JorenSix / Tarsos

Culture independent processing of MIR data
https://0110.be/tags/Tarsos
GNU General Public License v3.0
25 stars 12 forks source link

Midi to wav attempts to unload incorrect SoundBank #3

Open k4pran opened 6 years ago

k4pran commented 6 years ago

https://github.com/JorenSix/Tarsos/blob/4b3f172314766f9d2ff85946f7c82d32e5d4b5a1/src/be/tarsos/midi/MidiToWavRenderer.java#L149

In the class MidiToWavRenderer when using custom SoundBank to create the wav file their is an attempt to unload the default SoundBank:

this.synth.unloadAllInstruments(soundbank);

soundbank is the custom SoundBank and so will not unload anything. It also means the next attempt to load the custom SoundBank silently fails:

...
this.synth.unloadAllInstruments(soundbank);
final Instrument[] instruments = soundbank.getInstruments();
for (final Instrument instrument : instruments) {
    synth.loadInstrument(instrument);
}
createWavFile(midiFile, outputFile);
...