[py] fix note-off timings (closes #240, thanks to @chaoxinzheng)
authorPaul Brossier <piem@piem.org>
Tue, 26 Mar 2019 14:55:17 +0000 (15:55 +0100)
committerPaul Brossier <piem@piem.org>
Tue, 26 Mar 2019 14:55:17 +0000 (15:55 +0100)
python/demos/demo_wav2midi.py

index 48c2d0a..8caa3ae 100755 (executable)
@@ -63,7 +63,7 @@ while True:
         delta = frames2tick(total_frames) - last_time
         if new_note[2] > 0:
             track.append(Message('note_off', note=int(new_note[2]),
-                velocity=127, time=0)
+                velocity=127, time=delta)
                 )
         track.append(Message('note_on',
             note=int(new_note[0]),