3 ms·
Your post prompted me to get off my ass and upload my .WAV file writer to BitBucket. I wrote it almost two years ago to do exactly what you're talking about --
by Figs 13y ago
Your post prompted me to get off my ass and upload my .WAV file writer to BitBucket. I wrote it almost two years ago to do exactly what you're talking about -- generate a waveform and learn how to design my own sounds. There are a lot of sophisticated synth tools out there already, but I wanted to start from first principles and really understand what I was doing.
Here's a link to the library: https://bitbucket.org/cmcfarla/waveout https://bitbucket.org/cmcfarla/waveout
It's stupidly simple C code -- you just need to use three functions: One to open a file for writing audio, one to write a stereo sample, and one to close the file performing cleanup and bookkeeping. I included two examples -- a really basic example to just create a sine wave, and a slightly more complicated one that creates a sine wave with a panning effect.
While I've written a lot of code before, it's rare for me to put code up as open source. So, if I've missed something important, please let me know.