I'm referring to control change messages that are used to adjust "registered parameters," or RPNs. Out of the three that are defined by General MIDI, one of them adjusts the fine-tuning of a channel by as much as 100 cents. Here's how it's done:
- Set control 101 (RPN MSB, or most significant byte) to 0.
- Set control 100 (RPN LSB, or least significant byte) to 1.
- Set control 6 (data entry MSB) to the appropriate value (see below).
- Set control 38 (data entry LSB) to the appropriate value (see below).
- Set control 101 (RPN MSB) to 127.
- Set control 100 (RPN LSB) to 127.
The first two commands indicate the start of an RPN message as well as which registered parameter will be adjusted (in this case, the "channel fine tune" parameter). The next two commands set the value of the registered parameter. Finally, the last two commands indicate the end of the RPN message.
To get the correct values for the data entry commands (the middle two), first multiply the number of cents above A440 (which can be negative) by 81.92 (or, if you wish to work solely with integers, multiply by 8192, then divide by 100), then add 8192 to the result. The lowest 7 bits of this result are the data entry LSB value, and the next 7 bits are the MSB value.
Here are some useful reference points for the MSB and LSB values:
- MSB=0, LSB=0: -100 cents (minimum)
- MSB=32, LSB=0: -50 cents
- MSB=64, LSB=0: A440
- MSB=96, LSB=0: +50 cents
- MSB=127, LSB=127: +100 cents (actually, I think it's closer to +99.99 cents) (maximum)
This registered parameter has a range of -100 cents to extremely close to +100 cents and a resolution of 100/8192 cent (about 0.012 cents), which should be far more than sufficient for Absolute Pitch Painter (assuming, of course, you can actually use these commands).
(And remember that these commands only affect the MIDI channel that they're sent to, so make sure they go to the correct channel!)