Music gloves

 

When Kate first launched the project, I tried to deliver a different way to experience music. The first concept was a musical belt, but it was too difficult because there was insufficient surface area to incorporate the module onto the belt. With more brain storming, I decided to move onto the musical glove. I chose the musical glove because I can deliver a visual part of the music along with the audio to the audience. Prior to the final product, I first set the layout of the design with normal thread, and with success I completed it with conductive thread. The most challenging part of the whole project was to apply a switch to the Lilypad to make the two sets of notes (C Major, C Minor).

Codes

#include <Bounce.h>

// Variable setup
int speakerPin = A2;
int keyPin = A1;
int gndPin = 3;
int gndPin2 = A0;
int switchPin5 = 5;
int switchPin6 = 6;
int switchPin7 = 7;
int switchPin8 = 8;
int switchPin9 = 9;
int switchPin10 = 10;
int switchPin11 = 11;
int switchPin12 = 12;
int ledPin = 13;
int minorKey = 0;
Bounce bouncer = Bounce(keyPin,50); // Button debounce
int soundLength = 500;

// Setup
void setup() {
pinMode(vibratorPin, OUTPUT);
pinMode(speakerPin, OUTPUT);
pinMode(gndPin,OUTPUT);
pinMode(gndPin2,OUTPUT);
digitalWrite(gndPin,LOW);
digitalWrite(gndPin2,LOW);
pinMode(keyPin, INPUT);
pinMode(switchPin5, INPUT);
pinMode(switchPin5, INPUT);
pinMode(switchPin6, INPUT);
pinMode(switchPin7, INPUT);
pinMode(switchPin8, INPUT);
pinMode(switchPin9, INPUT);
pinMode(switchPin10, INPUT);
pinMode(switchPin11, INPUT);
pinMode(switchPin12, INPUT);
pinMode(ledPin, OUTPUT);
// Turn on internal pullup resistor
digitalWrite(keyPin, HIGH);
int i = 5;
while (i < 13) {
digitalWrite(i, HIGH);
i++;
}
}

void loop() {

while (1) {
bouncer.update();
// Play sound depends on which pin is touched
if (digitalRead(switchPin5) == LOW) {
if (minorKey)
tone (speakerPin,2093);  // Minor C
else
tone(speakerPin,2093);  // Major C

delay(soundLength);
}
else if (digitalRead(switchPin6) == LOW) {
if (minorKey)
tone (speakerPin,2349);  // Minor D
else
tone(speakerPin,2349);  // Major D
delay(soundLength);
}
else if (digitalRead(switchPin7) == LOW) {
if (minorKey)
tone (speakerPin,2489);  // Minor E
else
tone(speakerPin,2637);  // Major E
delay(soundLength);
}
else if (digitalRead(switchPin8) == LOW) {
if (minorKey)
tone (speakerPin,2793);  // Minor F
else
tone(speakerPin,2794);  // Major F
delay(soundLength);
}
else if (digitalRead(switchPin9) == LOW) {
if (minorKey)
tone (speakerPin,3136);  // Minor G
else
tone(speakerPin,3136);  //Major G
delay(soundLength);
noTone(speakerPin);
}
else if (digitalRead(switchPin10) == LOW) {
if (minorKey)
tone (speakerPin,3322);  // Minor A
else
tone(speakerPin,3520);  //Major A
delay(soundLength);
}
else if (digitalRead(switchPin11) == LOW) {
if (minorKey)
tone (speakerPin,3729);  // Minor B
else
tone(speakerPin,3951);  //Major B
delay(soundLength);
}
else if (digitalRead(switchPin12) == LOW) {
if (minorKey)
tone (speakerPin,4186);  // Minor C
else
tone(speakerPin,4186);  //Major C
delay(soundLength);
}
noTone(speakerPin);

// Detect Switching key button
if (bouncer.fallingEdge())  {
minorKey = !minorKey;
digitalWrite(ledPin,HIGH);
}

}

}

 

Process:

<testing the led before sewing onto conductive thread.

Final product:

Videos:

Comments are closed.