Home   Easy-Code    Forum  Updater 
Twitter Facebook



Piano using c graphics

Critics Rating:

Users Rating:



          /* PIANO */



#include <stdio.h>

#include <conio.h>

#include <dos.h>

main()

{

int i;

char ch=" ";

clrscr();

while (ch!="0")

{

fflush(stdin);

ch=getch();

function(ch);

}

}

function(char ch)

{

switch (ch)

{

case "a": sound(5000);delay(1200);nosound();break;

case "b": sound(5001);delay(1200);nosound();break;

case "c": sound(5002);delay(1200);nosound();break;

case "d": sound(5003);delay(1200);nosound();break;

case "e": sound(5004);delay(1200);nosound();break;

case "f": sound(5005);delay(1200);nosound();break;

case "g": sound(5006);delay(1200);nosound();break;

case "h": sound(5007);delay(1200);nosound();break;

case "i": sound(5008);delay(1200);nosound();break;

case "j": sound(5009);delay(1200);nosound();break;

case "k": sound(5010);delay(1200);nosound();break;

case "l": sound(5011);delay(1200);nosound();break;

case "m": sound(5012);delay(1200);nosound();break;

case "n": sound(5013);delay(1200);nosound();break;

case "o": sound(5014);delay(1200);nosound();break;

case "p": sound(5015);delay(1200);nosound();break;

case "q": sound(5016);delay(1200);nosound();break;

case "r": sound(5017);delay(1200);nosound();break;

case "s": sound(5018);delay(1200);nosound();break;

case "t": sound(5019);delay(1200);nosound();break;

case "u": sound(5020);delay(1200);nosound();break;

case "v": sound(5021);delay(1200);nosound();break;

case "w": sound(5022);delay(1200);nosound();break;

case "x": sound(5023);delay(1200);nosound();break;

case "y": sound(5024);delay(1200);nosound();break;

case "z": sound(5025);delay(1200);nosound();break;

case "A": sound(2000);delay(1200);nosound();break;

case "B": sound(2001);delay(1200);nosound();break;

case "C": sound(2002);delay(1200);nosound();break;

case "D": sound(2003);delay(1200);nosound();break;

case "E": sound(2004);delay(1200);nosound();break;

case "F": sound(2005);delay(1200);nosound();break;

case "G": sound(2006);delay(1200);nosound();break;

case "H": sound(2007);delay(1200);nosound();break;

case "I": sound(2008);delay(1200);nosound();break;

case "J": sound(2009);delay(1200);nosound();break;

case "K": sound(2010);delay(1200);nosound();break;

case "L": sound(2011);delay(1200);nosound();break;

case "M": sound(2012);delay(1200);nosound();break;

case "N": sound(2013);delay(1200);nosound();break;

case "O": sound(2014);delay(1200);nosound();break;

case "P": sound(2015);delay(1200);nosound();break;

case "Q": sound(2016);delay(1200);nosound();break;

case "R": sound(2017);delay(1200);nosound();break;

case "S": sound(2018);delay(1200);nosound();break;

case "T": sound(2019);delay(1200);nosound();break;

case "U": sound(2020);delay(1200);nosound();break;

case "V": sound(2021);delay(1200);nosound();break;

case "W": sound(2022);delay(1200);nosound();break;

case "X": sound(2023);delay(1200);nosound();break;

case "Y": sound(2024);delay(1200);nosound();break;

case "Z": sound(2025);delay(1200);nosound();break;

}

}



Courtesy, Source, References & Regards: Kishore AVGK

While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright@2009-2011 by KuGuNi.com. All Rights Reserved.