# The Recorder — the tap, the file, the library

The Recorder taps the master output and writes it to a lossless WAV file. One button to start, one button to stop. It's how you capture takes, render arrangement variations, and round-trip sound design (record a DSP → re-import as a sample → use in another DSP).

This section covers the signal model and what lands on disk; the next section covers the workflows + the MCP catalog.

## The signal tap

The Recorder is registered in the routing table as an **audio Sink** named `recorder-default`. Its bus consumes `master:out` — the same signal your speakers receive, after the master FX rack, after the master volume, after the softclip stage.

That means:

- **Everything you hear, you record** — every Builder, every sequencer-driven instrument, every send return, the lot.
- **A muted track is silent in the recording too** — mute / solo on the Mixer is a real take-management tool.
- **Master FX affects the recording** — the reverb tail, the saturator drive, the softclip protection. The recording captures the master signal AS-RENDERED, not the pre-fader sources.

If you want to record ONE source dry (e.g. a Builder without master FX), three options:

1. **Solo its mixer track during the take** — simplest. Master FX still applies; everything else is silent.
2. **Solo + disable master FX slots** — `master.fx.slot.enabled.set { slot_id, enabled: false }` per slot during the take. Dry source, no master colour.
3. **Direct route to the Recorder** — `routing.connect { from_source: <builder-id>, to_sink: "recorder-default", kind: "audio" }`. The default `master → recorder-default` cable stays; you add a second cable that bypasses the master entirely. Sum-into-recorder if you don't disconnect the master cable; pure-source if you do.

See **FaustWave — Patchbay** § 4 for the routing.* primitives, **FaustWave — Mixer & Master** § 2 for the FX-rack actions.

## The Rec button

Four ways to start / stop a recording, all driving the same underlying state:

1. **Master Transport Widget Rec button** — the red dot near the right end of the topbar widget, immediately left of the Panic button. Pulses red while recording. Click to start; click again to stop.
2. **Recorder rail panel toggle** — same control, plus the recordings library on the panel body.
3. **MCP** — `recorder.start`, `recorder.stop`, `recorder.toggle`.
4. **AI Assistant** — *"record the next loop pass"* routes through the same `recorder.toggle` action.

All four sync to one underlying `recorderState` Svelte store — click the rail panel button while a chain is firing `recorder.toggle` and you'll see the panel flip even though the press came from elsewhere.

## What gets written

| Property | Default |
|---|---|
| Format | **32-bit float WAV** |
| Sample rate | Project's sample rate (typically 44.1 kHz or 48 kHz, set in Audio Inputs panel) |
| Channel count | Stereo (2 channels, master out) |
| Naming | `<ISO-date>_<random-suffix>.wav`, e.g. `2026-06-07T08-46-22_abc123.wav` |

32-bit float is lossless within the AudioContext's processing range — no clip distortion in the file even if the master meter shows red (the softclip kicks in earlier; the file captures the softclipped signal). About 12 MB per minute stereo at 48 kHz, so a long take is big but pristine.

For sharing, transcode to 16-bit or 24-bit FLAC via ffmpeg / Audacity:

```bash
# 24-bit FLAC, lossless, ~2-3× smaller than 32-bit float WAV
ffmpeg -i 2026-06-07T08-46-22_abc123.wav -c:a flac -sample_fmt s32 output.flac
```

## Where the files live

| OS | Path |
|---|---|
| **Windows** | `%APPDATA%\FaustWave IDE\recordings\` |
| **macOS** | `~/Library/Application Support/FaustWave IDE/recordings/` |
| **Linux** | `~/.config/FaustWave IDE/recordings/` |

Electron's standard `userData` location — same place your projects + node-packs + Logto session live. The Recorder rail panel has a **Reveal** button per recording that opens the OS file manager directly at the file.

## The recordings library

The Recorder rail panel lists every recording ever made, newest first. Each row carries:

- **Name** — the timestamped filename.
- **Duration** in seconds.
- **Size** on disk.
- Three action buttons:
  - **Play** — in-app preview via the audio system, independent of the master transport.
  - **Reveal** — open the file in the OS file manager.
  - **Delete** — hard-delete. No trash (greenfield discipline) — the file is gone the moment you click. Confirm with care.

> 🔘 **MCP**: `recordings.list` returns the library. `recordings.play { recording_id }` plays one. `recordings.delete { recording_id }` removes one. Use `recordings.list` to discover ids.

## A library-introspection chain

```yaml
actions:
  - action_id: surface.open
    input: { surface: recorder-default }
    label: "▶ 0. Open the Recorder panel"
  - action_id: recordings.list
    input: {}
    save_as: lib
    label: "▶ 1. List existing recordings"
  - action_id: recorder.start
    input: {}
    label: "▶ 2. Start a new recording"
  - action_id: recorder.stop
    input: {}
    save_as: rec
    label: "■ 3. Stop + finalize (returns the WAV path)"
```

> 🟦 **HANDS-FREE PATH**: step 1 captures the current library so you can see what was there. Step 2 arms the Recorder; let some audio play (a sequencer pass, a manual keyboard note, anything). Step 3 finalizes; the new entry is now in `recordings.list` next time you call it.

## State observability

The Recorder does NOT expose a state-snapshot MCP action of its own. Two ways to introspect:

- **Observable state** — the rail panel + the Rec button stay in sync because they subscribe to `recorderState`. If the panel says "recording", the Recorder is recording.
- **Library is the audit log** — every Stop writes a row to the library; `recordings.list` is the historical record. Compare two `recordings.list` snapshots to detect what landed between them.

Next section: the workflows — the 30-second take, round-trip into the sample store, the live-perf capture pattern.
