Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

Sound guides: music is composed for the cut, never a default bed, and every vetted source is one page away.

shinyobjectze946a5a0d747
diff --git a/sdk/guides/craft/bevy/games.md b/sdk/guides/craft/bevy/games.md
index f0ceb91c..27270a1f 100644
--- a/sdk/guides/craft/bevy/games.md
+++ b/sdk/guides/craft/bevy/games.md
@@ -236,10 +236,12 @@ function Hop() {
registerRoot(() => <Composition id="hop3d" component={Hop} width={1280} height={720} fps={30} durationInFrames={FRAMES} />);
```
-## Sound: one-shots on transitions, a bed under the voice
+## Sound: one-shots on transitions, music ducked under the voice
-A game's sound is Tone.js on raea (`motion/music` has the whole of it). Build the instruments at the top level, give
-the bed and the sounds their buses, and fire each one-shot on the frame its event happens:
+A game's sound is Tone.js on raea (`motion/music` has the whole of it). Every input and outcome gets a sound, the
+world's own sounds (machines, footsteps, a room's tone) sit where they are, and music, when the game has some, is a
+loop written to come round, not a pad. Build the instruments at the top level, give the music and the sounds their
+buses, and fire each one-shot on the frame its event happens:
- `useGameEvents(INITIAL, fold, (before, after) => machine.state(after.hero) === "land" && machine.state(before.hero) !== "land")`
gives the frames where a transition happened. `<Tone.Sfx when={landings.includes(frame)} play={(t) => thump.triggerAttackRelease("C2", "8n", t)} />`
diff --git a/sdk/guides/craft/floor.md b/sdk/guides/craft/floor.md
index 7e93c92b..120ac9ff 100644
--- a/sdk/guides/craft/floor.md
+++ b/sdk/guides/craft/floor.md
@@ -61,6 +61,8 @@ direction asks for it by name, and the direction then says why in a line.
- **Template captions.** White bold text with one yellow word, an emoji pop, a zoom on every sentence, a whoosh on
every entrance.
- **The same move everywhere.** One entrance, one zoom or one sound on every beat makes every beat weaker.
+- **Music by default.** A bed under every second, or a held pad and drone standing in for a score. Decide what each
+ scene is heard as, and compose what it needs (`motion/music`).
- **Copy that sounds like an ad.** Buzzwords, "Not X. Y." cadences, aphorisms, a label above every headline.
## Never
diff --git a/sdk/guides/craft/modes/story.md b/sdk/guides/craft/modes/story.md
index db6a9d91..2c7c43f8 100644
--- a/sdk/guides/craft/modes/story.md
+++ b/sdk/guides/craft/modes/story.md
@@ -33,8 +33,9 @@ they want the whole film.
moves. The easy default is choosing a look shot by shot from references, and that ends up as several films.
- **Each shot's subject.** Choose the person, object or action each shot is about. The easy default is a wide
establishing shot, so question every one.
-- **What the music does.** It either leads, and you cut to its map, or it sits under the picture as a score. The easy
- default is a cut on every bar.
+- **What the music does.** It either leads, and you cut to its map, or it scores the picture, written to the cut, or a
+ scene has none and belongs to its own sound or to silence. The easy defaults are a cut on every bar and a score
+ that is one held chord.
- **The poster frame.** Choose it before anything renders, and build the edit toward it.
## The rut
diff --git a/sdk/guides/craft/motion.md b/sdk/guides/craft/motion.md
index bdb59fd1..7db8c5cf 100644
--- a/sdk/guides/craft/motion.md
+++ b/sdk/guides/craft/motion.md
@@ -18,7 +18,8 @@ Read the files a task needs with `raea guide motion/NAME`, one or two at a time,
| planning how shots cut into each other: hooks on the thirds, the eye carried through each cut | `motion/match-cuts` |
| moving anything: entrances, exits, counters, push-ins | `motion/animating` |
| cutting takes, framing a face, trimming, clip sound | `motion/footage` |
-| music beds, foley, gains, fades, the master | `motion/sound` (the music itself: `motion/music`) |
+| what each scene is heard as, effects and foley, gains, fades, the master | `motion/sound` (the music itself: `motion/music`) |
+| where sounds come from: the local models and their setup, sample libraries, effect packs, MIDI | `motion/sources` |
| captions, or anything cued to what someone says | `motion/words` |
| putting parts over a face, platform zones, the proof | `motion/placement` |
| cards, stacks, type sizes, fonts | `motion/layout` |
@@ -63,9 +64,11 @@ Read the files a task needs with `raea guide motion/NAME`, one or two at a time,
(`text-brand-accent`, `bg-brand-surface`, `font-brand`, `text-title`, `rounded-brand` and the rest in AGENTS.md),
or `var(--brand-*)` where a class can't reach. Never write a hex palette of your own. A role the kit leaves empty
is yours to decide from the brand's own colours (`motion/brand`).
-8. **Sound is part of the edit.** Each sound goes in its own `<Sequence from layout="none">`. Use `gainDb` for
- levels, Tone.js for music (`motion/music`: TokenSynth or sample-library instruments in a Sampler) and `sao()` for
- foley, and put one `<Mix lufs={-14} />` in the composition. Put the sounds in the tree in time order.
+8. **Sound is part of the edit.** Decide what each scene is heard as (silence, its own sound, source music, score,
+ effects) before placing any; music is composed for the cut, never a bed by default. Each sound goes in its own
+ `<Sequence from layout="none">`. Use `gainDb` for levels, Tone.js for music (`motion/music`: sample-library or
+ TokenSynth instruments in a Sampler, playing a motif, chords that move and a rhythm) and `sao()` for foley, and
+ put one `<Mix lufs={-14} />` in the composition. Put the sounds in the tree in time order.
9. **Keep animated styles present on every frame.** The engine keeps a style property that React stops sending.
Write `transform: scale(1)` and `opacity: 1` rather than leaving them out when an animation settles. Always set
`fontFamily`, because the engine's default face is a serif.
@@ -80,13 +83,18 @@ unreadable text, the wrong loudness) and bans (invented claims, generated imager
## A whole composition, small
```tsx
-import { AbsoluteFill, Composition, Easing, Mix, Sequence, Audio, interpolate, registerRoot, sao, useCurrentFrame, useVideoConfig } from "raea";
+import { AbsoluteFill, Composition, Easing, Mix, Sequence, Audio, interpolate, registerRoot, sao, staticFile, useCurrentFrame, useVideoConfig } from "raea";
import * as Tone from "raea/tone";
import { css } from "./styles.gen";
-// the bed: one TokenSynth instrument in a Sampler, a bar of notes on a loop (motion/music)
-const keys = new Tone.Sampler({ urls: Tone.tokensynth("a soft felt piano, warm, intimate", ["C3", "C4"], { seconds: 2 }), volume: -14 }).connect(Tone.buses.music);
-new Tone.Sequence((t, n) => keys.triggerAttackRelease(n, "4n", t), ["C4", "G3", "E4", "G3"], "4n").start(0);
+// the music: a chord on the title and a two-note lift after it, on a library piano (`raea sounds get
+// salamander/piano --notes C4,C5`); a sting, not a bed (motion/music)
+const piano = new Tone.Sampler({ urls: { C4: staticFile("sounds/salamander-piano/C4.mp3"), C5: staticFile("sounds/salamander-piano/C5.mp3") }, release: 1, volume: -10 }).connect(Tone.buses.music);
+new Tone.Part((t, n) => piano.triggerAttackRelease(n.notes, n.dur, t, n.vel), [
+ { time: "0:0", notes: ["C4", "E4", "G4", "C5"], dur: "2n", vel: 0.8 },
+ { time: "0:2", notes: ["D5"], dur: "8n", vel: 0.55 },
+ { time: "0:2:2", notes: ["E5"], dur: "4n", vel: 0.65 },
+]).start(0);
Tone.getTransport().start();
const WHOOSH = sao("soft airy whoosh, short, clean, no music", { seconds: 0.8 });
diff --git a/sdk/guides/craft/motion/assets.md b/sdk/guides/craft/motion/assets.md
index 8a063fa0..77c50122 100644
--- a/sdk/guides/craft/motion/assets.md
+++ b/sdk/guides/craft/motion/assets.md
@@ -15,7 +15,8 @@
and `Tone.tokensynth(timbre, notes)` for an instrument's notes in a `Tone.Sampler` (`motion/music`).
- Recorded instruments and drum hits come from the open sample libraries: `raea sounds WORDS` finds one, `raea sounds
get PACK/INSTRUMENT` copies its files into `media/sounds/PACK-INSTRUMENT/` with a `LICENCE.txt`, and prints the
- `staticFile` paths and the Sampler that plays them.
+ `staticFile` paths and the Sampler that plays them. Orchestras, drum kits, effect packs and MIDI grooves fetched by
+ hand, and how to set up SAO and TokenSynth, are in `motion/sources`.
- Show stills with `<Img src>`. The frame waits for the image to load, and a missing one fails the render, naming
`src`.
- Keep pictures real: the person's footage, stock already in the object's media, or things you build (components,
@@ -28,9 +29,9 @@ error and so is a URL (`https://...`). `staticFile` checks both. A module import
fails loudly with the line that has it instead of rendering a black clip.
Generated imagery is banned outright (floor): no AI-generated images or video, ever. Generated sound is allowed by
-policy, and made on this computer: TokenSynth for an instrument's notes (music), SAO for foley, Pocket TTS
-(`<Speech>`) for narration over the picture. The sample libraries are recordings under open licences (CC0, CC-BY, public domain);
-a CC-BY one is credited where the piece is shown.
+policy, and made on this computer: TokenSynth for an instrument's notes where no library has the timbre, SAO for
+foley, Pocket TTS (`<Speech>`) for narration over the picture. The sample libraries are recordings under open licences
+(CC0, CC-BY, public domain); a CC-BY one is credited where the piece is shown.
## Common mistakes
diff --git a/sdk/guides/craft/motion/music.md b/sdk/guides/craft/motion/music.md
index 7cf6ff9b..ff67003b 100644
--- a/sdk/guides/craft/motion/music.md
+++ b/sdk/guides/craft/motion/music.md
@@ -1,5 +1,26 @@
# Music and sound effects: Tone.js on raea (raea/tone)
+## Decide what the picture needs before writing a note
+
+Music is never a default. A bed under every second makes every piece sound like every other one, and a held pad or
+drone under a long reverb is what generated music sounds like. Before any instrument goes in:
+
+- Name what each stretch is heard as: silence; the scene's own sound (diegetic: footsteps, a room, a radio, a game's
+ machines, anything the people on screen could hear); source music (music playing in the scene); score (music only
+ the audience hears); effects; a voice. Several at once is fine, and none is a choice too: a pitch with a voice may
+ need only effects and a four-second sting on the end card. Write the decision in the storyboard or DIRECTION.md,
+ one line a scene.
+- Spot the cut the way a music editor does: number each cue (1m1, 1m2...) with the frame it starts on, the moments
+ it has to hit (the hook, a reveal, the logo), where it turns (where the edit changes idea) and where it stops. A
+ cue ends on a hit, the "button" (the last chord on the last cut or the logo), not on a fade. Half a bar of silence
+ before a reveal is what makes the reveal.
+- Take the tempo from the cut. Frames per beat = fps × 60 / bpm: at 30 fps, 12 frames at 150 bpm, 15 at 120, 20 at
+ 90. Pick the bpm that puts the main cuts on beats and the biggest on downbeats, or set it so they do
+ (`bpm.value = (bars * 4 * 60 * fps) / framesToTheCut`). Shots of 1 to 1.5 s suit 120 to 160 bpm; shots of 3 to 5 s
+ suit 70 to 100, or a half-time feel. With a song, cut to its map instead (`motion/timing`).
+- A sustained texture (a held pad, a drone, a reverb wash) goes in only when the scene asks for one by name ("dread",
+ "the ship's hum") and the direction says why in a line. Even then something over it moves.
+
## What to do
- Write music and sound effects in Tone.js, as its docs write them: `import * as Tone from "raea/tone"`, then
@@ -7,53 +28,100 @@
`Part`, `Sequence` and `Pattern`. What you know of Tone works; the differences are below. It's a DAW in code: a
track is an instrument and its effects into a bus, a clip is a `Part` or `Sequence`, the arrangement is where each
starts and stops on the Transport.
-- Make music from instruments, not from a generated track. Each instrument is a `Tone.Sampler`; fill it one of two
- ways, both local and free:
- - **TokenSynth** for an instrument described in words: `Tone.tokensynth("a warm upright bass, plucked", ["C2",
- "C3", "C4"], { seconds: 2 })` renders those root notes once on this computer, and the Sampler pitches between
- them. Describe the timbre the way you'd describe a patch ("a soft wooden marimba, felt mallet, warm"; "a bright
- analog synth lead, saw, short decay"). Three roots an octave apart cover a part; a note's `seconds` is how long
- it's held (under 5). Each root takes about 5 s to make the first time, then it's cached.
- - **A sample library** for a real recorded instrument: `raea sounds piano` searches the open libraries (the
- Salamander grand piano, the 128 General MIDI instruments, tonejs-instruments' orchestra, the Versilian library's
- orchestral, world and percussion instruments); `raea sounds get salamander/piano` copies its notes into
- `media/sounds/` and prints the `Sampler` that plays them. Drums and hits come as takes for `Tone.Player`s.
- - Tone's own synths (`Synth`, `PolySynth`, `MembraneSynth`, `MetalSynth`, `NoiseSynth`, `FMSynth`) are there for
- pads, kicks, risers and anything synthetic.
-- Make sound effects and foley with SAO: `Tone.sao("a bright arcade coin chime, short", { seconds: 1 })` in a
- Sampler or Player, or `sao(...)` in an `<Audio>` (`motion/sound`). Narration over the picture is
- `<Speech>` from `raea/speech` (Pocket TTS, local; `motion/sound`).
+- Make music from instruments playing notes, not from a generated track. Each instrument is a `Tone.Sampler` (a kit
+ is `Tone.Players`); fill it one of three ways:
+ - **A sample library** for a real instrument, first: `raea sounds cello` searches the open libraries raea carries
+ (the Salamander grand piano; FluidR3's 128 General MIDI instruments, every note; tonejs-instruments' strings,
+ brass, woodwinds and guitars; the Versilian library's keyboards, harps, mallets, drums and percussion), and
+ `raea sounds get tonejs-instruments/cello` copies its notes into `media/sounds/` and prints the `Sampler` that
+ plays them. Drums and hits come as takes for `Tone.Player`s. Whole orchestras, multi-velocity kits and drummers'
+ grooves are fetched by hand (`motion/sources`).
+ - **TokenSynth** for a timbre no library has: `Tone.tokensynth("a bowed saw, close, eerie", ["C3", "C4", "C5"],
+ { seconds: 2 })` renders those root notes once on this computer, and the Sampler pitches between them. Describe
+ the timbre the way you'd describe a patch ("a soft wooden marimba, felt mallet, warm"; "a bright analog synth
+ lead, saw, short decay"); a note's `seconds` is how long it's held (under 5). Its takes need curating (below).
+ - Tone's own synths (`Synth`, `PolySynth`, `MonoSynth`, `MembraneSynth`, `MetalSynth`, `NoiseSynth`, `FMSynth`) for
+ parts that are synthetic on purpose: an 808 kick, an analog bass, a chiptune lead, a riser.
+- Make sound effects and foley with SAO or a recorded pack: `Tone.sao("a bright arcade coin chime, short", { seconds:
+ 1 })` in a Sampler or Player, or `sao(...)` in an `<Audio>`, built in layers (`motion/sound`). Narration over the
+ picture is `<Speech>` from `raea/speech` (Pocket TTS, local; `motion/sound`).
- Build the graph at the top level of the file: every instrument, effect and channel, and how they connect. The graph
is the one the composition has when its first frame renders. Schedule notes with the Transport (or with explicit
times). Never trigger notes from inside a component's render: a game's one-shots go through `<Tone.Sfx>`.
+- Set the tempo before building any Part: a Part reads its times at the tempo when it's made.
- Time 0 is the composition's first frame. `Tone.now()` is 0 at the top level and the event's time inside a callback,
so `Tone.getTransport().start()` at the top level starts the music at frame 0. Every note lands on its own sample,
so a render and a play are the same.
- Route through the buses: `Tone.buses.music`, `.sfx`, `.voice`, `.ambience`, `.ui`. Connect Tone nodes to them, and
give `<Audio>` and `<Video>` a `bus="voice"` (or another bus) prop. Each bus is a Tone `Channel`: `volume`, `pan`,
`mute`, `solo`, `send`/`receive`.
-- Duck the bed under the voice with `Tone.buses.music.duck(Tone.buses.voice, { amount: -12 })`; do the same for
- ambience. Start at -10 to -14 dB, 40 ms attack and 300 to 400 ms release. Then listen.
+- Duck the music under the voice with `Tone.buses.music.duck(Tone.buses.voice, { amount: -12 })`; do the same for
+ ambience. Start at -10 to -14 dB, 40 ms attack and 300 to 400 ms release; under a sparse cue, where pumping shows,
+ -6 to -8 dB, 80 ms and about 0.9 s. Then listen.
- Keep one `<Mix lufs={-14} ceiling={-1.5} />` per composition. The master measures the whole core, Tone included.
- In a game, fire a one-shot on the exact frame something happens: `<Tone.Sfx when={...} play={(t) => ...} />` with
- `when` from `useGameEvents` or a machine's transition. Give one-shots `Tone.vary(instrument, { pitch: 0.3,
- volume: 2 })` so repeats don't sound copied (the variation is seeded by the frame, so a replay is the same). Cap
- their voices with `maxPolyphony` (the oldest is stolen, faded in 5 ms).
+ `when` true on that frame only (a frame from `useGameEvents`, or a machine's transition). Give one-shots
+ `Tone.vary(instrument, { pitch: 0.3, volume: 2 })` so repeats don't sound copied (the variation is seeded by the
+ frame, so a replay is the same). Cap their voices with `maxPolyphony` (the oldest is stolen, faded in 5 ms).
- In a timeline, cut on the music: `Tone.Time("1m").toFrames(fps)` is a bar in frames, and `Tone.Time("4n")` a beat.
- To hear a sound before writing it in, `raea sao "PROMPT" --seconds 1 -o media/sfx/try.wav` or `raea tokensynth
"TIMBRE" --notes C3 -o media/try/` makes it now; the edit's own call with the same words and settings then plays
- what was made instead of making it again.
+ what was made instead of making it again. Another `--seed` makes another take; play a seed's file by its path
+ (`staticFile("sfx/try.wav")`), since `sao()` in the edit has no seed.
+- When SAO or TokenSynth isn't installed yet, `raea setup-audio` installs it (`motion/sources` says what it fetches
+ and what to do when it fails).
+
+## Writing music for picture
+
+Write it as a composer would, for this cut:
+
+- **A motif first.** Three to seven notes over two to four bars, with a rhythm of its own, before any chord. Then
+ vary it rather than loop it: answer it, fragment it, move it to another instrument or register, put new chords
+ under it. End the cue on it.
+- **Harmony that moves.** In an active cue, change chord every bar or every two beats; keep chords of two to four bars
+ for a slow passage. Move the inner voices by step or hold a common tone, set the bass against the tune (contrary
+ motion, inversions so it walks), and resolve a pedal when it ends. Keep the low end open: no thirds below about C3,
+ fifths down to about C2, only octaves under that.
+- **Rhythm and groove.** At least one part moves in eighths or sixteenths: an ostinato, a pizzicato, an arpeggio, a
+ kit, hand percussion. Accent where the picture moves. Spread velocities (0.35 to 0.95, not all 0.8), and put a
+ played part a few milliseconds off the grid (5 to 15 ms, written into the note's time: `humanize` is ignored here).
+ A drummer's recorded groove beats one typed in (Groove MIDI, `motion/sources`).
+- **Orchestrate by register.** One job each: a bass (E1 to C3), sparse harmony (C3 to C5), one lead (C4 to C6), the
+ rhythm, colour on top (glockenspiel, celesta, harp). Hand the tune to a new instrument each section, and use the
+ articulations the library has (staccato, legato, pizzicato, tremolo, a swell). A pad, where the scene names one,
+ is glue 12 dB or more under the lead, never the part.
+- **The arrangement follows the edit.** Sections change where the edit changes idea: build by adding parts and by
+ switching sections, on bar lines; peak, then strip back; drop out before the reveal; end on the button. A sting
+ lasts 1 to 4 s, sits in the cue's key and lands on a beat.
+- **Write around the voice.** The tune answers in the gaps between lines, and the arrangement thins under speech.
+- **Each instrument its own room.** A short reverb per instrument or per section (decay 1.2 to 2.5 s, wet 0.15 to
+ 0.3), never one long wash over the bus: a 6 s reverb and a low-pass on the whole music bus erase every attack, and
+ that is how a score turns into a drone.
+- **Source music lives in the scene.** A radio, a band in the room, a phone: narrow it to the device (a high-pass
+ around 300 Hz and a low-pass around 3.5 kHz for a small speaker), pan it to where it is (`Tone.Panner`), put it in
+ the room's reverb, and let the scene's own sound sit with it. Crossing over is strong: a radio song that opens out
+ to full range as it becomes the score, a score hit that lands on an action in the scene.
+- Leave silence. Let the music start after a chapter card clears and stop before the next; let a card sit on one low
+ note.
+- Write for this picture's feeling, not a genre's surface: a stock walking bass and brushes under everything reads as
+ pastiche as surely as a pad does.
+- Period source music can be real: US sound recordings published before 1926 and compositions published before 1931
+ are public domain in the US (2026). archive.org's 78rpm transfers give the period's own sound; play them as
+ `<Audio bus="music">`, narrowed and placed as source music, ducked with the rest.
+- Synth drums (`MembraneSynth` kicks, noise "brushes") sound synthetic on anything acoustic; use a library's recorded
+ kit (`raea sounds kick`, `snare`, `hihat`).
## Instruments from TokenSynth: build a library, don't trust a take
A TokenSynth note is one sample from a model, and a lot of takes are bad. In a 35-minute documentary score (2026-10-20),
12 of 30 single-seed root notes failed: hiss and buzz in place of a horn, a sax or accordion an octave (or 34
semitones) off, a piano note still at full level when its file ends, so every held note stopped with a click. That is
-the "vanilla and abrasive" sound. So:
+the "vanilla and abrasive" sound. It learned from 5-second notes at four velocities, so it gives one dynamic and can
+miss the pitch asked for. So:
- Reach for an open sample library first for a standard instrument (`raea sounds piano`, `sounds get
- salamander/piano`): recorded, velocity-layered, no gamble. Use TokenSynth for what no library has, or a timbre you
- can describe better than find.
+ salamander/piano`): a recording, no gamble. Use TokenSynth for what no library has, or a timbre you can describe
+ better than find.
- Declare each instrument as a candidate, not a call: its timbre, roots every 3 to 4 semitones over the range it plays
(a Sampler pitched further than that starts to sound fake), 3 or more seeds, and `seconds` long enough for the
sound to die away on its own (4 for piano, 6 for sustained strings).
@@ -67,24 +135,7 @@ the "vanilla and abrasive" sound. So:
- Prefer timbres TokenSynth does well (felt or soft piano, sustained cello section, bowed or plucked bass, vibraphone,
clarinet in its low register) to the ones it does badly (muted trumpet, tenor sax, accordion: breath and reed
noise come out as hiss).
-
-## Writing music for picture
-
-- Write for the picture's mood, not a genre's surface. A walking bass, brushes and block chords on every bar reads as
- MIDI pastiche. Under narration, a drone score works: a chord every four bars, bass and a sine sub swelling under it,
- a sustained section with a slow attack, and a piano playing single notes off any grid, with a motif returning in
- fragments. Sustained textures also hide what's left of a sample's flaws.
-- Leave silence. Let the music start after a chapter card clears and stop before the next; let a card sit on one low
- note.
-- Soften the whole bed: a 24 dB/octave low-pass around 2.5 kHz into a long reverb (decay 6 to 7 s) on the music bus.
- The voice owns the presence range.
-- Duck gently under a voice over a drone (-6 to -8 dB, 80 ms attack, about 0.9 s release); the -12 dB duck suits a
- rhythmic bed, where pumping is less audible.
-- Period source music can be real: US sound recordings published before 1926 and compositions published before 1931
- are public domain in the US (2026). archive.org's 78rpm transfers give the period's own sound; play them as
- `<Audio bus="music">` under the score's drones, ducked with the rest.
-- Synth drums (`MembraneSynth` kicks, noise "brushes") sound synthetic on anything acoustic; leave them out or use a
- library's recorded kit.
+- For dynamics, render a soft and a loud velocity as two Samplers and pick one by each note's velocity.
## Why
@@ -96,16 +147,27 @@ So the graph goes at the top level, and in-game sounds go through `<Sfx>`.
Generated sources are made once per their inputs: the prompt, the length, a TokenSynth note's pitch, velocity, seed
and precision. They're normalised, cached as PCM in the object's `assets/`, and played like any file. TokenSynth and
-SAO run on this computer and install themselves the first time they're used (a few minutes, once). Music written as
-notes on instruments can be edited note by note, cut on the bar and ducked per part; a generated track can't.
+SAO run on this computer and install themselves the first time they're used (minutes, once; `raea setup-audio` does
+it ahead of time). Music written as notes on instruments can be edited note by note, cut on the bar and ducked per
+part; a generated track can't.
-Policy: music is Tone.js instruments (TokenSynth, the sample libraries, synths), foley and effects are SAO, narration
-is Pocket TTS (`<Speech>`), all local. No other generation: no generated images, video or remote sound effects. (`lyria()`, a remote music model, is
-retired: an older edit keeps the take it made, and a new one is refused.)
+Policy: music is notes on Tone.js instruments (sample libraries first, TokenSynth for a timbre no library has, synths
+for synthetic parts), effects and foley are SAO or recorded packs (`motion/sources`), narration is Pocket TTS
+(`<Speech>`), all local. Any other generation is a `raea gen` step, quoted and capped (`motion/gen`). (`lyria()`, a
+remote music model, is retired: an older edit keeps the take it made, and a new one is refused.)
## Common mistakes
+- A pad and a sine sub through a low-pass into a long reverb as the score. That's a drone, not music: write a motif,
+ chords that move and a part with rhythm.
+- One chord every four bars for a minute, or a two-bar loop for thirty seconds. Change the harmony every bar or two
+ and the arrangement every four to eight.
+- Every note at the same velocity, on the grid. Spread the dynamics and move played parts a few milliseconds.
+- A cue that fades out at the end. End it on the last cut, on a chord or a hit.
+- Music under every scene because the piece "needs music". Decide per scene; silence and the scene's own sound count.
- `synth.triggerAttackRelease(...)` in a component body. It fires on every render; use `<Tone.Sfx>`.
+- `<Tone.Sfx when={g.coinTaken}>` on a flag the state holds for many frames: it fires on every one. Give it the
+ frames the event happens on (`useGameEvents`).
- `new Tone.Synth()` inside a component. Make instruments at the top level.
- A `https://` URL for a Sampler or a Player. Sources are media files or generated assets, and the render has no
network: `raea sounds get` puts a library's files in `media/` first.
@@ -114,6 +176,7 @@ retired: an older edit keeps the take it made, and a new one is refused.)
- Rewording a `tokensynth()` timbre on every pass: each new wording makes its notes again. Settle the timbre first.
- A sample library's licence ignored. CC-BY ones (FluidR3, Salamander) need their credit where the piece is shown;
`LICENCE.txt` beside the files has the line. VCSL is CC0.
+- `part.loop = true` after `part.start()`: the Part plays once. Set `loop` and `loopEnd` first.
- `Tone.Draw.schedule` for visuals. There's no draw loop: read the frame (`useCurrentFrame`) and the same times.
- Cutting on `Tone.Time("1m").toFrames(fps)` across a tempo ramp. `Tone.getTransport().bpm.rampTo(120, 4)` bends the
grid, as in Tone (the notes come closer together; an exponential ramp runs linear), but `Time(...)` is at the tempo
@@ -123,44 +186,110 @@ retired: an older edit keeps the take it made, and a new one is refused.)
.connect(filter.frequency)`).
- A Sequence or Loop with no `Tone.getTransport().start()`. Nothing plays until the Transport starts, as in Tone.
-## Example: a bed from TokenSynth instruments and a library piano, cut on the bar
+## Example: a cue with a motif, chords that move and a kit, cut on the bar
+
+Spotted as one cue over nine one-bar cards: A (bars 1 to 4) piano and a pizzicato ostinato, the flute's motif from
+bar 3; B (bars 5 to 8) the ostinato drops out, bass and kit come in, the motif climbs; the button on the end card's
+cut. The instruments came from:
-`raea sounds get salamander/piano --notes C3,C4,C5` put the piano's notes in `media/sounds/salamander-piano/`.
+```sh
+raea sounds get salamander/piano --notes C3,C4,C5
+raea sounds get fluid/pizzicato_strings --notes A2,C3,E3,A3
+raea sounds get tonejs-instruments/flute --notes C4,E4,A4,C5,E5,A5
+raea sounds get fluid/acoustic_bass --notes E1,A1,D2
+raea sounds get vcsl/bass-drum-1 && raea sounds get vcsl/snare-drum-modern-1 && raea sounds get vcsl/hi-hat-cymbal
+```
```tsx
import { AbsoluteFill, Composition, Mix, Series, registerRoot, staticFile } from "raea";
import * as Tone from "raea/tone";
-Tone.getTransport().bpm.value = 92;
-const BAR = Tone.Time("1m").toFrames(30); // 78 frames at 92 bpm in 4/4
-const room = new Tone.Reverb({ decay: 2.2, wet: 0.25 }).connect(Tone.buses.music);
-const bass = new Tone.Sampler({ urls: Tone.tokensynth("a warm upright bass, plucked, round", ["C2", "C3"], { seconds: 1.5 }), release: 0.3 }).connect(Tone.buses.music);
-const keys = new Tone.Sampler({
- urls: { C3: staticFile("sounds/salamander-piano/C3.mp3"), C4: staticFile("sounds/salamander-piano/C4.mp3"), C5: staticFile("sounds/salamander-piano/C5.mp3") },
- release: 1.2,
- volume: -8,
-}).connect(room);
-const kick = new Tone.MembraneSynth({ octaves: 5, volume: -8 }).connect(Tone.buses.music);
-new Tone.Sequence((t, n) => kick.triggerAttackRelease(n, "8n", t), ["C1", null, null, null], "4n").start(0);
-new Tone.Part((t, n) => bass.triggerAttackRelease(n, "4n", t), [["0:0", "A2"], ["0:2", "E2"], ["1:0", "F2"], ["1:2", "C3"]]).start(0);
-new Tone.Part((t, c) => keys.triggerAttackRelease(c, "2n", t), [["0:0", ["A3", "C4", "E4"]], ["1:0", ["F3", "A3", "C4"]]]).start(0);
+Tone.getTransport().bpm.value = 96; // first: a Part reads its times at the tempo when it's made
+const BAR = Tone.Time("1m").toFrames(30); // 75 frames
+
+const notes = (dir: string, names: string[]) => Object.fromEntries(names.map((n) => [n, staticFile(`sounds/${dir}/${n}.mp3`)]));
+const room = new Tone.Reverb({ decay: 1.6, wet: 0.2 }).connect(Tone.buses.music);
+const piano = new Tone.Sampler({ urls: notes("salamander-piano", ["C3", "C4", "C5"]), release: 1, volume: -8 }).connect(room);
+const pizz = new Tone.Sampler({ urls: notes("fluid-pizzicato_strings", ["A2", "C3", "E3", "A3"]), release: 0.2, volume: -12 }).connect(room);
+const flute = new Tone.Sampler({ urls: notes("tonejs-instruments-flute", ["C4", "E4", "A4", "C5", "E5", "A5"]), release: 0.4, volume: -6 }).connect(room);
+const bass = new Tone.Sampler({ urls: notes("fluid-acoustic_bass", ["E1", "A1", "D2"]), release: 0.3, volume: -6 }).connect(Tone.buses.music);
+const kit = new Tone.Players({
+ kick: staticFile("sounds/vcsl-bass-drum-1/BDrumNew_hit_v5_rr1_Sum.wav"),
+ snare: staticFile("sounds/vcsl-snare-drum-modern-1/Snare2_HitSN_v5_rr1_Mid.wav"),
+ hat: staticFile("sounds/vcsl-hi-hat-cymbal/HiHat_HitC_v3_rr1_Mid.wav"),
+ ghost: staticFile("sounds/vcsl-hi-hat-cymbal/HiHat_HitC_v1_rr1_Mid.wav"), // the soft take, for the off-beats
+}).connect(Tone.buses.music);
+
+// a chord a bar, voiced so the inner notes move by step: Am F C G, then F G Am E
+const CHORDS = [["A3", "C4", "E4"], ["A3", "C4", "F4"], ["G3", "C4", "E4"], ["G3", "B3", "D4"], ["A3", "C4", "F4"], ["G3", "B3", "D4"], ["A3", "C4", "E4"], ["G#3", "B3", "E4"]];
+// comped, not held: the downbeat and the and-of-two, the second softer
+new Tone.Part((t, c) => piano.triggerAttackRelease(c.notes, "8n", t, c.vel), CHORDS.flatMap((chord, bar) => [
+ { time: `${bar}:0`, notes: chord, vel: 0.62 },
+ { time: `${bar}:1:2`, notes: chord, vel: 0.42 },
+])).start(0);
+
+// A: an eighth-note ostinato on each chord's root (root, fifth, octave, fifth), accented on the beat
+new Tone.Part((t, n) => pizz.triggerAttackRelease(n.note, "16n", t, n.vel), ["A2", "F2", "C3", "G2"].flatMap((root, bar) =>
+ [0, 7, 12, 7, 0, 7, 12, 7].map((up, i) => ({ time: `${bar}:${i >> 1}:${(i & 1) * 2}`, note: Tone.Frequency(root).transpose(up).toNote(), vel: i % 2 ? 0.45 : 0.75 })),
+)).start(0);
+
+// the motif (E D C D, then B A G) from bar 3, sequenced up and answered in B; each note a few ms off the grid
+const TUNE: [string, string, string, number][] = [
+ ["2:0", "E5", "4n", 0.7], ["2:1", "D5", "8n", 0.55], ["2:1:2", "C5", "8n", 0.6], ["2:2", "D5", "2n", 0.75],
+ ["3:0", "B4", "4n.", 0.65], ["3:1:2", "A4", "8n", 0.5], ["3:2", "G4", "2n", 0.6],
+ ["4:0", "A5", "4n", 0.8], ["4:1", "G5", "8n", 0.6], ["4:1:2", "F5", "8n", 0.65], ["4:2", "G5", "2n", 0.8],
+ ["5:0", "D5", "4n.", 0.7], ["5:1:2", "B4", "8n", 0.55], ["5:2", "D5", "2n", 0.7],
+ ["6:0", "E5", "4n", 0.75], ["6:1", "C5", "8n", 0.6], ["6:1:2", "E5", "8n", 0.7], ["6:2", "A5", "2n", 0.9],
+ ["7:0", "G#5", "2n.", 0.8], ["7:3", "B4", "4n", 0.6],
+];
+new Tone.Part((t, n) => flute.triggerAttackRelease(n.note, n.dur, t + n.late, n.vel),
+ TUNE.map(([time, note, dur, vel], i) => ({ time, note, dur, vel, late: ((i * 5) % 3 - 1) * 0.007 }))).start(0);
+
+// B: the bass walks up under the climb (F G A, then E to come home), root on one and fifth on three
+new Tone.Part((t, n) => bass.triggerAttackRelease(n.note, "4n.", t, n.vel), [["F1", "C2"], ["G1", "D2"], ["A1", "E2"], ["E1", "B1"]].flatMap(([root, fifth], i) => [
+ { time: `${4 + i}:0`, note: root, vel: 0.85 },
+ { time: `${4 + i}:2`, note: fifth, vel: 0.6 },
+])).start(0);
+
+// B: the kit, four bars of sixteenth-note lanes (null rests)
+const _ = null;
+for (const steps of [
+ ["kick", _, _, _, _, _, "kick", _, "kick", _, _, _, _, _, _, _],
+ [_, _, _, _, "snare", _, _, _, _, _, _, _, "snare", _, _, _],
+ ["hat", _, "ghost", _, "hat", _, "ghost", "ghost", "hat", _, "ghost", _, "hat", _, "ghost", _],
+]) {
+ const lane = new Tone.Sequence((t, hit) => kit.player(hit).start(t), steps, "16n");
+ lane.loop = 4; // set before start: four bars, then it stops
+ lane.start("4m");
+}
+
+// the button: everything on the end card's downbeat, then nothing
+Tone.getTransport().schedule((t) => {
+ piano.triggerAttackRelease(["A2", "A3", "C4", "E4"], "2n", t, 0.85);
+ bass.triggerAttackRelease("A1", "2n", t, 0.9);
+ flute.triggerAttackRelease("A5", "4n", t, 0.8);
+ kit.player("kick").start(t);
+}, "8m");
Tone.getTransport().start();
-// each card is one bar long, so every cut lands on a downbeat
+// each card is one bar, so every cut lands on a downbeat; the ninth is the end card
const Edit = () => (
<AbsoluteFill>
- <Mix lufs={-14} ceiling={-1} />
- <Series>{[0, 1, 2, 3].map((i) => <Series.Sequence key={i} durationInFrames={BAR}>{/* card i */}</Series.Sequence>)}</Series>
+ <Mix lufs={-14} ceiling={-1.5} />
+ <Series>{Array.from({ length: 9 }, (_, i) => <Series.Sequence key={i} durationInFrames={BAR}>{/* card i */}</Series.Sequence>)}</Series>
</AbsoluteFill>
);
-registerRoot(() => <Composition id="bed" component={Edit} width={1080} height={1920} fps={30} durationInFrames={BAR * 4} />);
+registerRoot(() => <Composition id="cue" component={Edit} width={1080} height={1920} fps={30} durationInFrames={BAR * 9} />);
```
+FluidR3 and Salamander are CC-BY 3.0, so the piece credits them (the line is in each `LICENCE.txt`); the flute's
+`LICENCE.txt` says its source's licence; VCSL is CC0.
+
## Example: a game's sound
```tsx
-import { AbsoluteFill, Audio, Composition, Mix, Sequence, registerRoot, staticFile, useCurrentFrame, useGameEvents, useGameState } from "raea";
+import { AbsoluteFill, Audio, Composition, Mix, Sequence, registerRoot, staticFile, useCurrentFrame, useGameEvents } from "raea";
import * as Tone from "raea/tone";
// the game: its state and step (motion/games); only what the sound reads is shown
@@ -168,32 +297,41 @@ type State = { hits: number; coinTaken: boolean };
const INITIAL: State = { hits: 0, coinTaken: false };
const fold = (s: State): State => s;
+Tone.getTransport().bpm.value = 112;
Tone.buses.music.duck(Tone.buses.voice, { amount: -12 });
const thump = Tone.vary(new Tone.MembraneSynth({ octaves: 4, maxPolyphony: 4, poly: true }), { pitch: 0.5, volume: 2 }).connect(Tone.buses.sfx);
const coin = new Tone.Sampler({ urls: { C5: Tone.sao("a bright arcade coin chime, short", { seconds: 1 }) } }).connect(Tone.buses.sfx);
const marimba = new Tone.Sampler({ urls: Tone.tokensynth("a soft wooden marimba, felt mallet, warm", ["C3", "C4", "C5"], { seconds: 2 }), volume: -10 }).connect(Tone.buses.music);
-const tune = new Tone.Part((t, n) => marimba.triggerAttackRelease(n, "8n", t), [["0:0", "C4"], ["0:1", "E4"], ["0:2", "G4"], ["1:0", "A4"], ["1:2", "G4"]]);
+// a loop that wants to come round: a question (bars 1-2) and its answer (bars 3-4), rhythm before pitch
+const tune = new Tone.Part((t, n) => marimba.triggerAttackRelease(n.note, "8n", t, n.vel), [
+ { time: "0:0", note: "C4", vel: 0.8 }, { time: "0:0:2", note: "E4", vel: 0.5 }, { time: "0:1:2", note: "G4", vel: 0.6 }, { time: "0:3", note: "A4", vel: 0.7 },
+ { time: "1:0", note: "G4", vel: 0.8 }, { time: "1:1:2", note: "E4", vel: 0.5 }, { time: "1:2", note: "D4", vel: 0.6 },
+ { time: "2:0", note: "C4", vel: 0.8 }, { time: "2:0:2", note: "E4", vel: 0.5 }, { time: "2:1:2", note: "G4", vel: 0.6 }, { time: "2:3", note: "C5", vel: 0.75 },
+ { time: "3:0", note: "B4", vel: 0.7 }, { time: "3:1", note: "G4", vel: 0.55 }, { time: "3:2", note: "C4", vel: 0.85 },
+]);
tune.loop = true;
-tune.loopEnd = "2m";
+tune.loopEnd = "4m";
tune.start(0);
Tone.getTransport().start();
function Game() {
const frame = useCurrentFrame();
- const g = useGameState(INITIAL, fold);
const hits = useGameEvents(INITIAL, fold, (b, a) => a.hits > b.hits);
+ const coins = useGameEvents(INITIAL, fold, (b, a) => a.coinTaken && !b.coinTaken);
return (
<AbsoluteFill>
<Mix lufs={-14} ceiling={-1.5} />
{/* ...the game's picture... */}
<Tone.Sfx when={hits.includes(frame)} play={(t) => thump.triggerAttackRelease("C2", "8n", t)} />
- <Tone.Sfx when={g.coinTaken} play={(t) => coin.triggerAttackRelease("C5", "8n", t)} />
+ <Tone.Sfx when={coins.includes(frame)} play={(t) => coin.triggerAttackRelease("C5", "8n", t)} />
<Sequence from={90} durationInFrames={150} layout="none">
<Audio src={staticFile("voice.wav")} bus="voice" />
</Sequence>
</AbsoluteFill>
);
}
+
+registerRoot(() => <Composition id="game" component={Game} width={1920} height={1080} fps={60} durationInFrames={600} />);
```
`raea/music` is the shorthand for notes on named instruments (`new Part("bass", [...])`, `<Music>`). It plays
diff --git a/sdk/guides/craft/motion/sound.md b/sdk/guides/craft/motion/sound.md
index 479c9a3f..4dbe98d7 100644
--- a/sdk/guides/craft/motion/sound.md
+++ b/sdk/guides/craft/motion/sound.md
@@ -2,6 +2,10 @@
## What to do
+- Decide what each scene is heard as before placing anything: silence, the scene's own sound (footsteps, a room, a
+ machine: what the people on screen would hear), source music, score, effects, a voice. Music is a decision per
+ scene, never a bed by default (`motion/music` has the spotting and the writing; `motion/sources` where each sound
+ can come from).
- Put each sound in its own `<Sequence from={frame} layout="none" name>` with an `<Audio>` inside. The Sequence's
`from` is when the sound starts, and its `durationInFrames` (optional) cuts it off. `layout="none"` because a sound
draws nothing.
@@ -9,17 +13,26 @@
values above 1 boost). Either one can be a function of the sound's own frame (0 at its first frame) for a duck or
a swell. `gainDb` wins when both are given.
- Fade with `fadeIn` and `fadeOut`, in seconds. They ramp from and to silence at the start and end of where the sound
- plays, at the audio's own rate, and multiply with the gain. Use about 1 to 1.4 s at the end of a bed, and
- 0.012 s at a cut.
-- Make foley and sound effects with `sao(prompt, {seconds})` (2 s by default; up to 11.9 s) and pass the result to
- `<Audio src>`. Write prompts the way the approved pieces do: the sound, its character and what to leave out ("deep
- punchy cinematic impact hit, tight, no reverb tail"; "bubbly UI pop click, short, dry"). Ask for the length you
- need.
-- Make the music bed in Tone.js on `Tone.buses.music` (`motion/music`): instruments in a `Sampler` (TokenSynth notes
- or a sample library's), playing a `Part` or `Sequence`. Duck it under the voice with
- `Tone.buses.music.duck(Tone.buses.voice, { amount: -12 })`, give the voice `<Audio bus="voice">`, and set the bed's
- level on the bus: `Tone.buses.music.volume.value = -21`, then `Tone.buses.music.volume.rampTo(-12, 0.3, t)` to lift
- it at `t` seconds for the end card.
+ plays, at the audio's own rate, and multiply with the gain. Use about 1 to 1.4 s where an ambience or a source cue
+ leaves the scene, and 0.012 s at a cut. A score ends on its last hit instead (`motion/music`).
+- Make foley and sound effects with `sao(prompt, {seconds})` (2 s by default; up to 11.9 s, and a longer ask comes
+ back 11.9 s long) and pass the result to `<Audio src>`, or take a recorded one from a pack (`motion/sources`).
+ Write prompts the way the approved pieces do: the sound, its character and what to leave out ("deep punchy
+ cinematic impact hit, tight, no reverb tail"; "bubbly UI pop click, short, dry"). Ask for the length you need.
+- Design an effect in layers, each its own short prompt or take, laid on the same frame: a transient (the first 5 to
+ 30 ms: a snap, a click), a body that says what the thing is (50 to 500 ms), weight for a big hit only (under
+ 120 Hz, short), and a tail that puts it in its room (0.3 to 3 s). Vary a sound that repeats: 3 to 5 takes (another seed or another file), a semitone or two and a couple of dB apart.
+- Give a place its room tone and keep it across that place's cuts: no digital silence under picture, an ambience
+ that changes when the place does, and the next scene's sound starting about half a second before its cut. Foley
+ is three passes, each on the frame of contact: steps, cloth, props.
+- Place what's in the scene where it is: pan it to its side of the frame (`Tone.Panner`, a Channel's `pan`), give
+ it the room's reverb, and narrow a device (a phone, a radio) with a high-pass and a low-pass. In 3D, `<Sound3D
+ src at>` places it and the camera hears it move.
+- When the piece has music, write it in Tone.js on `Tone.buses.music` (`motion/music`): instruments in a `Sampler`
+ (a sample library's notes, or TokenSynth's), parts in a `Part` or `Sequence`, composed for the cut. Duck it under
+ the voice with `Tone.buses.music.duck(Tone.buses.voice, { amount: -12 })`, give the voice `<Audio bus="voice">`,
+ and set the music's level on the bus: `Tone.buses.music.volume.value = -21`, then
+ `Tone.buses.music.volume.rampTo(-12, 0.3, t)` to lift it at `t` seconds for the end card.
- Narration over the picture, when the footage has no voice for it, is
`<Speech text="the words" start={frame} />` from `raea/speech` (Pocket TTS, on this computer; `voice` picks a
Pocket voice or a WAV of one).
@@ -32,12 +45,13 @@
| sound | with a voice | without one (promo, deck, game) |
|---|---|---|
| the voice clips | about 0 dB | none |
- | music bed | -21 dB, rising to about -12 dB once the voice stops (the end card) | -12 to -15 dB |
+ | music | -21 dB, rising to about -12 dB once the voice stops (the end card) | -12 to -15 dB |
| foley hits, whooshes, pops | -16 to -22 dB | -1 to -6 dB |
These are starting points; listen and decide.
- `raea sao "PROMPT" --seconds 1.2 -o media/sfx/hit.wav` makes a sound now, to check it before it goes in; the edit's
- `sao("PROMPT", { seconds: 1.2 })` then plays that one rather than making another.
+ `sao("PROMPT", { seconds: 1.2 })` then plays that one rather than making another. `--seed 2` makes another take of
+ the same prompt; play that file by its path (`staticFile("sfx/hit-2.wav")`), since `sao()` has no seed.
## Why
@@ -46,14 +60,15 @@ full-frame box that paints over the parts beneath it.
`sao()` returns an asset `{kind, prompt, seconds, id, src}` whose id is a stable hash of the kind, the
prompt and the length. The renderer makes each asset once and caches it in the object's `assets/`. SAO runs on this
-computer (Stable Audio Open, a few seconds a sound; it installs itself the first time). The same call always reuses
+computer (Stable Audio Open Small, a few seconds a sound; it installs itself the first time, and `motion/sources`
+says what that fetches). It does better on effects and field recordings than on music. The same call always reuses
the same sound, and changing one word of the prompt makes a new one. So settle the prompt before you iterate on
gains.
-Policy: music is Tone.js instruments (TokenSynth, the sample libraries, synths), SAO makes foley, and Pocket TTS
-(`<Speech>`) says narration over the picture, all on this computer. Any other generation is a `raea gen` step
-(`motion/gen`). (`lyria()`, a remote music model, is retired: a
-new take is refused, and a bed of instruments can be cut on the bar and edited note by note anyway.)
+Policy: music is notes on Tone.js instruments (sample libraries first, TokenSynth, synths), SAO and recorded packs
+make effects and foley, and Pocket TTS (`<Speech>`) says narration over the picture, all on this computer. Any other
+generation is a `raea gen` step (`motion/gen`). (`lyria()`, a remote music model, is retired: a new take is refused,
+and music written as notes can be cut on the bar and edited note by note anyway.)
Sound sells the cut, but one move everywhere is a lint: a whoosh on every entrance flattens all of them. Give
foley to the moments that are physical (a slam, a strike-through, a card landing on the beat) and let others be
@@ -61,22 +76,23 @@ silent.
## Check the sound before you call it done
-Frames get looked at; sound has to be measured, because a broken bed is easy to miss on one listen and obvious to
+Frames get looked at; sound has to be measured, because a broken mix is easy to miss on one listen and obvious to
everyone else. Two checks, both cheap:
- **The render says when a sound runs out.** `WARN sound X runs out N s before its stretch ends` means the
source is shorter than its Sequence and still sounding (or asked for a fadeOut) at its end: it stops dead and the
- fade never plays, so a 10 s `sao()` bed under a 12 s cue cuts off mid-line. `loop` alone doesn't help: a sound
- loops only between `startFrom` and `endAt`, and that loop is a hard jump. Tile it instead: copies of the take end to
- end, each in its own Sequence, crossfading over 1.5 s (`fadeIn`/`fadeOut`), or make the take as long as the span.
+ fade never plays, so a 10 s `sao()` ambience under a 12 s scene cuts off mid-line. `loop` alone doesn't help: a
+ sound loops only between `startFrom` and `endAt`, and that loop is a hard jump. Tile it instead: copies of the take
+ end to end, each in its own Sequence, crossfading over 1.5 s (`fadeIn`/`fadeOut`), or make the take as long as the
+ span.
- **Check the finished file.** `raea check FILM.mp4 --words words.json` (the voice's words on the film's clock)
- reports, by timecode, dead stops (a steady sound that ends in one 10 ms step: fade a bed out over 100 ms or more;
+ reports, by timecode, dead stops (a steady sound that ends in one 10 ms step: fade it out over 100 ms or more;
a voice ending its word isn't one), stretches with no voice louder than
- the voice, a bed closer than 12 dB to the voice over it, and a true peak over -1 dBTP. Fix every line it prints, or
+ the voice, music closer than 12 dB to the voice over it, and a true peak over -1 dBTP. Fix every line it prints, or
say why it stands.
Set levels from measurements, not by ear on one pass. Measure each source's integrated loudness (`ffmpeg -i F -af
-ebur128 -f null -`) and set its gain against the narration's: beds 15-20 LU under the voice; a film's own sound,
+ebur128 -f null -`) and set its gain against the narration's: music 15-20 LU under the voice; a film's own sound,
where the narration stops, about 3 LU under it with its loudest 3 s no more than 2 LU over; never boost a near-silent
take more than +3 dB (its hiss comes up with it). A flat gain on every archive clip is how one film's main title
ends up shouting over the narrator while another is inaudible.
@@ -85,18 +101,21 @@ ends up shouting over the narrator while another is inaudible.
- An `<Audio>` without a Sequence, or in a Sequence without `layout="none"`.
- `volume={-6}` meaning decibels. That throws, because volume is a non-negative linear gain. Write `gainDb={-6}`.
-- A bed at -6 dB under the voice. The voice must stay intelligible over everything (floor).
-- `loop` on an `<Audio>` without `endAt` to stretch a short bed: nothing loops, it plays once and stops dead (the
- render warns). With `endAt` it repeats with a hard jump at each loop; tile copies with crossfades instead.
+- Music at -6 dB under the voice. The voice must stay intelligible over everything (floor).
+- A pad, a drone or one `sao()` take of "ambient music" laid under the whole piece as its score. Decide what each
+ scene needs, and write the music (`motion/music`).
+- An effect from one take with nothing under it: a click that should be a door. Layer it.
+- `loop` on an `<Audio>` without `endAt` to stretch a short ambience: nothing loops, it plays once and stops dead
+ (the render warns). With `endAt` it repeats with a hard jump at each loop; tile copies with crossfades instead.
- Two `<Mix>` in one composition: it throws.
- No `<Mix>`: the sum plays as it is, at whatever loudness it adds up to.
-- Rewording a `sao()` prompt on every pass. Each new prompt makes a new sound .
+- Rewording a `sao()` prompt on every pass. Each new prompt makes a new sound.
- `style` on an `<Audio>`: Audio has no picture and takes no style.
- Hand-placing dozens of game sounds from a log. Cue them from `useGameEvents` (`motion/games`).
- Writing music note by note in `<Audio>` files, or a game's sounds by hand. Write them in Tone.js (`motion/music`):
instruments, the Transport, buses with ducking, and `<Tone.Sfx>` for one-shots.
-## Example: a bed that lifts for the end card, a voice, foley on two beats
+## Example: a cue that lands on the end card, a voice, a layered hit
```tsx
import { AbsoluteFill, Audio, Composition, Mix, Sequence, registerRoot, sao, staticFile } from "raea";
@@ -106,24 +125,41 @@ import { css } from "./styles.gen";
const FRAMES = 300;
const END_CARD = 252; // the voice stops here
-// the bed: a TokenSynth pulse and a pad on the music bus, ducked under the voice, lifted for the end card
-Tone.getTransport().bpm.value = 100;
+// the music (motion/music): a sampled piano, chords that change every bar under a motif that answers the voice,
+// ducked under it, lifted for the end card, and ending on a chord on that cut. The tempo is set from the cut:
+// four bars to the end card, so its cut is a downbeat.
+Tone.getTransport().bpm.value = (4 * 4 * 60 * 30) / END_CARD; // about 114 bpm
Tone.buses.music.duck(Tone.buses.voice, { amount: -12 });
Tone.buses.music.volume.value = -21;
Tone.buses.music.volume.rampTo(-12, 0.33, END_CARD / 30);
-const pluck = new Tone.Sampler({ urls: Tone.tokensynth("a soft muted electric piano, warm, short decay", ["C3", "C4"], { seconds: 1 }) }).connect(Tone.buses.music);
-const pad = new Tone.PolySynth(Tone.Synth, { oscillator: { type: "fatsine" }, envelope: { attack: 0.6, release: 1.5 }, volume: -12 }).connect(Tone.buses.music);
-new Tone.Sequence((t, n) => pluck.triggerAttackRelease(n, "8n", t), ["A3", "E4", "C4", "E4"], "8n").start(0);
-new Tone.Part((t, c) => pad.triggerAttackRelease(c, "2m", t), [["0:0", ["A3", "C4", "E4"]], ["2:0", ["F3", "A3", "C4"]]]).start(0);
+const piano = new Tone.Sampler({
+ urls: { C3: staticFile("sounds/salamander-piano/C3.mp3"), C4: staticFile("sounds/salamander-piano/C4.mp3"), C5: staticFile("sounds/salamander-piano/C5.mp3") },
+ release: 1,
+}).connect(new Tone.Reverb({ decay: 1.4, wet: 0.2 }).connect(Tone.buses.music));
+const CHORDS = [["A2", "E3", "C4"], ["F2", "C3", "A3"], ["C3", "G3", "E4"], ["G2", "D3", "B3"]];
+new Tone.Part((t, c) => piano.triggerAttackRelease(c.notes, "4n", t, c.vel), CHORDS.flatMap((chord, bar) => [
+ { time: `${bar}:0`, notes: chord, vel: 0.55 },
+ { time: `${bar}:2:2`, notes: chord, vel: 0.4 },
+])).start(0);
+new Tone.Part((t, n) => piano.triggerAttackRelease(n.note, "8n", t, n.vel), [
+ { time: "1:1", note: "E5", vel: 0.7 }, { time: "1:1:2", note: "D5", vel: 0.5 }, { time: "1:2", note: "C5", vel: 0.6 }, { time: "1:3", note: "A4", vel: 0.65 },
+ { time: "3:1", note: "G5", vel: 0.75 }, { time: "3:1:2", note: "F5", vel: 0.5 }, { time: "3:2", note: "E5", vel: 0.6 }, { time: "3:3", note: "D5", vel: 0.7 },
+]).start(0);
+Tone.getTransport().schedule((t) => piano.triggerAttackRelease(["A2", "E3", "A3", "C4", "E4"], "1m", t, 0.8), "4m");
Tone.getTransport().start();
+// one hit in three layers, on the same frame: the snap that starts it, the body that says what it is, the room's tail
+const SNAP = sao("sharp wooden snap, close, very short, dry", { seconds: 0.3 });
const HIT = sao("deep punchy impact hit, tight, no reverb tail", { seconds: 1.2 });
+const TAIL = sao("the reverb tail of one impact in a large hall, no attack", { seconds: 2.5 });
const POP = sao("bubbly UI pop click, short, dry", { seconds: 0.6 });
const VOICE = staticFile("voice/vo01.wav"); // the person's narration, as a file
/** Every sound, in time order. */
const SOUNDS = [
+ { id: "hit-snap", from: 0, gainDb: -20, src: SNAP, fade: 0, bus: "sfx" },
{ id: "hit", from: 0, gainDb: -16, src: HIT, fade: 0, bus: "sfx" },
+ { id: "hit-tail", from: 0, gainDb: -24, src: TAIL, fade: 0, bus: "sfx" },
{ id: "voice", from: 15, to: END_CARD, gainDb: 0, src: VOICE, fade: 0.012, bus: "voice" },
{ id: "pop", from: END_CARD + 2, gainDb: -17, src: POP, fade: 0, bus: "sfx" },
] as const;
diff --git a/sdk/guides/craft/motion/sources.md b/sdk/guides/craft/motion/sources.md
new file mode 100644
index 00000000..e4934b96
--- /dev/null
+++ b/sdk/guides/craft/motion/sources.md
@@ -0,0 +1,158 @@
+# Sources: the local models, sample libraries, effect packs and MIDI, and how to get each onto the Mac
+
+## What to do
+
+- Take each sound from the source that fits its job, and know its licence before it goes in:
+
+ | the job | the source |
+ |---|---|
+ | an instrument playing a part: piano, strings, brass, woodwinds, mallets, guitars, a drum kit | a sampled library: `raea sounds` first, then the packs below |
+ | a timbre no library has ("a bowed saw, close") | TokenSynth, curated (`motion/music`) |
+ | an effect, foley, an ambience | a recorded pack or the person's own recordings first; SAO for what none has, in layers (`motion/sound`) |
+ | a voice over the picture | `<Speech>` (Pocket TTS, local); a voice model is a `raea gen speech` step, Fish's with the person's own FISH_API_KEY (`motion/gen`) |
+ | a drummer's feel | a Groove MIDI performance played on a sampled kit |
+ | a melody or harmony to arrange from the public domain | Mutopia, OpenScore |
+
+- Use what raea's licence rule takes: CC0 and public domain, CC-BY (credited), MIT and Apache, and free licences that
+ allow a commercial film (Sonniss's, Pixabay's). Never a non-commercial (NC), no-derivatives (ND), Sampling+,
+ "personal use" or share-alike (SA) source: share-alike terms can reach the film made with it. A pack's licence is
+ per pack and sometimes per sound; read its readme and keep it beside the files.
+- Credit each CC-BY source where the piece is shown (its description or end credits). The line is in the
+ `LICENCE.txt` that `raea sounds get` writes, or in the pack's readme.
+- Keep a pack fetched by hand in one folder on the Mac, outside any project (`~/Music/raea-sounds/PACK/` with its
+ licence file), and copy the files a piece uses into its `media/` (`media/sounds/PACK/`): a render reads only its
+ own media, never a URL. With the raea app open, `raea library new sounds` and `raea library add sounds
+ ~/Music/raea-sounds` index that folder once the person says yes in the app; then `raea library search "metal door
+ slam" --kind audio --sound` finds a sound by what it sounds like.
+- raea reads WAV, MP3, FLAC and AAC (.m4a). Convert Ogg (most of Kenney's packs) and Opus to WAV first (`ffmpeg -i
+ in.ogg out.wav`).
+
+## Getting SAO and TokenSynth onto the Mac
+
+Both run on this computer and install themselves the first time a render, `raea sao` or `raea tokensynth` asks for
+a sound. To do it ahead of time and see where they are:
+
+```sh
+raea setup-audio --check # what's installed, where, and how much disk
+raea setup-audio # installs what's missing: TokenSynth, then SAO
+raea setup-audio sao # one of them
+```
+
+- **What it fetches.** Each model has a script (`tools/sao/setup.sh` and `tools/tokensynth/setup.sh` in a checkout,
+ `share/raea/tools/` beside an installed raea) that installs into `~/.cache/raea-sao` and `~/.cache/raea-tokensynth`
+ (RAEA_SAO and RAEA_TOKENSYNTH move them):
+ - SAO, about 2 GB: Stable Audio Open Small's Core ML conversion (the DiT, the VAE decoder and the number embedder)
+ from a Hugging Face mirror at a pinned revision, each file checked against its SHA-256; t5-base's tokenizer; a
+ small Python environment; and raea's own fp32 T5 encoder, converted once in a throwaway environment whose torch
+ and t5-base weights (about 900 MB) are deleted after.
+ - TokenSynth, about 6 GB: its code from GitHub, a Python environment with torch (about 1.1 GB), the model and its
+ unconditional twin (713 MB each), DAC (307 MB) and CLAP (2.35 GB) from Hugging Face, the text encoders CLAP
+ fetches, then a converted fp16 runtime and Core ML models.
+- **What it needs.** A network connection, `uv` (Astral's Python manager) on the PATH, and `git` for TokenSynth.
+ Neither script installs them. Install uv first (`curl -LsSf https://astral.sh/uv/install.sh | sh`, or Homebrew).
+- **The licences.** TokenSynth's code and weights are MIT. Stable Audio Open Small is under Stability AI's Community
+ License, which isn't an open licence: it's free to use, commercially too, for a person or organisation with under
+ USD 1 million in annual revenue (above that, Stability's enterprise licence), Stability asks commercial users to
+ register (stability.ai/license), and what it makes belongs to the person. Setup doesn't show this licence, so say
+ it to the person before the first SAO sound goes into a commercial piece of theirs.
+- **When it fails.** The error names the script and the folder; run that script with `sh` to see its own output.
+ `exit status: 127` is uv or git missing. `75` is another setup running in the same folder: wait for it, or remove
+ the folder's `.setup-lock` once nothing is running. RAEA_OFFLINE refuses the download, and RAEA_AUDIO_AUTOSETUP=0
+ turns the self-install off, so a render names the command instead. Running setup-audio again picks up where a
+ broken install stopped: finished files are kept.
+- A render that meets a model not yet installed waits while it installs (minutes, once). Run setup-audio before the
+ first render, not inside one.
+
+## What `raea sounds` fetches for you
+
+`raea sounds WORDS` searches four libraries with no network (`kick`, `hihat` and the other words producers use find
+their parts). `raea sounds get PACK/INSTRUMENT` downloads one instrument's files once (into `~/.cache/raea-sounds`),
+copies them into `media/sounds/PACK-INSTRUMENT/` with a `LICENCE.txt`, and prints the `Sampler` (or the `Player`s)
+that plays them.
+
+| pack | licence | what it has |
+|---|---|---|
+| `salamander` | CC-BY 3.0 (credit) | a grand piano, sampled every minor third |
+| `fluid` | CC-BY 3.0 (credit) | the 128 General MIDI instruments of the FluidR3 font, every note A0 to C8; no drum kit |
+| `tonejs-instruments` | public domain and CC-BY, per instrument (its `LICENCE.txt` says) | 20: cello, violin, contrabass, French horn, trumpet, trombone, tuba, saxophone, flute, clarinet, bassoon, harp, guitars, organ, harmonium, piano, xylophone |
+| `vcsl` | CC0 | 104 from the Versilian Community Sample Library: pianos, harpsichords, harps, organs, recorders, marimba, vibraphone, glockenspiel, kalimbas; bass drums, snares, toms, hi-hat, cymbals, claps, shakers, congas, timpani; a siren, a ratchet, an anvil and other effects |
+
+The ids are exact: `raea sounds kick` lists `vcsl/bass-drum-1`, and `vcsl/bass-drum` isn't one. A pitched
+instrument comes as one take a note, at its middle dynamic; a drum or a hit as its first 12 takes (`--all` for
+every one). VCSL names a hit's dynamic and round robin in the file (`_v2` soft to `_v7` hard, `_rr1`, `_rr2`), so a
+part can pick a softer take for a softer note.
+
+## Packs to fetch by hand
+
+Each of these is a download from its own page into `~/Music/raea-sounds/PACK/`, then the files a piece uses copied
+into its `media/`.
+
+| source | licence | where | what it has |
+|---|---|---|---|
+| VSCO 2 Community Edition | CC0 | github.com/sgossner/VSCO-2-CE (releases) | an orchestra: solo and section strings with articulations, woodwinds, brass, percussion, keys; WAV with SFZ maps, about 3 GB |
+| VCSL, the whole library | CC0 | github.com/sgossner/VCSL | every dynamic and round robin of what `raea sounds` gives one take of, with SFZ maps |
+| Salamander Grand Piano V3 | CC-BY 3.0 | github.com/sfzinstruments/SalamanderGrandPiano | the same piano at 16 velocities, 48 kHz, SFZ |
+| sfzinstruments' lists | per pack, on the list | sfzinstruments.github.io (pianos, strings, drums) | take the CC0, public domain and CC-BY ones: Karoryfer's free packs (Big Rusty, Swirly and Unruly drums, Frankensnare, Meatbass, Bigcat Cello; mostly CC0, older ones CC-BY 3.0: read each readme), SM Drums (public domain), Splendid Grand Piano (public domain), DrumGizmo's DRS and Muldjord kits and Naked Drums (CC-BY 4.0) |
+| University of Iowa Musical Instrument Samples | "may be downloaded and used for any projects, without restrictions" | theremin.music.uiowa.edu/mis.html | single notes of orchestral instruments at several dynamics, recorded dry: give them a room's reverb |
+| FreePats | per bank: CC0, CC-BY, or GPL with an exception for music made with it | freepats.zenvoid.org | General MIDI families, world instruments, percussion; SFZ and SF2 |
+| MuseScore General | MIT (keep its notice) | ftp.osuosl.org/pub/musescore/soundfont/MuseScore_General/ | a General MIDI bank with drum kits, SF2 (206 MB) or SF3, for playing a MIDI file as it is |
+| Kenney's audio packs | CC0 | kenney.nl/assets/category:Audio | Impact Sounds, Interface Sounds, UI Audio, Sci-fi Sounds, RPG Audio, Casino Audio, Digital Audio, Music Jingles, voice-over packs; mostly Ogg |
+| OpenGameArt | per asset: take CC0, CC-BY and OGA-BY | opengameart.org | game effects and loops, such as "512 Sound Effects (8-bit style)" (CC0) |
+| Freesound | per sound: take CC0 and CC-BY only | freesound.org (a free account to download) | field recordings, foley and effects of every kind |
+| Sonniss #GameAudioGDC bundles | royalty-free for commercial use, no credit; never passed on as sounds (a library, a pack, a template) and never used to train a model | sonniss.com/gameaudiogdc | over 200 GB of professional foley, impacts, ambiences and field recordings, a bundle a year |
+| Pixabay sound effects | Pixabay's Content License: free, commercial use, no credit; never sold or shared on their own | pixabay.com/sound-effects | effects and ambiences |
+| Groove MIDI Dataset | CC-BY 4.0 (credit Google Magenta) | magenta.tensorflow.org/datasets/groove | 1,150 MIDI performances by 10 drummers: 13.6 hours of beats and fills in 18 styles, 3 MB |
+| Mutopia Project | per piece: public domain or CC-BY (skip the BY-SA ones) | mutopiaproject.org | 2,100 classical pieces as MIDI and LilyPond |
+| OpenScore Lieder | CC0 | github.com/OpenScore/Lieder | 1,350 art songs as MuseScore scores (MuseScore exports MIDI) |
+
+Not these, whatever they sound like: Sonatina Symphonic Orchestra and the Virtual Playing Orchestra (Sampling+ and
+mixed terms: no use in an ad), the Philharmonia's samples (terms unclear), Spitfire LABS (no samples to take), the
+MusyngKite and FatBoy fonts beside FluidR3 (no licence), Tone.js's own drum kits (CC BY-NC-SA), the BBC's sound
+effects (personal and research use), Zapsplat and Mixkit (their own terms), Salamander Drumkit and other CC-BY-SA
+kits, and Lakh MIDI (copyrighted songs). Freesound's API is free only for non-commercial use, so raea doesn't search
+Freesound for the person: they download its sounds themselves.
+
+## Loading a pack in a composition
+
+- **One-shots** (an effect pack, a field recording): the file in `media/sfx/PACK/`, then `<Audio
+ src={staticFile("sfx/PACK/door-slam.wav")} />` in a Sequence at its frame (`motion/sound`), or a `Tone.Player`
+ for a game's one-shot.
+- **A multisampled instrument** (the SFZ packs): raea has no SFZ reader yet. The `.sfz` file is text: each `<region>`
+ names a `sample=` file, its `pitch_keycenter` (the note it is), `lovel`/`hivel` (the velocities it plays) and
+ `seq_position` (its round robin). Copy the files for the notes and dynamics the part needs, map them by note, and
+ give each dynamic its own Sampler, picked by the note's velocity:
+
+ ```tsx
+ // SOFT and LOUD: { C3: staticFile("sounds/vsco-cello/..."), ... }, written from the .sfz's regions
+ const soft = new Tone.Sampler({ urls: SOFT, release: 0.6 }).connect(Tone.buses.music);
+ const loud = new Tone.Sampler({ urls: LOUD, release: 0.6 }).connect(Tone.buses.music);
+ const cello = (note: string, dur: string, t: number, vel: number) => (vel < 0.6 ? soft : loud).triggerAttackRelease(note, dur, t, vel);
+ ```
+
+- **A MIDI file** (a Groove MIDI performance, a Mutopia piece): a composition can't read a `.mid` yet. Turn it into
+ a JSON of notes, then play the notes on Samplers and Players:
+
+ ```sh
+ uv run --with mido python3 -I -c '
+ import json, sys, mido
+ t, notes = 0.0, []
+ for m in mido.MidiFile(sys.argv[1]):
+ t += m.time
+ if m.type == "note_on" and m.velocity:
+ notes.append({"time": round(t, 4), "midi": m.note, "vel": round(m.velocity / 127, 3)})
+ json.dump(notes, open(sys.argv[2], "w"))
+ ' media/grooves/funk-92.mid media/grooves/funk-92.json
+ ```
+
+ ```tsx
+ import groove from "./media/grooves/funk-92.json"; // [{ time, midi, vel }]: seconds, at the drummer's 92 bpm
+ // General MIDI drum notes: 36 kick, 38 and 40 snare, 42 and 44 closed hi-hat, 46 open (the dataset lists the rest)
+ const KIT: Record<number, string> = { 36: "kick", 38: "snare", 40: "snare", 42: "hat", 44: "hat", 46: "open" };
+ const stretch = 92 / Tone.getTransport().bpm.value; // the drummer's tempo onto the cue's
+ new Tone.Part((t, n) => kit.player(KIT[n.midi]).start(t), groove.filter((n) => n.midi in KIT).map((n) => ({ ...n, time: n.time * stretch }))).start("4m");
+ ```
+
+ A pitched track's notes go to a Sampler as `Tone.Frequency(n.midi, "midi").toNote()`.
+- **A SoundFont** (`.sf2`, `.sf3`): raea can't play one. To hear a MIDI file the person hands over as it is, render
+ it with FluidSynth (`brew install fluid-synth`, then `fluidsynth -ni -F song.wav -r 48000 MuseScore_General.sf2
+ song.mid`) and play the WAV as `<Audio bus="music">`; to write parts, use the sampled libraries instead.
diff --git a/sdk/guides/craft/rubric.md b/sdk/guides/craft/rubric.md
index eef3827a..602b074d 100644
--- a/sdk/guides/craft/rubric.md
+++ b/sdk/guides/craft/rubric.md
@@ -25,14 +25,32 @@ piece's modes isn't asked.
- land (pitch, story, explain): Does the end land: something this audience can do next, a payoff, or a return to the opening?
- pace (all): Do shot lengths change with what they hold, with no stretch sitting still longer than it earns, and cuts falling on words or beats?
- read (all): Is every word that matters large, sharp against what is behind it, and on long enough to read?
-- sound (all): Is the voice clear over everything else, with music and effects marking moments rather than filling space?
-- sound-silent (silent): With no voice, do the music and the effects carry it: cuts and moments landing on the beat, each effect marking a moment rather than filling space, nothing muddy? (asked in place of sound when no one speaks)
+- sound (all): Is the voice clear over everything else, with music and effects marking moments rather than filling space, and any music written for this cut (a tune, harmony that moves, a rhythm, an ending on a cut) rather than a pad or drone held under it?
+- sound-silent (silent): With no voice, do the music and the effects carry it: cuts and moments landing on the beat, the music composed (a tune, moving harmony, a rhythm, sections that change with the picture), each effect marking a moment rather than filling space, nothing muddy? (asked in place of sound when no one speaks)
- world (all): Do colour, type, motion and sound hold one direction from the first frame to the last?
- own (all): With the name covered, could this only be this project, rather than any product in its category?
- feel (play): Does the player's input change the picture right away and in a way they can read?
- again (play): After a failure, is it clear what went wrong and is the next attempt one press away?
- task (tool): Can the task the screen exists for be done without stopping to work out where to look?
+## Music that sounds generated
+
+Listen for these before the decision model does; each is how a made score gives itself away, and the fix
+(`motion/music`):
+
+- **One held texture.** A pad, a sine sub and a long reverb under everything, no attack anywhere. Write a motif, chords
+ that move and a part with rhythm; reverb per instrument, nothing on the bus.
+- **Harmony that stands still.** One chord for four bars or more in a cue that's meant to move. Change it every bar or two.
+- **A loop, not a cue.** The same two bars for thirty seconds. Vary the motif, change the arrangement every four to
+ eight bars, and turn where the edit turns.
+- **Played by a machine.** Every note at one velocity, exactly on the grid. Spread the dynamics; move played parts a
+ few milliseconds; use a recorded groove.
+- **No ending.** A fade-out. End on a chord or a hit on the last cut.
+- **Everywhere.** Music under every scene because the piece "needs music". Some scenes belong to silence or to their
+ own sound.
+- **The wrong source.** A whole score from TokenSynth takes (organ-like sustains, buzz) or from an SAO "ambient
+ music" prompt. Recorded instruments play the parts; TokenSynth fills a timbre no library has; SAO makes effects.
+
## Ranking
| | Means | Do |
diff --git a/sdk/guides/craft/verbs/quieter.md b/sdk/guides/craft/verbs/quieter.md
index c46f1c45..179ce893 100644
--- a/sdk/guides/craft/verbs/quieter.md
+++ b/sdk/guides/craft/verbs/quieter.md
@@ -18,7 +18,7 @@ note names. Keep the point of view: a quieter piece still has one.
- Light: fewer sources pulsing, shorter pulses, lower bloom. Glow only where the eye should go.
- Colour: lower saturation on what's around the accent, not on the accent.
- Motion: fewer moving things at once, smaller moves, no bounce.
-- Sound: duck the bed further under the voice; drop layers before lowering levels.
+- Sound: duck the music further under the voice; drop parts and layers before lowering levels.
- Never solve quiet with blur, fog or grain that softens the work itself.
## Verify
diff --git a/sdk/guides/craft/verbs/remix.md b/sdk/guides/craft/verbs/remix.md
index 4a65ab3c..b43bb392 100644
--- a/sdk/guides/craft/verbs/remix.md
+++ b/sdk/guides/craft/verbs/remix.md
@@ -5,18 +5,23 @@ sound: voice, music, foley and the master.
## Assess
- Listen once for the voice alone: is every word clear over everything else?
-- Then listen for what's filling space rather than marking moments: a bed at one level under everything, a whoosh on
+- Then listen for what's filling space rather than marking moments: music at one level under everything, a whoosh on
every entrance.
+- Then for what the music is: a tune you could hum, chords that move, a part with rhythm, an ending on a cut; or one
+ held texture (a pad, a drone) under a long reverb.
- With a song, check the cuts and hits against its map.
## Decide
+- What each scene is heard as: silence, its own sound, source music, score. Some scenes need no music.
- What leads: the voice, or the music. Everything else sits under it.
- Which moments get a sound. A few marked moments beat a sound on every one.
## Change
- The voice first; duck music and foley under it.
- Sound marks moments: a hit on the cut that matters, silence before the drop. Remove what only fills.
-- Music: a library instrument first; TokenSynth takes are curated, not trusted. Under a voice, a sparse score.
+- Music: composed for the cut (`motion/music`) on recorded instruments first; TokenSynth takes are curated, not
+ trusted. Under a voice, thin the arrangement and let the tune answer between lines.
+- Effects: layered (a transient, a body, a tail), with repeats varied (`motion/sound`).
- Master at -14 LUFS integrated, true peak at or below -1 dBTP.
## Verify
@@ -24,6 +29,8 @@ sound: voice, music, foley and the master.
## When it goes wrong
- The voice is clear on headphones and buried on a phone's speaker.
-- The music pumps as it ducks under the voice. Use a slower release, or a lower bed.
+- The music pumps as it ducks under the voice. Use a slower release, or lower music.
+- The score has turned into a drone: one chord held under a long reverb. Move the harmony, add a part with rhythm,
+ and take the reverb off the bus.
- Clipping, or a true peak over the limit. Measure, and don't trust the meter by eye.
- The loudness is off the delivery's spec.