Skip to content

offset/starting time issue of a MIDI file #261

Answered by melanchall
tracyhenry asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Hmm,. interesting. Can you show me the getAbsoluteTimeInSecondsOfSpan method? In your code I don't see usage of DryWetMIDI API to get the time.

Update

Thanks, I see the code now.

Short answer

DryWetMIDI works correctly.

Long answer

Well, I've parsed the file with DryWetMIDI and here what we have:

  • Time of the note in ticks is 5868.
  • The file has tempo (T) change at 1920 ticks, tempo changes to 600,000 μs (microseconds) per quarter note.
  • Time division of the file is 480 ticks per quarter note (TPQN).

Also according to MIDI spec the default tempo is 500,000 μs per quarter note. If we know TPQN and T, we can always calculate the length of a tick in microseconds:

$$\frac{T}{TPQN}$$

So sin…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@tracyhenry
Comment options

@melanchall
Comment options

@tracyhenry
Comment options

@tracyhenry
Comment options

@melanchall
Comment options

Answer selected by tracyhenry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Just question about the library
2 participants