Page 1 of 1

Script for Shift Key Function

Posted: 13 Aug 2014 18:08
by octobersongs
I have a button in Lemur (button A) that sends a specific midi cc# to Cubase. I want that button to send a different cc# if another button in Lemur (button B) is touched and held, like a "shift" modifier. I presume a script would be added to button A to get that to happen. What would that script be?

Thank you,
jc

Re: Script for Shift Key Function

Posted: 19 Aug 2014 20:28
by Softcore
There are two ways to achieve this - either via custom midi messages or via scripting

custom midi - CC 21, shift -> CC 22, Midi channel 1, target 0
shiftbutton-way1.jzml
(4.72 KiB) Downloaded 77 times
scripted - CC 21, shift -> CC 22, Midi channel 1, target 0
shiftbutton-way2.jzml
(4.82 KiB) Downloaded 66 times
To understand:

______________________

Code: Select all

if (x!=0) 
can also be written as

Code: Select all

if (x)
remember here that a buttons x can be either 0 (when released) or 1 when pressed. So if (button.x) essentially "checks" if the button is pressed - instead of typing the full

Code: Select all

if (button.x==1)
______________________

Code: Select all

if (a) b;
else c;
can also be written as:

Code: Select all

a?b:c

Re: Script for Shift Key Function

Posted: 01 Sep 2014 16:54
by octobersongs
Thank you Softcore. I used your first option, no scripting. Works beautifully.

Is the a source for learning more about scripting or the non-scripting methods you've shown here?

jc

Re: Script for Shift Key Function

Posted: 03 Sep 2014 18:04
by Softcore
Besides the Lemur manual my personal source has been the user library, downloading bits and pieces and analyzing how they work, and of course, the helpful guys here in the forum.

We have to understand, that esp in the case of scripting, so much is possible that no manual or webpage can cover all the posible senarios (or scripts lololol). Having a basic understanding of how things work in the scripts definitely helps, for example I remember when I first got Lemur reading all the manual but not necessarily trying to memorise every detail, BUT....When I wanted something done with scripts, in most of the cases, what I wanted to achieve would ring a bell on something I had read - a script command, or a specific built in function. So I would then search the manual for the specific passage and read more carefully. Another helpful thing is to be able to decipher what parts of OTHER templates may be of help to what you are after. For example if you are after some special midi keyboard, downloading what already in the user library as far as keys are concerned can help you see what others did and how and get more ideas for your own template.

Re: Script for Shift Key Function

Posted: 04 Sep 2014 03:06
by octobersongs
Thanks again Softcore.

jc