Match Ableton Clip Color to reflect as LED state on MIDI Pads for Akai APC40 MK2

410 viewsCSS Feature Requests
0

A lot of use on the forum are asking for this feature. We want the Akai APC40 MK2 PADS to light up based on the clip color of the Ableton clip that gets loaded on that PAD.

why did you choose to only go with 3 states for LED feed back? what are you going to implement so that we have LED color matching to clip color on Ableton?

we bought and purchased CSS with the idea that MIDI Mapping would go by a lot faster with your tool you created, so far it’s been more of a hassle trying to get your program to work appropriately mainly because the APC40 has 3 modes like MCBeats has mentioned on multiple forum posts and responses.

MCBeats has even provided the solution to set the modes (giving us a template ready for you to update on your program so that it’s easier on the users to choose between modes (mode 0, 1, and 2).

admin Changed status to publish May 22, 2024
Attached Files:
0

I forgot I changed some stuff around before posting comment #5.

Instead of using modifiers m10 and m11 to store the colors dictionary and buttons list, i stored those inside Action Block 1 of the Reaction named “Set Button Colors to Clip Colors”. To edit the dictionary of colors and list of buttons, I’d suggest editing them inside software that can handle python code (I use Visual Studio Code myself) because Python relies heavily on indentation to work properly and it’s real finnicky inside these custom code boxes to handle that. An online python editor like this one should also work.

I also forgot to mention you should change the dimensions of your session box to your controller’s specifications.

The script will throw up errors when the list of buttons doesn’t contain enough buttons to match the clips inside the session box. The loops in the script loop through all tracks and scenes in the session box to check all the clips it contains. Then it sends velocity data to corresponding buttons. If there is no button to send that data to, it will cause an error, and I haven’t provided a failsafe for that. When I’ll revisit the code I’ll make it a little less prone to producing errors. For now, make sure you’ve got as much buttons as you have clips inside the session box.

admin Changed status to publish May 22, 2024
Attached Files:
0

I think, if you adjust the dictionary of colors and the list of buttons to your controller, you should in theory be able to get it working when you set it up like I did.

How the script is set up now, remember to arrange the buttons in lists of columns (like I did myself). There’s a picture of that list in comment #4.

If you have any trouble, let me now and I’ll try to help.

admin Changed status to publish May 22, 2024
Attached Files:
0

Hey Glenn,

Thanks for your work on this. Sounds like your trying to move on from this project, but could you let me know what i would have to modify in your script to implement this for a launchpad X? I’ve already created a sheet that relates ableton color index values to corresponding midi veloctiy for LEDs, so i know i would have to modify those.

Would there be anything else?

admin Changed status to publish May 22, 2024
Attached Files:
0

Here’s the current state of this project. I added a version for the APC40 MK2 (untested, because I don’t own the device) and a version for the MIDI Fighter Twister (tested).

What the script does in its current state:
– Sets button colors to Clip colors if the the Clip colors are made of “valid” color indices (i.e. color indices that have a velocity assigned to them). On invalid color index, a default “Off Color” will be assigned (in case of the APC40 that’s black, in case of the MFT that’s whatever Off Color has been installed in the first virtual bank using the MIDI Fighter Utility)
– Clip slots without a clip also get the default Off Color assigned.
– The updating of button colors happens when:
– the script is initialized
– a color index of a clip inside session box has changed
– the session box is moved

What the script does NOT do in its current state:
– It doesn’t work as expected when using the in-app Session Box mapping for more than just setting the boundaries of the session box (i.e. if you assign buttons or colors inside this Session Box mapping, my script won’t behave as we would want it to)
– Button colors aren’t updated if you change Clip colors indirectly (e.g. when you use the right-click option on a Track to change all its Clip’s colors into the Track’s color).
– There are probably a lot more ways this script doesn’t work in a useful way.

This comment by JohnC helped me find a way to make the colors on the controller adapt after a clip color was changed within the session box.

I’ll put this project on hold for now, as I’ve lost my interest in it a bit + it basically does what I set out to accomplish; it only doesn’t react well with extra stuff. I might return to it from an angle, by using the “user.py” custom coding method (which I just recently learned about).

I also think it might be possible to use Ableton’s colors on the APC40 via SysEx messages. SysEx is entirely new terrain for me which I want to explore on another controller first, one that I own: a Nektar Pacer. The Pacer doesn’t allow its colors to be changed using MIDI velocity but I’ve reached out to Nektar and they’ve sent me documents on its SysEx messages, which should be able to change the colors dynamically, using the “Send raw MIDI data” action. If this works, I’ll return to this project and I’ll try to make all 70 Clip colors appear on the APC40’s pads.

admin Changed status to publish May 22, 2024
0

A little update on the script. I’m in the process of writing code that should send velocities to the buttons on a controller based on a Clip’s color index. Because I don’t the AKAI controller OP mentioned, the script is set to work with the MIDI Fighter Twister at the moment (using Remotify’s template for the device).

I made a dictionary of colors and a list of buttons and assigned each to a modifier.

The color dictionary doesn’t contain all color indices. When a color index is not present, a standard velocity will be sent from key -1 in the dictionary. In this case key -1 refers to velocity 0, which produces whatever the Off color is that you’ve set for the corresponding button (using MIDI Fighter Utility). So it’s best to set all the Off colors for the buttons to Black.

Only the MIDI signals for the 1st virtual bank of the MFT are collected in the list.

The code runs through all tracks and scenes contained within the session box, checks each clip slot for a Clip. If it has a Clip with a valid index, it will produce the corresponding color on the device. If it has no Clip or a Clip with invalid index, it will produce the Off color (in this case). When the session box isn’t full of tracks or scenes, it will produce an indexError that invokes the exception, where also the Off collor will be assigned to the corresponding button.

The code runs from an Action within a Reaction.
I made one Reaction that invokes the code via button press (bottom right button).
I made another Reaction that invokes the code when initializing the script and when moving the session box.

There are a few hurdles I’m facing at the moment:
1. How can I make the colors reload after changing the color of a Clip inside the session box? I tried making the script add a Color Index listener to the currently highlighted clip(s) but that didn’t work out as I hoped it would.
2. What other changes does the script need to keep track of? I’m guessing changes in Track and Scene numbers. The addition and removal of clips within the session box. Are there more?

admin Changed status to publish May 22, 2024