ποΈ THX Deep Note Generator (by SmezMorePrakezz)
A python based synthesizer to recreate the THX Deep Note ποΈ
The script is designed to generate a 36-second, layered, stereo audio fileβa programmatic recreation of the famous "Deep Note" chord sound. It achieves its complexity by treating the audio creation as a pipeline: randomized synthesis (generating the source waves), time-varying filtering, mid/side stereo widening, and final mastering EQ/Envelope. A new feature allows running the entire process
The core sound is built from 30 independently controlled sawtooth waves (the primary harmonic generator). This section determines the pitch over time (the "trajectory").
- Wave Initialization: 30 base frequencies, ranging from 36.71 Hz (D1) to 1760.00 Hz (A6), are defined as a D5 power chord (D and A notes only).
- Random Wobble: For the first 16 seconds (Wobble + Spread phases), each of the 30 waves is given a unique, randomized frequency trajectory defined by segment points. The pitch changes are interpolated linearly between these points, creating erratic glides.
-
Final Pitch Detune: When the waves settle on the final chord (20s-36s):
- The six lowest bass waves (36.71 Hz, 73.42 Hz, 110.00 Hz) are forced to have zero detune for perfect stability and phase alignment at the low end.
- The remaining 24 waves are randomly detuned up to
$\pm4$ Hz (the default--final_detune_max) from their target pitch, creating the characteristic beating and thickness of the final sustained chord.
-
Sawtooth Generation: For the entire 36 seconds, the instantaneous frequency profile of each wave is used to generate a classic, unfiltered sawtooth wave (
scipy.signal.sawtooth). All 30 waves are summed together to create the raw, unfiltered audio.
After the raw audio is generated, a multi-stage process shapes the timbre and volume.
-
Low-Pass Filter (LPF) Sweep: The script implements a 4th-order low-pass filter with a time-varying cutoff frequency:
- Phase 1 (0-16s): Constant LPF cutoff at 2500 Hz (default), keeping the sound muffled.
- Phase 2 (16-20s): The cutoff sweeps from 2500 Hz to 7000 Hz (default). The sweep uses logarithmic interpolation to create a natural, smooth opening effect as the final chord approaches.
- Phase 3 (20-36s): Constant LPF cutoff at 7000 Hz, allowing the high harmonics to sustain.
- Note: Filter states (
zi) are passed between all phases to ensure a smooth transition with no clicks.
-
EQ Boost: A fixed peaking equalization filter is applied: +10 dB boost at 100 Hz with a broad quality factor of
$Q=0.6$ . This adds a rich, powerful thickness to the final sound. - Master Envelope: The final volume envelope is applied: a 9-second fade-in (default) and a 6-second fade-out (default).
This is where the sound is widened and prepared for export.
-
Layering (
$N$ Generations): If the--n_generationsparameter is set to$N>1$ , the entire pipeline (Synthesis, Filtering, EQ) is repeated$N$ times. Each generation produces a unique, randomly distinct stereo track, and all$N$ tracks are summed into a singlefinal_stereo_mix. -
Mid/Side (M/S) Conversion: The final accumulated stereo signal is converted into Mid (
$M = L+R$ ) and Side ($S = L-R$ ) channels. -
Stereo Widening Fade: The Side (
$S$ ) channel is subjected to a 10-second logarithmic fade-in (default). The Mid ($M$ ) channel remains at full volume. This causes the sound to start narrow and center-focused, gradually expanding to full stereo width over the first 10 seconds. -
L/R Conversion: The signal is converted back to Left/Right (
$L = M+S$ ,$R = M-S$ ). -
Normalization & Export: The entire stereo file is globally normalized based on its highest peak and exported as a 16-bit WAV file. The filename dynamically reports the settings used (e.g.,
THX_lp2500_sweep2500to7000_...).
--n_generations 1 Layering/Mix Sets the number of unique, randomized tracks (
--final_detune_max 4.0 Hz Synthesis Maximum random detune (
--lp1 2500.0 Hz Filtering Low-Pass Filter (LPF) cutoff for the initial 16 seconds (Wobble/Spread phase).
--lp_sweep_start 2500.0 Hz Filtering LPF cutoff frequency at the start (16s mark) of the 4-second logarithmic sweep.
--lp_sweep_end 7000.0 Hz Filtering LPF cutoff frequency at the end (20s mark) of the 4-second sweep and for the entire final sustain phase (20-36s).
--fade_in_s 9.0 s Envelope Total duration (in seconds) for the main volume fade-in of the entire track.
--fade_out_s 6.0 s Envelope Total duration (in seconds) for the main volume fade-out of the entire track.
--side_fade_in_s 10.0 s Stereo/M/S Sets the duration (in seconds) for the logarithmic fade-in of the Side channel. Controls how quickly the sound widens from mono to stereo.