Re: [linux-audio-dev] matrix model vs. memory

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

Subject: Re: [linux-audio-dev] matrix model vs. memory
From: Paul Davis (pbd_AT_Op.Net)
Date: Sun May 20 2001 - 00:18:27 EEST


This is very relevant to Abramo's reply too.

>I guess I am confused - are you referring to moving data between inputs
>and outputs in a single plugin or between ports on two different plugins?
>If the latter, then data is not really moved, right? The output of one
>plugin _is_ the input of another, so when would all of this happen?

well, if you require buffer sharing, then its impossible to have a
multi-input port.

such a port type is important for implementing busses, since
otherwise, you have to have an input port for every object that wants
to connect to it. its very important to me to be able to implement a
"bus" concept easily; an N-channel mixer with a single output port is
a much less efficient way of implementing this.

moreover, if you require buffer sharing, you also require that the
effective signal level for each of a series of connected input ports
be controlled on a per-port basis, since they will all get the same
data (from the output buffer).

both of these seem suboptimal to me. as i said, there is already an
implicit matrix of port connections; exposing it and attaching a gain
at each node of the matrix seems like a really cool idea to me.

>> Its also much more efficient, since otherwise, gain operations have to
>> consist of:
>>
>> src *= gain;
>> dst = src;
>>
>> (with these two operations not occuring directly after one another,
>> since they occur in different parts of the system)
>>
>> rather than:
>>
>> dst = src * gain;
>>
>> which occurs in one place.
>
>Why is this?

if the gain is independent of the transfer method, then plugin with
the input port has to implement the gain:

    foreach sample in buf { sample *= gain ; }

but whats "buf" ? if the output port's buffer is shared, then its an
internal buffer; if the data was actually moved from the output port
to the input port, then its the buffer associated with the input port.
so in either case, we have to move the data, then multiply.

if the gain is part of the transfer, we can do the multiply before we
store the result in the destination buffer, all at once time.

--p


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

This archive was generated by hypermail 2b28 : Sun May 20 2001 - 00:40:45 EEST