A Gaussian (bell-shaped) envelope is preferred as a grain window because it produces smooth, artifact-free grain transitions
Grain amplitude envelopes determine how each grain fades in and out. Simple linear ADSR envelopes work but can introduce clicks at grain boundaries if not carefully tuned. A Gaussian (bell-shaped normal curve) envelope provides a very smooth, symmetric fade-in and fade-out with no sharp edges, minimising discontinuity artifacts between overlapping grains. In practice it is stored as a precomputed buffer of 512 samples and read at variable speeds to scale to different grain durations. The shape is defined by the Gaussian formula e^(−x²/σ²). It is scalable to any grain duration simply by changing the read speed, making it efficient for polyphonic grain generation with thousands of simultaneous grains.
Examples
In Max/MSP: precompute 512 Gaussian curve values into a buffer at patch load time using uzi, expr, and peek~. Multiply any grain’s waveform by this envelope buffer (read with wave~) to produce the bell-shaped amplitude contour.
Assessment
Why is a Gaussian envelope stored in a buffer rather than computed in real time for each grain? What artifact does a Gaussian envelope prevent compared to a rectangular or unsmoothed linear envelope?