Multipad-how to define each pad as a value in a script ??

Discuss Lemur and share techniques.
Post Reply
dburns
Newbie
Posts:25
Joined:14 Apr 2012 04:31
Multipad-how to define each pad as a value in a script ??

Post by dburns » 20 Apr 2016 19:43

Hi Guys,
I would like to use the pads in a multipad object to output an array of NRPN messages to Cubase for key commands.Each pad needs to have a unique value for the "nrpn_lsb_param" as listed below in my script.I am not sure how to convert the value of each pad into a value I can enter into the script.I know this should be easy,but I'm stumped.i have seen the singular multipad example,but can't make headway with it-i fear the scripting is beyond me.Any help appreciated.

here's my NRPN script so far---

decl target=0; // MIDI Target
decl chan = 16; // MIDI Chan

decl nrpn_msb = 99, nrpn_lsb = 98; // NRPN MSB - LSB universal values
decl data_msb = 6, data_lsb = 38; // DATA MSB - LSB universal values

decl nrpn_msb_param = 0; // msb range 0 to 127 defines the parameter MSB
decl nrpn_lsb_param = 0; // lsb range 0 to 127 defines the parameter LSB

decl value; // value of msg sent out,in this case it only needs to be a trigger

value= 127 ; // data nrpn course value
decl null=0; // data nrpn fine value not used left at zero

ctlout(target,nrpn_msb,nrpn_msb_param,chan);
ctlout(target,nrpn_lsb,nrpn_lsb_param,chan);
ctlout(target,data_msb,value,chan);
ctlout(target,data_lsb,null,chan);

dburns
Newbie
Posts:25
Joined:14 Apr 2012 04:31

Re: Multipad-how to define each pad as a value in a script ?

Post by dburns » 21 Apr 2016 15:35

Ok,I figured it out.I'm posting this here in case someone else wants to do this.i think my NRPN script is clear.The +1 in the nrpn_lsb_param line can be adjusted in case you need to start the first pad with a higher number.In this example "nrpn_pad.x" is the name of my multipad.

decl nrpn_lsb_param = firstof(nrpn_pad.x)!=sizeof(nrpn_pad.x)?firstof(nrpn_pad.x)+1:0

full script- (on expression x (rising from zero)

decl target=0; // MIDI Target
decl chan = 16; // MIDI Chan

decl nrpn_msb = 99, nrpn_lsb = 98; // NRPN MSB - LSB universal values
decl data_msb = 6, data_lsb = 38; // DATA MSB - LSB universal values

decl nrpn_msb_param = 0; // msb range 0 to 127 defines the parameter
decl nrpn_lsb_param = firstof(nrpn_pad.x)!=sizeof(nrpn_pad.x)?firstof(nrpn_pad.x)+1:0; // lsb range 0 to 127 variable
decl value; // value of msg sent out

value= 127; // value variable set to 127 as trigger or hi
decl null=0; // data nrpn fine value not used left at zero

ctlout(target,nrpn_msb,nrpn_msb_param,chan);
ctlout(target,nrpn_lsb,nrpn_lsb_param,chan);
ctlout(target,data_msb,value,chan);
ctlout(target,data_lsb,null,chan);


Maybe this will help someone else.Thanks to some other threads that had some script examples.

cheers,
David

dburns
Newbie
Posts:25
Joined:14 Apr 2012 04:31

Re: Multipad-how to define each pad as a value in a script ?

Post by dburns » 21 Apr 2016 19:50

So now the problem is that the midi message is not concatenated,so the Cubase generic remote recognizes the last entry sent while in "Learn" mode.Is there a way to concatenate the midi message in Lemur???

By the way,was able to get Arturia synths to work with a fader version of nrpn script non-concatenated as above.The reason I wanted to use NRPN's was to be able to expand my key commands .seeing as I would have no overlap with the standard midi cc's ,or notes required by the generic remote in Cubase.

frustrated.

Post Reply