concept Envelope in category chuck

appears as: Envelope, n Envelope, Envelope
Programming for Musicians and Digital Artists: Creating music with ChucK

This is an excerpt from Manning's book Programming for Musicians and Digital Artists: Creating music with ChucK.

6.3.1. Making a clarinet sound using SqrOsc and Envelope

In chapter 1 we talked about how a square wave can sound somewhat like a clarinet and how the stick-slip physics of bowed strings generate something like a sawtooth wave. Now, by applying an Envelope to a SqrOsc, you can build a super-simple clarinet that more properly (gradually) starts and stops notes.

Listing 6.4 shows a simple example of using the Envelope and SqrOsc UGens to make a clarinet sound. Note that you connect the oscillator through the Envelope to the dac . After setting an initial frequency , you use a while loop to play individual notes by triggering the Envelope , waiting a bit to let it smoothly rise, and then turning the Envelope off (again waiting a bit to let it ramp down). We use a loop to play what’s called a “harmonic series,” increasing the pitch by 55 Hz. each time .

Listing 6.4. Simple clarinet synthesis with Envelope applied to SqrOsc