int b=500;//this integer represents the amount of milliseconds one beat is; in this case it is 500 milliseconds
int E3=164.82;//the integers represent the note frequency in hertz; it makes it easier for me to select the note
int E4=329.63;
int D3=146.83;
int B3=246.94;
int C3=261.63;//c3 is actually C4
int D4=293.66;
int G3=196.00;
int R=0;//this integer represents zero so I can produce a rest
int C2=65.41;
int RED_LED=9;//these integers represent the rgb lights so I know what slots belong to them
int BLUE_LED=10;
int GREEN_LED=11;
int BUZZER=2;//ths integer represents the the slot the buzzer has
//int voltage_red[]={255, 255, 0, 255, 191.25, 255, 255, 0, 255, 255, 255, 255, 255, 0, 255, 127.5, 255, 255, 0, 255, 255, 255, 255, 0, 255, 0, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 127.5, 127.5, 255, 255, 0, 255, 255, 0, 63.75, 127.5, 191.25, 127.5, 85, 0, 255, 255, 127.5, 255, 0, 63.75, 63.75, 191.25, 63.75, 85, 0, 255, 255, 255, 255, 255, 127.5, 255, 63.75, 85, 0, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 0, 255, 255};//the following integers represent the amount of light the red, blue, and green lights will emit
//int voltage_blue[]={0, 255, 255, 0, 63.75, 0, 255, 255, 0, 255, 255, 0, 255, 255, 0, 63.75, 0, 255, 255, 255, 255, 0, 255, 255, 0, 255, 0, 255, 255, 0, 255, 255, 255, 255, 255, 0, 255, 0, 63.75, 63.75, 0, 255, 255, 255, 255, 255, 191.25, 63.75, 0, 63.75, 85, 255, 255, 255, 63.75, 255, 255, 191.25, 191.25, 0, 191.25, 85, 255, 255, 255, 255, 255, 255, 63.75, 0, 191.25, 85, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 255, 255, 255, 255};
//int voltage_green[]={255, 0, 255, 255, 191.25, 255, 0, 255, 255, 255, 0, 255, 0, 255, 255, 191.25, 255, 0, 255, 255, 0, 255, 0, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 0, 255, 255, 255, 191.25, 191.25, 255, 0, 255, 255, 0, 255, 0, 191.25, 63.75, 191.25, 85, 255, 255, 0, 63.75, 0, 255, 0, 0, 63.75, 0, 85, 255, 255, 0, 255, 0, 0, 63.75, 255, 0, 85, 255, 255, 0, 255, 255, 255, 255, 255, 0, 0, 255, 0, 255, 255, 0};
int pitch[]={R, E3, B3, E4, E3, C3, G3, E3, B3, E4, E3, C3, G3, E3, B3, E4, E3, C3, G3, E3, R, E3, R, E3, D4, G3, E3, R, E3, R, E3, R, E3, C3, R, C3, R, C3, E3, R, E3, E3, R, E3, C3, R, G3, R, G3, E3, R, E3, E3, R, E3, C3, R, G3, R, G3, E3, R, E3, E3, R, E3, D3, C3, D4, E4, C3, D4, E4, C3, D4, E4, R, E4, D4, G3};//this integer represents the frequency (notes) in hertz the buzzer will emit
int duration[]={b, 0.5*b, 0.5*b, 0.5*b, 2.25*b, 1.5*b, 2.5*b, 0.5*b, 0.5*b, 0.5*b, 2.25*b, 1.5*b, 2.5*b, 0.5*b, 0.5*b, 0.5*b, 2.25*b, 1.5*b, 2.5*b, 1.5*b, 0.005*b, 1.5*b, 0.005*b, b, 1.5*b, 2.5*b, b, 0.5*b, 0.5*b, 0.005*b, b, 0.5*b, 0.5*b, b, 0.5*b, 1.5*b, 0.5*b, 0.5*b, b, 0.5*b, 0.5*b, b, 0.5*b, 0.5*b, b, 0.5*b, 1.5*b, 0.5*b, 0.5*b, b, 0.5*b, 0.5*b, b, 0.5*b, 0.5*b, b, 0.5*b, 2.5*b, 4*b, 1.5*b, 2.5*b, 4*b, 1.5*b, 2.5*b, 4*b, 1.5*b, 2.5*b, 0.05*b, 4*b, 1.5*b, 2.5*b};//this integer represents the amount of time the buzzer will wait before emitting the next note
void setup() { //void setup means that the following code will only play once
pinMode(RED_LED, OUTPUT); //these are the slots the red,blue, and green lights are put in
pinMode(BLUE_LED, OUTPUT);
pinMode(GREEN_LED, OUTPUT);
pinMode(BUZZER, OUTPUT);
for(int i=0; i<200; i++)//the code within the for loop will be picked in order 77 times because i<77, and the IDE counts from 0
{
//analogWrite(RED_LED, voltage_red[i]); //the voltages I selected for the lights will be picked in order
//analogWrite(BLUE_LED, voltage_blue[i]);
//analogWrite(GREEN_LED, voltage_green[i]);
tone(BUZZER, pitch[i]);//the pitches I inserted in the int will be played in sequence
delay(duration[i]);//the amount of time I selected in the duration integer will be played in sequence
}
}
void loop()
{}