General

Script for Shift Key Function

Started by octobersongs on .

Sign in or create an account to join the conversation.

5 posts

Topic starter
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
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

scripted - CC 21, shift -> CC 22, Midi channel 1, target 0
shiftbutton-way2.jzml

To understand:

______________________
if (x!=0) 
can also be written as
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
if (button.x==1)
______________________
if (a) b;
else c;
can also be written as:
a?b:c
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.