tim-janik / anklang

MIDI and Audio Synthesizer and Composer
https://anklang.testbit.eu/
Mozilla Public License 2.0
54 stars 3 forks source link

devices/liquidsfz/liquidsfz.cc: track instrument changes while loading #65

Open swesterfeld opened 3 months ago

swesterfeld commented 3 months ago

See also #44.

I've tested this by adding a sleep (30) inside the liquidsfz loading code. Instrument changes while busy loading another instrument are no longer lost now, and the event queue gets unconditionally processed, although two branches are necessary since in one branch (when the loader is busy) we cannot access synth_.

One issue that I noticed while implementing this is that currently the code uses sem_.post() (which is effectively sem_post()) to wake up the loader thread from the audio thread. I am not sure if this is hard RT safe, and if not, if we already have some kind of alternative available that is hare RT safe.