views:

105

answers:

3

Hey there!

I need to be able to play certain tones in a c# application. I don't care if it generates them on the fly or if it plays them from a file, but I just need SOME way to generate tones that have not only variable volume and frequency, but variable timbre. It would be especially helpful if whatever I used to generate these tones would have many timbre pre-sets, and it would be even more awesome if these timbres didn't all sound midi-ish (meaning some of them sounded like the might have been recordings of actual instruments).

Any suggestions?

A: 

There's a popular article on CodeProject along these lines: http://www.codeproject.com/KB/audio-video/CS%5FToneGenerator.aspx

You might also check out this thread: http://episteme.arstechnica.com/eve/forums/a/tpc/f/6330927813/m/197000149731

TrueWill
+2  A: 

You might like to take a look at my question Creating sine or square wave in C#

Using NAudio in particular was a great choice

johnc
A: 

In order for your generated tones not to sound 'midi-ish', you'll have to use real-life samples and play them back. Try to find some good real instrument sample bank, like http://www.sampleswap.org/filebrowser-new.php?d=INSTRUMENTS+single+samples%2F

Then, when you want to compose melody from them, just alternate playback frequency relative to the original sample frequency.

Please drop me a line if you find this answer usefull.

Daniel Mošmondor