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

[sc-users] ATS clicks and distortion



Hello,

I asked this question awhile back and I thought that I had got a handle on this problem, but it appears I hadn't.

Basically, I am running an ATS SynthDef that creates a single partial, and I am reconstructing the while ATS file through a pattern that plays all the partials. It works quite well, until I go down to very small envelope times. I am even using an .ar envelope and OffsetOut, which helps a little but not much.

It's not just the 'pop' of a quick envelope attack either, it almost sounds like nyquist aliasing, or zipper noise.

Josh had identified earlier that this is probably ATS tracks going to zero and the track changing scheme of ATS data - this makes sense, as when I am scanning through the data very quickly and applying to the sine waves is when it starts popping.

Is there anything more that can be done either on the ATS analysis side or on the SC side to deal with this?

I've included my code below - note that it's more or less prominent with different analyses, but but it's always noticeable when I have short envelope times with a very fast scan of the ATS data.

Perhaps I would have better luck with using a SPEAR based approach, or another analysis protocol? Any suggestions welcome!

SynthDef and Pattern below:

(
//partial player

SynthDef(\atsPartialPlayer, {arg ampBuffer, freqBuffer, partial, ampBufDur = 1, freqBufDur = 1, atk = 1, sus = 1, rel = 1, sustain =1, anaLag = 0.01, baseFreq = 1, fStr =0, fEnd = 1, fCurve = 1,aStr =0, aEnd = 1, aCurve= 1, amp = 1, freq = 1, freqScal = 1, ampScal = 1, pan = 0, curve = 0, outBus = 0; var sig, parFreq, parAmp, fEnv, aEnv, env;

aEnv = Env([aStr, aEnd],[1],[aCurve]);
fEnv = Env([fStr, fEnd],[1],[fCurve]);
aEnv = EnvGen.ar(aEnv.duration = sustain);
fEnv = EnvGen.ar(fEnv.duration = sustain) ;

parFreq = AtsFreq.ar(freqBuffer, partial, fEnv).lag(anaLag);
parAmp = AtsAmp.ar(ampBuffer, partial, aEnv).lag(anaLag);

env = EnvGen.ar(Env.linen(atk,sus,rel,1, curve).duration = sustain, doneAction:2);
sig = SinOsc.ar(parFreq * (freq/baseFreq) * freqScal, 0, parAmp * ampScal);

OffsetOut.ar(outBus, Pan2.ar(sig * env, pan))
}).add(s);

//partial pattern
Pdef(\atsPartialPattern,
Pbind(\instrument, \atsPartialPlayer,
\type, \on,
\group, ~gen,
\addAction, \addToTail,
\ampBuffer, g.bufnum,
\freqBuffer, g.bufnum,
\baseFreq, 60.midicps,

\degree, Pseq([[0, 2, 4], [2, 0, 4],[3, 6, 2]] , inf),
\scale, Scale.minor(~tuning),
\root, Pseries(-12 , Pseries(-12 ,4, inf).fold(0, 7), inf).fold(-12, 12),

\partial, Pfunc{Array.series(32, 0, 1)},
\freqScal, Pfunc{Array.series(32, 1, 0)},
\ampScal, Pfunc{Array.series(32, 0.4, -0.001)},

        \fStr, 0.2,
        \fEnd, 0.7,
        \fCurve, \lin,
        \aStr, 0.2,
        \aEnd, 0.7,
\aCurve, \lin,

\atk, Pkey(\partial).fold(1,2),
\sus, Pkey(\partial).fold(1,2),
\rel, Pkey(\partial).fold(1,3),

\curve, 0,
\anaLag, 0.01,
\pan, Pkey(\partial).fold(-1,1),
\outBus, 0,
\dur, Pseries(0.002, 0.15,inf).fold(0.01, 0.2),
\legato, Pkey(\dur) * Pseries(1, 0.1,inf).fold(1, 15),
)
);

--