answer-human
Play a call-and-response on the shared keys using the human's last take. Requires that they already played.
arrange-human-take
Turn the human's last live take into the shared phrase roll and play it back. Requires notes they already played on this page.
demo-next
Play the next lesson notes as the agent (green keys) so the student can hear them, then they copy on the glowing keys. Requires an active lesson.
design-instrument
Build a whole instrument sound in one call from a description like "metallic digital orchestral stab" or "thunderous staccato strikes". Prefer this over separate set-layer/set-adsr/set-fx calls.
Samples (layer A is…
presetName: string?, layerA: object?, layerB: object?, adsr: object?, fx: object?
export-midi
Download the current phrase as a Standard MIDI File.
focus-control
Open the STUDIO drawer and visually highlight controls: 'fx', 'layers', 'tempo', 'phrase', or 'studio'.
target: string
follow-human
Shadow the human an octave up in real time on the same keyboard. Toggle off to stop. Better only when they keep playing.
on: boolean?
generate-phrase
Generate a musical stab phrase in a style and play it on the shared instrument.
style: string?, bars: integer?
get-duet-state
See what the human is playing on this live page right now: held notes, last take, and whether you can harmonize, answer, or follow. Use this before acting.
get-instrument-state
Return the live KEYBED state: layers, FX, phrase, and who is holding which keys (you vs agent).
get-lesson-state
See the live piano lesson: which keys to play next, computer-key hints, hits, misses, and what the student just played. Call this after they play.
harmonize-held
Add agent notes around the chord the human is holding on the shared keyboard. Does nothing useful if they are not holding keys — this is the together feature.
list-lessons
List the piano curriculum on this live page in ladder order, with each lesson's tier and timing mode. First steps: landmarks, first-keys, rh-c-position, lh-c-position, hands-together, c-chord. Basic: hot-cross-buns…
load-preset
Load the last saved KEYBED preset from localStorage.
lock-layer
Lock or unlock layer A or B so generate/cycle will not replace it.
layer: string, locked: boolean?
make-track
Generate a complete track in one of the 5 styles (piano, rave, house, techno, garage) with matching sound design, BPM, and drum groove.
style: string, bars: integer?
play-notes
Play MIDI notes as the agent on the shared piano. Lights keys green. The human's amber keys stay theirs.
notes: array, velocity: integer?, durationMs: integer?
reset-sound
Put the instrument back to its factory sound: Steinway, clean effects, default envelope. Keeps the running lesson and the master volume.
save-preset
Save the current KEYBED preset to localStorage.
name: string?
set-adsr
Set the shared ADSR envelope. Switches the LCD to Envelope.
attack: number?, decay: number?, sustain: number?, release: number?
set-bpm
Set the tempo from 40 to 200 BPM. This is the single most useful thing you can do for a struggling student: halve the tempo, let them play it right, then put it back. Also drives the metronome and the duet loop.
bpm: number?, scale: number?
set-drums
Start or stop a looping backing beat under the keys. Patterns: backbeat, house, techno, garage. Pass an empty pattern to stop. The keys stay a piano; this is accompaniment, not a drum map.
pattern: string?
set-fx
Set the 5-stage FX chain: filter, distortion, crush, delay, reverb (0-1).
filter: number?, distortion: number?, crush: number?, delay: number?, reverb: number?
set-layer
Set layer A or B sample, volume, transpose, or lock. Samples:
pn-ivory (Steinway): bright acoustic grand piano, hard percussive attack, long ringing decay
pn-felt (Soft Grand): soft felt piano, muted and intimate…
layer: string, sampleId: string?, volume: number?, transpose: integer?, locked: boolean?, cycle: integer?
set-master
Set master volume from 0 to 1.
volume: number
set-mode
Switch what the page is for. 'teach' shows the lesson curriculum, the next-key glow and the hand map. 'dj' hides all of that and opens the STUDIO deck: styles, FX knobs, generated loops, MIDI export.
mode: string
set-next-keys
Light specific next keys for the student to play, in order. Use this to invent a drill. They must press those glowing keys — you cannot play them for the student.
notes: array, title: string?, coach: string?
set-sustain
Hold or release the sustain pedal (MIDI CC 64). Same as a pedal on an APC Key 25, Roland, or Yamaha controller.
down: boolean
set-swing
Set phrase swing from 0 to 0.4.
swing: number
show-next-keys
Show the student the next keys on the shared piano. Target keys glow cyan; on a find-the-note step the black-key group that locates them glows violet. Starts the landmarks lesson if none is running. Does not play the…
start-lesson
Start a piano lesson on this shared keyboard. Lights the next keys the student must play. Basic lessons wait forever; Intermediate ones run a metronome and grade timing; Advanced ones add a falling-note highway.…
lesson: string?
stop-lesson
End the current piano lesson and clear the next-key glow.
teach-phrase
Turn the phrase you last generated into a lesson: light its top line, first two bars, one key at a time. Call this after generate-phrase when the student asks to learn what you made. Stops any backing beat.
title: string?