Jump to content


Photo

Creating Duplex configuration for Akai APC Mini controller


  • Please log in to reply
12 replies to this topic

#1 genesis06

genesis06

    Member

  • Normal Members
  • PipPip
  • 19 posts

Posted 18 November 2014 - 21:57

I am trying to setup Duplex to work with Akai APC MIni device controller.

So far I have created lua and xml files and get APC mini controller fader and button working (mixer application). OK.

I have define a Mute button (pushbutton) and solo buttons

When I first press let's say a "mute" button, the button turns green on the apc mini and the track is muted. fine

problem is when I press the same button a second time to "unmute" the track, the track is unmuted in renoise but the button stays green.

 

I have used APC20 existing lua file to create a APCtest class. I think the problem is there, somewhere in the functions.... but I don't understand the colorspace principle and I don't have any ideas of what shoud be the APC Mini controller incoming midi messages

here is my APCtest.lua and APCtest.xml files (controlmaps and configurations)

Any help would be very welcome :)

 

Thanks

Attached Files



#2 genesis06

genesis06

    Member

  • Normal Members
  • PipPip
  • 19 posts

Posted 19 November 2014 - 14:28

I have found a discussion on qlc light controller plus forum concerning the akai apc mini.

 

http://sourceforge.n...hread/0b17a419/

 

seems that this unit needs a value greater than 0 to trigger the LED output.

I think the APCtest.lua file needs to adapt the "class" and function definition to send 1 instead of 0 when status is "OFF", does anyone knows how to do that ?

I am going to test de apc mini lights playing with qlc light controller plus... will update later



#3 genesis06

genesis06

    Member

  • Normal Members
  • PipPip
  • 19 posts

Posted 19 November 2014 - 15:28

I used midimon to monitor outgoing midi messages from the akai apc mini when pressing a button and answer from duplex :

pressing a button on the apcmini sends : Note on  |  C- 1 | 127

releasing the same button on the apc sends : Note off | C -1  | 127

 

answer from duplex :

first press : Note on | C -1 | 127

second press : Note Off | C -1 | 0

 

what midi message should be send to the apcmini to turn off the led on "note off with 0 velocity value" ?



#4 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6361 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 19 November 2014 - 16:15

Hi, I just had a quick look at the existing APC configuration

 

First thing I notice is that the solo and mute buttons does not seem to light up in the most recent version of Duplex. 

(using the on-screen, virtual version as I don't have an actual physical APC, mini or otherwise, around) 

I just checked with v0.99.1 and there, it works.

 

My guess is that recent changes to the "colorspace" might have the APC adversely affected

Will post something here as soon as I find out what is going on....


Tracking with Stuff. API wishlist | Soundcloud


#5 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6361 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 19 November 2014 - 18:01

Ah, from downloading the manual I now realize that the APC mini is a completely different product.

Somehow I though it would be like the Launchpad mini, a physically smaller version of the same thing. 

 

The APC 20/40 class you have copied will send a sysex command on startup, to initialize the controller

It's something called "mode 1", which enables the ability to receive messages from host. 

The QLC discussion you link to does mention a different sysex code but it doesn't seem to be documented by AKAI themselves. 

self:send_sysex_message(0x47 0x7F 0x28 0x60 0x00 0x04 0x41 0x09 0x01 0x04)

If you replace the sysex code with that, perhaps it will be able to receive messages? 

(sorry, I am fumbling a bit in the dark here :-) 


Tracking with Stuff. API wishlist | Soundcloud


#6 genesis06

genesis06

    Member

  • Normal Members
  • PipPip
  • 19 posts

Posted 19 November 2014 - 19:19

Thanks Danoise, I didn't mention this technical informations on the qlc forum.

It's a start.

in fact, I tried this sysex message to initialize device in mode 0, mode 1, and mode 2 (0x40, 0x41 and 0x42), but did'nt notice any changes

I don't think the problem is linked to the colorspace, I think (but might be wrong), the problem is related to midi message sends from Duplex that are not compatible with this device.

I opened a ticket on the Akai forum and asked them to provide a "communication protocol" document for the APC Mini.... Not sure I will get it !!!

Still trying to make this device working with renoise

perhaps I should try with a mid/osc bridge ?



#7 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6361 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 19 November 2014 - 19:41

If we're missing the technical documentation, the way forward would be to reduce everything to the most simple possible. 

Getting it to work in Duplex is obviously the goal, but we might need something more straightforward in order to reverse-engineer this thing. 

 

Maybe a few snippets of lua code, just to send the sysex and sending messages to the device. 

 

I will come up with something, and then you can test, play around with it? 


Tracking with Stuff. API wishlist | Soundcloud


#8 genesis06

genesis06

    Member

  • Normal Members
  • PipPip
  • 19 posts

Posted 19 November 2014 - 21:32

already get a sysex from the device using amidi

here is the answer I got from the APC MIni :

B0 36 69
F0 7E 00 06 02 47 28 00 19 01 00 00 00 7F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 F7

 

That where I get the product ID (28)

device ID should be 7F if I'm right...

Is anything relevant in this informations ?



#9 genesis06

genesis06

    Member

  • Normal Members
  • PipPip
  • 19 posts

Posted 20 November 2014 - 01:19

got something !!!

I add this function in the APCtest.lua main configuration file (get it from the MidiDevice.lua)

function APCtest:send_note_message(key,velocity,channel)

  if (not self.midi_out or not self.midi_out.is_open) then
    return
  end

  key = math.floor(key)
  velocity = math.floor(velocity)
  
  local message = {nil, key, velocity}
  
  if not channel then
    channel = self.default_midi_channel
  end

    message[1] = 0x8F+channel -- note-on
  
  TRACE(("MidiDevice: %s send MIDI %X %X %X"):format(
    self.port_out, message[1], message[2], message[3]))
    
  if(self.dump_midi)then
    LOG(("MidiDevice: %s send MIDI %X %X %X"):format(
      self.port_out, message[1], message[2], message[3]))
  end

  self.midi_out:send(message) 
end

I simply delete the test on velocity 0 and note on

And it's working !! the led correctly turn to green when I press the button and then turn back off when I press it again (like mute/unmute)

Now I need to understand the "colorspace" concept so that I can use all 3 colors for my device (green red and yellow), also would like to setup the recorder and to be able to flash (yellow) a button when counting down before starting recording....



#10 habbadabba

habbadabba

    New Member

  • Normal Members
  • Pip
  • 1 posts

Posted 25 May 2017 - 04:28

Did this project ever complete? I'm new to renoise and thinking about getting an akai apc mini for using with duplex, but I don't think there is a template for it built in to duplex yet.



#11 Psychometric

Psychometric

    New Member

  • Normal Members
  • Pip
  • 4 posts
  • Gender:Male
  • Location:Glasgow, Scotland
  • Interests:Music, Gaming, Art, Design, Creating things

Posted 13 September 2017 - 21:30

Would be really interested to know if this ever got anywhere as well as I have one of these on the way and would like to use it in a Renoise live setup. Anyone ever get one of these working?

#12 Psychometric

Psychometric

    New Member

  • Normal Members
  • Pip
  • 4 posts
  • Gender:Male
  • Location:Glasgow, Scotland
  • Interests:Music, Gaming, Art, Design, Creating things

Posted 17 September 2017 - 13:48

Just in case anyone was still following this, I managed to get a GridPie layout just about working, with colours working as expected on the device.

 

https://github.com/K...duplex-apc-mini

 

Haven't assigned all the buttons yet but the main button grid is set up for GridPie, the Mixer that genesis06 made is still set up on the sliders, and the arrow buttons are set up for GridPie pattern and track navigation. 

 

I tried assigning a Navigator to the Scene Launch column at the right but the colours don't seem to want to cooperate over there for some reason. Probably something I've done wrong. 

 

 

EDIT: Thanks to genesis06 for providing the starting point for all this, I doubt I'd have got very far without the code you put up here.


Edited by Psychometric, 17 September 2017 - 13:50.


#13 stevensrmiller

stevensrmiller

    New Member

  • Normal Members
  • Pip
  • 1 posts
  • Gender:Male
  • Location:Atlantic Coast, USA
  • Interests:MIDI, Theatrical tech, C#

Posted 18 September 2017 - 19:41

Just in case anyone was still following this...

Heh, lucky break for me, as I just found this forum/topic for the first time today, searching for info on programming the APC Mini. Unlike some of their other products, Akai doesn't seem to want to put programming info up on their web site. So, people have had to resort to "cracking" the device.

 

Don't know if this will be of help to you or anyone else here (I'm not a Renoise user, at the moment), but my tests have indicated that you cannot send the Mini more than 128 MIDI status messages without giving the device 10ms to process them. If you do, nothing will happen on the Mini (that is, any lights you're trying to turn on or off won't change) until after you stop sending data, and only the first 128 messages you sent will take any effect. When you're talking about using it as a control pad for Ableton Live, or a DAW, that's probably not much of a restriction. But if you write code that (as mine did) might send multiple redundant messages rapidly, you can exceed that 128-message limit quite easily.

 

I haven't tested it yet, but I think a procedure like this will handle it:

if count = 128
	Sleep (Max(0, 10ms - timer))
	set count to zero

reset timer
increment count
send message 

Do you write code for the Mini? I'd be interested in comparing notes with anyone else who does.


Edited by stevensrmiller, 18 September 2017 - 19:44.