summaryrefslogtreecommitdiff
path: root/src/audio/synth.cc
AgeCommit message (Collapse)Author
28 hoursfeat(audio): Implement audio backend abstraction (Task #51.1)skal
Created interface-based audio backend system to enable testing without hardware. This is the foundation for robust tracker timing verification. Changes: - Created AudioBackend interface with init/start/shutdown methods - Added test-only hooks: on_voice_triggered() and on_frames_rendered() - Moved miniaudio implementation to MiniaudioBackend class - Refactored audio.cc to use backend abstraction with auto-fallback - Added time tracking to synth.cc (elapsed time from rendered frames) - Created test_audio_backend.cc to verify backend injection works - Fixed audio test linking to include util/procedural dependencies All test infrastructure guarded by #if !defined(STRIP_ALL) for zero size impact on final build. Production path unchanged, 100% backward compatible. All 13 tests pass. handoff(Claude): Task #51.1 complete, audio backend abstraction ready Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
5 daysclang-formatskal
5 daysstyle: add vertical compression rules to clang-formatskal
- Enabled AllowShortFunctionsOnASingleLine: All - Enabled AllowShortBlocksOnASingleLine: Always - Enabled AllowShortIfStatementsOnASingleLine: Always - Enabled AllowShortLoopsOnASingleLine: true - Set MaxEmptyLinesToKeep: 1 - Applied formatting to all source files.
6 daysChore: Add missing newlines at end of source filesskal
6 daysenforce code styleskal
8 daysperf(synth): Optimize Hamming window generationskal
Moves the Hamming window initialization from synth_render to synth_init() to ensure it's generated only once, improving performance.
8 daysfeat(visuals): Add rotation, color shifts, and improved beat-syncskal
Implements a more dynamic and reactive visual system. - Updated synth.cc: Faster peak decay for better response. - Updated gpu.cc: Added time-based rotation and Hue shifting; implemented reactive clear-color flashes. - Updated main.cc: Corrected peak scaling (8x multiplier) and integrated time-based animation.
8 daysdocs: Update project context and session notesskal
Summarizes recent implementations including Asset Management, audio/visual fixes, and style improvements.
8 daysstyle: Add 3-line descriptive headers to all source filesskal
This commit applies a new project-wide rule that every source file must begin with a concise 3-line comment header describing its purpose. - Updated CONTRIBUTING.md with the new rule. - Applied headers to all .cc and .h files in src/ and tools/. - Fixed various minor compilation errors and missing includes discovered during the header update process.
9 daysbuild: Finalize WebGPU integration and platform fixesskal
Includes correct CMake configuration for GLFW native access, Objective-C++ compilation for the helper library on macOS, and applies clang-format to modified sources.
9 daysfix(synth): Implement peak meter with decay for smooth visualsskal
The graphics appeared static because the audio peak value was transient, only lasting for a single audio buffer. The main graphics loop, running much faster, would mostly read a zero value. This fix implements a simple peak meter with an exponential decay. The peak value now rises instantly to the maximum sample value but fades out smoothly over several frames, providing a persistent and smooth value for the visualizer.
9 daysfeat: Implement fullscreen, keyboard controls, and pulsating heptagonskal
This commit fulfills tasks 1 and 2, and adds a synchronized visual effect. - **Fullscreen Mode**: Added '--fullscreen' command-line argument and dynamic toggling via 'F' key. - **Keyboard Controls**: Implemented 'Esc' to exit and 'F' to toggle fullscreen in 'src/platform.cc'. - **Synchronized Visuals**: Added a pulsating heptagon effect in 'src/gpu/gpu.cc' and 'src/gpu/shader.wgsl' that scales and changes color based on the real-time audio peak from the synth. - **Refactor**: Abstracted platform-specific WebGPU surface creation into 'src/platform.cc' to keep 'src/gpu/gpu.cc' cross-platform. - **Build System**: Corrected 'CMakeLists.txt' to properly link 'wgpu-native' and platform frameworks, and updated 'project_init.sh' to build the submodule. - **Documentation**: Updated 'HOWTO.md' and 'PROJECT_CONTEXT.md' with new features and decisions.
9 daysfeat: Implement spectool & specview; refactor coding style; update docsskal
This commit introduces new tools for spectrogram manipulation and visualization, establishes a consistent coding style, and updates project documentation. Key changes include: - **Spectrogram Tools: - : A command-line utility for analyzing WAV/MP3 files into custom spectrogram format and playing back these spectrograms via the synth engine. - : A command-line tool for visualizing spectrogram files as ASCII art in the console. - **Coding Style Enforcement: - Added a configuration file enforcing LLVM-based style with 2-space indentation, no tabs, and an 80-column line limit. - Renamed all C++ source files from to for project consistency. - Applied automatic formatting using exit across the entire codebase. - **Documentation & Workflow: - Created to define a commit policy requiring tests to pass before committing. - Updated with instructions for building and using and , and referenced . - Updated and to reflect the new tools, audio architecture decisions (real-time additive synthesis, double-buffering for dynamic updates, WAV/MP3 support), coding style, and development workflow. - **Build System: - Modified to: - Include new targets for and under the option. - Update source file extensions to . - Add a new end-to-end test for to the suite.