iiwusynth-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iiwusynth-devel] What I'm planning to do with iiwusynth


From: Peter Hanappe
Subject: Re: [iiwusynth-devel] What I'm planning to do with iiwusynth
Date: Sun, 16 Feb 2003 10:28:49 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1



Bob Ham wrote:
Hi all,

I thought I'd write down some ideas I've been having for a frontend to
iiwusynth in order to get reactions, suggestions, etc, so here goes.

I knew you were working on something but I was wondering on what. I
happy to hear about it.

I
want to have a tabbed window where each tab represents one instance of
iiwusynth.  In each you can edit all the settings for the instance; the
soundfont stack, reverb, ladspa, etc.  Each instance would be running in
the same program; ie I'm intending to do this via libiiwusynth rather
than the command line or anything.  One thing that concerns me is the
interface to synths' controls once they've been created.  There seems to
be quite a few methods for telling the synth to do something; I've seen
tcp server stuff, "shell" stuff and whatnot around in the includes and
I'm not sure what's going on at a high level.  If someone could explain
what these things are about I'd appreciate it.

For what you're doing, it seems to me the best way to go is to create a
synth with new_iiwu_synth and then control it through the synth's API
defined in iiwusynth/synth.h. The shell and the tcp server are all just
wrappers around the synth's interface. Too high level to be efficient
for what you want to do.

Another thing that could be a problem is each synth's jack client.  I'm
not sure, but I suspect there might be Issues with more than one
jack_client_t in a single address space.  It could mean having to make
synths share the same jack client and have them do their jack processing
via libiiwusynth.  That's not too big an issue tho and could dealt with
quite cleanly I reckon.

You might have a problem if you create a jack driver for each synth.
Since the Jack driver creates a real-time thread for every client,
you'll end up with as many threads as synths which is a waste of
resources.

You can create one jack driver and share it between several synths. I
started to make the interface to the drivers slightly more generic.
It's been done rather quickly so there surely still are some problems.
The new interface just requires a callback function, and is independent
of the iiwusynth object. In code, you could done something like this:

iiwu_synth* synth[8];

void audio_init()
{
  int i;
  iiwu_settings_t* settings;
  iiwu_audio_driver_t* adriver;

  settings = new_iiwu_settings();

  for (i = 0; i < 8; i++) {
    synth[i] = new_iiwu_synth(settings);
  }

  iiwu_settings_setstr(settings, "audio.driver", "jack");
  adriver = new_iiwu_audio_driver2(settings, audio_callback, NULL);
}


int audio_callback(void* data, int len,
                   int nin, float** in,
                   int nout, float** out)
{
  int i;
  for (i = 0; i < 8; i++) {
    iiwu_synth_process(synth[i], len, 0, NULL, nout, out);
  }
}


However, I had the same question as Josh: why several synths?
I don't mean this in a negative sense. I'm just curious to know what
kind of setup you have in mind that needs many synths.
Do you have anything running, yet?


Anyway, that's what I'm thinking about.

Hope this helped.

Cheers,
P


Bob






reply via email to

[Prev in Thread] Current Thread [Next in Thread]