Any way to operate Switches in "momentary" mode?

Discuss Lemur and share techniques.
Post Reply
rgames
Newbie
Posts:20
Joined:22 Dec 2015 22:43
Any way to operate Switches in "momentary" mode?

Post by rgames » 23 Dec 2015 05:54

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.

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

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

Post by schoko » 23 Dec 2015 09:27

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

rgames
Newbie
Posts:20
Joined:22 Dec 2015 22:43

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

Post by rgames » 24 Dec 2015 00:57

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

ndivuyo
Regular
Posts:279
Joined:23 May 2014 00:24

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

Post by ndivuyo » 24 Dec 2015 05:59

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.

rgames
Newbie
Posts:20
Joined:22 Dec 2015 22:43

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

Post by rgames » 24 Dec 2015 17:17

Yep - got it to work by adding noteout() with velocity = 0.

Thanks!

rgames

Post Reply