Re: [linux-audio-dev] soft synth as a plugin

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] soft synth as a plugin
From: Paul Davis (pbd_AT_op.net)
Date: Thu Jul 04 2002 - 02:06:05 EEST


>Now somebody please put me straight here - as far as I can see, there's
>LADSPA and JACK. (and MuSE's own plugins?). Now, I'm under the
>impression that these only deal with the audio data - only half what I
>need for a synth. Or can LADSPA deal with MIDI?
>
>So how should I go about it?
>Is it acceptable to (for example) read the midi events from the ALSA
>sequencer in the audio callback? My gut instinct is no, no, no!
>
>Even if that's feasible with the alsa sequencer, it still has problems -
>say the host wanted to "render" the `song' to an audio file - using the
>sequencer surely it would have to be done in real time?
>
>I just want to get on, write amSynthe and then everyone can enjoy it,
>but this hurdle is bigger than it seems.

You handle MIDI I/O in its own thread. You use a lock-free
buffer/fifo/queue between this thread and the one that executes
process() (or LADSPA's run()) callback. The queue should contain an
abstract description of recent MIDI events, preferably in some format
not tied to MIDI because of its poor handling of pitch. The process()
callback will then pay attention to the events in the
queue/fifo/buffer, and change the synthesis accordingly.

The MIDI I/O can be done anyway you want: ALSA sequencer, ALSA
rawmidi, or raw file descriptors.

If its not obvious, I've thought about this a great deal, but I have
no time to code it :)

I'd recommend JACK for this. LADSPA is a bit too limited to support
this because of the GUI issues, unless you use LCP, which might be
still not be enough and is not supported by any notable LADSPA hosts
at this time (mea culpa).

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Jul 04 2002 - 02:08:21 EEST