[sdiy] re: coron midi issue

m.bareille m.bareille at free.fr
Thu Jul 18 13:36:09 CEST 2002


>  midi clock is song position pointer

No.... That is why i have renamed my project , to avoid confusion beeween both kind of messages. ( Damned ! Jim was rigth ..)
The song position pointer  is a locator function to force a device to go to an indicated position  in the song . The MIDI clock is a single byte message
to pulse other device at the same speed, independently of the position in the song . The MIDI clock will not tell your sequencer to go to 12.2.4.203
locator position in song....To clarify the situation, here is a resume of what say my MIDI specification file  about clock, Time code messages and RT
messages. This file is the "Bible" i use to code MIDI programs...sorry it is  a bit long but i hope this will help for a better understanding of those
messages.

Best Regards

Marc

( from www.midifarm.com i think but not sure)
-------------------------------------------------------------------------------

RealTime Category Messages

Each RealTime Category message (ie, Status of 0xF8 to 0xFF) consists of only 1 byte, the Status. These messages are primarily concerned with
timing/syncing functions which means that they must be sent and received at specific times without any delays. Because of this, MIDI allows a RealTime
message to be sent at any time, even interspersed within some other MIDI message. For example, a RealTime message could be sent inbetween the two data
bytes of a Note On message. A device should always be prepared to handle such a situation; processing the 1 byte RealTime message, and then subsequently
resume processing the previously interrupted message as if the RealTime message had never occurred.


-------------------------------------------------------------------------------
MIDI Clock

Category: System Realtime

Purpose
Some master device that controls sequence playback sends this timing message to keep a slave device in sync with the master. A MIDI Clock message is
sent at regular intervals (based upon the master's Tempo) in order to accomplish this.

Status  0xF8

Data None

Errata
There are 24 MIDI Clocks in every quarter note. (12 MIDI Clocks in an eighth note, 6 MIDI Clocks in a 16th, etc). Therefore, when a slave device counts
down the receipt of 24 MIDI Clock messages, it knows that one quarter note has passed. When the slave counts off another 24 MIDI Clock messages, it
knows that another quarter note has passed. Etc. Of course, the rate that the master sends these messages is based upon the master's tempo. For example,
for a tempo of 120 BPM (ie, there are 120 quarter notes in every minute), the master sends a MIDI clock every 20833 microseconds. (ie, There are
1,000,000 microseconds in a second. Therefore, there are 60,000,000 microseconds in a minute. At a tempo of 120 BPM, there are 120 quarter notes per
minute. There are 24 MIDI clocks in each quarter note. Therefore, there should be 24 * 120 MIDI Clocks per minute. So, each MIDI Clock is sent at a rate
of 60,000,000/(24 * 120) microseconds).

A device might receive a Song Select message to cue a specific song to play (out of several songs), a Song Position Pointer message to cue that song to
start on a particular beat, a MIDI Continue in order to start playback from that beat, periodic MIDI Clocks in order to keep the playback in sync with
another sequencer, and finally a MIDI Stop to halt playback.
--------------------------------------------------------------------------------
MIDI Start

Category: System Realtime

Purpose
Some master device that controls sequence playback sends this message to make a slave device start playback of some song/sequence from the beginning
(ie, MIDI Beat 0).

Status 0xFA

Data  None

Errata
A MIDI Start always begins playback at MIDI Beat 0 (ie, the very beginning of the song). So, when a slave device receives a MIDI Start, it automatically
resets its "Song Position" to 0. If the device needs to start playback at some other point (either set by a previous Song Position Pointer message, or
manually by the musician), then MIDI Continue is used instead of MIDI Start.

Often, the slave device has its playback tempo synced to the master via MIDI Clock. See Syncing Sequence Playback.
--------------------------------------------------------------------------------
MIDI Continue

Category: System Realtime

Purpose
Some master device that controls sequence playback sends this message to make a slave device resume playback from its current "Song Position". The
current Song Position is the point when the song/sequence was previously stopped, or previously cued with a Song Position Pointer message.

Status  0xFB

Data  None

Errata
Often, the slave device has its playback tempo synced to the master via MIDI Clock. See Syncing Sequence Playback.
--------------------------------------------------------------------------------
MIDI Stop

Category: System Realtime

Purpose
Some master device that controls sequence playback sends this message to make a slave device stop playback of a song/sequence.

Status 0xFC

Data None

Errata
When a device receives a MIDI Stop, it should keep track of the point at which it stopped playback (ie, its stopped "Song Position"), in the
anticipation that a MIDI Continue might be received next.
--------------------------------------------------------------------------------
MTC Quarter Frame Message

Category: System Common

Purpose
Some master device that controls sequence playback sends this timing message to keep a slave device in sync with the master.

Status
0xF1

Data
One data byte follows the Status. It's the time code value, a number from 0 to 127.

Errata
This is one of the MIDI Time Code (MTC) series of messages. See MIDI Time Code.

--------------------------------------------------------------------------------
Song Position Pointer

Category: System Common

Purpose
Some master device that controls sequence playback sends this message to force a slave device to cue the playback to a certain point in the
song/sequence. In other words, this message sets the device's "Song Position". This message doesn't actually start the playback. It just sets up the
device to be "ready to play" at a particular point in the song.

Status
0xF2

Data
Two data bytes follow the status. Just like with the Pitch Wheel, these two bytes are combined into a 14-bit value. (See Pitch Wheel remarks). This
14-bit value is the MIDI Beat upon which to start the song. Songs are always assumed to start on a MIDI Beat of 0. Each MIDI Beat spans 6 MIDI Clocks.
In other words, each MIDI Beat is a 16th note (since there are 24 MIDI Clocks in a quarter note).

Errata
Example: If a Song Position value of 8 is received, then a sequencer (or drum box) should cue playback to the third quarter note of the song. (8 MIDI
beats * 6 MIDI clocks per MIDI beat = 48 MIDI Clocks. Since there are 24 MIDI Clocks in a quarter note, the first quarter occurs on a time of 0 MIDI
Clocks, the second quarter note occurs upon the 24th MIDI Clock, and the third quarter note occurs on the 48th MIDI Clock).

Often, the slave device has its playback tempo synced to the master via MIDI Clock

--------------------------------------------------------------------------------
Song Select

Category: System Common

Purpose
Some master device that controls sequence playback sends this message to force a slave device to set a certain song for playback (ie, sequencing).

Status
0xF3

Data
One data byte follows the status. It's the song number, a value from 0 to 127.

Errata
Most devices display "song numbers" starting from 1 instead of 0. Some devices even use different labeling systems for songs, ie, bank 1, number 1 song.
But, a Song Select message with song number 0 should always select the first song.

When a device receives a Song Select message, it should cue the new song at MIDI Beat 0 (ie, the very beginning of the song), unless a subsequent Song
Position Pointer message is received for a different MIDI Beat. In other words, the device resets its "Song Position" to 0.

Often, the slave device has its playback tempo synced to the master via MIDI Clock. See Syncing Sequence Playback.

--------------------------------------------------------------------------------






More information about the Synth-diy mailing list