I want to make some kind of simple sound playing program. I tried with the Windows Beep() function which lets you specify which note you want to play and for how long. This works fine, but you can only play one note at a time. So I wrote a multithreaded program, but it seems threads don't guarantee that the notes are played simultaneously. I figured this out too late and now I have to remake my whole program... I searched the net but C++ doesn't have a sound library. Is there a way of playing multiple notes simultaneously? Only the Hz of the note is necessary, a simple Beep()-like sine wave is enough, I don't need prerecorded piano notes of something similar, It just has to be able to play specified notes.
I'm using Windows vista and Orwell Dev-C++, if that matters.
Thanks for the tips NwN! I'm sorry I responded so late, I was trying to make a function with Beep() which tried to play every note of an accord for one millisecond after which it switched to the next note, but that seems to affect the frequency of the notes and thus making the whole accord sound like a chainsaw... Setting the duration to a higher rate doesn't help.
I actually considered a MIDI-library long ago, but I decided not to for whatever reason...
Your links and a quick search gave me the name portAudio which mentions sinewaves and perhaps also supports MIDI.