Page 1 of 1

Any way to operate Switches in "momentary" mode?

Posted: 23 Dec 2015 05:54
by rgames
I'd like to use a Switches array for keyswitches - that way, I can see a visual indication of which switch is currently active and limit it to one among the array of buttons (as opposed to a Button where multiple buttons can be active).

However, my keyswitching in Cubase is getting confused because the Switches object doesn't send a note off value until the next switch is pressed.

Is there any way to make the Switches object send a note on followed by note off but keep the selected button illuminated until a different switch is pressed? In other words, I'd like to have a "momentary" function on the Switch object.

Thanks in advance,

rgames

EDIT: by the way, I'm brand-spanking new to Lemur but have written a lot of code.

Re: Any way to operate Switches in "momentary" mode?

Posted: 23 Dec 2015 09:27
by schoko
Hey,


should be no problem i think, you have to use the radio mode for the switches.
I don't tried this out but you have to send a noteoff via a "on expression x" script.

Which button is pressed ? -> firstof([switchname].x) (= 0,1,2,3..)
if firstof.. = 3 then do...
etc..

The noteoff has to be sent with the midiout (or even noteout is possible?) function.

hope that helps..
schoko

Re: Any way to operate Switches in "momentary" mode?

Posted: 24 Dec 2015 00:57
by rgames
Thanks - I might give that a shot.

The workaround I came up with was to place a button over each switch and use a script to illuminate the appropriate switch. So the button generates the MIDI data and the switch generates none. The button covers part of the switch so you wind up with an illuminated outline around the button - I kind of like the look!

That setup is kind of a hassle when I start copying it across all my keyswitch combos but it works and I have other stuff to figure out first :)

Thanks again.

Cheers,

rgames

Re: Any way to operate Switches in "momentary" mode?

Posted: 24 Dec 2015 05:59
by ndivuyo
Check out your available internal library of functions.
For MIDI note messages you can use [noteout(target, note, velocity, channel)]
Note off = 0 value for velocity
Add it in an event script when the x expression changes and you can manage all your note sending from there. Then just make sure you are not sending the x expression out as MIDI so it won't conflict (by unchecking the x expression box or just managing it's MIDI settings)

You can also create a custom MIDI expression as an alternative to [noteout()], I personally prefer noteout() though.

Re: Any way to operate Switches in "momentary" mode?

Posted: 24 Dec 2015 17:17
by rgames
Yep - got it to work by adding noteout() with velocity = 0.

Thanks!

rgames