Sampling — Key Spanning & Sample Instruments
We already know how to build a synthesiser. To begin building a sampler instrument, we can keep much of that architecture and simply replace the oscillator with audio stored in a buffer.
Oscillator
Audio Buffer
1. Give the sample a root note
Our built-in bass and chord examples are both rooted at C2. That is its root note: when C2 is played, the buffer is read at its original speed — 1×.
Drag the START and END markers directly on the waveform to choose the playback region. Reverse reads that selected region backwards.
2. Map one sample across a keyboard
Click the keys. Every note plays the same loaded recording. We change pitch by changing only the rate at which the buffer is read.
One octave above the root is +12 semitones: 2×. One octave below is −12 semitones: 0.5×.
3. Hear the problem
Simple sample transposition changes pitch and time together. Play progressively higher notes and the sample becomes shorter and brighter — eventually producing the familiar “chipmunk” effect. Play lower notes and it becomes longer and darker.
lower pitch = slower reading = longer duration
Try the bass first, then load the C2 chord. The sampler treats the complete chord exactly like any other buffer: the whole recorded object is transposed together. Try C1 → C2 → C3 → C4 → C5. The octave relationship is simple, but the identity of the original recording becomes increasingly transformed.
4. Why samplers use keygroups and multisamples
Stretching one recording across an entire keyboard quickly becomes unrealistic. A practical sampler can use several recordings, each covering a smaller range of notes.
C0–B1
C2–B2
C3–B3
C4–C5
The exact zones are an illustration. Real instruments choose sample positions and keygroups according to the source and available memory.
5. We are beginning to make an instrument
Once a sample responds to musical notes, we can treat it much like the oscillator section of our earlier synthesiser.
choose playback ratio
read the sample
Later we can add velocity, envelopes, filtering, modulation, looping and polyphony. The fundamental architecture is already familiar.