> ## Documentation Index
> Fetch the complete documentation index at: https://songbird.studiocollective.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Export

# Export System

Tivra supports exporting stems, masters, and MIDI from both the GUI and CLI.

## Stem Types

| Mode              | Flag         | Plugins     | Signal Path                                 | Use Case                                            |
| ----------------- | ------------ | ----------- | ------------------------------------------- | --------------------------------------------------- |
| **Dry**           | `--dry`      | None        | Raw clips only                              | Sharing with collaborators for re-mixing            |
| **Wet**           | `--wet`      | Track chain | Through track inserts (EQ, comp, etc.)      | Stems for mastering                                 |
| **Wet + Returns** | `--wet-full` | Full path   | Through sends and return FX (reverb, delay) | "What it sounds like in the mix" (minus master bus) |

### How Each Mode Renders

* **Dry**: Single-track bitset with `usePlugins=false`. Produces the raw audio clips for each track.
* **Wet**: Single-track bitset with `usePlugins=true, useMasterPlugins=false`. Applies the track's insert plugin chain (channel strip, EQ, compressor, etc.) but not the master bus.
* **Wet + Returns**: Full bitset with all other content tracks muted (return tracks stay unmuted), `usePlugins=true, useMasterPlugins=false`. The track's audio flows through its sends to return tracks (reverb, delay) which remain active. Master bus FX are excluded — use a separate `--master` export for the full mastered bounce.

> **Note**: Summing all "wet+returns" stems will double-count return FX since the same reverb return appears in every track's stem that sends to it. Use "wet" stems if you need stems that sum cleanly.

## Take Lanes

Each track can have take lanes (alternate recordings). When exporting with take lanes enabled (`--lanes`), the system:

1. Iterates through each take lane defined in the `.bird` file
2. For each lane, temporarily mutes all clips except those belonging to that lane (via the `birdLane` clip property)
3. Renders the track
4. Restores original mute states

Take lane stems are named `TrackName_LaneN.wav`.

## Master with Take Lane Variations

For A/B comparison of takes in a full mix context, master exports can swap in specific take lanes:

```
--master-lanes 0:1,0:2
```

This renders separate master bounces where track 0's active clips are swapped to lane 1, then lane 2, producing `Master_TrackName_Lane1.wav` and `Master_TrackName_Lane2.wav`.

## CLI Export

### Interactive Mode

```bash theme={null}
./utils/export.sh <project.bird>
```

Presents a menu:

1. **Master** — stereo master bounce, optional take lane variations
2. **All stems** — all tracks, choose stem type (dry/wet/wet+fx)
3. **Selected tracks** — pick specific tracks, with per-track take lane option

### Non-Interactive Flags

```bash theme={null}
./utils/export.sh <project.bird> --dry --wet --master --lanes --skip-build
```

| Flag                 | Description                              |
| -------------------- | ---------------------------------------- |
| `--dry`              | Dry stems (no effects)                   |
| `--wet`              | Wet stems (track plugin chain)           |
| `--wet-full`         | Wet stems + return bus FX                |
| `--master`           | Master stereo bounce                     |
| `--lanes`            | Include take lanes as separate stems     |
| `--tracks 0,1,2`     | Specific track indices (0-based)         |
| `--master-lanes T:L` | Master with take lane swaps (track:lane) |
| `--output <dir>`     | Custom output directory                  |
| `--skip-build`       | Skip C++ build step                      |

### Output Directory

Exports are saved to `<project>/stems/<timestamp>/` with subdirectories:

* `dry/` — dry stems
* `wet/` — wet stems
* `wet_returns/` — wet+returns stems
* Root — master bounces

## GUI Export

The Export popover in the toolbar provides the same options:

* **Master** — with optional take lane variation selection
* **Stems** — dry, wet, or wet+returns, with take lanes toggle
* **MIDI** — sheet music export
