Pbind and samples with different durations (chain them)



About Bbind, buffer and duration:
In a Pbind, I would like the /dur key match the duration of the audio sample randomly selected in an array (~ bufFauvette array in my example).

I tried this, but it does not work:

Pbind(\instrument, \bufplay,
	\buf, Prand(~bufFauvette, inf),
	\dur, Pfunc({|d| d.buf.bufDur}),
	\legato, 1,

How do you do in this case where the sounds contained in the buffers each have a different duration, and you want to chain them without interruption?

Pbind and samples with different durations (2)

Wrong method, you need ‘duration’ (BufDur is the UGen).

Crossfades, depends on the buffers how to do best. A legato value slightly above 1 might suffice.


Yes, it’s the idea…
And thank you very much, it works very well. I added as you suggested a legato value slightly above 1.
Also, I had to put (d.buf) in parenthesis so that there is no more error. The result:

Pbind(\instrument, \bufplay,
	\amp, 1,
	\buf, Pxrand(~bufFauvette, inf),
	\dur, Pfunc({|d| (d.buf).duration}),
	\legato, 1.05,