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:

FieldWhat it holdsThings to check
pitchThe note numberClamp transposed values to the valid MIDI range
startTimeWhere the note begins, in beatsConfirm what beat 0 refers to (clip start vs. something else)
durationHow long the note lasts, in beatsAvoid zero or negative values after edits
velocityNote velocityConfirm the range and whether non-integer values are kept
mutedWhether the note is deactivatedDecide whether your transform should skip muted notes
probabilityChance the note playsConfirm 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

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:

  1. Is notes a writable property, or are there dedicated methods to add, remove or replace notes?
  2. Does a write replace the whole note list, or merge with what is there?
  3. Which fields are required for a new note, and which get defaults?
  4. 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:

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:

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:

When it works, publish it on liveextensions.dev so other producers can download it, rate it and leave feedback.

Browse all extensions → · Submit yours →