A labs.llc instrument
What is actually
in the file.
Drop any audio file and read it: the key and the tempo, the peak and the crest factor, how its energy is spread across eight bands — and a plain verdict on whether it is going to hurt to listen to, with the partials responsible named to the hertz and to the note.
Most tools tell you that a mix is harsh. This one tells you where, in numbers you can act on. Harshness is not a matter of taste: the ear canal is a quarter-wave resonator about 25mm long, so hearing peaks between 2 and 5kHz, and a mix with a fifth of its energy in that band will be painful at any volume.
Nothing is uploaded. The file is decoded and measured in this tab and never leaves the machine — there is no server here to send it to.
The bench
Drop a file on it
MP3, WAV, M4A, FLAC, OGG — anything this browser can decode. A minute and a half is taken from the middle of the file, because the first ten seconds of a record are usually an intro and usually not what the question is about.
Measuring…
The balance
Where the energy is
The share of total energy in each band, averaged across the whole excerpt. A mix that is comfortable to listen to for an hour usually runs 10–15% in the bite band. The shaded region on the curve is that band.
The partials responsible
The strongest isolated peaks between 2 and 5kHz. Two of these sitting within a few tens of hertz of each other is roughness rather than pitch — the critical band up there is some 700Hz wide, so anything closer than that falls inside one band and the ear reports it as harshness.
The manual
How each number is arrived at
The spectrum
A 4096-point Hann-windowed FFT every 1024 samples, written out in
js/dsp.js because a radix-2 transform is smaller than any library that would
provide one and this page has no build step. Every other measurement reads from that one
spectrogram, which is the difference between answering in a second and answering in five.
The key
Krumhansl-Schmuckler. The spectrum is folded into twelve pitch classes and correlated against the twenty-four major and minor profiles Krumhansl and Kessler obtained by asking listeners how well each note fitted a key. Only 65–2000Hz is folded in: below that the bins are too coarse to separate one semitone from the next, above it the harmonics of everything start voting for keys nobody played. The page prints the runner-up and how close it was, because a key detector that never admits doubt is wrong about a third of the time without telling you.
The tempo
Spectral flux for the onset envelope — the sum of how much each bin grew since the last frame, which is what an onset is and what a plain amplitude envelope misses on anything with a pad under it. Then the envelope is autocorrelated and the strongest lag between 70 and 180 BPM is read off. Octave errors are the standard failure of this method, so where a candidate's double also scores well the faster reading is reported.
The verdict
Thresholds from measuring real mixes rather than from a table: healthy sits at 10–15% in the bite band, and the recording that caused this page to exist ran 22% with peaks at 64%. The page flags a low top end as well as a hot middle, because a mix with nothing above 6.3kHz reads as shrill rather than bright — a peak at 3.5kHz with nothing over it has no context, and the ear hears an isolated scream.
What it does not do
It is not a loudness meter to BS.1770 — the level tiles are sample peak and plain RMS, not LUFS and not true peak, and they are labelled as what they are. It measures the mono sum, so it says nothing about stereo width or phase. And it reads ninety seconds from the middle, so a file that changes character halfway through will be described by its middle.
Where the file goes
Nowhere. It is read with a FileReader, decoded with
decodeAudioData and measured in this tab. There is no request in
js/dsp.js or js/app.js that could send it anywhere, and you are
welcome to read both — they are the only two scripts this property adds.