Chord Generator from Audio — User Guide

Harmonic expansion: generates musical chords from any audio source using precise pitch shifting and duration manipulation to create rich harmonic textures.

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

What this does

This script implements chord generation from audio — a harmonic processing technique that creates musical chords from any monophonic audio source. Generates multiple pitch-shifted copies of the original sound, each tuned to specific chord intervals, then combines them into rich harmonic structures. Process uses sophisticated duration-tier manipulation to maintain audio quality while achieving precise musical intervals.

Key Features:

What is chord generation from audio? Traditional pitch shifting: single transpositions. Chord generation: creates multiple harmonically-related versions of audio and combines them into chords. Advantages: (1) Harmonic richness: Transforms monophonic audio into full chords. (2) Musical precision: Uses exact semitone ratios for perfect intonation. (3) Source preservation: Maintains original audio character across all chord tones. (4) Flexible voicing: Different chord types create different harmonic colors. (5) Quality processing: Sophisticated resynthesis preserves audio quality. Use cases: Harmonic sound design, vocal chord creation, instrumental harmonization, educational demonstrations, musical composition.

Quick start

  1. Select Sound object in Praat (monophonic works best)
  2. Run chord_generator_from_audio.praat
  3. Choose chord_type from 8 available options
  4. Adjust volume_each_note (0.1-1.0) for individual note levels
  5. Click OK — chord is generated and played automatically
  6. Result appears as new stereo Sound object
Quick tip: Start with Major or Minor chords for traditional harmony. Use volume_each_note = 0.33 for balanced triads (three notes) or 0.25 for seventh chords (four notes) to prevent clipping when notes combine.
Audio Selection: Works best with monophonic, pitched content (vocals, solo instruments). Polyphonic or noisy audio may produce unpredictable harmonic results. The script automatically converts stereo to mono.

Chord Theory

Pitch Shifting Mathematics

🎵 Semitone Ratio Calculation

Precise frequency ratios for equal temperament:

Semitone ratio formula: semitone_ratio = 2^(1/12) ≈ 1.059463094 Frequency calculation: new_frequency = original_frequency × (semitone_ratio ^ interval) Where interval = number of semitones: Major 3rd = 4 semitones Perfect 5th = 7 semitones Octave = 12 semitones Example (Major chord): Root: original frequency × (1.05946^0) = original 3rd: original frequency × (1.05946^4) ≈ original × 1.2599 5th: original frequency × (1.05946^7) ≈ original × 1.4983

Duration Manipulation Technique

⏱️ Advanced Time Stretching

Duration tier manipulation for quality preservation:

Processing pipeline for each chord tone: 1. Copy original sound 2. Calculate target sampling frequency: new_fs = original_fs × semitone_ratio^interval 3. Override sampling frequency to new_fs (pitches audio up/down) 4. Convert to Manipulation object 5. Extract duration tier 6. Add point: time=0, value=1/semitone_ratio^interval (stretches duration back) 7. Replace duration tier (maintains original duration) 8. Resynthesize with overlap-add 9. Resample to original sampling frequency 10. Scale amplitude for mixing Result: Precise pitch shift while maintaining original duration and quality

Chord Construction System

Processing StageFunctionResult
Root NoteOriginal audio copyFoundation pitch
Third NotePitch shifted by chord-specific intervalChord quality (major/minor)
Fifth NotePitch shifted by perfect fifth intervalHarmonic stability
Seventh NotePitch shifted by seventh interval (7th chords)Chord extension
MixingCombine all notes to stereoFinal chord sound

Available Chords

Chord TypeIntervals (semitones)NotesCharacter
Major0, 4, 7Root, Major 3rd, Perfect 5thBright, happy, stable
Minor0, 3, 7Root, Minor 3rd, Perfect 5thDark, sad, melancholic
Sus20, 2, 7Root, Major 2nd, Perfect 5thOpen, ambiguous, folk
Sus40, 5, 7Root, Perfect 4th, Perfect 5thSuspended, tense, resolving
Diminished0, 3, 6Root, Minor 3rd, Diminished 5thDissonant, tense, mysterious
Augmented0, 4, 8Root, Major 3rd, Augmented 5thDreamy, unstable, surreal
Major70, 4, 7, 11Root, Major 3rd, Perfect 5th, Major 7thJazzy, sophisticated, warm
Minor70, 3, 7, 10Root, Minor 3rd, Perfect 5th, Minor 7thBluesy, mellow, contemplative

🎹 Chord Quality Characteristics

Triads (3-note chords): Major, Minor, Sus2, Sus4, Diminished, Augmented — Clear, fundamental harmonies ideal for traditional music and strong harmonic foundations.

Seventh Chords (4-note chords): Major7, Minor7 — Richer, more complex harmonies perfect for jazz, R&B, and sophisticated harmonic contexts.

Volume Balancing

Volume calculation for optimal mixing: For triads (3 notes): Optimal volume_each_note = 1/3 ≈ 0.33 Total potential amplitude = 3 × 0.33 = 0.99 (safe) For seventh chords (4 notes): Optimal volume_each_note = 1/4 = 0.25 Total potential amplitude = 4 × 0.25 = 1.0 (safe) Adjustment guidelines: volume_each_note = 0.1-0.2: Subtle, background harmony volume_each_note = 0.2-0.3: Balanced, clear chords volume_each_note = 0.3-0.4: Prominent, forward harmony volume_each_note > 0.4: Risk of clipping in dense audio

Applications

Vocal Harmonization

Instant Choir Effects: Transform solo vocal recordings into rich chordal textures. Use Major chords for uplifting vocal pads, Minor chords for emotional depth, or Seventh chords for jazz-influenced vocal harmony.
Automatic Backing Vocals: Create instant harmony parts from lead vocal lines. The script maintains the original vocal character across all chord tones, creating coherent vocal ensembles.

Instrumental Sound Design

Chordal Instruments from Monophonic Sources: Transform any monophonic instrument (flute, trumpet, violin) into chord-playing instruments. Create pad-like textures from short instrumental samples.
Harmonic Textures: Use sustained sounds or atmospheric samples as source material to create evolving chordal pads and textures for electronic music and film scoring.

Educational Use

Chord Quality Demonstration: Perfect for music education to demonstrate the sonic differences between chord types using the same source material. Students can hear how interval choices create different emotional qualities.
Ear Training: Generate chords from familiar sounds to help students recognize chord qualities in different timbral contexts.

Composition and Arranging

Harmonic Exploration: Quickly test how melodic ideas sound when harmonized with different chord types. Useful for composers exploring harmonic options for melodic material.
Texture Building: Layer multiple chord-generated sounds to create complex harmonic textures for ambient music, electronic production, or film scoring.

Technical Considerations

Source Material Quality: The quality of the output chord depends heavily on the input audio. Clean, monophonic, well-recorded sources produce the best results. Noisy or polyphonic inputs may create dissonant or muddy chords.
Processing Time: Seventh chords and longer audio files require more processing time as the script generates and combines multiple pitch-shifted versions. Complex chords on long files may take several seconds to process.
Audio Quality Preservation: The script uses Praat's overlap-add resynthesis and careful resampling to maintain audio quality through the pitch shifting process. The result should closely match the original audio character while achieving the desired harmonic intervals.