I am making an Envelope Generator Plugin
mainly for my own Use but i believe others would also use it in a Game.
Envelope Generators are traditionally used in electronic Music to play a Note by animating the Loudness of a continuous Sound.
They typically have 4 Phases, together known as ADSR:
- Attack: Starts in the same Moment as the Note.
It ramps up the Volume of the Note to its Max. - Decay: The Note gets quieter but not mute.
- Sustain: For as long as the Note is held, it stays at the same Volume.
- Release: When the Note ends, it doesn’t silence abruptly.
It mutes smoothly.
More Info: Envelope (music) — English Wikipedia
The Purpose of making an Envelope Generator in Godot is that
it can animate much more than just Sound, for Example the Opacity of a Sprite.
Typical Envelopes only use linear Interpolation between the Start and End of each Phase
but my Implementation uses Curves, so i can change the Shape of each Phase in a Way that is more expressive but still easy to use.
This is also why i removed the Decay Phase from my Implementation:
Because the Attack Curve can include both Attack and Decay.