Spectral Swirl Multi-Channel
Creates an eight-channel sound from one mono working copy by applying a different full-file sinusoidal spectral-bin warp to each output channel. The eight channels therefore share the same source and duration but differ in spectral redistribution.
What this does
The script accepts exactly one Sound. If the source has more than one channel, it is first converted to mono. Praat then computes one full-file Spectrum from that mono working copy. Eight output channels are generated from the same immutable source Spectrum, with a different sinusoidal bin-displacement curve for each channel.
For channel i, two parameters vary systematically:
depth[i] = Base_depth + Depth_increment × (i - 1)
This produces an eight-channel family ranging from the first channel's base warp to progressively different spectral mappings in the later channels.
Quick start
- Select exactly one Sound in Praat.
- Run
Spectral_Swirl_Multi-Channel.praat. - Choose a preset, or select Custom.
- For Custom, set Base depth, Depth increment, Base cycle, and Cycle increment.
- Set the edge fade and Wet/dry percent.
- Choose whether to draw the visualization and play the result.
- Press OK. The script creates one eight-channel Sound named
source_swirl8ch_preset.
Processing model
1. Mono working source
Mono input is copied. Any source with more than one channel is downmixed to mono before spectral processing. The original Sound remains in the Objects list.
2. One immutable full-file Spectrum
The mono working Sound is converted once with Praat's To Spectrum: "yes". v0.4.2 keeps this Spectrum unchanged. Each output channel receives its own copy and reads source bins only from the immutable Spectrum.
sourceBin = round(k + depth[i] × sin(2π × cycle[i] × k / K))
sourceBin = clamp(sourceBin, 1, K)
Y_i(k) = X(sourceBin)
The same source-bin mapping is applied to the real and imaginary Spectrum rows. Thus each selected source bin contributes its existing complex spectral value; the script does not separately generate new magnitude or phase trajectories.
depth is measured in Spectrum bins. cycle is the number of sinusoidal displacement cycles distributed across the normalized frequency-bin axis. It is not a rate in hertz and does not describe temporal motion.
3. Clamp, not circular wrap
If the displaced index falls below the first bin or above the final bin, it is clamped to the nearest valid bin. The algorithm therefore does not circularly rotate or wrap bins from one spectral edge to the other.
4. Eight inverse transforms
Each warped Spectrum is converted back to a Sound. The eight resulting mono Sounds are then combined into one eight-channel output.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
| Preset | Custom | Selects one of six named parameter sets or leaves the four warp controls at the form values. |
| Base_depth | 50 | Bin-displacement amplitude for Channel 1. Positive value. |
| Depth_increment | 25 | Additional displacement depth added for each successive channel. |
| Base_cycle | 2 | Number of sinusoidal displacement cycles across the Spectrum for Channel 1. |
| Cycle_increment | 1.0 | Amount added to the cycle count for each successive channel. This field is a real number and may be negative. |
| Fade_duration_(s) | 0.01 | Linear fade applied to the beginning and end of the wet eight-channel signal when the value is greater than 0 and shorter than half the final duration. |
| Wet_dry_percent | 100 | Linear wet percentage. Values are clamped internally to 0–100. |
| Draw_visualization | 1 | Draws the analysis/output overview in the Picture window. |
| Play_result | 1 | Invokes Praat's Play command on the final eight-channel Sound. |
Presets
| Preset | Base depth | Depth inc. | Base cycle | Cycle inc. |
|---|---|---|---|---|
| Subtle Shimmer | 20 | 10 | 2 | 0.5 |
| Medium Swirl | 50 | 25 | 2 | 1.0 |
| Deep Swirl | 100 | 40 | 3 | 1.5 |
| Extreme Chaos | 200 | 60 | 5 | 2.0 |
| Gentle Spatial | 15 | 5 | 1 | 0.25 |
| Tight Cluster | 40 | 5 | 3 | 0.2 |
How the preset values expand across channels
For example, Medium Swirl produces:
Channel 2: cycle 3.0, depth 75
Channel 3: cycle 4.0, depth 100
...
Channel 8: cycle 9.0, depth 225
Wet/dry, fades, and output level
Linear wet/dry mix
The mix law is:
dry = 1 - wet
output = wet × warped8ch + dry × dry8ch
The dry signal is the same mono working source copied into all eight channels. It is therefore a centered/common eight-channel bed rather than the original multichannel input image.
Fade order
The linear fade-in/out is applied before the dry signal is mixed in. Consequently, at Wet/Dry values below 100%, the dry component is not faded and can remain audible at the file edges.
Final peak scaling
After wet/dry mixing, the complete eight-channel output is always processed with Scale peak: 0.99. This is a single final peak normalization across the combined result and may either attenuate or amplify it. There is no transparent bypass at 0% wet because the dry result is still peak-scaled to 0.99.
Visualization
When Draw_visualization is enabled, the Picture window shows:
- Title and subtitle — source, preset, base depth, channel-cycle span, and wet percentage.
- Input waveform — the original selected Sound.
- Eight output waveforms — a 2×4 grid, one small waveform for each output channel, labelled with that channel's cycle and depth.
- Swirl displacement curves — the eight sinusoidal bin-displacement laws plotted against normalized frequency.
- Output spectrogram — Channel 4, displayed from 0 to 5000 Hz.
- Channel legend — each channel's cycle and depth.
- Parameter/output summary — base/increment values, channel count, duration, sample rate, wet/dry value, and fade duration.
Notes & limitations
- Fixed eight-channel architecture: output always contains eight channels, regardless of the input channel count.
- Input spatial image is not preserved: all processing starts from a mono working copy.
- Static transform: the mapping does not evolve over the duration of the sound. Any audible temporal complexity comes from the transformed source itself, not from a time-varying control trajectory.
- Bin remapping is not one-to-one: rounding and clamping can make several output bins read the same source bin, while some source bins may not be read.
- No circular wrap: displacement beyond the Spectrum boundaries is clamped.
- No explicit formant preservation: large depths can substantially alter harmonic and formant structure.
- Whole-file transform: the method is conceptually different from STFT processing and does not expose FFT-size, hop-size, or window controls.