Jump to content

Can encoders send NRPN values with inc/dec?


jjonas

Recommended Posts

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?

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 3 years later...

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...