NRPN Receive Issues

Discuss Lemur and share techniques.
Post Reply
RobGee
Newbie
Posts: 5
Joined: 10 Jul 2017 23:14

NRPN Receive Issues

Post by RobGee »

Hi,

I'm having an issue where NRPN values that are 128 apart and received back to Lemur from Cubase are controlling 2 values.

For example 216 would also control 88, 344 and 472 and so on..

It seems to be this line of the script that is causing issue where the multiple of 128 has be minused from the NRPN number as Lemur can't receive over 127 value via midi as shown here:-

else if(cc==0x26 && nrx_adx_l==nrpn_param-128) {

The full receive script is below and I've attached a couple of multiball controllers to highlight the issue. One of them is working with NRPN 88 and 89 values and the other is set to 88 and 216 to highlight the issue.

I have no knowledge or experience regarding scripting or programming and these have been hacked together after looking at others work such as Phil999 and analog604.

This problem is limiting me to 128 controllers before the need to allocate an extra midi channel, and therefore limiting to 2048 controls total.

Does anyone have any ideas?

Thanks

//This script listens for the CC's needed for a Non-Registered Parameter Number (NRPN) message
decl cc=MIDI_ARGS[0],v=MIDI_ARGS[1];

decl outputCHANNEL=0;
decl outputTARGET=0;
decl VALRES=16383;
decl nrpn_param=216;

if(cc==0x62) nrx_adx_l=v;//98 save until more info is received
else if(cc==0x63) nrx_adx_m=v;//99 save until more info is received
else if(cc==0x26 && nrx_adx_l==nrpn_param-128) {//38 val LSB
//IF the script reaches this point then we should have a full NRPN TARGET parameter and value to decode and use
nrx_v_l=v;
decl n=(nrx_adx_m<<7) | nrx_adx_l;//parameter number target
decl val=(nrx_v_m<<7) | nrx_v_l; //parameter value

//Assign Knob/Value with parameter target and value
y=val*(1/VALRES);//scale to internal value that knob can use: 0-1
supressReTx=1;//set a flag so knob/slider doesn't resend the value
}
else if(cc==0x06) {//val MSB
nrx_v_m=v;//save until LSB received
}
Attachments
Test.rar
(3.17 KiB) Downloaded 94 times
Phil999
Regular
Posts: 919
Joined: 11 Jan 2012 01:53

Re: NRPN Receive Issues

Post by Phil999 »

RobGee wrote: This problem is limiting me to 128 controllers before the need to allocate an extra midi channel, and therefore limiting to 2048 controls total.
can't help you I'm afraid, but what I remember is that I had to use a second MIDI channel after the 128 CC's of one MIDI channel were filled. I could prevented this by using note commands for switches (mute, solo, etc.) instead of CC commands, but still I had to go for an additional MIDI channel.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
RobGee
Newbie
Posts: 5
Joined: 10 Jul 2017 23:14

Re: NRPN Receive Issues

Post by RobGee »

Phil999 wrote:
RobGee wrote: This problem is limiting me to 128 controllers before the need to allocate an extra midi channel, and therefore limiting to 2048 controls total.
can't help you I'm afraid, but what I remember is that I had to use a second MIDI channel after the 128 CC's of one MIDI channel were filled. I could prevented this by using note commands for switches (mute, solo, etc.) instead of CC commands, but still I had to go for an additional MIDI channel.
Thanks for the reply Phil, that's what I was thinking. Just wondered if someone knows of a way to edit the script to avoid the need for this and allow the full 16834 NRPN addresses.
Post Reply