You're accumulating more than you should. Keep track of the current adsr level, separately:nastyfingers wrote:
I tried storing a previous sample like with filters and mixing the 2 however this just causes signal overload.
Code: Select all
currentSamp = prevSamp + (currentSamp * (1.0f / attack));
Code: Select all
...
envLevel = envLevel + increment;
...
return envLevel;