chapter 3
sampling
In music production, "sampling" can mean a few different things depending on the context. This word has already shown up in the previous lessons when creating audio buffers. When creating sound from raw audio buffers we must specify how many channels (individual speakers) we have as well as how many seconds long we want the buffer to be, to calculate this we must determine our sample rate typically 44,100 samples per second or 44.1 kHz. In this context a "sample" refers to a single value (between -1 and 1) representing the position of the speaker (generating the vibration) at that point in time.
In our previous examples we've generated audio buffers algorithmically, in this lesson we'll be creating buffers by loading data from previously recorded sounds. We can do this with the Web Audio API (see Web Audio API / Audio Buffers / From File), but in the exmples below we'll be using Tone.js to keep things "higher level". When we record analog sounds and digitize them, we are again creating audio buffers except this time by "sampling" from the analog world. In this context, "sampling" is a purely technical process that transforms continuous analog sound into the digital domain by slicing it into tiny snapshots (again, values between -1 and 1), each representing the amplitude of the sound wave at a specific moment in time.

an audio documentary on the "Amen Break"
More broadly speaking, sampling generally refers to the process of taking a portion, or "sample," of an existing sound or audio recording and reusing it in a new context. This could involve lifting a short segment of a song—like a drum break, melody, or vocal phrase—and incorporating it into a new composition, often altering it with effects, pitch shifts, or looping.