[sdiy] samplers & pitch shifting
rsdio at audiobanshee.com
rsdio at audiobanshee.com
Sun May 13 22:22:38 CEST 2018
On May 13, 2018, at 9:07 AM, Tim Ressel <timr at circuitabbey.com> wrote:
> Forgive me if I've asked this before. I can't seem to get my head around this. I'm told if you make for example a drum machine that uses samples you HAVE to be able to change the pitch. How is this done? The pitch has to change but the sample length stays the same. Are we talking about a digital version of a Bode pitch shifter?
I disagree with that advice.
A) The ideal drum machine would have a fixed sample rate that is high enough to keep everyone happy. Every drum sample would be recorded with excellent microphones at the same sample rate as the playback hardware. If you want three toms tuned to different notes, then make three recordings. You drum machine needs enough memory to store every sound with instant access to all of the samples. This is how you make a studio quality drum machine that sounds excellent.
Over the years, drum machines have employed many, many different techniques. Some alter the playback sample rate to alter the tuning. I see no reason why the sample time length should not change, but of course the sample length in number of samples is the same because you can’t pull data out of nowhere. But this requires separate sample rates per sound, unless you want to tune the entire kit as a set. The Prophet VS actually has enough digital hardware to run every oscillator at its own sample rate, so it’s not impossible to implement, just expensive - and it requires analog mixing because of the mismatched output rates.
Once you get into pitch change techniques for devices with a fixed sample rate, you run into all kinds of ugly. There’s zero-order hold (drop sample), linear interpolation (which adds distortion), and various other tricks that were available with eighties and nineties technology. It’s not always audible. When audible, it’s not always “bad” - some folks like the aliasing and distortion.
B) Once DSP power hit a certain level, though, it became possible to perform a digital sample rate conversion that is exactly the same as running out of a DAC at one rate and then resampling the resulting analog signal via ADC at the new rate. This can be done entirely in the digital domain (avoiding the analog conversion noise) by resampling to a super high sample rate that is the least common multiple of both the input and output sample rate, and then converting back down to the desired output rate. A low-pass filter is needed if the output rate is lower than the input rate, otherwise there’re no worries. I consider this to be the second best technique to playing all samples at their original rate, because it allows changing of pitch without distortion (other than low-pass filtering where necessary).
There’s a slight difference between SRC (Sample Rate Conversion) and pitch shifting, but you’ll find papers from Julius O. Smith on the pitch shifting algorithms.
C) Once DSP power went beyond these levels, people devised various techniques for altering pitch without altering time. I see this as totally unnecessary for percussion. But if you really want to then there are techniques involving multi-tap reverb to cover the artifacts of sample snippets that are running longer or shorter than the original recording. Besides the multi-tap reverb, there are many other techniques. Actually, the multi-tap reverb algorithms for pitch shifting appeared quite early in the history of digital electronics. Now that we have laptops, the entire history of pitch shifting is available, as you’ll note when you see that Ableton Live offers at least four different algorithms for pitch shifting.
Finally, the Bode frequency shifter is not a pitch shifter. They’re two different things, and they sound different. Frequency shifting is like single-sided FM (if you like vague and incomplete descriptions).
Brian Willoughby
More information about the Synth-diy
mailing list