[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sv: Sv: [sc-users] What is causing the audible clicks when the envelope is retriggered



Thanks very much! I like the sound of the sweep even if there is less attack. I guess I have to experiment some more in order to

Have more control over how sweep behaves in order to get that attack.

Thanks a lot!

 

Skickades från E-post för Windows 10

 

Från: borisklompus@xxxxxxxxxxxxxx
Skickat: Saturday, 19 June 2021 18:48
Till: sc-users@xxxxxxxxxxxxxxxx
Ämne: Re: Sv: [sc-users] What is causing the audible clicks when the envelope is retriggered

 

Yeah that's true, and your original code was technically correct, but because you aren't resetting the sine wave at the same time as your envelope, you're getting clicks when it's not at a zero crossing.

 

But for your timbre, what I'm hearing is that you're using the freqA to 'announce' the attack stage of the kick, more than the actual ramp to 1. And your amplitude envelope is doing transient shaping, but otherwise is effectively at 1.

 

// triggers 2/sec

(

// if Trig's dur is set to 0.5 it misses retrigger... 

{ var atk=0.001, rel=1, c1=1, c2=(-12);

EnvGen.kr(Env([0, 1, 0], [atk, rel], [c1, c2], 1), Trig.kr(Impulse.kr(2), 0.49));

}.plot(2);

)

(

{ var atk=0.001, rel=1, c1=1, c2=(-12);

EnvGen.kr(Env([0, 1, 0], [atk, rel], [c1, c2], 1), Trig.kr(Impulse.kr(2), 0.499));

}.plot(2);

)

(

{ var atk=0.001, rel=1, c1=1, c2=(-12);

EnvGen.kr(Env([0, 1, 0], [atk, rel], [c1, c2], 1), Trig.kr(Impulse.kr(2), 0.5));

}.plot(2);

)

 

(

{ var atk=0.001, rel=1, c1=1, c2=(-12);

EnvGen.kr(Env([0, 0, 1, 0], [0, atk, rel], [c1, c1, c2], 2), Trig.kr(Impulse.kr(2), 0.49));

}.plot(2);

)

 

 

Hmm, and this changes the timbre completely, but syncing the sine osc with the trigger does get rid of  the click...

I'm using Sweep to control the phase of the sine wave, which gets reset with each trigger. I think technically it should have the linlin(0, 1,  0, 2pi) message appended to it, since Sweep is 0 to 1 and phase is 0 to 2pi, but I tried that and it lost all sense of kick drum to me.

Using range(0, 2pi) is wrong I think, but sounds a bit better to my ears, but I prefer it completely without any scaling.

Again, it's all quite different sounding than yours - sorry - just might be interesting as a different point of approach?

 

(

SynthDef.new(\k1mono, {

 

| freqA=800, freqB=50, freqC=40, freqDur1=0.02, freqDur2=0.5, freqC1=(-1), freqC2=(-1),

 

atk=0.001, rel=1, c1=1, c2=(-12), amp=1, pan=0, out=0, ts=1 |

 

var sig, freqSweep, env, trigger= \trig.tr(1);

 

env = EnvGen.ar(Env([0, 0, 1, 0], [0, atk, rel], [c1, c1, c2], 2), trigger, timeScale:ts);

 

freqSweep = EnvGen.ar(Env([freqA, freqA, freqB, freqC],[0,freqDur1,freqDur2],[freqC1,freqC1,freqC2], 2),trigger,timeScale: ts);

 

sig = SinOsc.ar(0, Sweep.ar(trigger, freqSweep));

 

sig = sig * env;

 

sig = Pan2.ar(sig, pan, amp);

 

Out.ar(out, sig);

 

}).add;

)

 

 

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Saturday, June 19th, 2021 at 11:10 AM, <nilswallgren@xxxxxxxxxxx> wrote:

 

Thanks! Yeah changing release node from 2 to 1 makes it better. I’ve never really understood what exactly is going on with the release nodes. I thought I hade to add the extra 0 in Env([0,0,1,0] because it skips the first when retriggered?

I made another sequence so it is easier to here which one is better. I thing your first suggestion.

 

(

SynthDef.new(\k1mono, {

                      | freqA=800, freqB=50, freqC=40, freqDur1=0.02, freqDur2=0.5, freqC1=(-1), freqC2=(-1),

                      atk=0.001, rel=1, c1=1, c2=(-12), amp=1, pan=0, out=0, ts=1 |

                      var sig, freqSweep, env, trigger= \trig.tr(1);

env = EnvGen.ar(Env([0, 1, 0], [atk, rel], [c1, c2], 1), trigger, timeScale:ts);

           freqSweep = EnvGen.ar(Env([freqA, freqA, freqB, freqC],[0,freqDur1,freqDur2],[freqC1,freqC1,freqC2]),trigger,timeScale: ts);

          

                      sig = SinOsc.ar(freqSweep, pi/2);

                      sig = sig * env;

                      sig = Pan2.ar(sig, pan, amp);

                      Out.ar(out, sig);

           }).add;

)

 

env = EnvGen.ar(Env([0, 1, 0], [atk, rel], [c1, c2], 1), trigger, timeScale:ts);  // sounds best

env = EnvGen.ar(Env([0, 0, 1, 0], [atk * 0.1, atk, rel], [c1, c1, c2], 2), trigger, timeScale:ts); 2nd

env = EnvGen.ar(Env([0, 0, 1, 0], [atk, atk, rel], [c1, c1, c2], 2), trigger, timeScale:ts); 3rd

 

 

 

(

Pmono(\k1mono,

           \freqC,60,

           \freqB,70,

           #[dur,rel,freqA], Ptuple([

                   Pseq([0.5,0.25,1,0.25,1,2,0.25,0.25],1),

                            Pseq([4,0.75,10,2,5,2,2,1],1),

                            Pseq([800,800,700,500,400,500,300,300],1)

           ]*0.5,inf),

           \trig,1,

                    \ts, Pseq([0.9,1],inf),

           \amp,0.2

).play

)

 

 

Skickades från E-post för Windows 10

 

Från: borisklompus@xxxxxxxxxxxxxx
Skickat: Saturday, 19 June 2021 15:40
Till: sc-users@xxxxxxxxxxxxxxxx
Ämne: Re: [sc-users] What is causing the audible clicks when the envelope is retriggered

 

Hello,

 

I believe that the clicks are caused from the combination of the free running oscillator not being reset with your amplitude envelope, and the 0 second first stage attack. You're not starting at a zero crossing of the wave.

 

I removed the first stage of you amplitude envelope and the clicks went away:

 

env = EnvGen.ar(Env([0, 1, 0], [atk, rel], [c1, c2], 1), trigger, timeScale:ts);

 

 

I figure you have that extra stage in there for the retriggering to also have an attack stage (though I don't think it's necessary?), so not removing it, but setting it to be the same as atk also solves this:

 

env = EnvGen.ar(Env([0, 0, 1, 0], [atk, atk, rel], [c1, c1, c2], 2), trigger, timeScale:ts);

 

I also scaled it further down, there's a click but it's a bit more harmonically consistent...

 

env = EnvGen.ar(Env([0, 0, 1, 0], [atk * 0.1, atk, rel], [c1, c1, c2], 2), trigger, timeScale:ts);

 

Boris

 

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Saturday, June 19th, 2021 at 8:56 AM, <nilswallgren@xxxxxxxxxxx> wrote:

 

I am trying to create a kick that cuts off when retriggered. The problem is that there sometimes are audible clicks when doing this.

Is there away around this?

 

//Instrument

 

SynthDef.new(\k1mono, {

                      | freqA=800, freqB=50, freqC=40, freqDur1=0.02, freqDur2=0.5, freqC1=(-3), freqC2=(-1),

                      atk=0.001, rel=1, c1=1, c2=(-12), amp=1, pan=0, out=0, ts=1 |

                      var sig, freqSweep, env, trigger= \trig.tr(1);

           freqSweep = EnvGen.ar(Env([freqA,freqA, freqB, freqC],[0,freqDur1,freqDur2],[0,freqC1,freqC2],2),trigger);

           env = EnvGen.ar(Env([0,0,1,0],[0,atk,rel],[c1,c1,c2],2),trigger,timeScale:ts);

                      sig = SinOsc.ar(freqSweep, pi/2);

                      sig = sig * env;

                      sig = Pan2.ar(sig, pan, amp);

                      Out.ar(out, sig);

           }).add;

 

//Sequence

 

(

Pmono(\k1mono,

           \freqA, 600,

           \freqC,60,

           \freqB,100,

           \rel, Pseq([1,0.5,3,10],inf),

           \dur, Pseq([0.5,0.25]*0.5,inf),

           \trig,1,

           \amp,0.03

).play

)

 

Best,

 

Skickades från E-post för Windows 10