Another screenshot update. Slow progress on making...
# two-minute-week
c
Another screenshot update. Slow progress on making the audio side of the project into something more robust and useful. • Added audio configuration for choosing sound device (on the top right of the screenshot) • Added a spectrum analysis window. If this looks familiar, it's the same FFT/GUI code I contributed to Sonic Pi, although here it is using ImGui • Continuing work on dock windows/gui setup.
👍 8
The technical challenge of adding the sound options was really in cleaning up the generation of the graphs when the audio changes. Since many nodes in the graph might be processing music data at the current audio rate, I needed to shut the graph down, reconfigure the nodes, and restart. This builds on previous work I've done to manage the graphs inside the audio pipeline. Effectively a graph is either 'Active' or 'Inactive'; the distinction is that an active graph can be run inside the audio thread. A graph is made inactive by quickly swapping pointers under a spin-lock. This means that the audio thread never waits for a graph, and never does a mutex lock which can schedule away from the audio thread when the lock is freed. Technical details aside, this is tricky to make clean and robust, but I think I'm there.
The output sound data in the audio side is also copied into a buffer and pointer-swapped so it can be processed in other threads.