Bell Curve Envelope — User Guide

Dual-stage processing: applies a pseudo-spectral filtering effect via time-shifted subtraction, followed by a Gaussian (Normal Distribution) amplitude envelope.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.1 (2025) License: MIT License Repo: https://github.com/ShaiCohen-ops/Praat-plugin_AudioTools
Contents:

What this does

This script combines timbre modification with dynamic shaping. It first creates a "hollow" or "phased" texture by subtracting a pitch-shifted version of the sound from a time-stretched version (simulating spectral comb filtering). It then applies a Gaussian Bell Curve envelope to smooth the attack and decay, creating organized sound events from continuous textures. The result transforms static noise or drones into metallic, percussive, or swelling "bell-like" tones.

Key Features:

What is the "Spectral Filtering" here? Unlike FFT-based filtering, this script uses a time-domain trick: Signal(slow) - Signal(fast). By subtracting a slightly faster playback from a slightly slower playback, the phases align and cancel out at specific intervals. This creates a "comb filter" effect, often removing the fundamental frequency and emphasizing odd harmonics, resulting in a hollow, metallic timbre without using traditional EQ.

Technical Implementation: (1) Copy Sound: Creates a working copy _bell. (2) Filtering: Applies formula self[col/low] - self[col*high], effectively mixing pitch-shifted versions. (3) Envelope: Calculates Gaussian curve based on `bell_width_divisor` and `bell_center_position`. (4) Apply Envelope: Multiplies the filtered audio by the Gaussian curve. (5) Normalize: Scales peak amplitude to 0.99 to prevent clipping from the subtraction summation.

Quick start

  1. In Praat, select exactly one Sound object.
  2. Run script…Bell curve envelope.praat.
  3. Select a Preset (e.g., "Narrow Bell" for percussion, "Wide Bell" for pads).
  4. Click OK — script processes the file and plays the result automatically.
Quick tip: If you only want the volume envelope without the metallic filtering effect, choose Preset: Custom and set both low_freq_factor and high_freq_factor to 1.0 (or extremely close, like 1.0001). This bypasses the pitch-shifting interference.
Important: The "Filtering" stage changes the pitch and duration of the underlying samples before masking them. The output will often sound higher or inharmonic compared to the input. Because it relies on phase cancellation, this script works best on harmonically rich sounds (noise, saw waves, vocals) rather than simple sine waves (which may just disappear).

Theory & Logic

1. The Filtering Mechanism

The script creates texture via differential resampling. By taking two pointers to the same audio file—one moving slightly slower (Low Factor) and one moving slightly faster (High Factor)—and subtracting them, we create a composite signal.

Visualizing the Subtraction:
Signal A (Slow): / \ / \ / \ (Lower Pitch)
Signal B (Fast): /\ /\ /\ (Higher Pitch)
Result (A - B): Complex, beating waveform with phase cancellations.

2. The Gaussian Envelope

The amplitude is shaped using the Normal Distribution (Bell Curve) formula. This is distinct from linear (triangular) or ADSR envelopes because it is continuous and smooth (differentiable at all points), creating a very natural "analog" rise and fall.

Parameters & Presets

Presets

[cite_start] [cite_start] [cite_start] [cite_start]
PresetDescriptionInternal Logic
CustomManual control.Uses user values.
Narrow BellPercussive, short sound.bell_width_divisor = 8 [cite: 27]
Wide BellLong, slow swell.bell_width_divisor = 2 [cite: 27]
Low Freq EmphasisDarker, bass-heavy tone.low=1.5, high=1.0 [cite: 28]
High Freq EmphasisThinner, shimmering tone.low=1.0, high=1.5 [cite: 28]

Manual Parameters (Custom Mode)

ParameterDefaultDescription
low_freq_factor1.1Stretches layer 1. Value > 1 lowers pitch.
high_freq_factor1.1Shrinks layer 2. Value > 1 raises pitch.
bell_width_divisor4Curve sharpness. $\sigma = \text{Duration} / \text{Divisor}$.
bell_center_position0.5Peak location. 0.0=Start, 0.5=Mid, 1.0=End.
scale_peak0.99Final normalization level.

Mathematical Deep Dive

The Gaussian Formula

The script calculates the amplitude envelope $E(t)$ using the following implementation of the Gaussian function:

[cite_start]Equation used in Praat[cite: 30]: E(x) = exp( - ( (x - μ) / (W / d) )^2 ) Where: x = current time μ (mean) = bell_center_position × Duration W (width base) = Duration d (divisor) = bell_width_divisor Simplified: Amplitude = exp( -0.5 * z² ) where z is the number of "standard deviations" from center.

📐 Understanding the Divisor

The bell_width_divisor effectively defines how many standard deviations fit into the file duration.

  • Divisor = 2: The bell is very wide. The file duration covers roughly ±1$\sigma$. (Amplitude at edges is $\approx 36\%$).
  • Divisor = 4: The bell is standard. The file duration covers ±2$\sigma$. (Amplitude at edges is $\approx 1.8\%$).
  • Divisor = 8: The bell is narrow. The file duration covers ±4$\sigma$. (Amplitude at edges is near silence).

The Spectral Filter Formula

The "filtering" is achieved via this specific Praat Formula:

[cite_start]Formula: self[col/low] - self[col*high] [cite: 29] Analysis: col = current sample index (time) self[col/low] = Resampling at rate (1/low). If low=2, plays at half speed (octave down). self[col*high] = Resampling at rate (high). If high=2, plays at double speed (octave up). Operation: The two resampled waveforms are subtracted. Constructive interference occurs where phases align. Destructive interference occurs where phases oppose.

Applications

Percussive Sound Design

Goal: Create a metallic "impact" from white noise.

Settings: Preset "Narrow Bell", or Custom with Divisor=10, Center=0.1.

Result: The high divisor creates a sharp pluck. The filtering adds a metallic, inharmonic tail reminiscent of a struck cymbal or gong.

Drone & Pad Textures

Goal: Create an evolving, breathing pad.

Settings: Preset "Wide Bell", Center=0.5.

Result: A sound that slowly fades in, reaches a complex timbral peak in the middle, and fades out. The "filtering" adds movement to the texture so it isn't static.

Psychoacoustic Effects

Goal: "Ghostly" voice effects.

Settings: Input: Speech recording. Settings: Low Factor=1.01, High Factor=1.01.

Result: The slight detuning (1.01) creates a slow flanging/phasing effect combined with the smooth fade, making the voice sound distant or ethereal.

Troubleshooting

Problem: Output is silent.
Cause: If bell_width_divisor is extremely high (>20), the bell might be too narrow to hear (milliseconds).
Solution: Lower the divisor.
Problem: "Clicking" at start/end.
Cause: If bell_center_position is 0.0 or 1.0, the bell curve is cut in half, starting effectively at max volume.
Solution: Ensure the envelope starts at 0 amplitude by moving the center inward (e.g. 0.1) or increasing the divisor so the tails reach zero within the file duration.