Making 16 switches where only one switch is lit at a time

Discuss Lemur and share techniques.
Post Reply
crystaldrone
Newbie
Posts:20
Joined:05 Oct 2017 00:35
Making 16 switches where only one switch is lit at a time

Post by crystaldrone » 05 Oct 2017 02:21

Hello All,

I am very much a beginner at Lemur and scripting. I went htrough a few basic tutorials, but here is what I wanted to achieve for my setup -

16 switches sending 16 CC values (0,8,16,24,32..) of CC0 but with only the last pressed switch being lit. Having only one switch lit at a time. Is this something achievable with the pads?

I tried making columns out of a single switch, put the Radio option on, which works the way I want it on the interface, but I cannot seem to assign different CCs/values to the different columns in the editor. The whole switch with the columns gets selected when clicked.

So then I went on to successfully assign 16 switches to send 16 values, but now they all remain lit, until I press them again.

Can someone help me with this? Sorry for being such a noob.

Thanks!

schoko
Newbie
Posts:38
Joined:07 Feb 2015 17:54

Re: Making 16 switches where only one switch is lit at a tim

Post by schoko » 05 Oct 2017 15:40

hi

that is not a show stopper

you have allready switched to radio button mode
for a task like this you have to use "scripting output functions" , midiout (or ctlout?)
The name of the switcharray may be SWITCHARRAY

with "firstof(SWITCHARRAY.x)" you get 0 -> first button pressed, 1 -> second button pressed, etc...(assuming the script is under the buttons object)

under the object SWITCHARRAY you make a variable CCS with the cc values you want to send out (8 buttons = 8 values).
under the object SWITCHARRAY you make a script GETCC (on expression x)
-------
decl tempcc = getexpression(SWITCHARRAY,'CCS'[firstof(SWITCHARRAY.x)]; // get object CCS of container/object SWITCHARRAY at array position of the pressed "radio button"
decl tempcc1 = getexpression(getobject(),'CCS'[firstof(SWITCHARRAY.x)]; // selfreference to CCS object should be equal to the above

//then send it out (something like this)
-> midiout(0,{0xB0,tempcc1,127});
-----

hope this helps

crystaldrone
Newbie
Posts:20
Joined:05 Oct 2017 00:35

Re: Making 16 switches where only one switch is lit at a tim

Post by crystaldrone » 05 Oct 2017 18:48

Hi Schoko,

Thank you for your reply! Although I do need to know and understand scripting a little more to completely grasp what you are saying. Yup, that much of a noob :?

I did get some faders, pads setup by trying to edit, mix up various small scripts put up by some wonderful people on this forum. I got some working the way I want after editing, some I just can't.

Will keep experimenting and try to understand.

Thanks again!

Post Reply