How danilodsp/rt-aep works
Project Type and Purpose
• This is a native C++17 desktop application: a Real-Time Audio Effects Processor (RT-AEP).
• It captures live audio via PortAudio, runs it through a chain of DSP effects, displays a visualization, and lets the user tweak parameters in real time using Dear ImGui.
High-Level Components
a. Audio I/O Layer
• PortAudio (external library)
• Responsible for capturing and outputting the audio stream
b. Core Audio Engine
• AudioEngine (AudioEngine.hpp/cpp)
• Coordinates audio callback, buffer management, and dispatch to effects
c. Effect Chain
• EffectChain (EffectChain.hpp/cpp)
• A container of individual AudioEffect subclasses (Distortion, Echo, Gain, PitchShifter, Reverb)
• Each effect implements processSample or processBuffer
d. GUI Layer
• GUIManager (GUIManager.hpp/cpp) under gui/
• Built using Dear ImGui
• Renders sliders, toggles, and binds to AudioEngine/EffectChain parameters
e. Visualization Layer
• Visualizer (Visualizer.hpp/cpp) under visualization/
• Pulls audio buffer snapshots from AudioEngine and renders waveforms/spectra
f. Build & Configuration
• CMakeLists.txt (root, src/, gui/)
• Defines targets, finds PortAudio, sets include paths
g. External Dependencies
• PortAudio (audio backend)
• Dear ImGui (GUI framework, included via external or submodule)
Relationships and Data Flows
• Audio Input → PortAudio Callback → AudioEngine → EffectChain → [ Distortion, Echo, … ] → AudioEngine → PortAudio Output.
• GUIManager ←→ AudioEngine/EffectChain (parameter control bi-directional).
• AudioEngine → Visualizer (buffer tap for real-time display).
• CMake orchestrates building of all modules with correct linkages.
Architectural Patterns & Principles
• Modular DSP pipeline (Chain of Responsibility pattern for effects).
• Clear separation of concerns:
• Audio I/O vs. DSP vs. UI vs. Visualization
• Dependency Injection: GUI and Visualizer reference AudioEngine interfaces rather than static globals.
• Single responsibility: Each effect class does one thing.