Closed ar065 closed 3 years ago
Thanks for the notice! Could you please attach these MIDI files?
Thanks for the notice! Could you please attach these MIDI files?
I'm not sure if I should have made an issue on JZZ or here, since JZZ is throwing the issue. Maybe the midi is loading but on the first event JZZ throws an error? Just speculation
0.mid is in the test folder, the second midi is bad apple: Bad Apple.zip
Strange... I don't see any issues when I open 0.mid during the "npm test". Can it be that your copy is corrupted? I'll take a look at your other file.
I re-installed and still have the same issue, im testing on windows next to see if that changes anything
Which OS are you on? Does npm test
work for you?
Which OS are you on? Does
npm test
work for you?
yarn run test
(Since I use yarn) works for me.
I was on linux. I tested on windows and had the same result, am I doing this correctly?:
const JZZ = require("jzz");
require("jzz-midi-smf")(JZZ);
fs.readFile("./midis/0.mid", "binary", (err, data) => {
if (err) console.log(err);
let smf = new JZZ.MIDI.smf(data);
let midiPlayer = smf.player();
midiPlayer.connect(output);
midiPlayer.play();
});
Change let smf = new JZZ.MIDI.smf(data);
to let smf = new JZZ.MIDI.SMF(data);
;)
VsCode said it was "smf" 🤦 Also can't believe I didn't notice that lol
Yes, I've just realized I have functions with similar names... Need to think what to do about that...
Here is an example with 0.mid:
Another example with a different midi:
Theres more after that
RangeError
, but its just a bunch of midi data. I loaded the midi just like the examples have shown, with fs.