Continuous Pitch over MIDI Grid Visualizer — User Guide
Advanced pitch visualization: displays continuous pitch contours overlaid on a MIDI note grid with multiple color schemes and visualization options.
What this does
This script implements continuous pitch visualization over a MIDI grid — a comprehensive tool for analyzing and displaying pitch contours with musical context. The visualizer extracts fundamental frequency (F0) from audio, converts to MIDI note values, and plots continuous pitch curves overlaid on a standard MIDI note grid. Multiple visualization options allow for detailed analysis of pitch behavior, intonation, vibrato, glissandi, and microtonal variations.
Key Features:
- Continuous Pitch Tracking — Accurate F0 extraction with adjustable parameters
- MIDI Grid Overlay — Standard musical reference for pitch analysis
- Multiple Color Schemes — 5 different visualization modes
- Flexible Line Styles — Continuous lines, variable thickness, or dots
- Intensity Mapping — Loudness information encoded in visualization
- Smart Smoothing — Multiple algorithms for cleaner pitch tracks
- Automatic Range Detection — Smart MIDI range adjustment
Technical Implementation: (1) Pitch Extraction: Uses Praat's advanced pitch tracking algorithm with user-defined floor/ceiling and time step. (2) Intensity Analysis: Simultaneously extracts loudness information for visualization encoding. (3) MIDI Conversion: Converts Hz values to MIDI note numbers using standard formula: MIDI = 69 + 12×log₂(Hz/440). (4) Smoothing: Applies optional median filtering or moving average to reduce pitch tracking errors. (5) Grid Drawing: Creates MIDI note grid with customizable display options. (6) Visualization: Plots pitch contour using selected color scheme and line style, with intensity information mapped to visual properties. (7) Range Management: Automatically or manually sets MIDI display range with padding for optimal visualization.
Quick start
- In Praat, select exactly one Sound object.
- Run script… →
continuous_pitch_midi_grid_visualizer.praat. - Set pitchFloor and pitchCeiling appropriate for your audio.
- Choose MIDI range: Auto-detect or manual specification.
- Select smoothing option if needed (recommended for noisy signals).
- Choose color scheme based on analysis goals.
- Select line style and adjust parameters if using dots.
- Configure display options (grid lines, labels, etc.).
- Set intensity range for loudness mapping.
- Click OK — visualization appears in Picture window.
Pitch Analysis System
Fundamental Frequency Extraction
Praat Pitch Algorithm
Advanced autocorrelation method:
Parameter Guidelines
Optimal settings by voice type:
| Voice Type | pitchFloor | pitchCeiling | Notes |
|---|---|---|---|
| Bass | 65 Hz | 300 Hz | Low male singing |
| Tenor | 80 Hz | 500 Hz | High male singing |
| Alto | 130 Hz | 600 Hz | Low female singing |
| Soprano | 180 Hz | 1100 Hz | High female singing |
| Child | 200 Hz | 800 Hz | Children's voices |
| Speech (male) | 75 Hz | 300 Hz | Conversational speech |
| Speech (female) | 120 Hz | 500 Hz | Conversational speech |
| Violin | 190 Hz | 3000 Hz | G3 - E7 range |
| Cello | 60 Hz | 1000 Hz | C2 - C6 range |
MIDI Conversion System
Hz to MIDI Formula
Standard equal temperament conversion:
MIDI Note Numbering
Standard MIDI note reference:
Smoothing Algorithms
Median Filtering
3-frame median filter:
Moving Average
3-frame moving average:
Smoothing Selection Guide
| Smoothing Type | Best For | Preserves | Removes |
|---|---|---|---|
| No smoothing | Clean signals, vibrato analysis | All microvariations | Nothing |
| Median 3-frame | Noisy signals, pitch errors | Sharp transitions | Outliers, octave jumps |
| Median 5-frame | Very noisy signals | General contour | More outliers |
| Moving average | General smoothing | Slow variations | High-frequency changes |
MIDI Grid System
Automatic Range Detection
Smart MIDI Range
Algorithm for automatic range setting:
Grid Display Options
Note Line Styling
Hierarchical grid system:
Note Labeling
Automatic note name generation:
Time Grid System
Vertical Time Markers
Optional time grid:
Visualization Options
Color Schemes
🎨 Pitch+Loudness Rainbow
Mapping: Pitch height → Hue, Loudness → Brightness
Visual effect: Rainbow gradient from low (red) to high (blue) pitches
Best for: General pitch contour analysis, overall pattern recognition
🎵 PitchClass+Loudness Wheel
Mapping: Pitch class → Hue, Loudness → Brightness
Visual effect: Color repeats every octave, same note = same color
Best for: Tonal music analysis, key relationships, chord progressions
⚫ Grayscale Loudness
Mapping: Loudness → Grayscale value
Visual effect: Monochromatic, loud sections = dark, quiet = light
Best for: Focus on dynamics, intensity-pitch relationships
🔥 Intensity Heatmap
Mapping: Loudness → Heat colors (blue-green-yellow-red)
Visual effect: Thermal display, loud = hot colors
Best for: Emphasis on loudness variations, intensity hotspots
🌀 Octave Spiral
Mapping: Pitch class → Hue, Octave → Brightness
Visual effect: Colors spiral through brightness with octaves
Best for: Wide-range music, register changes, vocal range analysis
Line Style Options
Thin Continuous Line
Standard continuous plot:
Thickness Varies with Loudness
Dynamic line thickness:
Dots with Size Varies with Loudness
Point-based visualization:
Intensity Processing
Loudness Extraction
Praat intensity analysis:
Logarithmic Compression
Perceptual loudness mapping:
Applications
Vocal Pedagogy
Use case: Voice training and intonation practice
Technique: Compare sung pitch to equal temperament reference
Settings: PitchClass+Loudness Wheel, thin continuous line, showNoteLabels=yes
Ethnomusicology
Use case: Analysis of non-Western tuning systems
Technique: Examine microtonal patterns and scale structures
Settings: No smoothing, thin continuous line, showAllSemitones=no
Speech Intonation Analysis
Use case: Study of prosody and intonation patterns
Technique: Analyze pitch contours in relation to linguistic structure
Settings: Pitch+Loudness Rainbow, median smoothing, autoMidiRange=yes
Instrument Performance Analysis
Use case: Study of expressive pitch variations
Technique: Analyze vibrato, portamento, and intonation tendencies
Settings: Octave Spiral, thickness varies with loudness
Sound Design
Use case: Analysis of synthetic pitch contours
Technique: Visualize glissando, pitch envelopes, FM modulation
Settings: Intensity Heatmap, dots with variable size
Practical Workflow Examples
🎤 Voice Lesson Analysis
Goal: Help student improve intonation
Settings:
- Color: PitchClass+Loudness Wheel
- Line: Thin continuous
- Smoothing: Median 3-frame
- Show note labels: Yes
- MIDI range: Auto with padding 3
Analysis: Identify consistently sharp/flat notes, vibrato extent, pitch stability
🎻 Violin Vibrato Study
Goal: Analyze vibrato rate and extent
Settings:
- Color: Pitch+Loudness Rainbow
- Line: Thin continuous
- Smoothing: No smoothing
- Show all semitones: No
- Time grid: Yes
Measurements: Count cycles per second, measure pitch deviation, analyze regularity
🗣️ Speech Prosody Research
Goal: Study question vs statement intonation
Settings:
- Color: Grayscale Loudness
- Line: Thickness varies
- Smoothing: Moving average
- Log loudness: Yes
Analysis: Compare final pitch direction, pitch range, loudness patterns
Advanced Analysis Techniques
- Cent measurement: 1 semitone = 100 cents, visualization shows cent deviations
- Just intonation: Compare to pure intervals (e.g., 5:4 major third = 386 cents)
- Regional scales: Identify maqam, raga, or other non-ET pitch collections
- Blue notes: Analyze pitch bending in blues/jazz performance
- Rubato: Use time grid to analyze tempo variations
- Articulation: Examine attack and release timing
- Phrasing: Identify musical phrases through pitch and dynamics
- Emphasis: Correlate loudness peaks with structural points
Troubleshooting Common Issues
Cause: Incorrect pitch range, noisy signal, or unvoiced audio
Solution: Adjust pitchFloor/pitchCeiling, use smoothing, check signal quality
Cause: Pitch tracking confusion with harmonics
Solution: Use median smoothing, narrow pitch range, manual correction
Cause: Incorrect MIDI range or time step
Solution: Adjust autoMidiRange padding, change timeStep resolution
Cause: Misunderstanding of color mapping
Solution: Review color scheme descriptions, try different schemes
Technical Reference
Complete Parameter Reference
| Parameter | Type | Default | Description |
|---|---|---|---|
| pitchFloor | positive | 75 | Minimum expected pitch (Hz) |
| pitchCeiling | positive | 600 | Maximum expected pitch (Hz) |
| timeStep | positive | 0.01 | Analysis frame interval (s) |
| autoMidiRange | boolean | 1 | Auto-detect MIDI display range |
| manualMidiMin | integer | 48 | Manual MIDI minimum (if auto=no) |
| manualMidiMax | integer | 84 | Manual MIDI maximum (if auto=no) |
| midiPadding | positive | 3 | Padding for auto range (semitones) |
| smoothing | optionmenu | 1 | Pitch smoothing algorithm |
| colorScheme | optionmenu | 1 | Visualization color mapping |
| lineStyle | optionmenu | 1 | Pitch contour display style |
| minDotSize | positive | 0.8 | Minimum dot size (mm) |
| maxDotSize | positive | 3.5 | Maximum dot size (mm) |
| showAllSemitones | boolean | 1 | Show all semitone grid lines |
| showNoteLabels | boolean | 1 | Show note names on C lines |
| showTimeGrid | boolean | 0 | Show vertical time grid |
| intensityMinDb | positive | 40 | Minimum intensity for mapping (dB) |
| intensityMaxDb | positive | 80 | Maximum intensity for mapping (dB) |
| useLogLoudness | boolean | 1 | Use logarithmic loudness compression |
Performance Considerations
Processing Time Factors
Major time consumers:
Memory Usage
Storage requirements: