detect_clip_key
Analyze a MIDI clip in Ableton Live to detect its key and scale using the Krumhansl-Kessler algorithm. Returns the best-fit key, confidence, and margin over the runner-up.
Instructions
Detect the key/scale of one Session MIDI clip (Krumhansl-Kessler). Reads
the clip's notes and returns the best-fit key with a confidence (-1..1),
margin over the runner-up, and the runner-up key. weight is how notes are
weighted into the pitch-class histogram: "duration" (default), "velocity",
"product", or "count". Reads only; changes nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| weight | No | duration | |
| clip_index | Yes | ||
| track_index | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |