Digital sampler

Owner's Manual

The Salamander Grand Piano played soft and then loud, on the sampler's keygroups page, 7.6 seconds in. Each bar over the keyboard is a keygroup: a stretch of keys and the samples they play. The amber ones are playing the loud F chord and the A4 before it, and the soft A minor chord, still in its release. The bright one, selected, plays the C5 sounding now, and the fields under the keyboard are its own: its four zones of velocity.: the full

0.0 / 11.4 s

peak -5.2 dBFS

Fig. 1 The Salamander Grand Piano played soft and then loud, on the sampler's keygroups page, 7.6 seconds in. Each bar over the keyboard is a keygroup: a stretch of keys and the samples they play. The amber ones are playing the loud F chord and the A4 before it, and the soft A minor chord, still in its release. The bright one, selected, plays the C5 sounding now, and the fields under the keyboard are its own: its four zones of velocity.

scriptzig build run-studio -- manual/sampler/index/cover --view device --track 1 --script manual/sampler/index/cover.txt

renderzig build run-studio -- render manual/sampler/index/cover cover.wav

cover/song.json
{
  "tempo": 84,
  "end": "5",
  "key": ["1 C major"],
  "devices": [{
    "name": "S1000",
    "type": "sampler",
    "state": {
      "channels": [{ "channel": 1, "program": 1, "level": -8 }],
      "programs": [{ "program": 1, "file": "programs/piano.json" }]
    }
  }],
  "desk": { "strips": { "S1000": { "reverb": -16 } } },
  "tracks": [
    {
      "name": "piano",
      "device": "S1000",
      "channel": 1,
      "clips": [
        { "at": "1", "length": "2.0.0", "notes": "soft" },
        { "at": "3", "length": "2.0.0", "notes": "loud" }
      ]
    }
  ],
  "notes": {
    "soft": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 C3 1.0.0 28",
        "1.1.0 G3 1.0.0 28",
        "1.1.0 E4 0.2.0 34",
        "1.3.0 D4 0.2.0 30",
        "2.1.0 A2 1.0.0 28",
        "2.1.0 E3 1.0.0 28",
        "2.1.0 C4 0.2.0 34",
        "2.3.0 B3 0.2.0 30"
      ]
    },
    "loud": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 F1 1.0.0 120",
        "1.1.0 F2 1.0.0 112",
        "1.1.0 C3 1.0.0 112",
        "1.1.0 A4 0.2.0 122",
        "1.3.0 C5 0.2.0 118",
        "2.1.0 G1 1.0.0 124",
        "2.1.0 G2 1.0.0 116",
        "2.1.0 D3 1.0.0 116",
        "2.1.0 B4 0.2.0 127",
        "2.3.0 G5 1.0.0 127"
      ]
    }
  }
}
cover.txt
# The piano playing on the keygroups page, in bar 3, with the keygroup
# that plays C5 selected.
key space
wait 7.4
click 143 67
click 824 102
wait 0.1
capture cover.png

This is the manual for the sampler, the studio's third instrument: an Akai S900 grown into an S1000, with the sixteen pads of an MPC60. It plays recordings. A piano recorded at sixteen strengths becomes a program you play from the keys; a drum break becomes sixteen slices on the pads; a phrase stutters on its first beat and holds its high note for as long as a key is down. It teaches sampling from the beginning, with the instrument itself as the apparatus: every sound in it was rendered by the studio, every picture is a capture of its window, and every example is a small song you can open, play, and change.

Before you start

The sampler lives in the studio, and has no window of its own: this book is part of the studio's manual, beside the synth's and the drum machine's. Build and run the studio as the studio's manual says in Before you start.

Its sounds aren't in the repository. tools/fetch-samples.sh fills the library folder, library/, and checks each download against its checksum:

tools/fetch-samples.sh        # into library/, or a folder you name

It fetches the Salamander Grand Piano, 1.18 GB, and imports it as programs/piano.json; a recording of the sea; and it renders, with the studio, an 808 break into breaks/808.wav, and two loops into loops/, a synth phrase and the break at 122 BPM. library/ATTRIBUTION.md names the authors and licenses. Every figure in this book plays them: a build of the manual without the library fails those figures, and a song that names a missing file still opens, lists the sample in red on the samples page, and plays nothing where it would sound.

Open a song with a sampler in it, and show its device:

zig build run-studio -- studio/examples/piano --view device

or select a sampler's track in the arrange view and press Ctrl+2. The panel shows the channel that track plays. Ctrl+1 goes back.

The studio names samples by their place in the library, library/ unless --library DIR names another, and keeps them in one pool of sample memory, 512 MB unless --sample-memory MB says otherwise. Both options go before or after any command, as studio --library ~/samples render SONG out.wav.

How to read this

Chapter 0 is a tour of the panel's five pages. Chapters 1 to 3 build a sound from the bottom up, as the S1000's manual does: a sample, then a program of samples across the keys, then the voice that plays them. Chapters 4 to 6 are the work around it: the pads and breaks, sampling from the input, and sounds in a song. Chapter 7 is the reference.

A figure has pictures of the window, cropped to the panel, the clip the song renders, plots of the clip, and a recipe: the song's song.json, a window script where the picture needs presses, and the commands that reproduce it. The songs are small folders in manual/sampler/, next to the chapters. What the studio made is dark, as its window is, and amber means what it means there: sound, playing now.

A control has two names. The panel gives it a short label, such as release in the filter envelope column; a song's file and a controller name it by its param, such as filter_release. The text uses the label for the control in front of you and the param, in code, for the setting. The chapters that teach controls end with a table of their params.

The S1000's owner's manual, version 2.0 of November 1989, is in reference/s1000/. This book quotes it where it says something well, with its page.

Contents