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.
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.
Create_stereo is enabled, the script creates a new two-channel image by panning the generated chord voices.
Quick start
- Select exactly one Sound object in Praat.
- Run
Chord Generator from Audio. - Choose one of the ten Chord_type options.
- Set Root_level, Third_level, Fifth_level, and, for seventh chords, Seventh_level.
- Choose mono output or enable Create_stereo and set Stereo_spread.
- Optionally enable Draw_visualization and Play_result.
Chord types
| Chord | Intervals above source | Generated voices |
|---|---|---|
| Major | 0, +4, +7 st | Root, major 3rd, perfect 5th |
| Minor | 0, +3, +7 st | Root, minor 3rd, perfect 5th |
| Sus2 | 0, +2, +7 st | Root, major 2nd, perfect 5th |
| Sus4 | 0, +5, +7 st | Root, perfect 4th, perfect 5th |
| Diminished | 0, +3, +6 st | Root, minor 3rd, diminished 5th |
| Augmented | 0, +4, +8 st | Root, major 3rd, augmented 5th |
| Major 7th | 0, +4, +7, +11 st | Root, major 3rd, perfect 5th, major 7th |
| Minor 7th | 0, +3, +7, +10 st | Root, minor 3rd, perfect 5th, minor 7th |
| Dominant 7th | 0, +4, +7, +10 st | Root, major 3rd, perfect 5th, minor 7th |
| Power (5th) | 0, +7, +12 st | Root, perfect 5th, octave |
Parameters
| Parameter | Default | Behavior |
|---|---|---|
| Chord_type | Major | Selects the interval set shown above. |
| Root_level | 0.8 | Linear gain applied to the unshifted root voice. |
| Third_level | 0.6 | Linear gain applied to the second chord voice. The name is generic: for Sus2, Sus4 and Power this voice is not literally a third. |
| Fifth_level | 0.5 | Linear gain applied to the third chord voice. In Augmented, Diminished and Power modes its musical interval follows the chord table. |
| Seventh_level | 0.4 | Linear gain for the fourth voice in Major 7th, Minor 7th and Dominant 7th. Ignored for three-voice chords. |
| Create_stereo | Yes | Creates a new stereo chord image. If disabled, all chord voices are summed to mono. |
| Stereo_spread | 0.6 | Clamped 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_visualization | Yes | Draws the source/result waveforms, chord interval diagram, stereo pan display when applicable, and summary strip. |
| Play_result | Yes | Plays the final Sound after processing. |
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.
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:
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:
- Original waveform — the selected source Sound.
- Chord waveform — the final mono or stereo result.
- Chord interval diagram — bars labeled with the actual chord intervals and semitone offsets.
- Stereo pan display — shown only for stereo output; marks the root and generated voices on the L–C–R axis.
- Summary — chord type, number of voices and stereo spread or mono status.