On Fri, Jun 13, 2008 at 6:27 PM, AlgoMantra <[EMAIL PROTECTED]> wrote: > Sorry, my last reply was meant for the list, not just > Fons. > > On Sat, Jun 14, 2008 at 6:56 AM, AlgoMantra <[EMAIL PROTECTED]> wrote: >> >> FYI: >> >> http://www.linuxjournal.com/article/3836 >> >> I was looking for this sort of thing. > > > > _______________________________________________ > Linux-audio-dev mailing list > [email protected] > http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev > >
If you want to code raw additive synthesis in C, I recommend either writing a LADSPA plugin or a jack client. You will get one array of 32 bit floats per connection to the outside world at run-time. Audio input will be an array with data you can read, and you will be expected to write something to the audio output arrays so the data can be used by other applications / plugins. As was mentioned before, using /dev/dsp is depricated. If you want to go low level, you want the ALSA API, because on any sane modern linux system, /dev/dsp is probably an emulator for the OSS interface, built on top of ALSA. It probably makes more sense for most projects to use jack and let a user fine tune thier ALSA parameters for their purposes in thier jack driver configuration, rather than attempting to second guess thier particular system or force them to set custom buffer sizes and sample rate and data size for yet another audio application. Whether you use jack or OSS, both are layers built on top of ALSA, and jack will perform much better. cat interprets its input as eight bit characters. If you really wanted to go the lowest common denominator route and use only old school unix API's, you can read() from /dev/dsp and then use the chars you get back as a numeric datatype (this will most likely mean converting them to floats if you are doing anything halfway interesting). This will not be as straightforward to code, as flexible to use, or as efficient at runtime as using jack or LADSPA would be. For playing with sine waves and beat frequencies, I recommend csound or PD. Both have sine wave generators built in, and both are easy to write c plugins for. _______________________________________________ Linux-audio-dev mailing list [email protected] http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
