Does delta time still process the same way mathematically if the file uses SMPTE?
Delta times are the number of so-called "ticks" since the previous message in the track. The MIDI file header indicates the format of the ticks (ticks per quarter note or ticks per frame).
The initial handling is the same:
• You still process the delta time bytes as a variable-length quantity no matter what format the ticks represent.
• At the beginning of each track you would reset a tick counter to zero. Each time you encounter a delta time, you increment the tick counter by that delta time's value to get the event's absolute tick position.
The handling begins to be different once you need to get the positions of events in quarter notes or in seconds. The conversion calculations you use depends on the delta time format the MIDI file uses:
• In the ticks per quarter note format, the ticks represent some amount of quarter notes. If you need the absolute time in seconds, you have to convert the quarter note amount into a seconds amount.
• In the SMPTE delta time (ticks per frame) format, the ticks represent some amount of seconds. If you need the position in quarter notes, you have to convert the seconds amount into a quarter notes amount.
SMPTE-RELATED THINGS
Be aware that even though the SMPTE delta time format, the SMPTE Offset meta event, and MIDI Time Code are all related to SMPTE time codes (hours:minutes:seconds:frames), my understanding is there's no requirement that a MIDI sequencer must use all of them together for a particular MIDI file. (For example, the MIDI file you attached contains the SMPTE Offset meta event, but uses the ticks per quarter note format of delta time.)
Delta times
As you know, the position of every event in the MIDI file is specified in delta times, the number of so-called "ticks" since the previous message in the track.
There are two kinds of delta time formats possible: Delta times can be based on quarter notes (ticks per quarter note) or based on seconds (SMPTE format). The MThd header chunk of the MIDI file specifies the format of the delta times.
If the delta times are based on quarter notes, the header specifies a value of
ticks per quarter note.
If the delta times are based on seconds, then the header specifies values for
frames per second and
ticks per frame.
For information about the delta time format bytes in the header, see the
Standard MIDI Files Specification PDF page 6 (printed page 4). (Be aware there is a special frames per second value possible called "30 drop frame" that the MIDI File Specification doesn't explain. I can explain my understanding of it if you want, but it gets complicated.)
SMPTE Offset meta event
My understanding is the SMPTE Offset meta event can be stored at the beginning of a MIDI file's tempo track for use by a MIDI player that is able to sync with a tape system that uses SMPTE timecodes. For example, you could start playing a tape that has SMPTE timecode information recorded on it, and once the timecode on the tape matches the SMPTE Offset value, the MIDI player will start playing the MIDI file. If you are creating MIDI software that doesn't need this kind of sync capability, then you can just skip over the SMPTE Offset meta event if it is present, you don't need to do anything with it.
For the description of the SMPTE Offset meta event, see the the
Standard MIDI Files Specification PDF page 11 (printed page 9).
MIDI clocks and MIDI Time Code
MIDI clocks and MIDI Time Code are two different kinds of sync messages. These messages aren't stored in a MIDI file, but they might be sent from a MIDI sequencer to another device, or might be sent from another device to a MIDI sequencer, to help synchronize the two devices.
MIDI Clocks and Song Position Pointer are based on quarter notes:
• Clock messages are sent at a rate of 24 clocks per quarter note to indicate the current tempo.
• A Song Position Pointer message can be sent to change the current position in units of sixteenth notes.
MIDI Time Code is based on seconds:
• The Quarter Frame message is sent at a rate of four messages per frame. For example, when the frame rate is 30 frames per second, then the Quarter Frame messages happen 120 times per second. Quarter Frame messages contain information about the time position (hours:minutes:seconds:frames), but the information is spread out over 8 messages.
• The Full message is a Universal System Exclusive message that can be sent to change the current position to a specific hours:minutes:seconds:frames position.
For information about MIDI clock messages see the
MIDI 1.0 Detailed Specification PDF pages 35 to 37 (printed pages 30 to 32).
For information about Song Position Pointer, see the
MIDI 1.0 Detailed Specification PDF pages 32 to 34 (printed pages 27 to 29).
For information about MIDI Time Code, see the
MIDI Time Code specification.
The division value of 480 ticks per quarter note [is] fairly high
It's always good to check the data types being used to make sure there's no overflow happening. But I believe 480 ticks per quarter note is a typical amount. My understanding is that it is common for the ticks per quarter note value to be some multiple of 24 up to about 960. For example, Cakewalk lets you choose the from the following values for ticks per quarter note: 48, 72, 96, 120, 144, 168, 192, 216, 240, 360, 384, 480, 600, 720, or 960. (The reason behind using a multiple of 24 is because it is helpful if MIDI clocks are used for synchronization. There are 24 MIDI clocks per quarter note, so when the ticks per quarter note is a multiple of 24, there will be an integer number of ticks per MIDI clock.)