Professional Documents
Culture Documents
// section 0
char notes[] = " "; // notes played (Same for each section)
int beats[] = {1}; //the beat the notes are played at (same for each section)
// section 1
char notes1[] = "fFECDEF"; // a space represents a rest
// section 2
char notes2[] = "fDcdha"; // a space represents a rest
// section 3
char notes3[] = "fgah"; // a space represents a rest
//section 4
char notes4[] = "aefgaf"; // a space represents a rest
//section 6
char notes6[] = "fDcdh"; // a space represents a rest
//section 7
char notes7[] = "afgaha"; // a space represents a rest
// section 8
char notes8[] = "efgaf"; // a space represents a rest
//section 9
char notes9[] = "cacacaca"; // a space represents a rest
//section 10
char notes10[] = "chc"; // a space represents a rest
//section 11
char notes11[] = "hchchc"; // a space represents a rest
//section 12
char notes12[] = "DDD"; // a space represents a rest
//section 13
char notes13[] = "cacac"; // a space represents a rest
//section 14
char notes14[] = "aca"; // a space represents a rest
//section 16
char notes16[] = "hcDE"; // a space represents a rest
//section 17
char notes17[] = "F"; // a space represents a rest
//section 18
char notes18[] = " "; // a space represents a rest
/* section 19
char notes19[] = " "; // notes played (Same for each section)
int beats19[] = {1}; //the beat the notes are played at (same for each section)
// section 20
char notes20[] = "fFECDEF"; // a space represents a rest
// section 21
// section 22
char notes22[] = "fgah"; // a space represents a rest
//section 23
char notes23[] = "aefgaf"; // a space represents a rest
// section 24
char notes24[] = " "; // notes played (Same for each section)
int beats24[] = {1}; //the beat the notes are played at (same for each section)
// section 25
char notes25[] = "fFECDEF"; // a space represents a rest
// section 26
// section 27
char notes27[] = "fgah"; // a space represents a rest
//section 28
char notes28[] = "aefgaf"; // a space represents a rest
// section 29
char notes29[] = " "; // notes played (Same for each section)
int beats29[] = {1}; //the beat the notes are played at (same for each section)
// section 30
char notes30[] = "fFECDEF"; // a space represents a rest
int beats29[] = {1}; //the beat the notes are played at (same for each section)
*/
int i;
int j;
int a;
int b;
int c;
int d;
int e;
int f;
int g;
int h;
int k;
int l;
int m;
int n;
int o;
int p;
int q;
int r;
int s;
int t;
int u;
int v;
/*int w;
int x;
int y;
int z;
int !;
int ?;
int $;
int #;
int ^; */
// section 0
for (i = 0; i < songLength; i++) // step through the song arrays
{
duration = beats[i] * tempo; // length of note/rest in ms
}
lcd.clear(); // clear the screen
lcd.print("Some-where over"); // print this on the screen
lcd.setCursor(0,1);
lcd.print("the rain-bow");
//Same comments for every other section
// section 1
}
lcd.clear();
lcd.print("way up high");
lcd.setCursor(0,1);
lcd.print("there's a land");
//section 2
lcd.clear();
lcd.print("that I heard of");
lcd.setCursor(0,1);
lcd.print(" ");
//section 3
}
lcd.clear();
lcd.print("once in a lullaby");
lcd.setCursor(0,1);
// section 4
for (c = 0; c < songLength4; c++) // step through the song arrays
{
duration = beats4[c] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("Some-where over ");
lcd.setCursor(0,1);
lcd.print ("the rain-bow");// section 5
for (d = 0; d < songLength5; d++) // step through the song arrays
{
duration = beats5[d] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("skies are blue");
lcd.setCursor(0,1);
lcd.print("and the");
// section 6
for (e = 0; e < songLength6; e++) // step through the song arrays
{
duration = beats6[e] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("Dreams that you dare to dream");
lcd.setCursor(0,1);
lcd.print("dare to dream");
//section 7
for (f = 0; f < songLength7; f++) // step through the song arrays
{
duration = beats7[f] * tempo; // length of note/rest in ms
if (notes7[f] == ' ') // is this a rest?
{
delay(duration); // then pause for a moment
}
else // otherwise, play the note
{
tone(buzzerPin, frequency(notes7[f]), duration);
delay(duration); // wait for tone to finish
}
delay(tempo/10); // brief pause between notes
}
lcd.clear();
lcd.print("real-ly do come");
lcd.setCursor(0,1);
lcd.print("true");
//section 8
for (g = 0; g < songLength8; g++) // step through the song arrays
{
duration = beats8[g] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("someday ill wish" );
lcd.setCursor(0,1);
lcd.print("up-o; a star");
//section 9
for (h = 0; h < songLength9; h++) // step through the song arrays
{
duration = beats9[h] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("and wake up");
lcd.setCursor(0,1);
lcd.print(" ");
//section 10
for (k = 0; k < songLength10; k++) // step through the song arrays
{
duration = beats10[k] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("where the clouds are far");
lcd.setCursor(0,1);
lcd.print ("are far");
//section 11
for (l = 0; l < songLength11; l++) // step through the song arrays
{
duration = beats11[l] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("be-hind me---");
lcd.setCursor(0,1);
lcd.print(" ");
//section 12
for (m = 0; m < songLength12; m++) // step through the song arrays
{
duration = beats12[m] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("where troubles ");
lcd.setCursor(0,1);
lcd.print("melt");
//section 13
for (n = 0; n < songLength13; n++) // step through the song arrays
{
duration = beats13[n] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("like lem-on drops");
lcd.setCursor(0,1);
lcd.print(" ");
//section 14
for (o = 0; o < songLength14; o++) // step through the song arrays
{
duration = beats14[o] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("a-way a-bove the");
lcd.setCursor(0,1);
lcd.print("chimney tops");
//section 15
for (p = 0; p < songLength15; p++) // step through the song arrays
{
duration = beats15[p] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("thats where");
lcd.setCursor(0,1);
lcd.print("you'll find");
//section 16
for (q = 0; q < songLength16; q++) // step through the song arrays
{
duration = beats16[q] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("WOW!");
//section 18
for (s = 0; s < songLength18; s++) // step through the song arrays
{
duration = beats18[s] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("Great Job");
// section 19
}
lcd.clear();
lcd.print("way up high there's a land");
lcd.setCursor(0,1);
lcd.print("LEXI");
//section 20
lcd.clear();
lcd.print("that I heard of");
lcd.setCursor(0,1);
lcd.print("LEXI");
//section 21
}
lcd.clear();
lcd.print("once in a lullaby");
lcd.setCursor(0,1);
lcd.print("LEXI");
// section 22
for (w = 0; w < songLength22; w++) // step through the song arrays
{
duration = beats22[w] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("Some-where over the rain- bow");
lcd.setCursor(0,1);
lcd.print("LEXI");
// section 23
for (x = 0; x < songLength23; x++) // step through the song arrays
{
duration = beats23[x] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("Dreams that you dare to dream");
lcd.setCursor(0,1);
lcd.print("LEXI");
//section 25
for (z = 0; z < songLength25; z++) // step through the song arrays
{
duration = beats25[z] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("real-ly do come true");
lcd.setCursor(0,1);
lcd.print("LEXI");
//section 26
for (! = 0; ! < songLength26; !++) // step through the song arrays
{
duration = beats26[!] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("someday I'll wish up-on a star");
lcd.setCursor(0,1);
lcd.print("LEXI");
//section 27
for (? = 0; ? < songLength27; ?++) // step through the song arrays
{
duration = beats27[?] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("and wake up");
lcd.setCursor(0,1);
lcd.print("LEXI");
//section 28
for ($ = 0; $ < songLength28; $++) // step through the song arrays
{
duration = beats28[$] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("where the clouds are far");
lcd.setCursor(0,1);
lcd.print("LEXI");
//section 29
for (# = 0; # < songLength29; #++) // step through the song arrays
{
duration = beats29[#] * tempo; // length of note/rest in ms
}
lcd.clear();
lcd.print("be-hind me---");
lcd.setCursor(0,1);
lcd.print("LEXI");
//section 30
for (^ = 0; ^ < songLength30; ^++) // step through the song arrays
{
duration = beats30[^] * tempo; // length of note/rest in ms
int frequency(char note) //creates an integer called frequency that is a char note
{
char names[] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C', 'h', 'F', 'E', 'D' }; //name of notes
int frequencies[] = {262, 294, 330, 349, 392, 440, 494, 523, 466, 698, 659, 587}; // frequency of each note
// section 0
for (i = 0; i < numNotes; i++) //????
{
if (names[i] == note) // ????
{
return(frequencies[i]); // return the frequency of i
}
}
//section 1
for (j = 0; j < numNotes; j++)
{
if (names[j] == note)
{
return(frequencies[j]);
}
}
//section 2
for (a = 0; a < numNotes; a++)
{
if (names[a] == note)
{
return(frequencies[a]);
}
}
//section 3
for (b = 0; b < numNotes; b++)
{
if (names[b] == note)
{
return(frequencies[b]);
}
}
//section 4
for (c = 0; c < numNotes; c++)
{
if (names[c] == note)
{
return(frequencies[c]);
}
}
// section 5
for (d = 0; d < numNotes; d++)
{
if (names[d] == note)
{
return(frequencies[d]);
}
}
//section 6
for (e = 0; e < numNotes; e++)
{
if (names[e] == note)
{
return(frequencies[e]);
}
}
//section 7
for (f = 0; f < numNotes; f++)
{
if (names[f] == note)
{
return(frequencies[f]);
}
}
//section 8
for (g = 0; g < numNotes; g++)
{
if (names[g] == note)
{
return(frequencies[g]);
}
}
//section 9
for (h = 0; h < numNotes; h++)
{
if (names[h] == note)
{
return(frequencies[h]);
}
}
// section 10
for (k = 0; k < numNotes; k++)
{
if (names[k] == note)
{
return(frequencies[k]);
}
}
//section 11
for (l = 0; l < numNotes; l++)
{
if (names[l] == note)
{
return(frequencies[l]);
}
}
//section 12
for (m = 0; m < numNotes; m++)
{
if (names[m] == note)
{
return(frequencies[m]);
}
}
//section 13
for (n = 0; n < numNotes; n++)
{
if (names[n] == note)
{
return(frequencies[n]);
}
}
//section 14
for (o = 0; o < numNotes; o++)
{
if (names[o] == note)
{
return(frequencies[o]);
}
}
//section 15
for (p = 0; p < numNotes; p++)
{
if (names[p] == note)
{
return(frequencies[p]);
}
}
//section 16
for (q = 0; q < numNotes; q++)
{
if (names[q] == note)
{
return(frequencies[q]);
}
}
// section 17
for (r = 0; r < numNotes; r++)
{
if (names[r] == note)
{
return(frequencies[r]);
}
}
//section 18
for (s = 0; s < numNotes; s++)
{
if (names[s] == note)
{
return(frequencies[s]);
}
}
// section 19
for (t = 0; t < numNotes; t++) //????
{
if (names[t]== note) // ????
{
return(frequencies[t]); // return the frequency of i
}
}
/*//section 20
for (u= 0; u< numNotes; u++)
{
if (names[u]== note)
{
return(frequencies[u]);
}
}
/* // section 5
for (d = 0; d < numNotes; d++)
{
if (names[d] == note)
{
return(frequencies[d]);
}
}
//section 6
for (e = 0; e < numNotes; e++)
{
if (names[e] == note)
{
return(frequencies[e]);
}
}
//section 7
for (f = 0; f < numNotes; f++)
{
if (names[f] == note)
{
return(frequencies[f]);
}
}
//section 8
for (g = 0; g < numNotes; g++)
{
if (names[g] == note)
{
return(frequencies[g]);
}
}
//section 9
for (h = 0; h < numNotes; h++)
{
if (names[h] == note)
{
return(frequencies[h]);
}
}
// section 10
for (k = 0; k < numNotes; k++)
{
if (names[k] == note)
{
return(frequencies[k]);
}
}
//section 11
for (l = 0; l < numNotes; l++)
{
if (names[l] == note)
{
return(frequencies[l]);
}
}*/