8-Channel Comb Delay
Creates eight related feed-forward comb-difference channels from one source, with independent divisor-based periods, optional reversal of the even channels, shared-gain normalization, and several multichannel or downmix output formats.
What this does
The script selects exactly one Sound, derives a mono working source, and makes eight processed channels. Each channel uses a different divisor to derive a sample offset b. The channel signal is the difference between the current sample and a sample b samples later in the source. The eight channels can then remain separate, be grouped into stereo or quad stems, or be folded down.
- Eight comb channels: one divisor per channel.
- Ten preset choices: Custom plus nine fixed divisor patterns.
- Optional even-channel reversal: channels 2, 4, 6, and 8 are reversed after comb processing.
- Five output formats: octophonic, four stereo pairs, two quad groups, four-channel fold-down, or stereo odd/even mix.
- Shared-gain scaling: one gain is calculated from the loudest processed channel and applied to all eight before output formatting.
Quick start
- Select exactly one Sound in Praat.
- Run
8-Channel_Comb_Delay.praat. - Choose a Preset, or use Custom and enter eight positive divisors.
- Optionally enable Reverse_even_channels.
- Choose the Output_format.
- Set Scale_peak, and choose whether to draw the visualization and play the result.
Scale_peak is 0.99.Comb algorithm
Mono working source
A mono source is used for all eight channels. A multichannel input is converted to mono by Praat's ordinary channel averaging; a mono input is copied.
Divisor to sample offset
The corresponding period displayed in the visualization is b_i / sampleRate seconds. Higher divisors therefore produce smaller b values and shorter comb periods.
x[c+b]) rather than using a recursive delayed output. It therefore creates an offline feed-forward comb/difference response, not repeating feedback echoes.Even-channel reversal
If Reverse_even_channels is enabled, the already processed Sounds for channels 2, 4, 6, and 8 are reversed in time. Odd channels remain forward.
Divisor presets
| Preset | Ch1–Ch8 divisors |
|---|---|
| Custom | Uses the eight values in the form; defaults: 2, 4, 8, 10, 12, 16, 20, 24 |
| Linear | 2, 4, 6, 8, 10, 12, 14, 16 |
| Exponential | 2, 4, 8, 16, 32, 64, 128, 256 |
| Fibonacci | 2, 3, 5, 8, 13, 21, 34, 55 |
| Prime Numbers | 2, 3, 5, 7, 11, 13, 17, 19 |
| Octaves | 2, 4, 8, 16, 2, 4, 8, 16 |
| Dense Cluster | 2, 3, 4, 5, 6, 7, 8, 9 |
| Wide Spread | 2, 8, 18, 32, 50, 72, 98, 128 |
| Alternating | 2, 16, 4, 14, 6, 12, 8, 10 |
| Reverse | 24, 20, 16, 12, 10, 8, 4, 2 |
Reverse_even_channels checkbox, which reverses audio in channels 2, 4, 6, and 8.Parameters
| Parameter | Default | Behaviour |
|---|---|---|
| Preset | Custom | Selects Custom or one of nine fixed divisor patterns. |
| Delay_1 … Delay_8 | 2, 4, 8, 10, 12, 16, 20, 24 | Positive divisors used only when Custom is selected. |
| Reverse_even_channels | off | Reverses channels 2, 4, 6, and 8 after comb processing. |
| Scale_peak | 0.99 | Target used by the shared-gain stage and, for summed downmixes, by final peak scaling. Values ≤0 are reset to 0.99; values above 1 are clamped to 1. |
| Output_format | 8 channels — octophonic | Selects one of five output organizations described below. |
| Draw_visualization | on | Draws the 8 × 8 analysis/process figure. |
| Play_result | on | Plays the single output object, or a stereo odd/even monitoring mix when the chosen format creates multiple output objects. |
Output formats
| Format | Objects | Mapping | Naming |
|---|---|---|---|
| 8 channels — octophonic | 1 × 8-channel | Ch1–Ch8 remain Ch1–Ch8 | <source>_8chComb_<preset> |
| 4 stereo pairs | 4 × stereo | Ch1|Ch2, Ch3|Ch4, Ch5|Ch6, Ch7|Ch8 | ..._comb_pair_12_... through ..._pair_78_... |
| 2 quadraphonic groups | 2 × 4-channel | Ch1–Ch4 and Ch5–Ch8 | ..._comb_quad_1to4_..., ..._quad_5to8_... |
| 4-channel fold-down | 1 × 4-channel | 1=Ch1+Ch5, 2=Ch2+Ch6, 3=Ch3+Ch7, 4=Ch4+Ch8 | <source>_comb_fold4_<preset> |
| Stereo mix | 1 × stereo | L=Ch1+Ch3+Ch5+Ch7; R=Ch2+Ch4+Ch6+Ch8 | <source>_comb_stereo_<preset> |
When even-channel reversal is enabled, the stereo mapping places the forward odd channels on the left and the reversed even channels on the right. The four-channel fold-down likewise keeps odd channels with odd and even with even.
Monitoring
For the multi-object formats (four stereo pairs and two quad groups), Play_result auditions a temporary stereo monitor: odd channels are folded to the left and even channels to the right. This monitor is removed afterward and is not one of the output objects.
Normalization
Stage 1 — shared gain
The script measures the peak of all eight processed channels, finds the largest peak, computes one gain Scale_peak / peakAll, and applies that same gain to every channel. This preserves level relationships between the eight comb settings.
Stage 2 — summed downmixes only
The four-channel fold-down and stereo mix sum several channels into each output channel, so the finished object is peak-scaled again to Scale_peak. The octophonic, stereo-pair, and quad-group formats do not receive this second stage.
Visualization
The v0.5 figure uses an 8 × 8 canvas and draws directly from the eight processed working channels, so its content is independent of the selected output format.
- Header: source, preset, reversal state, duration, sample rate, and output format.
- Comb delay b: horizontal bars showing
bin samples for Ch1–Ch8, with the divisor beside each bar. - Comb period: the same offsets converted to milliseconds.
- Direction and routing: forward channels in blue, reversed even channels in red, with the destination for the selected output format.
- Processed-channel waveform: Ch1 in blue and Ch2 in orange on a shared amplitude scale.
- Summary: preset, source information, all eight divisors, output object/channel count, and routing map.
Edge cases and interpretation
floor(N/divisor) would be zero, b is clamped to 1 sample. The Info window reports that this channel has become a first-difference case rather than silence.b ≥ N, the condition c+b ≤ N is never satisfied and the channel becomes a phase-inverted copy of the source. This is reported in the Info window.