🔥 Lifetime deal! Get Control Surface Studio for Just £67 👉 Click Here To Get It
Time left... mailtimers.com
⚠️ Lifetime licenses are ending soon, get yours before they're gone ⚠️
Your shopping cart is empty.

How to display Ableton track colors on MIDI controller pads?

Submitted by Stakker on Tue, 09/21/2021 - 07:56
Stakker
Control Surface Studio User

Hi,

Great to see 2.6 out of beta, thanks for keeping up the development!

Now with the new reactions working, is it possible to send the color of the track in Ableton to a controller RGB pad? I mean, pick up the color from Ableton, not write down manually a matching velocity value.

What I want to do is lay out all the tracks on my controller pads with their colors and then hit the pad to select the track. It is MUCH easier to select the right track when I can see the color. Counting tracks to find the right one from a bunch of identically colored ones is not really useful.

If it is possible now, I'd really appreciate some direction on how to do it... I've tried finding the functionality myself, but failed :-/

Cheers!

Topic Category: 

45 Responses

Comments

JohnC
Forum Admin
#1

Yes you can grab a track's color using the 'color index' value (which go from 0 - 69)
You can send this directly to your pad as the velocity value, but it would make more sense to map/convert it to the correct velocity value - which you setup in a Reaction.

If this would work for you, I can put a tutorial together on how to do it...

Stakker
Control Surface Studio User
#2

Awesome! So, I guess the color index is Ableton's own way of referring to the colors? I have no clue how to do the mapping, so a tutorial or instructions of any kind (doesn't have to be anything fancy) would be much appreciated indeed! Thank you :-)

JohnC
Forum Admin
#3

Attached to this post is a script (named: custom track colors) containing the completed reaction mappings which I’m going to explain in this tutorial.

Download and import it into Control Surface Studio, then you can drag and drop / duplicate them in your own script.

Overview of how this works:

  1. The Reaction ‘set pad 1 color’ listens for the color to be changed in track 1. When this happens, it saves the ‘color index’ value to modifier ‘m1’.
  2. The Reaction ‘Convert Track Color to Velocity Value’ listens for modifier m1 to be updated. Whenever m1 is updated, it checks the value of m1, and based on this value it sets modifier ‘m2’ to a certain velocity value.
  3. Reaction ‘set pad 1 color’ then sets the pad’s velocity value to the value of modifier ‘m2’

The track color index

Each option in Ableton Live’s track color selector has an assigned number from 0 to 69 (see the below image). These values are accessed using the track’s ‘color index’ (Live Object Model > Track > color index)

How pad LEDs work

To light up a pad’s LED, a MIDI velocity value is sent to it. The MIDI velocity range goes from 0 to 127. Each value in this range is used to display a specific color, for example, sending a velocity value of 50 to the pad will light the LED red. 

Keep in mind that every midi controller is different, the range of colors it’s LEDs can display and the velocity value used to display each color are specific to only that controller. 

So you will need a way to ‘map’ each color index value to a specific MIDI velocity value.

The ’Convert Track Color to Velocity Value’ reaction

Each Action block uses a condition to check the value of the m1 modifier, if the condition is met (for example: if ‘m1’ is equal to 14)  it saves the velocity value we want to send to the pad to modifier ‘m2’ (i.e. save 50 to modifier ‘m2’) and immediately exits the reaction at that point.

If the condition doesn’t find a match then it skips the action section and continues on to the next action block. This process continues until either a match is found or there are no more action blocks remaining to process in the reaction.

Abit of extra info about using conditions

You can of course set up the contents of your action blocks however you need.
The most simple way would be to have 69 action blocks, one for each ‘color index’ value. The chances are though, your pads aren’t capable of displaying 69 different colors, so you probably don’t need 69 Action blocks in the reaction.

Conditions are very versatile, allowing you to run your checks in many different ways. You can use multiple ‘and / or’ conditions in order to filter out exactly what you need.

In this case, adding to an action block multiple conditions which match many different color index values would result in the same pad color being displayed for various ‘color index’ values. If your pad can’t display all 69 colors then this would be a good solution.

Here's another way you can do it, check for a range of color index values such as if the value of ‘m1’ is greater than 10 and less than 20.

You will notice that the last action block in this Reaction doesn’t have a condition. This is used to set the pad to a default color. If processing reaches this action block then it means there have been no matches, so this final action block acts as a fallback/default and will set the m2 modifier to the default value of 127.

The ‘set pad color’ reactions

In the example script is a reaction named ‘set pad 1 color’. You will need to copy/duplicate this reaction for each pad that you want to send LED feedback to.  

Rename it (i.e. set pad 2 color) and then set the ‘path menu’ to the correct track number in:

  1. the listeners section - Track’s color index value has changed
  2. in the action section - set the value of a modifier

You will also notice that the listeners section contains 2 other events, ‘script is initialised’ and ‘song’s tracks value has changed’. These are used to ensure that…

  1. the pad LEDs are configured when the script first loads
  2. the pad LED’s are re-configured whenever you move/add/remove tracks in your Ableton session.

And that’s all there is to it, if you also want to use your pad to select the track in Ableton, this can be done using the ‘track navigation’ mapping type or with reactions by using the action: script > set selected track.   

upload files: 
andyfavre
Control Surface Studio User
#4

Excellent. Thank you for the tutorial John.

Now how would you go about changing the color of each clip contained within the session box?

I've created a listener for "session box position changed" and I am able to retrieve the track offset and scene offset.
Now with this data, can I create a list of all the clips within the box and store their color index? The idea would be to then send it to the controller...
Or perhaps there's a better solution? How can I go about it?

I am using an APC40 MK2 and would like to emulate the same behavior as the original script and have the pads light up with the right color as I move the session box.

Thank you for your help!

Stakker
Control Surface Studio User
#5

Awesome! Thank you so much John, I appreciate the very detailed instructions.

Now I can finally put the Akai Fire that I bought specifically for this purpose to use :-)

Stakker
Control Surface Studio User
#6

Looks like Akai Fire uses Sysex to change the RGB pads... I'm guessing Remotify doesn't send Sysex ATM?

But I did verify that the script works by making it do other things, so that is excellent :-)

I might try setting it up on my Launchpad (in two rows to get more than 8 tracks). Or make it change my MIDI Fighter Twister RGB LED colors (selected track macros), if that is actually possible with the Twister.

JohnC
Forum Admin
#7

Yes Control Surface Studio now has the ability to send Sysex using the action 'script > send raw MIDI data to controller'
send sysex to midi controller
In this option you can enter sysex. It will require abit of investigation but another user was able to send track names to their controller's LED display 
using the following code:
tuple([240, 126, 0] + [ord(c) for c in self.song().view.selected_track.name] + [247])

JohnC
Forum Admin
#8

The example code in my previous comment is for doing something abit more dynamic.
If you want to send a specific sysex message to your controller, you should be able to simply enter it similar to this...
F0 41 10 42 12 40007F 00 41 F7

You would just need to find out what the sysex messages are for your controller.

Stakker
Control Surface Studio User
#9

Ahh nice! I found somebody had decoded the Akai Fire MIDI implementation (here: https://blog.segger.com/decoding-the-akai-fire-part-2/), so I actually tried that "send raw data" option, but didn't get it to work... I'll give it another shot, maybe I just had something wrong there. I tried sending "F0 47 7F 43 65 00 04 23 00 00 7F F7", as written the article.

JohnC
Forum Admin
#10

Hmm, try also wrapping it in brackets like this (F0 47 7F 43 65 00 04 23 00 00 7F F7)

upload files: 
Stakker
Control Surface Studio User
#11

Ok, I'll ry that, but hmm... I noticed at some point that I had an older version of Live in the CSS settings. After changing it to the current one (11.0.11), the installed scripts are not visible in the Ableton Preferences / Control Surface pull-down anymore. I checked that they are actually installed into the right folder, but for some reason Ableton doesn't see them?

JohnC
Forum Admin
#12

Do you have any errors in the CSS log?

Stakker
Control Surface Studio User
#13

Yeah I do get plenty when I start up the app — attached.

upload files: 
Robstaaaaa
Control Surface Studio User
#14

Same here, just posted in another thread here in the forum, but as it seems related I also update it here in this thread:

I have a similar midi command here and get the same syntax errors. Wrapping it in additional brackets does not solve it either.

Any advise on how to fix the syntax?

Robstaaaaa
Control Surface Studio User
#15

Found a cumbersome solution, but it works:

Just translate each individual element from HEX to DEC and it will work.

In my case what I want to send is: (F0,00,20,6B,7F,42,05,01,F7)
Instead I now send the same in Decimal: (240,0,32,107,127,66,5,1,247) and this works.

JohnC
Forum Admin
#16

Thanks Robstaaaa,
Stakker - if you look at Robstaaa's comment, he has a comma between each i.e. 240,0,32,...
Where as the errors in the log file which you provided show that the commas are missing - self._send_midi(F0 47 7F 43 65 00 04 23 00 00 7F F7)

So try adding them in to match like this - self._send_midi(F0,47,7F,43,65,00,04,23,00,00,7F,F7)

JohnC
Forum Admin
#17

... oh but you will need to convert it to decimal (as mentioned above)

Stakker
Control Surface Studio User
#18

Nice thinking Robstaaaaa! This actually worked, I turned an Akai Fire pad blue \:-D/ Thank you both.

So I can now color the pads in a static color, which is useful. However, in order to make the pad match the track color, I need to write the RGB values into that sysex command. Probably can't do direct conversion (?), but I'll have to investigate if there's a way to maybe do a couple of manual if-then sysex commands for the track colors I actually use. Or something like that :-)

Stakker
Control Surface Studio User
#19

Since Akai Fire is a bit difficult, I turned my attention back to my trusty Midi Fighter Twister. Thanks to John's examples, I can grab the color from the selected track and translate it to velocity and send it to a knob LED to indicate which track is selected.

However, the MFT LEDs listen for color input on MIDI channel 2... Is it possible to change the channel where I send the velocity CC for this purpose?

JohnC
Forum Admin
#20

You would need to add separate controls in the controller template which have the correct midi data (maybe use 'LED Display' controls) , then you can select it and send MIDI velocity to it.

Stakker
Control Surface Studio User
#21

Thanks John!

I can't add a new controller though, because the knob button actually also uses channel 2 (which creates a clash). But I believe it will work if I just change the button controller into a knob controller. Then I can send it velocity data and CC 0 and 127 should still let it function as a button. (The MFT manual seems to confirm this.)

However, I haven't figured out how to make a listener that activates when a new track is selected... I tried a listener that listens to the selected track's color index being changed (self.song().view.selected_track.add_color_index_listener), but it doesn't run the action block when I select a new track. (I verified it with a debug message action, so there's no error in the action block.)

I'm guessing there is a way to make a listener listen to this?

JohnC
Forum Admin
#22

Maybe you're looking in the wrong place, it's actually in the 'song' category.
live object model > song > selected track has changed

Stakker
Control Surface Studio User
#23

It actually works! \:-D/

This is awesome - now I can see which track is selected from the color of the MFT leds without looking at the screen. A bit of work to add all the track colors there, but that's a small price to pay to get this killer controller setup working :-)

Thank you so much for the help and happy holidays!

NicolĂĄs Vandendries
Control Surface Studio User
#24

Helllo everyone

I have a question

I hope that just you can tell me if what I want to do is possible

I've learned a little about how the program works now

And I can manage with the midi fighter twister

But I also have an apc 40 mkII and I have a question because i try with the manual and the videos but i dont find the solution to my problem.

I use the lighted pad's of the grid to mute and demute all kind of bus and tracks and it works very well

But the pads only have a choice of colour orange when on and no light when off

I would like to be able to choose the colour of the pad when the track that corresponds to it is muted or not

But I don't understand how I can do it

Can you please tell me how to do this?

Maybe with the reaction thing i imagine. .... i ve try but no succes

That would be great

And if it's not possible I'd rather know so as not to lose too much time

Thanks to you all

Nico

NicolĂĄs Vandendries
Control Surface Studio User
#25

Hey

I finally found how to change the pad colour ..... but its attach to the number of the track. ... right ??? But if i add after some track evrerything change and its not possible to manage. .... is there a way to block those assignations ?? Or maybe another way to do what i need .... thanks for your help ;-). Nico

NicolĂĄs Vandendries
Control Surface Studio User
#26

Finally i think its not going possible to lock the thing on certain tracks ..... anyway ;-) .... i change the way im gonna work Im gonna use fixed track to apply color and it looks to work but i ve got one last problem. it look there is a conflict with the original session box. .... i mean led pad comportement follow nicely my mouse click but when i push the pad they no react ... and if again i click with the mouse it work. ... it work perfectly also when i deactivate the apc in midi preference but i need it for the 8 button followin the blue hand
Am i clear ?? Can someone have the solution ???
Again Thanks

Nico

Stakker
Control Surface Studio User
#27

I'm not sure I fully understand what you mean, but you can have 8 knobs always automatically control the 8 macros of the selected track, if that is what you need? (Or more than 8 in Ableton 11 now.) That's one of the things my script does.

About assigning pads to certain tracks... I THINK you can only refer to tracks by their number, so if you change the track order, the numbers change. But not sure about that.

NicolĂĄs Vandendries
Control Surface Studio User
#28

i confirm only by numbers. !!!!! I m gonna check you script. ..... then you find a way to reproduce the blue hand thing ?? cool

NicolĂĄs Vandendries
Control Surface Studio User
#29

Hey stakker Have you share your script. ..?? I Yes where. plz ??? If not can your share Blue hand tips ? :-)

Stakker
Control Surface Studio User
#30

Well, this script is for the Midi Fighter Twister (and still under construction), but feel free to check it out if you can learn something useful from it:
https://www.dropbox.com/s/0ulzekdffs1vzhc/stakkertwister_trackcolor.json...

"Selected Track -> Device 1 -> Parameter Bank 1" is the macro mapping part.

I'm not sure if I've even ever used the blue hand functionality, can't really say much about that :-)

JohnC
Forum Admin
#31

If you want to select / control track parameters by name (or anything other than the position number)
You will need to use reactions to find the correct track and then save its position number to a modifier.
It requires using a loops and modifiers in reactions.
These 2 tutorials cover both subjects:
Loops and lists: https://youtu.be/ZYzkH1_ZL6U
Modifiers: https://youtu.be/qXUmpnl1wps

picky-picasso
Pro User
#32

You can also very easily refer to tracks (I'm here because I'm looking for a fast way to color all the clips in a track) within the session box using their offset, like

self.song().tracks[self.get_sessbox_track_offset()]
self.song().tracks[self.get_sessbox_track_offset()+1]

for tracks 1 & 2 all the way through '+7' for the 8th track in a 8 track session box.

dok.ryconn
Control Surface Studio User
#33

I made this Ableton 11 Color Palette Chart - Attached for Reference.

Wim
Control Surface Studio User
#34

Thanks for sharing dok.ryconn!
I'm sure this reference will come in handy!

dok.ryconn
Control Surface Studio User
#35

Of course! here is a slightly updated version, I just segmented out the blues into 3 categories. (regular, light, and dark). This was helpful for me to keep my color mapping reactions organized for all the Launchpad Mini Mk3 LED colors (velocities) I am using in my script.

For what it's worth in this thread, I also attached an example script that elaborates on the included script from John's tutorial post above. The only difference in my attached script is that it will convert all 69 possible Ableton colors into 13 specific MIDI velocities (colors to send to the controller). This way, the controller LEDs will become the general color of the Ableton track color - no matter which of the 69 color options are selected in Ableton.

I know that this potential is mentioned in the tutorial but I just wanted to share the leg work for anyone who stumbles into this thread. Peace ya'll!

dok.ryconn
Control Surface Studio User
#36

I'm looking for some help if possible. I've been trying to make a Reaction for sending the track color to Pad 1 on my Launchpad Mini Mk3 whenever a clip exists and also remove the color from Pad 1 when the clip is deleted.

The problem is that the LED Feedback from the "Session Box" mapping is overriding my Reaction's pad color assignment. My Reaction works fine without a "Session Box" mapping but I need it to coexist with a Session Box mapping for clip launching.

The LED Feedback settings in the Session Box have been turned OFF for "Clip Stopped" but it seems to still be breaking my Reaction regardless.

Any advice would be greatly appreciated! Thank you!

dok.ryconn
Control Surface Studio User
#37

To clarify, the problem is that the Session Box is causing the pad color to dissapear from the first clip slot when I create another clip in a different clip slot. My Reaction works initially and will assign a color to the pad but as soon as I create another clip, the Session Box takes over the first clip and turns the color off.

trololololol
Control Surface Studio User
#38

Have you tried to set the colors in the session Box to "none"? Cant test if the color still gets overwritten..

dok.ryconn
Control Surface Studio User
#39

Hey, thanks for the reply!
I have set the Clip Stopped feedback for the Session Box to "None" but it seems like "None" still sends a velocity to the pads, turning the LED off/black/velocity 0. It is in fact, set to "None" and not "0".

I even tried turning all of the Session Box LED feedback drop-down options to "None" just in case something else was causing the issue but I think I might be out of luck due to the nature of how the Session Box mapping LED feedback acts unless there is an additional listener or condition I could use as a workaround.

trololololol
Control Surface Studio User
#40

Im sorry. You did that already.

trololololol
Control Surface Studio User
#41

I checked it and i got the same Issue.
I hope John sees this and checks if "none" means something.

dok.ryconn
Control Surface Studio User
#42

Thanks for checking it out, trolo. I found that if I randomly remove this line of code from the python script file, my pad color doesn't disappear as soon as I add another clip but if I play the clip and then stop it, the color goes away unfortunately. (I have no python skills at all but am desperately trying anything I can think of).
clip_slot.set_stopped_value(feedbackArr["ClipStopped"])

trololololol
Control Surface Studio User
#43

Ah this is a good idea. If you put your script here i help tinker around. I would need these features too for my scripts..

dok.ryconn
Control Surface Studio User
#44

The forum won't allow .py file extension uploads but I've attached my CSS script file (.json). I just opened the .py script file in a text editor from the MIDI Remote Scripts folder where CSS installs the script.: C:\ProgramData\Ableton\Live 11 Suite\Resources\MIDI Remote Scripts\css_launchify

Or if you would like to just download the python script, you can grab it from my google drive:
https://drive.google.com/file/d/1OWFYmC3gbAsbXP5OHN3rdJ28HRbnGzrx/view?u...

Thanks again!

upload files: 
weppingpresent
Control Surface Studio User
#45

Hello, I am fighting with this ..
I use an APC40 MKII and I'm trying to reproduce almost the same behavior as the original one (the differences are the faders having 85% max value and the top encoders modes).
I need the pads to behave as the stock APC40 scripts, with colors following the session box.

Is it possible at all with the current version of CSS ? I'm afraid we would need a ton of modifiers ..
If not, maybe someone has raw python I could add manually to my script ? Considering I know basically nothing about python, but I can deduct some stuff.

Please please implement this in the Session Box mapping, this is a must :)

Cheers

Attached is my script if needed (wip)

upload files: