Script for Shift Key Function

Discuss Lemur and share techniques.
Post Reply
octobersongs
Newbie
Posts:16
Joined:21 May 2014 04:32
Script for Shift Key Function

Post by octobersongs » 13 Aug 2014 18:08

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

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Script for Shift Key Function

Post by Softcore » 19 Aug 2014 20:28

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.72KiB)Downloaded 83 times
scripted - CC 21, shift -> CC 22, Midi channel 1, target 0
shiftbutton-way2.jzml
(4.82KiB)Downloaded 72 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

octobersongs
Newbie
Posts:16
Joined:21 May 2014 04:32

Re: Script for Shift Key Function

Post by octobersongs » 01 Sep 2014 16:54

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

Softcore
Regular
Posts:1639
Joined:04 Nov 2012 08:34

Re: Script for Shift Key Function

Post by Softcore » 03 Sep 2014 18:04

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.
Last edited by Softcore on 05 Sep 2014 07:07, edited 1 time in total.

octobersongs
Newbie
Posts:16
Joined:21 May 2014 04:32

Re: Script for Shift Key Function

Post by octobersongs » 04 Sep 2014 03:06

Thanks again Softcore.

jc

Post Reply