diff options
Diffstat (limited to 'src/audio/synth.cc')
| -rw-r--r-- | src/audio/synth.cc | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/audio/synth.cc b/src/audio/synth.cc index ada46fd..2072bb4 100644 --- a/src/audio/synth.cc +++ b/src/audio/synth.cc @@ -41,9 +41,8 @@ static struct { static Voice g_voices[MAX_VOICES]; static volatile float g_current_output_peak = - 0.0f; // Global peak for visualization -static float g_hamming_window[WINDOW_SIZE]; // Static window for optimization -static float g_tempo_scale = 1.0f; // Playback speed multiplier + 0.0f; // Global peak for visualization +static float g_tempo_scale = 1.0f; // Playback speed multiplier #if !defined(STRIP_ALL) static float g_elapsed_time_sec = 0.0f; // Tracks elapsed time for event hooks @@ -56,8 +55,6 @@ void synth_init() { #if !defined(STRIP_ALL) g_elapsed_time_sec = 0.0f; #endif /* !defined(STRIP_ALL) */ - // Initialize the Hamming window once - hamming_window_512(g_hamming_window); } void synth_shutdown() { @@ -214,10 +211,6 @@ void synth_trigger_voice(int spectrogram_id, float volume, float pan) { } void synth_render(float* output_buffer, int num_frames) { - // Use the pre-calculated window - // float window[WINDOW_SIZE]; - // hamming_window_512(window); - // Faster decay for more responsive visuals g_current_output_peak *= 0.90f; @@ -243,13 +236,9 @@ void synth_render(float* output_buffer, int num_frames) { const float* spectral_frame = (const float*)v.active_spectral_data + (v.current_spectral_frame * DCT_SIZE); - float windowed_frame[DCT_SIZE]; - for (int j = 0; j < DCT_SIZE; ++j) { - windowed_frame[j] = - spectral_frame[j] * g_hamming_window[j]; // Use static window - } - - idct_512(windowed_frame, v.time_domain_buffer); + // IDCT directly - no windowing needed for synthesis + // (Window is only used during analysis, before DCT) + idct_512(spectral_frame, v.time_domain_buffer); v.buffer_pos = 0; ++v.current_spectral_frame; |
