Arduino Music light box Code  : basic code for the project. 


//Code for music light box

//from pitches.h - these are public constants

#define NOTE_C  131

#define NOTE_CSharp 139

#define NOTE_D  147

#define NOTE_DSharp 156

#define NOTE_E  165

#define NOTE_F  175

#define NOTE_FSharp 185

#define NOTE_G  196

#define NOTE_GSharp 208

#define NOTE_A  220

#define NOTE_ASharp 233

#define NOTE_B  247

#define NOTE_HighC  262

//LIST OF NOTES - MODIFY THIS LIST TO CHANGE THE SONG

int musicnotes[] = {

NOTE_C, NOTE_D, NOTE_E,NOTE_F,NOTE_G,NOTE_A,NOTE_B,0

};

void setup()

{

 pinMode(13,OUTPUT);

 pinMode(12,OUTPUT);

 pinMode(8,OUTPUT);

}

void loop()

{

 for (int i=0;i< 7;i++) {

   tone(8, musicnotes[i]);

   if (musicnotes[i] == NOTE_G) {

      digitalWrite(12,HIGH);   

   }

   digitalWrite(13,HIGH);

   delay(200);

   digitalWrite(13,LOW);

   digitalWrite(12,LOW);

   noTone(8);

   delay(200);

 }

 delay(1000);

}