add faust DSP

This commit is contained in:
Franz Heinzmann (Frando) 2021-10-18 21:49:50 +02:00
parent 392f8f8a2c
commit 88722c3ce4

61
dsp/mixer.dsp Normal file
View file

@ -0,0 +1,61 @@
declare name "studiox-mixer";
declare version "1.0";
declare author "Franz Heinzmann";
declare license "BSD";
declare options "[osc:on]";
//-----------------------------------------------
// Audio Mixer: I inputs x O outputs x B Buses
//-----------------------------------------------
import("stdfaust.lib");
stereo(func) = _,_ : func(_),func(_) : _,_;
gainM = *(vslider("gain[style:knob]", 0, -70, +40, 0.1) : ba.db2linear : si.smoo);
volumeM = *(vslider("volume", 0, -70, +4, 0.1) : ba.db2linear : si.smoo);
activeM = *(checkbox("on") : si.smoo);
muteM = *(1 - checkbox("mute") : si.smoo);
volume = stereo(volumeM);
gain = stereo(gainM);
active = stereo(activeM);
mute = stereo(muteM);
envelop = abs : max ~ -(1.0/ma.SR) : max(ba.db2linear(-70)) : ba.linear2db;
vumeterM(x) = envelop(x) : vbargraph("level[2][unit:dB][style:dB]", -60, +5);
vumeterS(a,b) = a,b <: _,_,_,_ :
(a, b, attach(0,vumeterM((a+b)/2)), 0) :>
_,_;
vumeter = _,_ : vumeterS(_,_);
faderchannel = _,_ : active : volume : vumeter : _,_;
simplechannel = _,_ : active : _,_;
gainchannel = _,_ : mute : gain : vumeter : _,_;
bus(I, bus) = hgroup("%bus",
hgroup("ch", par(i, I,
_,_ : vgroup("%i", faderchannel)
)) :>
_,_
);
mixer(I,O,B) =
par(i, I, _,_) :
vgroup("mixer",
hgroup("[1]in", par(i, I, vgroup("%i", gainchannel ))) :
tgroup("[2]bus",
par(i, I, _,_) <:
par(i, B, bus(I, i))
) <:
hgroup("[3]out",
par(o, O,
vgroup("%o",
hgroup("bus", par(i, B, vgroup("%i", simplechannel))) :>
gainchannel
)
)
)
) :
par(o, O, _,_);
process = mixer(8,8,4);