Hello;
I have a simple example (although under the hood the number flow is complex). It is a SynthDef with a FSinOsc wave generator and a percussive envelope. As you can see in the attachment the Pbind generates patterns for what is intended to be a simple granular synthesis. The problem, and it is a very uncomfortable issue, is that it produces latencies constantly. I don’t know if it’s my equipment (Mac M1 with Focusrite Scarlett 2i2), the server, or a combination of everything.
I have consulted this problem before on here but could not resolve the issue.
I would appreciate experience from someone who has had these same problems and solved them.
Regards
SynthDef(\sineGrainWPercEnv, {
arg freq = 800, amp = 0.1, envdur = 0.1, pan=0;
var signal;
signal = FSinOsc.ar(freq, 0, EnvGen.kr(Env.perc(0.001, envdur), doneAction: 2)*amp);
OffsetOut.ar(0, Pan2.ar(signal, pan));
}).add;
Pbind(
\instrument, \sineGrainWPercEnv,
\freq, Pseq([1000, 2000, 4000], inf), // try to add 3000 in here
\amp, Pfunc({rrand(0.1, 0.2)}),
\envdur, Pseq([0.01, 0.02, 0.04], inf),
\dur, Pseq([0.01, 0.02, 0.04], inf), // density
\pan, Pseq([0.9, -0.9],inf)
).play;
Returns:
-> an EventStreamPlayer
late 0.264374563
late 0.224374563
late 0.214374563
late 0.194374563
late 0.154374563
late 0.144374563
late 0.124374563
late 0.084374563
late 0.074374563
late 0.054374563
late 0.014374563
late 0.004374563
late 0.045447271
late 0.035447271
late 0.015447271
late 0.018561771
late 0.018221563
late 0.093701438
late 0.076921354
late 0.066921354
late 0.046921354
late 0.006921354
late 0.066240938
late 0.046240938
late 0.006240938
late 0.032929813