Combining Play and Stop into one 1 button on your controller is a great space saving trick.
Why do they need to be separate anyway? lets see how this can be done with an Ableton Script built in Control Surface Studio.
Although they are separate mapping types in Control Surface Studio, its pretty simple to set play and stop to the same button.
There are a couple of ways that this can be achieved which we will go through below.
Method 1: reversing the on/off values in each mapping
This is the most simple method but note that it requires the button to be a toggle as it needs to send an On and Off velocity value on separate presses.
If you are using a momentary button/pad, either change it to a toggle via the midi controller’s own editor or see Method 2 below.
The way this works is to create a ‘play’ mapping type and a ‘stop’ mapping type.
You will need to then set the ‘play’ mapping to only fire when the midi controller button’s ‘On’ velocity value is sent, and the ‘stop’ mapping to only fire for its ‘Off’ velocity value.
Here’s how to do it…
In your ‘play’ mapping, change the ‘control’ option to custom, set ‘control type’ to on/off and make sure the ‘on’ value is set to the velocity value which sent by the physical button on the midi controller when you press it down.
For the off value, set it to a value other than the button’s ‘off’ velocity value, this will prevent the play mapping from firing when the ‘off’ value is received.
The settings should look something like this:
For the ‘stop’ mapping, do the same as above (change the ‘control’ option to custom, set ‘control type’ to on/off),
but this time, you’re going to set the ‘On’ value to the physical button’s ‘off’ velocity value, meaning the velocity value which the button sends when you release it (which is usually 0 for buttons).
This tells the ‘stop’ mapping to only fire when it receives 0 from the button, essentially reversing your button’s functionality for this 1 mapping only.
Finally, just like you did with the ‘play’ mapping, you now just need to set the ‘stop’ mapping’s ‘Off’ value to any velocity value which the button doesn’t send when pressed or released (for buttons this can usually be anything other than 127 or 0).
Your ‘stop’ mapping should look something like this:
Method 2: Using Reactions to alternate between Start & Stop
You can also use the ‘Reaction’ mapping type you can also achieve this.
Reactions are a lot more flexible, allowing you to use momentary or toggle type buttons to achieve similar functionality as in method 1.
But rather than tying the ‘play’ and ‘stop’ functionality to the button’s on/off values, for this method when we press our button we will be creating some basic functionality which tells the script:
1. If playback is active then stop playback
Or
2. If playback is stopped then start playback.
This logic will cause the script to alternate between play and stop on each press of your button, regardless of the velocity being sent.
Add a new ‘Reaction’ mapping type and set the listener to the button which you want to use:
In the first Action block,
add a condition which contains the following settings:
‘Song – is playing’ (Live Object Model > Song > is playing)
‘Is equal to’
‘True’
This is effectively checking “If the song is playing”
Then in the Action section below, select the action:
Live Object Model > Song > stop playing
And then add second action below it which exits the Reaction at this point.
Script > Exit Reaction Here
That covers the functionality for ‘stop playback if it is playing’, so now we just need to do the reverse ‘start playback if it is stopped’.
So to do that, you can simply duplicate the first Action block, then scroll down to the new version which will be below.
In the condition, change ‘True’ to ‘False’
And then select the action ‘start playing’ (Live Object Model > Song > start playing)
And that’s it! now you just need to click save and generate the script into Ableton Live.
I have attached the script json file below which contains examples of both methods in this tutorial.
You can download and import it into your CSS App and then you can simply copy it over to your script. All you need to do then is select the button you want to use in each mapping.
Bonus: Continue playing from where you stopped
If you would prefer that playback continues from where it stopped rather than reseting back to the beginning, you can use the ‘continue playing’ option rather than ‘start playing’ in the ‘start playback’ reaction.
(Live Object Model > Song > Continue playing)