Formula Audio Manipulation — User Guide
Multi-stage sound transformation combining a formula-generated amplitude envelope, optional contour-preserving pitch modulation, and optional ring modulation.
What this does
Formula Audio Manipulation processes one selected Sound through up to three stages. First, a deterministic mathematical envelope modulates amplitude. Second, if enabled and usable F0 is detected, a layered low-frequency control signal shifts the detected source pitch contour in musical interval space. Third, if enabled, the result is blended with a sine-carrier ring-modulated version.
Source → formula AM → optional pitch modulation → optional ring modulation → peak safety.
The original number of channels, sample grid, sampling frequency, start time, and end time are preserved.
The effect is deterministic: there is no random generator or random seed. Pitch modulation depends on Praat pitch analysis, so that stage is most meaningful for voiced or otherwise clearly pitched material. If no usable pitch is detected, the script skips only the pitch stage and continues with the other enabled stages.
Quick start
- Select exactly one Sound object in Praat.
- Run
Formula_Audio_Manipulation.praat. - Choose a preset, or leave Manual selected and set the three processing stages directly.
- Use Base_frequency, Modulation_depth, and Complexity_level to define the amplitude envelope.
- Enable or disable Apply_pitch_modulation and Apply_ring_modulation as required.
- Choose whether to draw the visualization and play the result.
- Click OK. The result is selected when processing finishes.
Processing pipeline
1. Formula amplitude modulation
A mono envelope is created on the exact sample grid and time domain of the source, then the same envelope is multiplied into every source channel. The envelope is independent of the source waveform; channel 1 is used only to obtain a matching Sound grid.
envelope = 1 − md + md × shape
where
md = Modulation_depth and the generated shape is mapped approximately to 0…1.Therefore:
•
md = 0 → envelope = 1 everywhere → no AM•
md = 1 → full formula envelope• the AM stage does not intentionally amplify above unity
Complexity 1 — simple nested oscillator
Complexity 2 — layered oscillators
sin(2π·bf·t × (1 + 0.4·sin(2π·1.5·t))) +
0.6·sin(2π·bf·1.618·t × (1 + 0.5·sin(2π·2.8·t))) +
0.4·sin(2π·bf·2.718·t × (1 + 0.6·sin(2π·0.9·t)))
] / 2
At this level Modulation_depth controls the outer dry-to-envelope depth. The internal oscillator coefficients are fixed.
Complexity 3 — nested layered modulation
This level combines three oscillators at ratios 1, 1.618, and 2.414. Modulation_depth affects both the outer envelope depth and several nested phase-modulation terms.
2. Optional pitch modulation
The AM-processed signal is converted to a mono analysis reference when necessary. Praat detects its F0 contour; the script then builds a new target PitchTier from the detected source F0 at each voiced control point. It does not replace the contour with a constant median pitch.
3. Optional ring modulation
d = Ring_mod_depthf = Ring_mod_frequency
Ring_mod_depth = 0 is dry. Ring_mod_depth = 1 is full bipolar ring modulation. Intermediate values are a linear blend of the dry signal and the ring-modulated signal. The same carrier is applied directly to every channel.
Presets
Presets replace the processing parameters listed below. Draw_visualization and Play_result remain as chosen by the user. Parameters belonging to a disabled stage may retain their form values, but they are not used while that stage is off.
| Preset | AM | Pitch | Ring |
|---|---|---|---|
| Manual | Uses the form values unchanged. | ||
| Gentle Modulation | 0.3 Hz · depth 0.4 · complexity 2 | On · 0.2 Hz · depth 0.2 | Off |
| Complex Textures | 1.2 Hz · depth 0.7 · complexity 3 | On · 0.8 Hz · depth 0.3 | On · 80 Hz · depth 0.4 |
| Chaotic Systems | 2.5 Hz · depth 0.9 · complexity 3 | On · 1.5 Hz · depth 0.6 | On · 200 Hz · depth 0.8 |
| Rhythmic Pulsing | 4.0 Hz · depth 0.6 · complexity 2 | Off | On · 60 Hz · depth 0.7 |
| Harmonic Richness | 0.5 Hz · depth 0.5 · complexity 3 | On · 0.3 Hz · depth 0.4 | On · 150 Hz · depth 0.3 |
| Extreme Modulation | 3.0 Hz · depth 1.0 · complexity 3 | On · 2.0 Hz · depth 0.8 | On · 300 Hz · depth 0.9 |
| Subtle Evolution | 0.2 Hz · depth 0.3 · complexity 1 | On · 0.1 Hz · depth 0.15 | Off |
Parameters
Amplitude modulation
| Parameter | Default | Meaning |
|---|---|---|
| Base_frequency | 0.8 | Base rate in Hz used by the formula. Must be ≥ 0. |
| Modulation_depth | 0.85 | AM depth, 0…1. Zero gives an exact unity envelope. |
| Complexity_level | 3 | 1 = simple, 2 = layered, 3 = nested layered modulation. |
Pitch modulation
| Parameter | Default | Meaning |
|---|---|---|
| Apply_pitch_modulation | Yes | Enables the Praat pitch-analysis/resynthesis stage. |
| Pitch_mod_rate | 0.5 | Base rate in Hz for the layered pitch-control oscillators. Must be ≥ 0. |
| Pitch_mod_depth | 0.4 | Depth control, 0…1. It is converted internally to a symmetric musical interval. |
Ring modulation
| Parameter | Default | Meaning |
|---|---|---|
| Apply_ring_modulation | Yes | Enables the final dry/ring-modulated blend. |
| Ring_mod_frequency | 120 Hz | Sine carrier frequency. Must be ≥ 0 and below Nyquist. |
| Ring_mod_depth | 0.6 | Dry-to-ring depth, 0…1. |
Output
| Parameter | Default | Meaning |
|---|---|---|
| Draw_visualization | Yes | Draw the analysis and processing summary in the Picture window. |
| Play_result | Yes | Play the final Sound after processing. |
Pitch modulation details
Pitch analysis uses a 5 ms analysis step, a 40 Hz floor, and a ceiling of min(1200 Hz, 0.45 × sample rate). The median detected F0 is reported only as information and as the test for whether usable pitch exists; it is not used as the replacement contour.
pitchDepthSemitones = 12 × log₂(1 + Pitch_mod_depth)
Layered control
m₁ = sin(2π·rate·t)
m₂ = 0.5·sin(2π·rate·1.7·t + 0.5)
m₃ = 0.3·sin(2π·rate·0.6·t + 1.2)
shape = (m₁ + m₂ + m₃) / 1.8
semitoneShift = pitchDepthSemitones × shape
targetF0 = sourceF0 × 2^(semitoneShift/12)
The control grid is fixed at 10 ms (100 Hz) and explicitly includes the Sound end time. Points are added only where the analyzed source F0 is defined. Target values are limited to 20 Hz…0.45 × sample rate.
For multichannel material, the target PitchTier is calculated once from the mono analysis reference and then applied independently to each original channel. All channels therefore follow the same target F0 contour while the original channel count is retained.
Output behavior
- Name:
<source>_formula_Manual,_Gentle,_Complex,_Chaotic,_Rhythmic,_Harmonic,_Extreme, or_Subtle. - Channels: original channel count preserved.
- Time domain: original start time and end time preserved.
- Sample grid / sample rate: preserved.
- Randomness: none; the processing formulas are deterministic for the same source and settings.
- Peak handling: if the final absolute peak exceeds 0.95,
Scale peak: 0.95is applied. Signals already at or below 0.95 are not raised. This is an attenuate-only peak safety, not target normalization.
Visualization
When Draw_visualization is enabled, the Picture window contains:
- Original waveform — a mono display copy when the source has multiple channels.
- AM envelope — the exact formula envelope used by the DSP.
- Result waveform — a mono display copy when the output has multiple channels.
- Original and processed spectrograms — side by side, with upper frequency
min(5000 Hz, 0.45 × sample rate). - Processing-chain line — reports AM rate, whether pitch was applied or skipped, ring frequency when active, and complexity level.
- Summary strip — a compact footer for the visualization.