#include<dos.h>
#include<conio.h>
#include<graphics.h>
void main ()
{
int a=DETECT,border=13,x=0,y=150,m=5,n=5,b,i=320,j=240+60,xx[]={175,200,225,270,300,325,375,400,425,450,475};
int board[]={150,100,150,300,500,300,500,100,150,100,180,100,180,200,200,200,200,300,200,200,220,200,220,100,250,100,250,300,250,100,280,100,280,200,300,200,300,300,300,200,320,200,320,100,350,100,350,300,350,100,380,100,380,200,400,200,400,300,400,200,420,200,420,100,430,100,430,200,450,200,450,300,450,200,470,200,470,100};
float t1,t2,k=0,t=0,fre[36]={3729.31,3322.44,2959.96,2489.02,2217.46,1864.66,1479.98,1244.51,1108.73,932.328,739.989,622.254,554.365,466.164,415.305,369.994,311.127,277.183,233.082,184.997,155.563,138.591,116.541,103.826,92.4986,77.7817,69.2957,58.2705,51.9131,46.2493,38.8908,34.6478,29.1352};
;
char c='q',c2='q',str[]="Grand Piano",keys[]="qazwsxedcrfvtgbyhnujmik,ol.p;/[']";
initgraph(&a,&b,"c:/tc/bgi");
settextstyle(5,0,5);
while(1)
{
cleardevice();
setcolor(border);
outtextxy(180,40,str);
drawpoly(39,board);
for(i=0;i<33;i++) if(c==keys[i]) break;
x=i/3;
setcolor(border);
floodfill(xx[x],y,border);
sound(fre[i]);
delay(t);
nosound();
c=getch();
if(c==27) break;
if(c!=c2) {c2=c;t=100;}
else t=33;
}
getch();
closegraph();
}
