This version:
diffN(fx) = m_in <: fx,(m_in <: (fx,m_in) : ro.interleave(ins,2) : m_sub :
m_dmeter) : ro.interleave(ins,2) : m_attach
with {
ins = inputs(fx);
m_in = par(i,ins,_);
m_sub = par(i,ins,m_gr);
m_dmeter = par(i,ins,dmeter(i));
m_attach = par(i,ins,attach);
m_gr(fx) = _ <: (1 -(fx,_ : -));
};
(with a proper definition of dmeter(i))
process = diffN(dm.freeverb_demo);
Then it can be generalised by giving the « difference meter function » as
(high-order) parameter:
diffN1(fx, fun) = m_in <: fx,(m_in <: (fx,m_in) : ro.interleave(ins,2) : m_fun
: m_dmeter) : ro.interleave(ins,2) : m_attach
with {
ins = inputs(fx);
m_in = par(i,ins,_);
m_fun = par(i,ins,fun);
m_dmeter = par(i,ins,dmeter(i));
m_attach = par(i,ins,attach);
};
So assuming the « difference meter functions » are defined in one of the
following form (among others..) :
fun0(fx_s,dry_s) = 1 - (fx_s - dry_s);
fun1(fx_s) = _ <: (1 - (fx_s,_ : -));
process = diffN(dm.freeverb_demo, fun0);
or
process = diffN(dm.freeverb_demo, fun1);
Stéphane
> Le 19 oct. 2020 à 11:06, Julius Smith <[email protected]> a écrit :
>
> Hi Klaus,
>
> How about something like this?
>
> diff(fx) = _ <: fx, (_ <: fx,_ : - : dmeter) : attach;
> dmeter = envelop : hbargraph("[unit:db]", -12, 12);
>
> I'm not sure how you want to generalize to the multichannel case
>
> Cheers,
> Julius
>
> On Sat, Oct 17, 2020 at 5:49 AM Klaus Scheuermann <[email protected]> wrote:
> Hey guys,
>
> I am trying to write a function (diff) that does nothing to the audio,
> but shows the gain-difference another function (fx) makes in a meter.
> Ideally this would work for any number of channels.
>
> This is where I ran into trouble, as si.block not only terminates the
> signal, but also kills the meter in the gui: (I am working on faustide)
>
> Help much appreciated :)
> Klaus
>
> diff(fx) = _ <: fx, (_ <: fx,_ : - : dmeter : _*1 : si.block(1));
>
> //metering
> dmeter(x) = attach(x, envelop(x) : hbargraph("[unit:db]", -12, 12));
> envelop = abs : max(ba.db2linear(-70)) : ba.linear2db : min(10) : max
> ~ -(10.0/ma.SR);
>
>
>
> _______________________________________________
> Faudiostream-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>
>
> --
> "Anybody who knows all about nothing knows everything" -- Leonard Susskind
> _______________________________________________
> Faudiostream-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users