Tarsos icon indicating copy to clipboard operation
Tarsos copied to clipboard

Midi to wav attempts to unload incorrect SoundBank

Open k4pran opened this issue 6 years ago • 0 comments

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);
...

k4pran avatar Dec 27 '17 12:12 k4pran