## Project 2: Social/Environmental – “The Drawing Board”

Hey Guys, Imaan here bringing you the documentation of “The Drawing Board” – an interactive, collaborative drawing board!

Our group, consisting of myself, Yifat, Demi, and Ryan started brainstorming this topic thinking of various ideas for an interactive, social installation.

We came to the conlusion that an interactive art board encompassed all of the features of interactivity and social creation we wanted, whilst being feasible given our time and technological constraints.

From there, we had to run through the numerous variables which this initial idea contains – the requirements, technology needed, problems and solutions – all of which became more apparent as we discussed it in greater depth.

After this process, we realized that the coding of this project would be too difficult to accomplish using Max MSP & Processing, given our lack of expertise in these areas. Our solution: prototype the interface in Processing, and once complete, port it to Flash to be actually built, using Demi’s fantastic coding skills!

Stay tuned for the video demo!

## Basic Threshold Switch from a Mic

The Electret speaker breakout board from Sparkfun has been super popular in class so far.

https://www.sparkfun.com/products/9964

The thing is that when you finally get it wired up, it outputs what appear to be random number pulses. In waves. These are the amplitude wave of the sounds near the microphone, not an error. They can themselves be used for many things, but will not tell you if, for example, someone is talking TO the critter, just the background levels. Terrible! We need a threshold to tell us when someone’s surpassed the normal background volume instead.

Much like “face recognition,” “hearing” speech is tough. This is simple. This creates a threshold switch from a microphone. It will tell you when the sound levels nearby change to a wider range than “normal.” It requires some calibration, and some simple math. If you are outputting to a nearby speaker, it may not work very well; it will hear the speaker, as well as yourself. Better math would fix that issue. This is a simpler switch than that.

To wire it, hook 5v to a 10k pulldown resistor, ground to ground, and information to A1* as in the diagram. The datasheet says the thing needs 1.5v in, and most sources say a 5k will do you, but a 5k gives you a big fat wave with numbers between 200 and 400 – it looks super random. The 10K will compress your business like no nevermind.

*NB: I prefer A1 to A0 because A0 sometimes acts weird, and code occasionally interprets a “0” as a null value. This is important with analog inputs.

Once hooked up, here is your code:
``` /*```

Alex Leitch
@aeleitch
http://www.alexleitch.com

Oct 31 2012

Notes:
http://www.alexleitch.com/?p=83
Appropriate for All Ages, 2006, uses a much-simplified version of this circuit.
That one ran on a similar mic circuit, picked up for \$3 in a spare halloween “spooky robots” pile.
This is better because you can calibrate it, that was better because you didn’t have to. Also, it cost \$3, not \$30.

*/

const int pinSpeaker = 3;

int valMic;
int valMicRange;
int valMicLast;

int iHearYou; //set threshold for “being talked to”

void setup() {
Serial.begin(9600);
}

void loop() {

valMicRange = abs(valMic – valMicLast);
// take an absolute value of current and last value of amplitude wave for threshold

Serial.println(valMicRange);
// Find out what the absolute value of difference is – this will make a pretty visualizer out of your thresholds

if (valMicRange > iHearYou) { //do something if threshold is passed
}

else { // if not being talked to, what to do?
}

valMicLast=valMic; // hang onto that mic reading

}

Here is where the exhortation to do Amazing Things with this information comes in! But no. I am not going to lie to you: working with sound is tough and the sort of thing [redacted judgemental comment] (hi there, GearSlutz) work with. Sound is a wave, which is to say a four-dimensional transform, waves are a challenge if what you really want are robots. Sound becomes useful as a switch when, using thresholds maybe, you can transform it from a wave to a point, or at least a baseline, which is what this circuit does. Audio obsession knows no upward bounds. That message board is maybe the best review board for people who are really into analog inputs, though, and I think you may find something of use there.

Appropos of nothing, The Simpsons. Happy Hallowe’en.

## Point Cloud

Fellow Nerdz,

Check out this cool PDE sketch I found:

You’ll need this library though. openkinect.zip

Have fun!

Hi Everyone,

We will officially be kicking off the second project on Thursday night, but I wanted to pass along some relevant links for software/tools we’ll be using this week.  The main things we will be covering Thursday are:  Kinect, Max/Msp, and the principals of intersoftware communications.

The first part of the class will simply deal with getting lots of software, drivers, and libraries installed so its important that you have at least downloaded everything.

Max/Msp is a graphic programming language, For now just run the 30 day demo of the software, Later we will also look at the free version Pure Data, but for now just install max.

2. OSC and Arduino Externals for Max.  Just download these and we’ll go through where to place them.

3. Kinect Drivers.  Tomorrow we will be using the SimpleOpenNI library for processing to experiment with the Kinect.

You can also find details on how to install the drivers here: LINK

4. SimpleOpenNI Library for Processing:  LINK

5. OSCP5 Library for Processing:  LINK

I will also be sending out a set of example files, but this seems like enough for now.

7.***Files we will be using today:  LINK

Also, for those of you who have never seen Max before, here’s a little taste: