File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,10 @@ <h3>Examples</h3>
285285
286286 < div class ="container ">
287287 < h2 > Version history</ h2 >
288+ < p >
289+ v1.9c< br >
290+ Fixed an issue where tempo changes could desync
291+ </ p >
288292 < p >
289293 v1.9b< br >
290294 Fixed an issue where tempo changes were applied at the wrong time
Original file line number Diff line number Diff line change @@ -88,8 +88,8 @@ const MidiToNotes = (function () {
8888 const bType = getEventType ( b ) ;
8989
9090 // Tempo change events
91- if ( aType === "meta" && a . metaType == 81 ) aPriority = 2 ;
92- if ( bType === "meta" && b . metaType == 81 ) bPriority = 2 ;
91+ if ( aType === "meta" && a . metaType === 81 ) aPriority = 2 ;
92+ if ( bType === "meta" && b . metaType === 81 ) bPriority = 2 ;
9393
9494 if (
9595 ( aType === "noteOn" || aType === "noteOff" ) &&
@@ -112,6 +112,10 @@ const MidiToNotes = (function () {
112112 return bPriority - aPriority ;
113113 } ) ;
114114
115+ for ( let i = 1 ; i < allMidiEvents . length ; i ++ ) {
116+ allMidiEvents [ i ] . deltaTime = allMidiEvents [ i ] . time - allMidiEvents [ i - 1 ] . time ;
117+ }
118+
115119 return allMidiEvents ;
116120 }
117121
You can’t perform that action at this time.
0 commit comments