7. Reference

III. Reference

Reference

Everything the sampler takes, in one place: its params, as a song's lanes, a controller, and its file name them; the panel's other controls; its state in a song's file and in a program file; its limits; and its commands. The chapters before teach each one.

Params

NameRangeDefaultCurveFor
level-60 dB to 6 dB0 dBlineareach channel
pan-100% to 100%0%lineareach channel
mutedoff / onoffswitcheach channel
tune-24 semitones to 24 semitones0 semitoneslineareach channel
cutoff30 Hz to 20000 Hz20000 Hzexponentialeach channel
resonance0% to 100%0%lineareach channel
filter_env-6 octaves to 6 octaves0 octaveslineareach channel
key_follow0% to 100%0%lineareach channel
velocity_cutoff0% to 100%0%lineareach channel
attack0.001 s to 10 s0.001 sexponentialeach channel
decay0.01 s to 30 s1 sexponentialeach channel
sustain0% to 100%100%lineareach channel
release0.005 s to 30 s0.3 sexponentialeach channel
filter_attack0.001 s to 10 s0.001 sexponentialeach channel
filter_decay0.01 s to 30 s1 sexponentialeach channel
filter_sustain0% to 100%100%lineareach channel
filter_release0.005 s to 30 s0.3 sexponentialeach channel
lfo_rate0.05 Hz to 20 Hz5 Hzexponentialeach channel
lfo_wavetriangle / square / random / noisetriangleswitcheach channel
lfo_delay0 s to 5 s0 scubeeach channel
lfo_pitch0 semitones to 12 semitones0 semitonescubeeach channel
lfo_cutoff0 octaves to 4 octaves0 octavescubeeach channel
lfo_level0% to 100%0%cubeeach channel
velocity_level0% to 100%75%lineareach channel
grain16-bit / 12-bit16-bitswitcheach channel
bend-1 to 10lineareach channel
repeatoff / 1/4 / 1/8 / 1/8T / 1/16 / 1/16T / 1/32offswitcheach channel
levelsoff / tune / velocityoffswitcheach channel
levels_pad1 to 161linear, steps of 1each channel

Every param is a channel's. level, pan, muted, bend, repeat, levels, and levels_pad are the channel's own; the rest, from tune to grain, are the sound of the program the channel plays, so turning one turns it in the program (chapter 2). bend is played by the pitch wheel, two semitones either way, and isn't saved. A lane on a sampler's track names a param by its name, as cutoff (lanes).

A controller's pages

PageKnobs 1 to 8
1 filtercutoff, resonance, filter_env, key_follow, velocity_cutoff, tune, velocity_level, level
2 filter envfilter_attack, filter_decay, filter_sustain, filter_release, attack, decay, sustain, release
3 lfolfo_rate, lfo_wave, lfo_delay, lfo_pitch, lfo_cutoff, lfo_level, pan, level

A controller's faders play the amplifier's envelope, attack, decay, sustain, and release (chapter 18). The pads are on the keys C2 to D♯3, pad 1 to pad 16 (chapter 4).

The panel's other controls

The controls that aren't params change the bank: a program, a keygroup, or a sample. They're the song's, saved with it, but no lane or controller reaches them.

Page Control Range
program voices 1 to 16
program kg xfade on or off
keygroups low key, high key C−1 to G9
keygroups tune −48 to 48 semitones, in hundredths
keygroups level −60 to 24 dB
keygroups pan −100 to 100
keygroups cutoff −8 to 8 octaves
keygroups vel xfade on or off
keygroups attack to release the program's, or as the amplifier's params
keygroups a zone's sample the bank's samples
keygroups a zone's velocities 0 to 127, its low and its high
keygroups a zone's tune −1200 to 1200 cents
keygroups a zone's level −60 to 24 dB
samples root C−1 to G9
samples fine −100 to 100 cents
samples gain −60 to 60 dB
samples the mode in release, until release, no loops, one shot
samples start, end the sound's frames, shown in milliseconds and seconds
samples fit off, or 1, 2, 4, 8, or 16 bars
samples loop start, loop end the sound's frames
samples crossfade 0 to 96,000 frames, the loop's length, or its start
samples plays hold, or 1 to 100 times
record stereo on or off
record bandwidth 20 kHz or 10 kHz
record pitch C−1 to G9
record length 1 to 60 seconds
record start at once on or off
record threshold −60 to 0 dB
record pre-trigger 0 to 100 ms
record gain −24 to 24 dB

A slider drags across its width for its whole travel, the wheel nudges it a hundredth of its travel or a step, and a double-click puts it back, a keygroup's envelope to the program's. The record page's controls are the panel's, for its takes, and the song doesn't keep them.

The sampler's state

A sampler's state, in its device in song.json, holds its channels, its programs, and its samples. This one is a part of chapter 1's stutter song, with a channel more:

{
  "channels": [
    { "channel": 1, "program": 1 },
    { "channel": 2, "program": 2, "level": -6, "repeat": "1/16" }
  ],
  "programs": [
    {
      "program": 1,
      "name": "stutter",
      "sound": { "release": 30 },
      "keygroups": [{ "keys": "C-1 G9", "zones": [{ "sample": "phrase" }] }]
    },
    { "program": 2, "file": "programs/piano.json" }
  ],
  "samples": {
    "phrase": {
      "file": "loops/phrase.wav", "root": "C4", "end": 230400, "gain": 12, "mode": "until_release",
      "loops": ["0 28800 0 4", "70150 96164 4800 hold"]
    }
  }
}
  • Channels are a list, each with its channel, 1 to 16, and the program it plays, 1 to 100; and its own params where they aren't their defaults: level, pan, muted, repeat, levels, and levels_pad. A channel left out plays program 1 at its defaults.
  • Programs are a list, each an object with its program number, or the next after the one before; its name; polyphony, 1 to 16, and crossfade, true or false, the panel's voices and kg xfade; its sound, an object of params from tune to grain, the rest at their defaults; and its keygroups. A program may instead name a program file in the library with file, or be just the file's name in the list; a name beside file renames it in the song.
  • A keygroup has its keys, one key or two, as "C2" or "A0 B0"; a tune in semitones, a level in dB, a pan, and a cutoff in octaves; velocity_fade, false for zones that layer; its own attack, decay, sustain, and release where it has them; and its zones, up to four.
  • A zone names its sample, and has its velocity, two numbers from 0 to 127, as "94 127", and a tune in cents and a level in dB.
  • Samples are an object, by name, 1 to 24 bytes. Each has its file, its place in the library; its root, a key's name or number, and cents, the panel's fine; start and end, in frames; gain in dB; mode, one of in_release, until_release, none, and one_shot; and up to eight loops, each its start, its end, and its crossfade, in frames, and how many times it plays, or hold.

A switch's position is its name, as "12-bit" or "1/16", and muted is true or false. Anything left out is at its default, and a sample's cents left out is its file's own, if the file gives a root. Reading checks every name and range, and a mistake names its line, as sample phrase: a loop's crossfade is no longer than the loop, or the frames before it.

A song saved from the window writes every program whole, with its keygroups, and every sample, a program named by a file among them, so the saved song no longer follows the file.

Program files

A program file is one program's object, as a song holds it, with the samples it plays beside its keygroups, under samples. studio import-sfz writes them, and so might you, to keep a program to use in many songs. Its samples are named by their places in the library, as a song's are.

A song names one in its programs, as { "program": 2, "file": "programs/piano.json" }. On the samples page, a click on a program file in the library loads it into the program the channel plays, in place of its keygroups, named after the file if it has no name of its own.

Limits

What How many
Channels 16
Voices, all channels together 16
Programs 100
Keygroups, all programs together 512
Zones a keygroup 4
Samples a note plays 8
Samples 256
Loops a sample 8
A sample's name 24 bytes
Sounds in the sample memory 1024
A file's name in the library 200 bytes
Sample memory 512 MB, or 1 MB to 64 GB with --sample-memory
A take 60 seconds, with up to 100 ms before it
Devices in a song 8

The command line

studio import-sfz INSTRUMENT.sfz PROGRAM.json [--name NAME]
studio --library DIR ...          # name samples in another library folder
studio --sample-memory MB ...     # a pool of another size, for every sampler
tools/fetch-samples.sh [LIBRARY]  # fill the library: the piano, the sea, the break, two loops

import-sfz reads an SFZ in the library folder and writes a program file, and says what it made, folded, and left out (chapter 2). --library and --sample-memory go with every command, the window's and render alike; the studio's command line has the rest.

Next: chapter 19, every key, the studio's reference after its instruments: every key, every gesture of the mouse, and every mark the window draws.