OK i have read through this entire thread now and there are some incredible gems of information in here if you've already done a weeks worth of research, but i've just stumbled through some quite large holes that are present that i discovered the other night.
So it seems that everyone has become scared of the Term Sys EX and that the shear mention of it makes people cower and revert to a work around away from it entirely. But without understanding a couple of basics surrounding the APC40 it will hinder and push you round in large circles that pretty much you don't need to dwell on. So there is a post way up near the top that metions the Sys EX of the handshake but DOES NOT actually list any numbers for HEX. this can be found admittedly on other sites where i got it from but it is not even mentioned that this pdf exists:
http://www.akaipro.com/extras/product/a ... _rev_1.pdf
which contains all the necessary information to understand the Sys EX information (except i have not found the SHIFT key string thus far).
Now the APC has 3 distinct states as observed above by some. When you turn it on it is in state 0, then ableton handshakes and it becomes State 1 and when live is turned off it is State 2 (this is known to some as DUMB MODE), from that link i give they are as follows:
Notes Regarding Generic Mode (Mode 0):
-[CLIP LAUNCH] buttons are momentary and should light the green LED when ON
-[CLIP STOP] buttons are momentary and should light its LED when ON
-[ACTIVATOR], [SOLO], [RECORD ARM] are toggle buttons and should light its LED when ON
-[TRACK SELECTION] buttons (1-8 + MASTER) are radio style and only one of the 9 buttons are ON at a
time. When ON its LED should light. These buttons will NOT send out MIDI in generic mode for its
state. These buttons dictate which one of nine banks the DEVICE CONTROL knobs and DEVICE
CONTROL switches belong to. These knobs and switches will output on a different MIDI channel
based on the current Track Selection (track 1 = MIDI channel 0, track 8 = MIDI channel 7, MASTER =
MIDI channel 8 ). Upon pressing one of the Track Selection buttons, the current position of the 8 APC40 COMMUNICATIONS PROTOCOL
Rev 1 – May 1, 2009 Page 7
Device Control knobs will be sent.
-[CLIP/TRACK (1)], [DEVICE ON/OFF (2)], [ (3)], [ (4)] will be toggle style and will light its LED when
ON
-[DETAIL VIEW (5)], [REC QUANTIZATION (6)], [MIDI OVERDUB (7)], [METRONOME (8)] will be
momentary style and will light its LED when ON
-[SCENE LAUNCH] and [STOP ALL CLIPS] buttons are momentary buttons and will light its LED when
ON
-TRACK CONTROL buttons are toggle buttons and will light its LED when ON
-TRACK CONTROL KNOBS and buttons are NOT banked in any way
-[PLAY], [STOP], [RECORD], [UP], [DOWN], [LEFT], [RIGHT], [SHIFT], [NUDGE+], [NUDGE-], [TAP
TEMPO] are momentary buttons
-LED rings are all set to SINGLE style
Notes Regarding Ableton Live Mode (Mode 1):
- All buttons are momentary buttons
- Device control knobs and buttons are not banked within the APC40
- LED Rings around the knobs are controlled by the APC40 but can be updated by the Host
- All other LEDs are controlled by the Host
Notes Regarding Alternate Ableton Live Mode (Mode 2):
- All buttons are momentary buttons
- Device control knobs and buttons are not banked within the APC40
- All LEDs are controlled by the Host
So These 3 states are controlled internally on the APC by SYS EX message sent by LIVE or not.
I have successfully created 2 buttons on the APC to send these strings back to the APC and thus change it's state internally with very little code involved. This then acts to prevent live from listening to anything that is controlled by the Banks internally held by the APC, and thus knobs twist in Traktor but not in Ableton, i then switch back to ableton and they perform as normal except Traktor also hears this state as it is also on Midi Channel 1. The String relevant is F0 47 00 73 60 00 04
40 08 02 05 F7
40 in bold represents the APC State in this case should be State 0 = Banks (can have value of 41 or 42)
and the 08 02 05 are the version number of Live you are using in Hex i am on 8.2.5 change as you will (this did still work for me when it was set to 8.1.1 but i have changed it since i understood it's meaning)
basically so you understand i have this function on both the note on and note off separately for the buttons i use, i use 2 seperate buttons for this namely the Track 7 Solo/Cue (ableton) and Activator (Traktor) buttons
Testing sys ex.bmtp is simply this button setup only, so you may see how it works it can be easily merged to your own projects as it contains nothing that blanks or otherwise only the commands associated with those buttons, no shift modifier is required and LED feedback works between button swaps. it isn't clean as when ableton preset is selected Solo/Cue is also pushed for Track 7 in ableton and cannot be deselected without 1st reselecting traktor and then back again.
The other strange behaviour is that the Sys EX code is reversed for some reason and i had to rename the translators and presets accordingly so i did not get confused but if you look at the output strings 40 Ableton and 41 is Banks for Traktor? i do not know why but it works provided you get the handshake.
Testing Sysex global blank.bmtp is where i am at now with this where i have blanked Channel's 1-9 all LED's and messages inside the Traktor preset when this is activated if you have a full matrix of lights in ableton then pushing one button per row of buttons will turn off all lights in that row, also no midi will go to ableton nor traktor. then by selecting ableton preset and then hitting the Shift key to get it to send it's Sys EX data ableton will re-populate the matrix for you.
IF anyone knows this Sys EX string sent by Shift then i can send that from the ableton preset button and always return to LED feedback. Here is why i said at the beginning understand that Sys EX is your friend and abuse it's uses for less code headache.
The other thing i'm struggling with at the moment is the not isolating of the midi cables for traktor and ableton. i'm guessing i'm going down the right road here but i'd much rather use global commands than individuals so i think correct me if i'm wrong... i have blanked all CHannel 1-9 note cammands and LEDs on 'Preset default midi ports' but it stops both channels, have i messed up by sending to and from APC for the preset?
And to clear up the Track Selection messages as i can switch between APC modes, in Mode 0 (just turned on) the Track Selections send a number of CC values on their respective Channels so Track select 1 is B0 and 2 is B1 and so forth. The 2nd byte is the CC that they are affecting from 17 down to 10 in Hex, or CC23 to 16 (your 8 knobs). The Led ring then is the 3rd byte and the channels 1-9 (master) velocities based on what is actually stored inside the APC and therefore whatever Traktor would have been left at in my case.
In MODES 1 & 2 only a simple note on and off message is sent by the APC so inside ableton with handshake active and no SYS EX to tell APC to be in MODE 0 then for traktor all you get is Note on/off messages to use and thus you have to write banks and blank cc messages and log the values of your LEDs and update them for the use of the Track selection buttons in Traktor.
i propose that you could by this then make the top 8 knobs also fall into the bank selection mode with Bomes by adding the B0-B8 suffix for CC's of the Track Control knobs under MODE 0.