Following issue #14, I incorporated MIDI file support on my fork, taken from sinshu's meltysynth, and made necessary adjustments to make it work on Dart.
Example usage:
final sequencer = MidiFileSequencer(synth);
final midiFile = MidiFile.fromByteData(await rootBundle.load('assets/chpn_op23.mid'));
sequencer.play(midiFile);
final buf16 = ArrayInt16.zeros(numShorts: 1000);
sequencer.renderMonoInt16(buf16);
The logic behind it is mostly keep unchanged, so most of the MIDI files out there should work (at least on my case). Tested with single track classical pieces and multi-track GM songs.
I haven't updated the example app code, let me know if you would like those changes as well.
Following issue #14, I incorporated MIDI file support on my fork, taken from sinshu's meltysynth, and made necessary adjustments to make it work on Dart.
Example usage:
The logic behind it is mostly keep unchanged, so most of the MIDI files out there should work (at least on my case). Tested with single track classical pieces and multi-track GM songs.
I haven't updated the example app code, let me know if you would like those changes as well.