Your shopping cart is empty.

[solved] One button to play and stop

Submitted by przykuty on Mon, 10/14/2019 - 17:08
Pro User


is that possible to set play and stop to one button?
First touch for play, second for stop.

Topic Category: 

11 Responses


John C
Forum Admin

We have been asked how to do this quite a few times now, so I have written a tutorial on how to use a single button for play/stop.
You can find it here
There are a couple of ways it can be done which are covered in this tutorial.

Pro User

I have try with reaction attached below, no success.

upload files: 
Pro User

thank You so much for answer.
I have wrote post up before i have see Your post.
Will try everything from tutorial.

Pro User

I'm just dummy like fake button in Method 2, can't set play/stop on one button.
I have tried both methods.
For Method 1, Button I want to set for play/stop is set to On/Off on:127, off:0 - Toggle in Controller Manager.
All settings for play and stop set like in pictures attached in tutorial.
In my device (Launchkey mini MK3) setup for play button result is play only if button is press constantly, like shift metod for Mode Changeing.
If I delete stop button, songs start play for seetings on/off momentary On:127 Off:5
With stop button (On:0, Off:10, momentary) works like shift.
If I play the song with my mouse, Stop button (for the same button) works fine.
In second method, settings like on pictures (button in momentary mode) no result, but funny thing if I press fast button, sometimes start playing, and sometimes stop, so work, but it is randomly, and uncomfortable.
Maybe my device is a reason?

John C
Forum Admin

I think the pads on the Launchkey are probably momentary (doubt they are toggles) so you would need to use Reactions detailed in method 2 unless there is a way to change them to toggles in the hardware itself.
The best you will get out of method 1 is 'start playing' when you press and 'stop playing' when you release.

Method 2 should work for you though, did you download/import the completed script?

Pro User

No doubt, it is toggle.
Method 2 doesn't work.
And when I try to set my launchkey mini MK3 as Controller in script attached in tutorial, the error message occure:
"Check all 'Controller Input' selections in your Mappings!
This Controller is missing some Controller Inputs which your Script was using. The missing 'Controller Input' assignments have been reset."

I think that the fault is on device side, cos if I turn on MIDI Monitoring in CSS, after pushing any button, pad, or touching knob nombers in "Latest MIDI Message receive" going crazy, channel is set to 9 and value is changeing from 0 to
after pressing any button, pad, or touching knob, Value in "Latest MIDI Message receive" going crazy, channel is set to 9 and value is changing from 0 to correct number, but it doesnt remember it at all, so I can work only with MIDI monitoring off

John C
Forum Admin

The error message you mentioned means that you have mappings in your script which aren't assigned to any controls.
Make sure every mapping has a control selected for 'Controller Input'.
Also you screenshots has 'controller missing' error. Attach a controller to your script!

One thing to note, scripts created with version 2.5.2 (released today) no longer require dummy mappings to be added.

Pro User

I have the same situation on my script, or downloaded script.
The result is the same, music play only when play button is pressed, when release the button music is stopped

John C
Forum Admin


Ah yes that's right. Because its a momentary button you will need to add a second condition into each reaction which checks the current value of the button.

I have updated the tutorial above on how to do this and the script download at the bottom of the tutorial is also updated with the example which you can use.

Pro User

Thank You so much!!
with second condition, works perfectly
You are the greatest!

John C
Forum Admin

No problem :) glad to hear it worked!

One thing I forgot to mention, from CSS version 2.5.2+ the dummy mapping is no longer needed, reactions now add all required code for attaching to controller inputs.