Closed lukephills closed 9 years ago
Since the Envelope's decay / release uses setTargetAtTime
, it is an exponential approach towards 0, but might never reach 0. The BitCrusher effect uses a WaveShaperNode which seems to be amplifying those very small values by interpolating them back and forth between two steps.
It seems like the fix is to make the _minOuput
value of the envelope smaller. It seems to be working fine for me when i set it to 0.00001, so i'll be sure to make that change in the next update.
The click also seems to be pretty easily fixable. From my testing, it appears that scheduling things now
is what is causing the click. So far, I've never gotten clicks when i try triggerAttack("+0.01")
, only when i use it with no arguments which causes it to trigger immediately: triggerAttack()
.
If i put a very small delay, it works fine. My guess is that it's unable to schedule the event at the current block (128 samples) so delaying now
events to the next block would fix the problem. Since 128 samples at 44.1k is only about ~0.003ms, the delay wouldn't be noticeable, but should fix that clicking problem.
I'll make these changes and you can let me know if it fixes your issues.
Yes this fixed both problems. Amazing thanks!
Hey,
I've noticed a couple of undesirable effects with the changes to the Envelope in r5.
There's a click on the attack portion when TriggerAttack is called. It can be heard when the attack is set anywhere between 0.02 and 0.1.
Chain an Oscillator to a AmplitudeEnvelope and Bitcrusher. Turn the bits down and without triggering the attack on the env you can here the original tone sound. Some of the Oscillator output is escaping through the envelope.