Working with MIDI Notes in Ableton Live Extensions: Beats and Fields
Published Nov 6, 2026 · guide
Read, transform and write MIDI notes in an Ableton Live Extension: note fields, beat-based timing, safe transforms, and what to confirm in the SDK reference.
A MIDI clip, seen from an Extension, is a list of plain note objects. Each one has a pitch, a start time, a duration, a velocity, a muted flag, a probability and a few more fields. All timing is measured in beats, not seconds or ticks. Once that clicks, most note tools come down to the same loop: get the clip, copy its notes, change some numbers, and write the result back.
This guide covers that loop with the Ableton Extensions SDK. It also flags the details you should confirm in the official SDK documentation before you depend on them.
From a right-click to a note array
Every Extension starts in a context menu. The user right-clicks a MIDI clip, picks your command, and Live runs your code once for that click. Then the extension stops. There is no background process watching the clip, so each command has to do its full job in one pass.
Inside activate() you call initialize(), register a command, and attach it to a scope. For note tools the obvious scope is "MidiClip". The command receives a handle, and context.getObjectFromHandle(handle, MidiClip) turns that handle into a clip object:
commands.registerCommand("my-ext.inspect-notes", (handle) => {
const clip = context.getObjectFromHandle(handle, MidiClip);
const notes = clip.notes; // array of note objects, times in beats
// ...read, transform, write back
});
ui.registerContextMenuAction("MidiClip", "Inspect Notes", "my-ext.inspect-notes");Import paths and the exact way you get hold of context are best copied from a project made with the CLI scaffolder. Don't guess them. If you haven't built a command yet, start with Build Your First Ableton Live Extension: A MIDI Clip Command. If you want your tool to appear on clip slots or tracks instead, see the context-menu scopes guide.
The note fields, one by one
The SDK exposes MidiClip.notes as an array of objects. The fields documented so far:
| Field | What it holds | Things to check |
|---|---|---|
pitch | The note number | Clamp transposed values to the valid MIDI range |
startTime | Where the note begins, in beats | Confirm what beat 0 refers to (clip start vs. something else) |
duration | How long the note lasts, in beats | Avoid zero or negative values after edits |
velocity | Note velocity | Confirm the range and whether non-integer values are kept |
muted | Whether the note is deactivated | Decide whether your transform should skip muted notes |
probability | Chance the note plays | Confirm the scale (fraction vs. percentage) before writing it |
The list in the SDK ends with an ellipsis, so there are more fields than these six. Look up the note type in the TypeDoc API reference for the full shape. You may be looking for something called a note description there. The reference is the place to confirm the type name, the optional fields, and the value ranges.
A practical first step is a read-only command that dumps every note of a clip. Run it on a clip where you know the contents: one C3 on the downbeat, one note an eighth later, one muted note. Compare the output with what you see in Live's clip view. Ten minutes of this answers the range and origin questions better than any assumption.
Transforming notes without leaving beats
Since every time value is in beats, most edits are simple arithmetic. In 4/4 one beat is a quarter note, so a sixteenth grid is 0.25 and an eighth-note triplet is 1/3. Write transforms as pure functions that take an array and return a new one. They are easy to test outside Live, and they don't mutate the data you read.
const clampPitch = (p) => Math.min(127, Math.max(0, p));
const transpose = (notes, semitones) =>
notes.map((n) => ({ ...n, pitch: clampPitch(n.pitch + semitones) }));
const quantize = (notes, grid = 0.25) =>
notes.map((n) => ({ ...n, startTime: Math.round(n.startTime / grid) * grid }));
const legato = (notes) => {
const sorted = [...notes].sort((a, b) => a.startTime - b.startTime);
return sorted.map((n, i) => {
const next = sorted.slice(i + 1).find((m) => m.startTime > n.startTime);
return next ? { ...n, duration: next.startTime - n.startTime } : n;
});
};The spread ({ ...n, ... }) matters. It carries over every field you didn't touch, including the ones hidden behind that ellipsis. If you build fresh objects with only pitch, startTime and duration, you may silently reset probability or other per-note settings when you write back.
Ideas that fit this model
- Velocity shaping: scale, compress or ramp
velocityacross the clip bystartTime. - Thinning: lower
probabilityon off-beat notes instead of deleting them. - Muting by rule: set
mutedon notes above a pitch, which keeps them in the clip for later. - Swing: push every second sixteenth (
startTime % 0.5 === 0.25) a little later.
When you need seconds
Some jobs, like talking to an external service or lining notes up with a timestamp, need real time. The song tempo is available as context.application.song.tempo, and the conversion is straightforward:
const tempo = context.application.song.tempo;
const beatsToSeconds = (beats) => (beats * 60) / tempo;
const secondsToBeats = (sec) => (sec * tempo) / 60;This assumes one fixed tempo. If a Set has tempo changes, a single value won't describe the whole timeline. Do as much as you can in beats and convert only at the edges.
Writing notes back to the clip
Extensions can edit MIDI notes; that is part of what the SDK is for. The verified facts here, though, only describe notes as something you read. Before you write code, open MidiClip in the TypeDoc reference and check these points:
- Is
notesa writable property, or are there dedicated methods to add, remove or replace notes? - Does a write replace the whole note list, or merge with what is there?
- Which fields are required for a new note, and which get defaults?
- What happens to notes placed beyond the clip's current length?
Whatever the API looks like, the safe pattern stays the same. Read once, compute the full new list in memory, validate it (no negative durations, pitches in range, no NaN from a divide), then write once. A single write is easier to reason about than a sequence of edits halfway through a loop.
Test on a duplicate of a clip you care about. Check undo behaviour in your Live build yourself rather than assuming it.
Handling bigger jobs and user input
A transpose on one clip finishes instantly. A tool that walks dozens of clips, or calls a remote API to generate notes, may not. Two helpers in the SDK cover this:
withinProgressDialogshows a progress dialog while longer work runs, so the user knows Live hasn't stalled.showModalDialogopens a modal web view. Use it to ask for a transpose amount, a grid size or a key before you touch any notes.
Extensions run on Node.js with full Node APIs, including file system and networking. Each extension also gets its own storage directory, a natural home for saved presets such as a favourite swing amount or an API key. Ask for settings up front, then do the note work in one pass. That fits the run-once model.
Extensions to study
Several tools on the marketplace already read or write MIDI notes, and two of them publish their source:
- Progressive by Charlie Gleason generates well-known chord progressions in any key as Session clips or an Arrangement row. It works on clip slots and MIDI tracks. It is a clear case of building note arrays from scratch: chords become sets of notes sharing a
startTimeandduration. Source is linked from its page. - the-fnk — Ableton MCP by Thomas Gallaway adds an "Ask Claude…" action to Session clip slots, so Claude can generate or edit MIDI clips from a plain-language instruction. It is MIT-licensed, with source available. It shows the other end of the pipeline: notes going out to a service and coming back as edits. There's a deep dive on it too.
- PS Clip Jockey by Producer Stack lets you tag a master clip, edit it, and push the change to linked clips in the arrangement. It works on MIDI clips, audio clips and Arrangement selections. It's worth trying to see what copying note data between clips feels like for a user.
For more, browse the MIDI tools category and the generative and creative category.
Before you ship
Running any of this requires Live 12 Suite on beta 12.4.5 or later. Standard, Intro and Lite don't support Extensions, and you get the build through the Ableton beta program. The SDK needs Node.js v24 LTS or later on macOS or Windows. The CLI's package command produces the .ablx file users add under Settings → Extensions.
A short checklist for note tools:
- Tested on an empty clip, a single-note clip and a dense clip.
- Unknown note fields preserved via spread, not dropped.
- Pitch, velocity and probability ranges checked against the reference.
- Notes written back once, after validation.
minimumApiVersioninmanifest.jsonset to match what you used (see the manifest.json guide).
When it works, publish it on liveextensions.dev so other producers can download it, rate it and leave feedback.