Page 1 of 3
How to eliminate 'click' problem?
Posted: Sat Nov 22, 2014 3:02 am
by tester
I reduced the schematic to minimum, to illustrate the problem.
Each time when envelope is re-activated, new phase offsets are sent. And while it's not a problem for envelope initialization (it has 3ms fade in) - it is a problem ast the end of the old fade out, because signal is rapidly interrupted.
How to fix it?
//update:
(posted idea was wrong).
Re: How to eliminate 'click' problem?
Posted: Sat Nov 22, 2014 8:33 am
by Nubeat7
tester wrote: it is a problem ast the end of the old fade out
using smooth retrigger should fix this..
Re: How to eliminate 'click' problem?
Posted: Sat Nov 22, 2014 2:05 pm
by tester
Nubeat7 wrote:tester wrote: it is a problem ast the end of the old fade out
using smooth retrigger should fix this..
Can you play with the example schematic a little bit to show what you mean? I spent recently so much time on the greenery, that my head is blank again when I look at the DSP codes...
Re: How to eliminate 'click' problem?
Posted: Mon Nov 24, 2014 12:40 pm
by KG_is_back
Yes, a fade in would fix this problem. The simplest thing to do is to put envelope follower or low-pass filter on the envelope and dial longer attack / lower cutoff. It smooths the sharpness of the click.
Re: How to eliminate 'click' problem?
Posted: Mon Nov 24, 2014 6:12 pm
by tester
With filters I would be careful. At this point - precise phase control and phase stability is required.
I came up with something like this. Not perfect, but it seems to work. Optimizations appreciated. I guess that desipper should be in code somehow.
Note that the anti-click control is global, while envelope timers are local, thus 0 they only share input parameters.
(hmm... works on a single sine, but when too many are there, somethings goes wrong...)
Re: How to eliminate 'click' problem?
Posted: Mon Nov 24, 2014 7:43 pm
by KG_is_back
tester wrote:With filters I would be careful. At this point - precise phase control and phase stability is required.
I came up with something like this. Not perfect, but it seems to work. Optimizations appreciated. I guess that desipper should be in code somehow.
Note that the anti-click control is global, while envelope timers are local, thus 0 they only share input parameters.
(hmm... works on a single sine, but when too many are there, somethings goes wrong...)
The filter will only shape the envelope start. The oscillator itself is completely independent (it will not pass trough the filter)
Re: How to eliminate 'click' problem?
Posted: Mon Nov 24, 2014 8:44 pm
by tester
I'm not sure if we speak about the same thing. While smoothing the fade in - will the filter add smooth/short nullification to fade out?
Check the design in first post. The problem is not the "fade in" (which is defined) of the envelope, but discontinuity of an audio signal if "interval" is shorter than "fade out" (thus - audio is not reaching null state). It's a problem in case, when initial phase of the audio signal changes per each hit and amplitudes are still high. The click happens on the envelope end so to speak.
Since the design uses only sine generators (right now), one idea was to add lowpass filter, but I'm not sure yet how far I will go with the frequencies in the gens.
Other idea is what I tried to do: to damp the signal smoothly to zero (within few ms period) before the "fade in" begins. (and because all streams will have common fade in - that part could be moved outside individual envelope clocks to anti-click solution). But I probably messed up the numbers (or there is a problem with the design), and I still have discontinuities in larger schematic.
Re: How to eliminate 'click' problem?
Posted: Mon Nov 24, 2014 10:43 pm
by KG_is_back
does this work?
Re: How to eliminate 'click' problem?
Posted: Tue Nov 25, 2014 3:19 pm
by tester
...Let's start from scratch...

Sorry for confusions.

p.s.: I'm not sure how the phase change point truly relates to "changed" trig. Maybe that's the issue?
Re: How to eliminate 'click' problem?
Posted: Tue Nov 25, 2014 3:53 pm
by KG_is_back
Yes, this is almost what my schematic does. Only problem is, that you need lookahead to "de-click" the decay envelope by fade out. In my schematic this is done by delaying the trigger/pulse that starts new envelope and re-triggers phase and uses the original (non-delayed) pulse to trigger the fade-out.
As long as you will keep the same delay (=fadeout length) on all oscillators, their phase relationship will remain the same.
The Fade-in part is done by an envelope follower (lowpass filter) on the original envelope. This sort of adds "attack" to the envelope (effectively creating AD - attack-decay envelope). You can see this in my schematic by pausing the scope just in right time to see the envelope transitions.