Mechanical Music Digest  Archives
You Are Not Logged In Login/Get New Account
Please Log In. Accounts are free!
Logged In users are granted additional features including a more current version of the Archives and a simplified process for submitting articles.
Home Archives Calendar Gallery Store Links Info
MMD > Archives > May 1999 > 1999.05.20 > 11Prev  Next


External MIDI Clock Generator
By John Wale

Dear Andy,  To send a timing clock signal by MIDI, you will need to
generate a serial data stream capable of driving an opto-coupler.

The MIDI command code for timing clock is 0xF8 (hexadecimal), which in
binary is 11111000.  Conveniently, this particular bit pattern is very
simple - so simple that you probably don't need a proper parallel to
serial converter to generate it.

MIDI is an asynchronous protocol, so each group of 8 bits have to be
prefixed with a start bit and ended with a stop bit.  All bits are 32
microseconds long, and the least significant bit of the data is sent
first.

To add to the confusion, MIDI data bits are logically inverted when
they are transmitted, start bits are high and stop bits are low.  So
our sequence of 10 bits to send a timing clock message looks like this:

 . . . . 1 1 1 1 0 0 0 0 0 0 . . . .
         | |             | |
         | |             | |_Stop bit
         | |             |
         | |             |_Data bit 7
         | |
         | |_Data bit 0
         |
         |_Start bit

What this all reduces to is that you have to pull the MIDI line up
for 4 bit times (128 usec), then hold it low for 6 bit times (192
usec).  After this, keep the line low until you need to send the next
timing clock.  So really all you need is a monostable with a pulse
width of 128 microseconds, a trigger circuit that ensures that pulses
don't run together and to make sure that you don't trigger off pulses
more often than once per 320 usec.

To actually drive the MIDI input of your sequencer needs a few
milliamps.  A 74HC series CMOS logic chip should have enough capability
(not 74LS TTL!) with 220 ohm resistors on the output like this :

             |\       220R
74HC gate  __| \_____/\/\/\____ Pin 5 of MIDI socket
             | /
             |/       220R
                  ___/\/\/\____ Pin 4 of MIDI socket
                 |
    Ground (0V) _|_

If you look into a MIDI socket, the connections are numbered like this :

        1 o       3 o
         4 o     5 o
             2 o

For a pulse to be recognised as a valid MIDI command, the timing needs
to be right to within a few percent.  Ideally, you should use a crystal
clock oscillator divided down with counting logic, but you might just
get away with an analogue monostable if you use low-drift components
(e.g. polystyrene capacitors).

Remember that there are normally a lot of MIDI timing clocks to the
crotchet (quarter-note) - typically 96, 192 or 384.  You will probably
need some type of counter to clock out a fixed number of pulses every
time the pedal is pressed, otherwise you'll have to press the pedal a
lot of times!

I hope all of this is of some use.

Regards,

John Wale.
jw Electronics,
Coventry, UK

 [ Master Tracks Pro generates 20 internal ticks for each external
 [ pulse received.  Since it defines 240 ticks as equal to one beat,
 [ this is 12 external pulses per beat, just what Andy wants !
 [ -- Robbie


(Message sent Thu 20 May 1999, 11:49:34 GMT, from time zone GMT+0100.)

Key Words in Subject:  Clock, External, Generator, MIDI

Home    Archives    Calendar    Gallery    Store    Links    Info   


Enter text below to search the MMD Website with Google



CONTACT FORM: Click HERE to write to the editor, or to post a message about Mechanical Musical Instruments to the MMD

Unless otherwise noted, all opinions are those of the individual authors and may not represent those of the editors. Compilation copyright 1995-2024 by Jody Kravitz.

Please read our Republication Policy before copying information from or creating links to this web site.

Click HERE to contact the webmaster regarding problems with the website.

Please support publication of the MMD by donating online

Please Support Publication of the MMD with your Generous Donation

Pay via PayPal

No PayPal account required

                                     
Translate This Page