How to have a specific Velocity output from a Switch

Discuss problems and solutions.
Post Reply
D Junk
Newbie
Posts: 3
Joined: 12 Nov 2015 09:51

How to have a specific Velocity output from a Switch

Post 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. :)
MrCorba
Regular
Posts: 142
Joined: 02 Sep 2013 20:17
Location: Netherlands

Re: How to have a specific Velocity output from a Switch

Post 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
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
D Junk
Newbie
Posts: 3
Joined: 12 Nov 2015 09:51

Re: How to have a specific Velocity output from a Switch

Post 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. :)
ndivuyo
Regular
Posts: 278
Joined: 23 May 2014 00:24

Re: How to have a specific Velocity output from a Switch

Post 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
MrCorba
Regular
Posts: 142
Joined: 02 Sep 2013 20:17
Location: Netherlands

Re: How to have a specific Velocity output from a Switch

Post by MrCorba »

Wow, that IS way easier..... How did I miss that...
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
Post Reply