--- name: perform description: Perform procedural music and Hydra visuals locally, preserve Git-backed takes, and export audio with Kestrilo. --- Use Kestrilo on the computer where the user will listen. Call `probe_machine` for device setup. Use the exact listed name as `outputDevice` if the listener chooses a specific device. Offer offline rehearsal if no output is usable. Use `model_catalog` to show the verified model size. If the user chooses local AI and requests the download, call `prepare_model` with `download: true` and follow the returned job. Manual scores work on their own. Use `list_albums`, `create_album`, `create_song`, and `inspect_song` to find or prepare the local Git destination. Use `open_library` for the local album and take comparison view and `read_take_source` for the exact source of an existing take. Call `review_score` on drafts to inspect section density, estimated harmony, tempo changes, instrument ranges and opening motifs. Request `previewAudio` or a `previewTick` if a short native level and voice check would help. Use the review to develop form and musical transitions. Start a performance with a complete score and its intended label. For a headless rehearsal set `offline: true`. For local improvisation choose an existing track and pass musical intent. Set `designInstrument: true` when the user wants a locally generated graph. A score uses quarter-note positions or integer ticks suffixed with `t`, with 960 ticks per quarter. A track repeats its declared pattern in the interval from start inclusive to stop exclusive. All tempo changes precede the end. A minimal score is shown below. ```text kestrilo-score 1 meter 4 4 tempo 0 120 end 16 tail-ms 850 instrument low bass track bass low 0 16 4 note bass 0 0.5 38 105 note bass 1 0.5 45 95 note bass 2 0.5 41 102 note bass 3 0.5 43 98 ``` After `start_performance`, poll its session with `get_performance_status`. Give the user its stage link on their local computer. To direct an edit, use `propose_change` with the exact active digest, a future authored tick outside the frozen window and the complete revised source. Keep prior tempo and total duration compatible. Report a change as performed after the status shows its application. Preserve requested parts and use musical motifs and phrasing across planned sections. For a shared audiovisual set, pass the initial Hydra dialect source as `visualSource`. Use `get_audience_drafts` to read both revisions. As you write, send meaningful successive `patch_audience_draft` calls so the audience sees the source develop. Use the returned `baseRevision` and zero-based UTF-16 offsets. When writing alongside the operator, re-read and reconcile the draft after a conflict. Use `submit_audience_change` with `musicRevision`, `visualRevision`, or both, at a future `atTick` or with `atWrap: true` in a loop. Report an edit as performed only after its draft shows Playing. For a simple patch, use `osc(10 + rms * 8).blend(src(o0), 0.3).out(o0);`. Review the supported operations in `docs/AUDIOVISUAL.md`. Archive a finished audience take with `archive_audience_take`. For streaming, direct the user to the authenticated Stage controls. Keep the stream key in the local environment. When the user chooses to record directly into an album, set `albumId`, `songId`, `takeId`, and the observed `expectedHead` on `start_performance`. For a detached recording, archive it after natural completion with `archive_performance`. Use `replay_take` for playback and `render_take` for export. A capture gap or an unexpected interruption should be identified from the returned status.