AM Additive Synthesis Generator — User Guide
Additive synthesis from reusable spectral blueprints, with fifteen spectral configurations, ten amplitude envelopes, optional melody demonstration, stereo rendering, reproducible randomness, and measured QC visualization.
What this does
This script generates a new sound from summed sinusoidal components. A selected Texture type defines a spectral blueprint: each requested partial receives a frequency ratio and amplitude weight. The same blueprint is then rendered either as one sustained note or, when Melody demo is enabled, as an eight-note major-arpeggio phrase. An amplitude envelope is applied to each generated note, followed by optional stereo rendering and peak normalization.
No input Sound is required. Randomized spectral blueprints are created once per run and reused across every note in Melody demo, so the spectral identity stays consistent through the phrase.
Quick start
- In Praat, run AM Additive Synthesis Generator.praat. No Sound selection is required.
- Choose a Preset, or leave Custom to use the fields below.
- Choose a Texture type and Envelope type.
- Leave Melody demo off for one note, or enable it for the built-in arpeggio.
- Choose Mono, Stereo Wide, or Rotating output.
- Use a positive Random seed when you need a reproducible realization; 0 creates a new stochastic realization.
- Click OK. The result is named
additive_<preset>.
Signal path
The synthesis path is:
Spectral blueprint
↓
sum of rendered sinusoidal components
↓
spectral-energy normalization within each note
↓
selected amplitude envelope
↓
short safety fade at note boundaries
↓
optional stereo rendering
↓
optional target peak normalization
For each note, components that fall outside the anti-alias safety region are skipped. Time-varying textures may also have their sweep or modulation depth reduced to remain below the safety limit. The script uses 45% of the sample rate as its upper synthesis boundary rather than the exact Nyquist frequency.
Parameters
| Parameter | Default | Behavior |
|---|---|---|
| Melody demo | Off | Off: synthesize one note for Duration_s. On: synthesize the fixed eight-note phrase described below. |
| Preset | Custom | Selects one of eight stored configurations. Presets override only the fields listed in the Presets section. |
| Duration_s | 3.0 s | Single-note duration. Values below 0.05 s are raised to 0.05 s. This field does not determine Melody demo duration. |
| Sample_rate_Hz | 44100 | Sampling rate of the generated sound. Minimum accepted value: 1000 Hz. |
| Fundamental_Hz | 220 Hz | Root frequency used to scale the spectral blueprint. It must remain below 0.45 × sample rate. |
| Num_partials | 8 | Requested blueprint components. Internally limited to 1–32; individual components can still be skipped by the anti-alias guard. |
| Texture_type | Harmonic Series | Selects one of fifteen spectral constructions. |
| Detune | 0.1 | Clamped to 0–1. In the current implementation it directly controls the spread of Detuned Unison. |
| Chaos | 0.3 | Clamped to 0–1. Used by selected texture algorithms and several envelope algorithms as a variation/modulation control. |
| Random_seed | 0 | 0 = new stochastic realization. Positive values reproduce stochastic spectral choices and Random Bursts for the same settings. |
| Envelope_type | No Envelope | Selects one of ten amplitude-envelope behaviors. A short safety fade is still applied at note boundaries. |
| Spatial_mode | Mono | Mono, Stereo Wide, or Rotating. |
| Normalize_output | On | When enabled, Praat Scale peak: 0.95 performs target peak normalization after spatial rendering. |
| Draw_visualization | On | Draws the measured/model QC visualization described below. |
| Play_result | On | Automatically plays the completed output. |
Presets
Presets override Duration, Fundamental, Num partials, Texture type, Detune, Chaos, Envelope type, and Spatial mode. They do not override Melody demo, sample rate, Random seed, Normalize output, Draw visualization, or Play result.
| Preset | Overridden settings |
|---|---|
| Warm Pad | 5 s; 110 Hz; 6 partials; Harmonic Series; detune 0.05; chaos 0.1; Swell; Stereo Wide. |
| Bright Organ | 3 s; 220 Hz; 10 partials; Odd Harmonics; detune 0.02; chaos 0.05; No Envelope; Stereo Wide. |
| Bell Tone | 4 s; 440 Hz; 8 partials; Golden Bells; detune 0.08; chaos 0.2; Percussive; Rotating. |
| Shimmer | 5 s; 330 Hz; 12 partials; Detuned Unison; detune 0.15; chaos 0.3; Tremolo; Rotating. |
| Bass Drone | 8 s; 55 Hz; 6 partials; Harmonic Series; detune 0.03; chaos 0.1; Slow Fade; Stereo Wide. |
| Ethereal Choir | 6 s; 180 Hz; 8 partials; Filtered Spectrum; detune 0.1; chaos 0.4; Swell; Rotating. |
| Plucked String | 2 s; 196 Hz; 10 partials; Harmonic Decay; detune 0.02; chaos 0.15; Percussive; Mono. |
| Sci-Fi Sweep | 4 s; 150 Hz; 10 partials; Rising Partials; detune 0.1; chaos 0.5; Reverse; Rotating. |
Texture types
| Texture | Implemented spectral rule |
|---|---|
| Harmonic Series | Ratios 1, 2, 3… with amplitude 1/n. |
| Odd Harmonics | Ratios 1, 3, 5… with amplitude 1/harmonic number. |
| Even Harmonics | Ratios 2, 4, 6… with amplitude 1/harmonic number. |
| Inharmonic Cluster | Ratio = n + Chaos × Gaussian(0, 0.5), with a minimum ratio of 0.1; amplitude 1/n. The random ratios are drawn once per run. |
| Golden Bells | Ratios φ^(n−1), where φ is the golden ratio; amplitude falls as 1/2^(n−1). |
| Octave Stack | Ratios 2^(n−1), with matching 1/2^(n−1) amplitude falloff. |
| Fifth Stack | Ratios 1.5^(n−1), with amplitude 1/1.5^(n−1). |
| Shepard-like Glide | Octave-spaced components under a Gaussian spectral envelope. Each component glides upward exponentially by 0.25–1 octave per note according to Chaos, reduced when necessary by the anti-alias guard. |
| Spectral Comb | Ratios 1 + spacing × (n−1), where spacing = 2 + 3 × Chaos; amplitude = 1/(1 + 0.2n). |
| Random Cloud | Ratios drawn uniformly from 0.5–4 and random amplitude weights drawn once per run. |
| Detuned Unison | All components cluster around ratio 1. Detune controls the total linear spread across the component set. |
| Harmonic Decay | Harmonic ratios and 1/n weights; component n is additionally multiplied by exp(−0.5 n t), so upper partials decay faster. |
| Rising Partials | Harmonic components with a linear upward instantaneous-frequency trajectory. Chaos sets the requested rise rate; the rise is reduced when needed to remain below the anti-alias boundary. |
| Filtered Spectrum | Harmonic ratios with 1/n weighting multiplied by a Gaussian envelope across partial index. Chaos widens the spectral weighting. |
| Modulated Swarm | Harmonic centers with stochastic amplitude weights and bounded sinusoidal phase modulation. Modulator frequency and deviation are reduced when needed for anti-alias headroom. |
After all valid components for a note are summed, the script scales that note by the inverse square root of the summed squared component weights. This equalizes expected additive energy without changing the relative spectral shape.
Amplitude envelopes
In Melody demo, the selected envelope is evaluated separately for every note rather than across the concatenated phrase.
| Envelope | Implemented behavior |
|---|---|
| No Envelope | No main amplitude envelope; only the final short safety fades are applied. |
| Percussive | Exponential decay: exp(−5t). |
| Slow Fade | Slow exponential decay: exp(−0.3t). |
| Smooth Gate | Half-cycle raised-sine-squared gates separated by true zero-valued gaps. Chaos controls the gate period. |
| Reverse | Linear fade-in from 0 to 1 across the note. |
| Tremolo | Sinusoidal amplitude modulation. Chaos controls both rate (5–20 Hz) and depth. |
| Swell | Linear attack to full level; the requested attack grows with Chaos but is capped for short notes. |
| ADSR | Attack, decay, sustain, and release in one continuous expression. Segment lengths are shortened automatically if needed to fit short melody notes. |
| Smooth Stutter | Raised-sine-squared pulses with 60% duty cycle and zero-valued gaps; Chaos controls rate from 10–40 Hz. |
| Random Bursts | A stochastic control envelope made from Gaussian amplitude events, normalized to its own peak and resampled to the audio sample rate. Chaos controls burst density and width. |
Every note receives an additional short linear fade-in and fade-out of up to 10 ms to protect note boundaries.
Melody demo
When enabled, the script ignores Duration_s for phrase length and generates a fixed 3.8-second sequence. Frequency ratios relative to the selected fundamental are:
1.00 → 1.25 → 1.50 → 2.00 → 1.50 → 1.25 → 1.00 → 0.50 root major 3rd fifth octave fifth major 3rd root lower octave
The note durations are 0.4, 0.4, 0.4, 0.6, 0.4, 0.4, 0.4, and 0.8 seconds. The spectral blueprint is shared by all notes, while each note is synthesized and enveloped separately before concatenation.
Spatial output and level
| Mode | Channels | Implementation |
|---|---|---|
| Mono | 1 | The synthesized signal is retained as a mono Sound. |
| Stereo Wide | 2 | Left = original signal; right = the same signal delayed by 7 ms. This is a short decorrelation delay, not a spectral split. |
| Rotating | 2 | Complementary equal-power gains move the mono signal between channels at 0.2 Hz. |
Spatial rendering occurs before normalization. With Normalize output enabled, the final mono or stereo object is scaled to a target peak of 0.95. The output sample rate is the value entered in Sample_rate_Hz.
Visualization and QC
The visualization combines the actual generated signal with the realized synthesis model:
- Panel A — Measured output waveform: draws the mono output, or for stereo selects the channel with the higher RMS. The amplitude axis is symmetric and derived from that channel's measured peak.
- Panel B — Realized root-note spectral blueprint: uses a logarithmic frequency axis. Blue vertical stems show rendered component start frequencies and relative blueprint weights; rust horizontal spans show the modeled frequency extent of gliding or modulated components.
- Panel C — Measured spectrogram: shows the same representative output channel. A rust guide traces the first component of each note from its modeled start to end frequency.
- QC dashboard: reports realized frequency range, number of rendered and skipped components, anti-alias reductions, measured peak and RMS, actual output duration, and seed.
The visualization therefore distinguishes the spectral blueprint from the measured output; it does not infer partials from the spectrogram and does not fold stereo to mono for display.
Randomness and reproducibility
Stochastic choices occur in Inharmonic Cluster, Random Cloud, Modulated Swarm, and Random Bursts. A positive Random_seed reproduces those choices for the same settings. Seed 0 initializes Praat's generator unpredictably. Temporary object naming is generated before the reproducible synthesis seed is applied, so object names do not consume the synthesis random stream. After synthesis, the script restores Praat's global RNG to unpredictable initialization.
Compositional context
The generator belongs to the additive-synthesis tradition in which complex spectra are constructed from individually weighted sinusoidal components. Here that basic model is extended compositionally through non-harmonic ratio sets, moving partials, stochastic spectral blueprints, per-note amplitude shaping, and spatial rendering. The emphasis is on making the spectral construction explicit and controllable rather than reproducing a particular acoustic instrument model.