Matthew
Matthew

Reputation: 21

How can I obtain timing data from a MIDI file?

I have a bunch of MIDI files which I need to process. For each of these, I have to find the exact millisecond certain chords began. How can I go about doing this? The libraries I've found so far haven't been all that helpful.

Is there a way to just print a list of notes and timestamps of a MIDI file?

Upvotes: 1

Views: 995

Answers (1)

Нет войне
Нет войне

Reputation: 1139

The easiest way to print a list of notes and timestamps would be to use a MIDI to text conversion program. Googling 'midi to text' yields a few - for example, mf2t. However, MIDI files do not store timestamps of events in seconds or milliseconds, but rather delta times in ticks - try googling 'midi file delta time'.

Your choice is probably between:

  • using a MIDI to text program, parsing the text output and doing the conversion to milliseconds yourself - perhaps using e.g. Excel

  • using a MIDI library (for suggestions, tell us what language you're coding in) to read the note events and converting them to milliseconds directly, avoiding the text parsing step

Upvotes: 1

Related Questions