From 9dcf94ab01269311b4e5d39be23c95560904c626 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 27 Jan 2026 23:09:27 +0100 Subject: feat: Implement spectool & specview; refactor coding style; update docs 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. --- src/audio/synth.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/audio/synth.h') diff --git a/src/audio/synth.h b/src/audio/synth.h index 17770a7..eadde10 100644 --- a/src/audio/synth.h +++ b/src/audio/synth.h @@ -6,20 +6,20 @@ #define MAX_VOICES 16 struct Spectrogram { - float* spectral_data_a; - float* spectral_data_b; - int num_frames; + float *spectral_data_a; + float *spectral_data_b; + int num_frames; }; void synth_init(); void synth_shutdown(); -int synth_register_spectrogram(const Spectrogram* spec); +int synth_register_spectrogram(const Spectrogram *spec); void synth_unregister_spectrogram(int spectrogram_id); -float* synth_begin_update(int spectrogram_id); +float *synth_begin_update(int spectrogram_id); void synth_commit_update(int spectrogram_id); void synth_trigger_voice(int spectrogram_id, float volume, float pan); -void synth_render(float* output_buffer, int num_frames); +void synth_render(float *output_buffer, int num_frames); int synth_get_active_voice_count(); -- cgit v1.2.3