[LAD] Realtime inter-thread communication

From: Sebastian Gesemann <s.gesemann@email-addr-hidden>
Date: Mon Feb 29 2016 - 16:38:50 EET

Hello fellow audio developers,

I've started writing a software synthesizer in C++ (using SDL2 for
now) for kicks and giggles and ran into the problem of having the
event loop thread that listens for keyboard events communicate with
the audio callback.

Are there any recommendations for how to pass real-time events (note
on, note off, etc) to such an audio callback? I figured, this is
already a solved problem and that I could benefit from your
experiences. Maybe you know of some nice open-source C++ queue
implementation that is suitable in such a situation.

I could use some kind of "channel" (thread-safe bounded buffer
implemented using mutexes and condition variables) but I'm not sure
whether this is a good idea in this situation since the audio callback
function should avoid unnecessary delays.

I've also looked into LV2. If I implemented the synthesizer as LV2
plugin, I would get around having to solve the inter-thread
communication problem because it's the plugin host's responsibility.
But to be honest I've found this API to be a bit intimidating and I'm
not familiar with any LV2 host that would allow me to test such a
plugin. Any recommendations? Ardour?

Thanks in advance!
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Mon Feb 29 20:15:01 2016

This archive was generated by hypermail 2.1.8 : Mon Feb 29 2016 - 20:15:01 EET