Are you bored of typing Graphics Programs in C++? Here is something for your acoustic senses! This code will transform your ordinary keyboard into a Digital Piano!
// DIGIP.CPP
// DIGITAL PIANO
// Created by Karthik Sampath on 3/3/2010.
// Copyright 2010, Karthik. All rights reserved.
// The copyright to the computer program(s) herein
// is the property of Karthik Sampath ,India. The
// program(s) may be used and/or copied only with the
// written permission of Karthik Sampath or in accordance
// with the terms and conditions stipulated in the
// agreement/contract under which the program(s) have
// been supplied. This copyright notice must not be
// removed.
// Published in www.geekyard.com
#include
#include
#include
void main()
{
int i;
int music=710;
int freq;
clrscr();
cout<>freq;
while(1)
{
i=getch();
music=freq*i;
sound(music);
delay(1000);
nosound();
}
}
Feel free to experiment with your own Reference Frequencies.
P.S: Avoid running this code at work ;)
Popularity: 14% [?]
Related posts:












Join our revenue sharing program and earn more from Adsense. Get free traffic, backlinks, SEO and new visitors for your blog.
13 Responses to “C++ Code To Emulate A Piano”
Although I do think your current write-up is on the ideal track there are two items that i don’t go along with.
Exceptional Weblog, I just found this post while seeking by way of Blogburst I think that you and I could have been completely close friends inside a previous living – the posts that I’ve learnt from so far are truly charm to me and to my sense of personality! Anyways, chit chat aside, it appears that your Feed will not appear to perform in my browser (Ive just installed Google chrome) have you been in a position to notify me how I can fix it?
Hello! Just wanted to tell you that I like your entire publishing style and that so I am going to follow your blog often from now on
Stay the best!
Which two items Best tips?
Learned something new today after all. Thank you.
Hi, excelent, this is good stuff, keep up the good work.Greetings
Outstanding site. I really loved this post, I’m bookmarking your site right now!
I feel a lot more people need to read this, very good info!
Hi! Your post rocks and is a time saver!
Hello,Excellent article dude! i’m Fed up with using RSS feeds and do you use twitter?so i can follow you there:D.
PS:Do you thought about putting video to your web site to keep the readers more enjoyed?I think it works.Kind regards, Ray Ovitt
Interesting blog. It would be great if you can provide more details about it. Thanks you
Great info, thanks for useful post. I am waiting for more
Being a new blogger, I would like to tell you that you have given me much knowledge about it. Thanks for everything.