read_clip_notes
Read MIDI notes from Ableton Live Session clips, filter by time or pitch range, and count notes in large clips without transferring them.
Instructions
Read MIDI notes of a Session clip, query a specific window, or count notes.
Returns:
Dictionary containing notes, count, window parameters, and validation report.
Note:
Times and positions are clip-local beats. Muted notes are included and carry ``mute:
true``.
A single drum clip of 384 notes comes back as 57k characters, past the tool-result
cap, and ``Clip`` has no ``note_count`` in the LOM, so counting from out here
otherwise means transferring every note. ``count_only=True`` carries back one
integer instead. ``pitch_min`` and ``pitch_max`` narrow the read the way time does,
which is what makes a question like "what sits below this guitar's lowest string"
answerable on a clip too large to read whole. ``get_notes_extended`` through
``lom_call`` takes a pitch window too, but answers with opaque note handles that can
be counted and not read. With ``count_only`` there is nothing to validate, so
``check`` is ignored; with a window, ``check`` sees the window and not the clip.
Returned notes are sorted by time, then pitch. Live hands them back ordered by
pitch, which is the one order a musical instruction never means: four notes written
at beats 0, 1, 2, 3 with pitches 72, 60, 67, 62 come back 60, 62, 67, 72, so taking
every other entry off the raw list picks alternating pitches rather than alternating
beats, silently and plausibly. For Live's own order call ``get_notes_extended``
through ``lom_call``.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | LOM path to a Session clip, song.tracks[N].clip_slots[M] with or without a trailing .clip, as an alternative to track and slot. A song.tracks[N].arrangement_clips[i] path is refused with code region_not_addressable. | |
| slot | No | Clip slot index in track.clip_slots, counted from 0, which is the scene the clip sits in. Give track and slot, or give path instead. These are Session coordinates; an Arrangement clip has none. | |
| check | No | True runs validation over the notes that came back and reports what it found. Ignored when count_only is true, since there are no notes to check. | |
| track | No | Session track index in song.tracks, counted from 0. Give track and slot, or give path instead. These are Session coordinates; an Arrangement clip has none. | |
| from_time | No | First beat of the window to read, clip-local, where 0 is the clip start. Omit to read from the beginning. | |
| pitch_max | No | Highest MIDI pitch to return, inclusive. Omit for no upper bound. | |
| pitch_min | No | Lowest MIDI pitch to return, inclusive. Omit for no lower bound. Use it to ask about part of a clip too large to read whole, such as what sits below an instrument's real range. | |
| time_span | No | Length of the window in beats, not the beat it ends on: beats 24 to 32 is from_time=24, time_span=8. Omit to read to the end. | |
| count_only | No | True counts the notes and returns the number without carrying them back, which is the way to ask about a large clip. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||