Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Is there a way of disabling controls from an expression?

Hugh Macdonald Jun 10, 2017 04:49PM CEST


I'm wanting to build a "Lock" button into my controls. I would like this button to, when toggled on, lock out a certain number of other controls. I was hoping for an "enabled" parameter on controls or something like that.

Is this possible?


Up 2 rated Down
Liine Support Jun 11, 2017 03:47PM CEST Liine Agent
Only way to do that is to bypass the MIDI/OSC mapping of built-in variables (x,y,z,.. etc) and build your desired logic with scripts or Custom MIDI. These, in turn, can check a "enabled" flag (that you create) before outputting data
Up 1 rated Down
Hugh Macdonald Jun 11, 2017 04:07PM CEST
I've come up with my own way to do this on a per-control basis.

I have a toggle button called "Lock"

For each control that I wanted to be lockable, I created a 'previousValue' variable (initialised to whatever the default value is). Each would then be given an "onPress" script, set to execute "On Expression" when x changes (in any direction). Here's the content of that script:

if ( previousValue != x )
if (Lock.x )
x = previousValue;
previousValue = x;

That works fine for toggle buttons. I had to change it slightly for faders so that the script runs "On Frame", otherwise I'd still get some modified values coming through OSC.

Buttons which are only there to run scripts, not send OSC values through, had a bit of extra script to stop them even lighting up when locked:

if ( Lock.x )
x = 0;
// Do script contents here

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found