From the help desk files
Situation: to control tuning per note, the target uses two RPNs, one for positive adjustment, one higher for negative adjustment
C is RPNs 4 (+) / 5 (-)
C# is 6 (+) / 7(-)
… up to
B is 26 (+) / 27 (-)
Data is in CC6, up to 100 cents
Tuning visualization
- 100 --- -1 | 0 1 --- 100
<- Rpn 05 | Rpn 04 ->
Data (Cc 06)
100 --- 1 | 0 1 --- 100
Since they use Ccs, and need a range of +/- 100, or 201 total values, a single Cc will not cover the range.
RPNs RPN is a sequence of three or four Cc messages
Cc 101 - RPN MSB
Cc 100 - RPN LSB
Cc 006 - Data MSB
Cc 038 - Data LSB (not used in this case)
MDP2 does not have an explicit RPN format, but it can be built from individual Cc messages
Note The manufacturer should have used NRPNs. RPNs are defined by MIDI Mfg. RPN 4 is tuning bank request, RPN 5 is Modulation Depth Range, RPN 6 is MPE Configuration Message. So it is possible this non-standard use could cause issues with other hardware in a setup. Regardless, this solution will work with RPNs or NRPNs.
The usual MDP solution would be to build three controls, one for MSB, one for LSB, one for data, configure the MIDI values appropriately, (maybe using named ticks), then tie them together with a supercontrol. The complicator here is the different NRPN number for negative values. There is no elegant way to build this directly in MDP2.
But this is simple to implement with StreamByter.
Approach
We will use a synthetic SysEx control to send the value to StreamByter. Since the control range is 201 values (> 128), it must be a two byte control.
Where to set the zero point on the control?
1. At 0, using synthetic negative values (i.e., 7F7F = -1, etc). But this requires named ticks to build the negative values
2. At 101, so 0 = - 100. This is not bad, but
3. Set zero at a multiple of 128, in this case 01 00h. This simplifies the StreamByter logic. Roland uses this in many boards. In this case, 0 will be at 128, and the control range is 28 to 228
The synthetic Sysex format will be
F0 58 nn pp qq F7
m0 m1 m2 m3 m4 m5
nn identifies the note from 0 = C to 0A = B
pp qq is the two byte value, if pp = 1 it is positive.
Build the controls
- Make a knob:
- Label C
- Message Type SysEx
- SysEx Bytes: 58 00 V, two bytes in Value, no checksum
- Display -99 to +99 (it should be -100 to +100, but default only goes to -99)
- 201 ticks
- Display Zero 128
- Midi Min 28
- Midi Max 228 (must select two byte V first)
MAKE SIMILAR 10 times, then edit Labels and SysEx as follows:
C# is 58 01 V,
D is 58 02 V,
etc, up to
B is 58 0A V
StreamByter Code
# StreamByter code for separate Ccs for positive and negative tuning
# Jan 18, 2023
# Red Heron Music
If Load
Alias J0 Temp1
Alias J1 Temp2
Define Chan B0
# B0 = Channel 1, B1 = channel 2, to BF for channel 16
# We can build a control to change channel from the MDP2 layout if needed.
End
If M0 == F0 58
If M2 >= 0
iF M2 <= 0A
Mat Temp1 = M02 * 2
If M3 == 1 # Positive value
Mat Temp1 = Temp1 + 4 # offset for positive Ccs
Snd Chan $101 0 # RPN MSB
Snd Chan $100 Temp1 # RPN LSB
Snd Chan $06 M4 # RPN Data
Else # negative value
Mat Temp1 = Temp1 + 5 # offset for negative Ccs
Mat Temp2 = 80 - M4
Snd Chan $101 0
Snd Chan $100 Temp1
Snd Chan $06 Temp2
End
Block
End
End
End
# End StreamByter code