How to prevent crackles when triggering a sine oscillator with an AD envelope in your synth patch
Tutorial | Apr 07, 2023
In this video, I explain why Sine-Oscillators can give back crackles when triggered with an AD, and I share a trick to solve this issue. When using a short attack time and triggering the Sine-Oscillator, we start at minus one, which causes a crackle. To solve this, we can ease out the attack time, or we can move the cycle to a zero crossing by using a constant and the phase knob. However, a long decay time can still cause crackles when re-triggering the oscillator. To solve this, we can use a comparison with the AD output and a gate input to wait until the decay phase is finished before re-triggering the oscillator. Additionally, I suggest starting at zero value to prevent crackles and explain how this applies to other sounds. Overall, following these tips can help solve crackle issues in Sine-Oscillators.
You can watch the Video on Youtube - support me on Patreon
Questions & Answers #
Maybe you dont watch the video, here are some important takeaways:
Question 1: Why does the Sine-Oscillator give back crackles when triggered with an AD? #
The Sine-Oscillator gives back crackles when triggered with an AD because the attack time is pretty short and when we trigger the sign, we start basically at the cycle here at minus one. This means this signal is used to drive your speaker cone out and inside of the speaker. So it's basically moving the membrane. Therefore, we start with the minus one value instantaneously when we trigger the sound, leading to the crackle sound.
How can we circumvent the crackle with a steep attack? #
We can circumvent the crackle with a steep attack by offsetting the cycle to a zero crossing by using a constant input and going to 25%, then offsetting the face or the cycle of the Sine-Oscillator using an oscilloscope until we start with zero in the cycle. This will enable us to trigger the sound and have a completely smooth steep attack time since we are starting at zero.
What should we do when we have a long decay time and we re-trigger the Sine-Oscillator while in decay phase? #
When we have a long decay time and we re-trigger the Sine-Oscillator while in the decay phase, we should make the decay time shorter, so it fits the triggering speed. When we trigger often with short triggers, we have to make sure that the decay time basically matches our space between the triggers. If we can't do this manually, we can use a small little patch to do this automatically. We use a logic operator and use a comparison where we get the signal of the AD, the shape of the envelope, and use the output to compare it to 0. When the envelope is finished with the sequence, we will go back here with this signal to 0. We can use this output to only compare it with 0 by using this input, which is completely empty that gives us the trigger. We can then use this trigger to compare it to an end by using a long delay to make feedback since we are feeding the output back into the input.
What should we do to prevent crackles and pops when doing bass triggers or chopping up samples? #
To prevent crackles and pops when doing bass triggers or chopping up samples, we should always think about what the signal does to our speaker cone, and if possible, always start at a zero value, at a zero crossing of a sound. This will prevent us from starting at the minus or plus one value and always start with a smooth fade-in with a smooth transition from zero to plus one or to minus one. We want to have a zero crossing at the beginning as this is what leads to crackles, and this is what we can do to prevent them.
Transcription #
This is what im talking about in this video. The text is transcribed by AI, so it might not be perfect. If you find any mistakes, please let me know.
You can also click on the timestamps to jump to the right part of the video, which should be helpful.
[00:00.000] Hey folks, welcome back to another video. Just now someone asked me on my discord why
[00:05.440] the Sine-Oscillator pops or gives back some crackles when you trigger a sign with an
[00:11.840] AD. And I want to show you a small trick how you can circumvent this. It's getting
[00:17.880] a bit complicated in the end, but you get the idea. So the problem is when you use an
[00:24.480] AD and an output here. And use a short attack time, right? And then you trigger basically
[00:35.080] this here. You hear a small little crack at the start, right? You can hear a small little
[00:47.000] crack. Hopefully it's it's audible on the on the YouTube video. So the problem here is
[00:52.720] basically that the attack time is pretty short. That's the first thing. And then when we trigger
[00:58.240] the sign, we start basically at the, yeah, with the cycle here at minus one. So this means
[01:06.160] this signal is used to drive your speaker cone out and inside of the speaker. So it's
[01:15.040] basically moving the membrane. So you start with the minus one value instantaneously when
[01:22.160] you trigger the sound. So this is basically the crackle you can hear in your headphones
[01:26.560] or maybe on your speakers. So what we need to do is, or what you can do is, or what I usually
[01:32.520] do is I just ease out a bit of the attack time. So you can start at minus one, but the
[01:38.840] movie smoothly brings in the deSine-Wave over time, right? So it's already smooth, right?
[01:52.640] So maybe you want to have a steep attack. So how can you remove the crackle with a steep
[01:59.960] attack? So one thing you can do is you can move the cycle or offset the cycle to a zero
[02:08.800] crossing. So instead of starting at minus one, we want to start at zero. So we can do this
[02:14.400] here with the constant. At least that's the easiest way I know. Input this here. And then
[02:21.200] go to 25%. And when you use here oscilloscope, we can see here by just using now the face
[02:32.760] knob, we can offset the face or the cycle of the Sine-Oscillator. We go to 25. So move
[02:43.440] it basically to the left until we start you with the zero in the cycle. So now we can
[02:49.080] trigger the sound. I actually we have to re-trigger also. So we start at the same position, right?
[02:55.960] If you don't do that, if you disable this, basically the Sine-Oscillator runs free
[03:01.480] all the time. And it is decided by random when you press a key, when you bring in a certain
[03:11.600] cycle point, right? So you have to re-trigger the face every time you hit a key to start
[03:18.680] at the same position when you trigger. So now it's completely smooth with a steep attack
[03:30.840] time because we start at zero. But now we have a different problem and that's when you
[03:37.240] have a long decay time, something like this, right? And when you re-trigger the Sine-Oscillator
[03:43.600] while you are in decay phase, right? So we have a crack again because we are already
[03:57.480] unmuting the Sine-Oscillator or the output of that. And while we are playing the sign
[04:03.520] oscillator, we re-trigger the sign here and we get this crack again because we just
[04:10.400] cut off basically a sound and start at a different position in the face. So you get basically
[04:16.960] this crack or this part. So one thing we can do is we can make the decay time shorter,
[04:24.240] of course. So it fits more like the trickering speed. So when you have short triggers, something
[04:31.040] like this, you have to make sure that the decay time basically matches your space between
[04:37.880] the triggers. So when you trigger this often like this, right? You can't use a long decay.
[04:43.160] So you have to use a short one, something like this. If you can't do this manually,
[04:51.800] you can do this automatically also by a small little patch you can do. What you can do is
[04:58.800] you use your logic operator and use a comparison. And we get here the signal of the AD, the shape
[05:06.960] of the envelope, we get this here with this blue output. You can see, right? So when the
[05:15.840] envelope is finished with the sequence here, we can see we go back here with this signal
[05:20.600] to 0. So we can use this output to only compare it with 0. So this input is completely empty.
[05:28.120] So it's 0. So when the input is 0, so when we are back here or when the cycle is finished
[05:34.560] of the envelope, we get the 0. So this is 0 and this is 0, we get the trigger. We can
[05:40.360] use this trigger then to compare it to an end, something like this, that this is not possible.
[05:50.680] So we need here a long delay to make a feedback because we are feeding the output back into
[05:58.040] the input. So it's a feedback loop. We get this here, maybe make this also yellow.
[06:05.440] And the trigger input here, we can't use this anymore, so we use a gate input. So now
[06:12.920] we can't retrygar basically the AD until the last envelope cycle is finished. I retrygar,
[06:27.560] but it doesn't actually play until it's at completely at 0, which takes a while here.
[06:39.040] Right? But now we also retrygar are basically the sign while we are in the decay phase,
[06:46.560] which also leads to drag or to a pop. So we move this here to the front, uses an input
[06:52.080] disabled here to pre-cord and make sure we only retrygar when the decay phase here is
[06:58.920] finished. Maybe go here to digital one, something like this. So right, the decay phase basically
[07:09.400] decides how often you trigger now. Also you see a trigger input, something like this instead
[07:17.800] of my keyboard input. So you use your 16 nodes, you can see we don't actually retrygar
[07:27.000] that often. If you want to retrygar more, you have to make the AD shorter. It's also
[07:41.320] probably a neat trick here. If you want to increase the triggering speed without changing
[07:46.960] here the triggers value, you just do the setup, always wait until the phase from the envelope
[07:57.520] is over and then you can make here the triggering faster by just moving this in. It should be
[08:06.400] completely synchronized. And you can hear sometimes we still have a crackle here and you
[08:25.280] can maybe add a bit of delay to that. It's not super precise, maybe a bit of here attack.
[08:43.720] But yeah, one I want to say is basically the problem when you have these pops and clicks,
[08:51.040] always think about what the signal does to your speaker cone. So if you move your speaker
[08:56.400] cone in or out instantaneously to plus one or to minus one, you get the crackle. So always
[09:03.400] start if possible at a zero value, at a zero crossing of a sound. That's also why you
[09:11.560] do fade ends or fade outs on samples when you chop up a break or chop up some vocal sounds
[09:19.280] or something along those lines. You always want to bring in a small little fade so you
[09:25.360] prevent basically to start at the minus or plus one value and always start with a smooth
[09:32.440] fade in with a smooth transition from zero to plus one or to minus one. So you want to
[09:39.040] have a zero crossing at the beginning. So this is what it leads to crackles and this
[09:43.840] is what you can do here to prevent this. I know it's a bit complicated, but like I said
[09:50.960] at the beginning, you also can just do here the easy route and use an attack and decay.
[10:06.160] You have the same problem. We restart here even in the decay phase. When you do bass lines
[10:19.480] or these bass triggers, make sure you start always at a zero value. I think that's it.
[10:26.080] For this video, I want to give you this information so you can try it out for yourself and
[10:31.560] maybe solve these problems. Thanks for watching. Leave a like if you liked the video, subscribe
[10:36.960] to the channel. Thanks for watching and see you in the next one. Bye.