NRPN 14Bit Fader (working scrpit{barely})
Posted: 17 Jun 2012 18:24
*edit mistake on last line changed to value-127 to value-128*
First let me begin by I started with the scripts found on this post: http://liine.net/forum/viewtopic.php?f=25&t=649 So I cannot take credit for these next few lines. I too am working with a DSI (prophet 08 in particular), but my conundrum was having my Fader output all the values from 1 to 164. Lets take a look at the script:
decl target=1; // MIDI Target
decl nrpn_msb = 99, nrpn_lsb = 98; // NRPN MSB - LSB
decl data_msb = 6, data_lsb = 38; // DATA MSB - LSB
decl nrpn_param = 15;
decl null=0, value; //VARS
decl chan = 1; // MIDI Chan
value= Fader.x*164; // value * range
ctlout(target,nrpn_msb,null,chan); // CC: NRPN MSB
ctlout(target,nrpn_lsb,nrpn_param,chan); //CC: NRPN LSB
if(value<=127)ctlout(target,data_msb,null,chan); //CC: Data Entry MSB for 1st 7 bits or...
if(value>127)ctlout(target,data_msb,null+1,chan); //CC: Data Entry MSB for 2nd 7 bits
if(value<=127)ctlout(target,data_lsb,value,chan); //CC: Data Entry LSB for 1st 7 bits or...
if(value>127)ctlout(target,data_lsb,value-128,chan); //CC: Data Entry LSB for 2nd 7 bits
Which indeed outputs the following to the prophet 08:
B0 63 00 1 --- CC: NRPN MSB
B0 62 0F 1 --- CC: NRPN LSB
B0 06 00 1 --- CC: Data Entry MSB
B0 26 01 1 --- CC: Data Entry LSB
and onwards and upwards to 164.
So this is working 100%. After scouring these forums and the forums over at jazzmutant for the past two days and not finding the answers I was looking for... needless to say I am a happy camper. I am new to scripting but not with programming in general (CNC macro programming actually). To me it seems that there must be a more simple way to generate 14bit codes. If anyone knows of any tricks or tips, please share your thoughts below.
First let me begin by I started with the scripts found on this post: http://liine.net/forum/viewtopic.php?f=25&t=649 So I cannot take credit for these next few lines. I too am working with a DSI (prophet 08 in particular), but my conundrum was having my Fader output all the values from 1 to 164. Lets take a look at the script:
decl target=1; // MIDI Target
decl nrpn_msb = 99, nrpn_lsb = 98; // NRPN MSB - LSB
decl data_msb = 6, data_lsb = 38; // DATA MSB - LSB
decl nrpn_param = 15;
decl null=0, value; //VARS
decl chan = 1; // MIDI Chan
value= Fader.x*164; // value * range
ctlout(target,nrpn_msb,null,chan); // CC: NRPN MSB
ctlout(target,nrpn_lsb,nrpn_param,chan); //CC: NRPN LSB
if(value<=127)ctlout(target,data_msb,null,chan); //CC: Data Entry MSB for 1st 7 bits or...
if(value>127)ctlout(target,data_msb,null+1,chan); //CC: Data Entry MSB for 2nd 7 bits
if(value<=127)ctlout(target,data_lsb,value,chan); //CC: Data Entry LSB for 1st 7 bits or...
if(value>127)ctlout(target,data_lsb,value-128,chan); //CC: Data Entry LSB for 2nd 7 bits
Which indeed outputs the following to the prophet 08:
B0 63 00 1 --- CC: NRPN MSB
B0 62 0F 1 --- CC: NRPN LSB
B0 06 00 1 --- CC: Data Entry MSB
B0 26 01 1 --- CC: Data Entry LSB
and onwards and upwards to 164.
So this is working 100%. After scouring these forums and the forums over at jazzmutant for the past two days and not finding the answers I was looking for... needless to say I am a happy camper. I am new to scripting but not with programming in general (CNC macro programming actually). To me it seems that there must be a more simple way to generate 14bit codes. If anyone knows of any tricks or tips, please share your thoughts below.