Sampling: playing a recording as an instrument
A recording has a length. Repitch and stretch are two different answers to what should happen to that length when the pitch moves.
A sample is a recording played as an instrument: tuned, shaped by an envelope, and placed on sequencer steps like any oscillator. Lesson 2 gave the frame for what sits inside one. A recording is a frozen recipe, harmonics and all, borrowed from the world instead of built from a formula. One property separates it from every oscillator in this course. A recording has a length. The phrase in the toy below runs 1.6 seconds: four plucked notes, A2, C3, E3 and G3, one every 0.4 seconds. Everything difficult in this lesson comes from what happens to those 1.6 seconds when you ask for a different pitch.
Repitch: pitch and length move together
The oldest answer is to play the recording faster or slower, which is what a tape machine does when its speed changes. Pitch and length then become two readings of one number, the playback rate. A rate of 2 raises everything by an octave and finishes in half the time. The arithmetic is the equal-temperament arithmetic from lesson 1: the rate for a shift of n semitones is 2 to the power n/12, and the new length is the original divided by that rate. The toy's pitch slider covers ±12 semitones in whole steps and prints the resulting length next to it.
- +12 st — rate ×2.000, and the 1.6 s phrase plays in 0.8 s. Its bottom note, A2 at 110 Hz, comes out as A3 at 220 Hz.
- +7 st — rate ×1.498, 1.1 s. A borrowed loop a fifth up is also running about a third faster, which is usually the first thing you notice.
- +3 st — rate ×1.189, 1.3 s. Small shifts read mostly as tempo, and on percussion the pitch change slips past unremarked.
- −5 st — rate ×0.749, 2.1 s. Everything thickens; this is roughly where a break starts to sound like a slower, heavier drummer.
- −12 st — rate ×0.500, 3.2 s. Twice the original length, an octave down.
A rate change moves every frequency in the recording by the same factor. That includes the resonances that identify an instrument or a voice, which in a real body stay where they are when the pitch changes. Shift a voice up 12 semitones and its throat resonances double along with the note, giving the chipmunk sound everyone recognizes. Entire genres use that on purpose rather than working around it. Jungle sped breakbeats up by several semitones and kept the brightness that came with it. Vaporwave slowed records down and kept the sag.
Pitch against the length the 1.6 s phrase comes out at, on axes shared by both machines. The duration axis doubles at every label, so repitch's locked relationship draws an exact straight line and each semitone moves the same distance. Stretch reaches all 25 pitches at one length, so its line is vertical. The dashed crosshair marks the untouched phrase at 0 semitones and 1.6 seconds, the only setting the two machines agree on.
Stretch: length held, pitch free
Time-stretching gives pitch and time separate machinery. The toy stops using one long playback and switches to a stream of short overlapping pieces. Each piece is 90 ms of output, a new one starts every 45 ms so two are sounding at any moment, and each fades in and out over 15 ms at its edges so the seams do not click. Two clocks now run at once. The read position walks the recording at normal speed, which is what pins the length at 1.6 seconds wherever the slider sits. The pitch comes from each piece's own playback rate. At +12 semitones a piece plays at double rate, so its 90 ms of output consumes 180 ms of the recording, and the next piece starts from wherever the read position has reached in the meantime.
The cost arrives as texture. Pieces are being cut out of a continuous recording and re-laid at a different spacing, and no crossfade is both short enough to stay inaudible and long enough to hide the join. At two or three semitones you will not hear it. At a full octave the seams add a faint grainy shimmer under the note, clearest on sustained material and nearly invisible on drums. Hardware time-stretching makes the same trade for the same reason. One thing stretch does not buy you is the resonance problem from the last section: a voice pushed up an octave in stretch mode is exactly as chipmunk-like, only at the original tempo.
One melodic phrase, one pitch slider, two machines. In repitch the playhead visibly speeds up and the loop readout counts down from 1.6 s toward 0.8 s. In stretch the playhead never changes speed and the readout stays at 1.6 s. Hold the slider at +12 and toggle the machine button back and forth: the pitch is identical either way, and only the clock changes. Then stay at +12 in stretch mode and listen for the shimmer described above.
Digitakt II ships this lesson as four machines, and they share more than they differ. ONESHOT, REPITCH, STRETCH and WERP all read the same sample, and three of them carry a BARS knob where you declare how long that sample is in bars so the machine can match the pattern's tempo. The method is what differs. REPITCH changes the playback rate, and it is the only one of the four with no TUNE knob at all, because on that machine the pitch is whatever the tempo match implies. STRETCH chops the audio into grains and fades between them, which is the toy's own mechanism, so it can keep a separate ±5 octave TUNE. WERP cuts the sample into segments instead, sized with SEG, and each segment can play forward, in reverse, or looped until the next one is due. Tonverk's SINGLE PLAYER is the plain player of the family, with a start, an end, and a pair of loop points between them.