Live Played
live_playedReads the notes a player performed on their MIDI keyboard so you can quote a phrase or record the take into a song track, optionally snapping it to a grid.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bar | No | ||
| fit | No | ||
| bars | No | ||
| into | No | ||
| mode | No | replace | |
| source | No | ||
| project | Yes | ||
| from_bar | No | ||
| placement | No | A |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |