ALL ABOUT THE MIDI INTERFACE OF THE ATARI ST SERIES
by Frank Lemmen
Originally published in ST NEWS Volume 1 Issue 4, launched on
September 7th 1986.
MIDI (Musical Instrument Digital Interface) has become a standard
since several of the largest synthesizer manufacturers decided to
use one system to exchange information between synthesizers (all
kinds of synthesizers, and nowadays even guitars, bass guitars,
mixing panels, lighting equipment, etc.).
The MIDI interface works just like the interface that's used to
connect a modem to your computer (and some printers, too).
MIDI IS A SERIAL INTERFACE
This interface, known as the 'RS232 interface' works in a serial
way. That means that information is send down the line in one-by-
one format; just like many people entering a house with only one
door (they can't go in all at the same time).
The people that decided to use the one-by-one format did so
because this system was cheap, the technology was proven and it
turned out to work very well. Another reason was that choosing the
parallel option (which can be compared with many doors) would mean
thicker cables, expensive connectors and an interface that is not
yet as much in fashion as it is nowadays.
BITS & BYTES
The data that is send by MIDI consists of small packages of bits
that form a number; this number tells the synth. what to do.
As you know, a BIT is nothing to get excited about (BInary digiT).
You can compare it to a switch; it's either ON (set to 1) or it's
OFF (set to 0).
For the computer it makes sense, because he (it) can translate the
bits to numbers, and the numbers to instructions, and he can
understand the instructions.
When a MIDI message is sent, first the start-bit is sent, then the
actual data follows and finally a stop-bit tells the synthesizer
or computer that the package has been delivered(10 bits in total).
The package itself consists of 8 bits and is also known as a BYTE.
A byte may hold any number in the range of 0 - 255.
SPEED
The speed at which information is sent down the cable is a clean
31250 bits per second (31250 baud).
If you want to produce this kind of speed on your keyboard or
synth, you would have to play the 'Minute Waltz' of Frederic
Chopin in one second (Please don't)!
So midi is fast.
But, the speed IS limited.
That means that if you've recorded information of a hundred
synthesizers and you would play it back it sounds different on
each one. In fact, it's not possible to send that much information
with MIDI and still have the timing right.
BUFFERING
For this purpose the computer and the synthesizer use a buffer,
which is nothing more than a place to store the information while
the waiting goes on.
In the case of a synthesizer, this buffer usually has room for 128
bytes. The computer has room for many times this amount.
When the waiting is over, the computer/synthesizer will empty its
buffer as quickly as possible; that is at maximum speed.
The first byte that went in will be the first that goes out.
This kind of buffer is also known as a FIFO buffer (First In First
Out).
This whole proces of buffering may, under extreme conditions, be
somewhat 'messy', because when you had a delay of around 1/10th of
a second, you will definately notice the sudden burst of the
emptying of the buffer.
But don't worry,this will hardly ever happen with the synthesizers
and with the computer it will probably never happen.
The reason why the effect is more noticeable with a synthesizer is
simply that the synth has to translate each message to a sound or
change of pitch,etc. and at the same time has to keep track with
all the incoming information.
So a synthesizer will almost always send and recieve at a speed
that is much slower than the 31250 bits per second that MIDI can
actually do.
The computer can send at any speed, up to the maximum, without
having to make fuzz about sounds and change parameters while it is
sending/receiving.
It will need that extra when it, for instance, sends information
to more than one synthesizer at a time.
WHAT ARE MIDI MESSAGES?
The kind of stuff that a MIDI message consists of is again nothing
more than a series of numbers which are interpreted as commands by
your synthesizer.
These commands are actually quite simple, for instance when you
hit a key on the keyboard the numbers will be something like:
BITS NUMBER/BYTE
10010000 144
01000000 64
01000000 64
(are you puzzled?, read on)
The first byte that is send (128) begins with a bit that is set
(1). This means that the number will be interpreted as a COMMAND.
If this bit would be a 0 (cleared), the number would be
interpreted as a value only.
Now, something that you need to know is that in the case of a
command byte, (or status byte),it is split in two:
1001 - 0000
The first four bits(also called a nibble) form the command and the
last four bits (again, a nibble) are the channel that the
information is sent to.
So:
1001 means: A KEY IS BEING HIT: at channel 0000. ( channel 0 )
When the synth learns about this, it ofcourse needs to know which
which note you happened to be playing.
This information is contained in the next byte:
01000000 THE NOTE IS NUMBER 64
Note 64 will usually be somewhere around the middle C on the
keyboard.
The last byte (also 64) tells the synth with which speed you hit
the keyboard.
This byte will have no meaning if you have got a synth without
touch-sensitivity; it will then just be ignored.
A MIDI MESSAGE
10010000 KEY ON,CHANNEL 0
01000000 KEY = C
01000000 SPEED = 64
The C key has been hit on channel 0 with a speed of '64'.
You see, it's quite easy.
After you've hit the key you will probably release it some time
later. Until that time you will hear the tone C.
The release of the key is also put down into a series of numbers,
very similar to the former series:
10000000 KEY OFF,CHANNEL 0
01000000 KEY = C
00000000 SPEED = 0 ( ignored )
After this message, your synth will turn off the C and you'll hear
nothing but silence.
On the whole, hitting a key on a MIDI synthesizer will produce two
series of messages, called EVENTS.
(hit the key.... release it <-> NOTE ON...NOTE OFF event)
WHAT ARE EVENTS?
An event is a series of bytes that has a particular meaning to the
synthesizer.
Just like the NOTE events I mentioned, there are events for the
use of the sustain pedal, modulation wheel, the selection of a new
sound, the pitch bender, etc.
Not all events use the same amount of bytes, but most events are
three bytes in length.
So this was the first piece of work from me; I hope you've learned
from it.
P.S. My synthesizer type is a CASIO CZ-230S,
so if you have any kind of music in whatever program
you can send it to me at our address with my name
on the top lefthand side of the envelope.
Disclaimer
The text of the articles is identical to the originals like they appeared
in old ST NEWS issues. Please take into consideration that the author(s)
was (were) a lot younger and less responsible back then. So bad jokes,
bad English, youthful arrogance, insults, bravura, over-crediting and
tastelessness should be taken with at least a grain of salt. Any contact
and/or payment information, as well as deadlines/release dates of any
kind should be regarded as outdated. Due to the fact that these pages are
not actually contained in an Atari executable here, references to scroll
texts, featured demo screens and hidden articles may also be irrelevant.