We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I am using your library to create a midi file and then play it using midi-js.
I am finding that no matter how I set setTempo, the output midi in midi-js always plays very slowly. Here is my code snippet:
var TICKS_PER_BEAT = 128; var beatsPerSecond = 2; var file = new Midi.File(); var track = new Midi.Track(); file.addTrack(track); track.setTempo(beatsPerSecond * 60, 0); console.log(sequence[0]["beat"], typeof sequence[0]["beat"]) console.log(sequence[0]["midi_note"], typeof sequence[0]["midi_note"]) for (var i = 0; i < sequence.length; ++i) { var midiPitch = sequence[i]['midi_note'], noteOnBeat = sequence[i]['beat'], noteOffBeat; if (i == sequence.length - 1) { noteOffBeat = sequence[i]['beat'] + 2; } else { noteOffBeat = sequence[i + 1]['beat']; } track.addNoteOn(0, midiPitch, TICKS_PER_BEAT * noteOnBeat, velocity); track.addNoteOff(0, midiPitch, TICKS_PER_BEAT * noteOffBeat, velocity); } return file;
I changed beatsPerSecond to be 5 and the output file sounded the same. Thanks for your time.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, I am using your library to create a midi file and then play it using midi-js.
I am finding that no matter how I set setTempo, the output midi in midi-js always plays very slowly. Here is my code snippet:
I changed beatsPerSecond to be 5 and the output file sounded the same. Thanks for your time.
The text was updated successfully, but these errors were encountered: