Skip to content

Envelope Generator overview

f00b4r0 edited this page Feb 1, 2021 · 1 revision

The envelope generator alters the waveform amplitude based on four 4-bit parameters (attack, decay, sustain and release) and the gate signal to mimic real instruments sound dynamic. The envelope output is an 8 bit value, clocked up or down depending on the state, which modulates the waveform output through an MDAC. When the gate goes high the volume raises up to $ff linearly then it falls down exponentially to the sustain level. Once the gate is released the volume goes down exponentially to zero. A 15 bit LFSR is used to divide the clock during the attack phase providing 16 different attack rates, ranging from 2ms to 8s. Another 5 bit LFSR further divedes the clock during the decay/release phases to approximante an exponential curve, ranging from 6 ms to 24 s. The stop-points for the LFSRs are determined by two LUTs indexed by the ADR values.