VOGONS


First post, by llm

User metadata
Rank Member
Rank
Member

i try to understand what the controller number 6 is - and what the meaning of the controller-value is when send to an MT32 device

https://www.midi.org/specifications-old/item/ … of-midi-message

Control Change. 1011nnnn 0ccccccc 0vvvvvvv This message is sent when a controller value changes. Controllers include devices s […]
Show full quote

Control Change.
1011nnnn 0ccccccc 0vvvvvvv
This message is sent when a controller value changes. Controllers include devices such as pedals and levers. Controller numbers 120-127 are reserved as "Channel Mode Messages" (below).
(ccccccc) is the controller number (0-119). (vvvvvvv) is the controller value (0-127)

byte 0: 0xB0 + channel // Control change
byte 1: 0x06 ???
byte 2: ???

according to this page: https://www.midi.org/specifications-old/item/ … es-data-bytes-2
the 6 means "00000110 06 Data Entry MSB" and the 3rd byte is just a value 0-127

i don't know that Data Entry (Most significant byte) is?

is that the pitch bend?
https://www.noterepeat.com/articles/how-to/21 … terms-explained
http://midi.teragonaudio.com/tech/midispec/rpn.htm

Reply 1 of 14, by mkarcher

User metadata
Rank l33t
Rank
l33t

A "data entry" control change message shouldn't come on its own. It's part of the RPN/NRPN system. You first have to select a parameter number by writing an officially assigned 14-bit parameter number into controls 100 and 101 (B0 64 01 / B0 65 00) for parameter number 1 which is "master fine tuning". Alternatively, you can select a device-specific parameter ("not registered" with the MIDI association) by assigning the parameter number into controls 98 and 99 (e.g. B0 62 08 / B0 63 01) for parameter number 0x88, which is "vibrato rate", at least on some MIDI devices.

After you have selected a "registered parameter number" or "non-registered parameter number", you can change that parameter by assigning a value to control number 6.

Reply 2 of 14, by llm

User metadata
Rank Member
Rank
Member
mkarcher wrote on 2021-06-27, 21:02:

A "data entry" control change message shouldn't come on its own. It's part of the RPN/NRPN system. You first have to select a parameter number by writing an officially assigned 14-bit parameter number into controls 100 and 101 (B0 64 01 / B0 65 00) devices.

ok before are two msg in this order
B0 65 0
B0 64 0
B0 6 and changing 3rd byte

Reply 3 of 14, by mkarcher

User metadata
Rank l33t
Rank
l33t
llm wrote on 2021-06-27, 21:33:
ok before are two msg in this order B0 65 0 B0 64 0 B0 6 and changing 3rd byte […]
Show full quote

ok before are two msg in this order
B0 65 0
B0 64 0
B0 6 and changing 3rd byte

OK, so previous two messages select the "pitch bend range" registered parameter by its "registered parameter number" 0.

If that parameter is selected, the third byte of B0 06 xx specifies how many semitones you can bend the pitch using the pitch wheel command (E0 xx yy). While E0 40 00 always results in unbent pitch, E0 00 00 results in a downwards bend by the specified number of semitones and E0 7F 7F results in an upward bend by that many semitones.

Reply 5 of 14, by mkarcher

User metadata
Rank l33t
Rank
l33t
llm wrote on 2021-06-27, 21:59:

thank you for the detailed description, do you know any documents, links containing this details

It's MIDI experience, combined with the RPN page you alread linked in your first post and the pitch wheel explanation from the same site.

Reply 6 of 14, by sergm

User metadata
Rank Oldbie
Rank
Oldbie

BTW note, this stuff only works with newer MT-32 compatible hardware. The original "old" MT-32 ignores RPN controls altogether, and the pitch bender range can only be set via the respective SysEx messages.

Reply 7 of 14, by llm

User metadata
Rank Member
Rank
Member
sergm wrote on 2021-06-28, 05:27:

BTW note, this stuff only works with newer MT-32 compatible hardware. The original "old" MT-32 ignores RPN controls altogether, and the pitch bender range can only be set via the respective SysEx messages.

the game midi code im reversing contains both message types

Brøderbund versions
Stunts 1.0 (05 Oct. 1990) uses RPN conntrols to set pitch bender
Stunts 1.1 (12 Feb. 1991) uses SysEx message for the pitch bender (but the code seems to contain bugs)

Reply 8 of 14, by llm

User metadata
Rank Member
Rank
Member

this is the reversed function - the game code missing the fine (0x26) data entry entry set - still valid this way - or a bug in the old code?

static inline void near send_control_change_midi_msg(uint8_t channel_, uint8_t controller_nr, uint8_t controller_value_){...}

static inline void near set_pitch_bend_range_coarse_adjustment(uint8_t channel_, uint8_t semitones_)
{
//http://midi.teragonaudio.com/tech/midispec/rpn.htm
// Pitch Bend Range (ie, Sensitivity)
send_control_change_midi_msg(channel_, 100, 0); // RPN fine (100), Pitch Bend Range
send_control_change_midi_msg(channel_, 101, 0); // RPN coarse (101), Pitch Bend Range

// The coarse adjustment (usually set via Data Entry 6) sets the range in semitones.
send_control_change_midi_msg(channel_, 6, semitones_);
}

the original assembler code is a litte bit longer 😀

Reply 9 of 14, by sergm

User metadata
Rank Oldbie
Rank
Oldbie

AFAICT, this is totally correct with respect to the MIDI implementation of MT-32 ver. 2.0. Real devices only care about the MSB of the bender range, and that is clamped to the valid value range of 0..24 further. LSB is completely ignored.

Reply 10 of 14, by mkarcher

User metadata
Rank l33t
Rank
l33t
llm wrote on 2021-06-28, 08:37:

this is the reversed function - the game code missing the fine (0x26) data entry entry set - still valid this way - or a bug in the old code?

Perfectly valid. In hardware that supports fine adjustment of the bend range (as you already heard, the MT32 does not), the default value is zero. Not changing the zero is fine.

Reply 13 of 14, by llm

User metadata
Rank Member
Rank
Member

found it!

void Part::setDataEntryMSB(unsigned char midiDataEntryMSB) {
if (nrpn) {
// The last RPN-related control change was for an NRPN,
// which the real synths don't support.
return;
}
if (rpn != 0) {
// The RPN has been set to something other than 0,
// which is the only RPN that these synths support
return;
}
patchTemp->patch.benderRange = midiDataEntryMSB > 24 ? 24 : midiDataEntryMSB; <==========================
updatePitchBenderRange();
}

Reply 14 of 14, by Spikey

User metadata
Rank Oldbie
Rank
Oldbie

These are GM parameters. From what I understand, the MT-32 doesn't support them. Almost all Sierra games use the default bender, some occasional ones like PQ2 and PQ3 change it for one track in their soundtrack.