fbpx
Skip to main content

MIDI Forum

Nrpn related questi...
 
Notifications
Clear all

Nrpn related question

6 Posts
2 Users
0 Reactions
1,592 Views
Ted
 Ted
Posts: 33
Trusted Member
Topic starter
 

Hi everyone and best wishes

I ‘ve recently started working with nrpn to control an older synth that seems to prefer nrpn over sysex, with my Bcr 2000 controller.

So my question is :

what would be the correct nrpn

for a set of hex values 7f 1d - 00 63 (decimal -99 - +99)

for parameter nr. 0d hex (13 dec) on midi channel 0 hex (1 dec) for example

I have to say that I can use the variable “val” on my editor (bc manager).

Is it something like

B0 63 0d B0 62 00 B0 06 01 B0 26 val

Or something like

B0 63 0d B0 62 00 B0 06 00 B0 26 val

Is there a way to write the full range of values in a message instead of the variable “val”?

Thanks in advance

 
Posted : 27/12/2023 4:48 am
Bavi_H
Posts: 266
Reputable Member
 

I found your similar threads on Mountain Utilites forums (Questions regarding nrpn format) and Gearspace forums (Nrpn related question).

Your Mountain Utilities thread provided a little more context. If I understand correctly:

You will be connecting your Behringer BCR2000 controller to your Marion Systems ProSynth rack mount synthesizer.

To program the BCR2000, you are connecting it to your computer and using Mountain Utilities BC Manager to configure it.

You want to program one of the knobs on the BCR2000 to send NPRN messages with signed (two's complement) values from -99 to +99.

As you mentioned, the basic format of a NRPN message on channel 1 is:

B0 63 num_hi     B0 62 num_lo     B0 06 val_hi     B0 26 val_lo

Note: In your post above you used num_hi and num_lo as 0D and 00. But if your documentation says something like the NRPN number is 13, you might need to swap them around so that num_hi and num_lo are 00 and 0D.

In your post above you know that val_hi and val_lo need to range from 7F 1D (for -99) to 00 63 (for +99), but it sounds like you are trying to figure out how to program that range in to one of your BCR2000's knobs.

Unfortunately, it looks like the BCR2000 doesn't let a knob's range of values wrap around, so it can't normally support negative values using two's complement. However, the following thread in the Mountain Utilities forum BCR 2000 and negative value in sysex !! explains a quirky workaround that uses the checksum commands to calculate a negative byte in a dummy message and then copy it to desired position in the target message.

According to a review from Sound on Sound (Marion Systems Pro Synth), the ProSynth "allows up to eight different sounds to be driven from their respective MIDI channels." So I'm assuming the ProSynth only listens to MIDI channels 1 to 8 and will ignore messages for channels 9 to 16. If that's correct, I think we can use Pitch Bend messages for channel 16 (hex EF xx xx) to set up dummy values.

Using the quirky workaround method, here is my idea for programming a knob:

Value 1 (minimum value): 29
Value 2 (maximum value): 227
Output: $EF val7.13 $10 $EF cks-2 1 $3A $B0 $63 $0D $B0 $62 $00 $B0 $06 cks-3 4 $B0 $26 val0.6
(Position: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 )

The minimum value decimal 29 is 7-bit hex 00 1D.
The maximum value decimal 227 is 7-bit hex 01 63.

In the output string, the first byte is called position 0.

"val7.13" returns the high 7-bit part of the value. It will be either 00 or 01.

"cks-2 1" will calculate the 7-bit sum of the bytes from position 1 through the byte just before the "chks-2 1". The filler value of hex 10 was chosen so that the sum ends up being one of these values:

00 + 10 + EF = 7F
01 + 10 + EF = 00

"cks-3 4" will calculate a 7-bit XOR of the bytes from position 4 through the byte just before the "chks-3 4". The filler value of hex 3A was chosen to cancel out the third to last bytes of the calculation, so the result is the same as the first byte:

7F ^ 3A ^ B0 ^ 63 ^ 0D ^ B0 ^ 62 ^ 00 ^ B0 ^ 06 = 7F
00 ^ 3A ^ B0 ^ 63 ^ 0D ^ B0 ^ 62 ^ 00 ^ B0 ^ 06 = 00

"val0.6" returns the low 7-bit part of the value.

 
Posted : 27/12/2023 5:00 pm
Ted
 Ted
Posts: 33
Trusted Member
Topic starter
 

Thanks Bavi for your interest on my subject, your research and the super detailed reply.
Marion systems prosynth is very difgicult on data transmission. And yes it can send 8 voices to any 8 midi channels max. at a time. on mult mode (one of its 4 modes of operation : omni, multi, poly, solo)

[quotePost id=20839]

Note: In your post above you used num_hi and num_lo as 0D and 00. But if your documentation says something like the NRPN number is 13, you might need to swap them around so that num_hi and num_lo are 00 and 0D.
[/quotePost]

No need to swap them around since the manufacturer’s nrpn notes i have explicitly show the nrpn message format.

[quotePost id=20839]

In your post above you know that val_hi and val_lo need to range from 7F 1D (for -99) to 00 63 (for +99), but it sounds like you are trying to figure out how to program that range in to one of your BCR2000's knobs.

[/quotePost]

Correct.

[quotePost id=20839]

Value 1 (minimum value): 29
Value 2 (maximum value): 227
Output: $EF val7.13 $10 $EF cks-2 1 $3A $B0 $63 $0D $B0 $62 $00 $B0 $06 cks-3 4 $B0 $26 val0.6
(Position: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 )

The minimum value decimal 29 is 7-bit hex 00 1D.
The maximum value decimal 227 is 7-bit hex 01 63.

In the output string, the first byte is called position 0.

"val7.13" returns the high 7-bit part of the value. It will be either 00 or 01.

"cks-2 1" will calculate the 7-bit sum of the bytes from position 1 through the byte just before the "chks-2 1". The filler value of hex 10 was chosen so that the sum ends up being one of these values:

00 + 10 + EF = 7F
01 + 10 + EF = 00

"cks-3 4" will calculate a 7-bit XOR of the bytes from position 4 through the byte just before the "chks-3 4". The filler value of hex 3A was chosen to cancel out the third to last bytes of the calculation, so the result is the same as the first byte:

7F ^ 3A ^ B0 ^ 63 ^ 0D ^ B0 ^ 62 ^ 00 ^ B0 ^ 06 = 7F
00 ^ 3A ^ B0 ^ 63 ^ 0D ^ B0 ^ 62 ^ 00 ^ B0 ^ 06 = 00

"val0.6" returns the low 7-bit part of the value.
[/quotePost]

Seems so very exotic and beyond my simple understanding of sysex things that i fell like everytime i learn a coupleof thibgs i open a new box and things become stranger. Hopefully o woll understand ot brtter and i will be able to test it really soon.

Really really appreciate it Bavi.
Thanks a million.

 
Posted : 27/12/2023 9:54 pm
Ted
 Ted
Posts: 33
Trusted Member
Topic starter
 

After studying a bit the logic behind your workaround Bavi, i realize that it is very hard to program about 20 such values on the bcr.
Because of the different parameter values involved. Especially if we are talking about inexperienced programmers.

[quotePost id=20839]

Value 1 (minimum value): 29
Value 2 (maximum value): 227
Output: $EF val7.13 $10 $EF cks-2 1 $3A $B0 $63 $0D $B0 $62 $00 $B0 $06 cks-3 4 $B0 $26 val0.6
(Position: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 )

The minimum value decimal 29 is 7-bit hex 00 1D.
The maximum value decimal 227 is 7-bit hex 01 63.

In the output string, the first byte is called position 0.

"val7.13" returns the high 7-bit part of the value. It will be either 00 or 01.

"cks-2 1" will calculate the 7-bit sum of the bytes from position 1 through the byte just before the "chks-2 1". The filler value of hex 10 was chosen so that the sum ends up being one of these values:

00 + 10 + EF = 7F
01 + 10 + EF = 00

"cks-3 4" will calculate a 7-bit XOR of the bytes from position 4 through the byte just before the "chks-3 4". The filler value of hex 3A was chosen to cancel out the third to last bytes of the calculation, so the result is the same as the first byte:

7F ^ 3A ^ B0 ^ 63 ^ 0D ^ B0 ^ 62 ^ 00 ^ B0 ^ 06 = 7F
00 ^ 3A ^ B0 ^ 63 ^ 0D ^ B0 ^ 62 ^ 00 ^ B0 ^ 06 = 00

"val0.6" returns the low 7-bit part of the value.
[/quotePost]

For cks-2 1 let’s assume that we will always use pitch bend value of ch.16. So things are simpler and easy to understand. The filler value will always be 10

But for cks-3 4 things become very complicated since we need to find the correct filler value which will have to be always different for each different parameter number in order to give us 7f. And the calculation is not a simple sum.

So i guess the whole thing could be ok for an encoder, with a bit of help from experienced midi programmers, but for more i can’t think of a way to simplify things. Unless there are calculators and certain tricks i have no idea about.

 
Posted : 27/12/2023 10:35 pm
Bavi_H
Posts: 266
Reputable Member
 

[quotePost id=20845]But for cks-3 4 things become very complicated since we need to find the correct filler value which will have to be always different for each different parameter number in order to give us 7f. And the calculation is not a simple sum.[/quotePost]
If you are always using this hex pattern:

EF val_hi 10     EF sum filler     B0 63 num_hi     B0 62 num_lo     B0 06 sum     B0 26 val_lo

then you can use this hex formula to calculate the filler value:

filler = 37 xor num_hi xor num_lo

For example, in my original example, num_hi is hex 0D and num_low is hex 00.
In Windows calculator, you can change to Programmer mode and Hex mode then press

37 xor 0D xor 00 =

and you will get 3A.

Or in a desktop browser, you can press F12 to open the Developer Tools, then go to the Console page and enter

(0x37 ^ 0x0D ^ 0x00).toString(16)

and you will get '3a'.

 
Posted : 28/12/2023 6:06 am
Ted
 Ted
Posts: 33
Trusted Member
Topic starter
 

Thanks Bavi. Pure magic.
It took me some time to get my head around your answer but by studying a bit the midi implementation manual from the bc manager site, i realised that you had already given me the valid answer and formulas.
So now everything is working well and as it should.
Fantastic data string.
Thanks a million

 
Posted : 30/12/2023 2:27 am
Share: