Is there an NPRN encode/decode supported by default?

Hi,

As I am looking at the MIDI work I am doing, I’d like to be able to use 14bit NPRN messages. I was wondering if there was native support for this in oopsy.midi? If not, it would be a nice to have item in the future. :slight_smile:

Thanks,
Brett

I’m not totally up to speed on how NRPNs work, but is it a series of CC messages? E.g. CC98 (val=MSB) CC99 (val=LSB)?

If so then there’s not currently direct support for NRPNs, but you could patch it right now. Create a [param midi_cc98] and [param midi_cc99]. When the midi_cc99 value changes (detect via [change]), latch it and latch the midi_cc98 value too. Divide the midi_cc99 by 127, add it to the midi_cc99 value, and you have a 14-bit signal that runs from 0…1.

(or if you wanted integers, multiply midi_cc99 by 128, add midi_cc98, and multiply the result by 128 again.)

I don’t know that I have anything that sends/receives NRPNs so I can’t really test it here, but if that works, then I could very easily convert that into something built into oopsy so we can have param nrpn.

But it’s very possible I’m misunderstanding how NRPNs work…

@grrrwaaa,

I’m just learning the NPRN work as well. I wanted to ensure I can have higher resolution on a few areas of my work. Here is what else I found:

  1. NPRN Type are the CCs: 99 (MSB) and CC 98 (LSB), as you noted above
  2. NPRN Data/Value are the CCs of: 6 (course/MSB) and 38 (fine/LSB) for the values.

Here is one of the places I was reading about NPRN:
NRPN - Wikipedia

What you have noted sounds great, and i’ll give that a try.

Thank you for the suggestion, and in the future, it seems like it would be nice to have an NPRN option in the midi handler, but clearly not needed. :slight_smile:

Thank you for the help and suggestions.
Brett

I find this site to be a a great resource on NRPNs NRPN tutorial / How to - General Discussion - Elektronauts

Something to consider, from what I’ve gathered is that “not all devices may send the LSB value” - so if you latch the MSB value and are waiting for the LSB value, you ‘might’ not get it.

Also, of course the data implementation is use-case specific - really, you just get 7 or 14 bits of data, weather this is 0-n, -n-0-+n or boolean etc is entirely up to not only the sender but the target implementation as well.

That said, I currently haven’t worked with anything that sends RPN/NRPN values yet, I am sticking with plain CC for now for my stuff…

1 Like

I added an issue to track this here: Support (N)RPN midi IO · Issue #51 · electro-smith/oopsy · GitHub – feel free to add more detail if you can.

As I say, I don’t have any hardware that does NRPNs and I’ve read that they can be implemented quite differently on different hardware, so I’m a bit hesitant to dig into it, but if there’s general use cases we can map out I’m happy to look at them. At least, I learned that Max now has NRPN IO so I can test somewhat that way.