Forums > MaxMSP

how do I nrpn?

Aug 18 2011 | 5:30 am

ok everyone,

nrpns have got me mighty confused. I feel like I’ve read a lot about them but I don’t know where to start/what to do in any practical sense. I’ve been trying to find a video or an explanation of what it is I’m actually supposed to do with NRPNs but so far I haven’t got anything that’s helped me actually do it.

I would like to use the knobs on my MPD32 to control parameters on my MoPho using NRPN increment/decrement. The MoPho can receive them and the Akai can send them. I’ve set the MoPho up so midi parameter send and receive are on NRPN. Midi control is on.

I have a knob on my Akai set to:
+/- NRPN

below this:
Midi Ch 1A
CTRL 098

From the MoPho manual:

0 – 120
Oscillator 1 Freq

Upon someone else’s (admittedly inexpert) advice, I changed the MSB on the Akai editor to 0 and the LSB to 120, but it didn’t seem to work. I didn’t think it would, because it didn’t make much sense to put the range as the LSB…. but it’s all I’ve heard so far.

The Akai is putting out a stream of numbers like this:
176 99 0
176 98 120
176 96 1
176 99 127
176 98 127

I parsed them that way. In the Max window it was just a stream of numbers… I did midiin – print

Isn’t an NRPN supposed to be 4 sets of numbers, not five?
What is the data that’s actually being sent here?
And what is the data that the MoPho wants?

99, 98 and 96 are all NRPN controller numbers, so those seem to make sense… or at least I recognize them.

the 96 would indicate that it is "incrementing"… but it’s unclear where that’s being sent to. It changes to 97 when I go c-clockwise, so that would make sense for "decrementing"…

Also, is 96 an RPN? The mopho doesn’t use those, but the Manual does say it can do increment/decrement.

Where did the 176 come from? What does it mean?
For that matter, where did the 127 come from? or the 1?

The MoPho has an NRPN 176 (one of the steps of the sequencer) and the knob is not affecting it, so it doesn’t look to me like the first number is where it’s going…

A different knob assigned to +/- NRPN puts out the same stream of numbers when moved… starting with 176 again. I didn’t see a 176 anywhere on the Akai editor. The only difference in the printed midi data from the first knob and the others is that the first knob has a 0 and 120 in keeping with what I set the LSB and MSB to. The others just have 127 in those places, which is what they are set to when you first assign the knob to NRPN.

What do I do now? Where do I go with this?

Any help or guidance at all would be super duper appreciated.

MoPho manual is here:

Midi is page 30 onward

Aug 18 2011 | 5:36 am


I have Trond Lossius’ midi tools, but I don’t know where to begin with those either.

I thought it would be cool if the Akai could send the right messages to the MoPho on its own, but I am also interested in using a Max patch to translate data from the Akai into NRPN to send to the MoPho… I just don’t know how to go about doing that because I don’t practically understand why numbers need to go where for it to work.

Aug 18 2011 | 6:01 am

i may have just figured out how it works..

Aug 18 2011 | 7:11 am

I think it should be:

176 99 0 (parameter # MSB)
176 98 0 (parameter # LSB)
176 6 XX (where XX is value MSB, 0-127)
176 38 0 (optional 4th message, value LSB, if you need 14-bit precision)

Assuming you want channel 1. If not, add (channel – 1) to that 176.

Aug 18 2011 | 8:03 am

Ok, that makes some sense. I’ve got the knobs working to control some things on the MoPho.

I want to make a Max patch to control the mopho more completely. I’m going to start on that tomorrow.

I’m still wondering where the 176 is coming from though..

Aug 18 2011 | 3:30 pm

Hi Thom
I would suggest grabbing yourself a copy of a MIDI Message Table from the net somewhere – that should explain things. .
Basically the 176 is decimal for 1011 0000 a ControlChange on Channel 1
This is the status byte – 1011 is Control change & 0000=Channel 1
The other numbers are the data bytes – number of which varies . . .
99 =NRPN MSB(0-127), 98 = NRPN LSB(0-127) ,
101 = RPN MSB(0-127), 100 =RPN LSB(0-127)
These are usually followed by 6 =Data Entry MSB(0-127) & 38 Data Entry LSB(0-127)
96 = Data increment 97 = Data decrement – but do not have a third byte usually.
The 127’s in there are ‘Nulls’ to close the transfer so nothing else complicates things

Ahh just had a look at the docementation for the Mopho and you have heaps of info there.
Unfortunately the NRPN120 is Sequence Track 1 step 1.
I would try something more basic like 29 Voice Volume. or 14 nOise level – something easily noticed

Also make sure you have it set for recieving NRPN – AndMaybe sending standard CC’s back to Max from the Mopho would be easier than dealing with the NRPN’s in Max

Re-read all the MIDI stuff and grab a binary to decimal calculator to help make sense of the numbers

Aug 18 2011 | 6:31 pm

hey, thanks! Macciza, you have easily been most informative for me thus far. I figured out MSB and LSB last night but you helped me understand the status byte for sure.

I had set it to 120 because someone had suggested that number had to do with the range, which I now know is definitely not the case. I realized MSB and LSB refer to which "option" of the 16384 NRPN combinations there are, and that they (can) work like co-ordinates on a grid (at least that’s how I’m thinking of it). I got it working last night sending increment and decrement and that works

So I’m understanding what the status bytes are, but I am unclear on how are they sent. Is it sent in binary or as a decimal/nrpn (which is how it appears to be in the Max window)? Or, how do I send it out of Max? Where does it come from and where does it go, so to speak?

Aug 18 2011 | 6:47 pm

ps – I realize that the Trond Lossius midi tools do this, but I would like to understand what it’s doing.

Aug 18 2011 | 7:09 pm

is there a simple way to get nrpns into max?

Aug 18 2011 | 7:22 pm

found this:

but still am unsure how the status byte is transmitted.

Aug 18 2011 | 10:46 pm

If you’re using [ctlout] the status byte will be sent for you according to the midi channel you have set for the object. You don’t need to worry too much about it.

Status bytes are sent in binary, but if you need to send one yourself in max you send decimal to [midiout].

I probably wouldn’t do the NRPN-recognition in javascript as that article does, you pay a fairly hefty performance penalty crossing the max-js-max boundaries. NRPN controller streams can be fairly dense at 4 messages per controller increment, so that’s a lot of js entries and exits and it very definitely does add up.

MSB/LSB are not like coordinates on a grid, they just use two values together to represent a much higher value. Because MIDI values are 7-bit (0-127 decimal or 0000000-1111111 binary), two of those together can represent a 14-bit number (0-16384). So it’s (MSB x 128) + LSB = value.

In decimal, you could think of the numbers from 1-99 as MSB/LSB, using two messages with the values 0-9 – the first digit is MSB, the second is LSB, and you’d send those as 2 messages: 7 then 9 = 79. (7 x 10) + 9. See?

So NRPN can use just 4 CC messages to address up to 16384 different parameters, each of which can have a value of 0-127 (no LSB or LSB is ignored) or 0-16384 (using the LSB).

I have an NRPN-decode patch somewhere, I’ll see if I can find that.

Aug 18 2011 | 11:22 pm

-- Pasted Max Patch, click to expand. --

Aug 19 2011 | 4:39 pm

found this:

In fact it makes the job. I use it to totally control my prophet ’08.
Viceversa I can use my ’08 as a midi controller… but parsimoniously,
since synth can’t manage lists… and the external in question
has difficulty to receive many CC’s or send many CC’s at once,
it seems to backlog also in low priority.

-- Pasted Max Patch, click to expand. --

Sep 17 2011 | 12:50 am

Hey, thanks to everyone who posted stuff! I know it’s coming a bit late, but that’s how life went.

particularly thanks to johnpitcairn – you really helped me figure out what was going on, and that nrpn-decode patch is awesome.

"MSB/LSB are not like coordinates on a grid, they just use two values together to represent a much higher value… etc"

that’s totally what I meant by grid, down to your decimal example! I thought of it as like ‘counting in base-128’ though. when I was in early elementary school I always had a picture in my mind of rows and columns of ten when i counted up to one hundred, so I guess that kind of stuck, and that’s what I meant by grid. I suppose graph would be more apt. I’m definitely not a a mathy person, I kind of have to visualize it in some way or something.

Feb 09 2017 | 3:54 pm

"MSB/LSB are not like coordinates on a grid, they just use two values together to represent a much higher value… etc"

I’m just figuring this out too… but I thought I’d add/ask:
The MSB (from CC 99) + LSB (from CC 98) is the address of the location to send the value. The value can = MSB (from CC 6) + "optional’ LBS (from CC 38). Or an Inc (CC 96) or Dec (CC 97) can follow the 99/99 messages.

176 = 0xB0 <- Hex, "B" = CC message, "0" = Ch (0-15) – add 1 to be human readable. :-)

Viewing 15 posts - 1 through 15 (of 15 total)

Forums > MaxMSP