summaryrefslogtreecommitdiff
path: root/src/audio/synth.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-01-28 02:51:21 +0100
committerskal <pascal.massimino@gmail.com>2026-01-28 02:51:21 +0100
commit295626c3d527613c93fa63e2b1f079704600a98e (patch)
tree978da6b066bb1ff69df4abb02887bc940e88afe1 /src/audio/synth.cc
parent96bfc344ce9098681ff739cd7ed0a1d1f8ba54df (diff)
build: Finalize WebGPU integration and platform fixes
Includes correct CMake configuration for GLFW native access, Objective-C++ compilation for the helper library on macOS, and applies clang-format to modified sources.
Diffstat (limited to 'src/audio/synth.cc')
-rw-r--r--src/audio/synth.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/audio/synth.cc b/src/audio/synth.cc
index 77a0d05..a4f3b7a 100644
--- a/src/audio/synth.cc
+++ b/src/audio/synth.cc
@@ -26,7 +26,8 @@ static struct {
} g_synth_data;
static Voice g_voices[MAX_VOICES];
-static volatile float g_current_output_peak = 0.0f; // Global peak for visualization
+static volatile float g_current_output_peak =
+ 0.0f; // Global peak for visualization
void synth_init() {
memset(&g_synth_data, 0, sizeof(g_synth_data));
@@ -172,8 +173,8 @@ void synth_render(float *output_buffer, int num_frames) {
output_buffer[i * 2 + 1] = right_sample;
// Update the peak with the new max (attack)
- g_current_output_peak =
- fmaxf(g_current_output_peak, fmaxf(fabsf(left_sample), fabsf(right_sample)));
+ g_current_output_peak = fmaxf(
+ g_current_output_peak, fmaxf(fabsf(left_sample), fabsf(right_sample)));
}
}
@@ -187,4 +188,6 @@ int synth_get_active_voice_count() {
return count;
}
-float synth_get_output_peak() { return g_current_output_peak; }
+float synth_get_output_peak() {
+ return g_current_output_peak;
+}