Hello,

I’m trying to playing very fast notes with PlayBuf, (maybe it could be considered as a special kind of granulator), and to avoid too much latency, I tried the server sequencing way, but I have very little experience with the Deman Ugens and all that stuff.

// This is what I want to achieve, it works, but it has clicks:

SynthDef(\playBufTest1, {| out = 0, bufnum = 0 |

var trig, sig, env;

```
trig = TDuty.ar(Drand([0.25, 0.5, 1, 1.33, 1.75, 2.3, 3, 4, 6, 8], inf) / 20.0);
sig = PlayBuf.ar(2, bufnum, BufRateScale.kr(bufnum), trig, 0);
Out.ar(out, sig);
```

}).play(s, [\out, 0, \bufnum, b]);

)

// So I trIed to put en envelope, but it doesn’t work as expected :

//The sound drops very quickly

(

SynthDef(\playBufTest2, {| out = 0, bufnum = 0 |

var trig, sig, env;

```
trig = TDuty.ar(Drand([0.25, 0.5, 1, 1.33, 1.75, 2.3, 3, 4, 6, 8], inf) / 20.0);
env = EnvGen.kr(Env.new([0,1,0], [0.01, 0.5]), trig);
sig = PlayBuf.ar(2, bufnum, BufRateScale.kr(bufnum), trig, 0);
Out.ar(out, sig * env);
```

}).play(s, [\out, 0, \bufnum, b]);

)

// With a basic trigger, the envelope works, but there are still clicks

(

SynthDef(\playBufTest3, {| out = 0, bufnum = 0 |

var trig, sig, env;

```
trig = Dust.kr(5);
env = EnvGen.kr(Env.new([0,1,0], [0.01, 0.5]), trig);
sig = PlayBuf.ar(2, bufnum, BufRateScale.kr(bufnum), trig, 0);
Out.ar(out, sig * env);
```

}).play(s, [\out, 0, \bufnum, b]);

)

Any idea ?