• Home
  • /
  • Blog
  • /
  • Turn an LED on/off using position of Ableton’s master volume

Turn an LED on/off using position of Ableton’s master volume

Whether you’re performing in front of a crowd or practicing at home, being able to quickly see the current status of an Ableton Live parameter directly on your MIDI Controller is a great way to keep you in the zone and avoids the need to constantly switch over to your laptop screen and start clicking around.

Which leads us onto this question from one of our users: mamajuana.

“I want that the led color of one button changes depending on the master track input. Example.. if the master track volume is over 25 % it turns on. do you have any clue how can i do it?”

Although this question is specific to mamajuana’s own workflow, it’s a great example of ways you can customise your own immersion within the performance and also just a brilliant way to keep on top of everything that’s going on in Live at any one time.

Plus, this technique isn’t limited to just the master volume, it can be used for pretty much any parameter you can think of in Live. Track volume, sends, device paramaters, tempo etc… the list goes on!

diagram of master volume sending led on off to midi controller

Note: as it’s not possible to do this with Ableton live’s built in mapping mode alone, we will be using Control Surface Studio (version 2.5.2) to build the required functionality in a control surface script. If you’re totally new to Control Surface Studio we recommend going through our step by step guide where you’ll learn how to create midi controller templates and your own custom Ableton Live scripts.

In order to create this custom functionality, we will be using the ‘Reactions’ mapping type in Control Surface Studio. The reaction be configured to send custom LED feedback to our Midi controller whenever Ableton Live’s master track volume is moved above and below the 25% point on the fader range.

For the sake of the tutorial, we will be creating a new midi remote script containing only this functionality but you can of course add the functionality to an existing script if you already have one setup that you’d like to use.

Step 1: Create a new script containing a Reaction mapping

  1. Go to the Script manager and click the plus icon to add a new script and in the script settings form name it ‘Master Volume Feedback’. 
  2. Attach your controller template in the script settings. 
  3. Add a mode. 
  4. Click the mode plus button and add a ‘Reactions’ mapping type container
  5. Name the Reaction container ‘Mstr Vol Feedback’
  6. Select ‘1’ child Reaction inside it.
  7. Click on the child Reaction’s edit icon,
  8. rename it ‘Turn LED on’
  9. In the listener section select ‘Track Volume from the menu. Using this listener means the Reaction will run whenever any volume fader moves inside Ableton Live’s ui (this includes using an external midi controller to control a volume fader). 
  10. Delete the automatically added condition from the conditions section.
reaction setting

With the basic script and mapping in place, next we need to know what values the volume fader actually outputs when it moves. This will be needed in Step 3 for setting our reaction to send LED feedback when the value is within a certain range.

Step 2: Find out what values the master volume sends

  1. Add a ‘log message’ reaction setting in the ‘reaction’ section
  2. Leave the first text input blank
  3. The second menu should have () selected
  4. The third menu has ‘Input’ selected
  5. In the last text input insert the following string which will output the current value of the master volume: self.song().master_track.mixer_device.volume.value 
  6. Click the script ‘install’ button to install the script in Ableton Live
  7. Open Ableton Live
  8. Go to the preferences > Midi Tab and connect the ‘Master Volume Feedback’ script to your midi controller. 
log message to ableton live's log text file

With step 2 done, whenever you move the master volume fader in Live the master volume’s current value will be output to Live’s log.txt file.
By moving the fader from top to bottom we can see that these range from 0.00 at the bottom of the fader range, to 1.00 at the top.
A simple calulation tells us we want the LED to turn on whenever the volume value goes over 0.25 and turn off when it is 0.25 and below.

Next we can go back our reaction and add a condition which will tell it to only run when the value of the master volume is greater then 0.25. 

Step 3: Add a condition to check value of the master volume 

  1. Add a condition to the reaction
  2. Select master track in the first menu
  3. input the following string in the second menu: .mixer_device.volume.value
  4. In the next menu select the greater than symbol >
  5. In the last menu select ‘Input’
  6. And then in the last text input box add the value 0.25

In the ‘Reactions’ area we’re also going to add a ‘Show Message’ setting. The Show Message setting outputs values directly in Live’s status bar (the long grey rectangle at the very bottom of Ableton Live’s interface).

The reason we used ‘log message’ before and not ‘show message’ is because you can’t output parameter values in the status bar, they need to be logged to the log.txt file. We’re going to output “on” in the status bar. This will save us needing to check the log.txt file all of the time.

displaying custom message in ableton live status bar

Step 4: Add a ‘show message’ reactions setting

  1. Add a new setting in the ‘Reactions’ section
  2. For the first menu select ‘show message’
  3. Leave the first text input box empty
  4. Select the parenthesis option () in the second menu
  5. Set the third menu to Input
  6. And in the last input box add: “on” (make sure to include the quotations or your script will error)
  7. Install this update and reload Live.

When you move the master volume above the 0.25 point, you’ll now see the word ‘on’ is displayed in the status area. We now need a second reaction which does pretty much the same thing as the first one, except that this one will check if the master volume is 0.25 and below.

Step 5: Duplicate the reaction for the ‘off’ state

  1. Click the reaction’s duplicate button
  2. Click the duplicated reaction’s settings icon and rename it to ‘Turn LED Off’
  3. Change the condition operator to use the ‘less than or equal to’ option: <=
  4. Change the last text input of the ‘Show Message’ from “on” to “off”. Remember to include the quotations. 
  5. Install this update and reload live.

When you move the master volume above and below the 0.25 point, the value being displayed in the status area will switch between off and on. This confirms that we have the correct reactions conditions in place. 

Now that we have everything working as it should, the final step is send LED velocity values to an input on your Midi Controller. 

Step 6: Add LED feedback to reactions

  1. Go back into your ‘Turn LED Off’ reaction and add a new setting in the ‘Reactions’ area. 
  2. From the first menu select the button which you want to send LED feedback to on the midi controller. 
  3. In the text input field after it add: .send_value
  4. Then choose the parentheis option ( ) from the second menu
  5. then ‘Input’ in the third menu
  6. And in the last text input box, simply add a zero: 0 (This is the velocity value which will be sent to the button on the controller). 
  7. Go into the ‘Turn LED On’ reaction and add the same Reactions setting as above except in the last text input box enter the value 127 which will turn the led on
  8. Install this update and reload live.
select a midi controller button to send led feedback to from ableton live

As you move the master volume above and below 0.25 point it will now send LED feedback to your midi controller, turning the selected button LED on and off.

Additional tweaks you could do for this

If the buttons on your controller are RGB LEDs instead of just turning the button LED on/off, you could instead display various colours at different points which the master volume is at. This can be done by adding extra reactions that send the required velocity values between 0 and 127. Doing this would give you an even more fine grained feedback as to where you Master Volume is currently at. For example you could change between 4 colurs when the volume is at 0, 0.25, 0.50, 0.75.
Or you could turn different completely different button LEDs on and off across your controller. The power is in your hands.

More details on using reactions for LED feedback in your scripts
Buy Control Surface Studio here

Ready to build your perfect
midi remote script?