BeatScript: AI-assisted algorithmic composition. BeatScript is also the name of its small language for writing whole music tracks as text. This endpoint is the
Model Context Protocol over Streamable HTTP at https://beatscript.app/mcp:
check, format, share and render programs you write, and drive a browser tab at https://beatscript.app.
Programs are CC0. The reading list for a model is https://beatscript.app/llms.txt.
claude mcp add --transport http beatscript https://beatscript.app/mcp --header 'Authorization: Bearer btw_...'
The name is yours to choose; older installs may show btw, the same server. The token keeps its btw_ prefix.
Without the header the read tools still work (check, fmt, share, open, render, list_examples, instruments); eval, load, get, stop, devices and queue need a token. There is no compose tool here: you write the program (read the cheat-sheet, check it, fix every line:col error); composing from a prompt is a feature of the web app. Sign in on https://beatscript.app with a wallet or a browser key and press MCP token. Other clients take the same URL and header:
{ "mcpServers": { "beatscript": { "type": "http", "url": "https://beatscript.app/mcp",
"headers": { "Authorization": "Bearer btw_..." } } } }
#! license: (default CC0-1.0, a Creative Commons licence only), as share does, so the page gets the /p/<CID> link and inline audio. Two ways to sound, chosen by audio: "inline" (the default for a stored program that renders) carries the site's Ogg Opus render of the program in the page as a data: URI in a plain <audio controls>, so the page loads nothing at all (no script, no engine); it is the offline render (notes and sounds, not control lines), at most 6 MB as base64, and a longer render, a text that is not stored, or a render that does not finish falls back to engine with audio_note saying why. "engine" (the default for a text) plays it live with the <beatscript-track> player (@stackdump/beatscript-player@0.3.0, the same engine as the editor, loaded from cdn.jsdelivr.net at that exact version with a Subresource Integrity hash for every module it loads); the host must allow scripts from cdn.jsdelivr.net and WebAssembly ('wasm-unsafe-eval'), as a claude.ai Artifact does. Ogg Opus does not play in older Safari; there is no AAC render. Give exactly one of text (the program; it must pass check; not stored unless store), cid (a program stored here or an example's CID: the page carries the stored rights), example (a name from list_examples) or station. title names the page (default the program's #! name:, else its stored name). station makes a radio page instead: a station (docs/beatscript/radio.md; its program text, the CID of a station stored here, or the name of an example that is a station) played endlessly by <beatscript-radio> (@stackdump/beatscript-player@0.4.0, pinned the same way), from position n (default 0): transport, now playing, section and bar, a level meter, the playlist of the station's next tracks, a CC0 bridge loop when the next track is not ready (never dead air), and a peek drawer with the playing program's text. The station's tracks are computed in the page by the engine (no server, nothing fetched), so the page is the station's text and its CID; sound starts only from Play. Its summary is {title, station: {cid, name, genre, tempo, key, step, forms}, n, player, html_bytes, publish}; audio, store and the other sources do not go with it. Answers two text blocks: the first a JSON summary {title, cid, canonical_bytes, stored, rights, link, short_url, audio, player, render, audio_note, store_hint, html_bytes, publish}, the second the page (a whole HTML document). A program that uses samples or loops, or says use restricted, has nothing to play in a page and is refused. No sign-in, and it stores nothing, unless store; billed as a check (a render not cached yet is limited as render's are, a store as share's). Text at most 16384 bytes.station { } block, docs/beatscript/radio.md), the CID of a station stored here, or the name of an example that is a station. Not with text, cid, example, audio or store.#! license: or CC0-1.0; needs a signed-in caller), as share does, so the page links /p/<CID> and can carry the render inline (default false: the page links the self-sealing link instead).#! name:, else its stored name, else "BeatScript").control: line is the control deck (docs/BEATSCRIPT.md "The control deck"): engine calls only (move, swap pairs, load pair, queue, crossfader, a timed tempo, duck, mix, do), beside deck A:, deck B: and master:, sequenced by sections like a deck; it checks and plays as the same line with no head. An arrange { } switches it pass by pass with a line of its own: ~ control off (a section's control-deck lines do not fire from here on), ~ control on, @ control off (the next section only), ~ control freeze off (the lines of one call), ~3 control off (every 3rd pass); plays[].control_off in the answer's arrange names the calls each play holds back.
Answers {ok, errors, warnings, diagnostics[{severity, line, col, end_col, message, expected, found, help, render}], cid, canonical, version, renamed_cid, expanded_cid, tempo, key, sections, song_bars, seconds, evolve, uses_assets, restricted, docs}, and refs and resolution for a program with references, and arrange {passes, unbounded, plays[{section, name, pass, coda, start_bar, bars, reads, control_off}], patterns, fires} for an arrange { } with mutations. docs is the text's doc comments, [{kind, name, doc}]: the # lines directly above a section, let, def or arrange (a comment, so the CID does not change); sections[].doc is a section's, when it has one. line and col are 1-based; help says what would fix it ("did you mean ..."); render is the same error in caret form. ok:false is an answer, not a tool error. cid and canonical are of the canonical text (comments and spacing do not change the CID). version is the language version: 2 for a text whose header has #! beatscript 2 (write that), 1 for a text with #! btw 1 or no version line (BeatScript 1, the old spelling, which checks as before and keeps its old CID); renamed_cid is the CID of the same program in the other version (fmt upgrades a BeatScript 1 text to it). A program that uses the DJ tier (Selecta, docs/BEATSCRIPT.md "The DJ tier: Selecta": deck A: mute vocals, unmute bass, solo drums, loop 4 beats, loop off, jump -8 beats, cue tune.drop at bar 32) gains needs: ["booth"]: the booth plays it, and a host that is no booth says what it would not play. A station program (radio: a station { } block, see the station tool) checks the tracks of its first pass of forms and its first segue, and the answer gains station {text, cid, genre, generator, seed, step, forms, tempo, key, length, start_cid, version, tracks, segue}.
With same_as (another program's CID or text) the answer gains same_as {same, text_same, basis, why, diffs[{section, deck, start_bar, a_cid, b_cid}], only_in_a, only_in_b, renamed, song, diff}: whether the two are the same song by their compiled nets and song-level settings, not their text. When they are not, diff says what changed in music: diff.summary is one line per change ("tempo 124 -> 126", "moved outro: bar 13 -> bar 5", "drop2 bass = drop bass transposed +1", "drop bass: 1 note changed (1:7 c3 -> d3)"), with song, arrangement (inserted, removed, moved, repeated, renamed, changed) and parts (a transform: transpose, octave, rotate, reverse, thin, fill, fast, slow; else the notes added, removed or changed at bar:step) as JSON. Use it to prove a refactor changed nothing, or to find what an edit did.
This is the loop for writing a program (there is no compose tool): read https://beatscript.app/docs/cheatsheet.md and one or two list_examples programs, call instruments, write the program (its first line #! beatscript 2), call check and fix every line:col error until ok, then eval / load to play it and share to store it. Voices come from the instruments tool: use only names from it. For a sung line, a public-domain phrasebook line (list_examples with phrasebook true) comes with its meter, stress and phoneme escapes, so that sing @id on melody checks with no unknown-word warning (https://beatscript.app/docs/found-phrases.md). A voice name with a leading digit (808-bass) cannot be written: inst=808-bass reads as 808 - bass and a quoted "808-bass" is refused, so pick a voice that starts with a letter (inst=sub-bass for a deep bass). Read-only, no sign-in. Limits: the text is at most 16384 bytes; about 60 calls a minute.
References: a program can call the seeded generator (gen@2 techno seed=42 section=drop part=bass is the program generate prints, fitted to the program's key and tempo unless it says bpm= or key=) or borrow from seed(...), template(...) or a stored program by CID. Its cid is of the text as written (the recipe), and the answer says what the recipe makes: refs lists each reference of the program (a gen@N call, a seed(...), a template(...), a <cid>.section borrowed from a stored program): its kind, half (engine or structure), call, place (part, let, section or arrange), name, line and col, resolved (the CID it is pinned to), generator, fitted (what a gen call took from the program: key, bpm) and track; expanded_cid is the CID of the program with every reference written out as plain BeatScript: cid addresses the recipe, expanded_cid the result; the same recipe always gives the same expanded_cid, and a program with no references has expanded_cid equal to cid; resolution is the manifest: each reference once, with the CID it is pinned to and the generator and version that made it (seeded@2), and for a gen call the key and bpm it was generated in; a template's entry in resolution has parts: each role its reference binds, at any depth (a role of a form bound to a role is a part of that part), as {path, role, kind, call, cid, resolves, generator, parts}: path is where it stands (episodes/ground), kind what it was bound to (gen, stored, theme, notes or template), call the source as bound, cid the CID of what it is written out as (a program of its own: the key and tempo it plays in and the lines its binding wrote, every reference in them written out), resolves the CID its source is pinned to; the same recipe always gives the same parts and part CIDs. With expand true, each entry of refs also carries its expansion (the BeatScript it is written out as where it stands), and each part its text. A diagnostic of severity info at each gen call says the CID it resolved to and the key and tempo it was fitted to; the expand tool writes the whole program out. A use SOURCE as NAME line names a source on a line of its own (a stored program's <cid>.drop or <cid>.drop.bass, a gen call, a canned section template(passacaglia).ground, a form, theme ode_to_joy, phrase @tempest_such_stuff, genre@1 techno.drop; docs/BEATSCRIPT.md "Name a source: use"), and the name is then used as a section, a let or a phrase of the program's own (in a role, as its source): it is a reference of kind use in refs, a note at it says what the name is, and imports lists each use SOURCE as NAME line of the program: its name, what the name is (is: a section, a line, a source for a role or a phrase), from (the source, in canonical spelling), source (its kind: stored, gen, template, form, theme, phrase or genre), resolved (what it is pinned to: a CID, or the library's CID for a theme or a phrase), line and col, and what (a sentence).
Lexicon harvest, a side effect with no flag: when the program checks and may be kept (no samples or loops, no use restricted, public visibility; push_private records nothing), the (word, phonemes) pairs of its lyrics are recorded to grow the CC0 lexicon: each annotated escape word=/phonemes/ (jingle=/j ii ng g uh l/ sings the escape and keeps the word) and each word no lexicon knows, with the rules' pronunciation. Only the word, its phonemes and the program's CID are kept, never the text. The answer's lexicon is {harvested, new}: the pairs taken from this program, and how many no program had given before. When check says a word is not in the lexicon and it sounds wrong, write it as word=/phonemes/.#! genre: line. The answer gains style {genre, label, warnings[{severity: "style", code, message, line?, col?}]}: advice from the genre's conventions in the ontology (a tempo outside its range, a kit or voice the genre and its family do not use, chords far from its progressions). Style warnings never make ok false.#! name:).use restricted, public visibility; push_private records nothing), the (word, phonemes) pairs of its lyrics are recorded to grow the CC0 lexicon: each annotated escape word=/phonemes/ (jingle=/j ii ng g uh l/ sings the escape and keeps the word) and each word no lexicon knows, with the rules' pronunciation. Only the word, its phonemes and the program's CID are kept, never the text. The answer's lexicon is {harvested, new}: the pairs taken from this program, and how many no program had given before. When check says a word is not in the lexicon and it sounds wrong, write it as word=/phonemes/.arrange from seed(techno, 42) is the whole track, section intro from seed(techno, 42)[1..8] its first eight bars as a section, and bass seed(techno, 42).bass[17..24] (or let riff = seed(techno, 42).bass[17..24]) one part's bars as a pattern; seed@2(genre, n) is seeds v2, the same track with its genre's swing written (arrange from seed@2(jazz, 7) says swing 0.6; a bare seed(...) is seeds v1, written straight). template(name, phrase) compiles a phrase, a phrasebook id (@tempest_such_stuff) or any words in quotes, to a whole track, arrange from template(deep-house, @tempest_such_stuff) (templates: deep-house): the phrase is the vocal line, its syllables the line's length, its stress the accents and the beats, its meter the subdivision, and the arrangement is the template's own. A gen@N call (gen@2 techno seed=42 section=drop part=bass: the seeded generator, the program generate prints, pinned by its CID) is written out by where it stands: arrange from gen@2 ... as the whole program (under a # from: gen@2 ... -> <cid> line), a part line or section X from gen@2 ... section=drop as that section's parts, let bed = gen@2 ... section=drop part=bass as a let a bar (bed_1, bed_2, ..., bed = <bed_1 bed_2 ...>). check, eval and share take the references as they are and play the same music (the CID is of the short text); expand gives the long text, with a # from seed(...) or # from template(...) line over each place it wrote, to edit from there. Answers {ok, text, canonical, cid, from_cid, refs, resolution, diagnostics}: cid is the written-out program's, from_cid the one you gave; resolution is check's manifest (each reference once with its pin, and a template's nested parts, each with the CID of what it is written out as); with lineage true the text opens with #! forked-from: <from_cid>. With eject "line:col" it writes out only the reference there, in place, under its # from: <call> -> <cid> line (a comment: the ejected text has the CID of the same notes typed by hand), and answers {ok, text, cid, ejected: {call, kind, half, place, name, resolved, from}}. A use SOURCE as NAME line is written out as the definition its source makes (section NAME from ..., let NAME = ..., a theme's lets in the program's key), and a name in a role or a phrase's place as its source; the answer then also has imports, each name with its source. Read-only, no sign-in.# from: <call> -> <cid> line, the rest left as they are.#! forked-from: <CID of the program as given> (default false), so that once it is shared it says what it came from.#! beatscript 2 first; the other #! header lines, the comments and the blank lines between blocks stay where they are. A BeatScript 1 text (#! btw 1, or no version line) is upgraded: the same program under a new CID, and from_cid is the CID of the text as given (the old CID keeps working). Answers text (the formatted program), canonical (the same with no comments and no header lines but the version line: the CID is of that), cid, version (2), from_cid (only when it upgraded) and comments. A BeatScript 2 text formats to its own CID, so use fmt to tidy a program, to upgrade one, or to compare two; eval, load, queue, share and push_private already format what they are given and never upgrade it. A program that does not parse answers the same diagnostics as check. Read-only, no sign-in.key line moves the whole song) for you to edit. Same genre, bpm, key, length and seed: the same text and CID, every time; the seed and generator are in the #! header so the track can be re-derived. The program passes check and is stored as public CC0 (source generate). Answers text, cid, name, seed, generator, url and render_url; play it with eval or load, or edit it and check again.
The answer also has gen, the call that is this program in BeatScript (gen@2 techno seed=42, with the bpm=, key= and length= you gave: arrange from gen@2 techno seed=42 plays it), expanded_cid (the same as cid: a generated program has no references), and parts, so you can pick parts without reading the text: one entry a role, {role, section, sections, voice or kit, text, let, gen}, where gen is the call that is just that part (gen@2 techno seed=42 section=drop part=bass) and let is what let drop_bass = <gen> writes (a let a bar). Put a part's gen in a let or on a part line of your own program to layer it, mutate it in an arrange or cross it with another seed; there it is fitted to your program's key and tempo unless it says key= and bpm=, and check reports it in refs. With part (a role) the answer gains that part and its let alone; generator picks the version (1, 2, 3 or 4, as gen@1 to gen@4 name them; 3 writes BeatScript 2, 4 is 3 with the acid genre's bass on the 303); seeds (a list, or {count, start}, at most 16) answers a compact summary a seed instead of one program.
Lexicon harvest, a side effect with no flag: when the program checks and may be kept (no samples or loops, no use restricted, public visibility; push_private records nothing), the (word, phonemes) pairs of its lyrics are recorded to grow the CC0 lexicon: each annotated escape word=/phonemes/ (jingle=/j ii ng g uh l/ sings the escape and keeps the word) and each word no lexicon knows, with the rules' pronunciation. Only the word, its phonemes and the program's CID are kept, never the text. The answer's lexicon is {harvested, new}: the pairs taken from this program, and how many no program had given before. When check says a word is not in the lexicon and it sounds wrong, write it as word=/phonemes/.#! beatscript 2 first) or 4 (seeded@4: seeded@3 with the acid genre's bass on the 303, inst=acid-bass); default 4. A version always prints the same program for the same inputs.key line moves them all), and its family's standard song structure, each section with the roles the family's section profile makes active and its usual length. Returns {text, cid, canonical, seconds, genre{genre, label, family, tempo, tempo_range, scale, kit, voices, progressions, sections}} (and phrase, warnings with a phrase). The text passes check (it is checked before it is returned) and carries a #! genre: line, so check reports its style against the genre. Edit it, check it, then play or share it. For vocals, pass phrase (a phrasebook id from list_examples with phrasebook true, or any words): it is sung on the melody part of each section that has one, and the answer gains phrase with its source, year, meter, stress, syllables and phoneme escapes and whether its meter fits the genre (https://beatscript.app/docs/found-phrases.md). For a classical form, pass form (quodlibet, passacaglia, canon, rondo, fugue or theme-and-variations): the program is that form's template at the genre's tempo, built from public-domain themes, with the phrase (or the form's own) sung in it, and the answer gains form (its sections, mutation plan, themes and reference track) and expanded (the program written out to edit). To borrow one theme instead, pass theme (an id from list_examples with themes true): its lets go in, moved to the genre's key, played by the part of its role. See https://beatscript.app/docs/forms.md. For a whole track made from a phrase, write arrange from template(deep-house, "your words") (see expand). The plain answer also has use: each section of the genre's frozen template as a line, use genre@1 techno.drop as drop, that borrows it by name into a program of your own. Read-only, no sign-in. The answer also has expanded_cid (the CID of the program written out: the same as cid for a program with no references) and, for a program with references (a form's template(...)), refs and resolution, as check gives them: with roles bound, the template's entry in resolution has parts, each role (at any depth: a form in a role has its own) with the CID of what it is written out as. A form takes its sources as roles (docs/beatscript/ext-roles.md): with form and roles, each role is bound to a source (a seed of the seeded generator, a public-domain theme, notes, a stored program's part or section, another form), and the forms include cross (a quodlibet of two sources, roles a and b): two seeds that lead in turn, overlap, and morph toward each other and back.
Lexicon harvest, a side effect with no flag: when the program checks and may be kept (no samples or loops, no use restricted, public visibility; push_private records nothing), the (word, phonemes) pairs of its lyrics are recorded to grow the CC0 lexicon: each annotated escape word=/phonemes/ (jingle=/j ii ng g uh l/ sings the escape and keeps the word) and each word no lexicon knows, with the rules' pronunciation. Only the word, its phonemes and the program's CID are kept, never the text. The answer's lexicon is {harvested, new}: the pairs taken from this program, and how many no program had given before. When check says a word is not in the lexicon and it sounds wrong, write it as word=/phonemes/.# from: lines their saves kept as meta.based_on), derivations (from, to, sameSong, change, and a compare URL, https://beatscript.app/p/<A>/compare/<B>). Only public programs appear: a private one is never listed, and a chain that passes through one stops there (ancestorsCut). A person can browse the same tree at https://beatscript.app/p/<CID>/tree.use SOURCE as NAME line can name: the kinds of source, each template's sections (use template(passacaglia).ground as ground) and each genre template's (use genre@1 techno.drop as drop), see https://beatscript.app/docs/BEATSCRIPT.md "Name a source: use". Read-only, no sign-in.use SOURCE as NAME line can name (default false): the kinds of source, each with how it is written and what the name is; the templates and their sections (canned sections: use template(passacaglia).ground as ground); the genre templates and their sections (use genre@1 techno.drop as drop); themes and phrasebook lines are listed by themes and phrasebook.silent lists every deck or part that has notes in the window but is not heard (under -60 LUFS), with reason when the mixer explains it (master_zero, mute, level_0, crossfader, filter_closed, eq_killed; voice_missing when the mixer lets a part through and its voice made nothing; no_sound otherwise) and why in words. detected gives the tempo and key heard against the declared ones (bpm_match same|half|double|two_thirds|three_halves|differs; key_match same|relative|differs|unsure|undeclared). sections gives each section's loudness (and control_off on a section an arrange { } switch such as ~ control off plays with lines of its control deck held back: the calls that do not fire there), bar_lufs a loudness per bar, and master.clipped_samples counts samples over full scale. warnings is the short list to act on. A part that came from a reference (a gen@2 call, a seed(...), a template, a stored program's section) says so in from {call, kind, resolved, place, generator, sections} (also_from when several made it; a use line's also has its name); a gen call fitted to the program's key or tempo says so in notes, in check's words; and the answer gains expanded_cid and resolution, as check's (and imports, the names its use lines give). Give exactly one of text, cid, example; optionally section (listen to that section only) and bars (at most this many bars of the window). Nothing is stored and no sign-in is needed. At most 30 new listens an hour per caller; the same program, section and bars again is answered from the cache. Programs are at most 16384 bytes; the render covers at most 96 bars from the start. Like render, the offline engine plays the program as the browser's engine does (its control lines too: the mixer, inserts and their ramps, the vocoder, the Wheel, moves, kit= and sound=) and the macro lines (the DJ macro catalogue: see the macros tool); notes names any control line it leaves out. A program with a macro line gains macros: each call in the window, at_bar (the bar the engine starts it on, as the time words count), and played, with refused (the engine's reason, also a warning) when it was not. The mix, to polish it by ear: each measured part and the master have bands (dB in sub 20-60 Hz, low 60-250, low_mid 250-500, mid 500-2k, high_mid 2k-6k, high 6k up, on rms_db's scale), centroid_hz, width (0 mono, 0.5 wide, 1 out of phase), correlation and crest_db; the master also true_peak_db (dBTP, 4x oversampled), plr_db, short_term_max_lufs and lra; each section its bands and true_peak_db. clashes lists parts that carry the same band in the same bars at levels that mask each other ({parts, band, hz, bars, overlap, gap_db, sections}, the louder part first). targets (default streaming: -14 LUFS, -1 dBTP; also apple, broadcast, club, or LUFS/dBTP such as -12/-1) gives the master's lufs_delta and true_peak_delta and met. warnings come in the order to fix them (not heard, clipping, clashes, balance, loudness, width), each saying the BeatScript line that fixes it, and warning_ids gives each a stable id. With compare (the previous version: a CID or its text) the answer gains compare: deltas (now minus before) of the master, each part and each section, the targets before and after, and the warnings fixed, introduced and kept, with a one-line summary. On a long program listen a section at a time: a part past the budget of part renders is not measured (notes says so) and has no bands. The loop (check, listen, edit, listen with compare) and which lines fix what: https://beatscript.app/docs/polish.md.
Lexicon harvest, a side effect with no flag: when the program checks and may be kept (no samples or loops, no use restricted, public visibility; push_private records nothing), the (word, phonemes) pairs of its lyrics are recorded to grow the CC0 lexicon: each annotated escape word=/phonemes/ (jingle=/j ii ng g uh l/ sings the escape and keeps the word) and each word no lexicon knows, with the rules' pronunciation. Only the word, its phonemes and the program's CID are kept, never the text. The answer's lexicon is {harvested, new}: the pairs taken from this program, and how many no program had given before. When check says a word is not in the lexicon and it sounds wrong, write it as word=/phonemes/.compare (what changed, and the warnings fixed and introduced); the same section, bars and targets are used for both.use restricted, public visibility; push_private records nothing), the (word, phonemes) pairs of its lyrics are recorded to grow the CC0 lexicon: each annotated escape word=/phonemes/ (jingle=/j ii ng g uh l/ sings the escape and keeps the word) and each word no lexicon knows, with the rules' pronunciation. Only the word, its phonemes and the program's CID are kept, never the text. The answer's lexicon is {harvested, new}: the pairs taken from this program, and how many no program had given before. When check says a word is not in the lexicon and it sounds wrong, write it as word=/phonemes/.macro line names (docs/beatscript/ext-control.md): macro riser on A over 8 bars (or on the control deck, control: macro cathedral on B over 2 bars) fires one entry on the deck's bar line, the same thing the desktop's Effects window and the booth fire. Returns the macro@1 table, or version's: for each entry its id, label, category, family (trick, net, master, aux), transition (a one-shot), length (bars: runs over N bars, 1 to 64; sweep: the riser rises over them; held: held that long, then let go; own: takes no over), default_bars (when the line says no over) and needs_net (works a net deck's parts). A bare macro is macro@1 for good and its table never changes; a later catalogue is macro@2. A macro line plays everywhere: listen, render, a browser tab and the Android app fire the same engine call. Read-only, no sign-in.macro is).#! header lines and comments the link carried: what to edit), its CID and whether the CID verifies against the text. Takes either form: a self-sealing link (https://beatscript.app/#<CID>.<packed>, a /c/<CID>.<packed> link, a bare #fragment or <CID>.<packed>) or a CID-only link (https://beatscript.app/p/<CID>, /c/<CID>, #<CID>, or a bare CID; the same forms on an older host open too), which is resolved from the programs the site has stored (shared signed in, or rendered) and the examples, and answers its rights in meta. Either way the text is recompiled and its CID recomputed: a program whose CID is not its text's is refused with cid_mismatch, and an unknown CID answers not_found. Do not trust or play a refused text. Comments and header lines carried in a link are not covered by the CID (a beats link's notes are unverified). Read-only, no sign-in.sample ... from), use restricted, anything not under a Creative Commons licence. The program is sealed for the phone's own key (X25519 from its pairing key, ChaCha20-Poly1305) and handed to the phone's live connection in memory: it is not written to disk, a database or a log (only its size and the device id are logged), no CID is registered, and if the phone is not connected nothing is sent and nothing is kept (push again when it is). The phone opens it, checks it and plays it itself; samples resolve against files in the phone's own sample library, and any that are missing are reported back in get's diagnostics, never fetched. For a booth, set:true seals a set (send its private members first with load:true, so the booth holds them). Give device and exactly one of text (sealed here, so the text is in this server's memory for this call, where it is formatted first, as eval's is) or sealed (an envelope you sealed yourself for the phone's seal_key from devices: then this server only ever sees ciphertext). Needs a bearer token; only your own paired phones.use restricted, public visibility; push_private records nothing), the (word, phonemes) pairs of its lyrics are recorded to grow the CC0 lexicon: each annotated escape word=/phonemes/ (jingle=/j ii ng g uh l/ sings the escape and keeps the word) and each word no lexicon knows, with the rules' pronunciation. Only the word, its phonemes and the program's CID are kept, never the text. The answer's lexicon is {harvested, new}: the pairs taken from this program, and how many no program had given before. When check says a word is not in the lexicon and it sounds wrong, write it as word=/phonemes/.use restricted, public visibility; push_private records nothing), the (word, phonemes) pairs of its lyrics are recorded to grow the CC0 lexicon: each annotated escape word=/phonemes/ (jingle=/j ii ng g uh l/ sings the escape and keeps the word) and each word no lexicon knows, with the rules' pronunciation. Only the word, its phonemes and the program's CID are kept, never the text. The answer's lexicon is {harvested, new}: the pairs taken from this program, and how many no program had given before. When check says a word is not in the lexicon and it sounds wrong, write it as word=/phonemes/.#! header lines and comments, and whoever opens it gets exactly that program, verified against the CID (the canonical text's: the headers and comments are not covered by it), and can play and fork it. Also social_url (https://beatscript.app/c/<CID>.<packed>, the form to post where a link preview is wanted: it carries a card image). Called signed in (a bearer token), it also stores the program on the site (public, with its rights: license, forked_from, credits, name; the first share's rights stay) and returns the CID-only forms: short_url (https://beatscript.app/p/<CID>) and short_social_url (https://beatscript.app/c/<CID>), plus fetch_url, a public GET that returns the canonical text and rights for a phone or an app. A program with references (a template(...), a gen@N call, a seed(...), a borrowed <cid>.section) has expanded_cid, the CID of the same track with every reference written out as plain BeatScript; a signed-in share stores that expansion beside it, as a program of its own that plays the same (or finds it already stored: first write wins, so it keeps the rights its first sharer gave), and returns expanded_url (https://beatscript.app/p/<expanded_cid>) and expansion_license. An expansion that would copy another's program under other rights (only CC0 programs, or the sharer's own under the same licence, are copied), or is over the size limit, is not stored, and expansion_note says why. Opening a short link fetches the text, recompiles it, recomputes the CID and refuses a mismatch. A short link to a BeatScript 1 program (https://beatscript.app/p/<old CID>) redirects to its BeatScript 2 upgrade (the CID check's renamed_cid gives, the program fmt writes) once the site stores it; the old CID's text stays at fetch_url. Anonymous calls get the self-sealing links and short_url null. The program must pass check and must not use samples or "use restricted" (a private program is never shared or stored); programs shared here are CC0 unless license says otherwise. The text is formatted on the way in, its version kept (the stored program is its canonical text, whose CID the header lines and comments do not change, and the link carries the formatted text; a #! name: line names the stored program). Its # from: <call> -> <cid> lines (what an eject wrote out: comments, so not in the CID) are kept with it as meta.based_on ["<call> -> <cid>"]: its linked data lists each in isBasedOn as vendored, and lineage counts it (vendoredFrom); open with the CID answers them in meta. Links over about 2000 characters (chars says) may be cut by some apps; short links are not. A stored program also embeds in other sites: embed_url (https://beatscript.app/embed/<CID>) is a player any page may frame, https://beatscript.app/embed.js gives <beatscript-player cid="<CID>">, and https://beatscript.app/oembed?url=<a /p/ or /c/ link> answers oEmbed; see https://beatscript.app/docs/embed. Who authored a program and what rights it has, in plain language: https://beatscript.app/authorship.
Lexicon harvest, a side effect with no flag: when the program checks and may be kept (no samples or loops, no use restricted, public visibility; push_private records nothing), the (word, phonemes) pairs of its lyrics are recorded to grow the CC0 lexicon: each annotated escape word=/phonemes/ (jingle=/j ii ng g uh l/ sings the escape and keeps the word) and each word no lexicon knows, with the rules' pronunciation. Only the word, its phonemes and the program's CID are kept, never the text. The answer's lexicon is {harvested, new}: the pairs taken from this program, and how many no program had given before. When check says a word is not in the lexicon and it sounds wrong, write it as word=/phonemes/.#! name: line).tempo, its key and one block:
tempo 128
key am
station {
from gen@2 techno seed=42
next seed=~
forms seeded passacaglia rondo fugue
}
from is the first track's call of the seeded generator (gen@V GENRE seed=N, optionally length=short|standard|long; the station's tempo and key are its own lines, never the call's bpm= or key=). next is the walk from one track's seed to the next: seed=+N counts on (each track's seed is the one before's plus N), seed=~ draws each seed from the CID of the track before (worked out step by step, so a position past the walk's cap is refused; a seed=+N station has a track at any position); default seed=+1. forms is the forms rotation within the genre: track N plays forms[N mod R] of the R forms (seeded, the generator's own arrangement, or passacaglia, canon, rondo, fugue, theme-and-variations, cross), each form's first role bound to the chapter's theme seed (the first track of each pass of the rotation, so it recurs) and its second role to track N's own seed; default forms seeded. The segue from track N to N+1 is the cross form of their two seeds: a program of its own, with its own CID.
Answers {ok, version, station {text, cid, genre, generator, seed, step, forms, tempo, key, length, start_cid}, n, tracks[{n, seed, theme, form, phrase, text, cid, parent, station, check}], segues[{from, to, form, phrase, text, cid, check}], neighbours, retuned, locks, diagnostics}; ok:false with error and diagnostics is an answer, not a tool error. Each track's text is a program to check, listen to, eval, render or share; its parent is track N-1's CID. A listener does not steer a station: they turn its knobs (genre, seed, step, forms, tempo, key, length), and turning one moves them to a neighbouring station that already exists. retune sets knobs before anything else, each to a value or to "+1" / "-1" for one notch (seed by 1, tempo by 2, key a fifth round the circle in its own mode, step between +1 and ~, forms rotated by one, length one step; a genre only by name), and retune keeps N: the answer is track N of the retuned station. locks are knobs held fixed: retuning a locked knob is refused, and neighbours (true) lists the stations one notch away along each unlocked knob, each with its text, its CID and its track at n. check (true) checks each track and segue: {ok, expanded_cid, bars, seconds, errors}; each program checked counts as one call of the checker. check of a station program answers station too. Read-only, no sign-in. Stations, the walk and the knobs: https://beatscript.app/docs/radio.md.