Roland Checksum and Bank Calculation in MIDI Translator Pro

Hello,

can anybody help me with the correct MIDI messages for my ROLAND RD-2000.

I need to know how to Change the program, a.e. preset A03, or preset G12. MIDI channel would be number 1.

A-03 would be MSB 84, LSB 64, PC 3

G-12 would be MSB 84, LSB 65, PC 4

M-16 would be MSB 84, LSB 65, PC 128

In the MIDI implementation it is written that:

Program Change: Status: CnH, 2nd byte: ppH n = MIDI channel number: 0H–FH (ch.1–16) pp = Program number: 00H–7FH (prog.1–prog.128)

 

I also need to know how to change the Master Tune from a.e. 436.2 Hz to 463.0 Hz. This is done in the piano with the measurements in cents and the reference 440 Hz = 0 Cents.

This means 436.2 Hz = -15.0 Cents, 463.0 Hz = +88.2 Cents.

-----------------------------------------------------------------------------+ Offset Address: # 00 00 | 0000 aaaa | --------------------------------| 0000 bbbb | --------------------------------| 0000 cccc | --------------------------------| 0000 dddd |

Description: Master Tune (24 - 2024) | | -100.0 - 100.0 [cent] |

Master Tune "RD-2000_MIDI_Imple_eng02_W" p.9 (examples p.15 onwards).

I attached the corresponding PDF for you and hope that you can explain me how to calculate other values for myself.

Thanks!

Christopher

 

 

Master Tune “RD-2000_MIDI_Imple_eng02_W” p.15

Decimal and Hexadecimal Table In MIDI documentation, data values and addresses/sizes of exclusive messages etc. are expressed as hexadecimal values for each 7 bits. The following table shows how these correspond to decimal numbers. +------+------++------+------++------+------++------+------+ | D | H || D | H || D | H || D | H | +------+------++------+------++------+------++------+------+ | 0 | 00H || 32 | 20H || 64 | 40H || 96 | 60H | | 1 | 01H || 33 | 21H || 65 | 41H || 97 | 61H | | 2 | 02H || 34 | 22H || 66 | 42H || 98 | 62H | | 3 | 03H || 35 | 23H || 67 | 43H || 99 | 63H | | 4 | 04H || 36 | 24H || 68 | 44H || 100 | 64H | | 5 | 05H || 37 | 25H || 69 | 45H || 101 | 65H | | 6 | 06H || 38 | 26H || 70 | 46H || 102 | 66H | | 7 | 07H || 39 | 27H || 71 | 47H || 103 | 67H | | 8 | 08H || 40 | 28H || 72 | 48H || 104 | 68H | | 9 | 09H || 41 | 29H || 73 | 49H || 105 | 69H | | 10 | 0AH || 42 | 2AH || 74 | 4AH || 106 | 6AH | | 11 | 0BH || 43 | 2BH || 75 | 4BH || 107 | 6BH | | 12 | 0CH || 44 | 2CH || 76 | 4CH || 108 | 6CH | | 13 | 0DH || 45 | 2DH || 77 | 4DH || 109 | 6DH | | 14 | 0EH || 46 | 2EH || 78 | 4EH || 110 | 6EH | | 15 | 0FH || 47 | 2FH || 79 | 4FH || 111 | 6FH | | 16 | 10H || 48 | 30H || 80 | 50H || 112 | 70H | | 17 | 11H || 49 | 31H || 81 | 51H || 113 | 71H | | 18 | 12H || 50 | 32H || 82 | 52H || 114 | 72H | | 19 | 13H || 51 | 33H || 83 | 53H || 115 | 73H | | 20 | 14H || 52 | 34H || 84 | 54H || 116 | 74H | | 21 | 15H || 53 | 35H || 85 | 55H || 117 | 75H | | 22 | 16H || 54 | 36H || 86 | 56H || 118 | 76H | | 23 | 17H || 55 | 37H || 87 | 57H || 119 | 77H | | 24 | 18H || 56 | 38H || 88 | 58H || 120 | 78H | | 25 | 19H || 57 | 39H || 89 | 59H || 121 | 79H | | 26 | 1AH || 58 | 3AH || 90 | 5AH || 122 | 7AH | | 27 | 1BH || 59 | 3BH || 91 | 5BH || 123 | 7BH | | 28 | 1CH || 60 | 3CH || 92 | 5CH || 124 | 7CH | | 29 | 1DH || 61 | 3DH || 93 | 5DH || 125 | 7DH | | 30 | 1EH || 62 | 3EH || 94 | 5EH || 126 | 7EH | | 31 | 1FH || 63 | 3FH || 95 | 5FH || 127 | 7FH | +------+------++------+------++------+------++------+------+ D: decimal H: hexadecimal * Decimal values such as MIDI channel, bank select, and program change are listed as one (1) greater than the values given in the above table. * A 7-bits byte can express data in the range of 128 steps. For data where greater precision is required, we must use two or more bytes. For example, two hexadecimal numbers aa bbH expressing two 7-bits bytes would indicate a value of aa x 128 + bb. * In the case of values which have a ± sign, 00H = -64, 40H = ±0, and 7FH = +63, so that the decimal expression would be 64 less than the value given in the above chart. In the case of two types, 00 00H = -8192, 40 00H = ±0, and 7F 7FH = +8191. For example if aa bbH were expressed as decimal, this would be aa bbH - 40 00H = aa x 128 + bb - 64 x 128. * Data marked “nibbled” is expressed in hexadecimal in 4-bits units. A value expressed as a 2-byte nibble 0a 0bH has the value of a x 16 + b.


Attachments:
1571822757888_RD-2000_MIDI_Imple_eng02_W.pdf

Hi, see the following. I hope I got the calculations right as I don’t have this keyboard and had to do the best to interpret the documentation.

You will need to change the incoming triggers for your controller and set up the aliases for the devices you have. If aliased the input controller to “My Controller” and output to “Roland-RD2000”.

For the first two, I basically take the MSB and LSB and assemble them into a local variable for bank number and then send a bank change message with the proper PC. The below are the rules for A-03

 

// MSB
pp=84
// LSB
qq=64
rr=pp<<7
rr=rr|qq

The tune requests are a bit more complicated.

I figured from the documentation that a value of 24 is -100 cents and 2024 is +100 cents so for each value change of 10 it should move 1 cent. So we first take the target cent value you want and calculate the value from there.

// target cent value
pp=-15
qq=100+pp
// Every cent is 10 steps
qq=qq*10
// So we have to go up value of 850 from 24
// starting value
rr=24
// increment
rr=rr+qq
// rr is now the value we need to send

 

Then we have to break it down into the format Roland wants to use for Sysex so we put that value into 4 chunks for aaaa bbbb cccc and dddd.

// break it down into 4 byte chunks
// for sysex
// MSB aaaa
tt=rr>>12
// bbbb
uu=rr>>8
uu=uu&15
// cccc
vv=rr>>4
vv=vv&15
//dddd
ww=rr&15

So in the sysex we will use tt uu vv and ww for the value

But we need to also calculate the checkum and we will put that in rr (since we no longer need rr for anything else)

// Calculate Roland checksum
// We will use rr since we don’t need it any more
// Address
rr=0
// value 1
rr=rr+tt
rr=rr+uu
rr=rr+vv
rr=rr+ww
// Get remainder
rr=rr%128
//Subtract from 128
rr=128-rr
// rr is now the checksum

 

 

So if I’m right in my calculations and my understanding of the docs, all you should need to do for tuning is change the target value of pp (in cents) and the rules should figure out the rest for you.

I hope this helps!

 

 

 


Attachments:
1571843812524_Roland-Keyboard-Tune-and-PC-2019-10-23.bmtp

Hi Steve,

thanks for the answer! Could you please explain why I have to create an alias? The problem is that everything you calculated looks quite nice but it seems that the RD-2000 doesn’t receives the messages, even the simpler Program change. I’m wondering if it has to do with the aliased input. I tried it with just RD-2000 as Input and RD-2000 as Output (without alias).

With “You will need to change the incoming triggers for your controller” you mean that I map the action to a.e. the “Q”-key on my keyboard, right? Is there a possibility in Bome to add a kind of button behind the specific action to such a one time action like program change or change tune?

And one little correction: you are right that an increment of 10 is 1 Cent, but the accuracy of the RD-2000 is 0.1 Cents and therefore in steps of 1. So please take this in consideration for the formula, a.e for +88.2 Cents.

Thank you very much in advance!

 

Oh, on p.16 of RD-2000_MIDI_Imple_eng02_W there are some more details regarding the checksum, especially adding the “(4) Model ID (RD-2000)”, maybe it is this what was missing.

Hi, you do not need to use aliases if you don’t want to. Just open the input ports and output ports you want.

I doubt if you will be able to send MIDI from the Roland back to itself. At least without changing a setup parameter on the keyboard itself.

 

You now have the calculations I used so you will need to modify them as appropriate. You now have a model to work from.

To change the incoming triggers, just press capture midi in the input box while pressing the desired key from your incoming MIDI device. Then click on the captured message and it will copy over to the incoming action.

There is one more thing to add for proper checksum calculation that I neglected:

 

Where it currently says:


 

// Get remainder
rr=rr%128
//Subtract from 128
rr=128-rr
// rr is now the checksum


Add add the following lines in bold:

// Get remainder
rr=rr%128

// Skip next step if remainder is 0

if rr==0 then skip next rule
//Subtract from 128
rr=128-rr
// rr is now the checksum


I’m not sure your Roland will actually need the proper checksum. I have several Roland devices and although they painstakingly tell you how to calculate this, I’ve never seen it ignore an incoming message with the wrong checksum. I guess it is better to be safe and use it anyway.

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

 

OK, just add it in the appropriate place of the raw output MIDI message.

Please find the attached project file with the checksum calculation corrected and also the ability to define tuning moves at a .1 accuracy. Since MT Pro does not do floating point, if you want 88.1 cents you need to enter target as 881. I later divide this out to get to the right integer value.

The device model for Roland RD-2000 is “00 00 75” hext. However the manual calls out 10H as the default device ID. If you changed this, you may need to change this byte (3rd byte). You might try changing it to 7F as by most manufacturer conventions, this generally means “any device”. Next I would try 00.

 

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz


Attachments:
1571925611377_Roland-Keyboard-Tune-and-PC-2019-10-24.bmtp

Hi Steve,

with your addition the tune-option now works! Thank you very much 🙂 I also increased the accuracy by myself. I did this with your first version like this:

// target cent value
pp=-15 [edited to pp=-150]
qq=100+pp [edited to qq=1000+pp]
// Every cent is 10 steps [deleted]
qq=qq*10 [deleted]

What is still not working is the Program Change. Any ideas on this? And maybe it is redundant but I still don’t know where to insert the default device ID.

Best,

Christopher

 

 

If the tuning is working, no need to mess with the device ID. Just leave it as 10H this is in the Raw MIDI output string as the 3rd byte.
Note sure why PCs are not getting through. Maybe you need to put the device into a different mode to enable these messages. I would look at the user manual. Some synths have a native mode and a GM MIDI mode and if you are in GM MIDI mode it probably won’t work.
Can you send a PC without bank selection to see if it takes that (even if wrong)?
Also, could you post your project file with WORKING tone adjustment? I want to compare with mine to see if the working calculated output matches what I did based on documentation review only. Also this might be helpful to other users to actually see the working solution.

Also try sending this Sysex to see if Master tuning goes to +88.1 cents. This would be the Master Tuning Sysex according to the page for of the Roland RD-2000 MIDI Implementation document.
It is much shorter and doesn’t require the Roland checksum calculation .
F0 7F 7F 04 03 30 78 F7
Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Hi Steve,

attached you find the edited file. And I figured out why the PC didn’t worked, it was just that the RD-2000 default for PC messages is channel 16. Didn’t knew about this. Now everything is fine!

I have just two more questions:

  1. is it possible to combine the tuning and preset change in one preset?
  2. Can you help me with a passthrough of these message? I activated the “Local switch” which disconnects the Roland-Keyboard from the Sound Generator. By doing this it only acts on messages received by my Computer through Bome.
    Hold 1 (Controller number 64)
    Status — 2nd byte — 3rd byte
    BnH — 40H — vvH
    n = MIDI channel number: 0H–FH (ch.1–16)
    vv = Control value: 00H–7FH (0–127)

    Sostenuto (Controller number 66)
    Status — 2nd byte — 3rd byte
    BnH — 42H — vvH
    n = MIDI channel number: 0H–FH (ch.1–16)
    vv = Control value: 00H–7FH (0–127)

    Soft (Controller number 67)
    Status — 2nd byte — 3rd byte
    BnH — 43H — vvH
    n = MIDI channel number: 0H–FH (ch.1–16)
    vv = Control value: 00H–7FH (0–127)

Thank you so very, very much!

Christopher

PS: And one wish for the program itself, it would be just great to trigger a MIDI-message in Bome (like the tuning or PC) by double clicking on it, without assigning specific keys, MIDI triggers etc to such an one time event. Maybe for next update?


Attachments:
1571986466071_INPUTRoland-RD-2000_Keyboard-Tune-and-PC-2019-10-23-EDIT.bmtp

If you simply draw a line from the input device to the output device on the MIDI routing screen, any messages that are not handled by a translator will pass through untouched.
Optionally, you can just create translators with the same incoming trigger and outgoing action.
In order to have both PC and tuning triggered at the same time, simply both translators with the same incoming trigger. I suggest if you put a slight delay on the second one. If the first one is the tuning one, make the second one delay at least 50 ms.
I’ll tee up your request for clicking the translator to run it, however care would need to be taken between clicking to edit vs clicking to run. Typically what I do is just make the incoming trigger a keyboard shortcut.
Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz
PS. Thanks for posting your edited script!

Hi Steve,

now everything works perfectly! But would it still be possible to comine tuning and PC in one preset? I have different pianos (20+) and would need the double amount of tuning presets for each of them in case of the same trigger.

And regarding the clickable preset I could think of more possibilities:

  1. make the preset clickable
  2. a field/button behind the preset that is clickable
  3. to add an option inside the preset to make it clickable. Then everybody could choose if he want’s to watch out if he is editing or activating the preset. Maybe editing could be solely done via F2 with this option.

I would suggest option 3.

All the best,

Christopher

Tuning and PC together, yes.

Just duplicate the incoming trigger so they are the same for both translators. Put a slight delay on the second outgoing action especially if you do the tuning change before the PC change. Most controllers need about 50msec to process a SysEx before ready for the next command.