APC 40 mkII LED feedback - GrandMA

Hello,

I am using an APC 40 mkII to send midi notes to Dot2 on pc and control lights.
I would like to know if it is possible to have:

  • Have different lights for each button depending on the color it is associated within Dot2. For example, the button turning my wash lights purple should also be purple on the APC 40.

  • The pad button light flashing when pressing this button. (Right now the button light up in green when it is pressed and doesn’t stay on)

  • Some buttons (the one directly above faders for example) only send midi every two presses. Can this be changed and always send a midi signal?

Clément.

Hi and welcome to the Bome Community!

Yes, this can be done, however since by default GrandMA2 does not send MIDI LED feedback, you will will either need to program it in with the SendNote command or Lua script in GrandMA 2.

You can set the the mode of either APC40 or APC40 MK2 from toggle to momentary, but you didn’t specify which model you have.

APC40 (1st gen)	F0 47 7F 73 60 00 04 41 08 01 01 F7 
APC40 MK2	F0 47 7f 29 60 00 04 42 09 07 01 f7 

	Modes	

0x40	Generic (Startup Default)	Track select Radio- Channel Toggle

0x41	Ableton Live (LED Ring Remote Controlled)	Momentary All

0x42	Alternate Ableton Live	Momentary All


Notes Regarding Ableton Live Mode (Mode 1):

- All buttons are momentary buttons.

- Device control knobs and buttons are not banked within the APC40 Mk2.

- 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 Mk2.

- All LEDs are controlled by the Host.


Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thank you.

I am using the APC mk2 and dot2 (really close to ma2 but a strip down version)
Will it still work?

Also, I am a newbie with all of this. This is the first time, I am using Bome midi.
Are there any tutorials I can follow so I reach my goal?
I don’t know how to send SendNote commands and where to change modes.

As far as I know. dot2 has more limitations such as only one MIDI channel and I’m not sure it supports either SendNote or LUA scripting.

This§ is a quick tutorial I put together for GrandMA2.

This is not a tutorial, yet just a silent demo of dot2 using a Mackie Controller.

We have a bunch of tutorials here that are more generic and tied to various MIDI translation functions.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thank you for your quick answer, looking at some of the tutorials I was able to completely map the APC40 MK2 to my DOT2 show file.

I think I successfully change the APC40 mk2 mode by just sending a raw midi message “F0 47 7F 29 60 00 04 41 08 02 01 F7” but I didn’t send “0x41”. Is it the correct way? If not, where should I send this command? It seems to work though.
I also had to change some midi notes since dot2 only supports 1 channel. I had to use two translators for each note to translate the ON (when we press the button) and OFF (when the button is released). It seems like a lot of lines, is there a less tedious way of doing that?

Now that the mapping is done, (some optimizations are probably needed) the second step would be to associate a color to each button. I managed to associate a color when the file is open but as soon as I press one button, it lights up in orange and when released it goes off.
I tried to use an indefinite timer with a very small repeat delay to check and correct the color every ms but this is very heavy for my computer and triggers all cues associated to a button with color inside dot2 every time the timer repeats. I have attached my file so you can check it if necessary.
How could I do that correctly?

The last thing I want to do, and probably a bit harder is that every time I press a button it flashes between its initial color and no color until I press it again or I press another button of the same group.
For example, buttons controlling the position of my movable lights are in the same group. If I press the up position, the button flashed. If I press this button again or the down position button (or any other button controlling position) the first one goes back to its original color and the second one flashes.
I am not sure if I was clear enough.
Could you guide me through this?

https://drive.google.com/file/d/1X9rG1gL77-_qQpabVjTZinfaoMK6lcZX/view?usp=sharing

Thank you!!

Hi,

Well this could help move you along better.

First I changed it so one translator handles all of the main matrix buttons to dot2. (2.0)

I have another translator to handle the state of the matrix buttons (2.1) Right now each
button is set to toggle it’s current state and set a refresh timer to update the LED’s (3.0)

I use a bitmap to determine the led state a bit of 1 is on and 0 is off. The global variable ga handles the bitmap for the first 32leds and gb for the remaining 8 leds.

As I said, I use a timer to refresh all of the LED states and the timer has rules to set the on/off colors for each led. Right now I only set the first 7 buttons to the initial state as you had them (3.1)

I have the 8 faders all handled by one translator using rules based on the incoming MIDI Channel

The master fader has it’s own translator

I have all 8 upper knobs handled by one translator

If you need something more detailed for programming the grouping, I can do this, however this would be a paid consulting engagement but maybe you could look at the rules and figure it out from here.

APC-40-dot2-sjc-2021-12-22.bmtp (4.9 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thank you Steve.

I am trying to understand your code.

In translate 2.0 and 2.1 I don’t understand how this code check for notes and channels:

// check for notes
rr=oo&224
if rr!=128 then exit rules, skip Outgoing Action
// check for MIDI CH 1
rr=0&15
if rr!=0 then exit rules, skip Outgoing Action

Also, in which translator can I change the color of each button LED? I thought it was in translator 3.0 but when I change the variables SS or VV inside the if lines, it doesn’t do anything.

Thank you!!

We OR the upper 4 bits of the status byte with 224 (0xe0). If it is a note-on 0x90 or note-off 0x80 then the results will be 0x80 (128) and we know it is a note message. If not we exit rules.

We then mask the the lower bits of the status byte.

It should read if rr=oo&0x15 and not rr=0&15

We check for MIDI CH 1 (value 0) and if it is not 0 we do nothing.

So effectively the rules are testing for note on or note off on MIDI CH1 and if ether condition is not true, we do nothing.

So just the one typo should fix it. Sorry!

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Oh the color changes for the LED’s are indeed on 3.0 the defaults are the first two.

// default values unless defined below
if rr==1 then ss=127
if rr==0 then vv=14

The rest are defined by note number. I only did it for 7 notes. Below is note 0

// on off values for specific leds
if pp==0 then ss=23
if pp==0 then vv=5

and then note 1

if pp==1 then ss=12
if pp==1 then vv=0

etc

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Hi Steve,

I try to take your file and modify it for my application. I was able to map everything but I am still facing some problems:

  • I have tried to map out the buttons below the matrix and above each fader (translators 2.2 and 2.3). It works but it seems that Bome sends a note ON but not a Note Off when I release the button. Why is that? Do I need to make 2 other translators with an Outgoing Note Off Midi message?
    I am not sure how you avoided that in for the Matrix buttons.

  • I assigned all LED colors in the matrix as I wanted to, but like previously, when I press one button it goes back to the default orange color. It seems like it was working in your file and now that I have added some translators, I cannot make it work.

  • I would like to make some buttons pulsing between two colors but I can only make them between 1 color and the default orange one. How do I change the default orange color to something else for each button.

  • How can I light up buttons below the matrix and above the faders?

As for the grouping, I think I will check if I need this or not when I finish programming this first part correctly.

You can find my file here: https://drive.google.com/file/d/1BSgbjq2AZOJiKnRje0nQzr_mpgt2xwxa/view?usp=sharing

Thank you and Merry Christmas!

Yes, that would work.

I used Raw MIDI and rules to handle both note-on and note off messages in the same translator. I think I explained that before.

It looks like the rules that I had in 2.0 and 2.1 wrong, you tried to correct but your correction was not right. It should work now.

You use a different MIDI channel to set a “secondary color” and the pulsing or blinking behavior. So for on you would send the 2 colors you want for on as follows (for blinking 50%)

90 01 23
9f 01 45

The above could be for on or off color. Say it is for on.

Then for off you could send

90 01 01
9f 01 7f

So essentially in translator 3.0 for each note, you will need to send both MIDI CH 1 (for primary color and MIDI CH 16 (for secondary color) for the states you want.

The blinking or pulsing behavior by channel is in a table in the APC40 MKI communications protocol guide that you can download from the AkaiPro web site.

The same strategy as I used with the matrix. Just different notes, different global variables, and different bit shifting math. The note numbers for each button are documented in the APC40MKII communication protocol. With simple on/off states, you can manage up to 32 leds with one global variable. Doing this is beyond the scope of free support but if you study the examples I provided, you should be able to do it.

You could use one global variable to handle the two row buttons below the matrix and the scene launch buttons (22 bits), and then another global variable to handle the 32 small buttons above the faders.
I would recommend you put each group and a different repeating timer for LED updating.

Yes, grouping is a bit more complex but easier if you use global variable bitmapping.

Here is the project file will corrected rules in translators 2.0 and 2.1

APC40 dot2 mapping-sjc-2021-12-24.bmtp (8.2 KB)

Merry Christmas!

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz