Quantization is the process of mapping input to a fixed set of values. For example, an application may include a quantizing function that rounds a series of floating point numbers to the nearest integer. The result is a reduced data set that contains only integers.
Quantizing data provides a discrete set of values that, while estimated, can be more easily processed. For example, rounding numbers to the nearest thousand may be useful when charting population data. Constraining RGB values to a limited range may provide color consistency when publishing a website.
Quantization is common in digital audio production, but it can refer to several different things. Examples include 1) pitch quantization, 2) sample quantization, and 3) MIDI quantization.
1. Pitch Quantization
Some instruments, like the piano and harpsichord, have discrete notes. Other instruments, like the trombone and guitar, have an infinite range of pitches. Quantizing guitar input may help match the tone of a piano or other instruments within an audio mix.
2. Sample Quantization
Sampling is the process of converting an analog audio signal to a digital format. Because analog audio has an infinite range of frequencies, converting it to digital data requires quantizing the values to a fixed range. The sample rate determines the number of times the signal is sampled, or quantized, each second. Standard sample rates include 44.1 kHz and 96 kHz (96,000 times per second).
3. MIDI Quantization
A MIDI recording does not contain audio data, but instead stores information about each note played during the recording process. It includes which note was pressed, when it was pressed, how hard it was pressed (the velocity), and when it was released.
While a MIDI recording already contains discrete data, it is possible to quantize the timing of each note. For example, after recording a drum loop with a digital keyboard, it is common to quantize the data to the nearest 16th, 8th, or even quarter note. Shifting the bass and snare drum notes to exact timings creates a more consistent beat.
NOTE: Quantizing audio and MIDI data can help clean up minor errors and inconsistencies in a recording. However, it can also make a recording sound artificial since human recordings are not perfect. Therefore, auto-tune is applied sparingly to professional recordings, and MIDI quantization is best-suited for electronic music.