Chord Generator from Audio — User Guide

Builds a mono or stereo chord texture from one Sound by mixing the source with interval-shifted copies at user-controlled levels.

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

What this does

The script folds the selected Sound to mono, keeps one unshifted root voice, creates two or three upward-transposed copies according to the selected chord type, applies independent linear gains, and mixes the voices to mono or to a newly constructed stereo image.

The chord is relative to the source: the script does not detect a musical key or quantize the source to chord tones. Each generated voice is a fixed equal-tempered transposition of the complete source by the interval listed for the selected chord.

Channel behavior: mono input remains mono internally. Stereo or multichannel input is first converted to mono, so the original spatial image is not retained. When Create_stereo is enabled, the script creates a new two-channel image by panning the generated chord voices.

Quick start

  1. Select exactly one Sound object in Praat.
  2. Run Chord Generator from Audio.
  3. Choose one of the ten Chord_type options.
  4. Set Root_level, Third_level, Fifth_level, and, for seventh chords, Seventh_level.
  5. Choose mono output or enable Create_stereo and set Stereo_spread.
  6. Optionally enable Draw_visualization and Play_result.
Input material: the transposed voices are resynthesized through Praat Manipulation/overlap-add. Clearly pitched, approximately monophonic material is the most predictable source. Complex polyphonic or noisy material can produce resynthesis artifacts.

Chord types

ChordIntervals above sourceGenerated voices
Major0, +4, +7 stRoot, major 3rd, perfect 5th
Minor0, +3, +7 stRoot, minor 3rd, perfect 5th
Sus20, +2, +7 stRoot, major 2nd, perfect 5th
Sus40, +5, +7 stRoot, perfect 4th, perfect 5th
Diminished0, +3, +6 stRoot, minor 3rd, diminished 5th
Augmented0, +4, +8 stRoot, major 3rd, augmented 5th
Major 7th0, +4, +7, +11 stRoot, major 3rd, perfect 5th, major 7th
Minor 7th0, +3, +7, +10 stRoot, minor 3rd, perfect 5th, minor 7th
Dominant 7th0, +4, +7, +10 stRoot, major 3rd, perfect 5th, minor 7th
Power (5th)0, +7, +12 stRoot, perfect 5th, octave

Parameters

ParameterDefaultBehavior
Chord_typeMajorSelects the interval set shown above.
Root_level0.8Linear gain applied to the unshifted root voice.
Third_level0.6Linear gain applied to the second chord voice. The name is generic: for Sus2, Sus4 and Power this voice is not literally a third.
Fifth_level0.5Linear gain applied to the third chord voice. In Augmented, Diminished and Power modes its musical interval follows the chord table.
Seventh_level0.4Linear gain for the fourth voice in Major 7th, Minor 7th and Dominant 7th. Ignored for three-voice chords.
Create_stereoYesCreates a new stereo chord image. If disabled, all chord voices are summed to mono.
Stereo_spread0.6Clamped to 0–1. Controls the left/right positions of the two outer generated voices; 0 places all voices at center, 1 places voice 2 hard left and voice 3 hard right.
Draw_visualizationYesDraws the source/result waveforms, chord interval diagram, stereo pan display when applicable, and summary strip.
Play_resultYesPlays the final Sound after processing.
The four level controls and Stereo_spread are clamped internally to the range 0–1.

Pitch-shift pipeline

The root is an unshifted copy of the mono source. Every additional chord voice is generated independently.

1. Equal-tempered transposition
ratio = 2^(semitones / 12)
new sampling frequency = source sampling frequency × ratio

2. Temporary varispeed shift
The copied Sound receives the higher temporary sampling frequency, shifting the complete spectrum upward by the requested interval.

3. Duration restoration
A Praat Manipulation object is created and its DurationTier receives the constant value ratio. Overlap-add resynthesis restores the source duration while retaining the transposition.

4. Sample-rate restoration
The resynthesized voice is resampled back to the original sampling frequency with precision 50.

The script preserves the source start time, end time, duration, and final sample rate. Non-zero source start times are retained.

Adaptive pitch-analysis bounds

Before creating the chord voices, the mono source is analyzed once with a broad 40–1200 Hz pitch range. If a stable median F0 is found, the working floor is set to max(40, medianF0 / 4) and the base ceiling to max(600, medianF0 × 4). Each transposed voice expands the ceiling according to its pitch ratio and caps it below 45% of the temporary sampling frequency. If no stable median is found, the script uses the broad fallback bounds.

This pitch analysis supports the overlap-add resynthesis; it is not chord recognition and does not determine the musical root.

Mixing & output

Mono output

With Create_stereo = No, the gain-scaled root and all generated voices are summed directly into one mono Sound.

Stereo output

With Create_stereo = Yes, the script creates new left and right channels and uses constant-power pan gains:

left gain = sqrt(1 - pan)
right gain = sqrt(pan)

The root is always centered. Voice 2 is placed at 0.5 - 0.5 × Stereo_spread; voice 3 at 0.5 + 0.5 × Stereo_spread. The seventh voice, when present, is centered.

Peak safety

After mixing, the script measures the final absolute peak. If it exceeds 0.95, the complete result is scaled down to a peak of 0.95. Signals already at or below 0.95 are left unchanged. This is an attenuation-only safety ceiling, not target normalization.

Output name

The result is named <source>_<chord>, using chord labels such as Major, Minor, Maj7, Dom7, or Power.

Visualization

When Draw_visualization is enabled, the Picture window contains:

Waveform scaling: the source and result waveforms are drawn in separate panels with Praat auto-scaling, so their vertical amplitude scales are independent. Use the final peak behavior described above when judging actual output level.