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.

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

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

  1. In Praat, run AM Additive Synthesis Generator.praat. No Sound selection is required.
  2. Choose a Preset, or leave Custom to use the fields below.
  3. Choose a Texture type and Envelope type.
  4. Leave Melody demo off for one note, or enable it for the built-in arpeggio.
  5. Choose Mono, Stereo Wide, or Rotating output.
  6. Use a positive Random seed when you need a reproducible realization; 0 creates a new stochastic realization.
  7. 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

ParameterDefaultBehavior
Melody demoOffOff: synthesize one note for Duration_s. On: synthesize the fixed eight-note phrase described below.
PresetCustomSelects one of eight stored configurations. Presets override only the fields listed in the Presets section.
Duration_s3.0 sSingle-note duration. Values below 0.05 s are raised to 0.05 s. This field does not determine Melody demo duration.
Sample_rate_Hz44100Sampling rate of the generated sound. Minimum accepted value: 1000 Hz.
Fundamental_Hz220 HzRoot frequency used to scale the spectral blueprint. It must remain below 0.45 × sample rate.
Num_partials8Requested blueprint components. Internally limited to 1–32; individual components can still be skipped by the anti-alias guard.
Texture_typeHarmonic SeriesSelects one of fifteen spectral constructions.
Detune0.1Clamped to 0–1. In the current implementation it directly controls the spread of Detuned Unison.
Chaos0.3Clamped to 0–1. Used by selected texture algorithms and several envelope algorithms as a variation/modulation control.
Random_seed00 = new stochastic realization. Positive values reproduce stochastic spectral choices and Random Bursts for the same settings.
Envelope_typeNo EnvelopeSelects one of ten amplitude-envelope behaviors. A short safety fade is still applied at note boundaries.
Spatial_modeMonoMono, Stereo Wide, or Rotating.
Normalize_outputOnWhen enabled, Praat Scale peak: 0.95 performs target peak normalization after spatial rendering.
Draw_visualizationOnDraws the measured/model QC visualization described below.
Play_resultOnAutomatically 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.

PresetOverridden settings
Warm Pad5 s; 110 Hz; 6 partials; Harmonic Series; detune 0.05; chaos 0.1; Swell; Stereo Wide.
Bright Organ3 s; 220 Hz; 10 partials; Odd Harmonics; detune 0.02; chaos 0.05; No Envelope; Stereo Wide.
Bell Tone4 s; 440 Hz; 8 partials; Golden Bells; detune 0.08; chaos 0.2; Percussive; Rotating.
Shimmer5 s; 330 Hz; 12 partials; Detuned Unison; detune 0.15; chaos 0.3; Tremolo; Rotating.
Bass Drone8 s; 55 Hz; 6 partials; Harmonic Series; detune 0.03; chaos 0.1; Slow Fade; Stereo Wide.
Ethereal Choir6 s; 180 Hz; 8 partials; Filtered Spectrum; detune 0.1; chaos 0.4; Swell; Rotating.
Plucked String2 s; 196 Hz; 10 partials; Harmonic Decay; detune 0.02; chaos 0.15; Percussive; Mono.
Sci-Fi Sweep4 s; 150 Hz; 10 partials; Rising Partials; detune 0.1; chaos 0.5; Reverse; Rotating.

Texture types

TextureImplemented spectral rule
Harmonic SeriesRatios 1, 2, 3… with amplitude 1/n.
Odd HarmonicsRatios 1, 3, 5… with amplitude 1/harmonic number.
Even HarmonicsRatios 2, 4, 6… with amplitude 1/harmonic number.
Inharmonic ClusterRatio = 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 BellsRatios φ^(n−1), where φ is the golden ratio; amplitude falls as 1/2^(n−1).
Octave StackRatios 2^(n−1), with matching 1/2^(n−1) amplitude falloff.
Fifth StackRatios 1.5^(n−1), with amplitude 1/1.5^(n−1).
Shepard-like GlideOctave-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 CombRatios 1 + spacing × (n−1), where spacing = 2 + 3 × Chaos; amplitude = 1/(1 + 0.2n).
Random CloudRatios drawn uniformly from 0.5–4 and random amplitude weights drawn once per run.
Detuned UnisonAll components cluster around ratio 1. Detune controls the total linear spread across the component set.
Harmonic DecayHarmonic ratios and 1/n weights; component n is additionally multiplied by exp(−0.5 n t), so upper partials decay faster.
Rising PartialsHarmonic 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 SpectrumHarmonic ratios with 1/n weighting multiplied by a Gaussian envelope across partial index. Chaos widens the spectral weighting.
Modulated SwarmHarmonic 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.

EnvelopeImplemented behavior
No EnvelopeNo main amplitude envelope; only the final short safety fades are applied.
PercussiveExponential decay: exp(−5t).
Slow FadeSlow exponential decay: exp(−0.3t).
Smooth GateHalf-cycle raised-sine-squared gates separated by true zero-valued gaps. Chaos controls the gate period.
ReverseLinear fade-in from 0 to 1 across the note.
TremoloSinusoidal amplitude modulation. Chaos controls both rate (5–20 Hz) and depth.
SwellLinear attack to full level; the requested attack grows with Chaos but is capped for short notes.
ADSRAttack, decay, sustain, and release in one continuous expression. Segment lengths are shortened automatically if needed to fit short melody notes.
Smooth StutterRaised-sine-squared pulses with 60% duty cycle and zero-valued gaps; Chaos controls rate from 10–40 Hz.
Random BurstsA 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

ModeChannelsImplementation
Mono1The synthesized signal is retained as a mono Sound.
Stereo Wide2Left = original signal; right = the same signal delayed by 7 ms. This is a short decorrelation delay, not a spectral split.
Rotating2Complementary 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:

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.