Pitch Bend Ranges

Christopher's icon

Hi guys!

I don't get the math: How do I scale cent values to midi pitch bend range (64-127, only upwards) for devices outside my patch??? Using a scale object with an exponential I get it for a maximum pitch bend of a semitone. But Live's Operator for example has a pitch bend range of 5 semitones over 64-127. I need the correct value to get that microtone in there.

thx for your help

Max Patch
Copy patch and select New From Clipboard in Max.

Christopher Dobrian's icon

It's hard for me to tell exactly what you're trying to do, but here are some factoids of which you should be aware when trying to get specific pitches or specific frequencies with MIDI pitch bend messages.

1) Pitch is not the same as frequency. Not only are pitch (in MIDI terminology) and audible frequency (in Hertz) different numerical ranges, they are in a specific logarithmic relationship.
Translating pitch and frequency in Max

2) MIDI pitch bend messages are meant to cause changes in pitch (not frequency). A MIDI note message specifies the intended fundamental pitch of a note, and a MIDI pitch bend message specifies a pitch offset by some amount from the fundamental pitch of the note.

3) The amount of pitch offset caused by a pitchbend message is not part of the MIDI specification; it is determined by the receiving device. Generally that's specifiable as a setting in the receiving device, where the ± range of possible pitch offset is set. The norm is ±2 equal-tempered semitones, but many synths allow the user to set that range to something different.

3) A MIDI pitchbend message contains two data bytes which are combined to make a 14-bit number. You can think of those two bytes as a "fine" value and a "coarse" value. Each data byte goes from 0 to 127, and combining them as a 14-bit number gives a range from 0 to 16,383 (sometimes expressed in end-user applications as -8,192 to 8,191). So, for example a MIDI pitchbend message might look like 224 0 64, where 224 is the status byte, 0 is the "fine" value, and 64 is the "coarse" value; the 14-bit value is 8192 (64 left-shifted seven bits is 10000000000000).
Managing MIDI pitchbend messages

4) Not all devices use the first ("fine") data byte, but you might as well use it, especially when trying to achieve very specific microtonal pitch offsets.

5) The Max objects bendin, bendout, midiparse, and midiformat ignore the existence of the LSB (fine data byte). To send out a 14-bit MIDI pitchbend message, you can use xbendout or xbendout2 in combination with midiout.

6) So, just as one example, if your receiving device is set to ±2 semitones for its pitchbend range, that means that you have 16,383 quanta with which to describe pitch gradations within an interval of an equal-tempered major third. That means that you have 8,191 gradations within the interval of a whole tone. In most theoretical discourse pitch quanta are specified in "cents", 1/100 of an equal-tempered semitone, thus there are 200 cents in a whole tone. You can see that MIDI potentially allows you even finer control than most humans can discern.

Christopher's icon

Thx a million!!! :))