diff options
Diffstat (limited to 'src/audio/synth.cc')
| -rw-r--r-- | src/audio/synth.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/audio/synth.cc b/src/audio/synth.cc index 8380301..2242d5c 100644 --- a/src/audio/synth.cc +++ b/src/audio/synth.cc @@ -35,7 +35,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)); @@ -183,9 +184,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))); } } @@ -199,4 +199,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; +} |
