-
I am not very good with computers in general but I like to program. I have currently been trying to make a program that makes sound but I do not know how to do it. I have tried to look this up on the internet but have had surprising difficulty.
What I need to do seems very simple to me. I just want to be able to make a sine wave pitch of any frequency (like 4500Hz, 202Hz , etc.). I want to be able to play two or more of these at once. It would also be nice to be able to adjust the volume of each tone as well (and maybe even the phase, if that isn’t asking too much!). I think that there would also be a way to set the duration, but if not, I think I could figure out sometime involving the computer clock...
I want to do this in C++. If I really had to, I could use Visual Python or any language featured in Microsoft Visual Studio, but then I would have to learn a whole new language.
Does anyone have any ideas? Thank you very much!
-
dos.h has a sound function called sound the prototype is
Code:
void sound(unsigned frequency);
-
For a nice cross-platform solution, try using midi
This is a Midi library (as used in old dos games)
http://www.jdkoftinoff.com/main/Free_Proje...++_MIDI_Library
include it in your project and feed any midi info to it
(either from an external midi file, or direct from code)
-
Thanks, I'll try out those ideas tomorrow when I have access to my computer that I can program on!