0. The pages

Introduction

The pages

The sampler has no window of its own. It's a device in a song, and its panel is the studio's device view, shown for a track that plays it. The panel has the S1000's pages along its top, each a screen of controls the way the S1000's LCD showed one at a time: program, keygroups, samples, record, and pads. This chapter is a tour of the five, on a song with a piano on one channel and a chopped drum break on another; the chapters after it teach what each control does.

Open the window on the chapter's song, in the device view:

zig build run-studio -- manual/sampler/00-pages/tour --view device

The sampler in a song

The device view for the `piano` track, two seconds into the song: the `program` page of channel 1, which plays program 1, `piano`.: the full

0.0 / 5.0 s

peak -10.8 dBFS

Fig. 0.1 The device view for the piano track, two seconds into the song: the program page of channel 1, which plays program 1, piano.

openzig build run-studio -- manual/sampler/00-pages/tour --view device --track 1 --play 1

renderzig build run-studio -- render manual/sampler/00-pages/tour program.wav

tour/song.json
{
  "tempo": 96,
  "end": "3",
  "key": ["1 C major"],
  "devices": [{
    "name": "S1000",
    "type": "sampler",
    "state": {
      "channels": [
        { "channel": 1, "program": 1, "level": -10 },
        { "channel": 2, "program": 2 }
      ],
      "programs": [
        { "program": 1, "file": "programs/piano.json" },
        {
          "program": 2,
          "name": "808 chops",
          "keygroups": [
            { "keys": "C2", "zones": [{ "sample": "808.1" }] },
            { "keys": "C#2", "zones": [{ "sample": "808.2" }] },
            { "keys": "D2", "zones": [{ "sample": "808.3" }] },
            { "keys": "D#2", "zones": [{ "sample": "808.4" }] },
            { "keys": "E2", "zones": [{ "sample": "808.5" }] },
            { "keys": "F2", "zones": [{ "sample": "808.6" }] },
            { "keys": "F#2", "zones": [{ "sample": "808.7" }] },
            { "keys": "G2", "zones": [{ "sample": "808.8" }] },
            { "keys": "G#2", "zones": [{ "sample": "808.9" }] },
            { "keys": "A2", "zones": [{ "sample": "808.10" }] },
            { "keys": "A#2", "zones": [{ "sample": "808.11" }] },
            { "keys": "B2", "zones": [{ "sample": "808.12" }] },
            { "keys": "C3", "zones": [{ "sample": "808.13" }] },
            { "keys": "C#3", "zones": [{ "sample": "808.14" }] },
            { "keys": "D3", "zones": [{ "sample": "808.15" }] },
            { "keys": "D#3", "zones": [{ "sample": "808.16" }] }
          ]
        }
      ],
      "samples": {
        "808": { "file": "breaks/808.wav", "root": "C4", "mode": "one_shot" },
        "808.1": { "file": "breaks/808.wav", "root": "C2", "end": 15031, "mode": "one_shot" },
        "808.2": { "file": "breaks/808.wav", "root": "C#2", "start": 15031, "end": 30007, "mode": "one_shot" },
        "808.3": { "file": "breaks/808.wav", "root": "D2", "start": 30007, "end": 45003, "mode": "one_shot" },
        "808.4": { "file": "breaks/808.wav", "root": "D#2", "start": 45003, "end": 59858, "mode": "one_shot" },
        "808.5": { "file": "breaks/808.wav", "root": "E2", "start": 59858, "end": 74933, "mode": "one_shot" },
        "808.6": { "file": "breaks/808.wav", "root": "F2", "start": 74933, "end": 90009, "mode": "one_shot" },
        "808.7": { "file": "breaks/808.wav", "root": "F#2", "start": 90009, "end": 105001, "mode": "one_shot" },
        "808.8": { "file": "breaks/808.wav", "root": "G2", "start": 105001, "end": 120000, "mode": "one_shot" },
        "808.9": { "file": "breaks/808.wav", "root": "G#2", "start": 120000, "end": 135020, "mode": "one_shot" },
        "808.10": { "file": "breaks/808.wav", "root": "A2", "start": 135020, "end": 150043, "mode": "one_shot" },
        "808.11": { "file": "breaks/808.wav", "root": "A#2", "start": 150043, "end": 165001, "mode": "one_shot" },
        "808.12": { "file": "breaks/808.wav", "root": "B2", "start": 165001, "end": 180025, "mode": "one_shot" },
        "808.13": { "file": "breaks/808.wav", "root": "C3", "start": 180025, "end": 194808, "mode": "one_shot" },
        "808.14": { "file": "breaks/808.wav", "root": "C#3", "start": 194808, "end": 210004, "mode": "one_shot" },
        "808.15": { "file": "breaks/808.wav", "root": "D3", "start": 210004, "end": 225001, "mode": "one_shot" },
        "808.16": { "file": "breaks/808.wav", "root": "D#3", "start": 225001, "end": 240001, "mode": "one_shot" }
      }
    }
  }],
  "desk": { "strips": { "S1000": { "reverb": -18 } } },
  "tracks": [
    {
      "name": "piano",
      "device": "S1000",
      "channel": 1,
      "clips": [{ "at": "1", "length": "2.0.0", "notes": "chords" }]
    },
    {
      "name": "break",
      "device": "S1000",
      "channel": 2,
      "clips": [{ "at": "1", "length": "2.0.0", "notes": "beat" }]
    }
  ],
  "notes": {
    "chords": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 C3 0.3.0 56",
        "1.1.0 G3 0.3.0 56",
        "1.1.0 E4 0.1.0 72",
        "1.2.0 G4 0.1.0 64",
        "1.3.0 E4 0.2.0 60",
        "2.1.0 A2 0.3.0 56",
        "2.1.0 E3 0.3.0 56",
        "2.1.0 C4 0.1.0 72",
        "2.2.0 E4 0.1.0 64",
        "2.3.0 B3 0.2.0 60"
      ]
    },
    "beat": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 C2 0.0.480 110",
        "1.1.480 C#2 0.0.480 110",
        "1.2.0 D2 0.0.480 110",
        "1.2.480 B2 0.0.480 110",
        "1.3.0 F2 0.0.480 110",
        "1.3.480 F2 0.0.480 110",
        "1.4.0 F#2 0.0.480 110",
        "1.4.480 D#3 0.0.480 110",
        "2.1.0 G#2 0.0.480 110",
        "2.1.480 C3 0.0.480 110",
        "2.2.0 A#2 0.0.480 110",
        "2.2.480 D#2 0.0.480 110",
        "2.3.0 C2 0.0.480 110",
        "2.3.480 C#3 0.0.480 110",
        "2.4.0 D3 0.0.480 110",
        "2.4.480 G2 0.0.480 110"
      ]
    }
  }
}

A song's sampler is a device of type sampler, named in its song.json, here S1000. It has sixteen channels, and each track that plays it plays one of them: this song's piano track plays channel 1, and its break track channel 2. The tag under the studio's views says which, as piano: S1000, part 1; the studio calls a channel a part there, as it does the synth's. Ctrl+2 shows the selected track's device, on that track's channel, and Ctrl+1 goes back to the arrange view.

The row under the bar is the panel's header. On its left are the five pages; a click shows one. Then ch 1, the channel the panel shows, with arrows that step through the sixteen; and 1 piano, the program that channel plays, with arrows that step through the bank's 100 programs, an unused one reading (empty). Stepping to a program selects it for the channel at once, as Program Change does. new starts a program on the first unused number and selects it. At the right are the voices sounding, of the sixteen the channels share, and the sample memory the bank's sounds take, of the pool's 512 MB: 304.8 MB here, all but 0.9 MB of it the piano's.

The program page

The program page is the sound: six columns of controls, pitch and level, filter, filter envelope, amplifier, lfo, and program and pads. Most of them are the program's, as on the S1000: turning one changes the program the channel plays, and selecting that program again, on this channel or another, brings it back as it was left. The channel keeps a few of its own: its level and pan, the pitch wheel's bend, and the pads' repeat, 16 levels, and of pad.

A slider drags left and right, across its own width for its whole travel. The wheel over it nudges it, a hundredth of its travel a notch, or a step for a control that has steps. A double-click puts it back at its default. A switch, drawn as a button with its position in it, such as grain 16-bit, steps to its next position with each click, and one of two positions, such as kg xfade on, lights when it's on. A line under a slider marks a control that a controller's knobs reach on the page they show, and a hollow mark on its track where a controller's fader stands apart from it (chapter 18).

What the panel shows follows the sampler as it plays, so a lane that moves the cutoff moves the slider (lanes). Chapter 3 teaches every control on the page.

The keygroups page

The `keygroups` page for program 1, 2 seconds in: thirty keygroups over 88 keys. The four amber ones are playing the C chord's C3, G3, and E4, and the G4 before it, in its release. The fields under the keyboard are empty until a keygroup is selected.: the view
Fig. 0.2 The keygroups page for program 1, 2 seconds in: thirty keygroups over 88 keys. The four amber ones are playing the C chord's C3, G3, and E4, and the G4 before it, in its release. The fields under the keyboard are empty until a keygroup is selected.

scriptzig build run-studio -- manual/sampler/00-pages/tour --view device --track 1 --script manual/sampler/00-pages/keygroups.txt

tour/song.json
{
  "tempo": 96,
  "end": "3",
  "key": ["1 C major"],
  "devices": [{
    "name": "S1000",
    "type": "sampler",
    "state": {
      "channels": [
        { "channel": 1, "program": 1, "level": -10 },
        { "channel": 2, "program": 2 }
      ],
      "programs": [
        { "program": 1, "file": "programs/piano.json" },
        {
          "program": 2,
          "name": "808 chops",
          "keygroups": [
            { "keys": "C2", "zones": [{ "sample": "808.1" }] },
            { "keys": "C#2", "zones": [{ "sample": "808.2" }] },
            { "keys": "D2", "zones": [{ "sample": "808.3" }] },
            { "keys": "D#2", "zones": [{ "sample": "808.4" }] },
            { "keys": "E2", "zones": [{ "sample": "808.5" }] },
            { "keys": "F2", "zones": [{ "sample": "808.6" }] },
            { "keys": "F#2", "zones": [{ "sample": "808.7" }] },
            { "keys": "G2", "zones": [{ "sample": "808.8" }] },
            { "keys": "G#2", "zones": [{ "sample": "808.9" }] },
            { "keys": "A2", "zones": [{ "sample": "808.10" }] },
            { "keys": "A#2", "zones": [{ "sample": "808.11" }] },
            { "keys": "B2", "zones": [{ "sample": "808.12" }] },
            { "keys": "C3", "zones": [{ "sample": "808.13" }] },
            { "keys": "C#3", "zones": [{ "sample": "808.14" }] },
            { "keys": "D3", "zones": [{ "sample": "808.15" }] },
            { "keys": "D#3", "zones": [{ "sample": "808.16" }] }
          ]
        }
      ],
      "samples": {
        "808": { "file": "breaks/808.wav", "root": "C4", "mode": "one_shot" },
        "808.1": { "file": "breaks/808.wav", "root": "C2", "end": 15031, "mode": "one_shot" },
        "808.2": { "file": "breaks/808.wav", "root": "C#2", "start": 15031, "end": 30007, "mode": "one_shot" },
        "808.3": { "file": "breaks/808.wav", "root": "D2", "start": 30007, "end": 45003, "mode": "one_shot" },
        "808.4": { "file": "breaks/808.wav", "root": "D#2", "start": 45003, "end": 59858, "mode": "one_shot" },
        "808.5": { "file": "breaks/808.wav", "root": "E2", "start": 59858, "end": 74933, "mode": "one_shot" },
        "808.6": { "file": "breaks/808.wav", "root": "F2", "start": 74933, "end": 90009, "mode": "one_shot" },
        "808.7": { "file": "breaks/808.wav", "root": "F#2", "start": 90009, "end": 105001, "mode": "one_shot" },
        "808.8": { "file": "breaks/808.wav", "root": "G2", "start": 105001, "end": 120000, "mode": "one_shot" },
        "808.9": { "file": "breaks/808.wav", "root": "G#2", "start": 120000, "end": 135020, "mode": "one_shot" },
        "808.10": { "file": "breaks/808.wav", "root": "A2", "start": 135020, "end": 150043, "mode": "one_shot" },
        "808.11": { "file": "breaks/808.wav", "root": "A#2", "start": 150043, "end": 165001, "mode": "one_shot" },
        "808.12": { "file": "breaks/808.wav", "root": "B2", "start": 165001, "end": 180025, "mode": "one_shot" },
        "808.13": { "file": "breaks/808.wav", "root": "C3", "start": 180025, "end": 194808, "mode": "one_shot" },
        "808.14": { "file": "breaks/808.wav", "root": "C#3", "start": 194808, "end": 210004, "mode": "one_shot" },
        "808.15": { "file": "breaks/808.wav", "root": "D3", "start": 210004, "end": 225001, "mode": "one_shot" },
        "808.16": { "file": "breaks/808.wav", "root": "D#3", "start": 225001, "end": 240001, "mode": "one_shot" }
      }
    }
  }],
  "desk": { "strips": { "S1000": { "reverb": -18 } } },
  "tracks": [
    {
      "name": "piano",
      "device": "S1000",
      "channel": 1,
      "clips": [{ "at": "1", "length": "2.0.0", "notes": "chords" }]
    },
    {
      "name": "break",
      "device": "S1000",
      "channel": 2,
      "clips": [{ "at": "1", "length": "2.0.0", "notes": "beat" }]
    }
  ],
  "notes": {
    "chords": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 C3 0.3.0 56",
        "1.1.0 G3 0.3.0 56",
        "1.1.0 E4 0.1.0 72",
        "1.2.0 G4 0.1.0 64",
        "1.3.0 E4 0.2.0 60",
        "2.1.0 A2 0.3.0 56",
        "2.1.0 E3 0.3.0 56",
        "2.1.0 C4 0.1.0 72",
        "2.2.0 E4 0.1.0 64",
        "2.3.0 B3 0.2.0 60"
      ]
    },
    "beat": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 C2 0.0.480 110",
        "1.1.480 C#2 0.0.480 110",
        "1.2.0 D2 0.0.480 110",
        "1.2.480 B2 0.0.480 110",
        "1.3.0 F2 0.0.480 110",
        "1.3.480 F2 0.0.480 110",
        "1.4.0 F#2 0.0.480 110",
        "1.4.480 D#3 0.0.480 110",
        "2.1.0 G#2 0.0.480 110",
        "2.1.480 C3 0.0.480 110",
        "2.2.0 A#2 0.0.480 110",
        "2.2.480 D#2 0.0.480 110",
        "2.3.0 C2 0.0.480 110",
        "2.3.480 C#3 0.0.480 110",
        "2.4.0 D3 0.0.480 110",
        "2.4.480 G2 0.0.480 110"
      ]
    }
  }
}
keygroups.txt
# The keygroups page, with the piano playing.
key space
wait 1.9
click 143 67
wait 0.1
capture keygroups.png

A program spans the keys with keygroups, each a stretch of keys playing up to four samples. The bars over the keyboard are the program's keygroups, in as many as three lanes where their keys overlap, each named for the first sample it plays; a sounding one is amber. A click on a key plays it, harder the lower on the key it lands, and selects the keygroup it plays; a click on a bar selects that keygroup. The fields below are the selected keygroup's: its keys, tuning, level, pan, filter, envelope, and its four zones of velocity, a sample each. Chapter 2 builds programs here.

The samples page

The `samples` page, with the bank's first sample selected: `808`, the whole break, five seconds of `breaks/808.wav`. Its sixteen slices follow it in the list, and the piano's 120 samples after them.: the view
Fig. 0.3 The samples page, with the bank's first sample selected: 808, the whole break, five seconds of breaks/808.wav. Its sixteen slices follow it in the list, and the piano's 120 samples after them.

scriptzig build run-studio -- manual/sampler/00-pages/tour --view device --track 1 --script manual/sampler/00-pages/samples.txt

tour/song.json
{
  "tempo": 96,
  "end": "3",
  "key": ["1 C major"],
  "devices": [{
    "name": "S1000",
    "type": "sampler",
    "state": {
      "channels": [
        { "channel": 1, "program": 1, "level": -10 },
        { "channel": 2, "program": 2 }
      ],
      "programs": [
        { "program": 1, "file": "programs/piano.json" },
        {
          "program": 2,
          "name": "808 chops",
          "keygroups": [
            { "keys": "C2", "zones": [{ "sample": "808.1" }] },
            { "keys": "C#2", "zones": [{ "sample": "808.2" }] },
            { "keys": "D2", "zones": [{ "sample": "808.3" }] },
            { "keys": "D#2", "zones": [{ "sample": "808.4" }] },
            { "keys": "E2", "zones": [{ "sample": "808.5" }] },
            { "keys": "F2", "zones": [{ "sample": "808.6" }] },
            { "keys": "F#2", "zones": [{ "sample": "808.7" }] },
            { "keys": "G2", "zones": [{ "sample": "808.8" }] },
            { "keys": "G#2", "zones": [{ "sample": "808.9" }] },
            { "keys": "A2", "zones": [{ "sample": "808.10" }] },
            { "keys": "A#2", "zones": [{ "sample": "808.11" }] },
            { "keys": "B2", "zones": [{ "sample": "808.12" }] },
            { "keys": "C3", "zones": [{ "sample": "808.13" }] },
            { "keys": "C#3", "zones": [{ "sample": "808.14" }] },
            { "keys": "D3", "zones": [{ "sample": "808.15" }] },
            { "keys": "D#3", "zones": [{ "sample": "808.16" }] }
          ]
        }
      ],
      "samples": {
        "808": { "file": "breaks/808.wav", "root": "C4", "mode": "one_shot" },
        "808.1": { "file": "breaks/808.wav", "root": "C2", "end": 15031, "mode": "one_shot" },
        "808.2": { "file": "breaks/808.wav", "root": "C#2", "start": 15031, "end": 30007, "mode": "one_shot" },
        "808.3": { "file": "breaks/808.wav", "root": "D2", "start": 30007, "end": 45003, "mode": "one_shot" },
        "808.4": { "file": "breaks/808.wav", "root": "D#2", "start": 45003, "end": 59858, "mode": "one_shot" },
        "808.5": { "file": "breaks/808.wav", "root": "E2", "start": 59858, "end": 74933, "mode": "one_shot" },
        "808.6": { "file": "breaks/808.wav", "root": "F2", "start": 74933, "end": 90009, "mode": "one_shot" },
        "808.7": { "file": "breaks/808.wav", "root": "F#2", "start": 90009, "end": 105001, "mode": "one_shot" },
        "808.8": { "file": "breaks/808.wav", "root": "G2", "start": 105001, "end": 120000, "mode": "one_shot" },
        "808.9": { "file": "breaks/808.wav", "root": "G#2", "start": 120000, "end": 135020, "mode": "one_shot" },
        "808.10": { "file": "breaks/808.wav", "root": "A2", "start": 135020, "end": 150043, "mode": "one_shot" },
        "808.11": { "file": "breaks/808.wav", "root": "A#2", "start": 150043, "end": 165001, "mode": "one_shot" },
        "808.12": { "file": "breaks/808.wav", "root": "B2", "start": 165001, "end": 180025, "mode": "one_shot" },
        "808.13": { "file": "breaks/808.wav", "root": "C3", "start": 180025, "end": 194808, "mode": "one_shot" },
        "808.14": { "file": "breaks/808.wav", "root": "C#3", "start": 194808, "end": 210004, "mode": "one_shot" },
        "808.15": { "file": "breaks/808.wav", "root": "D3", "start": 210004, "end": 225001, "mode": "one_shot" },
        "808.16": { "file": "breaks/808.wav", "root": "D#3", "start": 225001, "end": 240001, "mode": "one_shot" }
      }
    }
  }],
  "desk": { "strips": { "S1000": { "reverb": -18 } } },
  "tracks": [
    {
      "name": "piano",
      "device": "S1000",
      "channel": 1,
      "clips": [{ "at": "1", "length": "2.0.0", "notes": "chords" }]
    },
    {
      "name": "break",
      "device": "S1000",
      "channel": 2,
      "clips": [{ "at": "1", "length": "2.0.0", "notes": "beat" }]
    }
  ],
  "notes": {
    "chords": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 C3 0.3.0 56",
        "1.1.0 G3 0.3.0 56",
        "1.1.0 E4 0.1.0 72",
        "1.2.0 G4 0.1.0 64",
        "1.3.0 E4 0.2.0 60",
        "2.1.0 A2 0.3.0 56",
        "2.1.0 E3 0.3.0 56",
        "2.1.0 C4 0.1.0 72",
        "2.2.0 E4 0.1.0 64",
        "2.3.0 B3 0.2.0 60"
      ]
    },
    "beat": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 C2 0.0.480 110",
        "1.1.480 C#2 0.0.480 110",
        "1.2.0 D2 0.0.480 110",
        "1.2.480 B2 0.0.480 110",
        "1.3.0 F2 0.0.480 110",
        "1.3.480 F2 0.0.480 110",
        "1.4.0 F#2 0.0.480 110",
        "1.4.480 D#3 0.0.480 110",
        "2.1.0 G#2 0.0.480 110",
        "2.1.480 C3 0.0.480 110",
        "2.2.0 A#2 0.0.480 110",
        "2.2.480 D#2 0.0.480 110",
        "2.3.0 C2 0.0.480 110",
        "2.3.480 C#3 0.0.480 110",
        "2.4.0 D3 0.0.480 110",
        "2.4.480 G2 0.0.480 110"
      ]
    }
  }
}
samples.txt
# The samples page, with the 808 break selected, the bank's first sample.
click 229 67
wait 0.1
capture samples.png

The list at the left is every sample in the bank, with how long each one plays, and under it the library folder, where a click on a WAV file loads it as a new sample. The selected sample's waveform takes the rest of the top: what plays is bright, and the markers show where it starts and ends and where its loops are. Under the waveform are its root key, tuning, gain, loop mode, start, end, fit, and loops, and the buttons that normalize it, chop it onto the pads, or map it to every key. The bank holds 256 samples, all the programs' together. Chapter 1 is about this page.

The record page

The `record` page, ready: stereo, the full 20 kHz bandwidth, a root of C4, 20 seconds, starting when the level crosses −20 dB. No input is heard, because a capture opens none.: the view
Fig. 0.4 The record page, ready: stereo, the full 20 kHz bandwidth, a root of C4, 20 seconds, starting when the level crosses −20 dB. No input is heard, because a capture opens none.

scriptzig build run-studio -- manual/sampler/00-pages/tour --view device --track 1 --script manual/sampler/00-pages/record.txt

tour/song.json
{
  "tempo": 96,
  "end": "3",
  "key": ["1 C major"],
  "devices": [{
    "name": "S1000",
    "type": "sampler",
    "state": {
      "channels": [
        { "channel": 1, "program": 1, "level": -10 },
        { "channel": 2, "program": 2 }
      ],
      "programs": [
        { "program": 1, "file": "programs/piano.json" },
        {
          "program": 2,
          "name": "808 chops",
          "keygroups": [
            { "keys": "C2", "zones": [{ "sample": "808.1" }] },
            { "keys": "C#2", "zones": [{ "sample": "808.2" }] },
            { "keys": "D2", "zones": [{ "sample": "808.3" }] },
            { "keys": "D#2", "zones": [{ "sample": "808.4" }] },
            { "keys": "E2", "zones": [{ "sample": "808.5" }] },
            { "keys": "F2", "zones": [{ "sample": "808.6" }] },
            { "keys": "F#2", "zones": [{ "sample": "808.7" }] },
            { "keys": "G2", "zones": [{ "sample": "808.8" }] },
            { "keys": "G#2", "zones": [{ "sample": "808.9" }] },
            { "keys": "A2", "zones": [{ "sample": "808.10" }] },
            { "keys": "A#2", "zones": [{ "sample": "808.11" }] },
            { "keys": "B2", "zones": [{ "sample": "808.12" }] },
            { "keys": "C3", "zones": [{ "sample": "808.13" }] },
            { "keys": "C#3", "zones": [{ "sample": "808.14" }] },
            { "keys": "D3", "zones": [{ "sample": "808.15" }] },
            { "keys": "D#3", "zones": [{ "sample": "808.16" }] }
          ]
        }
      ],
      "samples": {
        "808": { "file": "breaks/808.wav", "root": "C4", "mode": "one_shot" },
        "808.1": { "file": "breaks/808.wav", "root": "C2", "end": 15031, "mode": "one_shot" },
        "808.2": { "file": "breaks/808.wav", "root": "C#2", "start": 15031, "end": 30007, "mode": "one_shot" },
        "808.3": { "file": "breaks/808.wav", "root": "D2", "start": 30007, "end": 45003, "mode": "one_shot" },
        "808.4": { "file": "breaks/808.wav", "root": "D#2", "start": 45003, "end": 59858, "mode": "one_shot" },
        "808.5": { "file": "breaks/808.wav", "root": "E2", "start": 59858, "end": 74933, "mode": "one_shot" },
        "808.6": { "file": "breaks/808.wav", "root": "F2", "start": 74933, "end": 90009, "mode": "one_shot" },
        "808.7": { "file": "breaks/808.wav", "root": "F#2", "start": 90009, "end": 105001, "mode": "one_shot" },
        "808.8": { "file": "breaks/808.wav", "root": "G2", "start": 105001, "end": 120000, "mode": "one_shot" },
        "808.9": { "file": "breaks/808.wav", "root": "G#2", "start": 120000, "end": 135020, "mode": "one_shot" },
        "808.10": { "file": "breaks/808.wav", "root": "A2", "start": 135020, "end": 150043, "mode": "one_shot" },
        "808.11": { "file": "breaks/808.wav", "root": "A#2", "start": 150043, "end": 165001, "mode": "one_shot" },
        "808.12": { "file": "breaks/808.wav", "root": "B2", "start": 165001, "end": 180025, "mode": "one_shot" },
        "808.13": { "file": "breaks/808.wav", "root": "C3", "start": 180025, "end": 194808, "mode": "one_shot" },
        "808.14": { "file": "breaks/808.wav", "root": "C#3", "start": 194808, "end": 210004, "mode": "one_shot" },
        "808.15": { "file": "breaks/808.wav", "root": "D3", "start": 210004, "end": 225001, "mode": "one_shot" },
        "808.16": { "file": "breaks/808.wav", "root": "D#3", "start": 225001, "end": 240001, "mode": "one_shot" }
      }
    }
  }],
  "desk": { "strips": { "S1000": { "reverb": -18 } } },
  "tracks": [
    {
      "name": "piano",
      "device": "S1000",
      "channel": 1,
      "clips": [{ "at": "1", "length": "2.0.0", "notes": "chords" }]
    },
    {
      "name": "break",
      "device": "S1000",
      "channel": 2,
      "clips": [{ "at": "1", "length": "2.0.0", "notes": "beat" }]
    }
  ],
  "notes": {
    "chords": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 C3 0.3.0 56",
        "1.1.0 G3 0.3.0 56",
        "1.1.0 E4 0.1.0 72",
        "1.2.0 G4 0.1.0 64",
        "1.3.0 E4 0.2.0 60",
        "2.1.0 A2 0.3.0 56",
        "2.1.0 E3 0.3.0 56",
        "2.1.0 C4 0.1.0 72",
        "2.2.0 E4 0.1.0 64",
        "2.3.0 B3 0.2.0 60"
      ]
    },
    "beat": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 C2 0.0.480 110",
        "1.1.480 C#2 0.0.480 110",
        "1.2.0 D2 0.0.480 110",
        "1.2.480 B2 0.0.480 110",
        "1.3.0 F2 0.0.480 110",
        "1.3.480 F2 0.0.480 110",
        "1.4.0 F#2 0.0.480 110",
        "1.4.480 D#3 0.0.480 110",
        "2.1.0 G#2 0.0.480 110",
        "2.1.480 C3 0.0.480 110",
        "2.2.0 A#2 0.0.480 110",
        "2.2.480 D#2 0.0.480 110",
        "2.3.0 C2 0.0.480 110",
        "2.3.480 C#3 0.0.480 110",
        "2.4.0 D3 0.0.480 110",
        "2.4.480 G2 0.0.480 110"
      ]
    }
  }
}
record.txt
# The record page, as it opens.
click 315 67
wait 0.1
capture record.png

The record page samples from the computer's input, as the S1000's REC pages did, into a new sample and a file in the library. The input opens the first time the page shows. Chapter 5 records.

The pads page

The `pads` page for channel 2, which plays `808 chops`, the break cut into sixteen slices, one a pad. Pad 1 is at the bottom left, as on the MPC60. The amber edge marks a pad struck in the last fifth of a second, here pad 7, a snare.: the view
Fig. 0.5 The pads page for channel 2, which plays 808 chops, the break cut into sixteen slices, one a pad. Pad 1 is at the bottom left, as on the MPC60. The amber edge marks a pad struck in the last fifth of a second, here pad 7, a snare.

scriptzig build run-studio -- manual/sampler/00-pages/tour --view device --track 2 --script manual/sampler/00-pages/pads.txt

tour/song.json
{
  "tempo": 96,
  "end": "3",
  "key": ["1 C major"],
  "devices": [{
    "name": "S1000",
    "type": "sampler",
    "state": {
      "channels": [
        { "channel": 1, "program": 1, "level": -10 },
        { "channel": 2, "program": 2 }
      ],
      "programs": [
        { "program": 1, "file": "programs/piano.json" },
        {
          "program": 2,
          "name": "808 chops",
          "keygroups": [
            { "keys": "C2", "zones": [{ "sample": "808.1" }] },
            { "keys": "C#2", "zones": [{ "sample": "808.2" }] },
            { "keys": "D2", "zones": [{ "sample": "808.3" }] },
            { "keys": "D#2", "zones": [{ "sample": "808.4" }] },
            { "keys": "E2", "zones": [{ "sample": "808.5" }] },
            { "keys": "F2", "zones": [{ "sample": "808.6" }] },
            { "keys": "F#2", "zones": [{ "sample": "808.7" }] },
            { "keys": "G2", "zones": [{ "sample": "808.8" }] },
            { "keys": "G#2", "zones": [{ "sample": "808.9" }] },
            { "keys": "A2", "zones": [{ "sample": "808.10" }] },
            { "keys": "A#2", "zones": [{ "sample": "808.11" }] },
            { "keys": "B2", "zones": [{ "sample": "808.12" }] },
            { "keys": "C3", "zones": [{ "sample": "808.13" }] },
            { "keys": "C#3", "zones": [{ "sample": "808.14" }] },
            { "keys": "D3", "zones": [{ "sample": "808.15" }] },
            { "keys": "D#3", "zones": [{ "sample": "808.16" }] }
          ]
        }
      ],
      "samples": {
        "808": { "file": "breaks/808.wav", "root": "C4", "mode": "one_shot" },
        "808.1": { "file": "breaks/808.wav", "root": "C2", "end": 15031, "mode": "one_shot" },
        "808.2": { "file": "breaks/808.wav", "root": "C#2", "start": 15031, "end": 30007, "mode": "one_shot" },
        "808.3": { "file": "breaks/808.wav", "root": "D2", "start": 30007, "end": 45003, "mode": "one_shot" },
        "808.4": { "file": "breaks/808.wav", "root": "D#2", "start": 45003, "end": 59858, "mode": "one_shot" },
        "808.5": { "file": "breaks/808.wav", "root": "E2", "start": 59858, "end": 74933, "mode": "one_shot" },
        "808.6": { "file": "breaks/808.wav", "root": "F2", "start": 74933, "end": 90009, "mode": "one_shot" },
        "808.7": { "file": "breaks/808.wav", "root": "F#2", "start": 90009, "end": 105001, "mode": "one_shot" },
        "808.8": { "file": "breaks/808.wav", "root": "G2", "start": 105001, "end": 120000, "mode": "one_shot" },
        "808.9": { "file": "breaks/808.wav", "root": "G#2", "start": 120000, "end": 135020, "mode": "one_shot" },
        "808.10": { "file": "breaks/808.wav", "root": "A2", "start": 135020, "end": 150043, "mode": "one_shot" },
        "808.11": { "file": "breaks/808.wav", "root": "A#2", "start": 150043, "end": 165001, "mode": "one_shot" },
        "808.12": { "file": "breaks/808.wav", "root": "B2", "start": 165001, "end": 180025, "mode": "one_shot" },
        "808.13": { "file": "breaks/808.wav", "root": "C3", "start": 180025, "end": 194808, "mode": "one_shot" },
        "808.14": { "file": "breaks/808.wav", "root": "C#3", "start": 194808, "end": 210004, "mode": "one_shot" },
        "808.15": { "file": "breaks/808.wav", "root": "D3", "start": 210004, "end": 225001, "mode": "one_shot" },
        "808.16": { "file": "breaks/808.wav", "root": "D#3", "start": 225001, "end": 240001, "mode": "one_shot" }
      }
    }
  }],
  "desk": { "strips": { "S1000": { "reverb": -18 } } },
  "tracks": [
    {
      "name": "piano",
      "device": "S1000",
      "channel": 1,
      "clips": [{ "at": "1", "length": "2.0.0", "notes": "chords" }]
    },
    {
      "name": "break",
      "device": "S1000",
      "channel": 2,
      "clips": [{ "at": "1", "length": "2.0.0", "notes": "beat" }]
    }
  ],
  "notes": {
    "chords": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 C3 0.3.0 56",
        "1.1.0 G3 0.3.0 56",
        "1.1.0 E4 0.1.0 72",
        "1.2.0 G4 0.1.0 64",
        "1.3.0 E4 0.2.0 60",
        "2.1.0 A2 0.3.0 56",
        "2.1.0 E3 0.3.0 56",
        "2.1.0 C4 0.1.0 72",
        "2.2.0 E4 0.1.0 64",
        "2.3.0 B3 0.2.0 60"
      ]
    },
    "beat": {
      "length": "2.0.0",
      "notes": [
        "1.1.0 C2 0.0.480 110",
        "1.1.480 C#2 0.0.480 110",
        "1.2.0 D2 0.0.480 110",
        "1.2.480 B2 0.0.480 110",
        "1.3.0 F2 0.0.480 110",
        "1.3.480 F2 0.0.480 110",
        "1.4.0 F#2 0.0.480 110",
        "1.4.480 D#3 0.0.480 110",
        "2.1.0 G#2 0.0.480 110",
        "2.1.480 C3 0.0.480 110",
        "2.2.0 A#2 0.0.480 110",
        "2.2.480 D#2 0.0.480 110",
        "2.3.0 C2 0.0.480 110",
        "2.3.480 C#3 0.0.480 110",
        "2.4.0 D3 0.0.480 110",
        "2.4.480 G2 0.0.480 110"
      ]
    }
  }
}
pads.txt
# The pads page, with the chopped break playing.
key space
wait 1.95
click 401 67
wait 0.05
capture pads.png

The pads are the MPC60's sixteen, on the keys from C2 to D♯3, each showing its key and the sample it plays. A click plays a pad and selects it; a click on a sample in the list at the right then puts that sample on it. Beside the pads are the channel's note repeat and 16 levels. Chapter 4 chops a break and plays it.

Playing it

The letter keys play the selected track, as they do in the arrange view, and so does a MIDI keyboard. On a kit, a program whose keygroups each hold one key, such as the chopped break, the letter keys start from C2, the first pad, as they do for the drum machine, and the editor opens its clips in Drum Edit. The pads of a controller play the sampler's pads (chapter 18).

In the arrange view, a click on a sampler track's program, in its row, lists the sampler's programs in use, and a click on one selects it for the channel (songs, tracks, and devices). A track's device list offers new sampler, for a sampler of its own.

Next: chapter 1, samples, the sounds a sampler plays.