The state mechanisms are broken in this version. I have no internet, so stay tuned if you want to see the correct version. *hopefully soon
This is just an adsr abstraction that allows for realtime modulation of the atk, dec, sus, rel, and curve.
It uses a timer to calculate changes in the adsr.
It uses a series of lookup tables to compare the envelope’s current amplitude with the appropriate index of the desired curve when modulating the curve.
The resolution is only 256 and the the tables are read with tabread~. You could raise the precision with some hacking if you need.