Midterm Individual Report
A. PROJECT TITLE – YOUR NAME – YOUR INSTRUCTOR’S NAME
Project title: Music Hand
Group member: Jinnuo Liu, Tawan Kondhorn
Instructor: Rodolfo Cossovich
B. CONTEXT AND SIGNIFICANCE
In our group research project, we came up with a kind of glove that can test the positivity of the virus. Thus, I think it is cool to use wearable interactive designs. And also, I have researched Supersynthesis, designed by Amay Kataria, which can change its appearance and behavior determined by the participation of those viewing it. So, I think a wearable design that can change the sound and lighting will be fantastic. And it manifests my definition of interaction, which is “a cyclical process in which two or more objects see, think, and speak”. In the case of Supersynthesis, the user thinks and outputs his or her ideas to the device, while the device receives them and operates its sound and light system to output a special behavior or image. Then the user sees the image of Supoersynthesis as the input. This created a cyclical process in which two actors alternately input, process, and output.
So inspired by this, our project is “Music Hand”. It is a two-player interaction game, in which the two players each put on a devised glove on one hand, and Player One plays seven notes by clicking his or her finger onto the thumb before Player Two does the same process to imitate what Player One has done. After the process, the device will give feedback to signalize how well Player 2 played. I think the design is significant because simply tapping fingers to make music and play an interactive game is interesting and creative. Our project is intended for those who like to play physical games and challenging musical games, and the design may turn out to be innovative.
C. CONCEPTION AND DESIGN:
Because it works by users tapping their fingers to play notes, our design is using a buzzer to play the sound and sticking aluminum foam onto the fingers to serve as switches, just like the pedal switch that was made in Recitation 1. And for the feedback part, we decided to use three different LED lights. If Player Two gets 6-7 notes right, the green light, marked “Excellent”, will turn on; if he gets 3-5, the yellow light, marked “Mediocre”, will turn on; if he gets less than 3, the red light, marked “Trash”, will turn on. To make it clear when Player 1 is going to play notes and when Player 2 is going to play notes, we decided to put two LED lights to signalize who should be operating. Thus, our design uses 5 LED lights, one buzzer, several cables, aluminum foam, a pair of gloves, an Arduino Microcontroller, and some resistors overall. I use these materials in light of simplicity. We intended to use an MP3 player, but the time was limited and we couldn’t figure out how the MP3 player works. Maybe in the following weeks to come, I will be exploring how to use the MP3 player.
(These are the diagram and the sketch of the first version, but it is hard to realize so we abandoned it.)
(This is the final version of our design, and we made it.)
D. FABRICATION AND PRODUCTION:
After having designed our interactive design, we started to fabricate it. I and my partner Tawan collaborated and struggled a lot when doing the project. I mainly did the coding and made the shell of the design, while Tawan mainly connected the circuit, made the glove, and did the decorations. First, we worked on the first version of the design, which includes a buzzer metronome so that notes should be played on the beat, and allows double notes, namely a person can tap both fingers to play two notes simultaneously. However, I found it too difficult to code. I wrote upwards of 500 lines of code that turned out to be not working and struggled for a whole day to figure out where the error was, and the circuit was really complicated, as is shown below.
We then decided to simplify the design by removing the metronome and abandoning the availability of multiple notes. That makes the coding much easier. But we still met up with some difficulties. The major one was that every time I put my finger in the glove in touch, the buzzer wouldn’t beep, whilst every time I disconnected the touch of my fingers, the buzzer will beep randomly. I asked the professors and searched for solutions on Google, and finally found that “pinMode(2, INPUT)” should be replaced by “pinMode(2, INPUT_PULLUP)”. This makes it more stable. After that, we finished making the gloves and realized the basic parts of our project. The glove is shown as below:
Furthermore, during the User Testing Session, we found that the aluminum foam wasn’t tightly stuck and usually fell off, and wasn’t sensitive enough. Thus, I reformed the code, by means of decreasing the delay in the detection part of the code. Also, Tawan used masking paper to stick the aluminum foam on the gloves more tightly.
Here is the happiest moment of the project: we finally decorated it and fixed all the bugs, making it work steadily.
acc051fd710e6a968c5ac47a867e5332
And here is the code of our project:
const int rf1 = 2;
const int rf2 = 3;
const int rf3 = 4;
const int rf4 = 5;
const int rf5 = 6;
const int rf6 = 7;
const int rf7 = 8;
const int rf8 = 9;
int rf1_state;
int pre_rf1_state = HIGH;
int rf2_state;
int pre_rf2_state = HIGH;
int rf3_state;
int pre_rf3_state = HIGH;
int rf4_state;
int pre_rf4_state = HIGH;
int rf5_state;
int pre_rf5_state = HIGH;
int rf6_state;
int pre_rf6_state = HIGH;
int rf7_state;
int pre_rf7_state = HIGH;
int rf8_state;
int pre_rf8_state = HIGH;
int gamemode = 1;
int num = 0;
int notes[8];
int notes2[8];
int lastnote=0;
void setup() {
Serial.begin(9600);
pinMode(rf1, INPUT_PULLUP);
pinMode(rf2, INPUT_PULLUP);
pinMode(rf3, INPUT_PULLUP);
pinMode(rf4, INPUT_PULLUP);
pinMode(rf5, INPUT_PULLUP);
pinMode(rf6, INPUT_PULLUP);
pinMode(rf7, INPUT_PULLUP);
pinMode(rf8, INPUT_PULLUP);
pinMode(A0, OUTPUT);
pinMode(A1, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(A5, OUTPUT);
pinMode(A4, OUTPUT);
pinMode(A3, OUTPUT);
digitalWrite(10, HIGH);
}
void loop() {
if (gamemode == 1) {
rf1_state = digitalRead(rf1);
rf2_state = digitalRead(rf2);
rf3_state = digitalRead(rf3);
rf4_state = digitalRead(rf4);
if (rf1_state == LOW && rf1_state != pre_rf1_state && millis()-lastnote > 450) {
// tone(A0, 523, 300);
tone(A1, 523, 300);
for (int i = 1; i <= 7; i++) {
if (notes[i] == 0) {
notes[i] = 1;
Serial.print(notes[i]);
Serial.print(" ");
break;
}
}
lastnote=millis();
}
if (rf2_state == LOW && rf2_state != pre_rf2_state && millis()-lastnote > 450) {
//tone(A0, 587,300);
tone(A1, 587, 300);
for (int i = 1; i <= 7; i++) {
if (notes[i] == 0) {
notes[i] = 2;
Serial.print(notes[i]);
Serial.print(" ");
break;
}
}
lastnote=millis();
}
if (rf3_state == LOW && rf3_state != pre_rf3_state && millis()-lastnote > 450) {
// tone(A0, 659,300);
tone(A1, 659, 300);
for (int i = 1; i <= 7; i++) {
if (notes[i] == 0) {
notes[i] = 3;
Serial.print(notes[i]);
Serial.print(" ");
break;
}
}
lastnote=millis();
}
if (rf4_state == LOW && rf4_state != pre_rf4_state && millis()-lastnote > 450) {
// tone(A0, 698,300);
tone(A1, 698, 300);
for (int i = 1; i <= 7; i++) {
if (notes[i] == 0) {
notes[i] = 4;
Serial.print(notes[i]);
Serial.print(" ");
break;
}
}
lastnote=millis();
}
pre_rf1_state = rf1_state;
pre_rf2_state = rf2_state;
pre_rf3_state = rf3_state;
pre_rf4_state = rf4_state;
if (notes[7] != 0) {
gamemode = 2;
//Serial.println(gamemode);
digitalWrite(10, LOW);
digitalWrite(11, HIGH);
}
}
if (gamemode == 2) {
rf5_state = digitalRead(rf5);
rf6_state = digitalRead(rf6);
rf7_state = digitalRead(rf7);
rf8_state = digitalRead(rf8);
if (rf5_state == LOW && rf5_state != pre_rf5_state && millis()-lastnote > 450) {
// tone(A0, 523,300);
tone(A1, 523, 300);
for (int i = 1; i <= 7; i++) {
if (notes2[i] == 0) {
notes2[i] = 1;
Serial.print(notes2[i]);
Serial.print(" ");
break;
}
}
lastnote=millis();
}
if (rf6_state == LOW && rf6_state != pre_rf6_state && millis()-lastnote > 450) {
// tone(A0, 587,300);
tone(A1, 587, 300);
for (int i = 1; i <= 7; i++) {
if (notes2[i] == 0) {
notes2[i] = 2;
Serial.print(notes2[i]);
Serial.print(" ");
break;
}
}
lastnote=millis();
}
if (rf7_state == LOW && rf7_state != pre_rf7_state && millis()-lastnote > 450) {
// tone(A0, 659,300);
tone(A1, 659, 300);
for (int i = 1; i <= 7; i++) {
if (notes2[i] == 0) {
notes2[i] = 3;
Serial.print(notes2[i]);
Serial.print(" ");
break;
}
}
lastnote=millis();
}
if (rf8_state == LOW && rf8_state != pre_rf8_state && millis()-lastnote > 450) {
// tone(A0, 698,300);
tone(A1, 698, 300);
for (int i = 1; i <= 7; i++) {
if (notes2[i] == 0) {
notes2[i] = 4;
Serial.print(notes2[i]);
Serial.print(" ");
break;
}
}
lastnote=millis();
}
pre_rf5_state = rf5_state;
pre_rf6_state = rf6_state;
pre_rf7_state = rf7_state;
pre_rf8_state = rf8_state;
if (notes2[7] != 0) {
gamemode = 0;
}
}
if (gamemode == 0) {
digitalWrite(11, LOW);
delay(3000);
for (int i = 1; i <= 7; i++) {
if (notes[i] == notes2[i]) {
num++;
}
}
if (num >= 6) {
digitalWrite(A3, HIGH);
playsound(A1);
}
if (num <= 5 && num >= 3) digitalWrite(A4, HIGH);
if (num < 3) digitalWrite(A5, HIGH);
gamemode = -1;
}
}
void playsound(int bp){
tone(bp, 262, 400);
delay(120);
tone(bp, 294, 400);
delay(120);
tone(bp, 349, 400);
delay(120);
tone(bp, 294, 400);
delay(120);
tone(bp, 440, 800);
delay(240);
delay(100);
tone(bp, 440, 1600);
delay(480);
tone(bp, 392, 400);
delay(480);
delay(300);
tone(bp, 262, 400);
delay(120);
tone(bp, 294, 400);
delay(120);
tone(bp, 349, 400);
delay(120);
tone(bp, 294, 400);
delay(120);
tone(bp, 392, 800);
delay(240);
delay(100);
tone(bp, 392, 1600);
delay(480);
tone(bp, 349, 400);
delay(480);
}
E. CONCLUSIONS:
In summary, this is our project, interesting and interactive. It agrees with my definition of interaction, which is “a cyclical process in which two or more objects see, think, and speak”. The two users think and output their notes to the device, and then the device receives them and processes the evaluation system as well as the sound and vision system, then outputs the feedback to the user. Then the user sees the LED lights and hears the buzzer’s sound. This created a cyclical process in which multiple actors alternately input, process, and output. In my expectation, when users ultimately use the design, the two players each put on a devised glove on one hand, and Player One plays seven notes by clicking his or her finger onto the thumb before Player Two does the same process to imitate what Player One has done. After the process, the device will give feedback to signalize how well Player 2 played, as is depicted before. And luckily, users used our device smoothly as we expected. Here is the documentation of our user testing:
We have learned a lot during the process of fabrication, such as how to effectively debug codes (by flexibly using the “Serial. println()” function to check the errors), how to function multiple events at the same time (by using “millis()”), and how to prevent the erroneous multiple counts for a single click (by using “flag” and adding delay). But, the most important thing is, if the process is too difficult and I can’t figure it out for a long time, then don’t hesitate to simplify it instead of ineffectively struggling with it. I think if we have more time to reform the project, it may be allowing multiple notes, and replacing the buzzers with MP3 players. Moreover, the game design can be much more interesting and interactive, though we haven’t thought of any other ideas.
In summary, I find the midterm project interesting and meaningful, because it bolsters up my creative thinking, which I currently don’t have much. Overall, the project is successful, but I hope I will do better in the final project.