Live Played
live_playedReads back the notes someone played on their MIDI keyboard and records the take into a song track, with optional grid fitting for loop-ready takes.
Instructions
What the person played on their keys, as notes text: 'bar | +beat | pitch | d= | v=' lines in this engine's
bars, the same notes format tracks take (note-offs held while the sustain pedal was down). bars: the last
bars bars that had keys, or [a, b] for those bars (ask the player which part; never guess). Per input
(source: one input). Read it to answer what they played or to quote a phrase back.
Clock: each note is where it sounded against the beat the player heard (the press plus the keys' delay to the
speakers, which the header names in ms), because a player by ear lines up what they hear with the kick.
To loop a take back, use fit=True rather than rounding the lines to the grid: it groups the hits (keys within
0.15 beat are one), fits a 16th grid with a free offset, says the offset, the rms error in ms, the drift per
bar and the rhythm's shape in 16ths (3-3-2), and prints the snapped notes twice as live_queue notes (beats from
the clip start, bar 1 = the take's first bar, or from_bar): A as played, B with the first hit on a downbeat.
Where the take sits against the kick is a musical choice the data cannot make: play both and let the player
pick by ear. When every key has the same velocity (a keyboard that sends one), the reply says so and suggests
an accent shape; the lines keep the velocity.
Recording into the song: into='' writes the take into that track of the project in this folder (an
existing track: track_add first, with the sound to keep), one input at a time. Reach for it when the person
wants to record what they played on their MIDI keyboard into a track of the song (keep a take), instead of
copying the lines into notes_write. bar: where the take's first bar lands (from_bar picks which of the engine's
bars is that first bar; default the first bar with a note). mode='replace' clears the bars the take covers on
the track first, 'add' merges. Without fit it writes the take as it sounded: off the grid where it was played,
each note's velocity and length, the pedal's holds. With fit=True it writes the snapped notes, placement='A'
(as played, the default) or 'B' (the groups from beat 1) as the reply named them; ask the player first. The
reply says what was written, how to hear it, and undo() takes it back.
The played expression goes in too: the take's pitch bend, pressure and controllers (the key log keeps them,
whether or not the sound took them live) become the track's lanes (automation inst.lane.) over the take,
by live_midi's map: bend <- pitch bend (+-2, or +-48 per note with MPE), vib <- cc:1 (0..50 cents), level <-
pressure (0..+6 dB), or the patch's own lanes= while the input is patched. lanes: the map as data, as live_midi
and midi_write take it ({lane: {'midi': 'bend' | 'pressure' | 'cc:', 'range': [lo, hi]}}, any lane the
song's voice has, e.g. {'breath': {'midi': 'cc:2', 'range': [0, 1]}}; {lane: None} leaves one out), or
lanes=False for notes only. mpe: read each note's own channel, True or 'lower', 'upper' or False (default: as
the input is patched, else the MPE configuration the log holds). Poly pressure
goes onto the channel's pressure by the newest key held (a key that sends none is at 0), since a song's lanes
are per track. The lanes run to the take's last bar line, so a wheel let go after the last note springs back,
and a bend or pressure still off rest there goes back to rest on that line. They replace the track's points
over the take's bars, and on to the last point when a note is held past them; the song's own point on the bar
line after stays (mode='add' merges only notes). With fit they move with the notes.
MIDI effects: keys played through live_midi_fx come as the notes its chain made of them, as they sounded (its
random choices as rolled live, its note lengths), so a take written into a song plays what was heard and does
not roll the dice again. With live_arp on too, they are the notes the arp held, not its steps. raw=True gives the
keys pressed instead (for a track whose own track_midi_fx makes the notes); the reply says which it gave. Reach
for it when the person wants to keep a take of what the effects made live, its random rolls included.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project": "<project>"
},
"name": "live_played"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bar | No | ||
| fit | No | ||
| mpe | No | ||
| raw | No | ||
| bars | No | ||
| into | No | ||
| mode | No | replace | |
| lanes | No | ||
| source | No | ||
| project | Yes | ||
| from_bar | No | ||
| placement | No | A |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |