fbpx
Skip to main content

MIDI Forum

(Old item Jan 2021)...
 
Notifications
Clear all

(Old item Jan 2021) deltaTime between events

4 Posts
3 Users
0 Reactions
9,833 Views
Pawel
Posts: 2
New Member
Topic starter
 

There is no problem with deltaTime between events in the midi = 0 file format - there is only one track and all events are referenced to the preceding event.
However, how the deltaTime should be interpreted for midi files in other formats? Is it a distance from the previous event in the scope of the entire MIDI file or in the scope of a given track/chunk?

 
Posted : 06/01/2021 8:29 am
Sema
 Sema
Posts: 179
Reputable Member
 

Delta time is the distance from the previous event in the same track.

 
Posted : 06/01/2021 9:51 am
Pedro Lopez-Cabanillas
Posts: 154
Estimable Member
 

The spec says:

=

is stored as a variable-length quantity. It represents the amount of time before
the following event. If the first event in a track occurs at the very beginning of a track, or if
two events occur simultaneously, a delta-time of zero is used. Delta-times are always present.
(Not storing delta-times of 0 requires at least two bytes for any other value, and most delta-
times aren't zero.) Delta-time is in ticks as specified in the header chunk.

= | |

is any MIDI channel message. Running status is used: status bytes of MIDI
channel messages may be omitted if the preceding event is a MIDI channel message with the
same status. The first event in each MTrk chunk must specify status. Delta-time is not
considered an event itself: it is an integral part of the syntax for an MTrk event. Notice that
running status occurs across delta-times.

It doesn't matter if the file has a single track (like in format 0) or has several tracks, the delta time is always the amount of time before
the following event in that track.

 
Posted : 06/01/2021 9:57 am
Pawel
Posts: 2
New Member
Topic starter
 

Thank you.
Have a great day.

 
Posted : 06/01/2021 4:29 pm
Share: