avans06 commited on
Commit
8229bc2
·
1 Parent(s): 44e9039

feat(synth): Enhance 8-bit synthesizer with anti-aliasing and progress tracking

Browse files

This commit introduces a major overhaul of the 8-bit synthesizer to significantly improve its audio quality and provide better user feedback during rendering.

The primary motivations were to reduce sonic harshness caused by digital aliasing and to offer real-time progress updates for a better user experience, especially on long tracks.

1. Advanced Anti-Aliasing and Audio Quality Engine:
Implemented a suite of optional, high-quality DSP features to produce a cleaner, less harsh sound. These are controlled by a new "Audio Quality & Anti-Aliasing" section in the UI.
**Additive Synthesis:** Added a high-quality (but CPU-intensive) band-limited waveform generator to eliminate aliasing at its source.
**Waveform Edge Smoothing:** A low-cost alternative that applies a configurable sub-millisecond smoothing filter to the edges of standard waveforms.
**Dynamic Harmonic Filtering:** A new frequency-dependent lowpass filter is applied to each note, intelligently removing excessive high-frequency harmonics while preserving the note's fundamental character.
**Improved Distortion and Noise:** The distortion algorithm is now a smoother soft-clipping function, and the noise generator includes a lowpass filter to soften its texture.
**Final Limiter:** A final gain stage with a soft limiter (`tanh`) is applied to prevent digital clipping and manage dynamics.

2. Note-Level Rendering Progress Bar:
The `synthesize_8bit_style` function has been refactored to provide detailed, real-time progress feedback.
The progress bar (`tqdm`) is now applied to the inner **note-processing loop** instead of the outer instrument loop.
This provides a smooth, granular progress update that accurately reflects the CPU workload, which is especially useful for MIDI files with thousands of notes but few instrument tracks.
The progress tracking system has been made robust to work seamlessly in both single-file and batch-processing modes.

1 file changed +408 -206
app.py+408-206