Team
Ben Hongcheng Sun, Kristina Hart, Vaidyanath Venkitasubramanian, Ian Birnam, Yuki Chavez, Clemens Meyer
Description
ClapClap Revolution is a collaborative musical instrument. Players clap their hands while wearing a pair of gloves, which detect the clapping and trigger the sound of a percussion instrument. Depending on the combination of gloves clapped (e.g., Player A left and Player A right, or Player A left and Player B right), a different sound is played.
Video
clapclap_revolution_video.mov
Parts used
- (1) Arduino Uno
- (1) Breadboard
- (6) Force-Sensitive Resistors
- (6) 10k Resistors
- (2) Blue gloves
- (2) Red gloves
- (2) Green gloves
- Cables
Code used
/**
* ClapClap Revolution
* by Ben Hongcheng Sung, Kristina Hart, Vaidyanath Venkitasubramanian, Ian Birnam, Yuki Chavez, and Clemens Meyer
*
* ClapClap Revolution is a collaborative musical instrument. Players clap their hands while
* wearing a pair of gloves, which detect the clapping and trigger the sound of a
* percussion instrument. Depending on the combination of gloves clapped (e.g.,
* Player A left and Player A right, or Player A left and Player B right), a
* different sound is played
*
* Sound samples from FreeDrumKits.net and sounds-of-revolution.com
*/
// Import libraries necessary for Arduino
import processing.serial.*;
import cc.arduino.*;
// Import library for music samples
import ddf.minim.*;
Minim minim;
Arduino arduino;
AudioSample kick;
AudioSample snare;
AudioSample tom;
AudioSample clave;
AudioSample hihat_close;
AudioSample clap;
AudioSample laser;
AudioSample applause;
// Define key variables
int pt = 25; // Pressure threshold
int applauseThreshold = 4000; // Pressure threshold for applause
int delayTime = 100; // Time to wait after each loop
void setup()
{
size(100, 100);
minim = new Minim(this);
// load BD.wav from the data folder with 512 buffer size (increase if necessary)
kick = minim.loadSample( "kick.wav", 512);
snare = minim.loadSample("snare.wav", 512);
clave = minim.loadSample("clave.wav", 512);
tom = minim.loadSample("tom.wav", 512);
hihat_close = minim.loadSample("hihat_close.wav", 512);
applause = minim.loadSample("applause.wav", 512);
clap = minim.loadSample("clap.wav", 512);
laser = minim.loadSample("laser.wav", 512);
arduino = new Arduino(this, Arduino.list()[8], 57600);
}
void draw()
{
play();
}
// Main play funtion
void play() {
// Read values from blue, green and red gloves (both left and right)
int blueL = arduino.analogRead(1);
int blueR = arduino.analogRead(0);
int greenL = arduino.analogRead(2);
int greenR = arduino.analogRead(3);
int redL = arduino.analogRead(5);
int redR = arduino.analogRead(4);
// If all sensors are pressed together, play applause sound
if(redL + redR + blueL + blueR + greenL + greenR > applauseThreshold) {
applause.trigger();
}
// If left and right glove sensors are pressed together, play snare sound
if(blueL > pt && blueR > pt) {
snare.trigger();
}
if(redL > pt && redR > pt) {
kick.trigger();
}
if(greenL > pt && greenR > pt) {
clave.trigger();
}
if(blueR > pt && greenL > pt) {
tom.trigger();
}
if(greenR > pt && redL > pt) {
clap.trigger();
}
if(redR > pt && blueL > pt) {
laser.trigger();
}
// Print sum of input values in console for debugging
println(redL + redR + blueL + blueR + greenL + greenR);
// Wait for a bit before next cycle
delay(delayTime);
}
- Login to post comments