Update inc/jasmid/replayer.js
This commit is contained in:
parent
072eadb4af
commit
a5160b624f
|
@ -59,6 +59,10 @@ function Replayer(midiFile, timeWarp, eventProcessor) {
|
|||
//
|
||||
function processEvents() {
|
||||
function processNext() {
|
||||
if ( midiEvent.event.type == "meta" && midiEvent.event.subtype == "setTempo" ) {
|
||||
// tempo change events can occur anywhere in the middle and affect events that follow
|
||||
beatsPerMinute = 60000000 / midiEvent.event.microsecondsPerBeat;
|
||||
}
|
||||
if (midiEvent.ticksToEvent > 0) {
|
||||
var beatsToGenerate = midiEvent.ticksToEvent / ticksPerBeat;
|
||||
var secondsToGenerate = beatsToGenerate / (beatsPerMinute / 60);
|
||||
|
@ -78,4 +82,4 @@ function Replayer(midiFile, timeWarp, eventProcessor) {
|
|||
return clone(temporal);
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue