Simple Time-Stretching Instrument for Max/MSP
Often, when a person starts programming in Max/MSP, the first thing he or she wants to do is build an instrument for “time-stretching” samples – increasing the duration of the sample, without altering its pitch. Many new Max users are perplexed to find that there is no native object in MSP that allows one to independently modify the pitch and duration of samples.
Probably the quickest way to remedy this is to grab Nathan Wolek’s Granular Toolkit – a set of external objects designed to enable various types of granular synthesis. The Toolkit includes an object called gran.groove.file~, which is essentially MSP’s standard sample looper, groove~, with independent pitch/duration augmentation built in.
This object has found its way onto quite a few connect_icut tracks but it’s never sounded quite right – a little tinny and washed out. Luckily, the Toolkit includes another object, called gran.cloud.live~, which can be used in conjunction with groove~ for a rather punchier-sounding form of granular pitch/duration augmentation. The Max/MSP patch pictured above uses this technique. It was originally built as a simple stand-alone instrument and has since been integrated into the the main connect_icut Max/MSP set-up.
Here’s what it looks like inside…
The way it works is incredibly straightforward. The signal from a groove~ object is fed through the gran.cloud.live~ object and the controls are set up so that when the duration of the groove~ is changed, the gran.cloud.live~ does a little compensation and the pitch remains constant. Essentially, gran.cloud.live~ does this by busting the live signal up into a bunch of micro-loops (or “grains”), the pitch/duration of which can be adjusted independently.
The MP3 below is a demo of how the instrument sounds. It uses a sample familiar from connect_icut’s “Sea Bells on Sunday” and runs it through a bunch of presets with different durations, pitch-shifts and sizes of grain. You may notice that the particularly nice (or annoying, depending on how you look at it) thing about using the gran.cloud.live~ object is that it has a just-glitchy-enough sound and adds some nutty stereo panning.