How to eliminate 'click' problem?

For general discussion related FlowStone
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

How to eliminate 'click' problem?

Post 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).
Attachments
define-click-problem.fsm
(8.13 KiB) Downloaded 947 times
Last edited by tester on Sun Nov 23, 2014 7:06 pm, edited 1 time in total.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: How to eliminate 'click' problem?

Post by Nubeat7 »

tester wrote: it is a problem ast the end of the old fade out

using smooth retrigger should fix this..
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: How to eliminate 'click' problem?

Post 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...
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: How to eliminate 'click' problem?

Post 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.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: How to eliminate 'click' problem?

Post 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...)
Attachments
define-click-problem-003.fsm
(36.72 KiB) Downloaded 985 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: How to eliminate 'click' problem?

Post 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)
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: How to eliminate 'click' problem?

Post 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.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: How to eliminate 'click' problem?

Post by KG_is_back »

does this work?
Attachments
click_problem.osm
(44.02 KiB) Downloaded 1047 times
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: How to eliminate 'click' problem?

Post by tester »

...Let's start from scratch... :mrgreen:

Sorry for confusions. :-)

p.s.: I'm not sure how the phase change point truly relates to "changed" trig. Maybe that's the issue?
Attachments
define-click-problem-004.fsm
(8.74 KiB) Downloaded 925 times
img.jpg
img.jpg (20.26 KiB) Viewed 17469 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: How to eliminate 'click' problem?

Post 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.
Post Reply