Formant to MIDI Chord Converter — User Guide

Segments a sound file, extracts the first four formants (F1-F4) from each segment, and converts them to MIDI notes (cents) to represent a time-varying chord structure.

Category: Analysis / Phonetics / Music Praat Script: FormantToMidiChord.praat
Contents:

What this does

This script is a tool for analyzing the spectral characteristics of a sound, typically speech or singing, and mapping them onto musical pitches. It divides the selected Sound object into segments, calculates the center frequency of the first four formants (F1, F2, F3, F4) in each segment, and translates these frequencies into MIDI cents (a representation of musical pitch, where 100 cents = 1 semitone).

The result is a detailed output in the Praat Info window showing the four frequencies and their corresponding closest musical notes (e.g., C4 +15¢), allowing users to see the spectral resonance as a musical chord progression.

Theory

The script uses a standard formula to convert frequency in Hertz (Hz) to a MIDI note number (and then cents):

MIDI Note = 69 + 12 * log2(Frequency / 440)

The four formants (F1-F4) are used to represent a four-part chord:

Quick start

  1. In Praat, select exactly one Sound object (preferably speech or a sustained vocalization).
  2. Run script…FormantToMidiChordConverter.praat.
  3. Adjust the Number of segments to control the time resolution (more segments = finer time slices).
  4. Click OK.
  5. The results, showing the four-part chord analysis for each time segment, are printed in the Praat Info window.

Parameters (form fields)

Name (GUI)TypeDefaultDescription
Number of segmentspositive integer8The number of equally-sized time segments the input sound will be divided into for analysis.
Time steppositive real0.01The time step (in seconds) used to create the internal Formant object. Finer steps provide more detail but take longer.
Max formant Hzpositive real5500The maximum frequency (in Hz) the formant tracker will look for formants. Set higher for high-pitched sounds or lower for deep voices.
Number of formantspositive integer5The number of formants the internal Praat object will attempt to track. The script itself only uses the first 4 (F1-F4).
Window lengthpositive real0.025The duration (in seconds) of the analysis window used by the Burg algorithm for formant estimation.

Outputs

The script does not create a new object in the Praat Objects window. All results are printed to the Praat Info window.

The output for each segment includes: