iiwusynth-devel
[Top][All Lists]
Advanced

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

Re: [iiwusynth-devel] Individual channel and reverb / chorus outputs


From: Tim Goetze
Subject: Re: [iiwusynth-devel] Individual channel and reverb / chorus outputs
Date: Sat, 10 Aug 2002 14:41:57 +0200 (CEST)

Hej Markus,

>When implementing this, we'll have to take into account the
>multithreading aspects (i.e. not change a buffer, while the synthesis
>process writes to it).
>I hope this is not counter-productive, since Tim has already provided a
>working patch. But I'd rather implement all the related features
>consistently at one time.
>The only drawback I have found so far is, that the application cannot
>use alternating buffers for the individual outputs (still for master
>out).
>
>What do you think?

A bit problematic is the 'one-time' setting of the buffer addresses;
in more complicated setups it is desirable to operate with dynamic
buffers. 

I've spent some time thinking about this, and want to propose a
different solution that I think does what we want, only a little
simpler and with added benefits.

The basic iiwu_synth_write call would be passed an array of individual
channel buffer addresses, members of the array are like such:

typedef struct {
  iiwu_real_t * left, * right, * reverb, * chorus;
} iiwu_channel_buffer_t;

and the synth write call prototype would look like this:

int iiwu_synth_write_channels (iiwu_synth_t * synth, 
        int nframes, iiwu_channel_buffer_t * buffers);

where 'buffers' points to an array of 16 iiwu_channel_buffer_t's. 

Before issuing the call, the caller is responsible for a) setting all
members of the 'buffers' array to point to valid buffer addresses, and
b) to initialize the buffer contents, usually to zero (silence). 

The solution would be 'minimally intrusive', allowing for an almost
unmodified voice write loop.

Because the actual write loop adds the signal to the existing buffer
contents, it is possible to assign the same set of buffers to every
channel and get the exact same behaviour the current implementation
shows, without having to write multiple different iiwu_synth_write_*
implementations by making them all rely on the *_write_channels call. 

An added bonus is that it would become possible to directly use
buffers from outside the synth (mix into existing fx sends, audio
busses, use Jack shm segments etc) which is very attractive because it
increases cache locality.

What do you think?

tim





reply via email to

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