1

I have a midi file, which is converted to .csv file using midicsv.exe utility taken from here: http://www.fourmilab.ch/webtools/midicsv/

Part of csv file:

1, 278400, Tempo, 400454
1,278400,Note_on_c,0,67,G4,0
1,278400,Note_on_c,0,73,Cs5,0
1,278400,Note_on_c,0,74,D5,53
*1,278400,Note_on_c,0,54,Fs3,47*
1, 278400, Control_c, 0, 64, 0
1, 278415, Tempo, 420080
*1,278520,Note_on_c,0,54,Fs3,0*
1,278520,Note_on_c,0,74,D5,0
1,278520,Note_on_c,0,76,E5,53
1,278520,Note_on_c,0,62,D4,39

In which tempo the note 54/Fs3 is played?

The tempo 400454 is coming before the line

1,278400,Note_on_c,0,54,Fs3,47

and tempo 420080 is coming before the line

1,278520,Note_on_c,0,54,Fs3,0.

Is the midi to csv conversion correct?

3

First of all, there is no such thing as "note" in MIDI. Note in fact is a pair of Note On / Note Off events.

It's absolutely OK to have tempo changes anywhere in a MIDI file. It's just a MIDI event like any other. So Tempo event between Note On and Note Off just affects when Note Off event will be played.

So, for example, if the initial tempo is 120BPM and there is tempo change event of 240BPM between Note On and Note Off, Note Off event will be played earlier by 2 times (from point of tempo change).

You can also think about Tempo events as a modifier of MIDI tick duration. If 1 tick with 120BPM equals to 1 second (it's just for example, in general case it's wrong), then 1 tick with 240BPM will equal to 0.5 second.

Imagine following events:

Events  |  Tempo(120BPM)   NOn   NOff
Time    |  0               100   500

Here Note On event will be played after 100 seconds from the start of file, and Note Off one will be played after 500 seconds from start. But if we'll add Tempo change:

Events  |  Tempo(120BPM)   NOn   Tempo(240BPM)   NOff
Time    |  0               100   400             500

then Note On event will be played after 100 seconds from the start of file again, BUT Note Off one will be played after 400 + (500 - 400) * 0.5 = 450 seconds.

Is the midi to csv conversion correct?

You can provide the file and I'll look into it to answer on the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.