back to list

tutorial on MIDI tuning

🔗monz <monz@attglobal.net>

7/10/2003 10:59:03 PM

hi Joe,

> From: "Joseph Pehrson" <jpehrson@rcn.com>
> To: <tuning@yahoogroups.com>
> Sent: Thursday, July 10, 2003 6:24 PM
> Subject: [tuning] Re: MTS (was: Fwd: [tuning-math] Mu explained)
>
>
> ***TX81Zs are 1.56 cents maximum resolution.
> I think that's a pretty common one for some
> other synths as well...

this thread began over the weekend, while you
were away from the list.

yes, in fact, the resolution you give here for
the TX81Z, and the statement that it's "pretty
common", has been under much discussion over
the last few days.

this resolution, which actually is exactly
1.5625 = 1 & 9/16 cents, is 768edo. it is
indeed the tuning resolution on a vast number
of pieces of MIDI hardware, including my own
soundcard, as i just found out yesterday.

this resolution is the result of using 6 bits
of data per 12edo semitone.

i have proposed 768edo as a MIDI _de facto_
tuning standard because the vast majority of
MIDI instruments tune to a resolution of one
byte of tuning data, ignoring the other byte
of the 2-byte pitch-bend data word.

this byte (8 bits) uses its most significant
digit, which represents 2^7 = 128, set to 0
to indicate to the hardware that this is a
data byte.

likewise, in MIDI, all status bytes (which are
the actual commands, i.e. "pitch-bend", "note-on",
"control change", etc.) have the most significant
bit set to 1, to indicate to the hardware that
this is a status byte.

therefore, because one bit is being used as
a status/data flag, there are only 7 bits available
for use as the actual data of the pitch-bend
command.

for example, here's a command to send a pitch-bend
to channel 1 :

128 64 32 16 8 4 2 1 = decimal value of bit
1 1 1 0 0 0 0 0 = binary value of bit

because the first bit is 1, that tells the hardware
that this is a status byte and not data.

the next 3 bits specify exactly which type of
command this is. in this case, the 1 1 0 are
defined as a pitch-bend command.

the last 4 bits specify the MIDI channel number.
internally the channels are stored as 0 to 15,
but humans (and software used by humans)
generally translate that to 1 to 16. in this
particular example, all the bits are zero, so
that's MIDI channel 1.

if for some reason someone needs to know the
decimal equivalents of these bits, a whole byte
is usually converted to decimal number. the
decimal value for my example here is 224, which
is the first number which specifies a pitch-bend.

239 is the last decimal number which specifies a
pitch-bend, since it designates a pitch-bend
on channel 16, thus:

128 64 32 16 8 4 2 1 = decimal value of bit
1 1 1 0 1 1 1 1 = binary value of bit

the first nibble (4 bits) is the same as before:
a status bit and 3 bits specifying that status as
"pitch-bend".

the final nibble, with all 4 bits set to 1, is
at its highest value, which equals 15. this
translates into MIDI channel 16, the maximum
number of MIDI channels available. now you
know why there's a limitation to 16 channels
in MIDI.

now, after a status byte containing a pitch-bend
command, the hardware expects 2 data bytes to follow.
together they make up the MIDI "data word".

however, most hardware actually ignores the LSB
(least significant byte, i.e., the one with the
lower numerical value). this, in effect, truncates
any high-resolution MIDI pitch-bend data by dividing
it by whatever power of 2 makes the difference between
it and the truncated value (this divisor is typically 64),
and then lopping off the decimal part, thus giving
64 units per semitone.

now you're in a position to understand what i wrote here:
/tuning/topicId_45398.html#45412

which actually explains how the truncation of the
tuning data operates.

-monz

🔗Joseph Pehrson <jpehrson@rcn.com>

7/11/2003 7:41:19 PM

--- In tuning@yahoogroups.com, "monz" <monz@a...> wrote:

/tuning/topicId_45460.html#45460

>
> now you're in a position to understand what i wrote here:
> /tuning/topicId_45398.html#45412
>
> which actually explains how the truncation of the
> tuning data operates.
>

***Thanks so much, Monz for your understandable explanation in this
post. I hope that material is also on your Definitions Website,
since it helps to "demystify" the MIDI mania...

Joe