summaryrefslogtreecommitdiff
path: root/src/audio/synth.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/synth.cc')
-rw-r--r--src/audio/synth.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/audio/synth.cc b/src/audio/synth.cc
index 1afb501..617ff2f 100644
--- a/src/audio/synth.cc
+++ b/src/audio/synth.cc
@@ -11,10 +11,10 @@
#include <stdio.h> // For printf
#include <string.h> // For memset
-#if defined(DEBUG_LOG_SYNTH)
+#if !defined(STRIP_ALL)
#include "audio/audio.h"
#include "audio/audio_backend.h"
-#endif /* defined(DEBUG_LOG_SYNTH) */
+#endif /* !defined(STRIP_ALL) */
struct Voice {
bool active;
@@ -45,17 +45,17 @@ static volatile float g_current_output_peak =
static float g_hamming_window[WINDOW_SIZE]; // Static window for optimization
static float g_tempo_scale = 1.0f; // Playback speed multiplier
-#if defined(DEBUG_LOG_SYNTH)
+#if !defined(STRIP_ALL)
static float g_elapsed_time_sec = 0.0f; // Tracks elapsed time for event hooks
-#endif /* defined(DEBUG_LOG_SYNTH) */
+#endif /* !defined(STRIP_ALL) */
void synth_init() {
memset(&g_synth_data, 0, sizeof(g_synth_data));
memset(g_voices, 0, sizeof(g_voices));
g_current_output_peak = 0.0f;
-#if defined(DEBUG_LOG_SYNTH)
+#if !defined(STRIP_ALL)
g_elapsed_time_sec = 0.0f;
-#endif /* defined(DEBUG_LOG_SYNTH) */
+#endif /* !defined(STRIP_ALL) */
// Initialize the Hamming window once
hamming_window_512(g_hamming_window);
}
@@ -195,14 +195,14 @@ void synth_trigger_voice(int spectrogram_id, float volume, float pan) {
v.active_spectral_data =
g_synth_data.active_spectrogram_data[spectrogram_id];
-#if defined(DEBUG_LOG_SYNTH)
+#if !defined(STRIP_ALL)
// Notify backend of voice trigger event (for testing/tracking)
AudioBackend* backend = audio_get_backend();
if (backend != nullptr) {
backend->on_voice_triggered(g_elapsed_time_sec, spectrogram_id, volume,
pan);
}
-#endif /* defined(DEBUG_LOG_SYNTH) */
+#endif /* !defined(STRIP_ALL) */
return; // Voice triggered
}
@@ -267,11 +267,11 @@ void synth_render(float* output_buffer, int num_frames) {
g_current_output_peak, fmaxf(fabsf(left_sample), fabsf(right_sample)));
}
-#if defined(DEBUG_LOG_SYNTH)
+#if !defined(STRIP_ALL)
// Update elapsed time for event tracking (32000 Hz sample rate)
const float sample_rate = 32000.0f;
g_elapsed_time_sec += (float)num_frames / sample_rate;
-#endif /* defined(DEBUG_LOG_SYNTH) */
+#endif /* !defined(STRIP_ALL) */
}
int synth_get_active_voice_count() {