ferraus analyze key

Key and scale with confidence

Synopsis

ferraus analyze key <input> [options] [-o <output>]

What it does

Estimates the key and mode by correlating a chroma profile (from an STFT with tuning estimation) with Krumhansl-Schmuckler major and minor profiles. Reports the confidence (normalised margin over the best key with a different scale), the top-3 alternatives, the tuning offset and the chroma. --method notes uses a duration-weighted histogram of the tracked notes instead, which suits monophonic vocals.

Examples

Key, mode, confidence and alternatives

ferraus analyze key song.wav --json

Key of a solo vocal from its notes

ferraus analyze key vocal.wav --method notes

Key of a loop from its chroma, saved as JSON

ferraus analyze key loop.wav --method chroma -o key.json

Options

FlagTypeDefaultMeaning
--methodchroma | noteschromachroma: STFT chroma (any material); notes: pitch-tracked notes (monophonic)

Global options

Every command also accepts the global options (-o, --json, --dry-run, --overwrite, --progress, ...). See Global options.

Exit codes

CodeMeaning
0Success
1Processing failed
2Usage or parameter error
3Input missing or unreadable
4Unsupported format or codec
8Cancelled
70Internal error (bug)

Common mistakes

  • Forgetting that outputs are never overwritten: pass --overwrite or a new -o path when re-running.

For models

  • MCP tool: ferraus_analyze_key
  • Schema: ferraus schema analyze key
  • Pipeline: { op: analyze key, args: { ... } } (flag names with _ instead of -)
  • fx stage: no
{"command": "analyze key", "defaults": {"method": "chroma"}}