Grain Machine Max for Live Instrument

The Grain Machine v0.1

Something I have been meaning to do for a while was convert the MaxMSP instrument that I titled the Wavetable Glitch Machine (WTGM) into a Max for Live patch. The WTGM uses a TouchOSC interface running on an iPhone, iPod Touch, or iPad to explore samples using granular techniques as well as a virtual scrub dial with friction modeling. Visit the WTGM tag to read more and view a video of it in operation. I have renamed the instrument Grain Machine for the M4L version.

First I prepared the patch for transfer to M4L. This involved making sure that all of the interface objects were in the main patching window, reorganizing the sub-patchers, and cleaning up a variety of other things that I imagined might interfere with the process. Following that, all that was left was copying and pasting the patch into a Max Instrument, replacing some of the standard Max objects with M4L objects, and building a tidy little presentation mode.

Although I had to rework some of the logic and patch cords, the conversion went surprisingly fast. I expected to be working on this for weeks, but it only took me a matter of hours to get it into working order. There is still some fine tuning to be done, but all the necessary functionality is in place. Here’s an audio example I made with a simple breakbeat loaded into the Grain Machine.

Grain Machine Experiment

Traversing Samples with Granular Synthesis

messy_patchI have begun to refine the patch I described in the last entry, creating an instrument that allows you to traverse through samples using an x-y controller and a slider. The x axis controls the forward or backward playback frequency of the grain. The y axis controls the width of the grain; either very narrow (minimum of 10ms), to an adjustable percentage of the sample at the widest (15% by default). The slider controls the position of the grain in the sample. Buttons across the top allow you to choose one of five preset samples. Alternatives can be loaded in the patch or set as defaults.

So far the TouchOSC controller is working quite well for the project. It was a bit tricky getting the interface to reflect changes in the patch, since radio button behavior is not supported in TouchOSC. Fortunately it supports an input port, so I managed to get all the buttons toggled properly by sending data back to the iPod Touch. I have connected the accelerometer to a filter so that when turned on with a toggle, tilting it on the y axis causes a lowpass filter to effect the output. Finally, by setting a threshold on the z axis, giving the iPod Touch a brisk shake will cause the patch to loop a randomly selected grain of random length from a randomly selected buffer played back at a randomly selected rate. The variety of sounds possible with five short samples is huge. Here’s a selection of sound produced with one sample selected. The sound source is from a vintage video game. I’m curious to see if anyone can recognize it. Please post your guess in a comment.

Etude in 8 Bits for Multitouch Graintable Synthesis

Reverberated Graintable Noise

I produced this sound by programming a scale in a MIDI clip and then sending it to a virtual instrument designed to allow for freely manipulating granular synthesis through several seven point envelopes. I made several takes while I adjusted the envelops and other parameters.

One warning, this take has some piercingly high frequencies in a few places. The sound reminds me of some sort of scrambled futuristic alarm system. This led me to adding a warehouse reverb to the mix to put in into sci-fi thriller territory.

Reverberated Grain Table Noise

Tearing Grains

Using the simple granular synth packaged with Pluggo I created this nasty tearing sound. Towards the middle it sounds like it’s causing speaker damage, but don’t worry your speakers are safe. The original waveform was a sawtooth before the grain table algorithms manipulated it as you can see in the image.

Granular synthesis involves separating a waveform into grains that can be rearranged either randomly or with various formulas resulting in dense or scattered clouds of sound particles. For more information about granular synthesis, check out this entry on Wikipedia.

Tearing Grains