Packages
Examples
Synth Building Blocks: Envelopes
The envelopes that come with the Synth Building Blocks package include both an AD and ADSR envelope, an envelope followers, and a lowpass gate circuit emulation. Other envelope adjacent abstractions exist, such as a MIDI sustain abstraction and an abstraction for stereo panning.
ADSR Envelopes
The SBB package's sbb.env.adsr
abstraction resembles the most common envlope found in most synth systems. It generates a standard 4-stage attack-decay-sustain-release envelope. Similar to Max MSP and RNBO's adsr~
object, the values for the attack, decay, and release stages are given in milliseconds while the sustain value is given as an amplitude value from 0 - 1. The actual sustain length is triggered with the right inlet using gate values—1 to trigger the attack, decay, and sustain stages, and 0 to end the sustain stage with the release.
This can be adventageous for chaining the envelopes of certain sounds with other events in your patch. However, in cases where it'd be better to trigger the envelope with one shot, the sbb.env.ad
object can be used. In sbb.env.ad
, the decay and release stages are omitted so that sound events can be triggered with a single event.
For an even simpler oneshot envelope, the sbb.env.lpg
abstraction can be used. This emulates a lowpass gate, which will trigger a short envelope by sending a bang into the right inlet.
Envelope Follower
Using a preexisting signal as an envelope can also be done with Synth Building Blocks by using the package's envelope follower: sbb.env.follower
. This abstraction takes an input signal and turns it into an envelope by scaling and sampling accordingly.
In the example above, an audio file is acting as our envelope by being passed through sbb.env.follower
and attenuating the signal coming from sbb.osc.analog
.
Sustain and Crossfade
Two additional abstractions are available in SBB that fit into the general category of envelope processing. One is sbb.util.xfade
which is a simple stereo panner that takes two stereo input and pans then to a single stereo output. The other, sbb.util.sustain
, emulates a MIDI sustain pedal by filtering out note-off messages from the input.