This is a single-file C++20 audio application written for educational purposes which turns your computer keyboard into an extremely simple sine wave synthesizer.
The code has been deliberately over-engineered to show what I think are many useful techniques for architecting very large and complex audio applications such as digital audio workstations, based on what I have learned so far working on Blockhead.
Note that this is not a "very large and complex audio application", it is just a very small toy example, and therefore the techniques being used here are completely overkill for the end result. The only point of the project is to try to encapsulate some fairly advanced techniques in as few lines of code as possible.
Libraries used:
- CPM.cmake: CMake package management
- bhas: Just for starting and stopping audio streams.
- immer: For representing project state as an immutable data structure.
- ent: For managing a realtime-safe pool of reusable note entities.
- ez: For synchronizing project state with the audio thread.
- readerwriterqueue: For one-way communication from the audio thread back to the main thread.
- SDL2: Only for handling keyboard input.