Page 1 of 1
How to have a specific Velocity output from a Switch
Posted: 12 Nov 2015 10:02
by D Junk
I'm really new to Lemur ( Using Android ) and have been struggling to grasp Scripting.
I'd like to set up a Switch to output specific velocities, e.g. one switch to output exclusively velocity 64 when pressed , another switch to output velocity 127 etc
I've tried a few of my own feeble scripting attempts, but can't seem to get anywhere.
Anybody care to show me the way.
Much appreciated.
Re: How to have a specific Velocity output from a Switch
Posted: 12 Nov 2015 11:42
by MrCorba
If you create a script set to On expression x, this script will check which button is pressed and send the midi message with the corresponding velocity. If you release a pad it sends out the midi note with velocity 0.
Code: Select all
decl size = getattribute(Pads,'row')*getattribute(Pads,'column');
if(firstof(x)!=size){ //firstof(x) is equal to size when no pads are pressed
decl vel = {0,64,127}; //Change this to all the velocities you want to send.
noteout(1,1,vel[firstof(x)],1); //noteout(target,note,vel,chan)
}else{
noteout(1,1,0,1);
}
Cheers
MrCorba
Re: How to have a specific Velocity output from a Switch
Posted: 12 Nov 2015 15:00
by D Junk
Thank you MrCorba.
Looking at the script, I doubt I would have gotten anywhere near that for quite some time.
I'll try and incorporate into my layout.
Thanks again.
Re: How to have a specific Velocity output from a Switch
Posted: 13 Nov 2015 04:35
by ndivuyo
Nice script Cobra.
I think it's easier to get the size with the sizeof the x array though than with the attribute functions.
decl size = sizeof(x);
Cuz I lazy
Re: How to have a specific Velocity output from a Switch
Posted: 13 Nov 2015 09:13
by MrCorba
Wow, that IS way easier..... How did I miss that...