Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tracks[trackIndex] = track;
}
else
track = tracks[trackIndex];
var notes = voices[j];
run(p, track, 0, notes, 0, maxDuration);
}
}
sumMaxDuration += maxDuration;
}
MIDI.Player.timeWarp = 1; // speed the song is played back
MIDI.Player.currentData = this.file.toBytes();
MIDI.Player.loadMidiFile();
L.debug('Finished generating midi file');
}
onsuccess: function() {
// var delay = 0; // play one note every quarter second
// var note = 50; // the MIDI note
// var velocity = 127; // how hard the note hits
MIDI.setVolume(0, 127);
// MIDI.noteOn(0, note, velocity, delay);
// MIDI.noteOff(0, note, delay + 0.75);
player = MIDI.Player;
// player.BPM = 300;
// player.loadFile(song, player.start);
//MIDIPlayerPercentage(player);
MIDI.programChange(0, MIDI.GM.byName['acoustic_grand_piano'].number);
MIDI.programChange(1, MIDI.GM.byName['synth_drum'].number);
MIDI.programChange(2, MIDI.GM.byName['banjo'].number);
}
});
this.file.addTrack(track);
tracks[trackIndex] = track;
}
else
track = tracks[trackIndex];
var notes = voices[j];
run(p, track, 0, notes, 0, maxDuration);
}
}
sumMaxDuration += maxDuration;
}
MIDI.Player.timeWarp = 1; // speed the song is played back
MIDI.Player.currentData = this.file.toBytes();
MIDI.Player.loadMidiFile();
L.debug('Finished generating midi file');
}
}
this.file.addTrack(track);
tracks[trackIndex] = track;
}
else
track = tracks[trackIndex];
var notes = voices[j];
run(p, track, 0, notes, 0, maxDuration);
}
}
sumMaxDuration += maxDuration;
}
MIDI.Player.timeWarp = 1; // speed the song is played back
MIDI.Player.currentData = this.file.toBytes();
MIDI.Player.loadMidiFile();
L.debug('Finished generating midi file');
}