Assignment: Synthesis: Music Instrument (group work)
Collaborators:
Assignment: Synthesis: Music Instrument (group work)
Collaborators:
Assignment: Synthesis: Music Instrument (group work)
Collaborators:
Assignment: Synthesis: Music Instrument (group work)
Collaborators: kjtsai, kurt, jin0305, hazel
This project maps sounds from people's everyday lives and allows the user to walk in another person's shoes, literally. Ideally people would bring their own shoes which they would map to a sound (we would have plenty available) that they felt related to themselves and then others would be able to make music, exploring what types of beats people brought. It requires significant coordination among team members to produce a synthesis that sounds good .....we're still practicing.
http://www.youtube.com/watch?v=ALLJOp8Yoww
MATERIALS:
8 shoes
8 FSR
4 Arduino boards
8 resisters
Tape
Playdough
wires
AURDUINO CODE
// Output
int fsrPin1 = 0;
int fsrPin2 = 1;
int fsrVal1 = 0;
int fsrVal2 = 1;
void setup()
{
Serial.begin(9600);
// ...set up the serial ouput on 0004 style
}
// Main program
void loop()
{
fsrVal1 = analogRead(fsrPin1);
fsrVal2 = analogRead(fsrPin2);
Serial.print("a");
Serial.println(fsrVal1);
Serial.print("b");
Serial.println(fsrVal2);
}
PROCESSING CODE
import ddf.minim.*;
import processing.serial.*;
String portname = "COM4";
Serial port;
String buf = "";
int cr = 13; // ASCII return == 13
int lf = 10; // ASCII linefeed == 10
Minim minim;
AudioPlayer partyPlayer;
AudioPlayer rainPlayer;
String partyMusic = "whistleshort.wav";
String rainMusic = "Typequick.wav";
int threshhold = 500; // threshhold for the FSR
void setup()
{
size(512, 200, P2D);
// always start Minim before you do anything with it
port = new Serial(this, portname, 9600);
minim = new Minim(this);
partyPlayer = minim.loadFile(partyMusic, 2048);
rainPlayer = minim.loadFile(rainMusic, 2048);
}
void draw()
{
background(0);
stroke(255);
// draw the waveforms
// the values returned by left.get() and right.get() will be between -1 and 1,
// so we need to scale them up to see the waveform
// note that if the file is MONO, left.get() and right.get() will return the same value
for(int i = 0; i < partyPlayer.left.size()-1; i++)
{
line(i, 50 + partyPlayer.left.get(i)*50, i+1, 50 + partyPlayer.left.get(i+1)*50);
line(i, 150 + partyPlayer.right.get(i)*50, i+1, 150 + partyPlayer.right.get(i+1)*50);
}
}
// called whenever serial data arrives
void serialEvent(Serial p) {
int c = port.read();
if (c != lf && c != cr) {
buf += char(c);
} else if (c == lf) {
println(buf);
char indicator = buf.charAt(0);
buf = buf.substring(1, buf.length());
int val = int(buf);
println(buf);
println(val);
if (indicator == 'a' && val > threshhold) {
partyPlayer.play();
partyPlayer.rewind();
} else if (indicator == 'b' && val > threshhold) {
rainPlayer.play();
rainPlayer.rewind();
}
buf = "";
}
}
void stop()
{
// always close Minim audio classes when you are done with them
partyPlayer.close();
rainPlayer.close();
minim.stop();
super.stop();
}