NFJones/audio-to-midi

output midi files bear little resemblance to input audio

Opened this issue · 0 comments

From a simple midi file with the following content (quarter notes C, D, E, F)

0, 0, Header, 1, 2, 480
1, 0, Start_track
1, 0, Program_c, 0, 0
1, 0, Note_on_c, 0, 60, 100
1, 480, Note_off_c, 0, 60, 64
1, 480, Note_on_c, 0, 62, 100
1, 960, Note_off_c, 0, 62, 64
1, 960, Note_on_c, 0, 64, 100
1, 1440, Note_off_c, 0, 64, 64
1, 1440, Note_on_c, 0, 65, 100
1, 1920, Note_off_c, 0, 65, 64
1, 192000, End_track
0, 0, End_of_file

I create a wave file using timidity like so:

timidity c-d-e-f.mid -Ow

I then try to get a midi file from the wave file timidity created like so:

audio-to-midi c-d-e-f.wav -b 120 -t 30

But the result bears no resemblance to the input, and there is not a single Note_off event, only Note_on events.

0, 0, Header, 1, 1, 500
1, 0, Start_track
1, 30, Note_on_c, 1, 72, 2
1, 60, Note_on_c, 1, 72, 0
1, 60, Note_on_c, 1, 72, 3
1, 90, Note_on_c, 1, 72, 0
1, 90, Note_on_c, 1, 72, 3
1, 120, Note_on_c, 1, 72, 0
...
1, 990, Note_on_c, 1, 74, 0
1, 990, Note_on_c, 1, 74, 2
1, 1020, Note_on_c, 1, 74, 0
1, 1021, End_track
0, 0, End_of_file

I guess I must be doing something terribly wrong.

This is how I built the tool:

git clone https://github.com/NFJones/audio-to-midi
cd audio-to-midi
python3 ./setup.py install --user

Any help is appreciated.

N.B. The csv representation of midi files above was created using midicsv.