1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
#include <cstdlib>
#include <iostream>
#include <conio.h>
#include <windows.h>
using namespace std;
int main(int argc, char *argv[])
{
while(true){
cout<<"Input note: ";
char note = getch();
//do re mi fa sol la si do re mi fa sol
if(note == 'a'){
Beep(261,100);
}
if(note == 's'){
Beep(293,100);
}
if(note == 'd'){
Beep(329,100);
}
if(note == 'f'){
Beep(349,100);
}
if(note == 'g'){
Beep(392,100);
}
if(note == 'h'){
Beep(440,100);
}
if(note == 'j'){
Beep(493,100);
}
if(note == 'k'){
Beep(523,100);
}
if(note == 'l'){
Beep(587,100);
}
if(note == ';'){
Beep(659,100);
}
if(note == '\''){
Beep(698,100);
}
if(note == '\\'){
Beep(784,100);
}
//rebemol mibemol solbemol labemol sibemol rebemol mibemol solbemol
if(note == 'w'){
Beep(277,100);
}
if(note == 'e'){
Beep(311,100);
}
if(note == 't'){
Beep(370,100);
}
if(note == 'y'){
Beep(415,100);
}
if(note == 'u'){
Beep(466,100);
}
if(note == 'o'){
Beep(554,100);
}
if(note == 'p'){
Beep(622,100);
}
if(note == ']'){
Beep(740,100);
}
system("cls");
}
return EXIT_SUCCESS;
}
|