happy birthday with system beep (c++)

2
/* Coded by NOIWYR - Niccolò Agnoletti name: HBDAY BEEP MUSIC v2.1 license: http://creativecommons.org/publicdomain/zero/1.0/ http:/niccow3.tk */ #include <iostream> #include <windows.h> //note int C = 523; // DO - dura 191ms - 382ms int D = 587; // RE - dura 170ms - 340ms int E = 659; // MI - dura 152ms - 304ms int F = 698; // FA - dura 143ms - 286ms int G = 740; // SOL - dura 135ms - 270ms int A = 880; // LA - dura 114ms - 228ms int B = 988; // SI - dura 110ms - 220ms void BDAY(){ // CCDCFE Beep(C, 382); Beep(C, 382); Beep(D, 340); Beep(C, 382); Beep(F, 286); Beep(E, 304); // CCDCGF Beep(C, 382); Beep(C, 382); Beep(D, 340); Beep(C, 382); Beep(G, 270); Beep(F, 286); // CCCAFE Beep(C, 382); Beep(C, 382); Beep(C, 382); Beep(A, 228); Beep(F, 286); Beep(E, 304); //DBBAFGF Beep(D, 340); Beep(B, 220); Beep(B, 220); Beep(A, 228); Beep(F, 286); Beep(G, 270);

Upload: niccoloagnoletti

Post on 10-Oct-2015

1.826 views

Category:

Documents


58 download

DESCRIPTION

C++ Library that uses system Beep to emulate notes and play happy birthday song :DCool, no?

TRANSCRIPT

/*Coded by NOIWYR - Niccol Agnolettiname: HBDAY BEEP MUSIC v2.1license: http://creativecommons.org/publicdomain/zero/1.0/http:/niccow3.tk*/#include #include //noteint C = 523; // DO - dura 191ms - 382msint D = 587; // RE - dura 170ms - 340msint E = 659; // MI - dura 152ms - 304msint F = 698; // FA - dura 143ms - 286msint G = 740; // SOL - dura 135ms - 270msint A = 880; // LA - dura 114ms - 228msint B = 988; // SI - dura 110ms - 220msvoid BDAY(){// CCDCFEBeep(C, 382);Beep(C, 382);Beep(D, 340);Beep(C, 382);Beep(F, 286);Beep(E, 304);// CCDCGFBeep(C, 382);Beep(C, 382);Beep(D, 340);Beep(C, 382);Beep(G, 270);Beep(F, 286);// CCCAFEBeep(C, 382);Beep(C, 382);Beep(C, 382);Beep(A, 228);Beep(F, 286);Beep(E, 304);//DBBAFGFBeep(D, 340);Beep(B, 220);Beep(B, 220);Beep(A, 228);Beep(F, 286);Beep(G, 270);Beep(F, 286);}void playN(int n){int i = 0;for(i;i