8-Channel Canon

Creates eight fixed canon voices from one selected Sound, with independent semitone shifts and entry delays, then delivers the same eight-voice canon as octophonic audio, stems, a four-channel fold-down, or stereo.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.4.2 (2026) Praat License: MIT License Repo: Praat AudioTools
Contents:

What this does

8-Channel Canon always creates eight voices. Each voice is a pitch-shifted copy of the same mono working source, with its own semitone offset and delay. Pitch shifting uses sample-rate reinterpretation, so pitch and duration change together: upward transposition shortens a voice and downward transposition lengthens it.

The eight delayed voices first exist as eight separate working channels. Only after that canon has been built does the script choose an output format. This means the pitch/delay mechanism is the same whether the result is kept as eight channels, split into stems, folded to four channels, or mixed to stereo.

What kind of canon is this? It is a fixed eight-voice delay-and-varispeed canon. The current script does not contain variable voice count, tempo-sync entry values, independent time-stretch, reverse playback, dry/wet mixing, custom routing maps, or phase-vocoder pitch shifting.

Quick start

  1. Select exactly one Sound in Praat.
  2. Run 8-Channel_Canon.praat.
  3. Choose one of the nine named presets, or Custom.
  4. For Custom, set the eight Semitones values and eight Delay values.
  5. Choose the Output_format: 8-channel, four stereo pairs, two quad groups, 4-channel fold-down, or stereo.
  6. Leave Draw_visualization and Play_result on if you want the Picture-window analysis and an audition after processing.
Monitoring in stem formats: when the output is four stereo pairs or two quadraphonic groups, Play_result auditions a temporary mono monitoring mix of all eight voices rather than playing only the first stem.

Processing pipeline

1. Mono working source and resampling

The selected Sound is copied, converted to mono, and resampled to Resample_frequency with Praat precision 50. Multichannel sources therefore enter the canon through Praat's ordinary channel-average mono conversion.

2. Eight varispeed voices

For voice i: ratio[i] = 2^(semitones[i] / 12) temporary sampling rate = Resample_frequency × ratio[i] resample back to Resample_frequency Approximate resulting duration: voice_duration[i] = base_duration / ratio[i]

This is sample-rate reinterpretation followed by resampling, not independent pitch-preserving transposition. A +12 st voice is approximately half the duration; a -12 st voice is approximately twice the duration.

3. Entry fades

Each voice receives a fade-in and fade-out of Fade_time. For a short voice, the script clamps the fade to at most half that voice's duration so the two fades cannot overlap. A non-positive fade value produces no fade.

4. Delay placement

Each voice is placed in its own output-channel buffer at its requested delay. If any delay is negative, all eight delays are shifted together so that the earliest entry becomes 0 s. Relative delay differences are preserved.

minDelay = minimum(delay[1..8]) if minDelay < 0: effectiveDelay[i] = delay[i] - minDelay else: effectiveDelay[i] = delay[i] output duration = max(effectiveDelay[i] + voiceDuration[i]) + 0.05 s

5. Shared-gain normalization

The script measures the peak of all eight working channels, derives one common gain that makes the loudest working channel peak at 0.95, and applies that same gain to every voice channel. Stem formats therefore preserve relative level between voice groups. The 4-channel fold-down and stereo mix are summed first and then their finished output is peak-scaled to 0.95 once more.

Presets

Named presets replace both the eight semitone fields and the eight delay fields. Other settings, including sample rate, fade, output format, visualization, and playback, remain user-controlled.

PresetSemitones V1–V8Delays V1–V8 (s)
Custom0, 2, 4, 5, 7, 9, 11, 120, .2, .4, .6, .8, 1.0, 1.2, 1.4
Classic Canon0, 0, 0, 0, 0, 0, 0, 00, .3, .6, .9, 1.2, 1.5, 1.8, 2.1
Cluster0, 1, 2, 3, -1, -2, -3, -40, .15, .30, .45, .60, .75, .90, 1.05
Wide Spread0, 4, 7, 10, -3, -7, -10, -140, .25, .50, .75, 1.00, 1.25, 1.50, 1.75
Microtonal0, .5, 1, 1.5, 2, -.5, -1, -1.50, .1, .2, .3, .4, .5, .6, .7
Symmetrical6, 4, 2, 0, 0, -2, -4, -60, .2, .4, .6, .6, .8, 1.0, 1.2
Octave Stack0, 12, -12, 24, -24, 12, -12, 00, .2, .4, .6, .8, 1.0, 1.2, 1.4
Major Scale0, 2, 4, 5, 7, 9, 11, 120, .15, .30, .45, .60, .75, .90, 1.05
Chromatic0, 1, 2, 3, 4, 5, 6, 70, .1, .2, .3, .4, .5, .6, .7
Fifths Tower0, 7, 14, 21, -7, -14, -21, -280, .25, .50, .75, 1.00, 1.25, 1.50, 1.75

Parameters

ParameterDefaultActual behavior
PresetCustomCustom uses the form values; named presets replace all eight semitone and delay values.
Semitones_1 … Semitones_80, 2, 4, 5, 7, 9, 11, 12Real-valued semitone shifts. Fractional semitones are allowed.
Delay_1 … Delay_80.0 … 1.4 sReal-valued entry delays. Negative values are shifted as a block so the earliest effective entry is 0.
Resample_frequency44100 HzWorking sample rate used before and after the varispeed reinterpretation.
Fade_time0.01 sFade-in and fade-out per voice; clamped to half the individual voice duration.
Output_format8-channel octophonicSelects the deliverable channel/stem structure after all eight canon voices have been built.
Draw_visualizationonDraws the timeline, monitoring spectrogram, and summary.
Play_resultonPlays the output when one object exists; in stem formats, plays the temporary all-voice mono monitor instead.

Output formats

FormatObjectsMappingNaming
8 channels — octophonic1 × 8-channelCh1–Ch8 = V1–V8<source>_canon8ch_<preset>
4 stereo pairs4 × stereoV1|V2, V3|V4, V5|V6, V7|V8..._canon_pair_12_... through ..._pair_78_...
2 quadraphonic groups2 × 4-channelQuad 1 = V1–V4; Quad 2 = V5–V8..._canon_quad_1to4_..., ..._quad_5to8_...
4-channel fold-down1 × 4-channelCh1=V1+V5; Ch2=V2+V6; Ch3=V3+V7; Ch4=V4+V8<source>_canon_fold4_<preset>
Stereo mix1 × stereoL = V1+V2+V3+V4; R = V5+V6+V7+V8<source>_canon_stereo_<preset>
Fold-down versus spatial rendering: these mappings are channel assignments and groupings. The script contains no loudspeaker geometry, distance model, VBAP, DBAP, or binaural rendering. In particular, the stereo format is a functional split of voices 1–4 versus 5–8, not a geometrical stereo downmix.

Visualization

The current Picture-window visualization is built from the full eight-voice canon, independent of the selected output format.

Canon timeline

Monitoring spectrogram

The spectrogram is not taken from the first output stem. The script temporarily combines all eight working voices to an 8-channel object, converts that to mono, scales it to peak 0.95, and uses this all-voice monitoring mix for the spectrogram in every output format. The display covers 0–5000 Hz.

Summary

The summary reports preset, source, total output duration, all eight semitone shifts, all eight effective delays, output format, output-object count, channels per object, and the exact voice-to-output mapping.

The visualization itself is labelled v0.4.2 in the current script and reflects the runtime visual-QA revision; the DSP path is unchanged from the preceding v0.4 family.

Output and edge cases