Art and animation, written as code. Illustrations, loops, interactive web art, launch-videos and scored films in dozens of styles, identical on every render.
TypeScript agent-skillsanimationcanvasclaude-codeclaude-pluginclaude-skillscodex-plugincreative-codecreative-codingcreative-toolsdeterministicgenerative-arthand-drawnillustrationlaunch-videomotion-designmotion-graphicspluginprocedural-generationskill
references/music: compose.md (brief to original score, never-reuse rule), generated vocabularies.md, lofi-electronic as a vocabulary, music-box ranges not fixed notes, README (no default style, demos are not scores, 21 styles/moods, new voices); music.mjs vocab --md
Alex Greenshpunc4cd674094b6
diff --git a/skills/anidoodle/engine/tools/music.mjs b/skills/anidoodle/engine/tools/music.mjsindex b52951f..c610f70 100644--- a/skills/anidoodle/engine/tools/music.mjs+++ b/skills/anidoodle/engine/tools/music.mjs@@ -115,7 +115,7 @@ const main = async () => {const M = await load();const flag = (k) => args.includes(k), val = (k, d) => { const i = args.indexOf(k); return i >= 0 ? Number(args[i + 1]) : d; };if (cmd === "list") { console.log("demos (listening references and the novelty corpus, never a film's score):\n " + Object.keys(M.DEMOS).join("\n ") + "\nfixtures (tests):\n " + Object.keys(M.FIXTURES).join("\n ")); return; }- if (cmd === "vocab") { printVocab(M, args[0]); return; }+ if (cmd === "vocab") { if (args[0] === "--md") vocabMarkdown(M); else printVocab(M, args[0]); return; }if (cmd === "calibrate") { calibrate(M); return; }if (cmd === "novelty") {const pc = await getPiece(M, args[0]), fam = Object.values(M.DEMO_FAMILIES).find((f) => f.includes(args[0])) ?? [args[0]];@@ -218,7 +218,8 @@ const printVocab = (M, id) => {console.log("\nsection kinds:"); for (const [k, d] of Object.entries(M.KINDS)) console.log(` ${k.padEnd(10)} ${d.what}`); return; }const v = M.VOCAB[id]; if (!v) throw new Error(`no style "${id}" (have: ${Object.keys(M.VOCAB).join(", ")})`);console.log(`${v.name} (${v.id}): ${v.atmosphere}\ntempo ${v.tempo.join("-")} bpm, meters ${v.meters.join(" ")}, swing ${v.swing.join("-")}, moods ${v.moods.join(", ")}`);- console.log("palette (slot: instrument, gain dB, stem target):"); for (const [slot, x] of Object.entries(v.palette)) console.log(` ${slot.padEnd(8)} ${x.inst.padEnd(10)} ${String(x.gainDb).padStart(5)} ${v.stemTargets[slot] ?? "-"} dB${Object.keys(v.alternates[slot] ?? {}).length ? ` alternates: ${Object.keys(v.alternates[slot]).join(", ")}` : ""}`);+ const eff = (slot, x) => +(x.gainDb + (M.VOCAB_TRIM[v.id]?.[slot] ?? 0)).toFixed(1), tgt = (slot) => (v.stemTargets[slot] === undefined ? "-" : +(v.stemTargets[slot] + (M.VOCAB_TARGET_FIX[v.id]?.[slot] ?? 0)).toFixed(1));+ console.log("palette (slot: instrument, gain dB, stem target dB):"); for (const [slot, x] of Object.entries(v.palette)) console.log(` ${slot.padEnd(8)} ${x.inst.padEnd(10)} ${String(eff(slot, x)).padStart(5)} ${tgt(slot)} dB${Object.keys(v.alternates[slot] ?? {}).length ? ` alternates: ${Object.keys(v.alternates[slot]).join(", ")}` : ""}`);console.log(`stem targets ${v.calibrated ? "calibrated on a listened score" : "are starting numbers (uncalibrated: flags are advisory until a human listens)"}`);console.log(`grooves: ${v.grooves.map((g) => `${g} (${M.GROOVE_FAMILIES[g]})`).join("\n ") || "none"}`);for (const [k, x] of Object.entries(v.harmony)) console.log(`harmony.${k}: ${Array.isArray(x) ? x.join(", ") : x}`);@@ -227,6 +228,27 @@ const printVocab = (M, id) => {console.log(`avoid: ${v.avoid}`);};+/** references/music/styles/vocabularies.md, generated from the data so the page never drifts from the code. */+const vocabMarkdown = (M) => {+ const o = ["# Style vocabularies", "", "> GENERATED by `node tools/music.mjs vocab --md` from `engine/src/canvas-core/music/vocab.ts` and `vocabMore.ts`. Do not edit by hand.", "> A style is a vocabulary: sound, grooves, harmony language, melody rules, arrangement grammar. It never", "> contains notes. You compose the notes ([../compose.md](../compose.md)).", "",+ "| Style | Atmosphere | Tempo, meters | Moods | Grooves |", "|---|---|---|---|---|"];+ for (const v of Object.values(M.VOCAB)) o.push(`| \`${v.id}\` | ${v.atmosphere} | ${v.tempo.join("-")} bpm; ${v.meters.join(", ")} | ${v.moods.join(", ")} | ${v.grooves.join(", ") || "none (no drums)"} |`);+ o.push("", "## Groove families", "", "Pick a family and its knobs (`density`, `variation`, `fill`, `accent`); the seed varies every bar. Or write the drum bars yourself.", "");+ for (const [k, d] of Object.entries(M.GROOVE_FAMILIES)) o.push(`- \`${k}\`: ${d}`);+ o.push("", "## Section kinds (the arrangement grammar)", "", "A kind decides which layers may sound; your lines sound only where you write them.", "");+ for (const [k, d] of Object.entries(M.KINDS)) o.push(`- \`${k}\` (drums: ${d.drums ?? "none"}, bass: ${d.bass ? "yes" : "no"}): ${d.what}`);+ for (const v of Object.values(M.VOCAB)) {+ o.push("", `## \`${v.id}\`: ${v.name}`, "", `${v.atmosphere}. Tempo ${v.tempo.join("-")} bpm, meters ${v.meters.join(", ")}, swing ${v.swing.join("-")}.`, "", "| Slot | Voice | Gain dB | Stem target dB | Alternates |", "|---|---|---|---|---|");+ for (const [slot, x] of Object.entries(v.palette)) o.push(`| ${slot} | \`${x.inst}\` | ${+(x.gainDb + (M.VOCAB_TRIM[v.id]?.[slot] ?? 0)).toFixed(1)} | ${v.stemTargets[slot] === undefined ? "-" : +(v.stemTargets[slot] + (M.VOCAB_TARGET_FIX[v.id]?.[slot] ?? 0)).toFixed(1)} | ${Object.keys(v.alternates[slot] ?? {}).join(", ") || "-"} |`);+ o.push("", `Stem targets: ${v.calibrated ? "calibrated on a listened score." : "starting numbers from a neutral test signal (advisory until a human listens)."}`, "");+ o.push(`- **Harmony language.** Modes: ${v.harmony.modes.join(", ")}. Qualities: ${v.harmony.qualities}. Tendencies: ${v.harmony.tendencies}. Harmonic rhythm: ${v.harmony.rhythm}. Voicing: ${v.harmony.voicing}. Tension and release: ${v.harmony.tension}.`);+ o.push(`- **Melody.** Range ${v.melody.range}. Contour: ${v.melody.contour}. Density: ${v.melody.density}. Motif: ${v.melody.motif}.`);+ o.push(`- **Arrangement.** ${v.arrangement.shape}. Transitions: ${v.arrangement.transitions}. Endings: ${v.arrangement.endings}.`);+ o.push(`- **Grooves:** ${v.grooves.join(", ") || "none"}. **Avoid:** ${v.avoid}.`);+ }+ console.log(o.join("\n"));+};+/** Stem balance: each part's unmastered stem RMS (active samples) vs piece.stemTargets. Measured at 24 kHz, as the targets were. */const STEM_SR = 24000;const printStems = (M, piece, tempo, seconds) => {diff --git a/skills/anidoodle/references/music/README.md b/skills/anidoodle/references/music/README.mdindex 42e5027..73b2f58 100644--- a/skills/anidoodle/references/music/README.md+++ b/skills/anidoodle/references/music/README.md@@ -5,14 +5,25 @@ and synthesizes them in code. No samples, no recordings, no licensed audio, everwhat you make, so every choice is a number, every number is measured, and a human hears 8 secondsbefore anything ships.-Code: `engine/src/canvas-core/music/`. Tool: `engine/tools/music.mjs`. The old music-box recipe-lives on, verbatim, as the default style preset: [`styles/music-box.md`](styles/music-box.md).--Style pages:-- [`styles/music-box.md`](styles/music-box.md): the default. Plucked, no sustain, no reverb tail.-- [`styles/lofi-electronic.md`](styles/lofi-electronic.md): chill, upbeat, clean lo-fi electronic,- the launch film's sound. It covers the `lofiElectronic` builder, sections, landing on the home- chord, film fit, seamless loops and the stem balance meter.+Code: `engine/src/canvas-core/music/`. Tool: `engine/tools/music.mjs`.++**Start here: [`compose.md`](compose.md).** It takes you from a brief to an original score. A style+is a vocabulary: sound, grooves, harmony language, melody rules, arrangement grammar. It is never+notes. You compose every note, and nothing is filled in for you. There is no default style.++Pages:+- [`compose.md`](compose.md): the workflow, the material format, craft, and the never-reuse rule.+- [`styles/vocabularies.md`](styles/vocabularies.md): all 21 style vocabularies, the 15 groove+ families and the section kinds. It is generated from the code.+- [`styles/lofi-electronic.md`](styles/lofi-electronic.md): the lo-fi electronic vocabulary in+ depth, and the stem balance meter.+- [`styles/music-box.md`](styles/music-box.md): the original music-box recipe's sound numbers and+ the scar story behind the guards.++**Demos are not scores.** The pieces in `pieces/` (samplers, families, nocturne, our launch scores)+were written to prove the synth and the meters, and one of them is our own film's score. They are+listening references and the novelty corpus (`node tools/music.mjs list`). A film never plays them:+`node tools/music.mjs novelty` fails a score that sounds like them or quotes them.## The pipeline@@ -25,16 +36,16 @@ MusicPlan + notes (you write) -> perform -> instruments (one stem per part)harmony list.- The plan names:- one **style**;- - a tempo and a meter (3/4, 4/4, 6/8, 12/8);+ - a tempo and a meter (2/4, 3/4, 4/4, 5/4, 6/8, 7/8, 9/8, 12/8);- **sections**, each with a mood (or a blend `[a, b, w]`), a key and mode, the melody types,a dynamic level `[start, end]` 0..1, and an ending;- `repeatable` / `optional` / `pickup` / `variations` flags, which let it fit any length.- Notes are written in a bar-checked notation. A bar that doesn't add up to the meter throws:```ts- line(3, "C5:2 Bb4:.5 Ab4:.5 | Bb4:2 Eb4:1 | [Ab1 Eb2 Ab2]:[email protected]", { role: "melody", bpb: 3 })+ line(<start beat>, "<NOTE>:<beats> <NOTE>:<beats> | [<NOTE> <NOTE>]:<beats>@<vel> | r:<beats>", { role, bpb })```- Roles: `melody`, `inner`, `bass`, `accomp`, `color`, `drum`.- - Generators may draft. **You compose**:+ - Nothing generates notes. **You compose** (compose.md):- real harmony and voice-leading;- a memorable motif and phrases that ask and answer;- cadences.@@ -61,6 +72,16 @@ MusicPlan + notes (you write) -> perform -> instruments (one stem per part)| `fmBell`, `ePiano` | 2-operator FM || `pulse`, `triangle`, `noiseDrum` | NES-style chip voices || `kick`, `snare`, `hat`, `bass`, `vinyl` | Drums, bass and texture |+ | `warmPad`, `softPluck`, `sub` | The lo-fi electronic kit (`lofiKit.ts`): detuned-saw pad, filtered pluck with ping-pong delay, sine sub |+ | `organ` | Drawbar ranks (harmonics 1 2 3 4 6 8), chorus, tremulant |+ | `brass` | PolyBLEP saw, a low-pass that opens with loudness, a pitch scoop, delayed vibrato |+ | `woodwind` | Flute (sine + breath noise) or `reed: true` clarinet (odd harmonics) |+ | `choir` | Detuned saws through vowel formants (`vowel`: a o u e i). Texture, never a lead |+ | `timpani` | Tuned membrane modes, a pitch settle, a mallet thump (`pitch` tunes it in a drum lane) |+ | `leadSynth` | Mono saw + square, portamento, a filter envelope, blooming vibrato |+ | `bowedSolo` | One bowed voice (violin, or `cello: true`): vibrato, bow noise, body resonances |++ The acoustic voices are procedural approximations. A human listens before one carries a film.4. **Room.** The style chooses it:- music box: one reflection, no tail;- nocturne and lullaby: a small room;@@ -69,18 +90,19 @@ MusicPlan + notes (you write) -> perform -> instruments (one stem per part)5. **Master.**- **Gentle styles:** one static gain to **-16 LUFS**, true peak <= -1 dBTP, never a compressor.If the peak blocks the gain, the loudness goes down. The cure is musical (see "Peaks" below).- - **Dense styles** (chiptune, lo-fi, drive): **-14 LUFS** through a look-ahead true-peak limiter.+ - **Dense styles** (lofiElectronic, lofi, drive, house, synthwave, hipHop, rock, chiptune): **-14 LUFS** through a look-ahead true-peak limiter, then a static trim if an inter-sample peak still passes -1 dBTP.A film's `audio` is `filmAudio(piece, seconds)`, which returns `(sampleRate) => [L, R]` at exactlythe film's length. It fits the score first (`fitScore`, below), so the music ends on its phrase atthe last frame and is never chopped. Any film mix that renders a score (sound effects included) must-fit it the same way. `engine/src/canvas-core/score.ts` is the scaffold example.+fit it the same way. `engine/src/canvas-core/score.ts` is an empty skeleton: `filmScore(material,+fps, frames)` composes your material and fits it.## Any length, never hard-coded-`fitScore(piece, seconds)` first calls the piece's own `refit(seconds)` if it has one. A-lofiElectronic piece adds or removes whole loop cycles of its `stretch` section, so it still lands-on its outro. Then it runs `fitToDuration`.+`fitScore(piece, seconds)` first calls the piece's own `refit(seconds)` if it has one. A composed+piece repeats or drops its `stretch` section, so it still lands on its outro. Then it runs+`fitToDuration`.`fitToDuration(piece, seconds)` tries every form:- with some `optional` sections dropped (dropping music costs more than nudging the tempo);@@ -92,35 +114,42 @@ It picks the form whose tempo is closest to the written one. If no full form fitthe piece's `shortForm`. A section's `pickup` travels with it: wherever a section lands, its ownupbeat leads into it.-Example: the nocturne "Window Light" gives-- the short form (the 8-second phrase, restated) at 15 s;-- the full piece at 45 s;-- intro, theme, theme (in octaves), build, coda at 60 s;-- six theme/climax cycles with rotating variations at 180 s.+A hand-written piece with a short form, repeatable sections and optional sections can fit anything+from a quarter of its length to many times it, and it still ends on its cadence.-## Styles (12) and moods (15)+## Styles (21) and moods (21)-Both are rows of numbers in `tables.ts`. A brief names rows, never adjectives. Each row stays-`unconfirmed` until a human has listened to 8 seconds of it; the listener's words then go into-`confirmedBy`.+Both are rows of numbers in `tables.ts`. The vocabularies are in `vocab.ts` and `vocabMore.ts`, and+[`styles/vocabularies.md`](styles/vocabularies.md) is generated from them. A brief names rows,+never adjectives. Each row stays `unconfirmed` until a human has listened to 8 seconds of it; the+listener's words then go into `confirmedBy`.-| Style | Tempo, meter | Natural moods | Master |-|---|---|---|---|-| musicBox (default) | 110-130, 12/8 | joy, curious, tender, playful, wistful | gentle |-| nocturne (piano) | 50-72, 3/4 or 6/8 | tender, melancholy, wistful, romantic | gentle |-| cinematic | 60-120 | awe, triumph, melancholy, tension, hopeful | gentle |-| lullaby | 60-75, 3/4 or 6/8 | tender, calm | gentle |-| folk | 80-120, 6/8, 3/4, 4/4 | calm, wistful, joy, nostalgic | gentle |-| minimalist | 100-140 | curious, tension, awe | gentle |-| jazz | 90-180, swing | playful, nostalgic, romantic, curious | gentle |-| ambient | 50-80 | awe, calm, dread (highest ghost risk) | gentle |-| chiptune | 120-160 | joy, playful, drive, tension | dense |-| lofi | 70-90, swing 55-62 % | nostalgic, calm, wistful | dense |-| lofiElectronic ([page](styles/lofi-electronic.md)) | 80-100, swing 52-56 % | calm, joy, hopeful, nostalgic | dense |-| drive | 110-140 | drive, triumph, tension, awe | dense |+| Style | Atmosphere | Master |+|---|---|---|+| lofiElectronic | chill, upbeat, clean electronic | dense |+| lofi | dusty lo-fi hip-hop (e-piano, vinyl) | dense |+| drive | driving electronic, four-on-the-floor | dense |+| house | euphoric house / EDM | dense |+| synthwave | neon-retro, gated snare, soaring lead | dense |+| hipHop | head-nod or dark trap, heavy 808 | dense |+| rock | band energy, driven guitars, tight kit | dense |+| chiptune | 8-bit, two pulses, triangle, noise | dense |+| cinematic | string swells, ostinatos, harp and bell colour | gentle |+| orchestral | heroic/epic: brass theme, string engine, choir, timpani | gentle |+| suspense | drones, heartbeat pulse, bowed harmonics, stingers | gentle |+| ambient | airy, spacious, bells and pads | gentle |+| choral | voices in parts, organ, bells | gentle |+| folk | tender acoustic: guitar, piano, harp, brushes | gentle |+| world | drone, modal melody, hand percussion, odd meters | gentle |+| playful | bouncy mallets, skipping kit | gentle |+| jazz | swing ride, walking bass, comping | gentle |+| nocturne | solo piano, rubato | gentle |+| minimalist | interlocking ostinatos | gentle |+| lullaby | soft, rocking, nothing percussive | gentle |+| musicBox | clockwork plucks, no sustain | gentle |Moods: joy, playful, tender, wistful, melancholy, hopeful, curious, tension, dread, awe, triumph,-drive, calm, nostalgic, romantic.+drive, calm, nostalgic, romantic, anger, eerie, mischief, heroic, sensual, grief.- Each row has columns for:- modes and tempo;- harmonic rhythm and lead register;@@ -145,30 +174,18 @@ per-mode guards are in `theory.ts`.Melody types (9): arpeggio, stepwise, hook, ostinato, drone, call and response, counter-melody,sequence, theme transformation.-## How to plan a score--1. **Spot the film.** Find its 3-5 true sync points, and an arc per section (for example tender, then- swelling, then a sudden hush at about 2/3, then a soft close).-2. **Pick one style.** Give each section a mood, a key and a mode.-3. **Write the motif first.** A 2-5 note cell with its own rhythm. Then build the harmony under it,- with voice-leading by step. Then the phrases:- - the question ends off the tonic;- - the answer ends on it, straight away;- - the high point falls in the second half of the phrase.-4. **Arrange.** Add density, not length (more notes, never longer notes). Let the motif return:- transformed, at the climax, and at the close.-5. **Print the score and meter it:**- ```- node tools/music.mjs score <piece>- node tools/music.mjs render <piece> out.wav --seconds 45 --fit- ```-6. **Balance the stems** (dense styles):- ```- node tools/music.mjs stems <piece>- ```- It prints each part's RMS against the piece's `stemTargets` and flags anything more than 3 dB off.- Fix the part's gain, then master. LUFS alone hid a sub 7-10 dB too hot on the launch score.-7. **8 seconds to a human.** Include the most important mood change.+## How to write a score++Follow [`compose.md`](compose.md). In short:+1. brief -> numbers (length, picture beats, feeling);+2. one style + one mood + five mood controls;+3. compose YOUR harmony, bass lines, motif(s), groove choice and form as `Material`;+4. `node tools/music.mjs render <file>.ts#<export> out.mp3 --stems` (loudness, peak, stems);+5. `node tools/music.mjs novelty <file>.ts#<export>` must PASS;+6. 8 seconds (then the whole piece) to a human, as an mp3 on a page.++Hand-written `Piece`s (the nocturne, the samplers) are still valid for styles without a vocabulary+builder. Write them with `line()` and render them with `renderPiece`.**Peaks are a composing problem.** Octaves in both hands landing on one downbeat make a true peakthat caps a gentle master. Fix it in the notes:diff --git a/skills/anidoodle/references/music/compose.md b/skills/anidoodle/references/music/compose.mdnew file mode 100644index 0000000..77a3bbd--- /dev/null+++ b/skills/anidoodle/references/music/compose.md@@ -0,0 +1,184 @@+# Compose: from a brief to an original score++A style is a **vocabulary**. It gives you:+- sound: voices, levels and fx;+- groove families;+- a harmony language;+- melody rules;+- an arrangement grammar.++It never gives you notes. **You write every note**:+- the chords and their voicings;+- the bass lines;+- the motifs and lines;+- the form.++The engine refuses to fill gaps. Missing harmony, melody, grooves or form is an error that tells you+what to compose. The engine then performs, synthesizes, mixes and masters, deterministically, in code.++> **Never reuse shipped material.** The demos (`node tools/music.mjs list`) and our own film scores+> are listening references and the novelty corpus. They are never a film's score or a template. Don't+> copy them, transpose them or re-rhythm them. Also don't reuse a progression, motif or form printed+> anywhere in these docs. `node tools/music.mjs novelty` fails a score that sounds like any shipped+> piece, or that quotes a 6-note fragment of one (transposed or not).+>+> Why this rule exists: a "new" example once changed the key, chords and pitches of the launch+> score but kept its rhythms, contour, drums and form. It was heard at once as the same song. The+> novelty fingerprint weighs exactly those things.++## The workflow++1. **Read the brief as numbers.** Write down:+ - the use case (launch film, explainer, loop for a site, game, ad);+ - the length in seconds, and whether it must loop;+ - 3-5 picture beats with their times (the reveal, the claim, the cut to the end card);+ - the words the person used for the feeling.+2. **Pick one style and one mood.** Styles:+ ```+ node tools/music.mjs vocab+ node tools/music.mjs vocab <style>+ ```+ For the details, see [styles/vocabularies.md](styles/vocabularies.md). The mood is a row in+ `tables.ts` (see the README's mood list). Then set the five **mood controls**, each 0..1, where+ 0.5 = the calibrated palette:++ | Control | What it moves |+ |---|---|+ | `energy` | groove density, drum level, sidechain depth, dynamics |+ | `warmth` | filters darker, tape drive and wow, a little more bass |+ | `brightness` | filters and pluck brightness open, hats up |+ | `tension` | pad detune wider, string attacks shorter, lead decays shorter |+ | `space` | reverb sends, delay mix, pad release |++ Controls change the sound only. Harmonic tension is yours to write (step 3).+3. **Compose the harmony.** Work inside the style's harmony language: its modes, chord qualities,+ tendencies and voicing rule. Decide the key and mode from the mood, not from habit.+ - Write a progression **for this brief**. Choose its length (2, 3, 4, 5, 6 or 8 bars) and its+ harmonic rhythm (one chord per bar, two per bar, or one per two bars) on purpose.+ - Voice each chord yourself. Move the voices by step and hold common tones. The bass owns the+ root.+ - Write each chord's bass line (one bar) in the style's bass idiom: held root, root and fifth,+ walking, offbeat 8ths, a syncopated 808 figure. Make the rhythm YOURS.+ - **Tension and release as a curve.** Stable (tonic), moving away (subdominant, relative,+ borrowed), leaning (dominant, suspension, pedal), home. Put home on the picture's key beat.+4. **Compose the motif(s).** A motif is 2-5 notes with its own rhythm. Invent the rhythm first:+ - Which beats does it avoid?+ - Does it start on an upbeat?+ - Where is the long note?++ Then the pitches: the contour, one leap, then steps back.++ Develop the motif. Don't photocopy it:+ - **repeat**, then **vary**: change the last interval, displace it by an eighth, extend it;+ - **sequence**: the same shape a step or a third higher;+ - **call and response**: the question ends off the tonic, the answer lands on it, or another+ instrument answers;+ - **fragment** it in a build, **augment** it (slower, longer notes) at the climax;+ - put it in the bass for menace, or high and quiet at the close.++ The phrase's high point goes in its second half. A phrase is 2 or 4 bars; a period is two phrases+ (question, answer). The line must respect the style's range and density.+5. **Choose or write the groove.** Pick a family from the style's list (`bounce`, `trap`,+ `brushes`, `hand`, ...). Set `density` 0..1, `variation` 0..1 and `fill` (a fill on a section's+ last bar). The seed varies every bar, so no two pieces share a loop. You can also write the drum+ bars yourself as notation, one or more bars per lane: `kick`, `snare`, `ghost`, `hat`, `perc`.+ Use a second groove for contrast (`half`, `build`).+6. **Write the form.** Sections are `{ kind, bars, harmony, lead, counter, arp, groove, bass,+ chordVel, energy, repeat, stretch }`.+ - The **kind** sets which layers may sound: intro, verse, groove, hook, build, half, breakdown,+ drop, bridge, swell, breath, outro. See the arrangement grammar in vocabularies.md.+ - Lines sound only where you write them.+ - Land each section change on a picture beat. At `bpm`, a bar lasts `beatsPerBar x 60 / bpm`+ seconds, and at 30 fps a beat is `1800 / bpm` frames.+ - Mark one section `stretch: true`: a film fit repeats or drops it to reach the exact length and+ still end on your outro.+7. **Render, meter, check, listen:**+ ```+ node tools/music.mjs render <file>.ts#<export> out.mp3 --stems # loudness, peak, stems+ node tools/music.mjs render <file>.ts#<export> out.mp3 --fit --seconds 62+ node tools/music.mjs novelty <file>.ts#<export> # must PASS+ node tools/music.mjs score <file>.ts#<export> # the text score, bar by bar+ ```+ - **Stems:** fix any part flagged more than 3 dB off with `levels` (gainDb per slot). LUFS alone+ once hid a sub 7-10 dB too hot.+ - **Novelty:** if it fails, change what the numbers point at. The per-feature scores name it:+ the lead's rhythm, the contour, the groove, the chord colours, the form. Changing the key fixes+ nothing.+ - **Listen:** the person hears it (an mp3 on a page) before it is used. Meters prove you aren't+ obviously wrong. Only an ear says right.++## The material format++Write the score in the film's own file, e.g. `engine/src/canvas-core/<film>Score.ts`, and export it:++```ts+import type { Material } from "./music";+export const score = (): Material => ({+ style: "<style id>", title: "<this film's score>", seed: <any integer>, mood: "<mood id>",+ bpm: <tempo in the style's range>, key: "<tonic>", mode: "<mode id>", meter: "<meter>",+ moodControls: { energy: <0..1>, warmth: <0..1>, brightness: <0..1>, tension: <0..1>, space: <0..1> },+ chords: { "<name>": { voicing: "[<note> <note> <note>]", bass: "<one bar of notation>" }, /* ... */ },+ motifs: { "<motif>": "<one or more bars of notation>", /* your variations are motifs too */ },+ grooves: { main: { family: "<family>", density: <0..1>, variation: <0..1> }, half: { family: "<family>" } },+ sections: [+ { kind: "intro", bars: <n>, harmony: ["<chord>", /* per bar, cycled */], chordVel: <0..1> },+ { kind: "hook", bars: <n>, harmony: [/* ... */], lead: ["<motif>", "<motif variant>", "r:<beats>"], stretch: true },+ /* ... */+ { kind: "outro", bars: <n>, harmony: ["<home chord>"], lead: ["<the motif's last word>"] },+ ],+});+```++A film plays it with `filmScore(score(), fps, frames)` from `canvas-core/score.ts`. That fits your+form to the exact length. `score.ts` is an empty skeleton to copy.++- **Voices:** `voices: { lead: "<alternate name>" }` swaps a slot for one of the style's+ alternates. Or give your own `{ inst, role, gainDb, opts }` (instruments: README table).+- **Loops:** `loop: true`, and the form length is the loop. `render` makes it seamless.+- **Split bars:** `harmony: ["<chord> <chord>"]` splits a bar in two. Give that section a `bass`+ override for it.++**Notation** (bar-checked; a bar that doesn't add up throws):+- A token is `NOTE:DUR[@VEL]` (a pitch name with an octave, e.g. `F#4`), `[NOTE NOTE ...]:DUR` (a+ chord) or `r:DUR` (a rest).+- Bars are separated by `|`, or given as array items.+- Durations are in beats. In 6/8, 9/8 and 12/8 a beat is a dotted quarter, so an eighth is `1/3`.+ In 7/8 a beat is a quarter, so an eighth is `.5` and a bar is 3.5.+- `@VEL` scales the line's velocity (0..1).++## Craft notes (what makes it good, not just valid)++- **One idea, developed.** Most memorable scores have one motif, heard 6-12 times, never the same+ way twice. Two motifs at most; the second answers or contrasts the first.+- **Contrast by section:**+ - change the density (layers in and out);+ - change the register (the motif up an octave);+ - change the harmonic rhythm (twice as fast into a cadence);+ - change the groove (half-time).++ A section that only repeats the previous one is dead air.+- **Cadences on picture beats.** The strongest arrival (home chord, full layers, the motif's peak)+ goes on the most important frame. The claim, the reveal and the logo each get a structural+ downbeat. Use a breakdown or a breath (drums out, one bar of silence) right before it.+- **Tension curve.** Plan energy 0..1 per section before writing notes: rise, a dip before the peak,+ then release. Match it with density, register and harmony (leaning chords before home).+- **Endings.** End on a phrase, never on the last frame by accident:+ - a held home chord with the motif's last word;+ - a button (a short tutti hit);+ - an unresolved hold (suspense only).+- **Mood fit.** Match the mode, tempo and brightness to the words. If the listener names a different+ emotion from the one you declared, the choice was wrong, not the listener.+- **Breadth.** Across projects, vary the meter, the harmonic rhythm, the groove family and the form+ length. Two scores for two products should not be siblings.++## Checks that run for you++- `planProblems`: the declared key and mode match the notes.+- `guards`:+ - ghost: formless sustained sound fails;+ - reverb;+ - masking: the melody must be heard.+- The stem meter (`--stems`).+- The master: -14 LUFS for dense styles, -16 for gentle ones, true peak <= -1 dBTP.+- `novelty` (above).+- `tools/music-unit.mjs` keeps the engine honest (determinism, no defaults, every vocabulary renders).diff --git a/skills/anidoodle/references/music/styles/lofi-electronic.md b/skills/anidoodle/references/music/styles/lofi-electronic.mdindex 773397d..a51503e 100644--- a/skills/anidoodle/references/music/styles/lofi-electronic.md+++ b/skills/anidoodle/references/music/styles/lofi-electronic.md@@ -1,116 +1,108 @@# Style: lo-fi electronic (chill, upbeat, clean)-> The style the anidoodle launch film is scored in. Ask for it by name: **"lo-fi electronic"**.-> Code: `engine/src/canvas-core/music/lofiElectronic.ts` (the builder), `lofiKit.ts` (the voices),-> `STYLES.lofiElectronic` in `tables.ts`. Worked examples: `pieces/lofi.ts` (Daylight) and-> `pieces/launch.ts` (`launchLofi3`, the approved launch score, Cmaj9 landing on bar 26).-> The old `lofi` row (ePiano, vinyl, dusty low-pass) is a different, noisier sound. Don't use it for this.--## What it should sound like--Chill but **upbeat**, **clear**, **not noisy**. A warm chord loop that breathes with the kick, a-bright plucked hook bouncing through a ping-pong delay, a round sub, a kick that bounces, a snare on-2 and 4, 16th hats. Listeners' words for the approved launch score: "more upbeat, clearer, less noisy".--**Never:** a synth electric piano (Alex: no ePiano), vinyl crackle, bit-crush, a dark master-low-pass, heavy tape. Each of these reads as "dusty lo-fi hip-hop", not clean electronic.--## The recipe--| Layer | Voice (part id) | How it's made | Stem RMS target |+> A vocabulary, not a song. The data is `VOCAB.lofiElectronic` in `engine/src/canvas-core/music/vocab.ts`+> (print it: `node tools/music.mjs vocab lofiElectronic`). You compose the notes with+> [../compose.md](../compose.md). Our launch film was scored in this style (`launchLofi3`). That+> score is ours and is in the novelty corpus. Never reuse its progression, hook, rhythms, drums or+> form.++## The sound++Chill but **upbeat**, **clear**, **not noisy**:+- a warm pad that breathes with the kick;+- a plucked lead through a dotted-eighth ping-pong delay;+- a high counter-line;+- a round sine sub;+- a bouncy, clean kit.++**Never:**+- synth electric piano;+- vinyl crackle;+- bit-crush;+- a dark master low-pass;+- heavy tape.++Those read as dusty lo-fi hip-hop (the `lofi` style), not clean electronic.++| Slot | Voice | How it's made | Stem RMS target ||---|---|---|---|-| Chords | `warmPad` (`pad`) | 7 PolyBLEP saws spread by 0.55 x +-14 cents, slow per-voice drift (chorus), 12 dB low-pass at 2.6 kHz, 0.5 s attack, 1.4 s release, rootless 3-4 note voicings around E3-E4 | -21 dB |-| Hook | `softPluck` (`lead`) | triangle + square an octave down, filter snaps open and falls in 90 ms, 0.42 s decay, dotted-eighth ping-pong delay (feedback 0.28, mix 0.24) | -16.5 dB |-| Sparkle | `softPluck` (`sparkle`) | the same an octave up (C6 area), panned 0.35, more delay (0.35) and more room | -24 dB |-| Sub | `sub` (`sub`) | sine + a whisper of the 2nd harmonic, low-passed at 150 Hz; root for 3 beats, a walk note on the last eighth | -18 dB |-| Kick | `kick` (`kick`) | two alternating bouncy bar patterns | -14 dB |-| Snare | `snare` (`snare`) | beats 2 and 4, rim ghosts (`ghost`) about 11 dB under | -20 dB |-| Hats | `hat` (`hat`) | 16ths, accents 0.85 / 0.35 / 0.6 / 0.4 | -28 dB |--Bus: the kick ducks the pad and sparkle (depth 0.38, release 0.24 s: the pump that makes it-breathe). Tape barely there (2.5 cents wow at 0.4 Hz, no flutter, drive 1.02). `fx.clean`: no-lo-fi master tone. Room send only. Master: dense, **-14 LUFS**, true peak **<= -1 dBTP** through-the look-ahead limiter.--**Tempo** 90-100 bpm (the style range is 80-100), swing 0.54 (a hint, not a shuffle). **Harmony:**-a 4-bar, one-chord-per-bar loop of 7th/9th chords with rootless pads that move by step. Two that-work: ii-V-I-vi in C (Dm9 G13 Cmaj9 Am9, the launch) and I-vi-IV-V in D (Dmaj9 Bm9 Gmaj9 A13,-Daylight). **Hook:** one 4-bar phrase over the loop, the question ending off the tonic on the last-chord, the answer landing on the home chord; give it a second-pass variant (`hook: [a, b]`) so two-8-bar blocks are never identical.--## The API--```ts-import { lofiElectronic } from "./music";-const piece = lofiElectronic({- bpm: 96, key: "D", mood: "joy",- progression: [ // one bar each: pad voicing, sub root + walk note, hook bar(s), sparkle bar- { name: "Dmaj9", pad: "[F#3 A3 C#4 E4]", root: "D2", walk: "A1", hook: "r:.5 F#4:.5 A4:.5 D5:1 C#5:.5 A4:1", sparkle: "r:1 A5:.5 C#6:.5 E6:2" },- /* Bm9, Gmaj9, A13 */ ],- home: 0, // the home chord (index in the progression)- land: "claim", // this bar lands on home: a bar number or a section id; default = the last drop- sections: [- { kind: "intro", bars: 2 }, { kind: "hook", bars: 4 }, { kind: "hook", bars: 4, sparkle: true, stretch: true },- { kind: "half", bars: 2 }, { kind: "breakdown", bars: 2 }, { kind: "drop", bars: 1, id: "claim" }, { kind: "outro", bars: 2 },- ],- levels: { sub: -6 }, // part gainDb, set by measuring stems (below)-});-```--| Kind | Layers |-|---|---|-| `intro` | pad only (`intro` chords if given, e.g. IV V into home) |-| `groove` | pad, sub, full drums |-| `hook` | groove + hook |-| `half` | pad, sub, half-time drums (kick on 1, snare on 3, quarter hats) |-| `breakdown` | pad only: drums and sub out, before the landing |-| `drop` | groove + hook: everything back, on the home chord |-| `outro` | the home chord held, sub on the home root, the home note on the last bar |--Any section takes `hook: true/false` and `sparkle: true`. Every bar is checked by `line()`: a hook-bar that doesn't add up to 4 beats throws.--- **Film score:** `filmAudio(piece, seconds)` calls `fitScore`, which runs `piece.refit(seconds)`- first. The `stretch` section (default: the longest hook/groove/drop) gains or loses **whole- loop cycles**, so the harmony stays in phase and a numeric `land` after it moves with it. Then- `fitToDuration` trims the tempo by the remaining few percent (up to about +-6 %). The score ends- on its outro phrase at the film's last frame. It is never chopped by the picture.-- **Loop:** `loop: true` (no final ritard, no cadence relax), then `renderLoop(piece, sr)`. It renders- the tail, folds reverb, delay and pad release back onto the start, and snaps tape wow to whole- cycles per loop. Loop length = bars x 4 x 60 / bpm (12 bars at 96 bpm = 30 s exactly).--## Arrangement (how the launch score moves)--Intro pad (2 bars) -> groove -> hook -> hook + sparkle -> half-time for a scene change ->-groove with sparkle -> breakdown (drums out) -> **drop on the home chord on the claim** -> outro-holding home. Sections change on scene changes. At 90 bpm a bar is 80 frames at 30 fps.+| chords | `warmPad` | 7 PolyBLEP saws, spread 0.55 x +-14 cents, slow per-voice drift, 12 dB low-pass at 2.6 kHz, 0.5 s attack, 1.4 s release | -21 dB |+| lead | `softPluck` | triangle + square an octave down, filter snaps open, 0.42 s decay, dotted-eighth ping-pong (feedback 0.28, mix 0.24) | -16.5 dB |+| counter | `softPluck` | brighter, panned 0.35, more delay and room | -24 dB |+| bass | `sub` | sine + a whisper of the 2nd harmonic, low-passed at 150 Hz | -18 dB |+| kick / snare / ghost / hat | kit | a bouncy kick, a snare, rim ghosts about 11 dB under, 16th hats | -14 / -20 / - / -28 dB |+| arp, perc | `softPluck`, `hat` | optional extra layers | - |++Alternates:+- lead: `bell`, `mallet`, `guitar`;+- chords: `strings`, `piano`;+- bass: `warm`.++Bus:+- the kick ducks the chords and the counter (depth 0.38, release 0.24 s);+- tape is barely there (2.5 cents of wow);+- clean master at **-14 LUFS**, true peak **<= -1 dBTP**.++The stem targets were calibrated on a listened score, and they are the only calibrated targets.++## Grooves++`bounce`, `halfTime`, `broken`, `skip`, `pulse`, `build`. Pick one per section role (`main`,+`half`, `build`) and set `density` and `variation`. The seed varies every bar. Swing 0.52-0.56.++## Harmony language (write your own progression)++- **Modes:** major, dorian, lydian, aeolian, mixolydian.+- **Qualities:** 7ths, 9ths, 11ths, 13ths, add9, sus2 and sus4. Keep bare triads for the landing.+- **Tendencies:**+ - loops of 2, 4 or 8 bars;+ - ii-V motion;+ - drifting IV-iii-vi motion;+ - modal vamps (i-IV in dorian, I-II in lydian);+ - a borrowed iv or bVII for a wistful turn.+- **Harmonic rhythm:** one chord per bar or two. A change may anticipate the bar by an eighth.+- **Voicing:** rootless 3-4 note voicings between about E3 and E4, moving by step. The sub owns the+ root.+- **Tension:** sus4 and 13ths lean, maj7#11 floats, 7b9 or a borrowed iv aches. Release by stepping+ the leaning voice down.++## Melody rules (write your own motif)++- Lead in C4-A5, counter an octave above.+- Short arches, with the high point late in the phrase.+- 1-3 notes per beat, with rests so the echo can answer.+- A 2-5 note cell with its own rhythm: repeat it, then vary it (a step up, the last interval+ inverted, displaced by an eighth).+- Call and response between the lead and the counter.++## Arrangement grammar++A typical shape: intro -> groove -> hook -> (half-time or breakdown) -> drop on home -> outro. Add+or remove one layer at a time. Put the drop (everything back, home chord) on the picture's strongest+beat.++**Transitions:**+- a fill bar;+- a half-time bar;+- drums out for a breakdown.++**Endings:**+- the home chord held, with the motif's last note;+- a clean button.## Mixing: balance by stem RMS, then master```-node tools/music.mjs stems <piece> # each part's stem RMS vs its target; FLAG when > 3 dB off-node tools/music.mjs render <piece> out.mp3 --stems+node tools/music.mjs stems <file>.ts#<export>+node tools/music.mjs render <file>.ts#<export> out.mp3 --stems```-A stem is a part's own signal: unmastered, pre-room, after its gain and the duck. It is measured-as RMS over its **active** samples (|x| > 1e-4), left channel, at 24 kHz, the way the targets were-calibrated (`LOFI_STEM_TARGETS`). Fix a flagged part with its `levels` gain, never with the master.--**The lesson:** integrated LUFS only says how loud the whole mix is. On the launch score the-mix read a healthy -14 LUFS while the sub sat **7-10 dB too hot**. The number was right and the-balance was wrong. `tools/music-unit.mjs` keeps a regression for this: a sub 9 dB hot-still masters to -14.0 LUFS, and only the stem meter flags it.--## Checks (`node tools/music-unit.mjs`)+A stem is a part's own signal:+- unmastered, pre-room, after its gain and the duck;+- measured as RMS over its **active** samples (|x| > 1e-4), left channel, at 24 kHz.-- launchLofi3 md5 unchanged;-- determinism (same md5 twice);-- true peak <= -1 dBTP;-- -14 LUFS +-1;-- stems within +-3 dB;-- the hot-sub lesson;-- the loop seam is an ordinary sample step;-- a film fit ends on the home note at `seconds - tail`.+Fix a flagged part with `levels`, never with the master.-Meters prove we aren't obviously wrong. **A human hears it before it ships:** mp3 on a page first.+**The lesson:** integrated LUFS only says how loud the whole mix is. On the launch score the mix read+a healthy -14 LUFS while the sub sat **7-10 dB too hot**. `tools/music-unit.mjs` keeps this as a+regression: a sub 9 dB hot still masters to -14.0 LUFS, and only the stem meter flags it.diff --git a/skills/anidoodle/references/music/styles/music-box.md b/skills/anidoodle/references/music/styles/music-box.mdindex 8bfba70..cfe571f 100644--- a/skills/anidoodle/references/music/styles/music-box.md+++ b/skills/anidoodle/references/music/styles/music-box.md@@ -1,10 +1,11 @@-# Style preset: music-box (the default)+# Style: music box-> The original anidoodle music recipe, kept **verbatim** below as one style preset among the eleven-> in `engine/src/canvas-core/music/tables.ts` (`STYLES.musicBox`). Its numbers are what the-> `musicBox` and `bell` instruments implement. Its ban list is now the rule for THIS preset only;-> for every other style the bans became measured guards (see `../README.md`, "Guards"). The scar-> story is kept because it is why the guards exist.+> The original anidoodle music recipe, kept below for its SOUND numbers (the `musicBox` and `bell`+> instruments implement them) and its scar story (why the guards exist). It is one style among the+> vocabularies in `engine/src/canvas-core/music/vocab.ts` (`VOCAB.musicBox`), not a default: there is+> no default style. Its fixed composing choices (one progression, one scale, one accompaniment+> figure) were rewritten below as ranges: the composer writes the notes ([../compose.md](../compose.md)).+> Its ban list is the rule for THIS style only; for other styles the bans became measured guards.---@@ -27,11 +28,11 @@- bass: same pluck one to two octaves down with only the first two partials, gain 0.5. It is still a pluck. It never sustains.- "room": ONE early reflection, 30 ms late, 14 dB down. No tail.-**Key, register, harmony.** C, G or D major. Melody between C5 and C7, bass C3 to G3. One chord per bar, **I, IV, V, I**, and nothing cleverer. If you want a lift for the payoff, go up a whole step and play the same thing.+**Key, register, harmony.** Any major, lydian, dorian or minor key you choose for the mood (a minor music box is a real, uncanny sound). Melody between C5 and C7, bass C3 to G3. Harmonic rhythm one chord per bar; the progression is yours (plagal and deceptive turns read well; the original film used the plainest possible one and said "nothing cleverer", which is a choice, not a rule). For a lift at the payoff, move the key up a step.-**Melody.** Chord tones and the major pentatonic (1 2 3 5 6). Mostly steps, leaps only onto chord tones. Four-bar phrases in pairs: the QUESTION ends on the 5th over V, the ANSWER ends on the root over I, **and the answer follows immediately.** The story may hold its resolution back for a minute; the tune may not. What you hold back is the ARRANGEMENT: the octave doubling, the full arpeggio and the bell arrive with the payoff.+**Melody.** Chord tones plus the mode's scale, mostly steps, leaps onto chord tones. Four-bar phrases in pairs: the QUESTION ends off the tonic, the ANSWER lands on it, **and the answer follows immediately.** Your own motif, with its own rhythm.-**Rhythm.** At 120 bpm and 30 fps a beat is 15 frames and a straight eighth is 7.5 frames, which does not exist. Use triplet eighths, 5 frames: 12/8, which is what a music box plays anyway. Accompaniment is a rolling 1-5-3-5 arpeggio on the triplets; melody mostly on beats. Every onset is a row in a cue table with its FRAME, and the module asserts at load that each sample index equals `round(frame / fps * sampleRate)`.+**Rhythm.** At 120 bpm and 30 fps a beat is 15 frames and a straight eighth is 7.5 frames, which does not exist. Use triplet eighths, 5 frames: 12/8, which is what a music box plays anyway. Accompaniment is an arpeggio figure you design on the triplets (choose its order of chord tones and its cycle length; a 4-note cell over 3-note groups makes a gentle hemiola); melody mostly on beats. Every onset is a row in a cue table with its FRAME, and the module asserts at load that each sample index equals `round(frame / fps * sampleRate)`.**Sound events ride on top, quietly:** a tick is a 2 ms noise burst through a band-pass at 3 kHz, the tock at 2 kHz, 20 dB under the melody. A landing is one soft pluck on its beat. The DING is a bell on the tonic (partials 1, 2, 3, 4.2, tau 1.2 s, doubled an octave down) on the final downbeat, with at least four beats of film after it.diff --git a/skills/anidoodle/references/music/styles/vocabularies.md b/skills/anidoodle/references/music/styles/vocabularies.mdnew file mode 100644index 0000000..02a95f0--- /dev/null+++ b/skills/anidoodle/references/music/styles/vocabularies.md@@ -0,0 +1,537 @@+# Style vocabularies++> GENERATED by `node tools/music.mjs vocab --md` from `engine/src/canvas-core/music/vocab.ts` and `vocabMore.ts`. Do not edit by hand.+> A style is a vocabulary: sound, grooves, harmony language, melody rules, arrangement grammar. It never+> contains notes. You compose the notes ([../compose.md](../compose.md)).++| Style | Atmosphere | Tempo, meters | Moods | Grooves |+|---|---|---|---|---|+| `lofiElectronic` | warm, chill but upbeat, clean: a breathing pad, a plucked hook through ping-pong echoes, a round sub, a bouncy kit | 80-100 bpm; 4/4 | calm, joy, hopeful, nostalgic, wistful, curious | bounce, halfTime, broken, skip, pulse, build |+| `drive` | forward, bright, confident: four-on-the-floor, a pumping supersaw bed, a gritty bass line, a plucked arp | 110-140 bpm; 4/4 | drive, triumph, tension, joy, awe | fourFloor, broken, build, halfTime, tension |+| `cinematic` | wide and emotional: string swells, low ostinatos for tension, harp and bell colour, a low boom on the arrival | 60-120 bpm; 4/4, 3/4, 6/8 | awe, triumph, tension, melancholy, hopeful, dread | pulse, tension, build, halfTime |+| `ambient` | floating, spacious, luminous: long pads, bells and plucks with space around them, a soft heartbeat at most | 50-80 bpm; 4/4, 3/4 | awe, calm, hopeful, tender, dread | pulse, brushes |+| `folk` | intimate and warm: fingerpicked guitar, soft piano, a harp or celesta line, brushes | 60-110 bpm; 6/8, 3/4, 4/4 | tender, calm, wistful, nostalgic, hopeful, romantic | brushes, pulse, shuffle |+| `playful` | light, cheeky, springy: marimba and pizzicato-like plucks, a bouncy bass, a skipping kit | 100-150 bpm; 4/4, 6/8 | playful, joy, curious | skip, shuffle, bounce, fourFloor |+| `musicBox` | small, bright, clockwork, innocent; plucked and never sustained | 100-132 bpm; 12/8, 3/4, 6/8 | joy, curious, tender, playful, wistful, eerie | none (no drums) |+| `nocturne` | intimate, expressive, late-night: one piano, rubato, pedal | 50-76 bpm; 3/4, 6/8, 4/4 | tender, melancholy, wistful, romantic, grief | none (no drums) |+| `minimalist` | hypnotic, curious, clean: interlocking ostinatos that change slowly | 96-144 bpm; 4/4, 12/8, 5/4, 7/8 | curious, tension, awe, calm | pulse |+| `jazz` | loose, warm, clever: swing ride, walking bass, comping piano | 80-200 bpm; 4/4, 3/4 | playful, nostalgic, romantic, curious, sensual, mischief | swing, brushes, shuffle |+| `lullaby` | soft, rocking, safe | 56-78 bpm; 3/4, 6/8 | tender, calm | none (no drums) |+| `chiptune` | 8-bit, bright, game-like: two pulses, a triangle, noise drums | 110-170 bpm; 4/4, 6/8 | joy, playful, drive, tension, mischief | fourFloor, bounce, shuffle, skip |+| `lofi` | hazy, nostalgic, crackly: FM e-piano, vinyl, a lazy swung beat (the dusty cousin of lo-fi electronic) | 68-90 bpm; 4/4 | nostalgic, calm, wistful, sensual | bounce, halfTime, shuffle |+| `orchestral` | big and heroic: brass theme, string ostinato engine, choir, timpani | 70-140 bpm; 4/4, 3/4, 6/8 | heroic, triumph, awe, tension, grief | epic, build, tension, pulse |+| `suspense` | unsettling, cold, withheld: low drones, heartbeat pulse, high bowed harmonics, stingers | 50-110 bpm; 4/4, 5/4, 3/4 | tension, dread, eerie | pulse, tension, epic |+| `rock` | live-band energy: driven guitars, bass locked to the kick, a tight kit, maybe organ | 90-160 bpm; 4/4, 6/8 | drive, anger, triumph, joy, heroic | rock, halfTime, shuffle, fourFloor |+| `hipHop` | head-nod or dark trap: heavy 808, crisp clap, rolling hats, a moody loop on top | 70-100 bpm; 4/4 | drive, calm, nostalgic, sensual, anger, tension | trap, bounce, halfTime, broken |+| `house` | euphoric, dancing, bright: four-on-the-floor, offbeat bass, stabs, a big pad | 118-128 bpm; 4/4 | joy, drive, sensual, hopeful | fourFloor, build, broken |+| `synthwave` | neon-nostalgic, cinematic 80s: big gated snare, pulsing 8th bass, lush pads, a soaring lead | 80-118 bpm; 4/4 | nostalgic, drive, heroic, romantic, tension | fourFloor, halfTime, rock, build |+| `world` | rooted, spacious, rhythmic: a drone, a modal melody on plucked strings or a flute, hand percussion cycles (write your own melody; name the tradition you draw on) | 60-150 bpm; 7/8, 9/8, 12/8, 6/8, 4/4, 5/4 | calm, joy, curious, mischief, awe, sensual | hand, pulse, brushes |+| `choral` | vast, human, reverent: voices in parts, organ, bells, a slow swell | 50-90 bpm; 4/4, 3/4 | awe, grief, hopeful, tender, heroic | pulse |++## Groove families++Pick a family and its knobs (`density`, `variation`, `fill`, `accent`); the seed varies every bar. Or write the drum bars yourself.++- `bounce`: lo-fi / hip-hop bounce: kick on 1 plus syncopated pickups, backbeat on 2 and 4, ghost notes, 8th or 16th hats with accents+- `fourFloor`: house / drive: kick on every beat, clap on 2 and 4, off-beat open hats, 16ths when dense+- `halfTime`: half-time: kick on 1 (and a pickup), snare on 3; the same tempo feels twice as slow (a breath, a scene change)+- `broken`: broken beat / garage: kicks displaced off the grid, backbeat kept, ghosted 16ths; restless, modern+- `shuffle`: shuffle: triplet grid, swung hats, kick on 1 and 3 with a skip; playful, bouncy+- `pulse`: pulse: a soft heartbeat kick, no backbeat, sparse shaker; ambient and cinematic under-scoring+- `brushes`: brushes: soft rim on 2 and 4, shaker swishes, a gentle kick; tender, acoustic+- `build`: build: snare 8ths then 16ths rising in velocity across the section, kick on quarters; ends on the next downbeat+- `tension`: tension: 3-3-2 kick ostinato, accent on 4, quiet 16th hats; cinematic urgency, chases+- `skip`: skip: kick on 1 and the and-of-2, clap on 2 and 4, a skipping 16th perc; playful, light+- `trap`: trap: sparse syncopated kicks (the 808 bass follows them), clap on 3, 16th hats with velocity ramps and bursts, an open hat now and then+- `epic`: epic: big low hits (kick / timpani in perc) in a 3-3-2 or 1-and-3 figure, a snare accent on 4; orchestral and trailer weight+- `hand`: hand percussion: dum (low) on each group start, tek (rim) inside, ka (perc) fills; groups follow the meter (7/8 = 2+2+3, 9/8 = 2+2+2+3, 5/4 = 3+2)+- `rock`: rock: kick on 1 and 3 with an 8th pickup, snare backbeat, 8th hats, a crash (perc) on section starts+- `swing`: jazz swing: ride on the beats and the swung skip of 2 and 4, foot hi-hat (perc) on 2 and 4, feathered kick, snare comping ghosts++## Section kinds (the arrangement grammar)++A kind decides which layers may sound; your lines sound only where you write them.++- `intro` (drums: none, bass: no): chords (and any line you write) without drums or bass: set the colour, state the key+- `verse` (drums: main, bass: yes): the groove under a lighter line: room for picture and words+- `groove` (drums: main, bass: yes): chords, bass, drums: the bed, no lead unless you write one+- `hook` (drums: main, bass: yes): full groove under the motif: the memorable part+- `build` (drums: build, bass: yes): rising density (snare 8ths to 16ths), rising line, lands on the next downbeat+- `half` (drums: half, bass: yes): half-time drums: the same tempo feels slower (a scene change, a breath with pulse)+- `breakdown` (drums: none, bass: no): drums and bass out, chords and a thin line: the held breath before a landing+- `drop` (drums: main, bass: yes): everything back on a strong chord: the landing, put it on the picture's key beat+- `bridge` (drums: main, bass: yes): new harmony away from home (a borrowed or relative area) before the return+- `swell` (drums: none, bass: yes): long notes crescendo over 2-8 bars (orchestral swell), peaks on the downbeat after+- `breath` (drums: none, bass: no): near silence: one held chord or nothing, authored (max 2 bars)+- `outro` (drums: none, bass: yes): home chord held, the motif's last word, then the tail++## `lofiElectronic`: lo-fi electronic++warm, chill but upbeat, clean: a breathing pad, a plucked hook through ping-pong echoes, a round sub, a bouncy kit. Tempo 80-100 bpm, meters 4/4, swing 0.52-0.56.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `warmPad` | -3 | -21 | strings, piano |+| lead | `softPluck` | 6 | -16.5 | bell, mallet, guitar |+| counter | `softPluck` | 8 | -24 | - |+| bass | `sub` | -6 | -18 | warm |+| kick | `kick` | 0.5 | -14 | - |+| snare | `snare` | 8 | -20 | - |+| ghost | `snare` | 4 | - | - |+| hat | `hat` | 20 | -28 | - |+| arp | `softPluck` | 4 | - | - |+| perc | `hat` | 14 | - | - |++Stem targets: calibrated on a listened score.++- **Harmony language.** Modes: major, dorian, lydian, aeolian, mixolydian. Qualities: 7ths, 9ths, 11ths and 13ths; add9; sus2/sus4 for air; avoid bare triads except on the landing. Tendencies: loops of 2, 4 or 8 bars; ii-V motion, IV-iii-vi drifts, modal vamps (i-IV in dorian, I-II in lydian), borrowed iv or bVII for a wistful turn; the home chord arrives on a structural beat. Harmonic rhythm: one chord per bar or two per bar; the change can anticipate the bar by an eighth. Voicing: rootless 3-4 note voicings between E3 and E4 moving by step (common tones held); the bass owns the root. Tension and release: sus4 and 13ths lean, maj7#11 floats, a dominant 7b9 or a borrowed iv aches; release by resolving the lean voice down a step.+- **Melody.** Range C4-A5 for the lead, the octave above for counter lines. Contour: short arches; the high point in the second half of a phrase; answer phrases end lower. Density: 1-3 notes per beat; leave rests so the echo answers. Motif: a 2-5 note cell with its own rhythm; repeat it, then vary it (shift it up a step, invert the last interval, displace it by an eighth); call and response between lead and counter.+- **Arrangement.** intro -> groove -> hook -> (half-time or breakdown) -> drop on home -> outro; add or remove one layer at a time. Transitions: a fill bar, a half-time bar, drums out for a breakdown, then everything back on a downbeat. Endings: home chord held with the motif's last note, or a clean button on 1.+- **Grooves:** bounce, halfTime, broken, skip, pulse, build. **Avoid:** synth ePiano, vinyl crackle, bit-crush, a dark master low-pass: that is dusty lo-fi hip-hop, not clean electronic.++## `drive`: driving electronic++forward, bright, confident: four-on-the-floor, a pumping supersaw bed, a gritty bass line, a plucked arp. Tempo 110-140 bpm, meters 4/4, swing 0.5-0.52.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `strings` | -2.7 | -22 | - |+| lead | `strings` | 5.4 | -16 | pluck |+| counter | `fmBell` | 6 | -27.3 | - |+| bass | `bass` | 0.1 | -16 | sub |+| kick | `kick` | 2.5 | -12 | - |+| snare | `snare` | 10.5 | -18 | - |+| ghost | `snare` | -2 | - | - |+| hat | `hat` | 12 | -26 | - |+| arp | `softPluck` | 4.2 | -21 | - |+| perc | `hat` | 18.3 | -27 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: aeolian, dorian, mixolydian, major. Qualities: triads and power voicings, sus2, add9; minor with a major IV (dorian) for lift. Tendencies: i-VI-III-VII, i-v-VI-IV, bVI-bVII-i climbs; long pedal tones under changing chords; a key lift of a step for the last chorus. Harmonic rhythm: one chord per bar or per two bars; stabs on off-beats. Voicing: wide: root-fifth-octave low, tight triads above C4; the bass line is 8ths or offbeat. Tension and release: a pedal under a moving chord, a build that withholds the kick, a riser into a drop; release on the downbeat with everything.+- **Melody.** Range A3-E6. Contour: repeated cells climbing by step; big leaps at the drop. Density: 8ths and 16ths; arps in 3-note cells across 4/4 (hemiola). Motif: a rhythmic riff of 3-6 notes, repeated with the last note changed; sequence it up the scale in the build.+- **Arrangement.** intro (filtered) -> build -> drop -> breakdown -> build -> bigger drop -> outro. Transitions: builds of 4-8 bars, a one-beat breath before the drop. Endings: a button on 1 or a filtered fade of the groove.+- **Grooves:** fourFloor, broken, build, halfTime, tension. **Avoid:** swing, soft attacks on the lead, more than 4 layers in the breakdown.++## `cinematic`: cinematic / orchestral++wide and emotional: string swells, low ostinatos for tension, harp and bell colour, a low boom on the arrival. Tempo 60-120 bpm, meters 4/4, 3/4, 6/8, swing 0.5-0.5.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `strings` | 1.2 | -18 | - |+| lead | `strings` | 4.5 | -17 | piano, bell, celesta |+| counter | `harp` | 12 | -36.7 | piano |+| bass | `strings` | 1.3 | -19 | - |+| arp | `strings` | 3.4 | -21 | - |+| kick | `kick` | -2.4 | -16 | - |+| snare | `snare` | -2 | -24 | - |+| ghost | `snare` | -4 | - | - |+| hat | `hat` | 6 | -32 | - |+| perc | `fmBell` | -8 | - | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: aeolian, harmonicMinor, lydian, major, phrygian, dorian. Qualities: open fifths, add9, sus2/sus4, minor with a major IV; chromatic mediants (C to E, C to Ab) for awe. Tendencies: slow harmonic rhythm (1-2 bars per chord); i-bVI-bVII-i for epic, i-iv-V for drama, lydian II for wonder, a pedal bass under moving chords for tension; big arrivals on chromatic mediants. Harmonic rhythm: one chord per 1-2 bars; tension sections hold one chord over an ostinato. Voicing: spread wide: bass octaves below C3, open fifths, the melody doubled an octave on the climax (stagger the bass to keep peaks musical). Tension and release: minor seconds against a pedal, a b6 leaning to 5, suspended 4ths held long, harmonic minor's raised 7th; release to a major chord or a picardy third.+- **Melody.** Range G3-C6 (strings), harp and bell above. Contour: long arcs over 4-8 bars, a big leap (6th, octave) then stepwise fall. Density: 0.5-2 notes per beat; tension ostinatos 2-4 per beat. Motif: a 3-4 note idea that returns transformed: augmented (slower) at the climax, in the bass for menace, in the harp for tenderness.+- **Arrangement.** intro (a colour, a drone) -> theme -> swell/build -> climax on the key picture beat -> release -> quiet coda. Transitions: crescendo over 4-8 bars; a breath of silence before the arrival; a low boom on the downbeat. Endings: a held chord ringing into the tail, or a hard-out on the cut.+- **Grooves:** pulse, tension, build, halfTime. **Avoid:** more than four families at once outside the climax; fast drums under a tender theme.++## `ambient`: airy ambient++floating, spacious, luminous: long pads, bells and plucks with space around them, a soft heartbeat at most. Tempo 50-80 bpm, meters 4/4, 3/4, swing 0.5-0.5.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `warmPad` | 1.5 | -19 | - |+| lead | `fmBell` | 1.3 | -20 | pluck, vibes |+| counter | `softPluck` | 6.8 | -25 | - |+| bass | `sub` | -8.3 | -22 | - |+| arp | `celesta` | -0.9 | -24 | - |+| kick | `kick` | -6.4 | -20 | - |+| ghost | `snare` | -6 | - | - |+| hat | `hat` | 6 | -32 | - |+| perc | `hat` | 4 | - | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: lydian, major, dorian, majorPentatonic, aeolian. Qualities: maj7, add9, maj7#11, sus2, quartal stacks (4ths). Tendencies: two-chord oscillations (I-II lydian, i-IV dorian), planing (the same shape moved by step), a pedal note held through changes. Harmonic rhythm: slow: one chord per 2-4 bars. Voicing: wide and open, high register, no thirds low; let voices ring. Tension and release: a #11 or a 9 against the root; release by the melody settling on the fifth or the root.+- **Melody.** Range C5-C7 bells, pluck echoes above. Contour: sparse, falling phrases of 2-5 notes; rests as long as the notes. Density: 0.25-1 note per beat, but a motif at least every 8 bars (the ghost guard). Motif: a 3-note bell figure that returns, echoed by the pluck at a new register.+- **Arrangement.** slow evolution: add one layer every 4-8 bars, take one away before the end. Transitions: crossfades; a pad change on a bar line. Endings: the motif once more, alone, into the tail.+- **Grooves:** pulse, brushes. **Avoid:** formlessness: sustained pads with no onsets and no cadence (the ghost failure); run the guards.++## `folk`: tender acoustic++intimate and warm: fingerpicked guitar, soft piano, a harp or celesta line, brushes. Tempo 60-110 bpm, meters 6/8, 3/4, 4/4, swing 0.5-0.54.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `piano` | 7 | -33 | strings |+| arp | `guitar` | 8 | -22.9 | - |+| lead | `harp` | 14 | -18.8 | piano, guitar, strings |+| counter | `celesta` | 8.2 | -24 | - |+| bass | `bass` | -4.4 | -21 | - |+| kick | `kick` | -4.5 | -20 | - |+| snare | `snare` | -6 | -26 | - |+| ghost | `snare` | 3.4 | -28 | - |+| hat | `hat` | 2 | -30 | - |+| perc | `hat` | 14 | -35.8 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: major, mixolydian, dorian, majorPentatonic, aeolian. Qualities: triads, add9, sus2, slash chords with a walking bass (I - V/7 - vi). Tendencies: I-V/7-vi-IV descents, bVII-IV-I (mixolydian), plagal IV-I endings, a relative minor detour. Harmonic rhythm: one chord per bar in 6/8 or 3/4; two per bar in 4/4. Voicing: guitar-shaped: root-fifth-tenth, open strings ringing; piano in the middle, melody on top. Tension and release: a suspended 4th resolving, a IV minor (iv) borrowed for the ache; release plagal (IV-I).+- **Melody.** Range D4-G5, singable (a 10th at most). Contour: stepwise with one leap per phrase, rising question, falling answer. Density: 1-2 notes per beat, a held note at each phrase end. Motif: a singable 4-bar phrase; the answer repeats its start and changes its end.+- **Arrangement.** guitar alone -> + melody -> + piano and bass -> + counter line -> thin to guitar and melody for the end. Transitions: a pickup note into each phrase; a bar of guitar alone between verses. Endings: plagal cadence, a rolled final chord.+- **Grooves:** brushes, pulse, shuffle. **Avoid:** four-on-the-floor, heavy drums, synth pads, fast arpeggios that bury the melody.++## `playful`: playful / bouncy++light, cheeky, springy: marimba and pizzicato-like plucks, a bouncy bass, a skipping kit. Tempo 100-150 bpm, meters 4/4, 6/8, swing 0.5-0.6.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| lead | `marimba` | 4.1 | -16 | chip, pluck, bell |+| chords | `vibes` | -4.3 | -22 | - |+| arp | `harp` | 8 | -22.4 | - |+| counter | `celesta` | 10 | -23 | - |+| bass | `bass` | -1.6 | -18 | tuba |+| kick | `kick` | 0.3 | -15 | - |+| snare | `snare` | 8.1 | -21 | - |+| ghost | `snare` | 0 | -26 | - |+| hat | `hat` | 22.2 | -28 | - |+| perc | `hat` | 19.7 | -29 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: major, mixolydian, majorPentatonic, lydian, blues. Qualities: triads and 6ths, dominant 7ths, chromatic passing chords (a diminished between I and ii). Tendencies: fast harmonic rhythm (2 chords a bar), I-vi-ii-V turnarounds, secondary dominants (V/V), a surprise bVI. Harmonic rhythm: two chords per bar, on-beat stabs. Voicing: close, mid-high; the bass bounces root-fifth (oom-pah) or walks. Tension and release: a chromatic approach note, a held dominant with a pause; release with a cheeky button.+- **Melody.** Range C4-C7 (mallets love the top). Contour: leaps and staccato repeated notes; zig-zags; grace-note slides. Density: 2-4 notes per beat, with sudden rests (comic timing). Motif: a 3-note staccato cell with a leap; answer it lower, then sequence it.+- **Arrangement.** short sections (4-8 bars), stop-time breaks, call and response between lead and counter. Transitions: a stop (all out for a beat), a drum fill, a key lift. Endings: a button: a short tutti hit on 1, sometimes after a comic pause.+- **Grooves:** skip, shuffle, bounce, fourFloor. **Avoid:** long pads, slow tempo, minor-key sustained melodies.++## `musicBox`: music box++small, bright, clockwork, innocent; plucked and never sustained. Tempo 100-132 bpm, meters 12/8, 3/4, 6/8, swing 0.5-0.5.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| lead | `musicBox` | 3.5 | -16 | celesta, bell |+| arp | `musicBox` | -6 | -26 | - |+| bass | `musicBox` | -3 | -24 | - |+| counter | `bell` | 0.3 | -22 | - |+| chords | `celesta` | -5.3 | -27 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: major, lydian, dorian, aeolian, majorPentatonic. Qualities: triads and sus2; a minor music box is a real (and uncanny) sound. Tendencies: any functional progression you write; plagal and deceptive turns read well; a whole-step lift for the payoff. Harmonic rhythm: one chord per bar. Voicing: melody C5-C7, bass C3-G3, arpeggio figures in between (you choose the figure). Tension and release: an unresolved 4th or a borrowed iv; release on a clean tonic.+- **Melody.** Range C5-C7. Contour: hooky, skipping. Density: more notes, never longer notes (no sustain). Motif: a 3-5 note hook with a distinctive rhythm; restate it, answer it.+- **Arrangement.** melody -> +bass -> +arpeggio -> +octave sparkle -> bell on the final downbeat. Transitions: add a layer each phrase. Endings: a bell or a single plucked tonic.+- **Grooves:** none. **Avoid:** sustained pads, long reverb tails, slow attacks (the ghost failure); see styles/music-box.md for the old recipe's numbers.++## `nocturne`: nocturne / solo piano++intimate, expressive, late-night: one piano, rubato, pedal. Tempo 50-76 bpm, meters 3/4, 6/8, 4/4, swing 0.5-0.5.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| lead | `piano` | 12 | -17 | - |+| chords | `piano` | 12 | -30.3 | - |+| bass | `piano` | 6.3 | -23 | - |+| counter | `strings` | 2 | -30 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: major, aeolian, harmonicMinor, dorian. Qualities: triads, 7ths, secondary dominants, borrowed iv, Neapolitan for grief. Tendencies: descending bass lines, circle-of-fifths sequences, deceptive V-vi before the last cadence. Harmonic rhythm: one chord per bar, two at cadences. Voicing: left hand broken chords spanning a 10th, no close thirds below C3. Tension and release: suspensions (4-3, 9-8), appoggiaturas on strong beats.+- **Melody.** Range C4-C6. Contour: arch per phrase, peak about 2/3 through. Density: 0.5-2 notes per beat. Motif: a leap then stepwise return; transform it (octave up, in the bass) at the climax.+- **Arrangement.** intro -> theme (question, answer) -> build -> hush -> coda. Transitions: a breath (caesura) before a sudden hush. Endings: a rolled tonic into the pedal.+- **Grooves:** none. **Avoid:** octaves in both hands on one downbeat (peaks); a compressor.++## `minimalist`: minimalist / pulse++hypnotic, curious, clean: interlocking ostinatos that change slowly. Tempo 96-144 bpm, meters 4/4, 12/8, 5/4, 7/8, swing 0.5-0.5.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| arp | `marimba` | -0.5 | -20 | piano, pluck |+| lead | `marimba` | 3.1 | -17 | - |+| bass | `marimba` | -4.9 | -21 | - |+| counter | `vibes` | 3.7 | -27 | - |+| chords | `piano` | 4 | -37.1 | - |+| kick | `kick` | -6 | - | - |+| ghost | `snare` | -6 | - | - |+| perc | `hat` | 0 | - | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: dorian, lydian, aeolian, major, mixolydian. Qualities: open 5ths, add9, quartal stacks. Tendencies: a two-chord cycle for 8-16 bars, then one note changes. Harmonic rhythm: slow; the ostinato is the rhythm. Voicing: mid-register, interlocking; no doubled roots. Tension and release: phase shifts, added beats, a new bass note under the same pattern.+- **Melody.** Range C4-C6. Contour: cells, not tunes. Density: 2-4 onsets per beat in the ostinato. Motif: a 5-8 note cell; change ONE thing every 8-16 bars (add, drop, rotate).+- **Arrangement.** additive: one layer at a time. Transitions: a change at least every 16 bars. Endings: subtractive, or a hard stop.+- **Grooves:** pulse. **Avoid:** a big climax; a change more often than every 4 bars.++## `jazz`: jazz / swing++loose, warm, clever: swing ride, walking bass, comping piano. Tempo 80-200 bpm, meters 4/4, 3/4, swing 0.6-0.67.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `piano` | 8 | -32.5 | - |+| lead | `vibes` | 3.8 | -16 | piano, clarinet, flute, brass |+| bass | `bass` | -1.3 | -18 | - |+| counter | `woodwind` | 8.5 | -21 | - |+| kick | `kick` | -0.2 | -24 | - |+| snare | `snare` | 0 | -26 | - |+| ghost | `snare` | 7.5 | -28 | - |+| hat | `hat` | 21 | -26 | - |+| perc | `hat` | 18 | -30 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: major, dorian, mixolydian, melodicMinor, blues. Qualities: 7ths required; 9ths, 13ths, altered dominants (7b9, 7#11). Tendencies: ii-V-I, iii-VI-ii-V turnarounds, tritone substitutions, backdoor bVII7-I. Harmonic rhythm: two chords a bar at turnarounds. Voicing: rootless shell voicings (3-7, 7-3) in the middle; the walking bass owns roots. Tension and release: altered dominants, chromatic approach chords; release on a 6/9 or maj7.+- **Melody.** Range A3-C6. Contour: bebop lines: chord tones on beats, approach notes between. Density: swung 8ths with rests. Motif: a riff restated over changing chords (the chords change under it).+- **Arrangement.** head (theme) -> solos -> head out. Transitions: a 2-bar break, trading 4s. Endings: a tag (the last 2 bars three times) or a ritard on a 6/9.+- **Grooves:** swing, brushes, shuffle. **Avoid:** straight 8ths, triads only.++## `lullaby`: lullaby++soft, rocking, safe. Tempo 56-78 bpm, meters 3/4, 6/8, swing 0.5-0.5.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| lead | `celesta` | 5.3 | -17 | musicBox, piano, flute |+| arp | `harp` | 4 | -28.3 | - |+| bass | `harp` | 6 | -26 | - |+| counter | `musicBox` | 4 | -31.7 | - |+| chords | `strings` | -8.5 | -28 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: major, majorPentatonic, mixolydian. Qualities: triads, add9, sus2. Tendencies: I-IV-I rocking, plagal cadences, a gentle ii. Harmonic rhythm: one chord per bar. Voicing: close, mid-high. Tension and release: almost none; a minor lullaby is flagged for the human check (tips into eerie).+- **Melody.** Range C4-C6. Contour: rocking stepwise, falling phrase ends. Density: 1-2 notes per beat. Motif: a 2-bar rocking figure repeated with a changed ending.+- **Arrangement.** melody + gentle arpeggio, nothing percussive. Transitions: none needed. Endings: the tonic, soft, rolled.+- **Grooves:** none. **Avoid:** drums, surprise, bright highs.++## `chiptune`: chiptune++8-bit, bright, game-like: two pulses, a triangle, noise drums. Tempo 110-170 bpm, meters 4/4, 6/8, swing 0.5-0.56.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| lead | `pulse` | 7.4 | -16 | square |+| arp | `pulse` | 7 | -23.1 | - |+| bass | `triangle` | 0.2 | -18 | - |+| kick | `noiseDrum` | 7.6 | -18 | - |+| snare | `noiseDrum` | 6.7 | -20 | - |+| hat | `noiseDrum` | -10 | -28 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: major, aeolian, dorian, mixolydian. Qualities: triads; chords are faked by fast arpeggios. Tendencies: I-vi-IV-V, i-bVI-bVII, key changes up a step. Harmonic rhythm: one chord per bar. Voicing: arpeggio 16ths across an octave. Tension and release: a held dominant arpeggio, a pitch-bend-free chromatic climb.+- **Melody.** Range C4-C7. Contour: hooky, leaping. Density: 8ths and 16ths. Motif: a 1-bar hook, answered, sequenced.+- **Arrangement.** 4 voices max: lead, arp, triangle bass, noise. Transitions: a drum fill, a key change. Endings: a fanfare button.+- **Grooves:** fourFloor, bounce, shuffle, skip. **Avoid:** reverb, more than 4 voices, pads.++## `lofi`: dusty lo-fi hip-hop++hazy, nostalgic, crackly: FM e-piano, vinyl, a lazy swung beat (the dusty cousin of lo-fi electronic). Tempo 68-90 bpm, meters 4/4, swing 0.55-0.62.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `ePiano` | 5.2 | -20 | - |+| lead | `ePiano` | 7.5 | -17 | guitar, flute |+| bass | `bass` | -2.1 | -19 | - |+| counter | `fmBell` | 4 | -30.1 | - |+| kick | `kick` | -2.6 | -17 | - |+| snare | `snare` | 6.2 | -22 | - |+| ghost | `snare` | 6 | -27.1 | - |+| hat | `hat` | 4 | -43 | - |+| perc | `hat` | 4 | -29 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: major, dorian, aeolian. Qualities: maj9, m9, 13, m11. Tendencies: 2-4 chord loops, ii-V drifts. Harmonic rhythm: 1-2 chords a bar. Voicing: e-piano 4-note voicings. Tension and release: a borrowed iv.+- **Melody.** Range C4-C6. Contour: lazy, behind the beat. Density: sparse. Motif: a 2-bar sampled-sounding phrase.+- **Arrangement.** 4 or 8 bar loop with variations. Transitions: a filter or a drop-out. Endings: fade or tape stop.+- **Grooves:** bounce, halfTime, shuffle. **Avoid:** using it when the brief says clean or upbeat (then use lofiElectronic).++## `orchestral`: orchestral / epic++big and heroic: brass theme, string ostinato engine, choir, timpani. Tempo 70-140 bpm, meters 4/4, 3/4, 6/8, swing 0.5-0.5.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| lead | `brass` | 9.2 | -16 | strings, horn, flute |+| chords | `strings` | -0.4 | -19 | - |+| arp | `strings` | 4.4 | -20 | - |+| bass | `strings` | 0.9 | -19 | - |+| counter | `choir` | -1.7 | -22 | flute, harp |+| perc | `timpani` | 4.2 | -17 | - |+| kick | `kick` | -3.3 | -17 | - |+| snare | `snare` | 5.2 | -24 | - |+| hat | `hat` | 4 | -32 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: major, aeolian, dorian, mixolydian, harmonicMinor. Qualities: triads and power 5ths, sus4 resolving, major IV in minor. Tendencies: i-bVI-bIII-bVII, I-bVII-IV-I (mixolydian heroism), chromatic mediants for arrivals, a pedal under the build. Harmonic rhythm: one chord per 1-2 bars, faster into cadences. Voicing: brass in the middle in 3rds and 5ths, strings octaves above, bass in octaves. Tension and release: a long dominant pedal with the ostinato rising, sus4 held; release to the tonic major with everything.+- **Melody.** Range brass G3-C5 (heroic), strings up to A6. Contour: a rising 4th or 5th then steps; big arcs. Density: long notes over a busy ostinato. Motif: a fanfare cell (rising 4th/5th + rhythm) developed: fragment it in the build, augment it at the climax.+- **Arrangement.** intro (ostinato alone) -> theme (strings) -> theme (brass) -> build -> tutti climax -> quiet coda. Transitions: timpani roll or snare build into downbeats; a bar of silence before the last statement. Endings: a big held chord with timpani, or a hard cut.+- **Grooves:** epic, build, tension, pulse. **Avoid:** all families at once all the time; a brass lead above C6.++## `suspense`: suspense / horror++unsettling, cold, withheld: low drones, heartbeat pulse, high bowed harmonics, stingers. Tempo 50-110 bpm, meters 4/4, 5/4, 3/4, swing 0.5-0.5.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `strings` | -0.8 | -21 | - |+| bass | `sub` | -6.1 | -20 | - |+| lead | `bowedSolo` | 7.3 | -19 | choir, cello |+| counter | `celesta` | 8 | -27 | choir, bell |+| arp | `strings` | 2.7 | -22 | - |+| kick | `kick` | -3.4 | -17 | - |+| ghost | `snare` | -4 | -27 | - |+| perc | `timpani` | 8.4 | -18 | - |+| hat | `hat` | 0 | -32 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: phrygian, locrian, harmonicMinor, wholeTone, aeolian. Qualities: clusters, minor 2nds, tritones, minor-major 7th, augmented triads. Tendencies: a pedal that never resolves, chromatic crawl up or down by semitone, i-bII (phrygian), sudden major chord a tritone away. Harmonic rhythm: static: one sound for 4-8 bars, then a jolt. Voicing: very low and very high with an empty middle. Tension and release: withhold resolution; a stinger (all voices, one hit) on the scare; silence right before it.+- **Melody.** Range extremes: below C3 or above C6. Contour: a 2-3 note cell, often a semitone. Density: sparse, irregular. Motif: a semitone sigh or a tritone leap, repeated slower each time.+- **Arrangement.** drone -> pulse enters -> rising ostinato -> stinger on the hit -> silence -> aftermath drone. Transitions: cut to silence; a slow crescendo that stops short. Endings: unresolved: a held cluster, or a single low hit.+- **Grooves:** pulse, tension, epic. **Avoid:** a major cadence, melody in the middle register, busy drums.++## `rock`: rock / band++live-band energy: driven guitars, bass locked to the kick, a tight kit, maybe organ. Tempo 90-160 bpm, meters 4/4, 6/8, swing 0.5-0.52.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `strings` | -0.9 | -19 | organ, piano |+| lead | `leadSynth` | 9.9 | -16 | guitar |+| bass | `bass` | -0.8 | -17 | - |+| counter | `organ` | 6 | -30.4 | - |+| kick | `kick` | 1.2 | -13 | - |+| snare | `snare` | 11.2 | -17 | - |+| ghost | `snare` | 0 | -26 | - |+| hat | `hat` | 20.6 | -27 | - |+| perc | `hat` | 17 | -26 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: mixolydian, aeolian, major, blues, dorian. Qualities: power chords (root-5th-octave), triads, sus4. Tendencies: I-bVII-IV, i-bVI-bVII, riffs on the pentatonic, a chorus a 4th up. Harmonic rhythm: one chord per bar in verses, two in choruses. Voicing: power chords low (E2-E4), the bass doubling the root in 8ths. Tension and release: a riff held on the V, a stop before the chorus.+- **Melody.** Range E3-A5. Contour: riff-based, pentatonic, strong beats. Density: 8ths. Motif: a 1-2 bar riff that IS the song; the vocal-like lead answers it.+- **Arrangement.** riff intro -> verse -> pre -> chorus -> verse -> chorus -> bridge -> chorus x2. Transitions: a drum fill and a crash into every section. Endings: a big held last chord with a fill, or a stop on 1.+- **Grooves:** rock, halfTime, shuffle, fourFloor. **Avoid:** swing, soft attacks, long pads; the guitar tone here is an approximation: say so.++## `hipHop`: hip-hop / trap++head-nod or dark trap: heavy 808, crisp clap, rolling hats, a moody loop on top. Tempo 70-100 bpm, meters 4/4, swing 0.52-0.6.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| bass | `sub` | -2.5 | -15 | - |+| chords | `piano` | 6 | -36.8 | pad |+| lead | `softPluck` | 2.7 | -18 | bell, flute, choir |+| counter | `strings` | 4 | -29.2 | - |+| kick | `kick` | 1.4 | -13 | - |+| snare | `snare` | 10.2 | -18 | - |+| ghost | `snare` | 0 | -26 | - |+| hat | `hat` | 23.6 | -26 | - |+| perc | `hat` | 19.9 | -29 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: aeolian, phrygian, harmonicMinor, dorian. Qualities: minor triads, m7, dim, a single dark chord for 2 bars. Tendencies: 2-chord minor loops, i-bVI, i-bII (phrygian menace), a melody over one chord. Harmonic rhythm: one chord per 1-2 bars. Voicing: piano or bells high, the 808 low with nothing between. Tension and release: the 808 sliding or dropping out; a switch-up after 8 bars.+- **Melody.** Range C4-C6. Contour: short repeated figures. Density: sparse over busy hats. Motif: a 1-2 bar loop that repeats (the loop is the hook); vary it every 8 bars.+- **Arrangement.** intro (loop alone) -> 8-bar blocks with drops, switch-ups -> outro loop. Transitions: drop the drums for a bar, a hat roll into the downbeat. Endings: the loop alone, or a cut.+- **Grooves:** trap, bounce, halfTime, broken. **Avoid:** an 808 that owns everything below 150 Hz with no harmonics (phones): check stems.++## `house`: house / EDM++euphoric, dancing, bright: four-on-the-floor, offbeat bass, stabs, a big pad. Tempo 118-128 bpm, meters 4/4, swing 0.5-0.54.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `organ` | 5.2 | -21 | pad, piano |+| bass | `bass` | 0.3 | -16 | - |+| lead | `softPluck` | 4.3 | -17 | synth |+| counter | `warmPad` | 6.9 | -23 | - |+| arp | `softPluck` | 4.5 | -22 | - |+| kick | `kick` | 2.6 | -12 | - |+| snare | `snare` | 10.7 | -18 | - |+| ghost | `snare` | 1 | -26 | - |+| hat | `hat` | 12 | -26 | - |+| perc | `hat` | 18.3 | -27 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: aeolian, dorian, major, mixolydian. Qualities: m7, m9, maj7 stabs; piano house triads. Tendencies: i-VI-III-VII, vi-IV-I-V, 2-chord dorian vamps; a long pedal in the build. Harmonic rhythm: one chord per bar or per 2 bars; stabs on offbeats. Voicing: stabs mid-register, the bass on the offbeat 8th. Tension and release: filter build + snare build + one beat of silence; release = the drop.+- **Melody.** Range C4-C6. Contour: repetitive riffs. Density: 8ths and 16ths. Motif: a 1-bar riff repeated 4-8 times with one change.+- **Arrangement.** intro (kick + hats) -> groove -> breakdown (pad + motif) -> build -> drop -> outro (kick). Transitions: 16- or 32-bar blocks; builds of 8. Endings: DJ-friendly: strip back to kick and hats.+- **Grooves:** fourFloor, build, broken. **Avoid:** swing, busy harmony, a quiet drop.++## `synthwave`: synthwave / retro++neon-nostalgic, cinematic 80s: big gated snare, pulsing 8th bass, lush pads, a soaring lead. Tempo 80-118 bpm, meters 4/4, swing 0.5-0.5.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `strings` | -2.1 | -21 | pad |+| bass | `bass` | -0.3 | -17 | - |+| lead | `leadSynth` | 11.7 | -16 | brass |+| arp | `softPluck` | 4.1 | -22 | - |+| counter | `fmBell` | 4 | -29.1 | - |+| kick | `kick` | 1.4 | -13 | - |+| snare | `snare` | 11.7 | -17 | - |+| ghost | `snare` | 0 | -26 | - |+| hat | `hat` | 12 | -28 | - |+| perc | `hat` | 16.2 | -29 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: aeolian, dorian, major, lydian. Qualities: minor triads, add9, maj7, sus2. Tendencies: i-bVI-bIII-bVII, vi-IV-I-V, a lydian II for the neon lift. Harmonic rhythm: one chord per bar. Voicing: wide pads, bass in driving 8ths on the root. Tension and release: a long build on the V with the arp rising; release with the gated snare.+- **Melody.** Range A3-E6. Contour: soaring, long notes with glide. Density: long lead notes over a busy arp. Motif: a 2-bar singable lead phrase, stated then lifted an octave.+- **Arrangement.** pad intro -> bass + drums -> lead theme -> breakdown -> lead an octave up -> outro pad. Transitions: a tom-like fill (build), a drop-out bar. Endings: the pad alone, long tail.+- **Grooves:** fourFloor, halfTime, rock, build. **Avoid:** trap hats, acoustic instruments, a dry mix.++## `world`: world / modal folk++rooted, spacious, rhythmic: a drone, a modal melody on plucked strings or a flute, hand percussion cycles (write your own melody; name the tradition you draw on). Tempo 60-150 bpm, meters 7/8, 9/8, 12/8, 6/8, 4/4, 5/4, swing 0.5-0.56.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| lead | `woodwind` | 8.7 | -16 | pluck, marimba, reed, bowed |+| counter | `harp` | 10 | -38.1 | - |+| arp | `guitar` | 8 | -24.2 | - |+| chords | `warmPad` | -3.1 | -25 | - |+| bass | `sub` | -9.6 | -22 | - |+| kick | `timpani` | 0.3 | -17 | - |+| ghost | `snare` | 9.5 | -24 | - |+| perc | `hat` | 8 | -28 | - |+| hat | `hat` | 6 | -30 | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: dorian, phrygian, mixolydian, aeolian, majorPentatonic, minorPentatonic, harmonicMinor. Qualities: a drone (tonic + 5th) more than chords; modal colour chords sparingly. Tendencies: modal: stay on the tonic drone, move the melody through the mode; a second drone a step away for contrast. Harmonic rhythm: the percussion cycle carries it; harmony changes rarely. Voicing: open 5ths, the drone low and wide. Tension and release: the mode's colour note held against the drone; release on the tonic.+- **Melody.** Range a 10th around the drone. Contour: ornamented steps (grace notes, turns), phrases that return to the drone note. Density: flowing 8ths and 16ths with long held notes. Motif: a modal phrase that grows by adding ornaments on repeats.+- **Arrangement.** drone alone -> melody free -> percussion enters -> faster, denser -> return to the drone. Transitions: an accelerando, a percussion break. Endings: the melody alone on the tonic over the drone.+- **Grooves:** hand, pulse, brushes. **Avoid:** copying a traditional melody; Western functional cadences everywhere.++## `choral`: choral / sacred++vast, human, reverent: voices in parts, organ, bells, a slow swell. Tempo 50-90 bpm, meters 4/4, 3/4, swing 0.5-0.5.++| Slot | Voice | Gain dB | Stem target dB | Alternates |+|---|---|---|---|---|+| chords | `choir` | -9.9 | -19 | organ, strings |+| lead | `choir` | -3.1 | -17 | bowed, flute |+| bass | `organ` | 8 | -21 | - |+| counter | `fmBell` | 4 | -30.5 | - |+| arp | `harp` | 6 | -26.3 | - |+| perc | `timpani` | 5.5 | -20 | - |+| kick | `timpani` | -6 | - | - |++Stem targets: starting numbers from a neutral test signal (advisory until a human listens).++- **Harmony language.** Modes: major, aeolian, dorian, lydian. Qualities: triads in 4 parts, suspensions, the picardy third. Tendencies: chorale motion: I-IV-V-I, vi-IV-I-V, plagal amen (IV-I), deceptive V-vi before the final cadence. Harmonic rhythm: one chord per beat or per half bar (chorale), slower in swells. Voicing: SATB spacing: no gaps wider than an octave between upper voices, bass free; avoid parallel 5ths. Tension and release: 4-3 suspensions, a held dominant; release on a plagal amen.+- **Melody.** Range C4-G5 (singable). Contour: stepwise, phrase-shaped like breath. Density: 1 note per beat or slower. Motif: a hymn-like phrase whose cadence changes each time.+- **Arrangement.** a single voice -> full parts -> a swell -> a hush -> the final chord. Transitions: a fermata (breath) between phrases. Endings: a plagal amen or a picardy third, long tail.+- **Grooves:** pulse. **Avoid:** fast rhythms, drums, choir as a lead above G5.