Hi, I’d like to ask if the Button in AbleSet can be configured to work as a toggle instead of momentary.
Right now it only behaves as momentary (active when pressed, inactive when released). Is there a way to make it stay on/off with each press?
Thanks!
Hey @GOODSHOW,
You can definitely make a button look and behave like a toggle by combining a toggle OSC command with a dynamic background color that reflects the current state.
The Loop Button preset in canvas is actually a great example of this:
- Button Type:
OSC
- OSC Command on Press:
/loop/toggle
- Background Color (Dynamic):
${osc("/setlist/loopEnabled") ? "blue-800" : "blue-950"}
Many OSC commands accept toggle as an argument (/mixer/click/mute toggle, /click/solo toggle, etc.), so you can apply the same pattern to mute, solo, recording, and similar.
If you want to toggle something that doesn’t have a built-in OSC state, set the Button Type to Script and use a Shared Variable instead:
setShared("myToggle", !shared("myToggle"));
And for the dynamic color:
${shared("myToggle") ? "green-600" : "green-950"}
You can see this in action with the mute button example in the official tutorial.
Let me know if that works on your end!
1 Like