MIDI-OX User Forum (http://www.midiox.com/cgi-bin/yabb/YaBB.pl)
MIDI-OX >> Mapping Questions >> NRPN to CC
(Message started by: KorgMan on Oct 5th, 2021, 7:03pm)

Title: NRPN to CC
Post by KorgMan on Oct 5th, 2021, 7:03pm
Hi all, I'm using a device (korg ES-1) that sends MRPN on encoder movements. I'm trying to get my DAW to respond to CC messages, but all it sees is CC#6 on every bit of midi info sent.

How can I convert MRPN to CC messages - I've heard this is possible but could do with some pointers as to how to make it work

Thanks in advance, :)

Title: Re: NRPN to CC
Post by Breath on Oct 5th, 2021, 10:47pm
Hi
It is good to know how NRPN works, but you can skip to the line ====================================
Firstly NRPN was designed to increase the number of CC types (there are only 128 types).
The number of NRPN controller types is 128 (MSB) x 128 (LSB) = 16384
CC 99 = MSB = Most significant byte  0 to 127
CC 89 = LSB  = Least significant byte 0 to 127

The NRPN message  consists of three CC messages...
CC type 98 with CC 99 gives the NRPN type, and CC type 6 is the controller value from 0 to 127

So if your NRPN is 245 and has a value of 47 the three CC messages that make up the NRPN are
CC 99 1
CC 98 117
CC 6 47

To calculate the full number from its LSB and MSB : 245 = (MSB * 128) + LSB
245 = (1 * 128) + 117  (you can use MidiOx's View / NRPN calculator

=======================================================
BUT in MidiOx data maps you DON'T need to know the MSB and LSB.
You just enter the NRPN number  (245 in our case) into the Data Map

Now you understand how the NRPN works lets see how our message can be converted to just one CC type, lets say type 32

Go to menu Options / Data Mapping... in the new dialog you need to clear anything that is there with the 'Clear' button then 'Insert' a new line
and a different dialog will pop up that has a 'When input matches...' - where you put the NRPN details and the 'Set ouput to' where you put the new CC details

Input:
Channel=Midi channel of the incoming NRPN :
Event Type= NRPN :
NRPN number Min =245 : Max =245 ( just the one NRPN input type) :
Data Value Min =-1 : Max =-1 (any data value)

Output:
Channel= the output channel you want :
Event Type = Crtl :
Ctrl# (= CC Type) Min =32 : Max =32 (just the one CC type)
Amount Min =-1: Nax=-1 (the same as the data coming from the NRPN)

Pres OK to close that dialog

If you have more than one NRPN to convert to CC you can Insert another line and repeat the above.


Check the box next to the OK button
Press the OK button
Any NRPN  message with number 245 will be converted to CC 32 message.
--------------------------------------------------------------------------------------
To connect up you ES-1 -> Midi-Ox -> DAW you will need to install MidiYoke or loopMiid !!!

If you don't have the Midi Port routings window open go to menu View /  Port Routings
On the Port Routings window drag connect the source of the NRPN messages on the left to loopMidi on the right
Inside your DAW instead of connecting the ES-1 Midi Input connect loopMidi

The Midi flow is now ...
ES-1 ->ES-1 Midi output -> NRPN -> MidiOx -> CC -> loopMidi -> DAW

Sorry for the long answer.
Hope this helps. NRPN is one of the trickier aspects to Midi.

All the best
Royce

Title: Re: NRPN to CC
Post by KorgMan on Oct 6th, 2021, 8:24am
Thanks for a brilliant answer, things are a little clearer now...

What I don't quite understand is how to figure out the NRPN number in my case.

I'm trying to convert the rotary controls on my ES-1, so when I move one of them, I get a stream of values in the MIDI OX monitor panel. These cycle through MSB, LSB and Data Entry MSB.

The status always reads B0.

DATA1 and DATA2 are hex values, and it seems whichever knob I use they are always: 06 00 for the knob at 0% and 06 7F at 100%

(incidentally, this makes me wonder how each knob can be individually identified to send specific CC numbers)

So - is there a way I can figure out an NRPN number for each individual knob on my ES-1?

I tried the example you gave... this seems to have resulted in the DAW picking up all movements on the ES-1 as CC98, but not a continuous stream, just a single event, so the input light just blips once.

Title: Re: NRPN to CC
Post by Breath on Oct 6th, 2021, 9:24pm
OK, deeper down the rabbit hole.
You seem to be OK with hex (if not, let me know)

I just noticed I was swapping between decimal and Hex - sorry, that must have been confusing
98 = 62H = LSB NRPN#
99 = 63H = MSB NRPN#

'The status always reads B0. '
Status is 'what is the Midi message'
B           = CC
B0 to BF = CC on channel 1 to 16
B0 = CC on channel 1
and with Microsoft we always expect to get a status byte

'DATA1 and DATA2 are hex values, and it seems whichever knob I use they are always: 06 00 for the knob at 0% and 06 7F at 100% '

You can swap back and forward from hex to decimal in MidiOx - right click in the Input or Output Monitor and halfway down the popup menu select 'Display Decimal' and the next time you right click it will be 'Display Hex'.
Use the Hex to understand the Midi and decimal for the data.

'06 00' is the NRPN value byte so you would expect that it would be 06 00 to 06 7F or value = 0 to 127

'(incidentally, this makes me wonder how each knob can be individually identified to send specific CC numbers) '
The ES-1 probably puts out different NRPN# for different knobs (perhaps there is a whole lot more if there is a SHIFT button to use with the knobs)
There might be a list at the end of the manual otherwise you will have to use MidiOx and try all the knobs.


'So - is there a way I can figure out an NRPN number for each individual knob on my ES-1? '

So the NRPN is really three messages long. That is three CC messages (each 3 bytes long) = 9 bytes, but Midi Ox displays it how Midi was originally designed.
That is, three separate CC messages

It is up you to notice that there is a B0 63 23 then B0 62 14 --- I know, I know it is a NRPN there must be a 06 xx (something 00 to 7F)  for the value
What is the NRPN number ?
B0 63 23  means 23 must be the MSB
B0 62 14  means 14 must be the LSB

So the number is ?   View / NRPN Calculator, select Hex and type in the MSB and LSB and the Decimal is displayed beneath and you get 4500  ( 1194 Hex )
So the NRPN 'number' is 4500 and you type that in the first line of the data map for the max and min NRPN#

Still with me.....?

If you see that the ES-1 uses NRPN# sequentially, say 4500, 4501 4502 etc, you can set up the data map with a single entry
The first line has the NRPN# Min=4500 Max=4503
The second CC# Min = 12 Max = 15

MidiOx will map NRPN# to CC#
4500 to 12
4501 to 13
4502 to 14
4503 to 15

One last trick in NRPN.
In NRPN we think of CC06  data as the complete value.

Sometimes 0 to 127 is too small a range  so we use two bytes MSB and LSB as value data ( as it is with Bank Select messages)
This is called High resolution NRPN and needs another CC message (total = 4 CC messages = 12 bytes)

CC06  the data byte (byte3) contains the MSB of the value.
CC20 (38)  the data byte contains the LSB of the value.

So if you see the CC38 then you know the knob is high resolution.
Either way, MidiOx always describes CC06 as MSB Value even though there may not be a CC20 (38 decimal).

Hope that helps
Royce



Title: Re: NRPN to CC
Post by KorgMan on Oct 6th, 2021, 10:22pm
Have figured it out now....

view>input monitor shows me the NRPN numbers coming in from the ES-1

Then, it was just a case of setting up the translations, as per this post: https://invisibleagent.com/blog/news/howto-korg-er1-electribe-midi-controller

NOTE - one key point (for any MIDI OX newbs like me reading this post) - I had to  make sure the tick boxes at the bottom of the translation pane were all unticked. And also make sure the "turn map on (after OK)" was ticked - then click OK [obviously!]

Hope this helps anyone else who wants to use their Electribe to send MIDI CC to DAWs and VSTs

Title: Re: NRPN to CC
Post by KorgMan on Oct 6th, 2021, 10:25pm
One last thing...

I also installed loopMIDI. Set the MIDI out in MIDI OX to LoopMIDI and make sure "MIDI in" in the DAW or VST is also set to LoopMIDI and nothing else.



MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.