A Quick Tutorial on NRPNs
Those who know some MIDI already know that the number of available continuous controller #'s is limited, and most of them are already assigned. Some are assigned to specific performance controls (mod wheel, which is controller #1, being the best known). Some are reserved for sending the low bytes for 14-bit controller values. The real-time messages eat up some numbers, and General MIDI consumes a few more each time the spec is updated. So there aren't enough unassigned ones to assign one to each parameter that is editable on a typical synth. So some manufacturers resort to sysex for parameter editing.
However, the continuous controller definitions themselves contain the mechanism for extending the available set of numbers: The RPN/NRPN mechanism. The way it works involves four controller messages: two to select the parameter to be edited, and two to send the value. Registered Parameter Numbers, or RPNs, are defined in the MIDI standard; the two most commonly used RPNs allow master tuning and pitch bend range to be altered via MIDI. However, Non-Registered Parameter Numbers, or NRPNs, are reserved in the MIDI standard for manufacturers to define how they wish.
To send an NRPN value, first you send messages to select the desired parameter. Continuous controller 99 is used to send the most significant byte (MSB), and controller 98 is used to send the least significant byte (LSB). If the receiver has fewer than 128 parameters, the MSB message need not be used. For example, to select parameter 131 (whatever that parameter happens to be on a given synth), you would send a controller 99 message with a value of 1, and a controller 98 message with a value of 3. (The value of the controller 99 message is multiplied by 128, and added to the value of the controller 98 message.) Having selected the parameter, you then send two more messages to specify the value of the selected parameter: controller 8 sends the MSB of the value, and controller 38 sends the LSB. (If the parameter is limited to the range 0-127, the MSB message need not be sent.) If we wanted to set the selected parameter to a value of 286, we send the controller 8 message with a value of 2 (2*128=256), and the controller 38 message with a value of 30.
Here's what I've found out so far about the Fizmo's NRPN implementation:
Note all the parameters that changed at first, and then that only parameter 117 continued to change as the knob kept moving. Clearly, parameter 117 corresponds to the sustain knob on the panel. The other parameters are associated with additional envelope segment levels and/or times, not accessible from the panel, that were set to default values by the movement of the sustain knob.
Basic Structure of the NRPN numbering
Each parameter within each sound and oscillator has its own NRPN parameter number. (Recall that each patch on the Fizmo has four sounds, or layers, and two oscillators per sound.) It is possible to edit multiple sounds and oscillators at once from the panel; if you do this, the Fizmo will send out a separate set of NRPN messages for each individual parameter which has been changed. In order to make the Fizmo send editing NRPN messages, you have to go into the system edit mode; press the MIDI button multiple times until "nRPn" appears in the display. Then, press the "yes" button to turn it on. If you then hit the save button, it will save this to flash and become the power-up setting.
The high byte of the parameter number is used to specify which sound and oscillator is being accessed. The values go like this:
- Sound 1, oscillator 1: 2
- Sound 1, oscillator 2: 4
- Sound 2, oscillator 1: 6
- Sound 2, oscillator 2: 8
- Sound 3, oscillator 1: 10
- Sound 3, oscillator 2: 12
- Sound 4, oscillator 1: 14
- Sound 4, oscillator 2: 16
Because there are more than 128 parameters in each oscillator, a few parameters will have the MSB value one higher than noted above. Parameters which are not specific to an oscillator (such as the dry/effect mix) have an MSB value of 1.
The LSB then specifies the individual parameter. Here are some that I've found so far (the MSB values shown here as an example are for sound 4, oscillator 1):
Control NRPN (99/98)
Effect Mix 1 34
Pitch Tune 14 14
Pitch Fine 14 15
Pitch Mod button 14 26
Pitch Mod Amount 14 27
Glide Time 14 18
Mono Button 14 16
Attack (Pitch) 14 79
*sent initially 14 80
Attack (Filter) 14 95
Attack (Env) 14 111
*sent initially 14 112
Decay (Pitch) 14 85
*sent initially 14 81 14 83 14 82 14 84
Decay (Filter) 14 101
*sent initially 14 97 14 99 14 98
Decay (Env) 14 117
*sent initially 14 113 14 115 14 112
Sustain (Pitch) 14 86
Sustain (Filter) 14 102
Sustain (Env) 14 118
Release (Pitch) 14 87
Release (Filter) 14 103
Release (Env) 14 119
Envelope Mode button 14 123
Velocity button 14 120
*sent initially 14 125
Amp Level 14 12
Pan 14 13
Effect Bus Select button 14 20
Wave Select 14 52
*sent initially 14 51
Wave Modulation button 14 57
Wave Mod Amount 14 58
Filter Cutoff 14 32
Filter Resonance 14 33
Filter Envelope Amount 14 34
*sent initially 14 119
Filter Mod Amount 14 36
Filter Kybd Track button 14 37
*"on" also sends 14 39
Amp Noise Mod Amount 14 70
Amp LFO Mod Amount 15 0
Amp LFO Shape button 14 126
The ones that say "sent initially" are clues to some of the hidden parameters. Many of these get set to default values when you move a panel control that is associated with those parameters. The big win here, if I can sort it out, is the envelope parameters. The Fizmo envelopes are actually multi-segment envelopes, but only ADSR-type controls are provided on the panel, and when you move one of them, the "extra" segments get set to defaults. (Sometimes.) That's what the "sent initially" means; it sends those the first time the control is moved because that action resets them, and then they aren't sent again because you can't change them from the panel. Here, for example, is a dump from MIDI Monitor from moving the Decay knob (the dump shown is for sound 4, oscillator 2), with the Amp envelope selected:
22:35:46.206 From MIDI Express XT #2 Port 8 Control 3 99 16
22:35:46.206 From MIDI Express XT #2 Port 8 Control 3 98 117
22:35:46.207 From MIDI Express XT #2 Port 8 Control 3 6 0
22:35:46.208 From MIDI Express XT #2 Port 8 Control 3 38 1
22:35:46.208 From MIDI Express XT #2 Port 8 Control 3 99 16
22:35:46.209 From MIDI Express XT #2 Port 8 Control 3 98 113
22:35:46.209 From MIDI Express XT #2 Port 8 Control 3 6 0
22:35:46.210 From MIDI Express XT #2 Port 8 Control 3 38 0
22:35:46.211 From MIDI Express XT #2 Port 8 Control 3 99 16
22:35:46.211 From MIDI Express XT #2 Port 8 Control 3 98 115
22:35:46.212 From MIDI Express XT #2 Port 8 Control 3 6 0
22:35:46.213 From MIDI Express XT #2 Port 8 Control 3 38 0
22:35:46.213 From MIDI Express XT #2 Port 8 Control 3 99 16
22:35:46.214 From MIDI Express XT #2 Port 8 Control 3 98 114
22:35:46.215 From MIDI Express XT #2 Port 8 Control 3 6 0
22:35:46.215 From MIDI Express XT #2 Port 8 Control 3 38 127
22:35:46.216 From MIDI Express XT #2 Port 8 Control 3 99 16
22:35:46.216 From MIDI Express XT #2 Port 8 Control 3 98 116
22:35:46.217 From MIDI Express XT #2 Port 8 Control 3 6 0
22:35:46.218 From MIDI Express XT #2 Port 8 Control 3 38 127
22:35:46.265 From MIDI Express XT #2 Port 8 Control 3 99 16
22:35:46.265 From MIDI Express XT #2 Port 8 Control 3 98 117
22:35:46.266 From MIDI Express XT #2 Port 8 Control 3 6 0
22:35:46.267 From MIDI Express XT #2 Port 8 Control 3 38 2
22:35:46.313 From MIDI Express XT #2 Port 8 Control 3 99 16
22:35:46.313 From MIDI Express XT #2 Port 8 Control 3 98 117
22:35:46.314 From MIDI Express XT #2 Port 8 Control 3 6 0
22:35:46.315 From MIDI Express XT #2 Port 8 Control 3 38 3
22:35:46.385 From MIDI Express XT #2 Port 8 Control 3 99 16
22:35:46.386 From MIDI Express XT #2 Port 8 Control 3 98 117
22:35:46.386 From MIDI Express XT #2 Port 8 Control 3 6 0
22:35:46.387 From MIDI Express XT #2 Port 8 Control 3 38 4
Note all the parameters that changed at first, and then that only parameter 117 continued to change as the knob kept moving. Clearly, parameter 117 corresponds to the sustain knob on the panel. The other parameters are associated with additional envelope segment levels and/or times, not accessible from the panel, that were set to default values by the movement of the sustain knob.
I've only managed to sort out a few of these parameters so far. There is one "extra" parameter associated with the Attack knob, in addition to the attack time itself. When I started experimenting with this, I expected it to be an attack peak level setting, but it wasn't. What it turned out to be instead is a time scaling parameter that makes the attack faster or slower, depending on the note-on velocity. The resulting attack time is proportional to:
attack time * scaling parameter * (128 - velocity)
If this parameter is set to its max value (which appears to be 99), and attack time is at its max value, and a note is struck with minimum velocity, a veeeerrrrry long attack (about a minute) results. With these same settings, a max-velocity note results in an attack time of about five seconds. If the scaling parameter is set to 0, attack is instantaneous regardless of what the attack time is set to.
For the pitch envelope, the attack time is parameter #79 and the scaling parameter is #80. For the filter envelope, the corresponding parameters are #95 and 96, and for the amp envelope, #111 and 112.
Another finding: The Fizmo manual gives one the impression that velocity scaling on envelope levels is an on-off parameter, selected by the Velocity button. Not so. It's actually a variable parameter. To set it, using the amp envelope as the example, you must send the desired value to both parameters #120 and 125. The #120 corresponds to the value that is actually active; the #125 is a "holding" register. When you turn off velocity response with the Velocity button, parameter #120 goes to zero. When you turn it back on, it resets #120 to #125's value. The interesting thing is that there does not appear to be any way to set parameter #125 to a default value from the panel. Without editing software or some other way of sending NRPNs, you could get really frustrated if you were editing a patch with parameter #125 set to a minimal value; the Velocity button would appear to have no effect. I've seen that some of the factory patches have different values of this parameter, so be careful about using a factory patch as a starting point for one of your own patches.
I'm going to keep working on this, in part because Sounddiver for OSX is apparently a dead item now, and there doesn't seem to be any other way of computer editing a Fizmo on a Mac without resorting to OS9. To send NRPN sequences, I'm using the event editor in Metro; to observe NRPNs coming back from the Fizmo, I'm using MIDI Monitor.
3 comments:
Thanks! I referred to your article here -- http://compileyouidontevenknowyou.blogspot.com/2012/02/msb-and-lsb-with-midi-nrpn.html. Let me know if I've gotten anything wrong, please :)
Best!
Dan
You say, "controller 8 sends the MSB of the value, and controller 38 sends the LSB" but I think it should be "controller [6] sends the MSB of the value, and controller 38 sends the LSB"
Love this post. Do you know of a way of outputting those NRPN messages from a knob on a controller rather than through software? Thanks
Post a Comment