Controls changing other controls

Similar to the active/inactive and variable control requests, but maybe a bit more general.

There are times I’d like to change the text of a control and the NRPN/CC number (and possibly the ranges) it is using based on the state of a different control element.
For example, The Micron has the option for filter 2 to either have an absolute frequency or an offset frequency based on the Filter 1 frequency. The Micron defines two separate NRPNs to adjust the absolute frequency and the offset frequency. To implement this currently, I need 3 controls - a pad to toggle between absolute and offset and then 2 separate frequency faders to adjust the two controls.

It would be great to have a single frequency control that has their info toggled based on the status of the pad.

Or is it possible to defined two faders in the same location and make one or the other visible based on the state of the pad?

1 Like

apparently there’s something called LUA that might be useful to implement this type of functionality. I need to track down the info/docs/examples and look into it.

1 Like

yes, I added the Lua script to handle situations like that. Doing such thing with JSON would be quite messy.

I spent some time on your Alesis Micron preset already and got familiar with it a bit. I will make a copy for myself and will try to add the Lua functions there for what you described and will share it with you. That could help to get you going faster…

Just to make sure… the Lua script extension docs are available at Preset Lua extension | Electra One Documentation.

Thanks. I will read it and work through some things here when I can.
I am familiar with scripting in general, having spent a couple years writing some templates for the Liine Lemur application running on my iPad. (and working as a programmer for too many years now).

It’s just a matter of learning the LUA syntax and figuring out the best way to apply it.

1 Like

So I’ve been playing around with LUA scripting and in general it is going well. However, I wanted to reach out to see if I’m missing something that would help me.

The goal – have two different controls (Control A and Control B) occupy the same slot (slot 1) and switch between them based on the status of a Pad Control C located in slot 12.

So, if the Pad is ‘on’, then Control A occupies slot 1 and if the Pad is ‘off’, Control B occupies slot 1.

My first thought was to define both controls in the same slot and make on visible and one hidden. That way, the Pad would simply toggle the visibility flag. This does not work - when you load the template to the E1, it moves the second control to the first free slot in the template.

OK, next thought - use Page 12 to hold hidden versions of Control A and Control B and then use control:setSlot() to move A or B into Slot 1 depending on the state of the Pad. This does not work since setSlot() is limited to only the 36 slots on the current page.

Third time - use things like getValues(), getValue(), getMessage() to save the current Control configuration and the use setValues(), setValue(), setMessage() to change them to the other Control definition. That does not work since there are no corresponding set…() methods available.

It looks like currently the only way to have two controls in the same space is to use an empty slot on the current page, hide the ‘other’ control and then when the Pad changes state, move/unhide, move/hide the two controls to swap locations.

Have I missed any options?

1 Like

This is the way I intended. I will check why the Control is moved to the next slot. Will let you know. I assume it might be done by the editor when the preset is sent to the controller.