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.

References and the agent's prompt teach sound the way the guides now do.

shinyobjectz620cfe074453
diff --git a/docs/manual/reference/cli/sao.md b/docs/manual/reference/cli/sao.md
index f688a5b1..8455c3e0 100644
--- a/docs/manual/reference/cli/sao.md
+++ b/docs/manual/reference/cli/sao.md
@@ -12,9 +12,15 @@ with [`raea setup-audio`](setup-audio.md)).
```sh
raea sao "a heavy wooden door creaks open" --seconds 3 -o door.wav
-raea sao "rain on a tin roof" --seconds 8 --seed 4
+raea sao "rain on a tin roof" --seconds 8 --seed 4 -o media/sfx/rain-4.wav
```
+A take is up to 11.9 s long; a longer `--seconds` comes back that long. Another `--seed` is another take of the same
+prompt: `sao()` in a composition has no seed, so play a seed's take from its file (`staticFile("sfx/rain-4.wav")`).
+Stable Audio Open Small does better on effects and field recordings than on music, so build an effect from short
+layers (a transient, a body, a tail) and write music as notes on instruments (`raea guide music`). Its licence is
+Stability AI's Community License: [`raea setup-audio`](setup-audio.md) says what that means.
+
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
## Usage
diff --git a/docs/manual/reference/cli/setup-audio.md b/docs/manual/reference/cli/setup-audio.md
index b0df87f8..42bf402c 100644
--- a/docs/manual/reference/cli/setup-audio.md
+++ b/docs/manual/reference/cli/setup-audio.md
@@ -14,6 +14,22 @@ raea setup-audio --check
raea setup-audio tokensynth
```
+Each model's script (`share/raea/tools/sao/setup.sh` and `share/raea/tools/tokensynth/setup.sh` beside an installed
+raea) installs it into `~/.cache/raea-sao` or `~/.cache/raea-tokensynth` (`RAEA_SAO` and `RAEA_TOKENSYNTH` move them):
+
+- **SAO, about 2 GB:** Stable Audio Open Small's Core ML models 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 a T5 encoder converted once.
+ Its licence is Stability AI's Community License, not an open one: free, commercially too, for a person or
+ organisation under USD 1 million in annual revenue; above that, Stability's enterprise licence
+ ([stability.ai/license](https://stability.ai/license)). The sounds it makes are yours.
+- **TokenSynth, about 6 GB:** its code from GitHub, a Python environment with torch, and its weights, DAC and CLAP
+ from Hugging Face, then a converted fp16 runtime. MIT.
+
+Both need a network connection and [uv](https://docs.astral.sh/uv/) on the PATH; TokenSynth also needs `git`. When a
+setup fails, the error names its script: run that with `sh` to see why (exit status 127 is uv or git missing, 75 is
+another setup running in the same folder). `RAEA_AUDIO_AUTOSETUP=0` stops a render from installing a model itself,
+and `RAEA_OFFLINE` refuses the download.
+
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
## Usage
diff --git a/docs/manual/reference/cli/sounds.md b/docs/manual/reference/cli/sounds.md
index 5368364a..cd9d2775 100644
--- a/docs/manual/reference/cli/sounds.md
+++ b/docs/manual/reference/cli/sounds.md
@@ -11,10 +11,16 @@ Tone.js `Sampler`. For a pitched instrument it takes one sample per note, at the
```sh
raea sounds piano
-raea sounds get vcsl/upright-piano --notes C2,C3,C4,C5 -o media/piano/
-raea sounds get vcsl/bass-drum --all
+raea sounds get vcsl/upright-piano-knight --notes C2,C3,C4,C5 -o media/piano/
+raea sounds get vcsl/bass-drum-1 --all
```
+The ids are exact: `raea sounds kick` lists the kicks by their ids (`vcsl/bass-drum-1`, `-2`, `-3-legacy`). A drum or a
+hit comes as its first 12 takes unless `--all` is given. The four libraries are Salamander's grand piano and FluidR3's
+General MIDI set (both CC-BY 3.0: credit them), tonejs-instruments (public domain and CC-BY, per instrument) and the
+Versilian Community Sample Library (CC0). Larger libraries, effect packs and MIDI grooves are fetched by hand:
+`raea guide sources` lists them with their licences.
+
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
## Usage
@@ -29,7 +35,7 @@ Headless: it needs nothing running and opens no window. Takes up to 2 arguments
| Flag | Takes | What it does |
| --- | --- | --- |
-| `--all` | – | Fetch every sample the instrument has: every note, dynamic and round robin. |
+| `--all` | – | Fetch every sample: a pitched instrument's every sampled note (still one take a note, at the middle dynamic), a drum's every take. |
| `--notes` | `..\|--all` | Fetch only these notes, comma-separated (`C2,C4`). |
| `-o` | `DIR` | The folder the samples go to. |
diff --git a/docs/manual/reference/cli/tokensynth.md b/docs/manual/reference/cli/tokensynth.md
index f61cbb36..efaabe5f 100644
--- a/docs/manual/reference/cli/tokensynth.md
+++ b/docs/manual/reference/cli/tokensynth.md
@@ -11,9 +11,13 @@ writes one file per note: a sample set for a Sampler. Like `raea sao`, it shares
```sh
raea tokensynth "warm analog bass" --notes C1,C2,C3 -o media/bass/
-raea tokensynth "glassy bell pad" --seconds 4 --velocity 80
+raea tokensynth "a bowed saw, close, eerie" --notes C3,E3,G#3,C4 --seconds 4 --velocity 80 --seed 7
```
+Use it for a timbre no recorded library has ([`raea sounds`](sounds.md) first for a piano, strings or drums). A take
+can miss its pitch or come out as hiss, so make a few seeds of each root and keep the ones that pass
+(`raea guide music`, "Instruments from TokenSynth"). A note is held under 5 s.
+
<!-- generated:begin by tools/manual-ref/cli.ts from `raea help --json`; edit only the flag descriptions -->
## Usage
diff --git a/docs/manual/reference/sdk/audio.md b/docs/manual/reference/sdk/audio.md
index 6ba11f75..0a99c597 100644
--- a/docs/manual/reference/sdk/audio.md
+++ b/docs/manual/reference/sdk/audio.md
@@ -17,8 +17,8 @@ import { Audio, Mix } from "raea/audio";
function Soundtrack() {
return (
<Mix lufs={-14} ceiling={-1}>
- <Audio src={staticFile("media/voice.wav")} bus="voice" />
- <Audio src={staticFile("media/bed.m4a")} bus="music" gainDb={-12} fadeOut={1.5} />
+ <Audio src={staticFile("voice.wav")} bus="voice" />
+ <Audio src={staticFile("rain.m4a")} bus="ambience" gainDb={-18} fadeOut={1.5} />
</Mix>
);
}
@@ -40,7 +40,7 @@ Sound in step with the frame; no picture. A muted or ended Audio is silent.
| Prop | Type | What it does |
| --- | --- | --- |
-| `src` (required) | `string \| GeneratedAsset` | a file URL, or a generated asset from lyria() or sao() |
+| `src` (required) | `string \| GeneratedAsset` | a file URL (staticFile), or a generated sound from sao() |
Also takes the props of [`MediaProps`](video.md#mediaprops).
diff --git a/docs/manual/reference/sdk/raea.md b/docs/manual/reference/sdk/raea.md
index 30778704..8be31314 100644
--- a/docs/manual/reference/sdk/raea.md
+++ b/docs/manual/reference/sdk/raea.md
@@ -69,7 +69,7 @@ Sound in step with the frame; no picture. A muted or ended Audio is silent.
| Prop | Type | What it does |
| --- | --- | --- |
-| `src` (required) | `string \| GeneratedAsset` | a file URL, or a generated asset from lyria() or sao() |
+| `src` (required) | `string \| GeneratedAsset` | a file URL (staticFile), or a generated sound from sao() |
Also takes the props of [`MediaProps`](video.md#mediaprops).
diff --git a/engine/cli/src/index.ts b/engine/cli/src/index.ts
index 64969e6c..1e7fdfed 100644
--- a/engine/cli/src/index.ts
+++ b/engine/cli/src/index.ts
@@ -97,9 +97,11 @@ Layout: <AbsoluteFill>, <Sequence from durationInFrames>, <Series><Series.Sequen
Media: <Video src startFrom endAt volume playbackRate muted framing="face" punchIn style> (framing="face" keeps the
eyes 38% down as the speaker moves; an objectPosition or transform turns it off), <Audio src startFrom endAt volume={n | (f) => n} gainDb fadeIn fadeOut>,
<Img src>. Media files import as modules: import take from
-"./media/x.mov". Sound: music in Tone.js (import * as Tone from "raea/tone"): instruments in a Tone.Sampler
-playing a Part or Sequence, the instrument's notes from Tone.tokensynth("a warm upright bass", ["C2", "C3", "C4"]) or a
-sample library (\`raea sounds\`); sao("prompt", {seconds}) for an effect, as an <Audio src>; narration
+"./media/x.mov". Sound: decide what each scene is heard as first (silence, its own sound, score, effects); music,
+where there is some, in Tone.js (import * as Tone from "raea/tone"), composed for the cut (a motif, chords that move,
+a part with rhythm, ending on a cut; never a pad or drone by default): instruments in a Tone.Sampler playing Parts and
+Sequences, the notes from a sample library (\`raea sounds\`, \`raea guide sources\`) or, for a timbre no library has,
+Tone.tokensynth("a bowed saw, close", ["C3", "C4", "C5"]); sao("prompt", {seconds}) for an effect, as an <Audio src>; narration
is <Speech text start> from raea/speech (Pocket TTS). All of it local. <Mix lufs ceiling> masters the sound.
Words: useWords() -> [{text, from, to}] (frames, the cuts' words), word("phrase") -> the frame it's said,
findPhrase(words, "phrase", {occurrence, edge: "start" | "end"}).
diff --git a/sdk/react/docs/audio-stack.md b/sdk/react/docs/audio-stack.md
index 0377c125..2499ad67 100644
--- a/sdk/react/docs/audio-stack.md
+++ b/sdk/react/docs/audio-stack.md
@@ -258,7 +258,7 @@ A Sampler's `urls` and a Player's `url` take a media path, or a generated asset:
- `Tone.tokensynth(timbre, notes, {seconds, velocity, seed, precision})`: one asset per root note, by TokenSynth,
local CPU. The Sampler pitches between the roots. This is how raea makes music.
- `Tone.sao(prompt, {seconds})`: foley, by Stable Audio Open Small on Core ML, local.
-- `Tone.lyria(prompt)`: a music bed, by Lyria, paid. Still wired; the guides no longer use it.
+- `Tone.lyria(prompt)`: retired. A take an older edit made still plays; a new one is refused.
- A file from an open sample library in the media folder: `raea sounds get PACK/INSTRUMENT` (below).
How a source is made and played:
diff --git a/sdk/video/src/media.tsx b/sdk/video/src/media.tsx
index 2df81170..64702492 100644
--- a/sdk/video/src/media.tsx
+++ b/sdk/video/src/media.tsx
@@ -87,7 +87,7 @@ export function matteStyle(m: VideoMatte, seconds: number, fit: CSSProperties["o
}
export type AudioProps = Omit<MediaProps, "style" | "className" | "src"> & {
- /** a file URL, or a generated asset from lyria() or sao() */
+ /** a file URL (staticFile), or a generated sound from sao() */
src: string | GeneratedAsset;
};