NRPN Receive Issues
Posted: 23 Jan 2018 22:28
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
}
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
}