What about generating PCM data on the fly? PCM - Pulse Code Modulated - sound is just a bunch of samples of voltage across an analog sound system.
Think about a speaker. As sound is played, it vibrates. What if you took a ruler and measured the location of the speaker at a rate faster then the frequency of the sound? You would get a picture of a waveform. That's exactly what PCM data looks like, with each measurement stored as an 8 or 16 bit int. The frequency, say 44khz is the number of samples per second. CDs use 44khz sampling frequency and 16 bit samples.
DirectSound (on windows) and OpenAL (cross platform) are two libraries you can use to play databuffers full of PCM data. I've used DirectSound in the past, not to play data but rather to read in data from the microphone to get the volume level.
If you wanted to create a PCM sample for a certain note, you just calculate the frequency (here's a table), and then put a sinewave in your buffer. You can mix different frequencies together just by adding them (make sure the sum is less then the maximum volume, to avoid clipping)