Skip to content

midi2-dev/WaveFileAmplitudeAnalyzer

Repository files navigation

6:11:2026

WaveFileAmplitudeAnalyzer.py

The program was converted to python 3.13.14 A Python CLI (command Line Interface) tool for analyzing peak amplitude levels across MIDI velocity levels in piano wave files. Originally written in MATLAB/Octave by Dave Starkey (dstarkey@midi9.com); this is the Python port.

Overview

Given a WAV file containing recordings of a piano note at multiple velocity levels (e.g. recorded from a MIDI sampler session), this tool slices the audio into per-note, per-velocity segments, measures peak amplitude in each, converts to dB, and outputs a multi-page PDF with waveform plots plus a summary .txt file.

more details are available in AI_py_README.md

Usage: python wave_amplitude_analyzer.py --input [options]

python wave_amplitude_analyzer.py --input WaveSource/myfile.wav
python wave_amplitude_analyzer.py --input WaveSource/myfile.wav --velocities 13
python wave_amplitude_analyzer.py --input WaveSource/myfile.wav --thump-size 2 --preroll 0.3 --deadspace 2
python wave_amplitude_analyzer.py --help

Dependencies: pip install numpy pip install scipy pip install matplotlib pip install soundfile """ Piano wave file amplitude analyzer — Python port of WaveFileAmplitudeAnalyzer.m

options: -h, --help show this help message and exit --input, -i INPUT Path to input .wav file --velocities, -v {10,13} Number of velocity layers: 10 or 13 (default: 10) --thump-size, -t THUMP_SIZE Seconds per note/velocity slot (default: 3.0; use 2.0 for Yamaha files) --preroll, -p PREROLL Pre-roll fraction of thump size (default: 0.9; use 0.3 for Yamaha files) --deadspace, -d DEADSPACE Dead space in seconds per note group (default: 0; use 2 for Yamaha files) --output-dir, -o OUTPUT_DIR Output directory for PDF and TXT results (default: Results)

Examples: python wave_amplitude_analyzer.py --input WaveSource/myfile.wav python wave_amplitude_analyzer.py --input WaveSource/myfile.wav --velocities 13 python wave_amplitude_analyzer.py --input WaveSource/myfile.wav --thump-size 2 --preroll 0.3 --deadspace 2

5:28:2026

WaveFileAmplitudeAnalyzer

WaveFileAmplitudeAnalyzer.m is an Octave (similar to Matlab) script for analyzing audio file for use to make compliant piano implementations of the MIDI Piano Profile

Readme for Version 4 WaveFileAmpltudeAnalyzer_4.m:

This script is made by Dave Starkey for use in evaluating wave files were generated by playing Piano Profile 8 Notes at 13 Velocities 2025-12-18.mid or Piano Profile 8 Notes at 10 Velocities 2025-12-18.mid or by playing the file on various platforms with various recording systems.

The intent is to allow MIDI Association and AMEI members to compare the amplitude vs velocity response of their instruments and compare them to other instruments.

When the Piano Profile began concept was that there would be one reference piano that all complying instruments would emulate. As the project continued it became clear that strict adherence to such strict standards would be hard to achieve.

Ultimately, the MIDI Association and AMEI will publish several reference file sets for comparison. MIDI Association and AMEI members may use this tool to compare their own instrument’s velocity response to the reference files.

The WaveFileAmplitudeAnalyzer.m is a script written for use with GNU.octave.10.2.0 an open source platform. As of May 2026 the source resides on the Midi Association's GitHub under revision contrel. Octave uses a language that is almost identical to Matlab. This script is intended to be shared by MIDI Association members but may to be released to the world. It carries no warranty of any kind. If you need help using or modifying this code please contact Dave Starkey.

As of today May 30 2026 I have analyzed more than 20 different recordings. However there are 4 recordings and results on the GitHub site now. These are explained in Read me for WaveFileAmplitudeAnalyzer.m found on the PianoProfile web page Wave File Amplitude Analyzer (from Dave Starkey). The results for all of those files can be found in Results.

This version should work on both Mac and PC.
On Line 40 -graphics_toolkit('gnuplot');%comment out for use with MAC might work comment this line out when using a Mac. The native rendering tools on the Mac work well and the gnuplot is not required

New version posted 5-28-2026 This allows some modification due to some non comfoming wave files.

At the top of the WaveFileAmplitudeAnalyzer.m there are some constants that might be changed to compensate for ill fitting files:

NumVelocities = 10 or 13; optional number of velocities per note thumpSizeSeconds = 3 or maybe 2; the originaly 2 seconds later changed to 3 seconds DeadSpace = 0 or maybe 2; the offical file has no pad between note numbers. preRoll = .9 or maybe .3;default .9 but .3 for recent yamaha files

About

WaveFileAmplitudeAnalyzer.m is an Octave (similar to Matlab) script for analyzing audio file for use to make compliant piano implementations of the MIDI Piano Profile

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages