Closed Stazed closed 7 months ago
Hi
Yes, indeed we didn't need the -1 return from get_instrument_for_channel in Fluida. So I followed your suggestion and make it return 0 on error. In our context that doesn't matter.
Thanks for the hint, should be fixed with the latest commit.
Great! Now all my old custom (somewhat suspect) .sf2s work without issue. Thanks again for this beautiful plugin...
With some sf2 files (maybe broken?) the call to : XSynth.cpp
On the host non-mixer-xt (I am the developer), the lv2 file is saved in .ttl format with lilv_state_save(). The -1 value gets saved in the channel_list - Example:
When attempting to restore the plugin state, the -1 channel value causes Fluida.lv2 to crash with a:
or some other similar related error.
I patched with:
Which changed the -1 channel_list saving to 0 and stopped the plugin from crashing on re-load, with no side effects that I could determine.
I also noticed that the calls to XSynth::get_instrument_for_channel() do not handle the -1 error in any case. I'm not sure what the best solution is for the error conditions, but returning 0 seemed to work if no preset was found.
Anyhow you may know of a better solution...
Thanks.