SuperCollider and the Xth-Sense

The Xth-Sense is a analog sensor that listens to muscle sound and amplifies it for use in experimental performance. I participated a workshop in July 2012 held at LEAP in Berlin and built one.

Cleaning up the signal

Marco, its inventor, also developed some software in PureData (Pd) to work with the signal that the Xth-Sense produces. I, being more of a SuperCollider guy developed a simple patch for listening to the data:

(
    { [LPF.ar(RunningSum.rms(SoundIn.ar), 1000), SoundIn.ar] }.play
)

Since the output from the Xth Sense is just an audio signal I uses a simple audio in, SoundIn.ar to get the signal and then I cleaned it up, taking hints from what Marco was doing in Pd, so I used a Root-mean-sqaure running sum and then applied a Low Pass Filter to clean up some of the higher end noise from the environment (the microphone in the sensor is very sensitive).

Patching it around a bit

I then started to use SuperColliders live coding facilities to quickly patch together some reactive noise.

First we take what we did above and wrap an Ndef around it...

Ndef(\xth, { LPF.ar(RunningSum.rms(SoundIn.ar), 500) });

This Ndef sends the signal to the output and is the only Ndef that needs to have .play run on it...

Ndef(\out, { \in.ar(0) ! 2 * \amp.kr(0.9) }).play;

First define some filters to pass the signal through and in such a way that we can combine them in different ways...

Ndef(\limit, { Limiter.ar(\in.ar(0)) });

Ndef(\pshift, { PitchShift.ar(\in.ar(0), pitchRatio: \ratio.kr(2)) });

// GVerb has lots of param's we can tweek later...
Ndef(\gverb, { 
    GVerb.ar(
        \in.ar(0), 
        \roomsize.kr(10), 
        \revtime.kr(3), 
        \damping.kr(0.5), 
        \inputbw.kr(0.5), 
        \spread.kr(15), 
        \drylevel.kr(1), 
        \earlyreflevel.kr(0.7), 
        \taillevel.kr(0.5), 
        \maxroomsize.kr(300)) 
    }
);

Ndef(\fm, { SinOsc.ar(\feedback.ar(440), \in.ar(0)) });

Patching them together in various ways using the <<> operator which is fast and easy. Signal comes in (right) and passes through each filter till it reaches the output Ndef, \out, on the left:

// Basics 
Ndef(\out) <<> Ndef(\limit) <<> Ndef(\pshift) <<> Ndef(\xth);
// Moody 
Ndef(\out) <<> Ndef(\limit) <<> Ndef(\gverb) <<> Ndef(\pshift) <<> Ndef(\xth);
// hummm...
Ndef(\out) <<> Ndef(\xth) <>> Ndef(\fm) <<>.feedback Ndef(\out);

We can tweak some of the parameters, real time, on any of the Ndefs we have setup:

Ndef(\pshift).set(\ratio, 4);
Ndef(\fverb).setn(\mix, 1.0, \room, 0.9, \damp, 0.8);
Ndef(\out).set(\amp, 1.2);

For an introduction to making sounds like this in SuperCollider is the Simple Sound Design page.