From 88722c3ce423262afa3c2cabc37c24a37ffa5b60 Mon Sep 17 00:00:00 2001 From: "Franz Heinzmann (Frando)" Date: Mon, 18 Oct 2021 21:49:50 +0200 Subject: [PATCH] add faust DSP --- dsp/mixer.dsp | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 dsp/mixer.dsp diff --git a/dsp/mixer.dsp b/dsp/mixer.dsp new file mode 100644 index 0000000..e3039de --- /dev/null +++ b/dsp/mixer.dsp @@ -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);