Sync'd pitch Playbuf


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;
a=Mix([a]).clump(5)*0.1 ;

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


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

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:

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


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.


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 : (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.