Sync'd pitch Playbuf

Hello,

I am still new to SC and this is a wee bit beyond my paygrade.
I want to create arrays of pitched samples. Which I do with this-

({
var a,b,c,d;
b=Array.fill(10,{exprand(1.1,1.2).postln});
a=PlayBuf.ar(2,~cel,b,1,0);
a=Mix([a]).clump(5)*0.1 ;
}.play)

BUT I want them to be all in sync…
Using the rate to change the pitch makes subtle delays.

Thanks!

If you want them to be in sync you better be going with the granulator like GrainBuf or fft synthesis

Interesting!
Thanks.
Any suggestions on where to start?

Could you please specify a bit more: how long are your samples and of what kind ? How much pitch shift do you want at max ?

E.g. if you have percussive sounds and you want to play them in parallel it might suffice to measure the (silent ?) time before attack and calculate the adapted start positions. Clearly the decay times will be different though …

Other than that, as mentioned, granular and fft pitch shift are the methods that can be used. The easiest way ist the built-in granular-based PitchShift ugen. IMO it is not as bad as widely regarded, you have to find reasonable params, which depend very much on the sound.

I’d recommend controlling timeDispersion and pitchDispersion params with mantissa and exponent, find an example here:

https://www.listarc.bham.ac.uk/lists/sc-users-2017/msg55080.html

You’ll see that for playback of most recorded sounds it is easier to find good params than for Saw.

Daniel

Hey,
Thanks I will check that out.

For this project I would be using long samples 20seconds to a few minutes. I only want to detune/pitchshift them a little bit, maybe 100-500 cents either way.

Cheers
Max

Then I suppose it might be easier to take a standard pitch shifter of a DAW, e.g. Reaper’s Reapitch fx. But yes, check and compare the results.

That would make sense.

I am checking out your \pitchShift_1 synthdef right now. Thanks again for that.

I’m now using this one, it is better than the other ones I tested :
https://github.com/supercollider-quarks/redSys/blob/master/redEffects/RedEfxPch2.sc (thank you very much, Fredrik Olofsson!).
I use also windowDur as a parameter, it affects the quality, depending on ratio (defined in +/- semi-tones). Because windowDur bring a little the latency, it is better to have the same if the sounds have to be synchronized.