Musicology·A Field Guide

§ I.5 · The CLI Workshop · No. XII

Onset / Meter
Profiler.

After Huron 2006 · cf. Large & Palmer 2002

Reads a sequence of inter-onset intervals (in milliseconds, or as proportional beat units) and applies salience-weighted autocorrelation against a small bank of metrical templates — 2/4, 3/4, 4/4, 5/8, 6/8, 7/8, 12/8. Outputs a best-fit time signature with a confidence score, candidates ranked, and a salience-peak profile across the bar.

Why a command line

Ethnomusicologists transcribing field recordings, performance researchers analysing expressive timing, and computational musicologists studying corpus meter-distributions need automated meter detection. Rubato passages, polyrhythmic material, and non-Western music demand something better than rule-based heuristics. The tool gives you a confidence-ranked answer in milliseconds, ready to chain into your transcription pipeline.

Invocation

$ node 03-meter.js < ioi-list.txt
$ echo "500 500 500 250 250 500" | node 03-meter.js
$ node 03-meter.js --proportional < beat-ratios.txt
$ node 03-meter.js --top=3 < performance.txt

Sample output

best-fit:    4/4   (confidence: 0.87)
candidate:   2/2   (confidence: 0.71)
candidate:   3/4   (confidence: 0.62)

salience-peaks (ms · weight):
   0    1.00
 500    0.92
1000    1.00
1500    0.71

Scope

input        whitespace-delimited inter-onset intervals on stdin / file
             — milliseconds (default)
             — proportional beat units with --proportional

flags        --top=N           emit the top N candidates (default 3)
             --beat=ms         override the inferred tactus beat
             --no-peaks        suppress the salience-peak block

output       a best-fit line, ranked candidates, and a salience-peak profile.
             Confidence is the normalised cross-correlation between the
             onset grid and a Lerdahl–Jackendoff metrical-weight template.

References

Source

cli/03-meter.js ↗ raw
loading source…
← Back to the CLI workshop