# Mixing inside the byte budget

The mix in Soundfish is authored, not monitored: track volume, sends, pan,
cutoff, and the shared reverb and delay live in the URL and count toward its
bytes. Set them once in compose, then adjust with `set-volume`, `set-send`,
`set-pan`, `set-cutoff`, and `set-effects`.

## Register per role

| Role | Register | Why |
| --- | --- | --- |
| Kick | 36 or 35 | one fundamental below 120 Hz |
| Sub or 808 bass | C1 to C2 (24 to 36) | sits under the kick; long notes, no sends |
| Bass | C1 to C3 (24 to 48) | `lint` flags bass notes above C3 (`bass-register`) |
| Chords | C4 to C6 (60 to 84) | a chord tone below C4 that doubles the bass root muddies both (`chord-register`) |
| Pad | C3 to C5 with `cut` 5,000 to 7,000 | the filter keeps the pad off the bass |
| Lead | C4 to C6 | above the chords' top note or between the chord stabs |
| Hats and cymbals | 42, 44, 46, 49, 51 | accents carry the groove |

`analyze` prints each track's lowest and highest pitch and its register band;
`transpose <track> ±12` moves a whole track an octave.

## Accents

Hats alternate strong and weak: `x` (110) on the downbeats and `o` (90) on the
offbeats in a row, or `@70/95` to set the pair. `accent <track> --pattern
100,70,85,70` scales every event on the track by the percentage at its step,
cycling the pattern (four values give one per sixteenth of a beat).
Snare backbeats at 100 to 115, ghosts at 55 to 70. Chords at 90 to 100, the
last chord of a phrase 10 lower.

## Volume and headroom

- A track without `vol` is 10,000 (the editor starts new tracks at 8,000,
  drums 9,000). Write `vol 8000` on notes tracks and `vol 9000` on drums. The master has a fixed trim and a hard ceiling; eight
  tracks at 10,000 sit in that ceiling (`volume-headroom`).
- Bass and kick are the loudest sources; everything else sits 1,000 to 3,000
  below them. Pads 5,500 to 6,500, keys 6,500 to 7,500, leads 5,500 to 7,000.
- `render --dry` (repository checkout only) prints per-track peak, RMS, crest
  factor, and the share of energy below 120 Hz, 120 to 500 Hz, 500 Hz to
  2 kHz, and above 2 kHz. A bass with more than half of its energy above
  500 Hz is not doing a bass's job (`bass-band`); a mix led below 120 Hz by a
  pad is crowded (`sub-band-crowding`); a dry peak at 1.00 clips
  (`mix-clipping`).

## Sends and returns

| Control | Range | Default | Use |
| --- | --- | --- | --- |
| `rev` (track reverb send) | 0 to 10,000 | 0 | keys and pads 2,000 to 3,500; leads 1,500 to 2,500; snare 500 to 1,500; kick and bass 0 |
| `del` (track delay send) | 0 to 10,000 | 0 | leads and stabs 1,500 to 3,000; keys 1,000 to 2,000; kick and bass 0 |
| `fx reverb` (return) | 0 to 10,000 | 2,000 | 1,500 dry pop; 3,500 ambient |
| `fx delay` (return) | 0 to 10,000 | 2,500 | how loud the repeats come back |
| `fx feedback` | 0 to 9,500 | 3,500 | above 6,000 the repeats pile up (`delay-feedback`) |
| `fx time` | 62 to 4,000 milli-beats | 500 | see the presets |

`low-end-send` fires when a bass track or a drums track with a kick carries a
send: `set-send <track> --reverb 0 --delay 0`.

## Delay presets

Delay time is in milli-beats, so the presets hold at every tempo.

| `fx time` | Note value | Feel |
| ---: | --- | --- |
| 250 | sixteenth | slap, thickening |
| 333 | triplet eighth | shuffle, dub |
| 500 | eighth | the default; house and pop |
| 750 | dotted eighth | the classic lead delay |
| 1,000 | quarter | echo, ballads |
| 1,500 | dotted quarter | long ambient repeats |

## Pan and cutoff

- `pan` runs 0 (left) to 10,000 (right); 5,000 is center. Keep kick, snare,
  bass, and the lead centered. Hats 4,000 or 6,000, keys 4,200 to 5,800, a
  second keys or guitar part on the opposite side.
- `cut` is a low-pass from 200 Hz (0) to 20 kHz (10,000) on a logarithmic
  scale: 2,500 is about 630 Hz, 5,000 is 2 kHz, 7,500 about 6.3 kHz. Pads at
  5,000 to 7,000, leads 4,000 to 8,000, keys 7,000 to 9,000; drums and bass
  open (10,000) unless you want a dark lo-fi kit at 6,000.
- Both are automatable: `set-cutoff <track> --points 0:2000:linear,63:10000`
  sweeps a pad open over four bars.

## Swing

`swing N` delays every odd sixteenth by N percent of half a step. 0 is
straight (house, techno, orchestral); 15 to 35 loosens boom-bap and breaks;
55 to 66 is a shuffle or triplet feel (jazz, garage). Swing is a document
setting, so every track shares it.

## Byte budget

- A loop holds at most 24,493 canonical bytes; that is the binding limit. The
  event cap (832 per loop, 512 per track) is secondary. `analyze` prints bytes
  used and `lint` warns above 80% (`byte-budget`).
- An event costs about 22 bytes; an automation point about 10; an extra
  track about 100 before its events; derived lineage and long titles more. Sixteen bars of
  four dense tracks fit; sixteen bars of sixteen dense tracks do not.
- To fit: `thin <track> --to-bytes 20000` drops the quietest events first,
  shorten names, remove unused tracks, replace per-event repetition with
  fewer bars and `double`, or split the arrangement into a song of shorter
  loops.
