Can encoders send NRPN values with inc/dec?

Hi,

in the user manual’s .NGC part, the EVENT_ENC intro section says, “An encoder can send and receive MIDI events. In ‘absolute mode’ it will handle a value internally, in incremental modes it will just send an inc/dec event and expects the handling of the resulting value at the host site.”,

However, in the possible enc_modes list, there is no enc_mode=relative, enc_mode=inc_dec or something, which would allow me to send NRPN value increment/decrement commands, instead of absolute values. If EVENT_ENC is type=NRPN, MIOS Studio shows that MBNG is sending the CCs for NRPN selection (98 and 99), and then the absolute value, but is there a way I can send CCs 96/97 for value increment/decrement with NRPNs, instead of absolute values?

Hi,

relative changes can be sent with the various relative value modes, example:

EVENT_ENC id= 1 type=NRPN chn= 1 nrpn=1 enc_mode=40Speed
EVENT_ENC id= 2 type=NRPN chn= 1 nrpn=2 enc_mode=40Speed
EVENT_ENC id= 3 type=NRPN chn= 1 nrpn=3 enc_mode=40Speed
EVENT_ENC id= 4 type=NRPN chn= 1 nrpn=4 enc_mode=40Speed

Aside from 40Speed, there is also 00Speed, Inc00Speed_Dec40Speed, Inc41_Dec3F, Inc01_Dec7F, Inc01_Dec41

These are all “relative values” (I guess that this is for what you asked for)

Sending different NRPN numbers would be possible with conditional events.

Best Regards, Thorsten.

This is an old thread, but because the original was by me and this is the exact same issue, I thought I’ll reply here (rather than make a new post and refer to this one).

Today I tried all these modes on my DSI Tetra, but they all change the target parameter between two values, rather than increment or decrement it by one step. to To try I put the _ enc_mode=xx _ in a line like this:

EVENT_ENC id=65  hw_id=1     label=“@(2:1:1)Frq1%B@(1:38:2)%03d”  type=NRPN  chn=12  nrpn=0

I’ve used my own Arduino-based controller to do it like this:

MIDI.sendControlChange(99, NRPN_MSB + MSB_modifier, sendCh);
MIDI.sendControlChange(98, NRPN_LSB, sendCh);
MIDI.sendControlChange(CC, 1, sendCh); // send increment or decrement value by 1

In other words, select the target NRPN, then use either CC96 or CC97 for increment or decrement by the given value (=1). Is this possible?

I don’t see the enc_mode parameter in the line. You have to set it to enc_mode=40Speed for example. All modes are listed on ucapps.de

I did try each encoder mode definition one after the other in the example line that I posted, even though the example line given above doesn’t include any particular _ enc_mode _ definition. Sorry for any confusion!

An example setup for this use case can be found here: https://github.com/midibox/mios32/blob/master/apps/controllers/midibox_ng_v1/cfg/tests/conev_1.ngc

# send CC#96 if value is incremented EVENT\_ENC id=2000 hw\_id=2000 enc\_mode=Inc01\_Dec7F if\_equal=0x01 type=CC cc=96 lcd\_pos=1:1:2 label="Enc INC" # send CC#97 if value is decremented EVENT\_ENC id=2001 hw\_id=2000 enc\_mode=Inc01\_Dec7F if\_equal=0x7f type=CC cc=97 lcd\_pos=1:1:2 label="Enc DEC"

Best Regards, Thorsten.

How to select the target NRPN to increment/decrement in that case? An event can’t be _ type=CC _ and _ type=NRPN _ simultaneously, and trying to use the same enc with different id’s to both select the target NRPN and then increment or decrement with CC96/97 it hasn’t worked in any of the combinations I tried.

Below one of the things I tried. Three absolute mode NRPN encoders (hw_id=2-4) and one (hw_id=1) where turning hw_id=1 only increments/decrements the most recent parameter, but doesn’t select any parameter on its own:

EVENT_ENC id=1   hw_id=1    label=“@(2:1:1)Attk "   range=0:0 type=NRPN  chn=12  nrpn=23
EVENT_ENC id=9   hw_id=1    label=”@(2:1:1)Attk "   enc_mode=Inc01_Dec7F  type=CC  cc=96  if_equal=0x01  chn=12
EVENT_ENC id=11  hw_id=1    label="@(2:1:1)Attk "   enc_mode=Inc01_Dec7F  type=CC  cc=97  if_equal=0x7f  chn=12

EVENT_ENC id=3   hw_id=2    label="@(2:6:1)Dcay "   range=0:127  type=NRPN  chn=12  nrpn=24

EVENT_ENC id=5   hw_id=3    label="@(2:11:1)Sust "  range=0:127  type=NRPN  chn=12  nrpn=25

EVENT_ENC id=7   hw_id=4    label="@(2:16:1)Rel  "  range=0:127  type=NRPN  chn=12  nrpn=26

(I also tried selecting the NRPN with CC98 and 99, but wasn’t successful.)

There is a trick which might help here: a SysEx stream can also send “common” events, which means: we can just put all CCs into a single String.

Example:

EVENT\_ENC id=1 hw\_id=1 label="@(2:1:1)Attk " enc\_mode=Inc01\_Dec7F if\_equal=0x01 type=SysEx stream="0xbb 99 0 98 23 96 1" EVENT\_ENC id=1 hw\_id=1 label="@(2:1:1)Attk " enc\_mode=Inc01\_Dec7F if\_equal=0x7f type=SysEx stream="0xbb 99 0 98 23 97 127"

Best Regards, Thorsten.

That’s it!! This works, with the small correction that the sent decrement value shouldn’t be 127, but 1 just like with the increment:

EVENT_ENC id=3   hw_id=2     label=“@(2:6:1)Dcay "  enc_mode=Inc01_Dec7F  if_equal=0x01  type=SysEx stream=“0xbb 99 0 98 24 96 1”
EVENT_ENC id=3   hw_id=2     label=”@(2:6:1)Dcay "  enc_mode=Inc01_Dec7F  if_equal=0x7f  type=SysEx stream=“0xbb 99 0 98 24 97 1