2

I am trying to write a Piano application for my kid. What I am doing is using KeyDown and KeyUp Events inside a WinForm. The idea is to start emiting a frequency through the speaker in KeyDown event and then stop it in Keyup event. Just like in a piano :)

However, this is my first dabling in anything with Audio or Video. So, Is there a way to do it? Iz there a better way to do what I am suggesting. Note that I don't have access to midi or wav files or anything similar. Hence I can't start using samples that allow me to do this. Also note that I plan to go for more than just Piano frequencies.

Again, this is just for a kid to have fun (who is just 15 months old :)) Any help is appreciated.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Chetan
  • 184
  • 12
  • If you don't want to use samples it will be much more complicated to make sounds other than the sine wave, as you'll have to make a synthesizer of some sort. – annonymously Jan 19 '12 at 02:23
  • @annonymously, Its not that I don't want to use midi or anything similar, just that I don't have access to existing files and don't have knowledge of how to create it. I really mean it when I say I am a beginner at this. :) – Chetan Jan 19 '12 at 05:18
  • Try looking at these articles. 1. [Fundamentals of Sound: How to make music out of nothing at all](http://www.codeproject.com/KB/audio-video/CPIAudio.aspx) 2. [Sound Generator – How to create alien sounds using mathematic formulas](http://www.codeproject.com/KB/audio-video/SoundGenerator.aspx) 3. [Audio -Real low level sound generation in C#?](https://stackoverflow.com/q/3743591/479512) – Mark Hall Jan 19 '12 at 02:26

1 Answers1

0

Even the most basic onboard soundcard nowadays supports MIDI (I would really think). Check out this C# MIDI Toolkit.

MPelletier
  • 16,256
  • 15
  • 86
  • 137