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!
Earlier I wrote C++ Code To Draw A Winking Face and Animating a car using Java Codes.
// 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 😉
This is pretty interesting. This looks like a little version of the 64 key piano at virtualpiano.net. Good effort though.
Being a new blogger, I would like to tell you that you have given me much knowledge about it. Thanks for everything.
Great info, thanks for useful post. I am waiting for more
Interesting blog. It would be great if you can provide more details about it. Thanks you
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
Hi! Your post rocks and is a time saver!
I feel a lot more people need to read this, very good info!
Outstanding site. I really loved this post, I’m bookmarking your site right now!
Learned something new today after all. Thank you.
Which two items Best tips?
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!