MIDI pitch bend vs MIDI Tuning Standard: microtones
I'm working on a project that generates music. It allows the user to select a wide variety of tunings (n-EDO up to 49000, etc).
I have two methods implemented so far and both rely on MIDI.
Using the MIDI Tuning Standard I send a sysreq with each note corresponding to the required audio frequency of the tuning. The problem -- and this might only be an issue with Timidity -- is that I can only have one note sounding at a time, period. Across all channels. Just one note.
Using MIDI pitch bend which because the pitch bend applies to all notes on a given channel means you can have only 16 notes playing at a time (given that you want each note to have its own pitch bend).
Ok, here's where it gets odd. Using the MTS approach I get 16,384 tones between the base note and the next semitone. Eg, between C and C# there are 16,384 notes.
With pitch bend I get 16,384 stretched between two whole tones (four semitones). Starting with the base note you get +8192 tones to the next whole tone or -8192 tones to the next lower whole tone.
So both approaches use 16,384 values but pitch bend is stretched across two whole tones while the MTS method is compressed to just one semitone.
For evidence here is output from my program showing the pitch bend and sysreq values calculated and that produce the exact same result:
note: 1 pitch = 60 bend = 0.0 sysreq_value = 0.0
note: 2 pitch = 60 bend = 2048.0 sysreq_value = 8192.0
note: 3 pitch = 60 bend = 4096.0 sysreq_value = 16384.0
Note 3 is equivalent to pitch 61 in both approaches with note 2 being a quarter tone.
My questions, does my analysis make sense? And is it possible to tell Timidity (or any MIDI player) to use all 16,384 values of pitch bend for just the one semitone, like some kind of sysreq command at the beginning of the file? Clearly Timidity has the ability to use 16,384 between each semitone it's just a matter of convincing it to.
Update: It now appears that Fluidsynth can use up to 256 channels so that solves one of my problems. Apparently it does not support the MTS so I would have to use pitch bend with it but now the question applies to Fluidsynth -- is there a way to tell it to use 16,384 values for the notes between semitones?
1 Comments
Sorted by latest first Latest Oldest Best
You can change the range of the pitch bend using RPN messages. See www.midikits.net/midi_analyser/pitch_bend.htm, or google "set MIDI pitch bend range" if that link disappears for some reason.
Pitch bend affects all notes on a MIDI channel. If you want to have more polyphony than 16 (one note per channel) while using pitch bend in a way that it was not intended for, the easiest solution is probably to use several MIDI players in parallel and combine the audio output.
You might want to consider setting up the whole playback configuration inside a VST host.
Note, although in theory you can specify pitch bends and tuning commands to high accuracy, there is no guarantee that the player will interpret the commands to the same accuracy. Some players will round the pitch to the nearest cent, i.e. 100 steps per semitone or 1200 steps per octave.
Alternatively, generate the sounds yourself with something like en.wikipedia.org/wiki/Csound.
Terms of Use Privacy policy Contact About Cancellation policy © freshhoot.com2026 All Rights reserved.