Physically Modeling Multitouch Controls

spinnerFor the last two weeks I have been working on a performance application that I’m developing in MaxMSP controlled with TouchOSC on the iPhone or iPod Touch. The application is coming along quite well. I have the granular traversal piece working how I want, as I described in Traversing Samples with Granular Synthesis.

Now I’m working on another feature of the application designed to allow the user to play samples with a rotary dial; not unlike manually spinning a record on a turntable. The basics of getting this going were pretty simple, but I also wanted to be able to spin the dial and have it continue to rotate based on the acceleration applied. Secondly, I wanted to have a slider that would adjust the amount of friction, from frictionless to instant braking.

This essentially involved physically modeling the control to behave like a turntable or other spinning device. After trying four or five techniques using standard Max objects I managed to get it working, but it wasn’t pretty. Instead I decided to try using a few lines of Javascript to do the calculations and adjust the position of the dial. This worked much better and only required about 35 lines of code. The best way to illustrate this application will be with video. I’ll shoot a few minutes to get the point across and share it here soon. For now here’s a recording made with the modeled controller I described and just a small amount of friction.

Percussion Loop Spinning

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

TouchOSC Controlled Glitch Looper in MaxMSP

Custom TouchOSC LayoutI don’t have this patch ready to share yet, but I thought I could at least explain a little bit about it and offer an audio example. What I’m working on is a device to manipulate samples in unconventional ways using alternative input methods. This audio clip, for example, was generated using a Max patch that adjusts the playback frequency and length of a sample using an x-y controller. The x-axis controls the frequency while the y-axis controls the sample length. For a controller I used an iPod Touch running TouchOSC. I’ve been using Mrmr as well, but wanted to try TouchOSC now that it has an editor to create custom layouts.

My goal is to create several pages in TouchOSC that allow you to manipulate one of five samples in several different ways. The image is a shot of my iPod Touch displaying the custom layout that I created and connected to my Max patch for creating the sound linked below.

Mad Looper