_id
stringlengths 64
64
| repository
stringlengths 7
61
| name
stringlengths 5
45
| content
stringlengths 0
943k
| download_url
stringlengths 94
213
| language
stringclasses 1
value | comments
stringlengths 0
20.9k
| code
stringlengths 0
943k
|
---|---|---|---|---|---|---|---|
dc494fc3a1c73ae8e7019505ffa124b97559d0f90be4e858982c2553687fa146 | ml-wo/VirtualGuitarAmp-Guitarix | duck_delay_st.dsp | declare id "duckDelaySt";
declare name "Duck Delay St";
declare category "Echo / Delay";
//------------------------------------
//Description:
//The delayed signal added to output dependent of input signal amplitude.
//If the input signal is high. The delayed signall turned off, and vise versa.
//The switching controlled by envelope follower
//(parameters: "attack", "release", and main - "amount", what is controls envelope follower influence).
//
//Parameters description:
//time - de.delay time in milliseconds
//feedback - de.delay feedback
//pingpong - changes feedback character
//coloration - LP/HP coloration filter
//attack, release - envelope follower time in seconds controls
//amount dB - envelope follower influence
//effect - amplitude of effect signal in mix
//------------------------------------
import("stdfaust.lib");
//Constrols
p_time = hslider("time[name:Delay]", 500, 1, 2000, 1):si.smooth(ba.tau2pole(0.1));
p_feedback = hslider("feedback[name:Feedback]", 0, 0, 1, 0.05);
p_pingpong = hslider("pingpong[name:Ping Pong]", 0, 0, 1, 0.05);
coloration = hslider("coloration[name:Coloration]", 0, -1, 1, 0.05);
p_attack_time = hslider("attack[name:Attack]", 0.1, 0.05, 0.5, 0.05);
p_release_time = hslider("release[name:Release]", 0.1, 0.05, 2, 0.05);
p_amount = hslider("amount[name:Amount]", 0.5, 0,56, 0.05):ba.db2linear;
p_effect = hslider("effect[name:Effect]", 0, -16, +4, 0.1) : ba.db2linear : si.smooth(0.999);
//Consts
c_fdelay_max_len = 393216;
c_channels_sw_time = 0.1;
//Funcs
X = (_,_)<:(!,_,_,!);
get_delay_length(x) = x*ma.SR:_*0.001;
coloration_filter(coloration) = _<:(fi.lowshelf(5,(1 - coloration)*12,440),
fi.highshelf(5,coloration*12,880)):>_*ba.db2linear(-15);
pp_delay(time,fb_coef,pp_fb_coef) = _,_*(1 - pp_fb_coef):
(_,X,_:(X:(pp_fb_delay(time, fb_coef,pp_fb_coef))),
(X:(pp_fb_delay(time, fb_coef,pp_fb_coef))):_,_)~X
:>_,_
with {
pp_fb_delay(time,fb_coef,pp_fb_coef) = _+_*pp_fb_coef:
(_+_:de.fdelay(c_fdelay_max_len,get_delay_length(p_time)))~_*fb_coef;
};
switcher(att, rel, amount) = an.amp_follower_ud(att,rel):
_*amount:_>1:(1 - _):
si.smooth(ba.tau2pole(c_channels_sw_time));
process = (_<:_,_,_),(_<:_,_,_):
_,
switcher(p_attack_time, p_release_time, p_amount),
(pp_delay(p_time,p_feedback*(1 - p_pingpong),p_pingpong*p_feedback):
coloration_filter(coloration),coloration_filter(coloration)),
switcher(p_attack_time, p_release_time, p_amount),
_:
_,_*_,_*_,_:(_,_*p_effect:>_),(_*p_effect,_:>_);
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/faust/duck_delay_st.dsp | faust | ------------------------------------
Description:
The delayed signal added to output dependent of input signal amplitude.
If the input signal is high. The delayed signall turned off, and vise versa.
The switching controlled by envelope follower
(parameters: "attack", "release", and main - "amount", what is controls envelope follower influence).
Parameters description:
time - de.delay time in milliseconds
feedback - de.delay feedback
pingpong - changes feedback character
coloration - LP/HP coloration filter
attack, release - envelope follower time in seconds controls
amount dB - envelope follower influence
effect - amplitude of effect signal in mix
------------------------------------
Constrols
Consts
Funcs | declare id "duckDelaySt";
declare name "Duck Delay St";
declare category "Echo / Delay";
import("stdfaust.lib");
p_time = hslider("time[name:Delay]", 500, 1, 2000, 1):si.smooth(ba.tau2pole(0.1));
p_feedback = hslider("feedback[name:Feedback]", 0, 0, 1, 0.05);
p_pingpong = hslider("pingpong[name:Ping Pong]", 0, 0, 1, 0.05);
coloration = hslider("coloration[name:Coloration]", 0, -1, 1, 0.05);
p_attack_time = hslider("attack[name:Attack]", 0.1, 0.05, 0.5, 0.05);
p_release_time = hslider("release[name:Release]", 0.1, 0.05, 2, 0.05);
p_amount = hslider("amount[name:Amount]", 0.5, 0,56, 0.05):ba.db2linear;
p_effect = hslider("effect[name:Effect]", 0, -16, +4, 0.1) : ba.db2linear : si.smooth(0.999);
c_fdelay_max_len = 393216;
c_channels_sw_time = 0.1;
X = (_,_)<:(!,_,_,!);
get_delay_length(x) = x*ma.SR:_*0.001;
coloration_filter(coloration) = _<:(fi.lowshelf(5,(1 - coloration)*12,440),
fi.highshelf(5,coloration*12,880)):>_*ba.db2linear(-15);
pp_delay(time,fb_coef,pp_fb_coef) = _,_*(1 - pp_fb_coef):
(_,X,_:(X:(pp_fb_delay(time, fb_coef,pp_fb_coef))),
(X:(pp_fb_delay(time, fb_coef,pp_fb_coef))):_,_)~X
:>_,_
with {
pp_fb_delay(time,fb_coef,pp_fb_coef) = _+_*pp_fb_coef:
(_+_:de.fdelay(c_fdelay_max_len,get_delay_length(p_time)))~_*fb_coef;
};
switcher(att, rel, amount) = an.amp_follower_ud(att,rel):
_*amount:_>1:(1 - _):
si.smooth(ba.tau2pole(c_channels_sw_time));
process = (_<:_,_,_),(_<:_,_,_):
_,
switcher(p_attack_time, p_release_time, p_amount),
(pp_delay(p_time,p_feedback*(1 - p_pingpong),p_pingpong*p_feedback):
coloration_filter(coloration),coloration_filter(coloration)),
switcher(p_attack_time, p_release_time, p_amount),
_:
_,_*_,_*_,_:(_,_*p_effect:>_),(_*p_effect,_:>_);
|
4239a42308c2871419eb056c0909193d267a37d90f52cf2ae01d26d45de00248 | ml-wo/VirtualGuitarAmp-Guitarix | mbdel.dsp | declare id "mbdel";
declare name "MultiBand Delay";
declare shortname "MB Delay";
declare category "Echo / Delay";
declare description "Multi Band Delay";
import("stdfaust.lib");
import("reducemaps.lib");
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
interp = 100*ma.SR/1000.0;
N = int( 2^18);
g1 = vslider("gain1", -10, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d1 = ba.tempo(hslider("delay1[tooltip:Delay in Beats per Minute]",30,24,360,1));
g2 = vslider("gain2", -5, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d2 = ba.tempo(hslider("delay2[tooltip:Delay in Beats per Minute]",60,24,360,1));
g3 = vslider("gain3", -2, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d3 = ba.tempo(hslider("delay3[tooltip:Delay in Beats per Minute]",90,24,360,1));
g4 = vslider("gain4", 0, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d4 = ba.tempo(hslider("delay4[tooltip:Delay in Beats per Minute]",120,24,360,1));
g5 = vslider("gain5", -10, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d5 = ba.tempo(hslider("delay5[tooltip:Delay in Beats per Minute]",150,24,360,1));
del(g,d) = *(g) : de.sdelay(N, interp,d) ;
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
envelop = abs : max ~ (1.0/ma.SR) : mean(4096) ; // : max(ba.db2linear(-70)) : ba.linear2db;
process = _<:(geq: ( dist5s , dist4s , dist3s, dist2s, dist1s)),_:>_ with {
dist1s = del(g1,d1) : vmeter1;
dist2s = del(g2,d2) : vmeter2;
dist3s = del(g3,d3) : vmeter3;
dist4s = del(g4,d4) : vmeter4;
dist5s = del(g5,d5) : vmeter5;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/plugins/mbdel.dsp | faust | : max(ba.db2linear(-70)) : ba.linear2db; | declare id "mbdel";
declare name "MultiBand Delay";
declare shortname "MB Delay";
declare category "Echo / Delay";
declare description "Multi Band Delay";
import("stdfaust.lib");
import("reducemaps.lib");
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
interp = 100*ma.SR/1000.0;
N = int( 2^18);
g1 = vslider("gain1", -10, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d1 = ba.tempo(hslider("delay1[tooltip:Delay in Beats per Minute]",30,24,360,1));
g2 = vslider("gain2", -5, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d2 = ba.tempo(hslider("delay2[tooltip:Delay in Beats per Minute]",60,24,360,1));
g3 = vslider("gain3", -2, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d3 = ba.tempo(hslider("delay3[tooltip:Delay in Beats per Minute]",90,24,360,1));
g4 = vslider("gain4", 0, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d4 = ba.tempo(hslider("delay4[tooltip:Delay in Beats per Minute]",120,24,360,1));
g5 = vslider("gain5", -10, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d5 = ba.tempo(hslider("delay5[tooltip:Delay in Beats per Minute]",150,24,360,1));
del(g,d) = *(g) : de.sdelay(N, interp,d) ;
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
process = _<:(geq: ( dist5s , dist4s , dist3s, dist2s, dist1s)),_:>_ with {
dist1s = del(g1,d1) : vmeter1;
dist2s = del(g2,d2) : vmeter2;
dist3s = del(g3,d3) : vmeter3;
dist4s = del(g4,d4) : vmeter4;
dist5s = del(g5,d5) : vmeter5;
};
|
ff9fb6aa5b8770b2ef43e687a8774925eef1792d6e970490f54f3db549efa02e | ml-wo/VirtualGuitarAmp-Guitarix | mbe.dsp | declare id "mbe";
declare name "MultiBand Echo";
declare shortname "MB Echo";
declare category "Echo / Delay";
declare description "Multi Band Echo";
import("stdfaust.lib");
import("reducemaps.lib");
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
t1 = ba.tempo(hslider("time1[tooltip:Echo in Beats per Minute]",30,24,360,1));
r1 = hslider("percent1", 10, 0, 100, 0.1)/100.0 : si.smooth(0.999);
t2 = ba.tempo(hslider("time2[tooltip:Echo in Beats per Minute]",60,24,360,1));
r2 = hslider("percent2", 30, 0, 100, 0.1)/100.0 : si.smooth(0.999);
t3 = ba.tempo(hslider("time3[tooltip:Echo in Beats per Minute]",120,24,360,1));
r3 = hslider("percent3", 45, 0, 100, 0.1)/100.0 : si.smooth(0.999);
t4 = ba.tempo(hslider("time4[tooltip:Echo in Beats per Minute]",150,24,360,1));
r4 = hslider("percent4", 20, 0, 100, 0.1)/100.0 : si.smooth(0.999);
t5 = ba.tempo(hslider("time5[tooltip:Echo in Beats per Minute]",240,24,360,1));
r5 = hslider("percent5", 0, 0, 100, 0.1)/100.0 : si.smooth(0.999);
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
envelop = abs : max ~ (1.0/ma.SR) : mean(4096) ; // : max(ba.db2linear(-70)) : ba.linear2db;
echo1(t,r) = +~(de.sdelay(int(2^18), 100*ma.SR/1000.0, t) * (r));
process = geq: ( dist5s , dist4s , dist3s, dist2s, dist1s) :>_ with {
dist1s = echo1(t1,r1) : vmeter1 ;
dist2s = echo1(t2,r2) : vmeter2;
dist3s = echo1(t3,r3) : vmeter3;
dist4s = echo1(t4,r4) : vmeter4;
dist5s = echo1(t5,r5) : vmeter5;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/mbe.dsp | faust | : max(ba.db2linear(-70)) : ba.linear2db; | declare id "mbe";
declare name "MultiBand Echo";
declare shortname "MB Echo";
declare category "Echo / Delay";
declare description "Multi Band Echo";
import("stdfaust.lib");
import("reducemaps.lib");
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
t1 = ba.tempo(hslider("time1[tooltip:Echo in Beats per Minute]",30,24,360,1));
r1 = hslider("percent1", 10, 0, 100, 0.1)/100.0 : si.smooth(0.999);
t2 = ba.tempo(hslider("time2[tooltip:Echo in Beats per Minute]",60,24,360,1));
r2 = hslider("percent2", 30, 0, 100, 0.1)/100.0 : si.smooth(0.999);
t3 = ba.tempo(hslider("time3[tooltip:Echo in Beats per Minute]",120,24,360,1));
r3 = hslider("percent3", 45, 0, 100, 0.1)/100.0 : si.smooth(0.999);
t4 = ba.tempo(hslider("time4[tooltip:Echo in Beats per Minute]",150,24,360,1));
r4 = hslider("percent4", 20, 0, 100, 0.1)/100.0 : si.smooth(0.999);
t5 = ba.tempo(hslider("time5[tooltip:Echo in Beats per Minute]",240,24,360,1));
r5 = hslider("percent5", 0, 0, 100, 0.1)/100.0 : si.smooth(0.999);
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
echo1(t,r) = +~(de.sdelay(int(2^18), 100*ma.SR/1000.0, t) * (r));
process = geq: ( dist5s , dist4s , dist3s, dist2s, dist1s) :>_ with {
dist1s = echo1(t1,r1) : vmeter1 ;
dist2s = echo1(t2,r2) : vmeter2;
dist3s = echo1(t3,r3) : vmeter3;
dist4s = echo1(t4,r4) : vmeter4;
dist5s = echo1(t5,r5) : vmeter5;
};
|
8f7948023260bcb02d19e84b894935eff5d3449f05602fd3f291af2c3288791d | ml-wo/VirtualGuitarAmp-Guitarix | gx_vibrochump.dsp | declare id "Redeye Vibro Chump"; // in amp tube ba.selector
declare name "Redeye Vibro Chumo";
declare category "Amplifier";
import("stdfaust.lib");
import("guitarix.lib");
import("redeye.lib");
/****************************************************************
** Tube Preamp Emulation stage 1 - 2
**
** SHP : Experiment with the presence control as a feedback loop
** Created a loop with high shelf filter cutting around 1khz and up
** pot controls the amount of cut 0 > -70dB
** If feedback loop is inverted get mad distortion and feedback!
** With no inversion get required effect so guess the combination
** of filter and processing de.delay may be shifting phase some
**
** To do :
** Play with amp structure say a champ clone
** tube:eq:tube:tube
** 12AX7:??:12AX7:6V6
**
** Move feedback loop in more complex amp around driver and power tube
** 12AX7:EQ:(12AX7:6V6)~FEEDBACK
*/
/*
** Model of a vactrol tremolo unit by "transmogrify"
** c.f. http://sourceforge.net/apps/phpbb/guitarix/viewtopic.php?f=7&t=44&p=233&hilit=transmogrifox#p233
** http://transmogrifox.webs.com/vactrol.m
*/
/* vactrol model */
R1 = 2700;
Ra = 1e6;
Rb = 300;
b = exp(log(Ra)/log(Rb)) - exp(1);
dTC = 0.06;
minTC = log(0.005/dTC);
cds = ((_ <: _,_),_ : _+(1-alpha)*_) ~ (_<:*(alpha)) with {
iSR = 1/ma.SR;
dRC = dTC * exp(*(minTC));
alpha = 1 - iSR / (dRC + iSR);
};
vactrol = pow(_,1.9) : cds : *(b) + exp(1) : exp(log(Ra)/log) : R1/(_ + R1);
/* os.triangle oscillator (not bandlimited, frequency is approximate) */
trianglewave(freq) = _ ~ (_ <: _ + hyst) : /(periodsamps) with {
if(c,t,e) = select2(c,e,t);
hyst(x) = if(_ > 0, 2 * (x < periodsamps) - 1, 1 - 2 * (x > 0)) ~ _;
periodsamps = int(ma.SR / (2*float(freq)));
};
process = chumpPreamp:*(0.1):poweramp:transformer:*(volume) with{
volume = hgroup( "Amp",vslider("Volume[alias][style:knob]",0.5,0,1,0.01):smoothi(0.999) );
poweramp = *(vibe):tubestage(TB_6V6_250k,120.0,820.0,1.130462) ;
transformer = fi.lowpass( 1, 5500 ):fi.highpass( 1, 120) ;
// Tremelo effect
/* tremolo unit, using os.triangle or sine oscillator as lfo */
tremolo(freq, depth) = lfo * depth + 1 - depth : vactrol with {
sine(freq) = (os.oscs(freq) + 1) / 2 : max(0); // max(0) because of numerical inaccuracy
SINE=hgroup( "Tremelo",checkbox("SINEWAVE[3][enum:os.triangle|sine]") );
lfo = select2(SINE, trianglewave(freq), sine(freq));
};
speed = hgroup( "Tremelo",vslider("speed[2][style:knob]",5,0.1,10,0.1) ) ;
intensity = hgroup( "Tremelo", vslider("intensity[1][style:knob]",5,0,10,0.1)/10.2 ) ;
effect = tremolo(speed,intensity);
vof = hgroup( "Tremelo",checkbox("vibe[0][enum:Off|On]"));
vibe = select2(vof, 1.0, effect) ;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/gx_vibrochump.dsp | faust | in amp tube ba.selector
***************************************************************
** Tube Preamp Emulation stage 1 - 2
**
** SHP : Experiment with the presence control as a feedback loop
** Created a loop with high shelf filter cutting around 1khz and up
** pot controls the amount of cut 0 > -70dB
** If feedback loop is inverted get mad distortion and feedback!
** With no inversion get required effect so guess the combination
** of filter and processing de.delay may be shifting phase some
**
** To do :
** Play with amp structure say a champ clone
** tube:eq:tube:tube
** 12AX7:??:12AX7:6V6
**
** Move feedback loop in more complex amp around driver and power tube
** 12AX7:EQ:(12AX7:6V6)~FEEDBACK
** Model of a vactrol tremolo unit by "transmogrify"
** c.f. http://sourceforge.net/apps/phpbb/guitarix/viewtopic.php?f=7&t=44&p=233&hilit=transmogrifox#p233
** http://transmogrifox.webs.com/vactrol.m
vactrol model
os.triangle oscillator (not bandlimited, frequency is approximate)
Tremelo effect
tremolo unit, using os.triangle or sine oscillator as lfo
max(0) because of numerical inaccuracy | declare name "Redeye Vibro Chumo";
declare category "Amplifier";
import("stdfaust.lib");
import("guitarix.lib");
import("redeye.lib");
R1 = 2700;
Ra = 1e6;
Rb = 300;
b = exp(log(Ra)/log(Rb)) - exp(1);
dTC = 0.06;
minTC = log(0.005/dTC);
cds = ((_ <: _,_),_ : _+(1-alpha)*_) ~ (_<:*(alpha)) with {
iSR = 1/ma.SR;
dRC = dTC * exp(*(minTC));
alpha = 1 - iSR / (dRC + iSR);
};
vactrol = pow(_,1.9) : cds : *(b) + exp(1) : exp(log(Ra)/log) : R1/(_ + R1);
trianglewave(freq) = _ ~ (_ <: _ + hyst) : /(periodsamps) with {
if(c,t,e) = select2(c,e,t);
hyst(x) = if(_ > 0, 2 * (x < periodsamps) - 1, 1 - 2 * (x > 0)) ~ _;
periodsamps = int(ma.SR / (2*float(freq)));
};
process = chumpPreamp:*(0.1):poweramp:transformer:*(volume) with{
volume = hgroup( "Amp",vslider("Volume[alias][style:knob]",0.5,0,1,0.01):smoothi(0.999) );
poweramp = *(vibe):tubestage(TB_6V6_250k,120.0,820.0,1.130462) ;
transformer = fi.lowpass( 1, 5500 ):fi.highpass( 1, 120) ;
tremolo(freq, depth) = lfo * depth + 1 - depth : vactrol with {
SINE=hgroup( "Tremelo",checkbox("SINEWAVE[3][enum:os.triangle|sine]") );
lfo = select2(SINE, trianglewave(freq), sine(freq));
};
speed = hgroup( "Tremelo",vslider("speed[2][style:knob]",5,0.1,10,0.1) ) ;
intensity = hgroup( "Tremelo", vslider("intensity[1][style:knob]",5,0,10,0.1)/10.2 ) ;
effect = tremolo(speed,intensity);
vof = hgroup( "Tremelo",checkbox("vibe[0][enum:Off|On]"));
vibe = select2(vof, 1.0, effect) ;
};
|
fd613e98fb93816dee9fb354d2b035b621134c328cf6a37bd39312d0a0ee1efd | ml-wo/VirtualGuitarAmp-Guitarix | mbd.dsp | declare id "mbd";
declare name "MultiBand Distortion";
declare shortname "MB Distortion";
declare category "Distortion";
declare description "MultiBand Distortion";
import("stdfaust.lib");
import("reducemaps.lib");
anti_denormal = pow(10,-20);
anti_denormal_ac = 1 - 1' : *(anti_denormal) : + ~ *(-1);
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
drive1 = hslider("Drive1 [tooltip: Amount of distortion]", 0, 0, 1, 0.01);
offset1 = hslider("Offset1 [tooltip: Brings in even harmonics]", 0, 0, 0.5, 0.01);
drive2 = hslider("Drive2 [tooltip: Amount of distortion]", 0, 0, 1, 0.01);
offset2 = hslider("Offset2 [tooltip: Brings in even harmonics]", 0, 0, 0.5, 0.01);
drive3 = hslider("Drive3 [tooltip: Amount of distortion]", 0, 0, 1, 0.01);
offset3 = hslider("Offset3 [tooltip: Brings in even harmonics]", 0, 0, 0.5, 0.01);
drive4 = hslider("Drive4 [tooltip: Amount of distortion]", 0, 0, 1, 0.01);
offset4 = hslider("Offset4 [tooltip: Brings in even harmonics]", 0, 0, 0.5, 0.01);
drive5 = hslider("Drive5 [tooltip: Amount of distortion]", 0, 0, 1, 0.01);
offset5 = hslider("Offset5 [tooltip: Brings in even harmonics]", 0, 0, 0.5, 0.01);
gain1 = vslider("Gain", 0, -40, 4, 0.1) : ba.db2linear : si.smooth(0.999);
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
envelop = abs : max ~ (1.0/ma.SR) : mean(4096); // : max(ba.db2linear(-70)) : ba.linear2db;
process = _: +(anti_denormal_ac): geq: ( dist5s , dist4s , dist3s, dist2s, dist1s) :> *(gain1) with {
dist1s = ef.cubicnl_nodc(drive1,offset1: si.smooth(0.999)) : vmeter1;
dist2s = ef.cubicnl_nodc(drive2,offset2: si.smooth(0.999)) : vmeter2;
dist3s = ef.cubicnl_nodc(drive3,offset3: si.smooth(0.999)) : vmeter3;
dist4s = ef.cubicnl_nodc(drive4,offset4: si.smooth(0.999)) : vmeter4;
dist5s = ef.cubicnl_nodc(drive5,offset5: si.smooth(0.999)) : vmeter5;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/mbd.dsp | faust | : max(ba.db2linear(-70)) : ba.linear2db; | declare id "mbd";
declare name "MultiBand Distortion";
declare shortname "MB Distortion";
declare category "Distortion";
declare description "MultiBand Distortion";
import("stdfaust.lib");
import("reducemaps.lib");
anti_denormal = pow(10,-20);
anti_denormal_ac = 1 - 1' : *(anti_denormal) : + ~ *(-1);
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
drive1 = hslider("Drive1 [tooltip: Amount of distortion]", 0, 0, 1, 0.01);
offset1 = hslider("Offset1 [tooltip: Brings in even harmonics]", 0, 0, 0.5, 0.01);
drive2 = hslider("Drive2 [tooltip: Amount of distortion]", 0, 0, 1, 0.01);
offset2 = hslider("Offset2 [tooltip: Brings in even harmonics]", 0, 0, 0.5, 0.01);
drive3 = hslider("Drive3 [tooltip: Amount of distortion]", 0, 0, 1, 0.01);
offset3 = hslider("Offset3 [tooltip: Brings in even harmonics]", 0, 0, 0.5, 0.01);
drive4 = hslider("Drive4 [tooltip: Amount of distortion]", 0, 0, 1, 0.01);
offset4 = hslider("Offset4 [tooltip: Brings in even harmonics]", 0, 0, 0.5, 0.01);
drive5 = hslider("Drive5 [tooltip: Amount of distortion]", 0, 0, 1, 0.01);
offset5 = hslider("Offset5 [tooltip: Brings in even harmonics]", 0, 0, 0.5, 0.01);
gain1 = vslider("Gain", 0, -40, 4, 0.1) : ba.db2linear : si.smooth(0.999);
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
process = _: +(anti_denormal_ac): geq: ( dist5s , dist4s , dist3s, dist2s, dist1s) :> *(gain1) with {
dist1s = ef.cubicnl_nodc(drive1,offset1: si.smooth(0.999)) : vmeter1;
dist2s = ef.cubicnl_nodc(drive2,offset2: si.smooth(0.999)) : vmeter2;
dist3s = ef.cubicnl_nodc(drive3,offset3: si.smooth(0.999)) : vmeter3;
dist4s = ef.cubicnl_nodc(drive4,offset4: si.smooth(0.999)) : vmeter4;
dist5s = ef.cubicnl_nodc(drive5,offset5: si.smooth(0.999)) : vmeter5;
};
|
f82803c1031c2157b43fc4010e70bcb0e01a42940c0e5255a43ac3139bda8e4a | ml-wo/VirtualGuitarAmp-Guitarix | graphiceq.dsp | declare id "graphiceq";
declare name "Graphic EQ";
declare category "Tone Control";
declare description "Graphic EQ";
import("stdfaust.lib");
rd = library("reducemaps.lib");
//geq = fi.filterbank(3, (31.25, 62.5, 125., 250., 500., 1000., 2000., 4000., 8000., 16000.));
geq = fi.filterbank(3, (44., 88., 177., 354., 707., 1414., 2828., 5657., 11384., 18110.));
g1 = vslider("g1[tooltip:gain (dB) below 31.25 Hz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g2 = vslider("g2 [tooltip:gain (dB) at 62.5 Hz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g3 = vslider("g3 [tooltip:gain (dB) at 125 Hz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g4 = vslider("g4 [tooltip:gain (dB) at 250 Hz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g5 = vslider("g5 [tooltip:gain (dB) at 500 Hz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g6 = vslider("g6 [tooltip:gain (dB) at 1 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g7 = vslider("g7 [tooltip:gain (dB) at 2 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g8 = vslider("g8 [tooltip:gain (dB) at 4 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g9 = vslider("g9 [tooltip:gain (dB) at 8 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g10 = vslider("g10 [tooltip:gain (dB) at 16 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g11 = vslider("g11 [tooltip:gain (dB) above 16 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
v1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
v2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
v3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
v4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
v5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
v6(x) = attach(x, envelop(x) : vbargraph("v6[nomidi:no]", -70, +5));
v7(x) = attach(x, envelop(x) : vbargraph("v7[nomidi:no]", -70, +5));
v8(x) = attach(x, envelop(x) : vbargraph("v8[nomidi:no]", -70, +5));
v9(x) = attach(x, envelop(x) : vbargraph("v9[nomidi:no]", -70, +5));
v10(x) = attach(x, envelop(x) : vbargraph("v10[nomidi:no]", -70, +5));
v11(x) = attach(x, envelop(x) : vbargraph("v11[nomidi:no]", -70, +5));
envelop = abs : max ~ (1.0/ma.SR) : rd.maxn(4096) ;
process = geq :(*(g11):v11), (*(g10):v10),(*(g9):v9),(*(g8):v8),(*(g7):v7),(*(g6):v6),
(*(g5):v5),(*(g4):v4),(*(g3):v3),(*(g2):v2),(*(g1):v1) :>_;
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/faust/graphiceq.dsp | faust | geq = fi.filterbank(3, (31.25, 62.5, 125., 250., 500., 1000., 2000., 4000., 8000., 16000.)); | declare id "graphiceq";
declare name "Graphic EQ";
declare category "Tone Control";
declare description "Graphic EQ";
import("stdfaust.lib");
rd = library("reducemaps.lib");
geq = fi.filterbank(3, (44., 88., 177., 354., 707., 1414., 2828., 5657., 11384., 18110.));
g1 = vslider("g1[tooltip:gain (dB) below 31.25 Hz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g2 = vslider("g2 [tooltip:gain (dB) at 62.5 Hz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g3 = vslider("g3 [tooltip:gain (dB) at 125 Hz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g4 = vslider("g4 [tooltip:gain (dB) at 250 Hz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g5 = vslider("g5 [tooltip:gain (dB) at 500 Hz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g6 = vslider("g6 [tooltip:gain (dB) at 1 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g7 = vslider("g7 [tooltip:gain (dB) at 2 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g8 = vslider("g8 [tooltip:gain (dB) at 4 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g9 = vslider("g9 [tooltip:gain (dB) at 8 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g10 = vslider("g10 [tooltip:gain (dB) at 16 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
g11 = vslider("g11 [tooltip:gain (dB) above 16 kHz]", 0, -30, 20, 0.1) : ba.db2linear : si.smooth(0.999);
v1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
v2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
v3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
v4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
v5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
v6(x) = attach(x, envelop(x) : vbargraph("v6[nomidi:no]", -70, +5));
v7(x) = attach(x, envelop(x) : vbargraph("v7[nomidi:no]", -70, +5));
v8(x) = attach(x, envelop(x) : vbargraph("v8[nomidi:no]", -70, +5));
v9(x) = attach(x, envelop(x) : vbargraph("v9[nomidi:no]", -70, +5));
v10(x) = attach(x, envelop(x) : vbargraph("v10[nomidi:no]", -70, +5));
v11(x) = attach(x, envelop(x) : vbargraph("v11[nomidi:no]", -70, +5));
envelop = abs : max ~ (1.0/ma.SR) : rd.maxn(4096) ;
process = geq :(*(g11):v11), (*(g10):v10),(*(g9):v9),(*(g8):v8),(*(g7):v7),(*(g6):v6),
(*(g5):v5),(*(g4):v4),(*(g3):v3),(*(g2):v2),(*(g1):v1) :>_;
|
13ae2d1bd903f5287eeb2641c0e0ed51bbc3e15e311dfb3b02744dbde8e4ef5f | ml-wo/VirtualGuitarAmp-Guitarix | mbclipper.dsp | declare id "mbclip";
declare name "MultiBand Clipper";
declare shortname "MB Clipper";
declare category "Distortion";
declare description "MultiBand Clipper";
import("stdfaust.lib");
import("reducemaps.lib");
anti_denormal = pow(10,-20);
anti_denormal_ac = 1 - 1' : *(anti_denormal) : + ~ *(-1);
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
drive1 = hslider("Drive1 [tooltip: Amount of distortion]", 0.33, 0, 1, 0.01);
drive2 = hslider("Drive2 [tooltip: Amount of distortion]", 0.5, 0, 1, 0.01);
drive3 = hslider("Drive3 [tooltip: Amount of distortion]", 0.65, 0, 1, 0.01);
drive4 = hslider("Drive4 [tooltip: Amount of distortion]", 0.33, 0, 1, 0.01);
drive5 = hslider("Drive5 [tooltip: Amount of distortion]", 0.1, 0, 1, 0.01);
gain1 = vslider("Gain", 0, -40, 4, 0.1) : ba.db2linear : si.smooth(0.999);
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
envelop = abs : max ~ (1.0/ma.SR) : mean(4096); // : max(ba.db2linear(-70)) : ba.linear2db;
clip(drive) = *(pregain) : clip : *(postgain) with {
pregain = pow(10.0,2*drive);
clip = ffunction(float symclip(float), "clipping.h", "");
postgain = max(1.0,1.0/pregain);
};
eclip(drive) = *(pregain) : clip : *(postgain) with {
pregain = pow(10.0,2*drive);
clip(x) = ((exp(x*4)-exp(-x*4*1.2))/(exp(x*4)+exp(-x*4)))/4;
postgain = max(1.0,1.0/(pregain*2.5));
};
cclip(drive) = *(pregain) : clip : *(postgain) with {
pregain = pow(10.0,drive);
clip(x) = ma.tanh((drive+0.0001)*x)/ma.tanh(drive+0.0001);
postgain = max(1.0,1.0/pregain);
};
aclip(drive) = *(pregain) : clip : *(postgain) with {
pregain = pow(10.0,2*drive);
clip(x) = atan(x)/ma.PI;
postgain = max(1.0,1.0/pregain);
};
process = _: +(anti_denormal_ac): geq: ( dist5s , dist4s , dist3s, dist2s, dist1s) :> *(gain1) with {
dist1s = clip(drive1: si.smooth(0.999)) : vmeter1;
dist2s = clip(drive2: si.smooth(0.999)) : vmeter2;
dist3s = clip(drive3: si.smooth(0.999)) : vmeter3;
dist4s = clip(drive4: si.smooth(0.999)) : vmeter4;
dist5s = clip(drive5: si.smooth(0.999)) : vmeter5;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/plugins/mbclipper.dsp | faust | : max(ba.db2linear(-70)) : ba.linear2db; | declare id "mbclip";
declare name "MultiBand Clipper";
declare shortname "MB Clipper";
declare category "Distortion";
declare description "MultiBand Clipper";
import("stdfaust.lib");
import("reducemaps.lib");
anti_denormal = pow(10,-20);
anti_denormal_ac = 1 - 1' : *(anti_denormal) : + ~ *(-1);
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
drive1 = hslider("Drive1 [tooltip: Amount of distortion]", 0.33, 0, 1, 0.01);
drive2 = hslider("Drive2 [tooltip: Amount of distortion]", 0.5, 0, 1, 0.01);
drive3 = hslider("Drive3 [tooltip: Amount of distortion]", 0.65, 0, 1, 0.01);
drive4 = hslider("Drive4 [tooltip: Amount of distortion]", 0.33, 0, 1, 0.01);
drive5 = hslider("Drive5 [tooltip: Amount of distortion]", 0.1, 0, 1, 0.01);
gain1 = vslider("Gain", 0, -40, 4, 0.1) : ba.db2linear : si.smooth(0.999);
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
clip(drive) = *(pregain) : clip : *(postgain) with {
pregain = pow(10.0,2*drive);
clip = ffunction(float symclip(float), "clipping.h", "");
postgain = max(1.0,1.0/pregain);
};
eclip(drive) = *(pregain) : clip : *(postgain) with {
pregain = pow(10.0,2*drive);
clip(x) = ((exp(x*4)-exp(-x*4*1.2))/(exp(x*4)+exp(-x*4)))/4;
postgain = max(1.0,1.0/(pregain*2.5));
};
cclip(drive) = *(pregain) : clip : *(postgain) with {
pregain = pow(10.0,drive);
clip(x) = ma.tanh((drive+0.0001)*x)/ma.tanh(drive+0.0001);
postgain = max(1.0,1.0/pregain);
};
aclip(drive) = *(pregain) : clip : *(postgain) with {
pregain = pow(10.0,2*drive);
clip(x) = atan(x)/ma.PI;
postgain = max(1.0,1.0/pregain);
};
process = _: +(anti_denormal_ac): geq: ( dist5s , dist4s , dist3s, dist2s, dist1s) :> *(gain1) with {
dist1s = clip(drive1: si.smooth(0.999)) : vmeter1;
dist2s = clip(drive2: si.smooth(0.999)) : vmeter2;
dist3s = clip(drive3: si.smooth(0.999)) : vmeter3;
dist4s = clip(drive4: si.smooth(0.999)) : vmeter4;
dist5s = clip(drive5: si.smooth(0.999)) : vmeter5;
};
|
db4028f98147444d074945af9bc262ee3ad14b190c437ad77f30f026d976deeb | ml-wo/VirtualGuitarAmp-Guitarix | gx_studiopre.dsp | // Yet another tube preamp experiment
// So far so good :
// Bright bypass must not do fi.zero division
// Look at actual gain of tube stages in real preamp
// and maybe adjust stage1 outpu to reflect as at present with gain at 0dB get very
// little distortion/overload
// Also look at relative loss in tonestack
// stage1 gain is 30dB-35dB in reality
// tonestack takes around 12dB off in central position
// So stage1 effectively should boost by 18-23dB but in effect does only 3dB
// So to accuratley model the overload of next stage would need a boost of around
// 15-20dB at this point x 5.6 -> x10
// Would then need to attenuate final output to compensate ( actual preamp has 60dB gain! )
import("stdfaust.lib");
import("guitarix.lib");
// Based on simple Alembic F-2B vstudio preamp
// 2 sections of 12AX7 together with tonestack and volume
// This is an identical circuit apart from coupling caps whcih could do with filters
// 1st cathode cap gives aroudn 2Hz !
// Coupling cap sat end gives cutoff 1.6Hz!
// So only reason to do is to eliminate low frequency rubbish
studiopre( tone, gain ) = stage1:*(10):tone:gain:stage2 with{
//studiopre = volume with{
stage1 = tubestage(TB_12AX7_68k,2.1,1500.0,1.204541) ; // Gain 2.9 2nd -29.8 3rd -26.24
stage2 = tubestage(TB_12AX7_250k,2.1,1500.0,1.204285) ; // Gain 2.41 2nd -34.34 3rd -23.36
};
process =studiopre( tone_l,gain_l) with{
volume_l = vslider("Volume_L[alias][style:knob]",5,0,10,0.1)/10;
// In actuall amp is Fender/marshall type B/M/T tone set
// Look at adding tonestack in dsp.
// Does not work for stereo as the slider are predefined
// need to find a way of loadin 2
tstack_l = component("tonestack.dsp");
tone_l = tstack_l[tse=tstack_l.ts.fender_default;
t = vslider("Treble_L[alias]", 0.5, 0, 1, 0.01);
m = vslider("Middle_L[alias]", 0.5, 0, 1, 0.01);
l = vslider("Bass_L[alias]", 0.5, 0, 1, 0.01) : (_-1)*3.4 : exp;
] ;
// Attempt bright switch - bypass high frequencies around gain control
// Important that this may only work up to 0dB
// Note tried to emulate actual circuit so cutoff frequency varies with volume pot
// In effect -3dB is when reactance of capacitor equals pot value
// use equation freq = 160/( gain * 0.12 ) yo get -3dB cutoff
// Assuming 1M pot and 120pF cap
// Must avoid div by fi.zero
// Seems to cause pros when gain less than 0.1
freq_l = 160/(0.12 * ( volume_l+0.1) );
bright_l = *(checkbox("bright_l")):fi.highpass( 1, freq_l ) ;
gain_l = _<:bright_l,*(volume_l):>_ ;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/gx_studiopre.dsp | faust | Yet another tube preamp experiment
So far so good :
Bright bypass must not do fi.zero division
Look at actual gain of tube stages in real preamp
and maybe adjust stage1 outpu to reflect as at present with gain at 0dB get very
little distortion/overload
Also look at relative loss in tonestack
stage1 gain is 30dB-35dB in reality
tonestack takes around 12dB off in central position
So stage1 effectively should boost by 18-23dB but in effect does only 3dB
So to accuratley model the overload of next stage would need a boost of around
15-20dB at this point x 5.6 -> x10
Would then need to attenuate final output to compensate ( actual preamp has 60dB gain! )
Based on simple Alembic F-2B vstudio preamp
2 sections of 12AX7 together with tonestack and volume
This is an identical circuit apart from coupling caps whcih could do with filters
1st cathode cap gives aroudn 2Hz !
Coupling cap sat end gives cutoff 1.6Hz!
So only reason to do is to eliminate low frequency rubbish
studiopre = volume with{
Gain 2.9 2nd -29.8 3rd -26.24
Gain 2.41 2nd -34.34 3rd -23.36
In actuall amp is Fender/marshall type B/M/T tone set
Look at adding tonestack in dsp.
Does not work for stereo as the slider are predefined
need to find a way of loadin 2
Attempt bright switch - bypass high frequencies around gain control
Important that this may only work up to 0dB
Note tried to emulate actual circuit so cutoff frequency varies with volume pot
In effect -3dB is when reactance of capacitor equals pot value
use equation freq = 160/( gain * 0.12 ) yo get -3dB cutoff
Assuming 1M pot and 120pF cap
Must avoid div by fi.zero
Seems to cause pros when gain less than 0.1 |
import("stdfaust.lib");
import("guitarix.lib");
studiopre( tone, gain ) = stage1:*(10):tone:gain:stage2 with{
};
process =studiopre( tone_l,gain_l) with{
volume_l = vslider("Volume_L[alias][style:knob]",5,0,10,0.1)/10;
tstack_l = component("tonestack.dsp");
tone_l = tstack_l[tse=tstack_l.ts.fender_default;
t = vslider("Treble_L[alias]", 0.5, 0, 1, 0.01);
m = vslider("Middle_L[alias]", 0.5, 0, 1, 0.01);
l = vslider("Bass_L[alias]", 0.5, 0, 1, 0.01) : (_-1)*3.4 : exp;
] ;
freq_l = 160/(0.12 * ( volume_l+0.1) );
bright_l = *(checkbox("bright_l")):fi.highpass( 1, freq_l ) ;
gain_l = _<:bright_l,*(volume_l):>_ ;
};
|
476e7d76e01817909f9252de98c6abb3cbd0741c79dd769847f6fb0c5e988746 | ml-wo/VirtualGuitarAmp-Guitarix | ruin.dsp | // generated automatically
// DO NOT MODIFY!
declare id "ruin";
declare name "Ruiner";
declare category "Fuzz";
declare shortname "Ruiner";
declare description "Devi Ever Dark Boost";
declare drywetbox "true";
declare samplerate "96000";
import("stdfaust.lib");
import("trany.lib");
ruinerp1 = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Intensity = vslider("Intensity[name:Intensity]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
b0 = -3.68740376472719e-5*fs;
b1 = 0;
b2 = 3.68740376472719e-5*fs;
a0 = Intensity*fs*(3.23341143501596e-10*fs + 1.83849805831657e-6) + fs*(2.50211258533327e-10*fs + 1.41841348392955e-7) + 9.19249029158284e-5;
a1 = -6.46682287003193e-10*Intensity*pow(fs,2) - 5.00422517066654e-10*pow(fs,2) + 0.000183849805831657;
a2 = Intensity*fs*(3.23341143501596e-10*fs - 1.83849805831657e-6) + fs*(2.50211258533327e-10*fs - 1.41841348392955e-7) + 9.19249029158284e-5;
};
ruinerp2 = pre : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0),(a1/a0,a2/a0,a3/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = -1.11891193819806e-10*Level*pow(fs,2) - 1.11891193819806e-12*pow(fs,2);
b1 = 1.11891193819806e-10*Level*pow(fs,2) + 1.11891193819806e-12*pow(fs,2);
b2 = 1.11891193819806e-10*Level*pow(fs,2) + 1.11891193819806e-12*pow(fs,2);
b3 = -1.11891193819806e-10*Level*pow(fs,2) - 1.11891193819806e-12*pow(fs,2);
a0 = Level*(Level*fs*(fs*(-8.62067474057856e-16*fs - 4.46379387426086e-13) - 5.75832602737396e-11) + fs*(fs*(8.53446799317278e-16*fs + 5.28122340957611e-13) + 7.99957173492034e-11) + 2.87916301368698e-9) + fs*(fs*(8.71550216272493e-15*fs + 5.37582514840965e-12) + 8.12279541046302e-10) + 2.88204217670067e-8;
a1 = Level*(Level*fs*(fs*(2.58620242217357e-15*fs + 4.46379387426086e-13) - 5.75832602737396e-11) + fs*(fs*(-2.56034039795183e-15*fs - 5.28122340957611e-13) + 7.99957173492034e-11) + 8.63748904106094e-9) + fs*(fs*(-2.61465064881748e-14*fs - 5.37582514840965e-12) + 8.12279541046302e-10) + 8.646126530102e-8;
a2 = Level*(Level*fs*(fs*(-2.58620242217357e-15*fs + 4.46379387426086e-13) + 5.75832602737396e-11) + fs*(fs*(2.56034039795183e-15*fs - 5.28122340957611e-13) - 7.99957173492034e-11) + 8.63748904106094e-9) + fs*(fs*(2.61465064881748e-14*fs - 5.37582514840965e-12) - 8.12279541046302e-10) + 8.646126530102e-8;
a3 = Level*(Level*fs*(fs*(8.62067474057856e-16*fs - 4.46379387426086e-13) + 5.75832602737396e-11) + fs*(fs*(-8.53446799317278e-16*fs + 5.28122340957611e-13) - 7.99957173492034e-11) + 2.87916301368698e-9) + fs*(fs*(-8.71550216272493e-15*fs + 5.37582514840965e-12) - 8.12279541046302e-10) + 2.88204217670067e-8;
};
preclip = min(1) : max(-1);
//clip(x) = ((exp(x*4)-exp(-x*4*1.2))/(exp(x*4)+exp(-x*4)))/4;
clip = ffunction(float symclip(float), "clipping.h", "");
aclip(x) = atan(x)/ma.PI;
tclip = tranystageb(TB_SVEL34_68k,86.0,2700.0,25.922163) : tranystageb(TB_SVEL34_68k,86.0,2700.0,25.922163) ;
process = ruinerp1 : tclip : ruinerp2 ;
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/plugins/ruin.dsp | faust | generated automatically
DO NOT MODIFY!
clip(x) = ((exp(x*4)-exp(-x*4*1.2))/(exp(x*4)+exp(-x*4)))/4; | declare id "ruin";
declare name "Ruiner";
declare category "Fuzz";
declare shortname "Ruiner";
declare description "Devi Ever Dark Boost";
declare drywetbox "true";
declare samplerate "96000";
import("stdfaust.lib");
import("trany.lib");
ruinerp1 = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Intensity = vslider("Intensity[name:Intensity]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
b0 = -3.68740376472719e-5*fs;
b1 = 0;
b2 = 3.68740376472719e-5*fs;
a0 = Intensity*fs*(3.23341143501596e-10*fs + 1.83849805831657e-6) + fs*(2.50211258533327e-10*fs + 1.41841348392955e-7) + 9.19249029158284e-5;
a1 = -6.46682287003193e-10*Intensity*pow(fs,2) - 5.00422517066654e-10*pow(fs,2) + 0.000183849805831657;
a2 = Intensity*fs*(3.23341143501596e-10*fs - 1.83849805831657e-6) + fs*(2.50211258533327e-10*fs - 1.41841348392955e-7) + 9.19249029158284e-5;
};
ruinerp2 = pre : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0),(a1/a0,a2/a0,a3/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = -1.11891193819806e-10*Level*pow(fs,2) - 1.11891193819806e-12*pow(fs,2);
b1 = 1.11891193819806e-10*Level*pow(fs,2) + 1.11891193819806e-12*pow(fs,2);
b2 = 1.11891193819806e-10*Level*pow(fs,2) + 1.11891193819806e-12*pow(fs,2);
b3 = -1.11891193819806e-10*Level*pow(fs,2) - 1.11891193819806e-12*pow(fs,2);
a0 = Level*(Level*fs*(fs*(-8.62067474057856e-16*fs - 4.46379387426086e-13) - 5.75832602737396e-11) + fs*(fs*(8.53446799317278e-16*fs + 5.28122340957611e-13) + 7.99957173492034e-11) + 2.87916301368698e-9) + fs*(fs*(8.71550216272493e-15*fs + 5.37582514840965e-12) + 8.12279541046302e-10) + 2.88204217670067e-8;
a1 = Level*(Level*fs*(fs*(2.58620242217357e-15*fs + 4.46379387426086e-13) - 5.75832602737396e-11) + fs*(fs*(-2.56034039795183e-15*fs - 5.28122340957611e-13) + 7.99957173492034e-11) + 8.63748904106094e-9) + fs*(fs*(-2.61465064881748e-14*fs - 5.37582514840965e-12) + 8.12279541046302e-10) + 8.646126530102e-8;
a2 = Level*(Level*fs*(fs*(-2.58620242217357e-15*fs + 4.46379387426086e-13) + 5.75832602737396e-11) + fs*(fs*(2.56034039795183e-15*fs - 5.28122340957611e-13) - 7.99957173492034e-11) + 8.63748904106094e-9) + fs*(fs*(2.61465064881748e-14*fs - 5.37582514840965e-12) - 8.12279541046302e-10) + 8.646126530102e-8;
a3 = Level*(Level*fs*(fs*(8.62067474057856e-16*fs - 4.46379387426086e-13) + 5.75832602737396e-11) + fs*(fs*(-8.53446799317278e-16*fs + 5.28122340957611e-13) - 7.99957173492034e-11) + 2.87916301368698e-9) + fs*(fs*(-8.71550216272493e-15*fs + 5.37582514840965e-12) - 8.12279541046302e-10) + 2.88204217670067e-8;
};
preclip = min(1) : max(-1);
clip = ffunction(float symclip(float), "clipping.h", "");
aclip(x) = atan(x)/ma.PI;
tclip = tranystageb(TB_SVEL34_68k,86.0,2700.0,25.922163) : tranystageb(TB_SVEL34_68k,86.0,2700.0,25.922163) ;
process = ruinerp1 : tclip : ruinerp2 ;
|
1d5fd708a0bce0e8678568c54cfbe4ad82f44f62ff3177d8ab0b9752ae5ef9a6 | ml-wo/VirtualGuitarAmp-Guitarix | uniBar.dsp | declare name "Nonlinear Banded Waveguide Models";
declare author "Romain Michon";
declare copyright "Romain Michon ([email protected])";
declare version "1.0";
declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license);
declare description "This instrument uses banded pm.waveguide. For more information, see Essl, G. and Cook, P. Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference.";
import("stdfaust.lib");
bow(offset,slope) = pow(abs(sample) + 0.75, -4) : saturationPos
with{
sample(y) = (y + offset)*slope;
};
bandPass(resonance,radius) = fi.TF2(b0,b1,b2,a1,a2)
with{
a2 = radius*radius;
a1 = -2*radius*cos(ma.PI*2*resonance/ma.SR);
b0 = 0.5-0.5*a2;
b1 = 0;
b2 = -b0;
};
saturationPos(x) = x <: (_>1),(_<=1 : *(x)) :> +;
saturationNeg(x) = x <: (_<-1),(_>=-1 : *(x)) :> *(-1) + _;
//==================== GUI SPECIFICATION ================
freq = hslider("h:Basic Parameters/synthfreq [1][unit:Hz] [tooltip:Tone frequency]",440,20,20000,1);
gain = hslider("h:Basic Parameters/gain [1][tooltip:Gain (value between 0 and 1)]",0.8,0,10,0.01)*10;
gate = checkbox("h:Basic Parameters/gate [1][tooltip:noteOn = 1, noteOff = 0]");
//==================== MODAL PARAMETERS ================
preset = 1;
nMode(1) = 4;
modes(1,0) = 1;
basegains(1,0) = pow(0.9,1);
excitation(1,0) = 1*gain/nMode(1);
modes(1,1) = 2.756;
basegains(1,1) = pow(0.9,2);
excitation(1,1) = 1*gain/nMode(1);
modes(1,2) = 5.404;
basegains(1,2) = pow(0.9,3);
excitation(1,2) = 1*gain/nMode(1);
modes(1,3) = 8.933;
basegains(1,3) = pow(0.9,4);
excitation(1,3) = 1*gain/nMode(1);
//==================== SIGNAL PROCESSING ================
//----------------------- Synthesis parameters computing and functions declaration ----------------------------
//the number of modes depends on the preset being used
nModes = nMode(preset);
//bow table parameters
tableOffset = 0;
tableSlope = 10 - (9);
delayLengthBase = ma.SR/freq;
//de.delay lengths in number of samples
delayLength(x) = delayLengthBase/modes(preset,x);
//de.delay lines
delayLine(x) = de.delay(4096,delayLength(x));
//Filter bank: fi.bandpass filters (declared in instrument.lib)
radius = 1 - ma.PI*32/ma.SR;
bandPassFilter(x) = bandPass(freq*modes(preset,x),radius);
//Delay lines feedback for bow table lookup control
baseGainApp = 0.8999999999999999 + (0.1);
velocityInputApp = 0.8;
velocityInput = velocityInputApp + _*baseGainApp,par(i,(nModes-1),(_*baseGainApp)) :> +;
//Bow velocity is controled by an ADSR envelope
maxVelocity = 0.03 + 0.1*gain;
bowVelocity = maxVelocity*en.adsr(0.02,0.005,90,0.01,gate);
//----------------------- Algorithm implementation ----------------------------
//Bow table lookup (bow is decalred in instrument.lib)
bowing = bowVelocity - velocityInput <: *(bow(tableOffset,tableSlope)) : /(nModes);
//One resonance
resonance(x) = + : + (excitation(1,x)*gate) : delayLine(x) : _*basegains(1,x) : bandPassFilter(x);
/*process =
//Bowed Excitation
_<:((bowing <:
//nModes resonances with nModes feedbacks for bow table look-up
(resonance(1)~_))~_);*/
process(x) =
//Bowed Excitation
(bowing <:
//nModes resonances with nModes feedbacks for bow table look-up
par(i,nModes,(resonance(i)~_)))~par(i,nModes,_) :> _ : +(x) :_;
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/uniBar.dsp | faust | Synthesis Tool Kit 4.3 (MIT style license);
==================== GUI SPECIFICATION ================
==================== MODAL PARAMETERS ================
==================== SIGNAL PROCESSING ================
----------------------- Synthesis parameters computing and functions declaration ----------------------------
the number of modes depends on the preset being used
bow table parameters
de.delay lengths in number of samples
de.delay lines
Filter bank: fi.bandpass filters (declared in instrument.lib)
Delay lines feedback for bow table lookup control
Bow velocity is controled by an ADSR envelope
----------------------- Algorithm implementation ----------------------------
Bow table lookup (bow is decalred in instrument.lib)
One resonance
process =
//Bowed Excitation
_<:((bowing <:
//nModes resonances with nModes feedbacks for bow table look-up
(resonance(1)~_))~_);
Bowed Excitation
nModes resonances with nModes feedbacks for bow table look-up | declare name "Nonlinear Banded Waveguide Models";
declare author "Romain Michon";
declare copyright "Romain Michon ([email protected])";
declare version "1.0";
declare description "This instrument uses banded pm.waveguide. For more information, see Essl, G. and Cook, P. Banded Waveguides: Towards Physical Modelling of Bar Percussion Instruments, Proceedings of the 1999 International Computer Music Conference.";
import("stdfaust.lib");
bow(offset,slope) = pow(abs(sample) + 0.75, -4) : saturationPos
with{
sample(y) = (y + offset)*slope;
};
bandPass(resonance,radius) = fi.TF2(b0,b1,b2,a1,a2)
with{
a2 = radius*radius;
a1 = -2*radius*cos(ma.PI*2*resonance/ma.SR);
b0 = 0.5-0.5*a2;
b1 = 0;
b2 = -b0;
};
saturationPos(x) = x <: (_>1),(_<=1 : *(x)) :> +;
saturationNeg(x) = x <: (_<-1),(_>=-1 : *(x)) :> *(-1) + _;
freq = hslider("h:Basic Parameters/synthfreq [1][unit:Hz] [tooltip:Tone frequency]",440,20,20000,1);
gain = hslider("h:Basic Parameters/gain [1][tooltip:Gain (value between 0 and 1)]",0.8,0,10,0.01)*10;
gate = checkbox("h:Basic Parameters/gate [1][tooltip:noteOn = 1, noteOff = 0]");
preset = 1;
nMode(1) = 4;
modes(1,0) = 1;
basegains(1,0) = pow(0.9,1);
excitation(1,0) = 1*gain/nMode(1);
modes(1,1) = 2.756;
basegains(1,1) = pow(0.9,2);
excitation(1,1) = 1*gain/nMode(1);
modes(1,2) = 5.404;
basegains(1,2) = pow(0.9,3);
excitation(1,2) = 1*gain/nMode(1);
modes(1,3) = 8.933;
basegains(1,3) = pow(0.9,4);
excitation(1,3) = 1*gain/nMode(1);
nModes = nMode(preset);
tableOffset = 0;
tableSlope = 10 - (9);
delayLengthBase = ma.SR/freq;
delayLength(x) = delayLengthBase/modes(preset,x);
delayLine(x) = de.delay(4096,delayLength(x));
radius = 1 - ma.PI*32/ma.SR;
bandPassFilter(x) = bandPass(freq*modes(preset,x),radius);
baseGainApp = 0.8999999999999999 + (0.1);
velocityInputApp = 0.8;
velocityInput = velocityInputApp + _*baseGainApp,par(i,(nModes-1),(_*baseGainApp)) :> +;
maxVelocity = 0.03 + 0.1*gain;
bowVelocity = maxVelocity*en.adsr(0.02,0.005,90,0.01,gate);
bowing = bowVelocity - velocityInput <: *(bow(tableOffset,tableSlope)) : /(nModes);
resonance(x) = + : + (excitation(1,x)*gate) : delayLine(x) : _*basegains(1,x) : bandPassFilter(x);
process(x) =
(bowing <:
par(i,nModes,(resonance(i)~_)))~par(i,nModes,_) :> _ : +(x) :_;
|
53d1b890e938104298489e6ddd7e6f9924d62e3590fa27ecbc5cb85dec30bac7 | ml-wo/VirtualGuitarAmp-Guitarix | compressor.dsp | declare name "Compressor";
declare category "Guitar Effects";
/* Compressor unit. */
//declare name "compressor -- compressor/limiter unit";
declare author "Albert Graef";
declare version "1.0";
import("stdfaust.lib");
import("guitarix.lib");
rd = library("reducemaps.lib");
/* Controls. */
// partition the controls into these three groups
comp_group(x) = hgroup("1-compression", x);
env_group(x) = vgroup("2-envelop", x);
gain_group(x) = vgroup("3-gain", x);
// compressor controls: ratio, threshold and knee size
ratio = nentry("ratio[name:Ratio]", 2, 1, 20, 0.1);
threshold = nentry("threshold[name:Threshold]", -20, -96, 10, 0.1);
knee = nentry("knee[name:Knee]", 3, 0, 20, 0.1);
// attack and release controls; clamped to a minimum of 1 sample
attack = hslider("attack[name:Attack]", 0.002, 0, 1, 0.001) : max(1/ma.SR);
release = hslider("release[name:Release]", 0.5, 0, 10, 0.01) : max(1/ma.SR);
// gain controls: make-up gain, compression gain meter
makeup_gain = gain_group(hslider("makeup gain[name:Makeup]", 0, -96, 96, 0.1));
gain(x) = attach(x, x : gain_group(hbargraph("gain", -96, 0)));
t = 0.1;
g = exp(-1/(ma.SR*t));
env = abs : *(1-g) : + ~ *(g);
rms = sqr : *(1-g) : + ~ *(g) : sqrt;
sqr(x) = x*x;
/* Compute the envelop of a stereo signal. Replace env with rms ba.if you want to
use the RMS value instead. */
//env2(x,y) = max(env(x),env(y));
env2(x) = max(env(x));
/* Compute the compression factor for the current input level. The gain is
always 0 dB ba.if we're below the reduced threshold, threshold-knee. Beyond
the real threshold value the level is scaled by 1/ratio. Between these two
extremes we return a convex combination of those factors. This is also
known as "soft-knee" compression: the compression kicks in gradually at
threshold-knee and reaches its full value at threshold. For special
effects, you can also achieve old-school "hard-knee" compression by setting
the knee value to fi.zero. Also note that, before computing the gain, the
input level is first smoothed out using a 1 fi.pole IIR to prevent clicks when
the input level changes abruptly. The attack and release times of this
filter are configured with the corresponding envelop controls of the
compressor. */
compress(env) = level*(1-r)/r
with {
// the (filtered) input level above the threshold
level = env : h ~ _ : ba.linear2db : (_-threshold+knee) : max(0)
with {
h(x,y) = f*x+(1-f)*y with { f = (x<y)*ga+(x>=y)*gr; };
ga = exp(-1/(ma.SR*attack));
gr = exp(-1/(ma.SR*release));
};
// the knee factor, clamped to 0..1; we add a small perturbation in
// the denominator to prevent infinities and nan when knee<<1
p = level/(knee+eps) : max(0) : min(1) with { eps = 0.001; };
// the actual compression ratio
r = 1-p+p*ratio;
};
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
envelop = abs : max ~ (1.0/ma.SR) : rd.mean(2048); // : max(ba.db2linear(-70)) : ba.linear2db;
process(x) = g(x)*x
with {
//g = env2(x) : compress : gain : +(makeup_gain) : ba.db2linear ;
g = add_dc : env : compress : vmeter1 : ba.db2linear ;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/faust/compressor.dsp | faust | Compressor unit.
declare name "compressor -- compressor/limiter unit";
Controls.
partition the controls into these three groups
compressor controls: ratio, threshold and knee size
attack and release controls; clamped to a minimum of 1 sample
gain controls: make-up gain, compression gain meter
Compute the envelop of a stereo signal. Replace env with rms ba.if you want to
use the RMS value instead.
env2(x,y) = max(env(x),env(y));
Compute the compression factor for the current input level. The gain is
always 0 dB ba.if we're below the reduced threshold, threshold-knee. Beyond
the real threshold value the level is scaled by 1/ratio. Between these two
extremes we return a convex combination of those factors. This is also
known as "soft-knee" compression: the compression kicks in gradually at
threshold-knee and reaches its full value at threshold. For special
effects, you can also achieve old-school "hard-knee" compression by setting
the knee value to fi.zero. Also note that, before computing the gain, the
input level is first smoothed out using a 1 fi.pole IIR to prevent clicks when
the input level changes abruptly. The attack and release times of this
filter are configured with the corresponding envelop controls of the
compressor.
the (filtered) input level above the threshold
the knee factor, clamped to 0..1; we add a small perturbation in
the denominator to prevent infinities and nan when knee<<1
the actual compression ratio
: max(ba.db2linear(-70)) : ba.linear2db;
g = env2(x) : compress : gain : +(makeup_gain) : ba.db2linear ; | declare name "Compressor";
declare category "Guitar Effects";
declare author "Albert Graef";
declare version "1.0";
import("stdfaust.lib");
import("guitarix.lib");
rd = library("reducemaps.lib");
comp_group(x) = hgroup("1-compression", x);
env_group(x) = vgroup("2-envelop", x);
gain_group(x) = vgroup("3-gain", x);
ratio = nentry("ratio[name:Ratio]", 2, 1, 20, 0.1);
threshold = nentry("threshold[name:Threshold]", -20, -96, 10, 0.1);
knee = nentry("knee[name:Knee]", 3, 0, 20, 0.1);
attack = hslider("attack[name:Attack]", 0.002, 0, 1, 0.001) : max(1/ma.SR);
release = hslider("release[name:Release]", 0.5, 0, 10, 0.01) : max(1/ma.SR);
makeup_gain = gain_group(hslider("makeup gain[name:Makeup]", 0, -96, 96, 0.1));
gain(x) = attach(x, x : gain_group(hbargraph("gain", -96, 0)));
t = 0.1;
g = exp(-1/(ma.SR*t));
env = abs : *(1-g) : + ~ *(g);
rms = sqr : *(1-g) : + ~ *(g) : sqrt;
sqr(x) = x*x;
env2(x) = max(env(x));
compress(env) = level*(1-r)/r
with {
level = env : h ~ _ : ba.linear2db : (_-threshold+knee) : max(0)
with {
h(x,y) = f*x+(1-f)*y with { f = (x<y)*ga+(x>=y)*gr; };
ga = exp(-1/(ma.SR*attack));
gr = exp(-1/(ma.SR*release));
};
p = level/(knee+eps) : max(0) : min(1) with { eps = 0.001; };
r = 1-p+p*ratio;
};
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
process(x) = g(x)*x
with {
g = add_dc : env : compress : vmeter1 : ba.db2linear ;
};
|
c65c5bb58127f8d3bee86319752e4facf7fcb41f3781172da70180c219039316 | ml-wo/VirtualGuitarAmp-Guitarix | mbchor.dsp | declare id "mbchor";
declare name "Multi Band Chorus";
declare shortname "MB Chorus";
declare category "Modulation";
declare description "Multi Band Chorus";
import("stdfaust.lib");
import("reducemaps.lib");
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
l1 = hslider("level1", 0.5, 0, 1, 0.01);
f1 = hslider("freq1[tooltip:Beats per Minute]",30,24,360,1)/60;
d1 = hslider("delay1", 0.02, 0, 0.2, 0.01): si.smooth(0.999);
de1 = hslider("depth1", 0.02, 0.01, 1, 0.01)/10;
l2 = hslider("level2", 0.5, 0, 1, 0.01);
f2 = hslider("freq2[tooltip:Beats per Minute]",60,24,360,1)/60;
d2 = hslider("delay2", 0.04, 0, 0.2, 0.01): si.smooth(0.999);
de2 = hslider("depth2", 0.04, 0.01, 1, 0.01)/10;
l3 = hslider("level3", 0.5, 0, 1, 0.01);
f3 = hslider("freq3[tooltip:Beats per Minute]",90,24,360,1)/60;
d3 = hslider("delay3", 0.06, 0, 0.2, 0.01): si.smooth(0.999);
de3 = hslider("depth3", 0.06, 0.01, 1, 0.01)/10;
l4 = hslider("level4", 0.5, 0, 1, 0.01);
f4 = hslider("freq4[tooltip:Beats per Minute]",120,24,360,1)/60;
d4 = hslider("delay4", 0.08, 0, 0.2, 0.01): si.smooth(0.999);
de4 = hslider("depth4", 0.08, 0.01, 1, 0.01)/10;
l5 = hslider("level5", 0.5, 0, 1, 0.01);
f5 = hslider("freq5[tooltip:Beats per Minute]",150,24,360,1)/60;
d5 = hslider("delay5", 0.10, 0, 0.2, 0.01): si.smooth(0.999);
de5 = hslider("depth5", 0.10, 0.01, 1, 0.01)/10;
tblosc(n,f,freq,mod) = (1-d)*rdtable(n,wform,i&(n-1)) +
d*rdtable(n,wform,(i+1)&(n-1))
with {
wform = ba.time*(2.0*ma.PI)/n : f;
phase = freq/ma.SR : (+ : ma.decimal) ~ _;
modphase = ma.decimal(phase+mod/(2*ma.PI))*n;
i = int(floor(modphase));
d = ma.decimal(modphase);
};
chor(dtime,freq,depth,lev) = chorus(dtime,freq,depth,lev,0) : *(lev)
with {
chorus(dtime,freq,depth,lev,phase,x)
= x+lev*de.fdelay(1<<16, t, x)
with {
t = ma.SR*dtime/2*(1+depth*tblosc(1<<16, sin, freq, phase));
};
};
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -0, +1));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -0, +1));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -0, +1));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -0, +1));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -0, +1));
envelop = abs : max ~ (1.0/ma.SR) :mean(4096) ; // : max(ba.db2linear(-70)) : ba.linear2db;
process = _<:(geq:( dist5s , dist4s , dist3s, dist2s, dist1s)),_ :>_ with {
dist1s = chor(d1,f1,de1,l1) : vmeter1;
dist2s = chor(d2,f2,de2,l2) : vmeter2;
dist3s = chor(d3,f3,de3,l3) : vmeter3;
dist4s = chor(d4,f4,de4,l4) : vmeter4;
dist5s = chor(d5,f5,de5,l5) : vmeter5;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/plugins/mbchor.dsp | faust | : max(ba.db2linear(-70)) : ba.linear2db; | declare id "mbchor";
declare name "Multi Band Chorus";
declare shortname "MB Chorus";
declare category "Modulation";
declare description "Multi Band Chorus";
import("stdfaust.lib");
import("reducemaps.lib");
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
l1 = hslider("level1", 0.5, 0, 1, 0.01);
f1 = hslider("freq1[tooltip:Beats per Minute]",30,24,360,1)/60;
d1 = hslider("delay1", 0.02, 0, 0.2, 0.01): si.smooth(0.999);
de1 = hslider("depth1", 0.02, 0.01, 1, 0.01)/10;
l2 = hslider("level2", 0.5, 0, 1, 0.01);
f2 = hslider("freq2[tooltip:Beats per Minute]",60,24,360,1)/60;
d2 = hslider("delay2", 0.04, 0, 0.2, 0.01): si.smooth(0.999);
de2 = hslider("depth2", 0.04, 0.01, 1, 0.01)/10;
l3 = hslider("level3", 0.5, 0, 1, 0.01);
f3 = hslider("freq3[tooltip:Beats per Minute]",90,24,360,1)/60;
d3 = hslider("delay3", 0.06, 0, 0.2, 0.01): si.smooth(0.999);
de3 = hslider("depth3", 0.06, 0.01, 1, 0.01)/10;
l4 = hslider("level4", 0.5, 0, 1, 0.01);
f4 = hslider("freq4[tooltip:Beats per Minute]",120,24,360,1)/60;
d4 = hslider("delay4", 0.08, 0, 0.2, 0.01): si.smooth(0.999);
de4 = hslider("depth4", 0.08, 0.01, 1, 0.01)/10;
l5 = hslider("level5", 0.5, 0, 1, 0.01);
f5 = hslider("freq5[tooltip:Beats per Minute]",150,24,360,1)/60;
d5 = hslider("delay5", 0.10, 0, 0.2, 0.01): si.smooth(0.999);
de5 = hslider("depth5", 0.10, 0.01, 1, 0.01)/10;
tblosc(n,f,freq,mod) = (1-d)*rdtable(n,wform,i&(n-1)) +
d*rdtable(n,wform,(i+1)&(n-1))
with {
wform = ba.time*(2.0*ma.PI)/n : f;
phase = freq/ma.SR : (+ : ma.decimal) ~ _;
modphase = ma.decimal(phase+mod/(2*ma.PI))*n;
i = int(floor(modphase));
d = ma.decimal(modphase);
};
chor(dtime,freq,depth,lev) = chorus(dtime,freq,depth,lev,0) : *(lev)
with {
chorus(dtime,freq,depth,lev,phase,x)
= x+lev*de.fdelay(1<<16, t, x)
with {
t = ma.SR*dtime/2*(1+depth*tblosc(1<<16, sin, freq, phase));
};
};
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -0, +1));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -0, +1));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -0, +1));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -0, +1));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -0, +1));
process = _<:(geq:( dist5s , dist4s , dist3s, dist2s, dist1s)),_ :>_ with {
dist1s = chor(d1,f1,de1,l1) : vmeter1;
dist2s = chor(d2,f2,de2,l2) : vmeter2;
dist3s = chor(d3,f3,de3,l3) : vmeter3;
dist4s = chor(d4,f4,de4,l4) : vmeter4;
dist5s = chor(d5,f5,de5,l5) : vmeter5;
};
|
895c6951cce216eae701fbd4763dec78a525bd15d12bfb8984f7cb21afa78be8 | ml-wo/VirtualGuitarAmp-Guitarix | mbdel.dsp | declare id "mbdel";
declare name "MultiBand Delay";
declare shortname "MB Delay";
declare category "Echo / Delay";
declare description "Multi Band Delay";
import("stdfaust.lib");
import("reducemaps.lib");
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
interp = 100*ma.SR/1000.0;
N = int( 2^18);
g1 = vslider("gain1", -10, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d1 = ba.tempo(hslider("delay1[tooltip:Delay in Beats per Minute]",30,24,360,1));
g2 = vslider("gain2", -5, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d2 = ba.tempo(hslider("delay2[tooltip:Delay in Beats per Minute]",60,24,360,1));
g3 = vslider("gain3", -2, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d3 = ba.tempo(hslider("delay3[tooltip:Delay in Beats per Minute]",90,24,360,1));
g4 = vslider("gain4", 0, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d4 = ba.tempo(hslider("delay4[tooltip:Delay in Beats per Minute]",120,24,360,1));
g5 = vslider("gain5", -10, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d5 = ba.tempo(hslider("delay5[tooltip:Delay in Beats per Minute]",150,24,360,1));
del(g,d,f) = *(g) : (+: de.sdelay(N, interp,d))~(*(f)) ;
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
f1 = vslider("feedback1[tooltip:percentage of the feedback level in the de.delay loop]", 50, 1, 100, 1)/100 ;
f2 = vslider("feedback2[tooltip:percentage of the feedback level in the de.delay loop]", 50, 1, 100, 1)/100 ;
f3 = vslider("feedback3[tooltip:percentage of the feedback level in the de.delay loop]", 50, 1, 100, 1)/100 ;
f4 = vslider("feedback4[tooltip:percentage of the feedback level in the de.delay loop]", 50, 1, 100, 1)/100 ;
f5 = vslider("feedback5[tooltip:percentage of the feedback level in the de.delay loop]", 50, 1, 100, 1)/100 ;
envelop = abs : max ~ (1.0/ma.SR) : mean(4096) ; // : max(ba.db2linear(-70)) : ba.linear2db;
process = _<:(geq: ( dist5s , dist4s , dist3s, dist2s, dist1s)),_:>_ with {
dist1s = del(g1,d1,f1) : vmeter1;
dist2s = del(g2,d2,f2) : vmeter2;
dist3s = del(g3,d3,f3) : vmeter3;
dist4s = del(g4,d4,f4) : vmeter4;
dist5s = del(g5,d5,f5) : vmeter5;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/mbdel.dsp | faust | : max(ba.db2linear(-70)) : ba.linear2db; | declare id "mbdel";
declare name "MultiBand Delay";
declare shortname "MB Delay";
declare category "Echo / Delay";
declare description "Multi Band Delay";
import("stdfaust.lib");
import("reducemaps.lib");
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
interp = 100*ma.SR/1000.0;
N = int( 2^18);
g1 = vslider("gain1", -10, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d1 = ba.tempo(hslider("delay1[tooltip:Delay in Beats per Minute]",30,24,360,1));
g2 = vslider("gain2", -5, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d2 = ba.tempo(hslider("delay2[tooltip:Delay in Beats per Minute]",60,24,360,1));
g3 = vslider("gain3", -2, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d3 = ba.tempo(hslider("delay3[tooltip:Delay in Beats per Minute]",90,24,360,1));
g4 = vslider("gain4", 0, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d4 = ba.tempo(hslider("delay4[tooltip:Delay in Beats per Minute]",120,24,360,1));
g5 = vslider("gain5", -10, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
d5 = ba.tempo(hslider("delay5[tooltip:Delay in Beats per Minute]",150,24,360,1));
del(g,d,f) = *(g) : (+: de.sdelay(N, interp,d))~(*(f)) ;
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
f1 = vslider("feedback1[tooltip:percentage of the feedback level in the de.delay loop]", 50, 1, 100, 1)/100 ;
f2 = vslider("feedback2[tooltip:percentage of the feedback level in the de.delay loop]", 50, 1, 100, 1)/100 ;
f3 = vslider("feedback3[tooltip:percentage of the feedback level in the de.delay loop]", 50, 1, 100, 1)/100 ;
f4 = vslider("feedback4[tooltip:percentage of the feedback level in the de.delay loop]", 50, 1, 100, 1)/100 ;
f5 = vslider("feedback5[tooltip:percentage of the feedback level in the de.delay loop]", 50, 1, 100, 1)/100 ;
process = _<:(geq: ( dist5s , dist4s , dist3s, dist2s, dist1s)),_:>_ with {
dist1s = del(g1,d1,f1) : vmeter1;
dist2s = del(g2,d2,f2) : vmeter2;
dist3s = del(g3,d3,f3) : vmeter3;
dist4s = del(g4,d4,f4) : vmeter4;
dist5s = del(g5,d5,f5) : vmeter5;
};
|
7a4a6093472102f9b30befd1bdc27b9795773a5f5173966b6b9976d6009153ea | ml-wo/VirtualGuitarAmp-Guitarix | gx_studiopre_st.dsp | // Yet another tube preamp experiment
// So far so good :
// Bright bypass must not do fi.zero division
// Look at actual gain of tube stages in real preamp
// and maybe adjust stage1 outpu to reflect as at present with gain at 0dB get very
// little distortion/overload
// Also look at relative loss in tonestack
// stage1 gain is 30dB-35dB in reality
// tonestack takes around 12dB off in central position
// So stage1 effectively should boost by 18-23dB but in effect does only 3dB
// So to accuratley model the overload of next stage would need a boost of around
// 15-20dB at this point x 5.6 -> x10
// Would then need to attenuate final output to compensate ( actual preamp has 60dB gain! )
import("stdfaust.lib");
import("guitarix.lib");
// Based on simple Alembic F-2B vstudio preamp
// 2 sectionos of 12AX7 together with tonestack and volume
// This is an identical circuit apart from coupling caps whcih could do with filters
// 1st cathode cap gives aroudn 2Hz !
// Coupling cap sat end gives cutoff 1.6Hz!
// So only reason to do is to eliminate low frequency rubbish
//studiopre = stage1:*(10):tone:volume:*(0.1) with{
studiopre( tone, gain ) = stage1:*(10):tone:gain:stage2 with{
//studiopre = volume with{
stage1 = tubestage(TB_12AX7_68k,2.1,1500.0,1.204541) ; // Gain 2.9 2nd -29.8 3rd -26.24
stage2 = tubestage(TB_12AX7_250k,2.1,1500.0,1.204285) ; // Gain 2.41 2nd -34.34 3rd -23.36
};
process =studiopre( tone_l,gain_l),studiopre(tone_r, gain_r) with{
//process =studiopre( tone_l,volume_l) with{
volume_l = vslider("Volume_L[alias][style:knob]",5,0,10,0.1)/10;
volume_r = vslider("Volume_R[alias][style:knob]",5,0,10,0.1)/10;
// In actuall amp is Fender/marshall type B/M/T tone set
// Look at adding tonestack in dsp.
// Does not work for stereo as the slider are predefined
// need to find a way of loadin 2
tstack_l = component("tonestack.dsp");
tone_l = tstack_l[tse=tstack_l.ts.fender_default;
t = vslider("Treble_L[alias]", 0.5, 0, 1, 0.01);
m = vslider("Middle_L[alias]", 0.5, 0, 1, 0.01);
l = vslider("Bass_L[alias]", 0.5, 0, 1, 0.01) : (_-1)*3.4 : exp;
] ;
tstack_r = component("tonestack.dsp");
tone_r = tstack_r[tse=tstack_r.ts.fender_default;
t = vslider("Treble_R[alias]", 0.5, 0, 1, 0.01);
m = vslider("Middle_R[alias]", 0.5, 0, 1, 0.01);
l = vslider("Bass_R[alias]", 0.5, 0, 1, 0.01) : (_-1)*3.4 : exp;
] ;
// Attempt bright switch - bypass high frequencies around gain control
// Important that this may only work up to 0dB
// Note tried to emulate actual circuit so cutoff frequency varies with volume pot
// In effect -3dB is when reactance of capacitor equals pot value
// use equation freq = 160/( gain * 0.12 ) yo get -3dB cutoff
// Assuming 1M pot and 120pF cap
// Must avoid div by fi.zero
// Seems to cause pros when gain less than 0.1
freq_l = 160/(0.12 * ( volume_l+0.1) );
bright_l = *(checkbox("bright_l")):fi.highpass( 1, freq_l ) ;
gain_l = _<:bright_l,*(volume_l):>_ ;
freq_r = 160/(0.12 * ( volume_r+0.1) );
bright_r = *(checkbox("bright_r")):fi.highpass( 1, freq_r ) ;
gain_r = _<:bright_r,*(volume_r):>_ ;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/gx_studiopre_st.dsp | faust | Yet another tube preamp experiment
So far so good :
Bright bypass must not do fi.zero division
Look at actual gain of tube stages in real preamp
and maybe adjust stage1 outpu to reflect as at present with gain at 0dB get very
little distortion/overload
Also look at relative loss in tonestack
stage1 gain is 30dB-35dB in reality
tonestack takes around 12dB off in central position
So stage1 effectively should boost by 18-23dB but in effect does only 3dB
So to accuratley model the overload of next stage would need a boost of around
15-20dB at this point x 5.6 -> x10
Would then need to attenuate final output to compensate ( actual preamp has 60dB gain! )
Based on simple Alembic F-2B vstudio preamp
2 sectionos of 12AX7 together with tonestack and volume
This is an identical circuit apart from coupling caps whcih could do with filters
1st cathode cap gives aroudn 2Hz !
Coupling cap sat end gives cutoff 1.6Hz!
So only reason to do is to eliminate low frequency rubbish
studiopre = stage1:*(10):tone:volume:*(0.1) with{
studiopre = volume with{
Gain 2.9 2nd -29.8 3rd -26.24
Gain 2.41 2nd -34.34 3rd -23.36
process =studiopre( tone_l,volume_l) with{
In actuall amp is Fender/marshall type B/M/T tone set
Look at adding tonestack in dsp.
Does not work for stereo as the slider are predefined
need to find a way of loadin 2
Attempt bright switch - bypass high frequencies around gain control
Important that this may only work up to 0dB
Note tried to emulate actual circuit so cutoff frequency varies with volume pot
In effect -3dB is when reactance of capacitor equals pot value
use equation freq = 160/( gain * 0.12 ) yo get -3dB cutoff
Assuming 1M pot and 120pF cap
Must avoid div by fi.zero
Seems to cause pros when gain less than 0.1 |
import("stdfaust.lib");
import("guitarix.lib");
studiopre( tone, gain ) = stage1:*(10):tone:gain:stage2 with{
};
process =studiopre( tone_l,gain_l),studiopre(tone_r, gain_r) with{
volume_l = vslider("Volume_L[alias][style:knob]",5,0,10,0.1)/10;
volume_r = vslider("Volume_R[alias][style:knob]",5,0,10,0.1)/10;
tstack_l = component("tonestack.dsp");
tone_l = tstack_l[tse=tstack_l.ts.fender_default;
t = vslider("Treble_L[alias]", 0.5, 0, 1, 0.01);
m = vslider("Middle_L[alias]", 0.5, 0, 1, 0.01);
l = vslider("Bass_L[alias]", 0.5, 0, 1, 0.01) : (_-1)*3.4 : exp;
] ;
tstack_r = component("tonestack.dsp");
tone_r = tstack_r[tse=tstack_r.ts.fender_default;
t = vslider("Treble_R[alias]", 0.5, 0, 1, 0.01);
m = vslider("Middle_R[alias]", 0.5, 0, 1, 0.01);
l = vslider("Bass_R[alias]", 0.5, 0, 1, 0.01) : (_-1)*3.4 : exp;
] ;
freq_l = 160/(0.12 * ( volume_l+0.1) );
bright_l = *(checkbox("bright_l")):fi.highpass( 1, freq_l ) ;
gain_l = _<:bright_l,*(volume_l):>_ ;
freq_r = 160/(0.12 * ( volume_r+0.1) );
bright_r = *(checkbox("bright_r")):fi.highpass( 1, freq_r ) ;
gain_r = _<:bright_r,*(volume_r):>_ ;
};
|
a0c3c7d5142645bee12614250414444df2b7e61f778622e0b7ec5ea3d0b8ec70 | ml-wo/VirtualGuitarAmp-Guitarix | mbreverb.dsp | declare id "mbe";
declare name "MultiBand Reverb";
declare shortname "MB Reverb";
declare category "Reverb";
declare description "Multi Band Reverb";
import("stdfaust.lib");
import("reducemaps.lib");
import("guitarix.lib");
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
envelop = abs : max ~ (1.0/ma.SR) : mean(4096) ; // : max(ba.db2linear(-70)) : ba.linear2db;
/*-----------------------------------------------
freeverb by "Grame"
-----------------------------------------------*/
c1 = vslider("RoomSize1", 0.5, 0, 1, 0.025)*0.28 + 0.7;
d1 = vslider("damp1",0.5, 0, 1, 0.025);
wet1 = vslider("wet_dry1[name:wet/dry]", 50, 0, 100, 1) : /(100);
dry1 = 1 - wet1;
c2 = vslider("RoomSize2", 0.5, 0, 1, 0.025)*0.28 + 0.7;
d2 = vslider("damp2",0.5, 0, 1, 0.025);
wet2 = vslider("wet_dry2[name:wet/dry]", 50, 0, 100, 1) : /(100);
dry2 = 1 - wet2;
c3 = vslider("RoomSize3", 0.5, 0, 1, 0.025)*0.28 + 0.7;
d3 = vslider("damp3",0.5, 0, 1, 0.025);
wet3 = vslider("wet_dry3[name:wet/dry]", 50, 0, 100, 1) : /(100);
dry3 = 1 - wet3;
c4 = vslider("RoomSize4", 0.5, 0, 1, 0.025)*0.28 + 0.7;
d4 = vslider("damp4",0.5, 0, 1, 0.025);
wet4 = vslider("wet_dry4[name:wet/dry]", 50, 0, 100, 1) : /(100);
dry4 = 1 - wet4;
c5 = vslider("RoomSize5", 0.5, 0, 1, 0.025)*0.28 + 0.7;
d5 = vslider("damp5",0.5, 0, 1, 0.025);
wet5 = vslider("wet_dry5[name:wet/dry]", 50, 0, 100, 1) : /(100);
dry5 = 1 - wet5;
// Filter Parameters
combtuningL1 = 1116;
combtuningL2 = 1188;
combtuningL3 = 1277;
combtuningL4 = 1356;
combtuningL5 = 1422;
combtuningL6 = 1491;
combtuningL7 = 1557;
combtuningL8 = 1617;
allpasstuningL1 = 556;
allpasstuningL2 = 441;
allpasstuningL3 = 341;
allpasstuningL4 = 225;
// Reverb components
monoReverb(fb1, fb2, damp, spread)
= _ <: comb(combtuningL1+spread, fb1, damp),
comb(combtuningL2+spread, fb1, damp),
comb(combtuningL3+spread, fb1, damp),
comb(combtuningL4+spread, fb1, damp),
comb(combtuningL5+spread, fb1, damp),
comb(combtuningL6+spread, fb1, damp),
comb(combtuningL7+spread, fb1, damp),
comb(combtuningL8+spread, fb1, damp)
+>
allpass (allpasstuningL1+spread, fb2)
: allpass (allpasstuningL2+spread, fb2)
: allpass (allpasstuningL3+spread, fb2)
: allpass (allpasstuningL4+spread, fb2)
;
//----------------------------------------------------------------
fxctrl(g,w,Fx) = _ <: (*(g) <: _ + Fx ), *(1-w) +> _;
reverb(dry, wet_dry, combfeed, dampslider) = _<:*(dry),(*(wet_dry):fxctrl(0.015,wet_dry, monoReverb(combfeed, 0.5, dampslider, 23))):>_;
process = geq: ( dist5s , dist4s , dist3s, dist2s, dist1s) :>_ with {
dist1s = reverb(dry1,wet1,c1,d1) : vmeter1 ;
dist2s = reverb(dry2,wet2,c2,d2) : vmeter2;
dist3s = reverb(dry3,wet3,c3,d3) : vmeter3;
dist4s = reverb(dry4,wet4,c4,d4) : vmeter4;
dist5s = reverb(dry5,wet5,c5,d5) : vmeter5;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/mbreverb.dsp | faust | : max(ba.db2linear(-70)) : ba.linear2db;
-----------------------------------------------
freeverb by "Grame"
-----------------------------------------------
Filter Parameters
Reverb components
---------------------------------------------------------------- | declare id "mbe";
declare name "MultiBand Reverb";
declare shortname "MB Reverb";
declare category "Reverb";
declare description "Multi Band Reverb";
import("stdfaust.lib");
import("reducemaps.lib");
import("guitarix.lib");
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
c1 = vslider("RoomSize1", 0.5, 0, 1, 0.025)*0.28 + 0.7;
d1 = vslider("damp1",0.5, 0, 1, 0.025);
wet1 = vslider("wet_dry1[name:wet/dry]", 50, 0, 100, 1) : /(100);
dry1 = 1 - wet1;
c2 = vslider("RoomSize2", 0.5, 0, 1, 0.025)*0.28 + 0.7;
d2 = vslider("damp2",0.5, 0, 1, 0.025);
wet2 = vslider("wet_dry2[name:wet/dry]", 50, 0, 100, 1) : /(100);
dry2 = 1 - wet2;
c3 = vslider("RoomSize3", 0.5, 0, 1, 0.025)*0.28 + 0.7;
d3 = vslider("damp3",0.5, 0, 1, 0.025);
wet3 = vslider("wet_dry3[name:wet/dry]", 50, 0, 100, 1) : /(100);
dry3 = 1 - wet3;
c4 = vslider("RoomSize4", 0.5, 0, 1, 0.025)*0.28 + 0.7;
d4 = vslider("damp4",0.5, 0, 1, 0.025);
wet4 = vslider("wet_dry4[name:wet/dry]", 50, 0, 100, 1) : /(100);
dry4 = 1 - wet4;
c5 = vslider("RoomSize5", 0.5, 0, 1, 0.025)*0.28 + 0.7;
d5 = vslider("damp5",0.5, 0, 1, 0.025);
wet5 = vslider("wet_dry5[name:wet/dry]", 50, 0, 100, 1) : /(100);
dry5 = 1 - wet5;
combtuningL1 = 1116;
combtuningL2 = 1188;
combtuningL3 = 1277;
combtuningL4 = 1356;
combtuningL5 = 1422;
combtuningL6 = 1491;
combtuningL7 = 1557;
combtuningL8 = 1617;
allpasstuningL1 = 556;
allpasstuningL2 = 441;
allpasstuningL3 = 341;
allpasstuningL4 = 225;
monoReverb(fb1, fb2, damp, spread)
= _ <: comb(combtuningL1+spread, fb1, damp),
comb(combtuningL2+spread, fb1, damp),
comb(combtuningL3+spread, fb1, damp),
comb(combtuningL4+spread, fb1, damp),
comb(combtuningL5+spread, fb1, damp),
comb(combtuningL6+spread, fb1, damp),
comb(combtuningL7+spread, fb1, damp),
comb(combtuningL8+spread, fb1, damp)
+>
allpass (allpasstuningL1+spread, fb2)
: allpass (allpasstuningL2+spread, fb2)
: allpass (allpasstuningL3+spread, fb2)
: allpass (allpasstuningL4+spread, fb2)
;
fxctrl(g,w,Fx) = _ <: (*(g) <: _ + Fx ), *(1-w) +> _;
reverb(dry, wet_dry, combfeed, dampslider) = _<:*(dry),(*(wet_dry):fxctrl(0.015,wet_dry, monoReverb(combfeed, 0.5, dampslider, 23))):>_;
process = geq: ( dist5s , dist4s , dist3s, dist2s, dist1s) :>_ with {
dist1s = reverb(dry1,wet1,c1,d1) : vmeter1 ;
dist2s = reverb(dry2,wet2,c2,d2) : vmeter2;
dist3s = reverb(dry3,wet3,c3,d3) : vmeter3;
dist4s = reverb(dry4,wet4,c4,d4) : vmeter4;
dist5s = reverb(dry5,wet5,c5,d5) : vmeter5;
};
|
162834ec5b9f91943d4090abf968cc8291822c03263ce8267f0fe9b848935b80 | ml-wo/VirtualGuitarAmp-Guitarix | cstb.dsp | // generated automatically
// DO NOT MODIFY!
declare id "cstb";
declare name "Colorsound Tone Blender";
declare category "Distortion";
declare shortname "CS Toneblender";
declare description "Colorsound Tone Blender";
import("stdfaust.lib");
import("trany.lib");
process = pre : _<:*(dry),(*(wet) : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0),(a1/a0,a2/a0,a3/a0,a4/a0)) : clip ):>_ with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
wet = vslider("wet_dry[name:wet/dry][tooltip:percentage of processed signal in output signal]", 100, 0, 100, 1) : /(100) : si.smooth(s);
dry = 1 - wet;
clip = tranystage(TB_KT88_68k,86.0,2700.0,5.562895) : tranystage(TB_KT88_68k,86.0,2700.0,5.562895) ;
//clip(x) = 0.3 * (min(0.7514,max(-0.4514,x)));
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Attack = vslider("Attack[name:Attack]", 0.5, 0, 0.95, 0.01) : Inverted(0) : si.smooth(s);
b0 = Attack*(Attack*(2.34677954600673e-19*Level*pow(fs,4) + 2.34677954600673e-22*pow(fs,4)) - 2.35728909376724e-17*Level*pow(fs,4) - 2.35728909376724e-20*pow(fs,4)) - 2.50775435507154e-15*Level*pow(fs,3) - 2.50775435507154e-18*pow(fs,3);
b1 = Attack*(Attack*(-9.38711818402692e-19*Level*pow(fs,4) - 9.38711818402692e-22*pow(fs,4)) + 9.42915637506898e-17*Level*pow(fs,4) + 9.42915637506898e-20*pow(fs,4)) + 5.01550871014307e-15*Level*pow(fs,3) + 5.01550871014307e-18*pow(fs,3);
b2 = Attack*(Attack*(1.40806772760404e-18*Level*pow(fs,4) + 1.40806772760404e-21*pow(fs,4)) - 1.41437345626035e-16*Level*pow(fs,4) - 1.41437345626035e-19*pow(fs,4));
b3 = Attack*(Attack*(-9.38711818402692e-19*Level*pow(fs,4) - 9.38711818402692e-22*pow(fs,4)) + 9.42915637506898e-17*Level*pow(fs,4) + 9.42915637506898e-20*pow(fs,4)) - 5.01550871014307e-15*Level*pow(fs,3) - 5.01550871014307e-18*pow(fs,3);
b4 = Attack*(Attack*(2.34677954600673e-19*Level*pow(fs,4) + 2.34677954600673e-22*pow(fs,4)) - 2.35728909376724e-17*Level*pow(fs,4) - 2.35728909376724e-20*pow(fs,4)) + 2.50775435507154e-15*Level*pow(fs,3) + 2.50775435507154e-18*pow(fs,3);
a0 = Attack*(Attack*fs*(fs*(fs*(-7.13788307669893e-19*fs - 3.81274375281155e-16) - 1.78337596435683e-14) - 3.57720562427687e-14) + fs*(fs*(fs*(7.26395344169953e-19*fs + 3.82634300978431e-16) + 1.78716714442828e-14) + 3.58457860428614e-14)) + fs*(fs*(7.72761004436121e-17*fs + 4.0705776699833e-14) + 1.90124164300881e-12) + 3.81338149392143e-12;
a1 = Attack*(Attack*fs*(pow(fs,2)*(2.85515323067957e-18*fs + 7.6254875056231e-16) - 7.15441124855374e-14) + fs*(pow(fs,2)*(-2.90558137667981e-18*fs - 7.65268601956861e-16) + 7.16915720857228e-14)) + fs*(-1.54552200887224e-16*pow(fs,2) + 3.80248328601762e-12) + 1.52535259756857e-11;
a2 = Attack*(Attack*pow(fs,2)*(-4.28272984601936e-18*pow(fs,2) + 3.56675192871367e-14) + pow(fs,2)*(4.35837206501972e-18*pow(fs,2) - 3.57433428885656e-14)) - 8.14115533996661e-14*pow(fs,2) + 2.28802889635286e-11;
a3 = Attack*(Attack*fs*(pow(fs,2)*(2.85515323067957e-18*fs - 7.6254875056231e-16) + 7.15441124855374e-14) + fs*(pow(fs,2)*(-2.90558137667981e-18*fs + 7.65268601956861e-16) - 7.16915720857228e-14)) + fs*(1.54552200887224e-16*pow(fs,2) - 3.80248328601762e-12) + 1.52535259756857e-11;
a4 = Attack*(Attack*fs*(fs*(fs*(-7.13788307669893e-19*fs + 3.81274375281155e-16) - 1.78337596435683e-14) + 3.57720562427687e-14) + fs*(fs*(fs*(7.26395344169953e-19*fs - 3.82634300978431e-16) + 1.78716714442828e-14) - 3.58457860428614e-14)) + fs*(fs*(-7.72761004436121e-17*fs + 4.0705776699833e-14) - 1.90124164300881e-12) + 3.81338149392143e-12;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/cstb.dsp | faust | generated automatically
DO NOT MODIFY!
clip(x) = 0.3 * (min(0.7514,max(-0.4514,x))); | declare id "cstb";
declare name "Colorsound Tone Blender";
declare category "Distortion";
declare shortname "CS Toneblender";
declare description "Colorsound Tone Blender";
import("stdfaust.lib");
import("trany.lib");
process = pre : _<:*(dry),(*(wet) : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0),(a1/a0,a2/a0,a3/a0,a4/a0)) : clip ):>_ with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
wet = vslider("wet_dry[name:wet/dry][tooltip:percentage of processed signal in output signal]", 100, 0, 100, 1) : /(100) : si.smooth(s);
dry = 1 - wet;
clip = tranystage(TB_KT88_68k,86.0,2700.0,5.562895) : tranystage(TB_KT88_68k,86.0,2700.0,5.562895) ;
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Attack = vslider("Attack[name:Attack]", 0.5, 0, 0.95, 0.01) : Inverted(0) : si.smooth(s);
b0 = Attack*(Attack*(2.34677954600673e-19*Level*pow(fs,4) + 2.34677954600673e-22*pow(fs,4)) - 2.35728909376724e-17*Level*pow(fs,4) - 2.35728909376724e-20*pow(fs,4)) - 2.50775435507154e-15*Level*pow(fs,3) - 2.50775435507154e-18*pow(fs,3);
b1 = Attack*(Attack*(-9.38711818402692e-19*Level*pow(fs,4) - 9.38711818402692e-22*pow(fs,4)) + 9.42915637506898e-17*Level*pow(fs,4) + 9.42915637506898e-20*pow(fs,4)) + 5.01550871014307e-15*Level*pow(fs,3) + 5.01550871014307e-18*pow(fs,3);
b2 = Attack*(Attack*(1.40806772760404e-18*Level*pow(fs,4) + 1.40806772760404e-21*pow(fs,4)) - 1.41437345626035e-16*Level*pow(fs,4) - 1.41437345626035e-19*pow(fs,4));
b3 = Attack*(Attack*(-9.38711818402692e-19*Level*pow(fs,4) - 9.38711818402692e-22*pow(fs,4)) + 9.42915637506898e-17*Level*pow(fs,4) + 9.42915637506898e-20*pow(fs,4)) - 5.01550871014307e-15*Level*pow(fs,3) - 5.01550871014307e-18*pow(fs,3);
b4 = Attack*(Attack*(2.34677954600673e-19*Level*pow(fs,4) + 2.34677954600673e-22*pow(fs,4)) - 2.35728909376724e-17*Level*pow(fs,4) - 2.35728909376724e-20*pow(fs,4)) + 2.50775435507154e-15*Level*pow(fs,3) + 2.50775435507154e-18*pow(fs,3);
a0 = Attack*(Attack*fs*(fs*(fs*(-7.13788307669893e-19*fs - 3.81274375281155e-16) - 1.78337596435683e-14) - 3.57720562427687e-14) + fs*(fs*(fs*(7.26395344169953e-19*fs + 3.82634300978431e-16) + 1.78716714442828e-14) + 3.58457860428614e-14)) + fs*(fs*(7.72761004436121e-17*fs + 4.0705776699833e-14) + 1.90124164300881e-12) + 3.81338149392143e-12;
a1 = Attack*(Attack*fs*(pow(fs,2)*(2.85515323067957e-18*fs + 7.6254875056231e-16) - 7.15441124855374e-14) + fs*(pow(fs,2)*(-2.90558137667981e-18*fs - 7.65268601956861e-16) + 7.16915720857228e-14)) + fs*(-1.54552200887224e-16*pow(fs,2) + 3.80248328601762e-12) + 1.52535259756857e-11;
a2 = Attack*(Attack*pow(fs,2)*(-4.28272984601936e-18*pow(fs,2) + 3.56675192871367e-14) + pow(fs,2)*(4.35837206501972e-18*pow(fs,2) - 3.57433428885656e-14)) - 8.14115533996661e-14*pow(fs,2) + 2.28802889635286e-11;
a3 = Attack*(Attack*fs*(pow(fs,2)*(2.85515323067957e-18*fs - 7.6254875056231e-16) + 7.15441124855374e-14) + fs*(pow(fs,2)*(-2.90558137667981e-18*fs + 7.65268601956861e-16) - 7.16915720857228e-14)) + fs*(1.54552200887224e-16*pow(fs,2) - 3.80248328601762e-12) + 1.52535259756857e-11;
a4 = Attack*(Attack*fs*(fs*(fs*(-7.13788307669893e-19*fs + 3.81274375281155e-16) - 1.78337596435683e-14) + 3.57720562427687e-14) + fs*(fs*(fs*(7.26395344169953e-19*fs - 3.82634300978431e-16) + 1.78716714442828e-14) - 3.58457860428614e-14)) + fs*(fs*(-7.72761004436121e-17*fs + 4.0705776699833e-14) - 1.90124164300881e-12) + 3.81338149392143e-12;
};
|
154dc822a99d0b0e5182de72d9684cf8ba95a4e75cf8dd5122bd51c130156dbf | ml-wo/VirtualGuitarAmp-Guitarix | tonecontroll.dsp | declare id "tonemodul";
declare name "3 Band EQ";
declare category "Tone Control";
declare version "0.01";
declare author "brummer";
declare license "BSD";
declare copyright "(c)brummer 2008";
import("stdfaust.lib");
import("guitarix.lib");
F = 600; //nentry("split_low_freq", 250, 20, 600, 10);
F1 = 1200; //nentry("split_middle_freq", 650, 600, 1250, 10);
F2 = 2400; //nentry("split_high_freq", 1250, 1250, 12000, 10);
/**********************************************************************
*** this part is included here for backward compatibility from 0.9.27 to
*** 0.9.24
***********************************************************************/
//------------------------------ ba.count and ba.take --------------------------------------
countN ((xs, xxs)) = 1 + countN(xxs);
countN (xx) = 1;
takeN (1, (xs, xxs)) = xs;
takeN (1, xs) = xs;
takeN (nn, (xs, xxs)) = takeN (nn-1, xxs);
//------------------------------ low/high-passfilters --------------------------------------
tf1N(b0,b1,a1) = _ <: *(b0), (mem : *(b1)) :> + ~ *(0-a1);
tf2N(b0,b1,b2,a1,a2) = sub ~ conv2(a1,a2) : conv3(b0,b1,b2)
with {
conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x'';
conv2(k0,k1,x) = k0*x + k1*x';
sub(x,y) = y-x;
};
tf1sN(b1,b0,a0,w1) = tf1N(b0d,b1d,a1d)
with {
c = 1/tan((w1)*0.5/ma.SR); // bilinear-transform scale-factor
d = a0 + c;
b1d = (b0 - b1*c) / d;
b0d = (b0 + b1*c) / d;
a1d = (a0 - c) / d;
};
tf2sN(b2,b1,b0,a1,a0,w1) = tf2N(b0d,b1d,b2d,a1d,a2d)
with {
c = 1/tan((w1)*0.5/ma.SR); // bilinear-transform scale-factor
csq = c*c;
d = a0 + a1 * c + csq;
b0d = (b0 + b1 * c + b2 * csq)/d;
b1d = 2 * (b0 - b2 * csq)/d;
b2d = (b0 - b1 * c + b2 * csq)/d;
a1d = 2 * (a0 - csq)/d;
a2d = (a0 - a1*c + csq)/d;
};
lowpassN(N,fc) = lowpass0_highpass1N(0,N,fc);
highpassN(N,fc) = lowpass0_highpass1N(1,N,fc);
lowpass0_highpass1N(s,N,fc) = lphpr(s,N,N,fc)
with {
lphpr(s,0,N,fc) = _;
lphpr(s,1,N,fc) = tf1sN(s,1-s,1,2*ma.PI*fc);
lphpr(s,O,N,fc) = lphpr(s,(O-2),N,fc) : tf2sN(s,0,1-s,a1s,1,w1) with {
parity = N % 2;
S = (O-parity)/2; // current section number
a1s = -2*cos(-ma.PI + (1-parity)*ma.PI/(2*N) + (S-1+parity)*ma.PI/N);
w1 = 2*ma.PI*fc;
};
};
//------------------------------ an.analyzer --------------------------------------
analyzern(O,lfreqs) = _ <: bsplit(nb) with
{
nb = countN(lfreqs);
fc(n) = takeN(n, lfreqs);
lp(n) = lowpassN(O,fc(n));
hp(n) = highpassN(O,fc(n));
bsplit(0) = _;
bsplit(i) = hp(i), (lp(i) <: bsplit(i-1));
};
analyzerN(lfreqs) = analyzern(3,lfreqs);
filterbankn(O,lfreqs) = analyzern(O,lfreqs) : delayeq with
{
nb = ba.count(lfreqs);
fc(n) = ba.take(n, lfreqs);
ap(n) = fi.highpass_plus_lowpass(O,fc(n));
delayeq = par(i,nb-1,apchain(nb-1-i)),_,_;
apchain(0) = _;
apchain(i) = ap(i) : apchain(i-1);
};
filterbankN(lfreqs) = fi.filterbank(3,lfreqs);
/**********************************************************************
*** end for backward compatibility from 0.9.27 to
*** 0.9.24 , it could removed when switch completly to > 0.9.27
***********************************************************************/
//----------tone_controll---------
t = vslider("Treble", 0., -5., 5, 0.01): ba.db2linear : smoothi(0.999);
m = vslider("Middle", 0., -5., 5, 0.01): ba.db2linear : smoothi(0.999);
l = vslider("Bass", 0., -5., 5, 0.01): ba.db2linear : smoothi(0.999) ;
//tstack = component("tonestack.dsp");
sharp = vslider("sharper[name:sharper]", -2, -2.5, 5, 0.1);
press = -5. * sharp;
attack = 0.005;
release = 5.0;
knee = 10.5;
ratio = 3.0;
env = abs : max(1);
compress(env) = level * (1-r)/r
with {
level = env : h ~ _ : ba.linear2db : (_ - press ) : max(0)
with {
h(x,y) = f*x+(1-f)*y with { f = (x<y)*ga+(x>=y)*gr; };
ga = exp(-1/(ma.SR*attack));
gr = exp(-1/(ma.SR*release));
};
p = level/(knee+eps) : max(0) : min(1) with { eps = 0.001; };
r = 1 - p + p * ratio;
};
comp1(x) = g(x) * x
with {
g = env : compress + sharp : ba.db2linear;
};
comp = BP( comp1);
tone_controll = _ : filterbankN((F,F2)): *(t),*(m),*(l):>_;
process = (tone_controll : comp) ,(tone_controll : comp);
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/tonecontroll.dsp | faust | nentry("split_low_freq", 250, 20, 600, 10);
nentry("split_middle_freq", 650, 600, 1250, 10);
nentry("split_high_freq", 1250, 1250, 12000, 10);
*********************************************************************
*** this part is included here for backward compatibility from 0.9.27 to
*** 0.9.24
**********************************************************************
------------------------------ ba.count and ba.take --------------------------------------
------------------------------ low/high-passfilters --------------------------------------
bilinear-transform scale-factor
bilinear-transform scale-factor
current section number
------------------------------ an.analyzer --------------------------------------
*********************************************************************
*** end for backward compatibility from 0.9.27 to
*** 0.9.24 , it could removed when switch completly to > 0.9.27
**********************************************************************
----------tone_controll---------
tstack = component("tonestack.dsp"); | declare id "tonemodul";
declare name "3 Band EQ";
declare category "Tone Control";
declare version "0.01";
declare author "brummer";
declare license "BSD";
declare copyright "(c)brummer 2008";
import("stdfaust.lib");
import("guitarix.lib");
countN ((xs, xxs)) = 1 + countN(xxs);
countN (xx) = 1;
takeN (1, (xs, xxs)) = xs;
takeN (1, xs) = xs;
takeN (nn, (xs, xxs)) = takeN (nn-1, xxs);
tf1N(b0,b1,a1) = _ <: *(b0), (mem : *(b1)) :> + ~ *(0-a1);
tf2N(b0,b1,b2,a1,a2) = sub ~ conv2(a1,a2) : conv3(b0,b1,b2)
with {
conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x'';
conv2(k0,k1,x) = k0*x + k1*x';
sub(x,y) = y-x;
};
tf1sN(b1,b0,a0,w1) = tf1N(b0d,b1d,a1d)
with {
d = a0 + c;
b1d = (b0 - b1*c) / d;
b0d = (b0 + b1*c) / d;
a1d = (a0 - c) / d;
};
tf2sN(b2,b1,b0,a1,a0,w1) = tf2N(b0d,b1d,b2d,a1d,a2d)
with {
csq = c*c;
d = a0 + a1 * c + csq;
b0d = (b0 + b1 * c + b2 * csq)/d;
b1d = 2 * (b0 - b2 * csq)/d;
b2d = (b0 - b1 * c + b2 * csq)/d;
a1d = 2 * (a0 - csq)/d;
a2d = (a0 - a1*c + csq)/d;
};
lowpassN(N,fc) = lowpass0_highpass1N(0,N,fc);
highpassN(N,fc) = lowpass0_highpass1N(1,N,fc);
lowpass0_highpass1N(s,N,fc) = lphpr(s,N,N,fc)
with {
lphpr(s,0,N,fc) = _;
lphpr(s,1,N,fc) = tf1sN(s,1-s,1,2*ma.PI*fc);
lphpr(s,O,N,fc) = lphpr(s,(O-2),N,fc) : tf2sN(s,0,1-s,a1s,1,w1) with {
parity = N % 2;
a1s = -2*cos(-ma.PI + (1-parity)*ma.PI/(2*N) + (S-1+parity)*ma.PI/N);
w1 = 2*ma.PI*fc;
};
};
analyzern(O,lfreqs) = _ <: bsplit(nb) with
{
nb = countN(lfreqs);
fc(n) = takeN(n, lfreqs);
lp(n) = lowpassN(O,fc(n));
hp(n) = highpassN(O,fc(n));
bsplit(0) = _;
bsplit(i) = hp(i), (lp(i) <: bsplit(i-1));
};
analyzerN(lfreqs) = analyzern(3,lfreqs);
filterbankn(O,lfreqs) = analyzern(O,lfreqs) : delayeq with
{
nb = ba.count(lfreqs);
fc(n) = ba.take(n, lfreqs);
ap(n) = fi.highpass_plus_lowpass(O,fc(n));
delayeq = par(i,nb-1,apchain(nb-1-i)),_,_;
apchain(0) = _;
apchain(i) = ap(i) : apchain(i-1);
};
filterbankN(lfreqs) = fi.filterbank(3,lfreqs);
t = vslider("Treble", 0., -5., 5, 0.01): ba.db2linear : smoothi(0.999);
m = vslider("Middle", 0., -5., 5, 0.01): ba.db2linear : smoothi(0.999);
l = vslider("Bass", 0., -5., 5, 0.01): ba.db2linear : smoothi(0.999) ;
sharp = vslider("sharper[name:sharper]", -2, -2.5, 5, 0.1);
press = -5. * sharp;
attack = 0.005;
release = 5.0;
knee = 10.5;
ratio = 3.0;
env = abs : max(1);
compress(env) = level * (1-r)/r
with {
level = env : h ~ _ : ba.linear2db : (_ - press ) : max(0)
with {
h(x,y) = f*x+(1-f)*y with { f = (x<y)*ga+(x>=y)*gr; };
ga = exp(-1/(ma.SR*attack));
gr = exp(-1/(ma.SR*release));
};
p = level/(knee+eps) : max(0) : min(1) with { eps = 0.001; };
r = 1 - p + p * ratio;
};
comp1(x) = g(x) * x
with {
g = env : compress + sharp : ba.db2linear;
};
comp = BP( comp1);
tone_controll = _ : filterbankN((F,F2)): *(t),*(m),*(l):>_;
process = (tone_controll : comp) ,(tone_controll : comp);
|
8a5e6af2d6fbe88a90314bfc6ad06082925d1471f853d790211abafd7a6a0ddc | ml-wo/VirtualGuitarAmp-Guitarix | bfuzz.dsp | // generated automatically
// DO NOT MODIFY!
declare id "bfuzz";
declare name "Bass Fuzz Pedal";
declare category "Fuzz";
declare shortname "Bass Fuzz";
declare description "Bass Fuzz Pedal";
import("stdfaust.lib");
import("trany.lib");
process = pre : _<:*(dry),(*(wet) : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0),(a1/a0,a2/a0,a3/a0,a4/a0)) : clip):>_ with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
wet = vslider("wet_dry[name:Wet/Dry][tooltip:percentage of processed signal in output signal]", 100, 0, 100, 1) : /(100);
dry = 1 - wet;
clip = tranystageb(TB_7199P_68k,86.0,2700.0,5.571981) : tranystageb(TB_7199P_68k,86.0,2700.0,5.571981) ;
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Drive = vslider("Drive[name:Drive]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Thickness = vslider("Thickness[name:Thickness]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = Drive*Level*pow(fs,2)*(-1.65780932898435e-16*fs - 8.29281439339673e-13) + Level*pow(fs,2)*(-7.76911913609341e-14*fs - 3.88632527694127e-10) + Thickness*(1.65780932898435e-16*Drive*Level*pow(fs,3) + 7.76911913609341e-14*Level*pow(fs,3));
b1 = 3.3156186579687e-16*Drive*Level*pow(fs,3) + 1.55382382721868e-13*Level*pow(fs,3) + Thickness*(-3.3156186579687e-16*Drive*Level*pow(fs,3) - 1.55382382721868e-13*Level*pow(fs,3));
b2 = 1.65856287867935e-12*Drive*Level*pow(fs,2) + 7.77265055388254e-10*Level*pow(fs,2);
b3 = -3.3156186579687e-16*Drive*Level*pow(fs,3) - 1.55382382721868e-13*Level*pow(fs,3) + Thickness*(3.3156186579687e-16*Drive*Level*pow(fs,3) + 1.55382382721868e-13*Level*pow(fs,3));
b4 = Drive*Level*pow(fs,2)*(1.65780932898435e-16*fs - 8.29281439339673e-13) + Level*pow(fs,2)*(7.76911913609341e-14*fs - 3.88632527694127e-10) + Thickness*(-1.65780932898435e-16*Drive*Level*pow(fs,3) - 7.76911913609341e-14*Level*pow(fs,3));
a0 = Drive*(fs*(fs*(fs*(-1.8235902618655e-20*fs - 8.82979918090661e-15) - 5.32286268006641e-11) - 2.42569918771087e-9) - 9.41937118747331e-10) + Thickness*(Drive*fs*(fs*(fs*(1.8235902618655e-20*fs + 8.73857822258011e-15) + 9.51587528271067e-12) + 4.14452332248826e-10) + fs*(fs*(fs*(-1.90624114055858e-19*fs - 9.05150991318089e-15) - 9.57238853136628e-11) - 4.70914107604798e-9)) + fs*(fs*(fs*(1.90624114055858e-19*fs + 1.0005063720083e-14) + 1.41002006493022e-10) + 6.98583678876617e-9) + 1.07025933546545e-8;
a1 = Drive*(fs*(pow(fs,2)*(7.294361047462e-20*fs + 1.76595983618132e-14) - 4.85139837542174e-9) - 3.76774847498933e-9) + Thickness*(Drive*fs*(pow(fs,2)*(-7.294361047462e-20*fs - 1.74771564451602e-14) + 8.28904664497652e-10) + fs*(pow(fs,2)*(7.6249645622343e-19*fs + 1.81030198263618e-14) - 9.41828215209595e-9)) + fs*(pow(fs,2)*(-7.6249645622343e-19*fs - 2.00101274401661e-14) + 1.39716735775323e-8) + 4.2810373418618e-8;
a2 = Drive*(pow(fs,2)*(-1.0941541571193e-19*pow(fs,2) + 1.06457253601328e-10) - 5.65162271248399e-9) + Thickness*(Drive*pow(fs,2)*(1.0941541571193e-19*pow(fs,2) - 1.90317505654213e-11) + pow(fs,2)*(-1.14374468433515e-18*pow(fs,2) + 1.91447770627326e-10)) + pow(fs,2)*(1.14374468433515e-18*pow(fs,2) - 2.82004012986045e-10) + 6.4215560127927e-8;
a3 = Drive*(fs*(pow(fs,2)*(7.294361047462e-20*fs - 1.76595983618132e-14) + 4.85139837542174e-9) - 3.76774847498933e-9) + Thickness*(Drive*fs*(pow(fs,2)*(-7.294361047462e-20*fs + 1.74771564451602e-14) - 8.28904664497652e-10) + fs*(pow(fs,2)*(7.6249645622343e-19*fs - 1.81030198263618e-14) + 9.41828215209595e-9)) + fs*(pow(fs,2)*(-7.6249645622343e-19*fs + 2.00101274401661e-14) - 1.39716735775323e-8) + 4.2810373418618e-8;
a4 = Drive*(fs*(fs*(fs*(-1.8235902618655e-20*fs + 8.82979918090661e-15) - 5.32286268006641e-11) + 2.42569918771087e-9) - 9.41937118747331e-10) + Thickness*(Drive*fs*(fs*(fs*(1.8235902618655e-20*fs - 8.73857822258011e-15) + 9.51587528271067e-12) - 4.14452332248826e-10) + fs*(fs*(fs*(-1.90624114055858e-19*fs + 9.05150991318089e-15) - 9.57238853136628e-11) + 4.70914107604798e-9)) + fs*(fs*(fs*(1.90624114055858e-19*fs - 1.0005063720083e-14) + 1.41002006493022e-10) - 6.98583678876617e-9) + 1.07025933546545e-8;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/plugins/bfuzz.dsp | faust | generated automatically
DO NOT MODIFY! | declare id "bfuzz";
declare name "Bass Fuzz Pedal";
declare category "Fuzz";
declare shortname "Bass Fuzz";
declare description "Bass Fuzz Pedal";
import("stdfaust.lib");
import("trany.lib");
process = pre : _<:*(dry),(*(wet) : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0),(a1/a0,a2/a0,a3/a0,a4/a0)) : clip):>_ with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
wet = vslider("wet_dry[name:Wet/Dry][tooltip:percentage of processed signal in output signal]", 100, 0, 100, 1) : /(100);
dry = 1 - wet;
clip = tranystageb(TB_7199P_68k,86.0,2700.0,5.571981) : tranystageb(TB_7199P_68k,86.0,2700.0,5.571981) ;
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Drive = vslider("Drive[name:Drive]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Thickness = vslider("Thickness[name:Thickness]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = Drive*Level*pow(fs,2)*(-1.65780932898435e-16*fs - 8.29281439339673e-13) + Level*pow(fs,2)*(-7.76911913609341e-14*fs - 3.88632527694127e-10) + Thickness*(1.65780932898435e-16*Drive*Level*pow(fs,3) + 7.76911913609341e-14*Level*pow(fs,3));
b1 = 3.3156186579687e-16*Drive*Level*pow(fs,3) + 1.55382382721868e-13*Level*pow(fs,3) + Thickness*(-3.3156186579687e-16*Drive*Level*pow(fs,3) - 1.55382382721868e-13*Level*pow(fs,3));
b2 = 1.65856287867935e-12*Drive*Level*pow(fs,2) + 7.77265055388254e-10*Level*pow(fs,2);
b3 = -3.3156186579687e-16*Drive*Level*pow(fs,3) - 1.55382382721868e-13*Level*pow(fs,3) + Thickness*(3.3156186579687e-16*Drive*Level*pow(fs,3) + 1.55382382721868e-13*Level*pow(fs,3));
b4 = Drive*Level*pow(fs,2)*(1.65780932898435e-16*fs - 8.29281439339673e-13) + Level*pow(fs,2)*(7.76911913609341e-14*fs - 3.88632527694127e-10) + Thickness*(-1.65780932898435e-16*Drive*Level*pow(fs,3) - 7.76911913609341e-14*Level*pow(fs,3));
a0 = Drive*(fs*(fs*(fs*(-1.8235902618655e-20*fs - 8.82979918090661e-15) - 5.32286268006641e-11) - 2.42569918771087e-9) - 9.41937118747331e-10) + Thickness*(Drive*fs*(fs*(fs*(1.8235902618655e-20*fs + 8.73857822258011e-15) + 9.51587528271067e-12) + 4.14452332248826e-10) + fs*(fs*(fs*(-1.90624114055858e-19*fs - 9.05150991318089e-15) - 9.57238853136628e-11) - 4.70914107604798e-9)) + fs*(fs*(fs*(1.90624114055858e-19*fs + 1.0005063720083e-14) + 1.41002006493022e-10) + 6.98583678876617e-9) + 1.07025933546545e-8;
a1 = Drive*(fs*(pow(fs,2)*(7.294361047462e-20*fs + 1.76595983618132e-14) - 4.85139837542174e-9) - 3.76774847498933e-9) + Thickness*(Drive*fs*(pow(fs,2)*(-7.294361047462e-20*fs - 1.74771564451602e-14) + 8.28904664497652e-10) + fs*(pow(fs,2)*(7.6249645622343e-19*fs + 1.81030198263618e-14) - 9.41828215209595e-9)) + fs*(pow(fs,2)*(-7.6249645622343e-19*fs - 2.00101274401661e-14) + 1.39716735775323e-8) + 4.2810373418618e-8;
a2 = Drive*(pow(fs,2)*(-1.0941541571193e-19*pow(fs,2) + 1.06457253601328e-10) - 5.65162271248399e-9) + Thickness*(Drive*pow(fs,2)*(1.0941541571193e-19*pow(fs,2) - 1.90317505654213e-11) + pow(fs,2)*(-1.14374468433515e-18*pow(fs,2) + 1.91447770627326e-10)) + pow(fs,2)*(1.14374468433515e-18*pow(fs,2) - 2.82004012986045e-10) + 6.4215560127927e-8;
a3 = Drive*(fs*(pow(fs,2)*(7.294361047462e-20*fs - 1.76595983618132e-14) + 4.85139837542174e-9) - 3.76774847498933e-9) + Thickness*(Drive*fs*(pow(fs,2)*(-7.294361047462e-20*fs + 1.74771564451602e-14) - 8.28904664497652e-10) + fs*(pow(fs,2)*(7.6249645622343e-19*fs - 1.81030198263618e-14) + 9.41828215209595e-9)) + fs*(pow(fs,2)*(-7.6249645622343e-19*fs + 2.00101274401661e-14) - 1.39716735775323e-8) + 4.2810373418618e-8;
a4 = Drive*(fs*(fs*(fs*(-1.8235902618655e-20*fs + 8.82979918090661e-15) - 5.32286268006641e-11) + 2.42569918771087e-9) - 9.41937118747331e-10) + Thickness*(Drive*fs*(fs*(fs*(1.8235902618655e-20*fs - 8.73857822258011e-15) + 9.51587528271067e-12) - 4.14452332248826e-10) + fs*(fs*(fs*(-1.90624114055858e-19*fs + 9.05150991318089e-15) - 9.57238853136628e-11) + 4.70914107604798e-9)) + fs*(fs*(fs*(1.90624114055858e-19*fs - 1.0005063720083e-14) + 1.41002006493022e-10) - 6.98583678876617e-9) + 1.07025933546545e-8;
};
|
6bc90925fc7c7432e2ad6765fa0abcd514e93b8455c9f68d54ab3164691da213 | ml-wo/VirtualGuitarAmp-Guitarix | gxechocat.dsp | declare name "Tape Delay";
declare category "Echo / Delay";
import("stdfaust.lib");
import("guitarix.lib");
import("redeye.lib");
/*
HEAD SPACING
I have lold Selmer unit where playback heads are 1.5 inches apart
and record head is 1.8 inches from last playback so :
record - play4 - play 3 - play 2 - play 1
1.8 - 1.5 - 1.5 - 1.5 - 1.5
Se we have record -1.8inches - head1, 2.3 to head2, 3.8 to head3 5.3 to head 4 !
Or at 15ips head1 120ms head2 220ms head3 320ms head4 420ms
According to what I have read the heads are not parallel but output from each one is fed into next ??? What ??? Also max de.delay from one head is 425ms
Apparently originsl units has 23 inch tapes!
Actual topology
In -> stage1 -> pentode driver for record head ->play heads -> 2stage valve amp ->mixer->out and feedback to pentode
Sounds OK maybe too much bandwidth loss try cleaner path
Look ay adding soft clip before machine to simulate saturation
Frequency response of tape in copicat would be poor due to design and use
Tape usually has steep low end frop with a hump and not quite so steep high drop, maybe as for guitar we can lower this but would guess that should start around
40 - 80Hz steep fi.highpass with possible hump ( ? resonant filter )
5- 6k fi.lowpass
Am concerned that as each valve stage already has same lowapss filter that this
may have same effect as in real amp of creating a resonance an will try same solution : stagger filters and identify dominant one ( biggest effect ) and slug it or drastically reduce it.
*/
// So we need multiple de.delay heads
// Each head can be bypassed or moved to alter de.delay time
// so tape speed in inches per second
// distance from record head in inches
// thus we get de.delay in milliseconds
//speed = 7.5 ;
bpm = hgroup( "Echo", vslider("BPM[style:knob]", 120, 24, 360, 0.1)) ;
// The wow should be preset by experiment...
// Lets introduce just a little
sine(freq) = (os.oscs(freq) + 1) / 2 : max(0); // max(0) because of numerical inaccuracy
freq= 4 ; // 4Hz
depth = 0.005 ; // Play with this
wow = sine( freq) * depth ;
speed = ( 72/(2*bpm)) ;
tapespeed = hgroup( "Tape Control",speed + wow );
echo = hgroup( "Echo", vslider("Swell[style:knob]", 0, 0, 1, 0.01)) ;
feedback = hgroup( "Echo", vslider("Sustain[style:knob]", 0, 0.0, 0.95, 0.01));
dtime1 = ma.SR*( 60/bpm) ;
dtime2 = ma.SR*( 120/ bpm) ;
dtime3 = ma.SR*( 180/bpm ) ;
dtime4 = ma.SR*( 240/bpm ) ;
head1 = de.sdelay(N, interp, dtime1):*(checkbox("Head1")) with {
interp = ma.SR/10.0; // 100*SER/1000
N = int( 2^19 ) ;
};
head2 = de.sdelay(N, interp, dtime2):*(checkbox("Head2")) with {
interp = 100*ma.SR/1000.0;
N = int( 2^19 ) ;
};
head3 = de.sdelay(N, interp, dtime3):*(checkbox("Head3")) with {
interp = 100*ma.SR/1000.0;
N = int( 2^19 ) ;
};
head4 = de.sdelay(N, interp, dtime4):*(checkbox("Head4")) with {
interp = 100*ma.SR/1000.0;
N = int( 2^19 ) ;
};
// IN real machine the ECHO level control is after the last 2 stages of valves
machine = vgroup( "Tape Heads", fi.highpass( 4, 40 )<:head1,head2,head3:>fi.lowpass( 1, 6500 ):fi.dcblocker:*(echo) );
fbloop = fi.lowpass( 1, 7500 ):*(feedback):*(0.5):fi.highpass( 1, 125 ) ;
process = input12au7<:_,(+:_<:machine :>_)~fbloop:>output12au7:*(0.1) ;
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/gxechocat.dsp | faust |
HEAD SPACING
I have lold Selmer unit where playback heads are 1.5 inches apart
and record head is 1.8 inches from last playback so :
record - play4 - play 3 - play 2 - play 1
1.8 - 1.5 - 1.5 - 1.5 - 1.5
Se we have record -1.8inches - head1, 2.3 to head2, 3.8 to head3 5.3 to head 4 !
Or at 15ips head1 120ms head2 220ms head3 320ms head4 420ms
According to what I have read the heads are not parallel but output from each one is fed into next ??? What ??? Also max de.delay from one head is 425ms
Apparently originsl units has 23 inch tapes!
Actual topology
In -> stage1 -> pentode driver for record head ->play heads -> 2stage valve amp ->mixer->out and feedback to pentode
Sounds OK maybe too much bandwidth loss try cleaner path
Look ay adding soft clip before machine to simulate saturation
Frequency response of tape in copicat would be poor due to design and use
Tape usually has steep low end frop with a hump and not quite so steep high drop, maybe as for guitar we can lower this but would guess that should start around
40 - 80Hz steep fi.highpass with possible hump ( ? resonant filter )
5- 6k fi.lowpass
Am concerned that as each valve stage already has same lowapss filter that this
may have same effect as in real amp of creating a resonance an will try same solution : stagger filters and identify dominant one ( biggest effect ) and slug it or drastically reduce it.
So we need multiple de.delay heads
Each head can be bypassed or moved to alter de.delay time
so tape speed in inches per second
distance from record head in inches
thus we get de.delay in milliseconds
speed = 7.5 ;
The wow should be preset by experiment...
Lets introduce just a little
max(0) because of numerical inaccuracy
4Hz
Play with this
100*SER/1000
IN real machine the ECHO level control is after the last 2 stages of valves | declare name "Tape Delay";
declare category "Echo / Delay";
import("stdfaust.lib");
import("guitarix.lib");
import("redeye.lib");
bpm = hgroup( "Echo", vslider("BPM[style:knob]", 120, 24, 360, 0.1)) ;
wow = sine( freq) * depth ;
speed = ( 72/(2*bpm)) ;
tapespeed = hgroup( "Tape Control",speed + wow );
echo = hgroup( "Echo", vslider("Swell[style:knob]", 0, 0, 1, 0.01)) ;
feedback = hgroup( "Echo", vslider("Sustain[style:knob]", 0, 0.0, 0.95, 0.01));
dtime1 = ma.SR*( 60/bpm) ;
dtime2 = ma.SR*( 120/ bpm) ;
dtime3 = ma.SR*( 180/bpm ) ;
dtime4 = ma.SR*( 240/bpm ) ;
head1 = de.sdelay(N, interp, dtime1):*(checkbox("Head1")) with {
N = int( 2^19 ) ;
};
head2 = de.sdelay(N, interp, dtime2):*(checkbox("Head2")) with {
interp = 100*ma.SR/1000.0;
N = int( 2^19 ) ;
};
head3 = de.sdelay(N, interp, dtime3):*(checkbox("Head3")) with {
interp = 100*ma.SR/1000.0;
N = int( 2^19 ) ;
};
head4 = de.sdelay(N, interp, dtime4):*(checkbox("Head4")) with {
interp = 100*ma.SR/1000.0;
N = int( 2^19 ) ;
};
machine = vgroup( "Tape Heads", fi.highpass( 4, 40 )<:head1,head2,head3:>fi.lowpass( 1, 6500 ):fi.dcblocker:*(echo) );
fbloop = fi.lowpass( 1, 7500 ):*(feedback):*(0.5):fi.highpass( 1, 125 ) ;
process = input12au7<:_,(+:_<:machine :>_)~fbloop:>output12au7:*(0.1) ;
|
2a2853af311ee9b92fdb24bf4e6e85a92398912db20d5e00425be8d3ec82ba03 | ml-wo/VirtualGuitarAmp-Guitarix | gxdistortion.dsp | declare id "gxdistortion";
declare version "0.01";
declare author "brummer";
declare license "BSD";
declare copyright "(c)brummer 2008";
import("stdfaust.lib");
import("guitarix.lib");
F = 300; //nentry("split_low_freq", 250, 20, 600, 10);
F1 = 1200; //nentry("split_middle_freq", 650, 600, 1250, 10);
F2 = 3200; //nentry("split_high_freq", 1250, 1250, 12000, 10);
/**********************************************************************
*** this part is included here for backward compatibility from 0.9.27 to
*** 0.9.24
***********************************************************************/
//------------------------------ ba.count and ba.take --------------------------------------
countN ((xs, xxs)) = 1 + countN(xxs);
countN (xx) = 1;
takeN (1, (xs, xxs)) = xs;
takeN (1, xs) = xs;
takeN (nn, (xs, xxs)) = takeN (nn-1, xxs);
//------------------------------ low/high-passfilters --------------------------------------
tf1N(b0,b1,a1) = _ <: *(b0), (mem : *(b1)) :> + ~ *(0-a1);
tf2N(b0,b1,b2,a1,a2) = sub ~ conv2(a1,a2) : conv3(b0,b1,b2)
with {
conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x'';
conv2(k0,k1,x) = k0*x + k1*x';
sub(x,y) = y-x;
};
tf1sN(b1,b0,a0,w1) = tf1N(b0d,b1d,a1d)
with {
c = 1/tan((w1)*0.5/ma.SR); // bilinear-transform scale-factor
d = a0 + c;
b1d = (b0 - b1*c) / d;
b0d = (b0 + b1*c) / d;
a1d = (a0 - c) / d;
};
tf2sN(b2,b1,b0,a1,a0,w1) = tf2N(b0d,b1d,b2d,a1d,a2d)
with {
c = 1/tan((w1)*0.5/ma.SR); // bilinear-transform scale-factor
csq = c*c;
d = a0 + a1 * c + csq;
b0d = (b0 + b1 * c + b2 * csq)/d;
b1d = 2 * (b0 - b2 * csq)/d;
b2d = (b0 - b1 * c + b2 * csq)/d;
a1d = 2 * (a0 - csq)/d;
a2d = (a0 - a1*c + csq)/d;
};
lowpassN(N,fc) = lowpass0_highpass1N(0,N,fc);
highpassN(N,fc) = lowpass0_highpass1N(1,N,fc);
lowpass0_highpass1N(s,N,fc) = lphpr(s,N,N,fc)
with {
lphpr(s,0,N,fc) = _;
lphpr(s,1,N,fc) = tf1sN(s,1-s,1,2*ma.PI*fc);
lphpr(s,O,N,fc) = lphpr(s,(O-2),N,fc) : tf2sN(s,0,1-s,a1s,1,w1) with {
parity = N % 2;
S = (O-parity)/2; // current section number
a1s = -2*cos(-ma.PI + (1-parity)*ma.PI/(2*N) + (S-1+parity)*ma.PI/N);
w1 = 2*ma.PI*fc;
};
};
//------------------------------ an.analyzer --------------------------------------
analyzern(O,lfreqs) = _ <: bsplit(nb) with
{
nb = countN(lfreqs);
fc(n) = takeN(n, lfreqs);
lp(n) = lowpassN(O,fc(n));
hp(n) = highpassN(O,fc(n));
bsplit(0) = _;
bsplit(i) = hp(i), (lp(i) <: bsplit(i-1));
};
analyzerN(lfreqs) = analyzern(3,lfreqs);
filterbankn(O,lfreqs) = analyzern(O,lfreqs) : delayeq with
{
nb = ba.count(lfreqs);
fc(n) = ba.take(n, lfreqs);
ap(n) = fi.highpass_plus_lowpass(O,fc(n));
delayeq = par(i,nb-1,apchain(nb-1-i)),_,_;
apchain(0) = _;
apchain(i) = ap(i) : apchain(i-1);
};
filterbankN(lfreqs) = fi.filterbank(3,lfreqs);
/**********************************************************************
*** end for backward compatibility from 0.9.27 to
*** 0.9.24 , it could removed when switch completly to > 0.9.27
***********************************************************************/
//----------distortion---------
/* 2 exp() because of valve.vt */
val(x) = valve.vt(dist, q(x), x)
with {
dist = 40.1;
q(x) = lp1tm1(x) * 1.0 - lp2tm1(x) * 1.02 - 1.0 : clip(-1.0,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
vt = valve.vt(dist, q) : ma.neg : valve.vt(dist, q) : ma.neg with
{
q_p = 0.9;
dist_p = 1.7;
q = -q_p*-q_p*-q_p;
dist = pow(10,dist_p);
};
//-distortion
distdrive(drive) = wet_dry_mix(wet_dry, _: distortion) with {
//drive = vslider("drive", 0.35, 0, 1, 0.01);
//h = (2.0): ba.db2linear; //1,2589412
//l = (4.0): ba.db2linear; //1,584893192
//mh = (4.0): ba.db2linear; //1,584893192
//ml = (2.5): ba.db2linear; //1,333521432
distortion1 = _:ef.cubicnl(0.45*drive,0.0): *(1.2589412); // l
distortion2 = _:ef.cubicnl(0.4*drive,0.0) : *(1.584893192); // h
distortion3 = _:ef.cubicnl(1.0*drive,0.0) : *(1.584893192); //ml
distortion4 = _:ef.cubicnl(0.6*drive,0.0) : *(1.333521432); //mh
distortion = fi.lowpass(2,15000.0): fi.highpass(1,31.0) : filterbankN((F,F1,F2)) : distortion2,distortion4 ,distortion3,distortion1 :>fi.lowpass(1,6531.0);
wet_dry = (drive - 0.5) * 2;
};
clipit = min(0.7) : max(-0.7) ;
gx_drive(drive) = _ <: _ + nonlin(4,4,0.125) * drive * 10 ;
wetdry = vslider("wet_dry[name:wet/dry]", 100, 0, 100, 1) : /(100);
drive = vslider("drive", 0.35, 0, 1, 0.01) : smoothi(0.999);
dist(drive,wetdry) =_<:(*(dry): gx_drive(drive)),(*(wetdry):distdrive(drive)):>_
with{
dry = 1 - wetdry;
};
dist1(drive,wetdry) =_<:(*(dry): gx_drive(drive)),(*(wetdry) <: (clipit: ef.cubicnl(drive,0.0) : * (0.5)),distdrive(drive) :>_):>_
with{
dry = 1 - wetdry;
};
/* 4 exp() because of val */
dist2(drive,wetdry) =_<:(*(dry): gx_drive(drive)),(*(wetdry) :val :distdrive(drive)):>_
with{
dry = 1 - wetdry;
};
dist4(drive,wetdry) =_<:(*(dry): gx_drive(drive)),
(*(wetdry) : val <:
(ef.cubicnl(drive,0.0) : * (0.5)),distdrive(drive) :>_):>_
with{
dry = 1 - wetdry;
};
process = distdrive;
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/faust/gxdistortion.dsp | faust | nentry("split_low_freq", 250, 20, 600, 10);
nentry("split_middle_freq", 650, 600, 1250, 10);
nentry("split_high_freq", 1250, 1250, 12000, 10);
*********************************************************************
*** this part is included here for backward compatibility from 0.9.27 to
*** 0.9.24
**********************************************************************
------------------------------ ba.count and ba.take --------------------------------------
------------------------------ low/high-passfilters --------------------------------------
bilinear-transform scale-factor
bilinear-transform scale-factor
current section number
------------------------------ an.analyzer --------------------------------------
*********************************************************************
*** end for backward compatibility from 0.9.27 to
*** 0.9.24 , it could removed when switch completly to > 0.9.27
**********************************************************************
----------distortion---------
2 exp() because of valve.vt
-distortion
drive = vslider("drive", 0.35, 0, 1, 0.01);
h = (2.0): ba.db2linear; //1,2589412
l = (4.0): ba.db2linear; //1,584893192
mh = (4.0): ba.db2linear; //1,584893192
ml = (2.5): ba.db2linear; //1,333521432
l
h
ml
mh
4 exp() because of val | declare id "gxdistortion";
declare version "0.01";
declare author "brummer";
declare license "BSD";
declare copyright "(c)brummer 2008";
import("stdfaust.lib");
import("guitarix.lib");
countN ((xs, xxs)) = 1 + countN(xxs);
countN (xx) = 1;
takeN (1, (xs, xxs)) = xs;
takeN (1, xs) = xs;
takeN (nn, (xs, xxs)) = takeN (nn-1, xxs);
tf1N(b0,b1,a1) = _ <: *(b0), (mem : *(b1)) :> + ~ *(0-a1);
tf2N(b0,b1,b2,a1,a2) = sub ~ conv2(a1,a2) : conv3(b0,b1,b2)
with {
conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x'';
conv2(k0,k1,x) = k0*x + k1*x';
sub(x,y) = y-x;
};
tf1sN(b1,b0,a0,w1) = tf1N(b0d,b1d,a1d)
with {
d = a0 + c;
b1d = (b0 - b1*c) / d;
b0d = (b0 + b1*c) / d;
a1d = (a0 - c) / d;
};
tf2sN(b2,b1,b0,a1,a0,w1) = tf2N(b0d,b1d,b2d,a1d,a2d)
with {
csq = c*c;
d = a0 + a1 * c + csq;
b0d = (b0 + b1 * c + b2 * csq)/d;
b1d = 2 * (b0 - b2 * csq)/d;
b2d = (b0 - b1 * c + b2 * csq)/d;
a1d = 2 * (a0 - csq)/d;
a2d = (a0 - a1*c + csq)/d;
};
lowpassN(N,fc) = lowpass0_highpass1N(0,N,fc);
highpassN(N,fc) = lowpass0_highpass1N(1,N,fc);
lowpass0_highpass1N(s,N,fc) = lphpr(s,N,N,fc)
with {
lphpr(s,0,N,fc) = _;
lphpr(s,1,N,fc) = tf1sN(s,1-s,1,2*ma.PI*fc);
lphpr(s,O,N,fc) = lphpr(s,(O-2),N,fc) : tf2sN(s,0,1-s,a1s,1,w1) with {
parity = N % 2;
a1s = -2*cos(-ma.PI + (1-parity)*ma.PI/(2*N) + (S-1+parity)*ma.PI/N);
w1 = 2*ma.PI*fc;
};
};
analyzern(O,lfreqs) = _ <: bsplit(nb) with
{
nb = countN(lfreqs);
fc(n) = takeN(n, lfreqs);
lp(n) = lowpassN(O,fc(n));
hp(n) = highpassN(O,fc(n));
bsplit(0) = _;
bsplit(i) = hp(i), (lp(i) <: bsplit(i-1));
};
analyzerN(lfreqs) = analyzern(3,lfreqs);
filterbankn(O,lfreqs) = analyzern(O,lfreqs) : delayeq with
{
nb = ba.count(lfreqs);
fc(n) = ba.take(n, lfreqs);
ap(n) = fi.highpass_plus_lowpass(O,fc(n));
delayeq = par(i,nb-1,apchain(nb-1-i)),_,_;
apchain(0) = _;
apchain(i) = ap(i) : apchain(i-1);
};
filterbankN(lfreqs) = fi.filterbank(3,lfreqs);
val(x) = valve.vt(dist, q(x), x)
with {
dist = 40.1;
q(x) = lp1tm1(x) * 1.0 - lp2tm1(x) * 1.02 - 1.0 : clip(-1.0,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
vt = valve.vt(dist, q) : ma.neg : valve.vt(dist, q) : ma.neg with
{
q_p = 0.9;
dist_p = 1.7;
q = -q_p*-q_p*-q_p;
dist = pow(10,dist_p);
};
distdrive(drive) = wet_dry_mix(wet_dry, _: distortion) with {
distortion = fi.lowpass(2,15000.0): fi.highpass(1,31.0) : filterbankN((F,F1,F2)) : distortion2,distortion4 ,distortion3,distortion1 :>fi.lowpass(1,6531.0);
wet_dry = (drive - 0.5) * 2;
};
clipit = min(0.7) : max(-0.7) ;
gx_drive(drive) = _ <: _ + nonlin(4,4,0.125) * drive * 10 ;
wetdry = vslider("wet_dry[name:wet/dry]", 100, 0, 100, 1) : /(100);
drive = vslider("drive", 0.35, 0, 1, 0.01) : smoothi(0.999);
dist(drive,wetdry) =_<:(*(dry): gx_drive(drive)),(*(wetdry):distdrive(drive)):>_
with{
dry = 1 - wetdry;
};
dist1(drive,wetdry) =_<:(*(dry): gx_drive(drive)),(*(wetdry) <: (clipit: ef.cubicnl(drive,0.0) : * (0.5)),distdrive(drive) :>_):>_
with{
dry = 1 - wetdry;
};
dist2(drive,wetdry) =_<:(*(dry): gx_drive(drive)),(*(wetdry) :val :distdrive(drive)):>_
with{
dry = 1 - wetdry;
};
dist4(drive,wetdry) =_<:(*(dry): gx_drive(drive)),
(*(wetdry) : val <:
(ef.cubicnl(drive,0.0) : * (0.5)),distdrive(drive) :>_):>_
with{
dry = 1 - wetdry;
};
process = distdrive;
|
5d4a23c81f68f7458d56aa30a499cad77680c8b84cdc4ceba87bea240f092dba | ml-wo/VirtualGuitarAmp-Guitarix | bmp.dsp | // generated automatically
// DO NOT MODIFY!
declare id "bmp";
declare name "BigMuffPi";
declare category "Fuzz";
declare shortname "BMP";
declare description "BigMuffPi";
declare samplerate "96000";
import("stdfaust.lib");
bpmin = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
b0 = 3.7454979802542e-6*fs;
b1 = 0;
b2 = -3.7454979802542e-6*fs;
a0 = 2.08287704934496e-5*fs + 0.000219016314271736;
a1 = 0.000438032628543473;
a2 = -2.08287704934496e-5*fs + 0.000219016314271736;
};
bpmamp1 = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Sustain = vslider("Sustain[name:Sustain]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = Sustain*fs*(2.26293387153501e-12*fs - 1.17905906929765e-5) + fs*(2.26293387153501e-14*fs - 1.17905906929765e-7);
b1 = -4.52586774307001e-12*Sustain*pow(fs,2) - 4.52586774307001e-14*pow(fs,2);
b2 = Sustain*fs*(2.26293387153501e-12*fs + 1.17905906929765e-5) + fs*(2.26293387153501e-14*fs + 1.17905906929765e-7);
a0 = Sustain*(Sustain*fs*(-1.13446519814126e-9*fs - 2.89110812782566e-6) + fs*(1.12312054615984e-9*fs + 2.8621970465474e-6)) + fs*(1.2821120020393e-10*fs + 6.26521815410076e-7) + 0.000146000960455196;
a1 = Sustain*(2.26893039628251e-9*Sustain*pow(fs,2) - 2.24624109231969e-9*pow(fs,2)) - 2.5642240040786e-10*pow(fs,2) + 0.000292001920910392;
a2 = Sustain*(Sustain*fs*(-1.13446519814126e-9*fs + 2.89110812782566e-6) + fs*(1.12312054615984e-9*fs - 2.8621970465474e-6)) + fs*(1.2821120020393e-10*fs - 6.26521815410076e-7) + 0.000146000960455196;
};
bpmamp2 = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
b0 = fs*(7.66731214399861e-12*fs - 3.99490857178962e-5);
b1 = -1.53346242879972e-11*pow(fs,2);
b2 = fs*(7.66731214399861e-12*fs + 3.99490857178962e-5);
a0 = fs*(3.920487958595e-10*fs + 2.00478727462711e-6) + 0.000489785157611555;
a1 = -7.84097591718999e-10*pow(fs,2) + 0.000979570315223111;
a2 = fs*(3.920487958595e-10*fs - 2.00478727462711e-6) + 0.000489785157611555;
};
bpmtone = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Tone = vslider("Tone[name:Tone]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = Tone*(3.68688858465455e-10*pow(fs,2) - 0.00316091270975185) + 8.67101574539126e-7*fs + 0.00401435914138484;
b1 = Tone*(-7.37377716930911e-10*pow(fs,2) - 0.00632182541950369) + 0.00802871828276969;
b2 = Tone*(3.68688858465455e-10*pow(fs,2) - 0.00316091270975185) - 8.67101574539126e-7*fs + 0.00401435914138484;
a0 = fs*(3.68688858465455e-10*fs + 3.03485551088694e-6) + 0.00486780557301784;
a1 = -7.37377716930911e-10*pow(fs,2) + 0.00973561114603569;
a2 = fs*(3.68688858465455e-10*fs - 3.03485551088694e-6) + 0.00486780557301784;
};
bpmout = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Volume = vslider("Volume[name:Volume]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = -1.74325899023428e-9*Volume*pow(fs,2);
b1 = 3.48651798046856e-9*Volume*pow(fs,2);
b2 = -1.74325899023428e-9*Volume*pow(fs,2);
a0 = fs*(4.33884681055068e-10*fs + 6.86809013445937e-9) + 2.65226702159437e-8;
a1 = -8.67769362110135e-10*pow(fs,2) + 5.30453404318874e-8;
a2 = fs*(4.33884681055068e-10*fs - 6.86809013445937e-9) + 2.65226702159437e-8;
};
antialiasing = pre : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0),(a1/a0,a2/a0,a3/a0,a4/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
b0 = fs*(4.68362091734077e-13*fs + 7.44521670106066e-7);
b1 = 1.48904334021213e-6*fs;
b2 = -9.36724183468154e-13*pow(fs,2);
b3 = -1.48904334021213e-6*fs;
b4 = fs*(4.68362091734077e-13*fs - 7.44521670106066e-7);
a0 = fs*(7.55757331680132e-11*fs + 8.45438325675249e-7) + 0.000114185647251642;
a1 = 1.6908766513505e-6*fs + 0.00045674258900657;
a2 = -1.51151466336026e-10*pow(fs,2) + 0.000685113883509854;
a3 = -1.6908766513505e-6*fs + 0.00045674258900657;
a4 = fs*(7.55757331680132e-11*fs - 8.45438325675249e-7) + 0.000114185647251642;
};
symclip = ffunction(float symclip(float), "clipping.h", "");
sclip = symclip(_);
process = bpmin : bpmamp1 : sclip : bpmamp2 : sclip : bpmtone : bpmout;
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/bmp.dsp | faust | generated automatically
DO NOT MODIFY! | declare id "bmp";
declare name "BigMuffPi";
declare category "Fuzz";
declare shortname "BMP";
declare description "BigMuffPi";
declare samplerate "96000";
import("stdfaust.lib");
bpmin = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
b0 = 3.7454979802542e-6*fs;
b1 = 0;
b2 = -3.7454979802542e-6*fs;
a0 = 2.08287704934496e-5*fs + 0.000219016314271736;
a1 = 0.000438032628543473;
a2 = -2.08287704934496e-5*fs + 0.000219016314271736;
};
bpmamp1 = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Sustain = vslider("Sustain[name:Sustain]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = Sustain*fs*(2.26293387153501e-12*fs - 1.17905906929765e-5) + fs*(2.26293387153501e-14*fs - 1.17905906929765e-7);
b1 = -4.52586774307001e-12*Sustain*pow(fs,2) - 4.52586774307001e-14*pow(fs,2);
b2 = Sustain*fs*(2.26293387153501e-12*fs + 1.17905906929765e-5) + fs*(2.26293387153501e-14*fs + 1.17905906929765e-7);
a0 = Sustain*(Sustain*fs*(-1.13446519814126e-9*fs - 2.89110812782566e-6) + fs*(1.12312054615984e-9*fs + 2.8621970465474e-6)) + fs*(1.2821120020393e-10*fs + 6.26521815410076e-7) + 0.000146000960455196;
a1 = Sustain*(2.26893039628251e-9*Sustain*pow(fs,2) - 2.24624109231969e-9*pow(fs,2)) - 2.5642240040786e-10*pow(fs,2) + 0.000292001920910392;
a2 = Sustain*(Sustain*fs*(-1.13446519814126e-9*fs + 2.89110812782566e-6) + fs*(1.12312054615984e-9*fs - 2.8621970465474e-6)) + fs*(1.2821120020393e-10*fs - 6.26521815410076e-7) + 0.000146000960455196;
};
bpmamp2 = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
b0 = fs*(7.66731214399861e-12*fs - 3.99490857178962e-5);
b1 = -1.53346242879972e-11*pow(fs,2);
b2 = fs*(7.66731214399861e-12*fs + 3.99490857178962e-5);
a0 = fs*(3.920487958595e-10*fs + 2.00478727462711e-6) + 0.000489785157611555;
a1 = -7.84097591718999e-10*pow(fs,2) + 0.000979570315223111;
a2 = fs*(3.920487958595e-10*fs - 2.00478727462711e-6) + 0.000489785157611555;
};
bpmtone = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Tone = vslider("Tone[name:Tone]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = Tone*(3.68688858465455e-10*pow(fs,2) - 0.00316091270975185) + 8.67101574539126e-7*fs + 0.00401435914138484;
b1 = Tone*(-7.37377716930911e-10*pow(fs,2) - 0.00632182541950369) + 0.00802871828276969;
b2 = Tone*(3.68688858465455e-10*pow(fs,2) - 0.00316091270975185) - 8.67101574539126e-7*fs + 0.00401435914138484;
a0 = fs*(3.68688858465455e-10*fs + 3.03485551088694e-6) + 0.00486780557301784;
a1 = -7.37377716930911e-10*pow(fs,2) + 0.00973561114603569;
a2 = fs*(3.68688858465455e-10*fs - 3.03485551088694e-6) + 0.00486780557301784;
};
bpmout = pre : fi.iir((b0/a0,b1/a0,b2/a0),(a1/a0,a2/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Volume = vslider("Volume[name:Volume]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = -1.74325899023428e-9*Volume*pow(fs,2);
b1 = 3.48651798046856e-9*Volume*pow(fs,2);
b2 = -1.74325899023428e-9*Volume*pow(fs,2);
a0 = fs*(4.33884681055068e-10*fs + 6.86809013445937e-9) + 2.65226702159437e-8;
a1 = -8.67769362110135e-10*pow(fs,2) + 5.30453404318874e-8;
a2 = fs*(4.33884681055068e-10*fs - 6.86809013445937e-9) + 2.65226702159437e-8;
};
antialiasing = pre : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0),(a1/a0,a2/a0,a3/a0,a4/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
b0 = fs*(4.68362091734077e-13*fs + 7.44521670106066e-7);
b1 = 1.48904334021213e-6*fs;
b2 = -9.36724183468154e-13*pow(fs,2);
b3 = -1.48904334021213e-6*fs;
b4 = fs*(4.68362091734077e-13*fs - 7.44521670106066e-7);
a0 = fs*(7.55757331680132e-11*fs + 8.45438325675249e-7) + 0.000114185647251642;
a1 = 1.6908766513505e-6*fs + 0.00045674258900657;
a2 = -1.51151466336026e-10*pow(fs,2) + 0.000685113883509854;
a3 = -1.6908766513505e-6*fs + 0.00045674258900657;
a4 = fs*(7.55757331680132e-11*fs - 8.45438325675249e-7) + 0.000114185647251642;
};
symclip = ffunction(float symclip(float), "clipping.h", "");
sclip = symclip(_);
process = bpmin : bpmamp1 : sclip : bpmamp2 : sclip : bpmtone : bpmout;
|
86276e3346983998e545f691d182cc54924e7f188339f44ab8fd5e2f20060716 | ml-wo/VirtualGuitarAmp-Guitarix | fuzzfacerm.dsp | // generated automatically
// DO NOT MODIFY!
declare id "fuzzfacerm";
declare name "Fuzz Face Mayer";
declare category "Fuzz";
declare shortname "FF Mayer";
declare description "Roger Mayer Fuzz Face simulation";
declare insert_p "tranyclipper3";
import("stdfaust.lib");
import("trany.lib");
process = fi.iir((b0/a0,b1/a0,b2/a0,b3/a0),(a1/a0,a2/a0,a3/a0)) with {
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
//clip = tranystage(TB_KT88_68k,86.0,2700.0,5.562895) : tranystage(TB_KT88_68k,86.0,2700.0,5.562895) ;
Fuzz = vslider("Fuzz[name:Fuzz]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
b0 = Fuzz*(Fuzz*(4.47934267089816e-14*Level*pow(fs,3) - 4.57075782744711e-14*pow(fs,3)) + 2.1870008532593e-12*Level*pow(fs,3) - 2.23163352373398e-12*pow(fs,3)) + Level*pow(fs,2)*(-2.23179427996828e-12*fs - 2.84573463334658e-11) + pow(fs,2)*(2.27734110200845e-12*fs + 2.90381085035365e-11);
b1 = Fuzz*(Fuzz*(-1.34380280126945e-13*Level*pow(fs,3) + 1.37122734823413e-13*pow(fs,3)) - 6.5610025597779e-12*Level*pow(fs,3) + 6.69490057120194e-12*pow(fs,3)) + Level*pow(fs,2)*(6.69538283990485e-12*fs + 2.84573463334658e-11) + pow(fs,2)*(-6.83202330602535e-12*fs - 2.90381085035365e-11);
b2 = Fuzz*(Fuzz*(1.34380280126945e-13*Level*pow(fs,3) - 1.37122734823413e-13*pow(fs,3)) + 6.5610025597779e-12*Level*pow(fs,3) - 6.69490057120194e-12*pow(fs,3)) + Level*pow(fs,2)*(-6.69538283990485e-12*fs + 2.84573463334658e-11) + pow(fs,2)*(6.83202330602535e-12*fs - 2.90381085035365e-11);
b3 = Fuzz*(Fuzz*(-4.47934267089816e-14*Level*pow(fs,3) + 4.57075782744711e-14*pow(fs,3)) - 2.1870008532593e-12*Level*pow(fs,3) + 2.23163352373398e-12*pow(fs,3)) + Level*pow(fs,2)*(2.23179427996828e-12*fs - 2.84573463334658e-11) + pow(fs,2)*(-2.27734110200845e-12*fs + 2.90381085035365e-11);
a0 = Fuzz*(Fuzz*(Level*(Level*fs*(fs*(-6.18674104772942e-29*fs - 4.00204457374009e-26) - 2.83832448080453e-29) + fs*(fs*(-1.26259937209307e-31*fs - 2.15993317197785e-28) - 8.68874841067831e-26)) + fs*(fs*(-3.22405119745267e-14*fs - 2.08898268350887e-11) - 2.21793415696022e-11)) + Level*(Level*fs*(fs*(5.85504578964162e-29*fs + 4.00083755606776e-26) + 2.83746860731297e-29) + fs*(fs*(1.19490650740761e-31*fs + 2.08767320417856e-28) + 8.68612838978577e-26)) + fs*(fs*(3.05119726906337e-14*fs + 2.08816997599123e-11) + 2.21726535708769e-11)) + Level*(Level*(fs*(fs*(3.31695258087803e-30*fs + 8.26874714950455e-28) + 5.00406457485288e-25) + 3.54897544287011e-28) + fs*(fs*(6.76928646854567e-33*fs + 8.88886207590151e-30) + 2.81644163364677e-27) + 1.08642105394636e-24) + fs*(fs*(1.72853928389298e-15*fs + 4.32740215906676e-13) + 2.6123111187704e-10) + 2.77325369604093e-10;
a1 = Fuzz*(Fuzz*(Level*(Level*fs*(fs*(1.85602231431883e-28*fs + 4.00204457374009e-26) - 2.83832448080453e-29) + fs*(fs*(3.78779811627921e-31*fs + 2.15993317197785e-28) - 8.68874841067831e-26)) + fs*(fs*(9.67215359235801e-14*fs + 2.08898268350887e-11) - 2.21793415696022e-11)) + Level*(Level*fs*(fs*(-1.75651373689249e-28*fs - 4.00083755606776e-26) + 2.83746860731297e-29) + fs*(fs*(-3.58471952222284e-31*fs - 2.08767320417856e-28) + 8.68612838978577e-26)) + fs*(fs*(-9.15359180719011e-14*fs - 2.08816997599123e-11) + 2.21726535708769e-11)) + Level*(Level*(fs*(fs*(-9.95085774263408e-30*fs - 8.26874714950455e-28) + 5.00406457485288e-25) + 1.06469263286103e-27) + fs*(fs*(-2.0307859405637e-32*fs - 8.88886207590151e-30) + 2.81644163364677e-27) + 3.25926316183907e-24) + fs*(fs*(-5.18561785167894e-15*fs - 4.32740215906676e-13) + 2.6123111187704e-10) + 8.3197610881228e-10;
a2 = Fuzz*(Fuzz*(Level*(Level*fs*(fs*(-1.85602231431883e-28*fs + 4.00204457374009e-26) + 2.83832448080453e-29) + fs*(fs*(-3.78779811627921e-31*fs + 2.15993317197785e-28) + 8.68874841067831e-26)) + fs*(fs*(-9.67215359235801e-14*fs + 2.08898268350887e-11) + 2.21793415696022e-11)) + Level*(Level*fs*(fs*(1.75651373689249e-28*fs - 4.00083755606776e-26) - 2.83746860731297e-29) + fs*(fs*(3.58471952222284e-31*fs - 2.08767320417856e-28) - 8.68612838978577e-26)) + fs*(fs*(9.15359180719011e-14*fs - 2.08816997599123e-11) - 2.21726535708769e-11)) + Level*(Level*(fs*(fs*(9.95085774263408e-30*fs - 8.26874714950455e-28) - 5.00406457485288e-25) + 1.06469263286103e-27) + fs*(fs*(2.0307859405637e-32*fs - 8.88886207590151e-30) - 2.81644163364677e-27) + 3.25926316183907e-24) + fs*(fs*(5.18561785167894e-15*fs - 4.32740215906676e-13) - 2.6123111187704e-10) + 8.3197610881228e-10;
a3 = Fuzz*(Fuzz*(Level*(Level*fs*(fs*(6.18674104772942e-29*fs - 4.00204457374009e-26) + 2.83832448080453e-29) + fs*(fs*(1.26259937209307e-31*fs - 2.15993317197785e-28) + 8.68874841067831e-26)) + fs*(fs*(3.22405119745267e-14*fs - 2.08898268350887e-11) + 2.21793415696022e-11)) + Level*(Level*fs*(fs*(-5.85504578964162e-29*fs + 4.00083755606776e-26) - 2.83746860731297e-29) + fs*(fs*(-1.19490650740761e-31*fs + 2.08767320417856e-28) - 8.68612838978577e-26)) + fs*(fs*(-3.05119726906337e-14*fs + 2.08816997599123e-11) - 2.21726535708769e-11)) + Level*(Level*(fs*(fs*(-3.31695258087803e-30*fs + 8.26874714950455e-28) - 5.00406457485288e-25) + 3.54897544287011e-28) + fs*(fs*(-6.76928646854567e-33*fs + 8.88886207590151e-30) - 2.81644163364677e-27) + 1.08642105394636e-24) + fs*(fs*(-1.72853928389298e-15*fs + 4.32740215906676e-13) - 2.6123111187704e-10) + 2.77325369604093e-10;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/plugins/fuzzfacerm.dsp | faust | generated automatically
DO NOT MODIFY!
clip = tranystage(TB_KT88_68k,86.0,2700.0,5.562895) : tranystage(TB_KT88_68k,86.0,2700.0,5.562895) ; | declare id "fuzzfacerm";
declare name "Fuzz Face Mayer";
declare category "Fuzz";
declare shortname "FF Mayer";
declare description "Roger Mayer Fuzz Face simulation";
declare insert_p "tranyclipper3";
import("stdfaust.lib");
import("trany.lib");
process = fi.iir((b0/a0,b1/a0,b2/a0,b3/a0),(a1/a0,a2/a0,a3/a0)) with {
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Fuzz = vslider("Fuzz[name:Fuzz]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
b0 = Fuzz*(Fuzz*(4.47934267089816e-14*Level*pow(fs,3) - 4.57075782744711e-14*pow(fs,3)) + 2.1870008532593e-12*Level*pow(fs,3) - 2.23163352373398e-12*pow(fs,3)) + Level*pow(fs,2)*(-2.23179427996828e-12*fs - 2.84573463334658e-11) + pow(fs,2)*(2.27734110200845e-12*fs + 2.90381085035365e-11);
b1 = Fuzz*(Fuzz*(-1.34380280126945e-13*Level*pow(fs,3) + 1.37122734823413e-13*pow(fs,3)) - 6.5610025597779e-12*Level*pow(fs,3) + 6.69490057120194e-12*pow(fs,3)) + Level*pow(fs,2)*(6.69538283990485e-12*fs + 2.84573463334658e-11) + pow(fs,2)*(-6.83202330602535e-12*fs - 2.90381085035365e-11);
b2 = Fuzz*(Fuzz*(1.34380280126945e-13*Level*pow(fs,3) - 1.37122734823413e-13*pow(fs,3)) + 6.5610025597779e-12*Level*pow(fs,3) - 6.69490057120194e-12*pow(fs,3)) + Level*pow(fs,2)*(-6.69538283990485e-12*fs + 2.84573463334658e-11) + pow(fs,2)*(6.83202330602535e-12*fs - 2.90381085035365e-11);
b3 = Fuzz*(Fuzz*(-4.47934267089816e-14*Level*pow(fs,3) + 4.57075782744711e-14*pow(fs,3)) - 2.1870008532593e-12*Level*pow(fs,3) + 2.23163352373398e-12*pow(fs,3)) + Level*pow(fs,2)*(2.23179427996828e-12*fs - 2.84573463334658e-11) + pow(fs,2)*(-2.27734110200845e-12*fs + 2.90381085035365e-11);
a0 = Fuzz*(Fuzz*(Level*(Level*fs*(fs*(-6.18674104772942e-29*fs - 4.00204457374009e-26) - 2.83832448080453e-29) + fs*(fs*(-1.26259937209307e-31*fs - 2.15993317197785e-28) - 8.68874841067831e-26)) + fs*(fs*(-3.22405119745267e-14*fs - 2.08898268350887e-11) - 2.21793415696022e-11)) + Level*(Level*fs*(fs*(5.85504578964162e-29*fs + 4.00083755606776e-26) + 2.83746860731297e-29) + fs*(fs*(1.19490650740761e-31*fs + 2.08767320417856e-28) + 8.68612838978577e-26)) + fs*(fs*(3.05119726906337e-14*fs + 2.08816997599123e-11) + 2.21726535708769e-11)) + Level*(Level*(fs*(fs*(3.31695258087803e-30*fs + 8.26874714950455e-28) + 5.00406457485288e-25) + 3.54897544287011e-28) + fs*(fs*(6.76928646854567e-33*fs + 8.88886207590151e-30) + 2.81644163364677e-27) + 1.08642105394636e-24) + fs*(fs*(1.72853928389298e-15*fs + 4.32740215906676e-13) + 2.6123111187704e-10) + 2.77325369604093e-10;
a1 = Fuzz*(Fuzz*(Level*(Level*fs*(fs*(1.85602231431883e-28*fs + 4.00204457374009e-26) - 2.83832448080453e-29) + fs*(fs*(3.78779811627921e-31*fs + 2.15993317197785e-28) - 8.68874841067831e-26)) + fs*(fs*(9.67215359235801e-14*fs + 2.08898268350887e-11) - 2.21793415696022e-11)) + Level*(Level*fs*(fs*(-1.75651373689249e-28*fs - 4.00083755606776e-26) + 2.83746860731297e-29) + fs*(fs*(-3.58471952222284e-31*fs - 2.08767320417856e-28) + 8.68612838978577e-26)) + fs*(fs*(-9.15359180719011e-14*fs - 2.08816997599123e-11) + 2.21726535708769e-11)) + Level*(Level*(fs*(fs*(-9.95085774263408e-30*fs - 8.26874714950455e-28) + 5.00406457485288e-25) + 1.06469263286103e-27) + fs*(fs*(-2.0307859405637e-32*fs - 8.88886207590151e-30) + 2.81644163364677e-27) + 3.25926316183907e-24) + fs*(fs*(-5.18561785167894e-15*fs - 4.32740215906676e-13) + 2.6123111187704e-10) + 8.3197610881228e-10;
a2 = Fuzz*(Fuzz*(Level*(Level*fs*(fs*(-1.85602231431883e-28*fs + 4.00204457374009e-26) + 2.83832448080453e-29) + fs*(fs*(-3.78779811627921e-31*fs + 2.15993317197785e-28) + 8.68874841067831e-26)) + fs*(fs*(-9.67215359235801e-14*fs + 2.08898268350887e-11) + 2.21793415696022e-11)) + Level*(Level*fs*(fs*(1.75651373689249e-28*fs - 4.00083755606776e-26) - 2.83746860731297e-29) + fs*(fs*(3.58471952222284e-31*fs - 2.08767320417856e-28) - 8.68612838978577e-26)) + fs*(fs*(9.15359180719011e-14*fs - 2.08816997599123e-11) - 2.21726535708769e-11)) + Level*(Level*(fs*(fs*(9.95085774263408e-30*fs - 8.26874714950455e-28) - 5.00406457485288e-25) + 1.06469263286103e-27) + fs*(fs*(2.0307859405637e-32*fs - 8.88886207590151e-30) - 2.81644163364677e-27) + 3.25926316183907e-24) + fs*(fs*(5.18561785167894e-15*fs - 4.32740215906676e-13) - 2.6123111187704e-10) + 8.3197610881228e-10;
a3 = Fuzz*(Fuzz*(Level*(Level*fs*(fs*(6.18674104772942e-29*fs - 4.00204457374009e-26) + 2.83832448080453e-29) + fs*(fs*(1.26259937209307e-31*fs - 2.15993317197785e-28) + 8.68874841067831e-26)) + fs*(fs*(3.22405119745267e-14*fs - 2.08898268350887e-11) + 2.21793415696022e-11)) + Level*(Level*fs*(fs*(-5.85504578964162e-29*fs + 4.00083755606776e-26) - 2.83746860731297e-29) + fs*(fs*(-1.19490650740761e-31*fs + 2.08767320417856e-28) - 8.68612838978577e-26)) + fs*(fs*(-3.05119726906337e-14*fs + 2.08816997599123e-11) - 2.21726535708769e-11)) + Level*(Level*(fs*(fs*(-3.31695258087803e-30*fs + 8.26874714950455e-28) - 5.00406457485288e-25) + 3.54897544287011e-28) + fs*(fs*(-6.76928646854567e-33*fs + 8.88886207590151e-30) - 2.81644163364677e-27) + 1.08642105394636e-24) + fs*(fs*(-1.72853928389298e-15*fs + 4.32740215906676e-13) - 2.6123111187704e-10) + 2.77325369604093e-10;
};
|
839ab4ec5d864fec8de8fd3e3d0447234179c5732104dcc5a95089f89af5dc9f | ml-wo/VirtualGuitarAmp-Guitarix | distortion.dsp | //declare name "distortion";
declare version "0.01";
declare author "brummer";
declare license "BSD";
declare copyright "(c)brummer 2008";
import("stdfaust.lib");
import("guitarix.lib");
F = nentry("split_low_freq", 250, 20, 600, 10);
F1 = nentry("split_middle_freq", 650, 600, 1250, 10);
F2 = nentry("split_high_freq", 1250, 1250, 12000, 10);
/**********************************************************************
*** this part is included here for backward compatibility from 0.9.27 to
*** 0.9.24
***********************************************************************/
//------------------------------ ba.count and ba.take --------------------------------------
countN ((xs, xxs)) = 1 + countN(xxs);
countN (xx) = 1;
takeN (1, (xs, xxs)) = xs;
takeN (1, xs) = xs;
takeN (nn, (xs, xxs)) = takeN (nn-1, xxs);
//------------------------------ low/high-passfilters --------------------------------------
tf1N(b0,b1,a1) = _ <: *(b0), (mem : *(b1)) :> + ~ *(0-a1);
tf2N(b0,b1,b2,a1,a2) = ma.sub ~ conv2(a1,a2) : conv3(b0,b1,b2)
with {
conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x'';
conv2(k0,k1,x) = k0*x + k1*x';
ma.sub(x,y) = y-x;
};
tf1sN(b1,b0,a0,w1) = tf1N(b0d,b1d,a1d)
with {
c = 1/tan((w1)*0.5/ma.SR); // bilinear-transform scale-factor
d = a0 + c;
b1d = (b0 - b1*c) / d;
b0d = (b0 + b1*c) / d;
a1d = (a0 - c) / d;
};
tf2sN(b2,b1,b0,a1,a0,w1) = tf2N(b0d,b1d,b2d,a1d,a2d)
with {
c = 1/tan((w1)*0.5/ma.SR); // bilinear-transform scale-factor
csq = c*c;
d = a0 + a1 * c + csq;
b0d = (b0 + b1 * c + b2 * csq)/d;
b1d = 2 * (b0 - b2 * csq)/d;
b2d = (b0 - b1 * c + b2 * csq)/d;
a1d = 2 * (a0 - csq)/d;
a2d = (a0 - a1*c + csq)/d;
};
lowpassN(N,fc) = lowpass0_highpass1N(0,N,fc);
highpassN(N,fc) = lowpass0_highpass1N(1,N,fc);
lowpass0_highpass1N(s,N,fc) = lphpr(s,N,N,fc)
with {
lphpr(s,0,N,fc) = _;
lphpr(s,1,N,fc) = tf1sN(s,1-s,1,2*ma.PI*fc);
lphpr(s,O,N,fc) = lphpr(s,(O-2),N,fc) : tf2sN(s,0,1-s,a1s,1,w1) with {
parity = N % 2;
S = (O-parity)/2; // current section number
a1s = -2*cos(-ma.PI + (1-parity)*ma.PI/(2*N) + (S-1+parity)*ma.PI/N);
w1 = 2*ma.PI*fc;
};
};
//------------------------------ an.analyzer --------------------------------------
analyzern(O,lfreqs) = _ <: bsplit(nb) with
{
nb = countN(lfreqs);
fc(n) = takeN(n, lfreqs);
lp(n) = lowpassN(O,fc(n));
hp(n) = highpassN(O,fc(n));
bsplit(0) = _;
bsplit(i) = hp(i), (lp(i) <: bsplit(i-1));
};
analyzerN(lfreqs) = analyzern(3,lfreqs);
/**********************************************************************
*** end for backward compatibility from 0.9.27 to
*** 0.9.24 , it could removed when switch completly to > 0.9.27
***********************************************************************/
//----------distortion---------
//-speaker emulation
sbp1 = vslider("low_freq[name:low freq][tooltip:low-freq cutoff Hz]",130,20,1000,10);
sbp2 = vslider("high_freq[name:high freq][tooltip:high-freq cutoff Hz]",5000,1000,12000,10);
switch1 = checkbox("on_off[name:low highcutoff]");
sbp = hgroup("low_highcutoff", bypass(switch1, +(anti_denormal_ac) : ef.speakerbp(sbp1,sbp2)));
//-low and fi.highpass
lowpassfreq = nentry("low_freq[name:low freq]", 5000, 20, 12000, 10);
highpassfreq = nentry("high_freq[name:high freq]", 130, 20, 7040, 10);
switch = checkbox("on_off[name:low fi.highpass]");
passo = +(anti_denormal_ac) : lowpassN(1,lowpassfreq) : highpassN(1,highpassfreq);
pass = hgroup("low_highpass", bypass(switch, passo));
//-distortion
drivelevel = vslider("level", 0.01, 0, 0.5, 0.01);
drivegain1 = vslider("gain", 2, -10, 10, 0.1)-10 : ba.db2linear : smoothi(0.999);
low_gain = vslider("low_gain", 10, -10, 20, 0.1)-10 : ba.db2linear : smoothi(0.999);
high_gain = vslider("high_gain", 10, -10, 20, 0.1)-10 : ba.db2linear : smoothi(0.999);
middle_gain_l = vslider("middle_l_gain", 10, -10, 20, 0.1)-10 : ba.db2linear : smoothi(0.999);
middle_gain_h = vslider("middle_h_gain", 10, -10, 20, 0.1)-10 : ba.db2linear : smoothi(0.999);
drive = vslider("drive", 0.64, 0, 1, 0.01);
drive1 = vslider("low_drive", 1, 0, 1, 0.01)*drive;
drive2 = vslider("high_drive", 1, 0, 1, 0.01)*drive;
drive3 = vslider("middle_l_drive", 1, 0, 1, 0.01)*drive;
drive4 = vslider("middle_h_drive", 1, 0, 1, 0.01)*drive;
distortion1 = _:ef.cubicnl(drive1,drivelevel): *(low_gain);
distortion2 = _:ef.cubicnl(drive2,drivelevel) : *(high_gain);
distortion3 = _:ef.cubicnl(drive3,drivelevel) : *(middle_gain_l);
distortion4 = _:ef.cubicnl(drive4,drivelevel) : *(middle_gain_h);
distortion = _ : analyzerN((F,(F1,F2))) : distortion2,distortion4 ,distortion3,distortion1 :>_;
//-resonator
resonator = (+ <: (de.delay(4096, d-1) + de.delay(4096, d)) / 2) ~ *(1.0-a)
with {
d = vslider("vibrato", 1, 0, 1, 0.01);
a = vslider("trigger", 0.12, 0, 1, 0.01);
};
switch2 = checkbox("resonator.on_off[name:resonat]");
//reso = hgroup("resonator", bypass(switch2, resonator));
hs = component("HighShelf.dsp").hs;
process = bypass(switch2, resonator) : +(anti_denormal_ac) : pass : sbp : hs : distortion : *(drivegain1) : hs : sbp;
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/faust/distortion.dsp | faust | declare name "distortion";
*********************************************************************
*** this part is included here for backward compatibility from 0.9.27 to
*** 0.9.24
**********************************************************************
------------------------------ ba.count and ba.take --------------------------------------
------------------------------ low/high-passfilters --------------------------------------
bilinear-transform scale-factor
bilinear-transform scale-factor
current section number
------------------------------ an.analyzer --------------------------------------
*********************************************************************
*** end for backward compatibility from 0.9.27 to
*** 0.9.24 , it could removed when switch completly to > 0.9.27
**********************************************************************
----------distortion---------
-speaker emulation
-low and fi.highpass
-distortion
-resonator
reso = hgroup("resonator", bypass(switch2, resonator)); | declare version "0.01";
declare author "brummer";
declare license "BSD";
declare copyright "(c)brummer 2008";
import("stdfaust.lib");
import("guitarix.lib");
F = nentry("split_low_freq", 250, 20, 600, 10);
F1 = nentry("split_middle_freq", 650, 600, 1250, 10);
F2 = nentry("split_high_freq", 1250, 1250, 12000, 10);
countN ((xs, xxs)) = 1 + countN(xxs);
countN (xx) = 1;
takeN (1, (xs, xxs)) = xs;
takeN (1, xs) = xs;
takeN (nn, (xs, xxs)) = takeN (nn-1, xxs);
tf1N(b0,b1,a1) = _ <: *(b0), (mem : *(b1)) :> + ~ *(0-a1);
tf2N(b0,b1,b2,a1,a2) = ma.sub ~ conv2(a1,a2) : conv3(b0,b1,b2)
with {
conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x'';
conv2(k0,k1,x) = k0*x + k1*x';
ma.sub(x,y) = y-x;
};
tf1sN(b1,b0,a0,w1) = tf1N(b0d,b1d,a1d)
with {
d = a0 + c;
b1d = (b0 - b1*c) / d;
b0d = (b0 + b1*c) / d;
a1d = (a0 - c) / d;
};
tf2sN(b2,b1,b0,a1,a0,w1) = tf2N(b0d,b1d,b2d,a1d,a2d)
with {
csq = c*c;
d = a0 + a1 * c + csq;
b0d = (b0 + b1 * c + b2 * csq)/d;
b1d = 2 * (b0 - b2 * csq)/d;
b2d = (b0 - b1 * c + b2 * csq)/d;
a1d = 2 * (a0 - csq)/d;
a2d = (a0 - a1*c + csq)/d;
};
lowpassN(N,fc) = lowpass0_highpass1N(0,N,fc);
highpassN(N,fc) = lowpass0_highpass1N(1,N,fc);
lowpass0_highpass1N(s,N,fc) = lphpr(s,N,N,fc)
with {
lphpr(s,0,N,fc) = _;
lphpr(s,1,N,fc) = tf1sN(s,1-s,1,2*ma.PI*fc);
lphpr(s,O,N,fc) = lphpr(s,(O-2),N,fc) : tf2sN(s,0,1-s,a1s,1,w1) with {
parity = N % 2;
a1s = -2*cos(-ma.PI + (1-parity)*ma.PI/(2*N) + (S-1+parity)*ma.PI/N);
w1 = 2*ma.PI*fc;
};
};
analyzern(O,lfreqs) = _ <: bsplit(nb) with
{
nb = countN(lfreqs);
fc(n) = takeN(n, lfreqs);
lp(n) = lowpassN(O,fc(n));
hp(n) = highpassN(O,fc(n));
bsplit(0) = _;
bsplit(i) = hp(i), (lp(i) <: bsplit(i-1));
};
analyzerN(lfreqs) = analyzern(3,lfreqs);
sbp1 = vslider("low_freq[name:low freq][tooltip:low-freq cutoff Hz]",130,20,1000,10);
sbp2 = vslider("high_freq[name:high freq][tooltip:high-freq cutoff Hz]",5000,1000,12000,10);
switch1 = checkbox("on_off[name:low highcutoff]");
sbp = hgroup("low_highcutoff", bypass(switch1, +(anti_denormal_ac) : ef.speakerbp(sbp1,sbp2)));
lowpassfreq = nentry("low_freq[name:low freq]", 5000, 20, 12000, 10);
highpassfreq = nentry("high_freq[name:high freq]", 130, 20, 7040, 10);
switch = checkbox("on_off[name:low fi.highpass]");
passo = +(anti_denormal_ac) : lowpassN(1,lowpassfreq) : highpassN(1,highpassfreq);
pass = hgroup("low_highpass", bypass(switch, passo));
drivelevel = vslider("level", 0.01, 0, 0.5, 0.01);
drivegain1 = vslider("gain", 2, -10, 10, 0.1)-10 : ba.db2linear : smoothi(0.999);
low_gain = vslider("low_gain", 10, -10, 20, 0.1)-10 : ba.db2linear : smoothi(0.999);
high_gain = vslider("high_gain", 10, -10, 20, 0.1)-10 : ba.db2linear : smoothi(0.999);
middle_gain_l = vslider("middle_l_gain", 10, -10, 20, 0.1)-10 : ba.db2linear : smoothi(0.999);
middle_gain_h = vslider("middle_h_gain", 10, -10, 20, 0.1)-10 : ba.db2linear : smoothi(0.999);
drive = vslider("drive", 0.64, 0, 1, 0.01);
drive1 = vslider("low_drive", 1, 0, 1, 0.01)*drive;
drive2 = vslider("high_drive", 1, 0, 1, 0.01)*drive;
drive3 = vslider("middle_l_drive", 1, 0, 1, 0.01)*drive;
drive4 = vslider("middle_h_drive", 1, 0, 1, 0.01)*drive;
distortion1 = _:ef.cubicnl(drive1,drivelevel): *(low_gain);
distortion2 = _:ef.cubicnl(drive2,drivelevel) : *(high_gain);
distortion3 = _:ef.cubicnl(drive3,drivelevel) : *(middle_gain_l);
distortion4 = _:ef.cubicnl(drive4,drivelevel) : *(middle_gain_h);
distortion = _ : analyzerN((F,(F1,F2))) : distortion2,distortion4 ,distortion3,distortion1 :>_;
resonator = (+ <: (de.delay(4096, d-1) + de.delay(4096, d)) / 2) ~ *(1.0-a)
with {
d = vslider("vibrato", 1, 0, 1, 0.01);
a = vslider("trigger", 0.12, 0, 1, 0.01);
};
switch2 = checkbox("resonator.on_off[name:resonat]");
hs = component("HighShelf.dsp").hs;
process = bypass(switch2, resonator) : +(anti_denormal_ac) : pass : sbp : hs : distortion : *(drivegain1) : hs : sbp;
|
87518ea1ac0f7a786392c01f2effc1146f7dbb12e6bc7780f00c68ac19810974 | ml-wo/VirtualGuitarAmp-Guitarix | tapesim.dsp | // Tape compression/saturation and frequency response
// Add wow & flutter and we have tape emulation - needsa to modulate the frequency
// which means basically vibrato
// So far so good - tubes may not be needed
// Need to work out better levels of saturation as current range too distorted
// wow at 1% is 0.15 inchs per second > 10ms * ma.SR/1000
// Which would indicate we need a de.delay time of 10ms to allow +-10ms modulation
// and thus delaytime = (10 + modulation ) * ma.SR/1000;
import("stdfaust.lib");
import("guitarix.lib");
import("redeye.lib");
// ((( lfo + 1 ) *5)+5) from vibrato
//wow = sine( freq )* depth with{
wow = de.sdelay(N, interp, delaytime) with{
freq = hgroup( "Wow Control",vslider("wowfreq[style:knob]",0.0,0.0,4.0,0.1) );
depth = hgroup( "Wow Control",vslider("wowdepth[style:knob]",0.0,0.0,0.03,0.001) );
sine(freq) = (os.oscs(freq) + 1) / 2 : max(0); // max(0) because of numerical inaccuracy what is range of this
modulation = (( sine( freq ) + 1 ) * 5)* depth ; // This should give number between 0-10 ms ??
delaytime = modulation * ma.SR/1000;
N = int(2^12);
interp = 100.0 *ma.SR/1000.0;
};
flutter = de.sdelay(N, interp, modulation*ma.SR/1000.0) with{
freq = hgroup( "Flutter",vslider("flutterfreq[style:knob]",4,4,60,0.1) );
depth = hgroup( "Flutter",vslider("flutterdepth[style:knob]",0.0,0.0,0.03,0.001) );
sine(freq) = (os.oscs(freq) + 1) / 2 : max(0); // max(0) because of numerical inaccuracy
modulation = ((( sine( freq ) + 1 ) *5))* depth ;
N = int(2^12);
interp = 100.0 *ma.SR/1000.0;
};
// Each tape recorde rhas its own frequency response
// Revox A77
// Hump in bass around 50Hz around 2-3dB
// Gentle slope from 100Hz down to 10K about -3dB
// fairly steep rolloff after that
// Can it be done with fi.iir or fi.fir?
// Try to boost highs 1st then cut after to get frequency dependent compressor
// These filters very subtly boost and cut highs
// So should be that the highs are more compressed - which seems to sound better
// may be look into better filter curve
tapesaturate = filter1:sigmoid:filter2:fi.lowpass( 3, 15000):fi.highpass(1,25) with {
//tapesaturate = sigmoid:fi.lowpass( 3, 15000):fi.highpass(1,25) with {
sigmoid(x) = 2.0/( 1.0 + exp(-5.0*x)) - 1.0;
filter1 = fi.iir((1.0, 0.0, 0.0),
(0.3 , 0.0 ,0.0)); // Boost higher frequencies
filter2 = fi.iir((1.0, 0.0, 0.0),
(-0.3 , 0.0 ,0.0)); // Cut higher frequencies
};
// We can incorporate a speed switch ( 7.5 ips / 15 ips )
// This would then select an alternative response curve
// 7.5 ips Revox has no bass hump and cuts treble off even more sharply
// In theory the frequency of no.noise would also double
speed = checkbox("speed");
taperesponse = _<:select2( tapetype, taperesponse1, taperesponse2 ):tapehiss with{
// This is loosely based on Revox B77
tapetype = vslider("tapetype[style:knob]", 0, 0, 1,1);
taperesponse1 = select2( speed ,taperesponse1b,taperesponse1a);
// Taperesponses
// Revoc B77
// 7.5ips
taperesponse1a = fi.highpass(1,25):fi.lowpass( 1, 10000 ):fi.lowpass( 2, 12500 );
// 15 ips
taperesponse1b = fi.highpass(1,25):fi.peak_eq_cq(3, 50, 0.4 ):fi.lowpass( 1, 12500 ):fi.lowpass( 2, 15000 ) ;
// Loosely based on Tascam A3340X
taperesponse2 = select2( speed ,taperesponse2b,taperesponse2a);
// TASCAM Q = 0.4 peak 9dB -- Although the ma.sub fi.lowpass wporks creates a lot of unwanted high end
//7.5ips
taperesponse2a = fi.highpass(1,25):fi.peak_eq_cq(6,75,0.4):ma.sub~fi.lowpass( 1, 4500 ):fi.lowpass( 4, 10000 );
// 15ips
taperesponse2b = fi.highpass(1,35):fi.peak_eq_cq(6,75,0.4):ma.sub~fi.lowpass( 1, 4500 ):fi.lowpass( 4, 15000 );
// Sort this out so level is -XXdB no.noise floor
tapehiss = _<:_,(no.noise * level:hissfilter):>_ ;
level = vslider("tapehiss[style:knob]", 0.0, 0.0, 1.0, 0.01):*(0.0316):si.smooth( 0.9999) ;
scale = ( ( 1.0-speed) + 1.0 )/2.0 ;
// Might be able to simplify this once I get to grips with IIR and fi.fir....!
// Current value is pretty good approximation of actual tape hiss
hissfilter = _<:(fi.highpass(1,3000):*(0.2)),fi.lowpass( 1, 250 ):>fi.lowpass( 2, 15000*scale );
} ;
machine = tapesaturate:taperesponse:wow:flutter;
delaystage = component( "delaystage.dsp").delaystage ;
// This is standard IEC eq maybe wrong way round as I want highs saturated more than lows
iec_in = fi.lowpass( 1, 4500 );
iec_out = ma.sub~fi.lowpass( 1, 4500 );
channel = input12au7:*(0.1):BP(iec_in:machine:iec_out):output12au7:fi.lowpass( 2, 20000);
//process = channel,channel;
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/tapesim.dsp | faust | Tape compression/saturation and frequency response
Add wow & flutter and we have tape emulation - needsa to modulate the frequency
which means basically vibrato
So far so good - tubes may not be needed
Need to work out better levels of saturation as current range too distorted
wow at 1% is 0.15 inchs per second > 10ms * ma.SR/1000
Which would indicate we need a de.delay time of 10ms to allow +-10ms modulation
and thus delaytime = (10 + modulation ) * ma.SR/1000;
((( lfo + 1 ) *5)+5) from vibrato
wow = sine( freq )* depth with{
max(0) because of numerical inaccuracy what is range of this
This should give number between 0-10 ms ??
max(0) because of numerical inaccuracy
Each tape recorde rhas its own frequency response
Revox A77
Hump in bass around 50Hz around 2-3dB
Gentle slope from 100Hz down to 10K about -3dB
fairly steep rolloff after that
Can it be done with fi.iir or fi.fir?
Try to boost highs 1st then cut after to get frequency dependent compressor
These filters very subtly boost and cut highs
So should be that the highs are more compressed - which seems to sound better
may be look into better filter curve
tapesaturate = sigmoid:fi.lowpass( 3, 15000):fi.highpass(1,25) with {
Boost higher frequencies
Cut higher frequencies
We can incorporate a speed switch ( 7.5 ips / 15 ips )
This would then select an alternative response curve
7.5 ips Revox has no bass hump and cuts treble off even more sharply
In theory the frequency of no.noise would also double
This is loosely based on Revox B77
Taperesponses
Revoc B77
7.5ips
15 ips
Loosely based on Tascam A3340X
TASCAM Q = 0.4 peak 9dB -- Although the ma.sub fi.lowpass wporks creates a lot of unwanted high end
7.5ips
15ips
Sort this out so level is -XXdB no.noise floor
Might be able to simplify this once I get to grips with IIR and fi.fir....!
Current value is pretty good approximation of actual tape hiss
This is standard IEC eq maybe wrong way round as I want highs saturated more than lows
process = channel,channel; |
import("stdfaust.lib");
import("guitarix.lib");
import("redeye.lib");
wow = de.sdelay(N, interp, delaytime) with{
freq = hgroup( "Wow Control",vslider("wowfreq[style:knob]",0.0,0.0,4.0,0.1) );
depth = hgroup( "Wow Control",vslider("wowdepth[style:knob]",0.0,0.0,0.03,0.001) );
delaytime = modulation * ma.SR/1000;
N = int(2^12);
interp = 100.0 *ma.SR/1000.0;
};
flutter = de.sdelay(N, interp, modulation*ma.SR/1000.0) with{
freq = hgroup( "Flutter",vslider("flutterfreq[style:knob]",4,4,60,0.1) );
depth = hgroup( "Flutter",vslider("flutterdepth[style:knob]",0.0,0.0,0.03,0.001) );
modulation = ((( sine( freq ) + 1 ) *5))* depth ;
N = int(2^12);
interp = 100.0 *ma.SR/1000.0;
};
tapesaturate = filter1:sigmoid:filter2:fi.lowpass( 3, 15000):fi.highpass(1,25) with {
sigmoid(x) = 2.0/( 1.0 + exp(-5.0*x)) - 1.0;
filter1 = fi.iir((1.0, 0.0, 0.0),
filter2 = fi.iir((1.0, 0.0, 0.0),
};
speed = checkbox("speed");
taperesponse = _<:select2( tapetype, taperesponse1, taperesponse2 ):tapehiss with{
tapetype = vslider("tapetype[style:knob]", 0, 0, 1,1);
taperesponse1 = select2( speed ,taperesponse1b,taperesponse1a);
taperesponse1a = fi.highpass(1,25):fi.lowpass( 1, 10000 ):fi.lowpass( 2, 12500 );
taperesponse1b = fi.highpass(1,25):fi.peak_eq_cq(3, 50, 0.4 ):fi.lowpass( 1, 12500 ):fi.lowpass( 2, 15000 ) ;
taperesponse2 = select2( speed ,taperesponse2b,taperesponse2a);
taperesponse2a = fi.highpass(1,25):fi.peak_eq_cq(6,75,0.4):ma.sub~fi.lowpass( 1, 4500 ):fi.lowpass( 4, 10000 );
taperesponse2b = fi.highpass(1,35):fi.peak_eq_cq(6,75,0.4):ma.sub~fi.lowpass( 1, 4500 ):fi.lowpass( 4, 15000 );
tapehiss = _<:_,(no.noise * level:hissfilter):>_ ;
level = vslider("tapehiss[style:knob]", 0.0, 0.0, 1.0, 0.01):*(0.0316):si.smooth( 0.9999) ;
scale = ( ( 1.0-speed) + 1.0 )/2.0 ;
hissfilter = _<:(fi.highpass(1,3000):*(0.2)),fi.lowpass( 1, 250 ):>fi.lowpass( 2, 15000*scale );
} ;
machine = tapesaturate:taperesponse:wow:flutter;
delaystage = component( "delaystage.dsp").delaystage ;
iec_in = fi.lowpass( 1, 4500 );
iec_out = ma.sub~fi.lowpass( 1, 4500 );
channel = input12au7:*(0.1):BP(iec_in:machine:iec_out):output12au7:fi.lowpass( 2, 20000);
|
15536806f215201122dd303e5fc9f74e0deb7bb74c7bb1eb7e609054ce0978e3 | ml-wo/VirtualGuitarAmp-Guitarix | gxdistortion.dsp | declare id "gxdistortion";
declare version "0.01";
declare author "brummer";
declare license "BSD";
declare copyright "(c)brummer 2008";
import("stdfaust.lib");
import("guitarix.lib");
F = 300; //nentry("split_low_freq", 250, 20, 600, 10);
F1 = 1200; //nentry("split_middle_freq", 650, 600, 1250, 10);
F2 = 3200; //nentry("split_high_freq", 1250, 1250, 12000, 10);
/**********************************************************************
*** this part is included here for backward compatibility from 0.9.27 to
*** 0.9.24
***********************************************************************/
//------------------------------ ba.count and ba.take --------------------------------------
countN ((xs, xxs)) = 1 + countN(xxs);
countN (xx) = 1;
takeN (1, (xs, xxs)) = xs;
takeN (1, xs) = xs;
takeN (nn, (xs, xxs)) = takeN (nn-1, xxs);
//------------------------------ low/high-passfilters --------------------------------------
tf1N(b0,b1,a1) = _ <: *(b0), (mem : *(b1)) :> + ~ *(0-a1);
tf2N(b0,b1,b2,a1,a2) = sub ~ conv2(a1,a2) : conv3(b0,b1,b2)
with {
conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x'';
conv2(k0,k1,x) = k0*x + k1*x';
sub(x,y) = y-x;
};
tf1sN(b1,b0,a0,w1) = tf1N(b0d,b1d,a1d)
with {
c = 1/tan((w1)*0.5/ma.SR); // bilinear-transform scale-factor
d = a0 + c;
b1d = (b0 - b1*c) / d;
b0d = (b0 + b1*c) / d;
a1d = (a0 - c) / d;
};
tf2sN(b2,b1,b0,a1,a0,w1) = tf2N(b0d,b1d,b2d,a1d,a2d)
with {
c = 1/tan((w1)*0.5/ma.SR); // bilinear-transform scale-factor
csq = c*c;
d = a0 + a1 * c + csq;
b0d = (b0 + b1 * c + b2 * csq)/d;
b1d = 2 * (b0 - b2 * csq)/d;
b2d = (b0 - b1 * c + b2 * csq)/d;
a1d = 2 * (a0 - csq)/d;
a2d = (a0 - a1*c + csq)/d;
};
lowpassN(N,fc) = lowpass0_highpass1N(0,N,fc);
highpassN(N,fc) = lowpass0_highpass1N(1,N,fc);
lowpass0_highpass1N(s,N,fc) = lphpr(s,N,N,fc)
with {
lphpr(s,0,N,fc) = _;
lphpr(s,1,N,fc) = tf1sN(s,1-s,1,2*ma.PI*fc);
lphpr(s,O,N,fc) = lphpr(s,(O-2),N,fc) : tf2sN(s,0,1-s,a1s,1,w1) with {
parity = N % 2;
S = (O-parity)/2; // current section number
a1s = -2*cos(-ma.PI + (1-parity)*ma.PI/(2*N) + (S-1+parity)*ma.PI/N);
w1 = 2*ma.PI*fc;
};
};
//------------------------------ an.analyzer --------------------------------------
analyzern(O,lfreqs) = _ <: bsplit(nb) with
{
nb = countN(lfreqs);
fc(n) = takeN(n, lfreqs);
lp(n) = lowpassN(O,fc(n));
hp(n) = highpassN(O,fc(n));
bsplit(0) = _;
bsplit(i) = hp(i), (lp(i) <: bsplit(i-1));
};
analyzerN(lfreqs) = analyzern(3,lfreqs);
filterbankn(O,lfreqs) = analyzern(O,lfreqs) : delayeq with
{
nb = ba.count(lfreqs);
fc(n) = ba.take(n, lfreqs);
ap(n) = fi.highpass_plus_lowpass(O,fc(n));
delayeq = par(i,nb-1,apchain(nb-1-i)),_,_;
apchain(0) = _;
apchain(i) = ap(i) : apchain(i-1);
};
filterbankN(lfreqs) = fi.filterbank(3,lfreqs);
/**********************************************************************
*** end for backward compatibility from 0.9.27 to
*** 0.9.24 , it could removed when switch completly to > 0.9.27
***********************************************************************/
//----------distortion---------
val(x) = valve.vt(dist, q(x), x)
with {
dist = 40.1;
q(x) = lp1tm1(x) * 1.0 - lp2tm1(x) * 1.02 - 1.0 : clip(-1.0,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
vt = valve.vt(dist, q) : ma.neg : valve.vt(dist, q) : ma.neg with
{
q_p = 0.9;
dist_p = 1.7;
q = -q_p*-q_p*-q_p;
dist = pow(10,dist_p);
};
//-distortion
distdrive(drive) = wet_dry_mix(wet_dry, _: distortion) with {
//drive = vslider("drive", 0.35, 0, 1, 0.01);
//h = (2.0): ba.db2linear; //1,2589412
//l = (4.0): ba.db2linear; //1,584893192
//mh = (4.0): ba.db2linear; //1,584893192
//ml = (2.5): ba.db2linear; //1,333521432
distortion1 = _:ef.cubicnl(0.45*drive,0.0): *(1.2589412); // l
distortion2 = _:ef.cubicnl(0.4*drive,0.0) : *(1.584893192); // h
distortion3 = _:ef.cubicnl(1.0*drive,0.0) : *(1.584893192); //ml
distortion4 = _:ef.cubicnl(0.6*drive,0.0) : *(1.333521432); //mh
distortion = fi.lowpass(2,15000.0): fi.highpass(1,31.0) : filterbankN((F,(F1,F2))) : distortion2,distortion4 ,distortion3,distortion1 :>fi.lowpass(1,6531.0);
wet_dry = (drive - 0.5) * 2;
};
distdrive1(drive) = wet_dry_mix(wet_dry, _: distortion) with {
//drive = vslider("drive", 0.35, 0, 1, 0.01);
//h = (2.0): ba.db2linear; //1,2589412
//l = (4.0): ba.db2linear; //1,584893192
//mh = (4.0): ba.db2linear; //1,584893192
//ml = (2.5): ba.db2linear; //1,333521432
distortion1 = _:ef.cubicnl(0.4*drive,0.0): *(1.2589412); // l
distortion2 = _:ef.cubicnl(0.8*drive,0.0) : *(1.584893192); // h
distortion3 = _:ef.cubicnl(0.8*drive,0.0) : *(1.584893192); //ml
distortion4 = _:ef.cubicnl(0.6*drive,0.0) : *(1.333521432); //mh
distortion = lowpassN(1,6531.0): fi.highpass(1,120.0) : filterbankN((F,(F1,F2))) : distortion2,distortion4 ,distortion3,distortion1 :>fi.lowpass(1,6531.0): fi.highpass(1,120.0);
wet_dry = (drive - 0.5) * 2;
};
clipit = min(0.7) : max(-0.7) ;
gx_drive(drive) = _ <: _ + nonlin(4,4,0.125) * drive * 10 ;
wetdry = vslider("wet_dry[name:wet/dry]", 100, 0, 100, 1) : /(100);
drive = vslider("drive", 0.35, 0, 1, 0.01) : smoothi(0.999);
dist(drive,wetdry) =_<:(*(dry): +(no_denormal) :gx_drive(drive)),(*(wetdry):+(no_denormal) :distdrive(drive)):>_
with{
dry = 1 - wetdry;
};
dist1(drive,wetdry) =_<:(*(dry): gx_drive(drive)),(*(wetdry) <: (clipit: ef.cubicnl(drive,0.0) : * (0.5)),distdrive(drive) :>_):>_
with{
dry = 1 - wetdry;
};
dist2(drive,wetdry) =_<:(*(dry): gx_drive(drive)),(*(wetdry):val :distdrive(drive)):>_
with{
dry = 1 - wetdry;
};
dist4(drive,wetdry) =_<:(*(dry): gx_drive(drive)),
(*(wetdry) : val <:
(ef.cubicnl(drive,0.0) : * (0.5)),distdrive(drive) :>_):>_
with{
dry = 1 - wetdry;
};
process = distdrive;
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/gxdistortion.dsp | faust | nentry("split_low_freq", 250, 20, 600, 10);
nentry("split_middle_freq", 650, 600, 1250, 10);
nentry("split_high_freq", 1250, 1250, 12000, 10);
*********************************************************************
*** this part is included here for backward compatibility from 0.9.27 to
*** 0.9.24
**********************************************************************
------------------------------ ba.count and ba.take --------------------------------------
------------------------------ low/high-passfilters --------------------------------------
bilinear-transform scale-factor
bilinear-transform scale-factor
current section number
------------------------------ an.analyzer --------------------------------------
*********************************************************************
*** end for backward compatibility from 0.9.27 to
*** 0.9.24 , it could removed when switch completly to > 0.9.27
**********************************************************************
----------distortion---------
-distortion
drive = vslider("drive", 0.35, 0, 1, 0.01);
h = (2.0): ba.db2linear; //1,2589412
l = (4.0): ba.db2linear; //1,584893192
mh = (4.0): ba.db2linear; //1,584893192
ml = (2.5): ba.db2linear; //1,333521432
l
h
ml
mh
drive = vslider("drive", 0.35, 0, 1, 0.01);
h = (2.0): ba.db2linear; //1,2589412
l = (4.0): ba.db2linear; //1,584893192
mh = (4.0): ba.db2linear; //1,584893192
ml = (2.5): ba.db2linear; //1,333521432
l
h
ml
mh | declare id "gxdistortion";
declare version "0.01";
declare author "brummer";
declare license "BSD";
declare copyright "(c)brummer 2008";
import("stdfaust.lib");
import("guitarix.lib");
countN ((xs, xxs)) = 1 + countN(xxs);
countN (xx) = 1;
takeN (1, (xs, xxs)) = xs;
takeN (1, xs) = xs;
takeN (nn, (xs, xxs)) = takeN (nn-1, xxs);
tf1N(b0,b1,a1) = _ <: *(b0), (mem : *(b1)) :> + ~ *(0-a1);
tf2N(b0,b1,b2,a1,a2) = sub ~ conv2(a1,a2) : conv3(b0,b1,b2)
with {
conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x'';
conv2(k0,k1,x) = k0*x + k1*x';
sub(x,y) = y-x;
};
tf1sN(b1,b0,a0,w1) = tf1N(b0d,b1d,a1d)
with {
d = a0 + c;
b1d = (b0 - b1*c) / d;
b0d = (b0 + b1*c) / d;
a1d = (a0 - c) / d;
};
tf2sN(b2,b1,b0,a1,a0,w1) = tf2N(b0d,b1d,b2d,a1d,a2d)
with {
csq = c*c;
d = a0 + a1 * c + csq;
b0d = (b0 + b1 * c + b2 * csq)/d;
b1d = 2 * (b0 - b2 * csq)/d;
b2d = (b0 - b1 * c + b2 * csq)/d;
a1d = 2 * (a0 - csq)/d;
a2d = (a0 - a1*c + csq)/d;
};
lowpassN(N,fc) = lowpass0_highpass1N(0,N,fc);
highpassN(N,fc) = lowpass0_highpass1N(1,N,fc);
lowpass0_highpass1N(s,N,fc) = lphpr(s,N,N,fc)
with {
lphpr(s,0,N,fc) = _;
lphpr(s,1,N,fc) = tf1sN(s,1-s,1,2*ma.PI*fc);
lphpr(s,O,N,fc) = lphpr(s,(O-2),N,fc) : tf2sN(s,0,1-s,a1s,1,w1) with {
parity = N % 2;
a1s = -2*cos(-ma.PI + (1-parity)*ma.PI/(2*N) + (S-1+parity)*ma.PI/N);
w1 = 2*ma.PI*fc;
};
};
analyzern(O,lfreqs) = _ <: bsplit(nb) with
{
nb = countN(lfreqs);
fc(n) = takeN(n, lfreqs);
lp(n) = lowpassN(O,fc(n));
hp(n) = highpassN(O,fc(n));
bsplit(0) = _;
bsplit(i) = hp(i), (lp(i) <: bsplit(i-1));
};
analyzerN(lfreqs) = analyzern(3,lfreqs);
filterbankn(O,lfreqs) = analyzern(O,lfreqs) : delayeq with
{
nb = ba.count(lfreqs);
fc(n) = ba.take(n, lfreqs);
ap(n) = fi.highpass_plus_lowpass(O,fc(n));
delayeq = par(i,nb-1,apchain(nb-1-i)),_,_;
apchain(0) = _;
apchain(i) = ap(i) : apchain(i-1);
};
filterbankN(lfreqs) = fi.filterbank(3,lfreqs);
val(x) = valve.vt(dist, q(x), x)
with {
dist = 40.1;
q(x) = lp1tm1(x) * 1.0 - lp2tm1(x) * 1.02 - 1.0 : clip(-1.0,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
vt = valve.vt(dist, q) : ma.neg : valve.vt(dist, q) : ma.neg with
{
q_p = 0.9;
dist_p = 1.7;
q = -q_p*-q_p*-q_p;
dist = pow(10,dist_p);
};
distdrive(drive) = wet_dry_mix(wet_dry, _: distortion) with {
distortion = fi.lowpass(2,15000.0): fi.highpass(1,31.0) : filterbankN((F,(F1,F2))) : distortion2,distortion4 ,distortion3,distortion1 :>fi.lowpass(1,6531.0);
wet_dry = (drive - 0.5) * 2;
};
distdrive1(drive) = wet_dry_mix(wet_dry, _: distortion) with {
distortion = lowpassN(1,6531.0): fi.highpass(1,120.0) : filterbankN((F,(F1,F2))) : distortion2,distortion4 ,distortion3,distortion1 :>fi.lowpass(1,6531.0): fi.highpass(1,120.0);
wet_dry = (drive - 0.5) * 2;
};
clipit = min(0.7) : max(-0.7) ;
gx_drive(drive) = _ <: _ + nonlin(4,4,0.125) * drive * 10 ;
wetdry = vslider("wet_dry[name:wet/dry]", 100, 0, 100, 1) : /(100);
drive = vslider("drive", 0.35, 0, 1, 0.01) : smoothi(0.999);
dist(drive,wetdry) =_<:(*(dry): +(no_denormal) :gx_drive(drive)),(*(wetdry):+(no_denormal) :distdrive(drive)):>_
with{
dry = 1 - wetdry;
};
dist1(drive,wetdry) =_<:(*(dry): gx_drive(drive)),(*(wetdry) <: (clipit: ef.cubicnl(drive,0.0) : * (0.5)),distdrive(drive) :>_):>_
with{
dry = 1 - wetdry;
};
dist2(drive,wetdry) =_<:(*(dry): gx_drive(drive)),(*(wetdry):val :distdrive(drive)):>_
with{
dry = 1 - wetdry;
};
dist4(drive,wetdry) =_<:(*(dry): gx_drive(drive)),
(*(wetdry) : val <:
(ef.cubicnl(drive,0.0) : * (0.5)),distdrive(drive) :>_):>_
with{
dry = 1 - wetdry;
};
process = distdrive;
|
a502e6c65d97ef6aa085c87816a865c2887a5c0e55eef942c24e23f13598834d | ml-wo/VirtualGuitarAmp-Guitarix | gx_w20.dsp | // generated automatically
// DO NOT MODIFY!
declare id "w20";
declare name "Westbury W-20";
declare category "External";
import("stdfaust.lib");
process = pre : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0,b5/a0),(a1/a0,a2/a0,a3/a0,a4/a0,a5/a0)):*(0.1) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Gain = vslider("Gain[name:Gain]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
b0 = Gain*fs*(fs*(fs*(1.33767398764352e-28*fs + 8.4883795584658e-24) + 3.1080196209939e-20) + 1.15566670466208e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(-4.25008767113306e-21*fs - 6.43954751474457e-20) - 6.76918055130131e-24) + 1.20590256422748e-34) + Gain*fs*(fs*(fs*(fs*(4.25008767113306e-21*fs + 2.1314833830679e-17) + 3.21977374686867e-16) + 8.4212352539407e-21) - 5.4813752919431e-32));
b1 = Gain*fs*(fs*(fs*(-4.01302196293057e-28*fs - 8.4883795584658e-24) + 3.1080196209939e-20) + 3.46700011398625e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(2.12504383556653e-20*fs + 1.93186425442337e-19) + 6.76918055130131e-24) + 1.20590256422748e-34) + Gain*fs*(fs*(fs*(fs*(-2.12504383556653e-20*fs - 6.39445014920369e-17) - 3.21977374686867e-16) + 8.4212352539407e-21) - 1.64441258758293e-31));
b2 = Gain*fs*(fs*(fs*(2.67534797528704e-28*fs - 1.69767591169316e-23) - 6.2160392419878e-20) + 2.31133340932417e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(-4.25008767113306e-20*fs - 1.28790950294891e-19) + 1.35383611026026e-23) - 2.41180512845497e-34) + Gain*fs*(fs*(fs*(fs*(4.25008767113306e-20*fs + 4.26296676613579e-17) - 6.43954749373733e-16) - 1.68424705078814e-20) - 1.09627505838862e-31));
b3 = Gain*fs*(fs*(fs*(2.67534797528704e-28*fs + 1.69767591169316e-23) - 6.2160392419878e-20) - 2.31133340932417e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(4.25008767113306e-20*fs - 1.28790950294891e-19) - 1.35383611026026e-23) - 2.41180512845497e-34) + Gain*fs*(fs*(fs*(fs*(-4.25008767113306e-20*fs + 4.26296676613579e-17) + 6.43954749373733e-16) - 1.68424705078814e-20) + 1.09627505838862e-31));
b4 = Gain*fs*(fs*(fs*(-4.01302196293057e-28*fs + 8.4883795584658e-24) + 3.1080196209939e-20) - 3.46700011398625e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(-2.12504383556653e-20*fs + 1.93186425442337e-19) - 6.76918055130131e-24) + 1.20590256422748e-34) + Gain*fs*(fs*(fs*(fs*(2.12504383556653e-20*fs - 6.39445014920369e-17) + 3.21977374686867e-16) + 8.4212352539407e-21) + 1.64441258758293e-31));
b5 = Gain*fs*(fs*(fs*(1.33767398764352e-28*fs - 8.4883795584658e-24) + 3.1080196209939e-20) - 1.15566670466208e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(4.25008767113306e-21*fs - 6.43954751474457e-20) + 6.76918055130131e-24) + 1.20590256422748e-34) + Gain*fs*(fs*(fs*(fs*(-4.25008767113306e-21*fs + 2.1314833830679e-17) - 3.21977374686867e-16) + 8.4212352539407e-21) + 5.4813752919431e-32));
a0 = Level*(Level*fs*(fs*(fs*(fs*(-1.0280271958907e-23*fs - 8.36540868501136e-22) - 1.56385834712324e-20) - 5.19795592422045e-25) + 1.35597773823241e-35) + fs*(fs*(fs*(fs*(9.92905276020348e-24*fs - 4.34163177403255e-21) - 4.02016257201554e-19) - 7.81929125002698e-18) - 2.59898185626912e-22) - 6.1635351737837e-33) + fs*(fs*(fs*(fs*(3.51219198703525e-25*fs + 5.83356284305863e-20) + 3.04912223958481e-17) + 2.1817595880033e-15) + 3.90964617079412e-14) + 1.29949000095383e-18;
a1 = Level*(Level*fs*(fs*(fs*(fs*(5.1401359794535e-23*fs + 2.50962260550341e-21) + 1.56385834712324e-20) - 5.19795592422045e-25) + 4.06793321469724e-35) + fs*(fs*(fs*(fs*(-4.96452638010174e-23*fs + 1.30248953220977e-20) + 4.02016257201554e-19) - 7.81929125002698e-18) - 7.79694556880737e-22) - 3.08176758689185e-32) + fs*(fs*(fs*(fs*(-1.75609599351763e-24*fs - 1.75006885291759e-19) - 3.04912223958481e-17) + 2.1817595880033e-15) + 1.17289385123824e-13) + 6.49745000476917e-18;
a2 = Level*(Level*fs*(fs*(fs*(fs*(-1.0280271958907e-22*fs - 1.67308173700227e-21) + 3.12771669424648e-20) + 1.03959118484409e-24) + 2.71195547646483e-35) + fs*(fs*(fs*(fs*(9.92905276020348e-23*fs - 8.6832635480651e-21) + 8.04032514403108e-19) + 1.5638582500054e-17) - 5.19796371253824e-22) - 6.1635351737837e-32) + fs*(fs*(fs*(fs*(3.51219198703525e-24*fs + 1.16671256861173e-19) - 6.09824447916961e-17) - 4.36351917600659e-15) + 7.81929234158824e-14) + 1.29949000095383e-17;
a3 = Level*(Level*fs*(fs*(fs*(fs*(1.0280271958907e-22*fs - 1.67308173700227e-21) - 3.12771669424648e-20) + 1.03959118484409e-24) - 2.71195547646483e-35) + fs*(fs*(fs*(fs*(-9.92905276020348e-23*fs - 8.6832635480651e-21) - 8.04032514403108e-19) + 1.5638582500054e-17) + 5.19796371253824e-22) - 6.1635351737837e-32) + fs*(fs*(fs*(fs*(-3.51219198703525e-24*fs + 1.16671256861173e-19) + 6.09824447916961e-17) - 4.36351917600659e-15) - 7.81929234158824e-14) + 1.29949000095383e-17;
a4 = Level*(Level*fs*(fs*(fs*(fs*(-5.1401359794535e-23*fs + 2.50962260550341e-21) - 1.56385834712324e-20) - 5.19795592422045e-25) - 4.06793321469724e-35) + fs*(fs*(fs*(fs*(4.96452638010174e-23*fs + 1.30248953220977e-20) - 4.02016257201554e-19) - 7.81929125002698e-18) + 7.79694556880737e-22) - 3.08176758689185e-32) + fs*(fs*(fs*(fs*(1.75609599351763e-24*fs - 1.75006885291759e-19) + 3.04912223958481e-17) + 2.1817595880033e-15) - 1.17289385123824e-13) + 6.49745000476917e-18;
a5 = Level*(Level*fs*(fs*(fs*(fs*(1.0280271958907e-23*fs - 8.36540868501136e-22) + 1.56385834712324e-20) - 5.19795592422045e-25) - 1.35597773823241e-35) + fs*(fs*(fs*(fs*(-9.92905276020348e-24*fs - 4.34163177403255e-21) + 4.02016257201554e-19) - 7.81929125002698e-18) + 2.59898185626912e-22) - 6.1635351737837e-33) + fs*(fs*(fs*(fs*(-3.51219198703525e-25*fs + 5.83356284305863e-20) - 3.04912223958481e-17) + 2.1817595880033e-15) - 3.90964617079412e-14) + 1.29949000095383e-18;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/gx_w20.dsp | faust | generated automatically
DO NOT MODIFY! | declare id "w20";
declare name "Westbury W-20";
declare category "External";
import("stdfaust.lib");
process = pre : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0,b5/a0),(a1/a0,a2/a0,a3/a0,a4/a0,a5/a0)):*(0.1) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Gain = vslider("Gain[name:Gain]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
b0 = Gain*fs*(fs*(fs*(1.33767398764352e-28*fs + 8.4883795584658e-24) + 3.1080196209939e-20) + 1.15566670466208e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(-4.25008767113306e-21*fs - 6.43954751474457e-20) - 6.76918055130131e-24) + 1.20590256422748e-34) + Gain*fs*(fs*(fs*(fs*(4.25008767113306e-21*fs + 2.1314833830679e-17) + 3.21977374686867e-16) + 8.4212352539407e-21) - 5.4813752919431e-32));
b1 = Gain*fs*(fs*(fs*(-4.01302196293057e-28*fs - 8.4883795584658e-24) + 3.1080196209939e-20) + 3.46700011398625e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(2.12504383556653e-20*fs + 1.93186425442337e-19) + 6.76918055130131e-24) + 1.20590256422748e-34) + Gain*fs*(fs*(fs*(fs*(-2.12504383556653e-20*fs - 6.39445014920369e-17) - 3.21977374686867e-16) + 8.4212352539407e-21) - 1.64441258758293e-31));
b2 = Gain*fs*(fs*(fs*(2.67534797528704e-28*fs - 1.69767591169316e-23) - 6.2160392419878e-20) + 2.31133340932417e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(-4.25008767113306e-20*fs - 1.28790950294891e-19) + 1.35383611026026e-23) - 2.41180512845497e-34) + Gain*fs*(fs*(fs*(fs*(4.25008767113306e-20*fs + 4.26296676613579e-17) - 6.43954749373733e-16) - 1.68424705078814e-20) - 1.09627505838862e-31));
b3 = Gain*fs*(fs*(fs*(2.67534797528704e-28*fs + 1.69767591169316e-23) - 6.2160392419878e-20) - 2.31133340932417e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(4.25008767113306e-20*fs - 1.28790950294891e-19) - 1.35383611026026e-23) - 2.41180512845497e-34) + Gain*fs*(fs*(fs*(fs*(-4.25008767113306e-20*fs + 4.26296676613579e-17) + 6.43954749373733e-16) - 1.68424705078814e-20) + 1.09627505838862e-31));
b4 = Gain*fs*(fs*(fs*(-4.01302196293057e-28*fs + 8.4883795584658e-24) + 3.1080196209939e-20) - 3.46700011398625e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(-2.12504383556653e-20*fs + 1.93186425442337e-19) - 6.76918055130131e-24) + 1.20590256422748e-34) + Gain*fs*(fs*(fs*(fs*(2.12504383556653e-20*fs - 6.39445014920369e-17) + 3.21977374686867e-16) + 8.4212352539407e-21) + 1.64441258758293e-31));
b5 = Gain*fs*(fs*(fs*(1.33767398764352e-28*fs - 8.4883795584658e-24) + 3.1080196209939e-20) - 1.15566670466208e-17) + Level*(Gain*Level*pow(fs,2)*(fs*(fs*(4.25008767113306e-21*fs - 6.43954751474457e-20) + 6.76918055130131e-24) + 1.20590256422748e-34) + Gain*fs*(fs*(fs*(fs*(-4.25008767113306e-21*fs + 2.1314833830679e-17) - 3.21977374686867e-16) + 8.4212352539407e-21) + 5.4813752919431e-32));
a0 = Level*(Level*fs*(fs*(fs*(fs*(-1.0280271958907e-23*fs - 8.36540868501136e-22) - 1.56385834712324e-20) - 5.19795592422045e-25) + 1.35597773823241e-35) + fs*(fs*(fs*(fs*(9.92905276020348e-24*fs - 4.34163177403255e-21) - 4.02016257201554e-19) - 7.81929125002698e-18) - 2.59898185626912e-22) - 6.1635351737837e-33) + fs*(fs*(fs*(fs*(3.51219198703525e-25*fs + 5.83356284305863e-20) + 3.04912223958481e-17) + 2.1817595880033e-15) + 3.90964617079412e-14) + 1.29949000095383e-18;
a1 = Level*(Level*fs*(fs*(fs*(fs*(5.1401359794535e-23*fs + 2.50962260550341e-21) + 1.56385834712324e-20) - 5.19795592422045e-25) + 4.06793321469724e-35) + fs*(fs*(fs*(fs*(-4.96452638010174e-23*fs + 1.30248953220977e-20) + 4.02016257201554e-19) - 7.81929125002698e-18) - 7.79694556880737e-22) - 3.08176758689185e-32) + fs*(fs*(fs*(fs*(-1.75609599351763e-24*fs - 1.75006885291759e-19) - 3.04912223958481e-17) + 2.1817595880033e-15) + 1.17289385123824e-13) + 6.49745000476917e-18;
a2 = Level*(Level*fs*(fs*(fs*(fs*(-1.0280271958907e-22*fs - 1.67308173700227e-21) + 3.12771669424648e-20) + 1.03959118484409e-24) + 2.71195547646483e-35) + fs*(fs*(fs*(fs*(9.92905276020348e-23*fs - 8.6832635480651e-21) + 8.04032514403108e-19) + 1.5638582500054e-17) - 5.19796371253824e-22) - 6.1635351737837e-32) + fs*(fs*(fs*(fs*(3.51219198703525e-24*fs + 1.16671256861173e-19) - 6.09824447916961e-17) - 4.36351917600659e-15) + 7.81929234158824e-14) + 1.29949000095383e-17;
a3 = Level*(Level*fs*(fs*(fs*(fs*(1.0280271958907e-22*fs - 1.67308173700227e-21) - 3.12771669424648e-20) + 1.03959118484409e-24) - 2.71195547646483e-35) + fs*(fs*(fs*(fs*(-9.92905276020348e-23*fs - 8.6832635480651e-21) - 8.04032514403108e-19) + 1.5638582500054e-17) + 5.19796371253824e-22) - 6.1635351737837e-32) + fs*(fs*(fs*(fs*(-3.51219198703525e-24*fs + 1.16671256861173e-19) + 6.09824447916961e-17) - 4.36351917600659e-15) - 7.81929234158824e-14) + 1.29949000095383e-17;
a4 = Level*(Level*fs*(fs*(fs*(fs*(-5.1401359794535e-23*fs + 2.50962260550341e-21) - 1.56385834712324e-20) - 5.19795592422045e-25) - 4.06793321469724e-35) + fs*(fs*(fs*(fs*(4.96452638010174e-23*fs + 1.30248953220977e-20) - 4.02016257201554e-19) - 7.81929125002698e-18) + 7.79694556880737e-22) - 3.08176758689185e-32) + fs*(fs*(fs*(fs*(1.75609599351763e-24*fs - 1.75006885291759e-19) + 3.04912223958481e-17) + 2.1817595880033e-15) - 1.17289385123824e-13) + 6.49745000476917e-18;
a5 = Level*(Level*fs*(fs*(fs*(fs*(1.0280271958907e-23*fs - 8.36540868501136e-22) + 1.56385834712324e-20) - 5.19795592422045e-25) - 1.35597773823241e-35) + fs*(fs*(fs*(fs*(-9.92905276020348e-24*fs - 4.34163177403255e-21) + 4.02016257201554e-19) - 7.81929125002698e-18) + 2.59898185626912e-22) - 6.1635351737837e-33) + fs*(fs*(fs*(fs*(-3.51219198703525e-25*fs + 5.83356284305863e-20) - 3.04912223958481e-17) + 2.1817595880033e-15) - 3.90964617079412e-14) + 1.29949000095383e-18;
};
|
af57f321b5bb1deccf3b3fc78eb23e316294400ccee1e5233b7df898ad17b866 | ml-wo/VirtualGuitarAmp-Guitarix | mbc.dsp | declare id "mbc";
declare name "Multi Band Compressor";
declare shortname "MB Comp";
declare category "Guitar Effects";
declare description "Multi Band Compressor contributed by kokoko3k";
import("stdfaust.lib");
import("reducemaps.lib");
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
envelop = abs : max ~ (1.0/ma.SR) : mean(4096) ; // : max(ba.db2linear(-70)) : ba.linear2db;
//Mono
process = geq : ( gcomp5s , gcomp4s , gcomp3s, gcomp2s, gcomp1s) :>_ with {
gcomp1s = ba.bypass1(bswitch1,co.compressor_mono(ratio1,-push1,attack1,release1)):*(Makeup1) : vmeter1;
gcomp2s = ba.bypass1(bswitch2,co.compressor_mono(ratio2,-push2,attack2,release2)):*(Makeup2) : vmeter2;
gcomp3s = ba.bypass1(bswitch3,co.compressor_mono(ratio3,-push3,attack3,release3)):*(Makeup3) : vmeter3;
gcomp4s = ba.bypass1(bswitch4,co.compressor_mono(ratio4,-push4,attack4,release4)):*(Makeup4) : vmeter4;
gcomp5s = ba.bypass1(bswitch5,co.compressor_mono(ratio5,-push5,attack5,release5)):*(Makeup5) : vmeter5;
};
sel1 = hslider("Mode1[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel2 = hslider("Mode2[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel3 = hslider("Mode3[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel4 = hslider("Mode4[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel5 = hslider("Mode5[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
not(x) = abs(x-1);
mute1 = not(max(0,sel1-2));
mute2 = not(max(0,sel2-2));
mute3 = not(max(0,sel3-2));
mute4 = not(max(0,sel4-2));
mute5 = not(max(0,sel5-2));
bypass(switch, block) = _ <: select2(switch, _, block);
bswitch1 = max(0,sel1-1);
bswitch2 = max(0,sel2-1);
bswitch3 = max(0,sel3-1);
bswitch4 = max(0,sel4-1);
bswitch5 = max(0,sel5-1);
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
ratio1 = hslider("[9] Ratio1 [tooltip: Compression ratio]",2,1,100,0.1);
attack1 = hslider("[A] Attack1 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release1 = hslider("[B] Release1 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio2 = hslider("[9] Ratio2 [tooltip: Compression ratio]",2,1,100,0.1);
attack2 = hslider("[A] Attack2 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release2 = hslider("[B] Release2 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio3 = hslider("[9] Ratio3 [tooltip: Compression ratio]",2,1,100,0.1);
attack3 = hslider("[A] Attack3 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release3 = hslider("[B] Release3 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio4 = hslider("[9] Ratio4 [tooltip: Compression ratio]",2,1,100,0.1);
attack4 = hslider("[A] Attack4 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release4 = hslider("[B] Release4 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio5 = hslider("[9] Ratio5 [tooltip: Compression ratio]",2,1,100,0.1);
attack5 = hslider("[A] Attack5 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release5 = hslider("[B] Release5 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
push1 = hslider("[5] Makeup1 [tooltip: Post amplification and threshold]" , 13, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push2 = hslider("[5] Makeup2 [tooltip: Post amplification and threshold]" , 10, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push3 = hslider("[5] Makeup3 [tooltip: Post amplification and threshold]" , 4, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push4 = hslider("[5] Makeup4 [tooltip: Post amplification and threshold]" , 8, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push5 = hslider("[5] Makeup5 [tooltip: Post amplification and threshold]" , 11, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
safe1 = hslider("[6] Makeup-Threshold1 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe2 = hslider("[6] Makeup-Threshold2 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe3 = hslider("[6] Makeup-Threshold3 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe4 = hslider("[6] Makeup-Threshold4 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe5 = hslider("[6] Makeup-Threshold5 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
Makeup1 = mute1* (not(bswitch1)*(push1-safe1) : ba.db2linear : si.smooth(0.999));
Makeup2 = mute2* (not(bswitch2)*(push2-safe2) : ba.db2linear : si.smooth(0.999));
Makeup3 = mute3* (not(bswitch3)*(push3-safe3) : ba.db2linear : si.smooth(0.999));
Makeup4 = mute4* (not(bswitch4)*(push4-safe4) : ba.db2linear : si.smooth(0.999));
Makeup5 = mute5* (not(bswitch5)*(push5-safe5) : ba.db2linear : si.smooth(0.999));
//Low end headsets: 13,10,4,8,11 (split 80,210,1700,5000)
//Mid-high end headsets: 17,20.5,20,10.5,10 (split 44,180,800,5000)
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/plugins/mbc.dsp | faust | : max(ba.db2linear(-70)) : ba.linear2db;
Mono
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
makeup-=safe
makeup-=safe
makeup-=safe
makeup-=safe
makeup-=safe
Low end headsets: 13,10,4,8,11 (split 80,210,1700,5000)
Mid-high end headsets: 17,20.5,20,10.5,10 (split 44,180,800,5000) | declare id "mbc";
declare name "Multi Band Compressor";
declare shortname "MB Comp";
declare category "Guitar Effects";
declare description "Multi Band Compressor contributed by kokoko3k";
import("stdfaust.lib");
import("reducemaps.lib");
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[nomidi:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[nomidi:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[nomidi:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[nomidi:no]", -70, +5));
process = geq : ( gcomp5s , gcomp4s , gcomp3s, gcomp2s, gcomp1s) :>_ with {
gcomp1s = ba.bypass1(bswitch1,co.compressor_mono(ratio1,-push1,attack1,release1)):*(Makeup1) : vmeter1;
gcomp2s = ba.bypass1(bswitch2,co.compressor_mono(ratio2,-push2,attack2,release2)):*(Makeup2) : vmeter2;
gcomp3s = ba.bypass1(bswitch3,co.compressor_mono(ratio3,-push3,attack3,release3)):*(Makeup3) : vmeter3;
gcomp4s = ba.bypass1(bswitch4,co.compressor_mono(ratio4,-push4,attack4,release4)):*(Makeup4) : vmeter4;
gcomp5s = ba.bypass1(bswitch5,co.compressor_mono(ratio5,-push5,attack5,release5)):*(Makeup5) : vmeter5;
};
sel1 = hslider("Mode1[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel2 = hslider("Mode2[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel3 = hslider("Mode3[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel4 = hslider("Mode4[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel5 = hslider("Mode5[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
not(x) = abs(x-1);
mute1 = not(max(0,sel1-2));
mute2 = not(max(0,sel2-2));
mute3 = not(max(0,sel3-2));
mute4 = not(max(0,sel4-2));
mute5 = not(max(0,sel5-2));
bypass(switch, block) = _ <: select2(switch, _, block);
bswitch1 = max(0,sel1-1);
bswitch2 = max(0,sel2-1);
bswitch3 = max(0,sel3-1);
bswitch4 = max(0,sel4-1);
bswitch5 = max(0,sel5-1);
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
ratio1 = hslider("[9] Ratio1 [tooltip: Compression ratio]",2,1,100,0.1);
attack1 = hslider("[A] Attack1 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release1 = hslider("[B] Release1 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio2 = hslider("[9] Ratio2 [tooltip: Compression ratio]",2,1,100,0.1);
attack2 = hslider("[A] Attack2 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release2 = hslider("[B] Release2 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio3 = hslider("[9] Ratio3 [tooltip: Compression ratio]",2,1,100,0.1);
attack3 = hslider("[A] Attack3 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release3 = hslider("[B] Release3 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio4 = hslider("[9] Ratio4 [tooltip: Compression ratio]",2,1,100,0.1);
attack4 = hslider("[A] Attack4 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release4 = hslider("[B] Release4 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio5 = hslider("[9] Ratio5 [tooltip: Compression ratio]",2,1,100,0.1);
attack5 = hslider("[A] Attack5 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release5 = hslider("[B] Release5 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
Makeup1 = mute1* (not(bswitch1)*(push1-safe1) : ba.db2linear : si.smooth(0.999));
Makeup2 = mute2* (not(bswitch2)*(push2-safe2) : ba.db2linear : si.smooth(0.999));
Makeup3 = mute3* (not(bswitch3)*(push3-safe3) : ba.db2linear : si.smooth(0.999));
Makeup4 = mute4* (not(bswitch4)*(push4-safe4) : ba.db2linear : si.smooth(0.999));
Makeup5 = mute5* (not(bswitch5)*(push5-safe5) : ba.db2linear : si.smooth(0.999));
|
d1b9a336d457b8428344b3e46ef5364bae4beeaf39951df67a752e8b1b4c383b | ml-wo/VirtualGuitarAmp-Guitarix | mbcs.dsp | declare id "mbcs";
declare name "Multi Band Compressor Stereo";
declare shortname "MB Comp St";
declare category "Guitar Effects";
declare description "Multi Band Compressor contributed by kokoko3k";
import("stdfaust.lib");
import("reducemaps.lib");
sel1 = hslider("Mode1[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel2 = hslider("Mode2[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel3 = hslider("Mode3[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel4 = hslider("Mode4[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel5 = hslider("Mode5[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
not(x) = abs(x-1);
mute1 = not(max(0,sel1-2));
mute2 = not(max(0,sel2-2));
mute3 = not(max(0,sel3-2));
mute4 = not(max(0,sel4-2));
mute5 = not(max(0,sel5-2));
bypass(switch, block) = _ <: select2(switch, _, block);
bswitch1 = max(0,sel1-1);
bswitch2 = max(0,sel2-1);
bswitch3 = max(0,sel3-1);
bswitch4 = max(0,sel4-1);
bswitch5 = max(0,sel5-1);
vmeter1(x,y) = attach(x, envelop(abs(x)+abs(y)) : vbargraph("v1[nomidi:no][tooltip: Sum of Band1 ]", -70, +5)),y;
vmeter2(x,y) = attach(x, envelop(abs(x)+abs(y)) : vbargraph("v2[nomidi:no][tooltip: Sum of Band2 ]", -70, +5)),y;
vmeter3(x,y) = attach(x, envelop(abs(x)+abs(y)) : vbargraph("v3[nomidi:no][tooltip: Sum of Band3 ]", -70, +5)),y;
vmeter4(x,y) = attach(x, envelop(abs(x)+abs(y)) : vbargraph("v4[nomidi:no][tooltip: Sum of Band4 ]", -70, +5)),y;
vmeter5(x,y) = attach(x, envelop(abs(x)+abs(y)) : vbargraph("v5[nomidi:no][tooltip: Sum of Band5 ]", -70, +5)),y;
envelop = _ : max ~ (1.0/ma.SR) : mean(4096) : *(0.5); // : max(ba.db2linear(-70)) : ba.linear2db;
//Stereo
process = (_,_):geqs: ( gcomp5s , gcomp4s , gcomp3s, gcomp2s, gcomp1s) :>(_,_) with {
gcomp1s = ba.bypass2(bswitch1,co.compressor_stereo(ratio1,-push1,attack1,release1)):*(Makeup1),*(Makeup1) : vmeter1;
gcomp2s = ba.bypass2(bswitch2,co.compressor_stereo(ratio2,-push2,attack2,release2)):*(Makeup2),*(Makeup2) : vmeter2;
gcomp3s = ba.bypass2(bswitch3,co.compressor_stereo(ratio3,-push3,attack3,release3)):*(Makeup3),*(Makeup3) : vmeter3;
gcomp4s = ba.bypass2(bswitch4,co.compressor_stereo(ratio4,-push4,attack4,release4)):*(Makeup4),*(Makeup4) : vmeter4;
gcomp5s = ba.bypass2(bswitch5,co.compressor_stereo(ratio5,-push5,attack5,release5)):*(Makeup5),*(Makeup5) : vmeter5;
};
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
cross5 = _,!,!,!,!,_,!,!,!,!,!,_,!,!,!,!,_,!,!,!,!,!,_,!,!,!,!,_,!,!,!,!,!,_,!,!,!,!,_,!,!,!,!,!,_,!,!,!,!,_ ;
geqs = (geq,geq) <: cross5;
ratio1 = hslider("[9] Ratio1 [tooltip: Compression ratio]",2,1,100,0.1);
attack1 = hslider("[A] Attack1 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release1 = hslider("[B] Release1 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio2 = hslider("[9] Ratio2 [tooltip: Compression ratio]",2,1,100,0.1);
attack2 = hslider("[A] Attack2 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release2 = hslider("[B] Release2 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio3 = hslider("[9] Ratio3 [tooltip: Compression ratio]",2,1,100,0.1);
attack3 = hslider("[A] Attack3 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release3 = hslider("[B] Release3 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio4 = hslider("[9] Ratio4 [tooltip: Compression ratio]",2,1,100,0.1);
attack4 = hslider("[A] Attack4 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release4 = hslider("[B] Release4 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio5 = hslider("[9] Ratio5 [tooltip: Compression ratio]",2,1,100,0.1);
attack5 = hslider("[A] Attack5 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release5 = hslider("[B] Release5 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
push1 = hslider("[5] Makeup1 [tooltip: Post amplification and threshold]" , 13, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push2 = hslider("[5] Makeup2 [tooltip: Post amplification and threshold]" , 10, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push3 = hslider("[5] Makeup3 [tooltip: Post amplification and threshold]" , 4, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push4 = hslider("[5] Makeup4 [tooltip: Post amplification and threshold]" , 8, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push5 = hslider("[5] Makeup5 [tooltip: Post amplification and threshold]" , 11, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
safe1 = hslider("[6] Makeup-Threshold1 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe2 = hslider("[6] Makeup-Threshold2 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe3 = hslider("[6] Makeup-Threshold3 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe4 = hslider("[6] Makeup-Threshold4 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe5 = hslider("[6] Makeup-Threshold5 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
Makeup1 = mute1* (not(bswitch1)*(push1-safe1) : ba.db2linear : si.smooth(0.999));
Makeup2 = mute2* (not(bswitch2)*(push2-safe2) : ba.db2linear : si.smooth(0.999));
Makeup3 = mute3* (not(bswitch3)*(push3-safe3) : ba.db2linear : si.smooth(0.999));
Makeup4 = mute4* (not(bswitch4)*(push4-safe4) : ba.db2linear : si.smooth(0.999));
Makeup5 = mute5* (not(bswitch5)*(push5-safe5) : ba.db2linear : si.smooth(0.999));
//Low end headsets: 13,10,4,8,11 (split 80,210,1700,5000)
//Mid-high end headsets: 17,20.5,20,10.5,10 (split 44,180,800,5000)
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/plugins/mbcs.dsp | faust | : max(ba.db2linear(-70)) : ba.linear2db;
Stereo
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
makeup-=safe
makeup-=safe
makeup-=safe
makeup-=safe
makeup-=safe
Low end headsets: 13,10,4,8,11 (split 80,210,1700,5000)
Mid-high end headsets: 17,20.5,20,10.5,10 (split 44,180,800,5000) | declare id "mbcs";
declare name "Multi Band Compressor Stereo";
declare shortname "MB Comp St";
declare category "Guitar Effects";
declare description "Multi Band Compressor contributed by kokoko3k";
import("stdfaust.lib");
import("reducemaps.lib");
sel1 = hslider("Mode1[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel2 = hslider("Mode2[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel3 = hslider("Mode3[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel4 = hslider("Mode4[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel5 = hslider("Mode5[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
not(x) = abs(x-1);
mute1 = not(max(0,sel1-2));
mute2 = not(max(0,sel2-2));
mute3 = not(max(0,sel3-2));
mute4 = not(max(0,sel4-2));
mute5 = not(max(0,sel5-2));
bypass(switch, block) = _ <: select2(switch, _, block);
bswitch1 = max(0,sel1-1);
bswitch2 = max(0,sel2-1);
bswitch3 = max(0,sel3-1);
bswitch4 = max(0,sel4-1);
bswitch5 = max(0,sel5-1);
vmeter1(x,y) = attach(x, envelop(abs(x)+abs(y)) : vbargraph("v1[nomidi:no][tooltip: Sum of Band1 ]", -70, +5)),y;
vmeter2(x,y) = attach(x, envelop(abs(x)+abs(y)) : vbargraph("v2[nomidi:no][tooltip: Sum of Band2 ]", -70, +5)),y;
vmeter3(x,y) = attach(x, envelop(abs(x)+abs(y)) : vbargraph("v3[nomidi:no][tooltip: Sum of Band3 ]", -70, +5)),y;
vmeter4(x,y) = attach(x, envelop(abs(x)+abs(y)) : vbargraph("v4[nomidi:no][tooltip: Sum of Band4 ]", -70, +5)),y;
vmeter5(x,y) = attach(x, envelop(abs(x)+abs(y)) : vbargraph("v5[nomidi:no][tooltip: Sum of Band5 ]", -70, +5)),y;
process = (_,_):geqs: ( gcomp5s , gcomp4s , gcomp3s, gcomp2s, gcomp1s) :>(_,_) with {
gcomp1s = ba.bypass2(bswitch1,co.compressor_stereo(ratio1,-push1,attack1,release1)):*(Makeup1),*(Makeup1) : vmeter1;
gcomp2s = ba.bypass2(bswitch2,co.compressor_stereo(ratio2,-push2,attack2,release2)):*(Makeup2),*(Makeup2) : vmeter2;
gcomp3s = ba.bypass2(bswitch3,co.compressor_stereo(ratio3,-push3,attack3,release3)):*(Makeup3),*(Makeup3) : vmeter3;
gcomp4s = ba.bypass2(bswitch4,co.compressor_stereo(ratio4,-push4,attack4,release4)):*(Makeup4),*(Makeup4) : vmeter4;
gcomp5s = ba.bypass2(bswitch5,co.compressor_stereo(ratio5,-push5,attack5,release5)):*(Makeup5),*(Makeup5) : vmeter5;
};
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
cross5 = _,!,!,!,!,_,!,!,!,!,!,_,!,!,!,!,_,!,!,!,!,!,_,!,!,!,!,_,!,!,!,!,!,_,!,!,!,!,_,!,!,!,!,!,_,!,!,!,!,_ ;
geqs = (geq,geq) <: cross5;
ratio1 = hslider("[9] Ratio1 [tooltip: Compression ratio]",2,1,100,0.1);
attack1 = hslider("[A] Attack1 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release1 = hslider("[B] Release1 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio2 = hslider("[9] Ratio2 [tooltip: Compression ratio]",2,1,100,0.1);
attack2 = hslider("[A] Attack2 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release2 = hslider("[B] Release2 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio3 = hslider("[9] Ratio3 [tooltip: Compression ratio]",2,1,100,0.1);
attack3 = hslider("[A] Attack3 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release3 = hslider("[B] Release3 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio4 = hslider("[9] Ratio4 [tooltip: Compression ratio]",2,1,100,0.1);
attack4 = hslider("[A] Attack4 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release4 = hslider("[B] Release4 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio5 = hslider("[9] Ratio5 [tooltip: Compression ratio]",2,1,100,0.1);
attack5 = hslider("[A] Attack5 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release5 = hslider("[B] Release5 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
Makeup1 = mute1* (not(bswitch1)*(push1-safe1) : ba.db2linear : si.smooth(0.999));
Makeup2 = mute2* (not(bswitch2)*(push2-safe2) : ba.db2linear : si.smooth(0.999));
Makeup3 = mute3* (not(bswitch3)*(push3-safe3) : ba.db2linear : si.smooth(0.999));
Makeup4 = mute4* (not(bswitch4)*(push4-safe4) : ba.db2linear : si.smooth(0.999));
Makeup5 = mute5* (not(bswitch5)*(push5-safe5) : ba.db2linear : si.smooth(0.999));
|
5962360d6465b78e380b7807204e703cea16a192eb51dc6f5b10496e58e8a196 | ml-wo/VirtualGuitarAmp-Guitarix | mbc.dsp | declare id "mbc";
declare name "Multi Band Compressor";
declare shortname "MB Compressor";
declare category "Guitar Effects";
declare description "Multi Band Compressor contributed by kokoko3k";
import("stdfaust.lib");
import("reducemaps.lib");
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[tooltip:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[tooltip:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[tooltip:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[tooltip:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[tooltip:no]", -70, +5));
vmeter6(x) = attach(x, envelop(x) : vbargraph("v6[tooltip:no]", -70, +5));
vmeter7(x) = attach(x, envelop(x) : vbargraph("v7[tooltip:no]", -70, +5));
vmeter8(x) = attach(x, envelop(x) : vbargraph("v8[tooltip:no]", -70, +5));
vmeter9(x) = attach(x, envelop(x) : vbargraph("v9[tooltip:no]", -70, +5));
vmeter10(x) = attach(x, envelop(x) : vbargraph("v10[tooltip:no]", -70, +5));
envelop = abs : max ~ (1.0/ma.SR) : mean(4096) ; // : max(ba.db2linear(-70)) : ba.linear2db;
//Mono
process = geq : ( gcomp5s , gcomp4s , gcomp3s, gcomp2s, gcomp1s) :>_ with {
gcomp1s = vmeter6:ba.bypass1(bswitch1,co.compressor_mono(ratio1,-push1,attack1,release1)):*(Makeup1) : vmeter1;
gcomp2s = vmeter7:ba.bypass1(bswitch2,co.compressor_mono(ratio2,-push2,attack2,release2)):*(Makeup2) : vmeter2;
gcomp3s = vmeter8:ba.bypass1(bswitch3,co.compressor_mono(ratio3,-push3,attack3,release3)):*(Makeup3) : vmeter3;
gcomp4s = vmeter9:ba.bypass1(bswitch4,co.compressor_mono(ratio4,-push4,attack4,release4)):*(Makeup4) : vmeter4;
gcomp5s = vmeter10:ba.bypass1(bswitch5,co.compressor_mono(ratio5,-push5,attack5,release5)):*(Makeup5) : vmeter5;
};
sel1 = hslider("Mode1[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel2 = hslider("Mode2[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel3 = hslider("Mode3[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel4 = hslider("Mode4[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel5 = hslider("Mode5[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
not(x) = abs(x-1);
mute1 = not(max(0,sel1-2));
mute2 = not(max(0,sel2-2));
mute3 = not(max(0,sel3-2));
mute4 = not(max(0,sel4-2));
mute5 = not(max(0,sel5-2));
bypass(switch, block) = _ <: select2(switch, _, block);
bswitch1 = max(0,sel1-1);
bswitch2 = max(0,sel2-1);
bswitch3 = max(0,sel3-1);
bswitch4 = max(0,sel4-1);
bswitch5 = max(0,sel5-1);
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
ratio1 = hslider("[9] Ratio1 [tooltip: Compression ratio]",2,1,100,0.1);
attack1 = hslider("[A] Attack1 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release1 = hslider("[B] Release1 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio2 = hslider("[9] Ratio2 [tooltip: Compression ratio]",2,1,100,0.1);
attack2 = hslider("[A] Attack2 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release2 = hslider("[B] Release2 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio3 = hslider("[9] Ratio3 [tooltip: Compression ratio]",2,1,100,0.1);
attack3 = hslider("[A] Attack3 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release3 = hslider("[B] Release3 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio4 = hslider("[9] Ratio4 [tooltip: Compression ratio]",2,1,100,0.1);
attack4 = hslider("[A] Attack4 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release4 = hslider("[B] Release4 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio5 = hslider("[9] Ratio5 [tooltip: Compression ratio]",2,1,100,0.1);
attack5 = hslider("[A] Attack5 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release5 = hslider("[B] Release5 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
push1 = hslider("[5] Makeup1 [tooltip: Post amplification and threshold]" , 13, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push2 = hslider("[5] Makeup2 [tooltip: Post amplification and threshold]" , 10, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push3 = hslider("[5] Makeup3 [tooltip: Post amplification and threshold]" , 4, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push4 = hslider("[5] Makeup4 [tooltip: Post amplification and threshold]" , 8, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
push5 = hslider("[5] Makeup5 [tooltip: Post amplification and threshold]" , 11, -50, +50, 0.1) ; // threshold-=push ; makeup+=push
safe1 = hslider("[6] MakeupThreshold1 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe2 = hslider("[6] MakeupThreshold2 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe3 = hslider("[6] MakeupThreshold3 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe4 = hslider("[6] MakeupThreshold4 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
safe5 = hslider("[6] MakeupThreshold5 [tooltip: Threshold correction, an anticlip measure]" , 2, 0, +10, 0.1) ; // makeup-=safe
Makeup1 = mute1* (not(bswitch1)*(push1-safe1) : ba.db2linear : si.smooth(0.999));
Makeup2 = mute2* (not(bswitch2)*(push2-safe2) : ba.db2linear : si.smooth(0.999));
Makeup3 = mute3* (not(bswitch3)*(push3-safe3) : ba.db2linear : si.smooth(0.999));
Makeup4 = mute4* (not(bswitch4)*(push4-safe4) : ba.db2linear : si.smooth(0.999));
Makeup5 = mute5* (not(bswitch5)*(push5-safe5) : ba.db2linear : si.smooth(0.999));
//Low end headsets: 13,10,4,8,11 (split 80,210,1700,5000)
//Mid-high end headsets: 17,20.5,20,10.5,10 (split 44,180,800,5000)
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/mbc.dsp | faust | : max(ba.db2linear(-70)) : ba.linear2db;
Mono
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
threshold-=push ; makeup+=push
makeup-=safe
makeup-=safe
makeup-=safe
makeup-=safe
makeup-=safe
Low end headsets: 13,10,4,8,11 (split 80,210,1700,5000)
Mid-high end headsets: 17,20.5,20,10.5,10 (split 44,180,800,5000) | declare id "mbc";
declare name "Multi Band Compressor";
declare shortname "MB Compressor";
declare category "Guitar Effects";
declare description "Multi Band Compressor contributed by kokoko3k";
import("stdfaust.lib");
import("reducemaps.lib");
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[tooltip:no]", -70, +5));
vmeter2(x) = attach(x, envelop(x) : vbargraph("v2[tooltip:no]", -70, +5));
vmeter3(x) = attach(x, envelop(x) : vbargraph("v3[tooltip:no]", -70, +5));
vmeter4(x) = attach(x, envelop(x) : vbargraph("v4[tooltip:no]", -70, +5));
vmeter5(x) = attach(x, envelop(x) : vbargraph("v5[tooltip:no]", -70, +5));
vmeter6(x) = attach(x, envelop(x) : vbargraph("v6[tooltip:no]", -70, +5));
vmeter7(x) = attach(x, envelop(x) : vbargraph("v7[tooltip:no]", -70, +5));
vmeter8(x) = attach(x, envelop(x) : vbargraph("v8[tooltip:no]", -70, +5));
vmeter9(x) = attach(x, envelop(x) : vbargraph("v9[tooltip:no]", -70, +5));
vmeter10(x) = attach(x, envelop(x) : vbargraph("v10[tooltip:no]", -70, +5));
process = geq : ( gcomp5s , gcomp4s , gcomp3s, gcomp2s, gcomp1s) :>_ with {
gcomp1s = vmeter6:ba.bypass1(bswitch1,co.compressor_mono(ratio1,-push1,attack1,release1)):*(Makeup1) : vmeter1;
gcomp2s = vmeter7:ba.bypass1(bswitch2,co.compressor_mono(ratio2,-push2,attack2,release2)):*(Makeup2) : vmeter2;
gcomp3s = vmeter8:ba.bypass1(bswitch3,co.compressor_mono(ratio3,-push3,attack3,release3)):*(Makeup3) : vmeter3;
gcomp4s = vmeter9:ba.bypass1(bswitch4,co.compressor_mono(ratio4,-push4,attack4,release4)):*(Makeup4) : vmeter4;
gcomp5s = vmeter10:ba.bypass1(bswitch5,co.compressor_mono(ratio5,-push5,attack5,release5)):*(Makeup5) : vmeter5;
};
sel1 = hslider("Mode1[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel2 = hslider("Mode2[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel3 = hslider("Mode3[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel4 = hslider("Mode4[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
sel5 = hslider("Mode5[enum:Compress|Bypass|Mute][tooltip: Compress or Mute the selected band, or Bypass The Compressor]",1,1,3,1);
not(x) = abs(x-1);
mute1 = not(max(0,sel1-2));
mute2 = not(max(0,sel2-2));
mute3 = not(max(0,sel3-2));
mute4 = not(max(0,sel4-2));
mute5 = not(max(0,sel5-2));
bypass(switch, block) = _ <: select2(switch, _, block);
bswitch1 = max(0,sel1-1);
bswitch2 = max(0,sel2-1);
bswitch3 = max(0,sel3-1);
bswitch4 = max(0,sel4-1);
bswitch5 = max(0,sel5-1);
hifr1 =hslider("crossover_b1_b2 [log][name:Crossover B1-B2 (hz)][tooltip: Crossover fi.bandpass frequency]" ,80 , 20, 20000, 1.08);
hifr2 =hslider("crossover_b2_b3 [log][name:Crossover B2-B3 (hz)][tooltip: Crossover fi.bandpass frequency]",210,20,20000,1.08);
hifr3 =hslider("crossover_b3_b4 [log][name:Crossover B3-B4 (hz)][tooltip: Crossover fi.bandpass frequency]",1700,20,20000,1.08);
hifr4 =hslider("crossover_b4_b5 [log][name:Crossover B4-B5 (hz)][tooltip: Crossover fi.bandpass frequency]",5000,20,20000,1.08);
geq = fi.filterbank(3, (hifr1,hifr2,hifr3,hifr4));
ratio1 = hslider("[9] Ratio1 [tooltip: Compression ratio]",2,1,100,0.1);
attack1 = hslider("[A] Attack1 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release1 = hslider("[B] Release1 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio2 = hslider("[9] Ratio2 [tooltip: Compression ratio]",2,1,100,0.1);
attack2 = hslider("[A] Attack2 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release2 = hslider("[B] Release2 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio3 = hslider("[9] Ratio3 [tooltip: Compression ratio]",2,1,100,0.1);
attack3 = hslider("[A] Attack3 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release3 = hslider("[B] Release3 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio4 = hslider("[9] Ratio4 [tooltip: Compression ratio]",2,1,100,0.1);
attack4 = hslider("[A] Attack4 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release4 = hslider("[B] Release4 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
ratio5 = hslider("[9] Ratio5 [tooltip: Compression ratio]",2,1,100,0.1);
attack5 = hslider("[A] Attack5 [tooltip: Time before the compressor starts to kick in]", 0.012, 0.001, 1, 0.001);
release5 = hslider("[B] Release5 [tooltip: Time before the compressor releases the sound]", 1.25, 0.01, 10, 0.01);
Makeup1 = mute1* (not(bswitch1)*(push1-safe1) : ba.db2linear : si.smooth(0.999));
Makeup2 = mute2* (not(bswitch2)*(push2-safe2) : ba.db2linear : si.smooth(0.999));
Makeup3 = mute3* (not(bswitch3)*(push3-safe3) : ba.db2linear : si.smooth(0.999));
Makeup4 = mute4* (not(bswitch4)*(push4-safe4) : ba.db2linear : si.smooth(0.999));
Makeup5 = mute5* (not(bswitch5)*(push5-safe5) : ba.db2linear : si.smooth(0.999));
|
70f36d91ebe4c58e6c254bdcbfaedfabb9b8a440b6e6d2541a2ee071dfd1f425 | ml-wo/VirtualGuitarAmp-Guitarix | fuzzfacefm.dsp | // generated automatically
// DO NOT MODIFY!
declare id "fuzzfacefm";
declare name "Fuzz Face Fuller";
declare category "Distortion";
declare shortname "Fuzz Face FM";
declare description "Micke Fuller Fuzz Face simulation";
import("stdfaust.lib");
import("trany.lib");
process = fi.iir((b0/a0,b1/a0,b2/a0,b3/a0),(a1/a0,a2/a0,a3/a0)) : clip with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
clip = tranystage(TB_KT88_68k,86.0,2700.0,5.562895) : tranystage(TB_KT88_68k,86.0,2700.0,5.562895) ;
Drive = vslider("Drive[name:Drive]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
Fuzz = vslider("Fuzz[name:Fuzz]", 0.5, 0, 0.99, 0.01) : Inverted(1) : si.smooth(s);
Input = vslider("Input[name:Input]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
b0 = Drive*(Fuzz*(Fuzz*(-1.12927979815576e-15*Level*pow(fs,3) + 1.4115997476947e-15*pow(fs,3)) - 1.11420586447254e-13*Level*pow(fs,3) + 1.39275733059067e-13*pow(fs,3)) + Level*pow(fs,2)*(1.12549866245409e-13*fs + 2.58361695553557e-12) + pow(fs,2)*(-1.40687332806762e-13*fs - 3.22952119441946e-12)) + Fuzz*(Fuzz*(1.66004130328897e-15*Level*pow(fs,3) - 2.07505162911121e-15*pow(fs,3)) + 1.63788262077463e-13*Level*pow(fs,3) - 2.04735327596828e-13*pow(fs,3)) + Level*pow(fs,2)*(-1.65448303380752e-13*fs - 3.79791692463729e-12) + pow(fs,2)*(2.0681037922594e-13*fs + 4.74739615579661e-12);
b1 = Drive*(Fuzz*(Fuzz*(3.38783939446729e-15*Level*pow(fs,3) - 4.23479924308411e-15*pow(fs,3)) + 3.34261759341761e-13*Level*pow(fs,3) - 4.17827199177201e-13*pow(fs,3)) + Level*pow(fs,2)*(-3.37649598736228e-13*fs - 2.58361695553557e-12) + pow(fs,2)*(4.22061998420285e-13*fs + 3.22952119441946e-12)) + Fuzz*(Fuzz*(-4.98012390986691e-15*Level*pow(fs,3) + 6.22515488733364e-15*pow(fs,3)) - 4.91364786232388e-13*Level*pow(fs,3) + 6.14205982790485e-13*pow(fs,3)) + Level*pow(fs,2)*(4.96344910142255e-13*fs + 3.79791692463729e-12) + pow(fs,2)*(-6.20431137677819e-13*fs - 4.74739615579661e-12);
b2 = Drive*(Fuzz*(Fuzz*(-3.38783939446729e-15*Level*pow(fs,3) + 4.23479924308411e-15*pow(fs,3)) - 3.34261759341761e-13*Level*pow(fs,3) + 4.17827199177201e-13*pow(fs,3)) + Level*pow(fs,2)*(3.37649598736228e-13*fs - 2.58361695553557e-12) + pow(fs,2)*(-4.22061998420285e-13*fs + 3.22952119441946e-12)) + Fuzz*(Fuzz*(4.98012390986691e-15*Level*pow(fs,3) - 6.22515488733364e-15*pow(fs,3)) + 4.91364786232388e-13*Level*pow(fs,3) - 6.14205982790485e-13*pow(fs,3)) + Level*pow(fs,2)*(-4.96344910142255e-13*fs + 3.79791692463729e-12) + pow(fs,2)*(6.20431137677819e-13*fs - 4.74739615579661e-12);
b3 = Drive*(Fuzz*(Fuzz*(1.12927979815576e-15*Level*pow(fs,3) - 1.4115997476947e-15*pow(fs,3)) + 1.11420586447254e-13*Level*pow(fs,3) - 1.39275733059067e-13*pow(fs,3)) + Level*pow(fs,2)*(-1.12549866245409e-13*fs + 2.58361695553557e-12) + pow(fs,2)*(1.40687332806762e-13*fs - 3.22952119441946e-12)) + Fuzz*(Fuzz*(-1.66004130328897e-15*Level*pow(fs,3) + 2.07505162911121e-15*pow(fs,3)) - 1.63788262077463e-13*Level*pow(fs,3) + 2.04735327596828e-13*pow(fs,3)) + Level*pow(fs,2)*(1.65448303380752e-13*fs - 3.79791692463729e-12) + pow(fs,2)*(-2.0681037922594e-13*fs + 4.74739615579661e-12);
a0 = Drive*(Fuzz*(Fuzz*fs*(fs*(1.42504059392599e-16*fs + 6.43443174346988e-16) - 3.26234246975457e-55) + fs*(fs*(-1.42392288693486e-16*fs - 6.43214948741896e-16) + 3.45797348759893e-55)) + fs*(fs*(-1.1177069911304e-19*fs - 3.24149709132582e-15) - 1.46288954534563e-14) + 6.96979875434139e-54) + Fuzz*(Fuzz*fs*(fs*(-7.14615106636066e-14*fs - 7.44787041826973e-12) - 3.21721587173494e-11) + fs*(fs*(7.14054610111223e-14*fs + 7.44216743501989e-12) + 3.21607474370948e-11)) + Input*(Drive*(Fuzz*(Fuzz*pow(fs,2)*(-1.41557498356337e-16*fs + 7.17715343346006e-56) + pow(fs,2)*(1.41507288723217e-16*fs - 7.60754167271764e-56)) + fs*(fs*(5.02096331201311e-20*fs + 3.21835699976039e-15) - 1.53335572595511e-54)) + Fuzz*(Fuzz*pow(fs,2)*(7.09868387007524e-14*fs + 7.07787491781686e-12) + pow(fs,2)*(-7.09616600760317e-14*fs - 7.07536443616085e-12)) + fs*(fs*(-2.51786247207522e-17*fs - 1.61641996632585e-12) - 1.6091784998802e-10)) + fs*(fs*(5.60496524842164e-17*fs + 1.63110208134281e-12) + 1.69410806769336e-10) + 7.31444772672817e-10;
a1 = Drive*(Fuzz*(Fuzz*fs*(fs*(-4.27512178177797e-16*fs - 6.43443174346988e-16) - 3.26234246975457e-55) + fs*(fs*(4.27176866080457e-16*fs + 6.43214948741896e-16) + 3.45797348759893e-55)) + fs*(fs*(3.35312097339121e-19*fs + 3.24149709132582e-15) - 1.46288954534563e-14) + 2.09093962630242e-53) + Fuzz*(Fuzz*fs*(fs*(2.1438453199082e-13*fs + 7.44787041826973e-12) - 3.21721587173494e-11) + fs*(fs*(-2.14216383033367e-13*fs - 7.44216743501989e-12) + 3.21607474370948e-11)) + Input*(Drive*(Fuzz*(Fuzz*pow(fs,2)*(4.24672495069012e-16*fs - 7.17715343346006e-56) + pow(fs,2)*(-4.24521866169651e-16*fs + 7.60754167271764e-56)) + fs*(fs*(-1.50628899360393e-19*fs - 3.21835699976039e-15) - 1.53335572595511e-54)) + Fuzz*(Fuzz*pow(fs,2)*(-2.12960516102257e-13*fs - 7.07787491781686e-12) + pow(fs,2)*(2.12884980228095e-13*fs + 7.07536443616085e-12)) + fs*(fs*(7.55358741622564e-17*fs + 1.61641996632585e-12) - 1.6091784998802e-10)) + fs*(fs*(-1.68148957452649e-16*fs - 1.63110208134281e-12) + 1.69410806769336e-10) + 2.19433431801845e-9;
a2 = Drive*(Fuzz*(Fuzz*fs*(fs*(4.27512178177797e-16*fs - 6.43443174346988e-16) + 3.26234246975457e-55) + fs*(fs*(-4.27176866080457e-16*fs + 6.43214948741896e-16) - 3.45797348759893e-55)) + fs*(fs*(-3.35312097339121e-19*fs + 3.24149709132582e-15) + 1.46288954534563e-14) + 2.09093962630242e-53) + Fuzz*(Fuzz*fs*(fs*(-2.1438453199082e-13*fs + 7.44787041826973e-12) + 3.21721587173494e-11) + fs*(fs*(2.14216383033367e-13*fs - 7.44216743501989e-12) - 3.21607474370948e-11)) + Input*(Drive*(Fuzz*(Fuzz*pow(fs,2)*(-4.24672495069012e-16*fs - 7.17715343346006e-56) + pow(fs,2)*(4.24521866169651e-16*fs + 7.60754167271764e-56)) + fs*(fs*(1.50628899360393e-19*fs - 3.21835699976039e-15) + 1.53335572595511e-54)) + Fuzz*(Fuzz*pow(fs,2)*(2.12960516102257e-13*fs - 7.07787491781686e-12) + pow(fs,2)*(-2.12884980228095e-13*fs + 7.07536443616085e-12)) + fs*(fs*(-7.55358741622564e-17*fs + 1.61641996632585e-12) + 1.6091784998802e-10)) + fs*(fs*(1.68148957452649e-16*fs - 1.63110208134281e-12) - 1.69410806769336e-10) + 2.19433431801845e-9;
a3 = Drive*(Fuzz*(Fuzz*fs*(fs*(-1.42504059392599e-16*fs + 6.43443174346988e-16) + 3.26234246975457e-55) + fs*(fs*(1.42392288693486e-16*fs - 6.43214948741896e-16) - 3.45797348759893e-55)) + fs*(fs*(1.1177069911304e-19*fs - 3.24149709132582e-15) + 1.46288954534563e-14) + 6.96979875434139e-54) + Fuzz*(Fuzz*fs*(fs*(7.14615106636066e-14*fs - 7.44787041826973e-12) + 3.21721587173494e-11) + fs*(fs*(-7.14054610111223e-14*fs + 7.44216743501989e-12) - 3.21607474370948e-11)) + Input*(Drive*(Fuzz*(Fuzz*pow(fs,2)*(1.41557498356337e-16*fs + 7.17715343346006e-56) + pow(fs,2)*(-1.41507288723217e-16*fs - 7.60754167271764e-56)) + fs*(fs*(-5.02096331201311e-20*fs + 3.21835699976039e-15) + 1.53335572595511e-54)) + Fuzz*(Fuzz*pow(fs,2)*(-7.09868387007524e-14*fs + 7.07787491781686e-12) + pow(fs,2)*(7.09616600760317e-14*fs - 7.07536443616085e-12)) + fs*(fs*(2.51786247207522e-17*fs - 1.61641996632585e-12) + 1.6091784998802e-10)) + fs*(fs*(-5.60496524842164e-17*fs + 1.63110208134281e-12) - 1.69410806769336e-10) + 7.31444772672817e-10;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/fuzzfacefm.dsp | faust | generated automatically
DO NOT MODIFY! | declare id "fuzzfacefm";
declare name "Fuzz Face Fuller";
declare category "Distortion";
declare shortname "Fuzz Face FM";
declare description "Micke Fuller Fuzz Face simulation";
import("stdfaust.lib");
import("trany.lib");
process = fi.iir((b0/a0,b1/a0,b2/a0,b3/a0),(a1/a0,a2/a0,a3/a0)) : clip with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
clip = tranystage(TB_KT88_68k,86.0,2700.0,5.562895) : tranystage(TB_KT88_68k,86.0,2700.0,5.562895) ;
Drive = vslider("Drive[name:Drive]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
Fuzz = vslider("Fuzz[name:Fuzz]", 0.5, 0, 0.99, 0.01) : Inverted(1) : si.smooth(s);
Input = vslider("Input[name:Input]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
b0 = Drive*(Fuzz*(Fuzz*(-1.12927979815576e-15*Level*pow(fs,3) + 1.4115997476947e-15*pow(fs,3)) - 1.11420586447254e-13*Level*pow(fs,3) + 1.39275733059067e-13*pow(fs,3)) + Level*pow(fs,2)*(1.12549866245409e-13*fs + 2.58361695553557e-12) + pow(fs,2)*(-1.40687332806762e-13*fs - 3.22952119441946e-12)) + Fuzz*(Fuzz*(1.66004130328897e-15*Level*pow(fs,3) - 2.07505162911121e-15*pow(fs,3)) + 1.63788262077463e-13*Level*pow(fs,3) - 2.04735327596828e-13*pow(fs,3)) + Level*pow(fs,2)*(-1.65448303380752e-13*fs - 3.79791692463729e-12) + pow(fs,2)*(2.0681037922594e-13*fs + 4.74739615579661e-12);
b1 = Drive*(Fuzz*(Fuzz*(3.38783939446729e-15*Level*pow(fs,3) - 4.23479924308411e-15*pow(fs,3)) + 3.34261759341761e-13*Level*pow(fs,3) - 4.17827199177201e-13*pow(fs,3)) + Level*pow(fs,2)*(-3.37649598736228e-13*fs - 2.58361695553557e-12) + pow(fs,2)*(4.22061998420285e-13*fs + 3.22952119441946e-12)) + Fuzz*(Fuzz*(-4.98012390986691e-15*Level*pow(fs,3) + 6.22515488733364e-15*pow(fs,3)) - 4.91364786232388e-13*Level*pow(fs,3) + 6.14205982790485e-13*pow(fs,3)) + Level*pow(fs,2)*(4.96344910142255e-13*fs + 3.79791692463729e-12) + pow(fs,2)*(-6.20431137677819e-13*fs - 4.74739615579661e-12);
b2 = Drive*(Fuzz*(Fuzz*(-3.38783939446729e-15*Level*pow(fs,3) + 4.23479924308411e-15*pow(fs,3)) - 3.34261759341761e-13*Level*pow(fs,3) + 4.17827199177201e-13*pow(fs,3)) + Level*pow(fs,2)*(3.37649598736228e-13*fs - 2.58361695553557e-12) + pow(fs,2)*(-4.22061998420285e-13*fs + 3.22952119441946e-12)) + Fuzz*(Fuzz*(4.98012390986691e-15*Level*pow(fs,3) - 6.22515488733364e-15*pow(fs,3)) + 4.91364786232388e-13*Level*pow(fs,3) - 6.14205982790485e-13*pow(fs,3)) + Level*pow(fs,2)*(-4.96344910142255e-13*fs + 3.79791692463729e-12) + pow(fs,2)*(6.20431137677819e-13*fs - 4.74739615579661e-12);
b3 = Drive*(Fuzz*(Fuzz*(1.12927979815576e-15*Level*pow(fs,3) - 1.4115997476947e-15*pow(fs,3)) + 1.11420586447254e-13*Level*pow(fs,3) - 1.39275733059067e-13*pow(fs,3)) + Level*pow(fs,2)*(-1.12549866245409e-13*fs + 2.58361695553557e-12) + pow(fs,2)*(1.40687332806762e-13*fs - 3.22952119441946e-12)) + Fuzz*(Fuzz*(-1.66004130328897e-15*Level*pow(fs,3) + 2.07505162911121e-15*pow(fs,3)) - 1.63788262077463e-13*Level*pow(fs,3) + 2.04735327596828e-13*pow(fs,3)) + Level*pow(fs,2)*(1.65448303380752e-13*fs - 3.79791692463729e-12) + pow(fs,2)*(-2.0681037922594e-13*fs + 4.74739615579661e-12);
a0 = Drive*(Fuzz*(Fuzz*fs*(fs*(1.42504059392599e-16*fs + 6.43443174346988e-16) - 3.26234246975457e-55) + fs*(fs*(-1.42392288693486e-16*fs - 6.43214948741896e-16) + 3.45797348759893e-55)) + fs*(fs*(-1.1177069911304e-19*fs - 3.24149709132582e-15) - 1.46288954534563e-14) + 6.96979875434139e-54) + Fuzz*(Fuzz*fs*(fs*(-7.14615106636066e-14*fs - 7.44787041826973e-12) - 3.21721587173494e-11) + fs*(fs*(7.14054610111223e-14*fs + 7.44216743501989e-12) + 3.21607474370948e-11)) + Input*(Drive*(Fuzz*(Fuzz*pow(fs,2)*(-1.41557498356337e-16*fs + 7.17715343346006e-56) + pow(fs,2)*(1.41507288723217e-16*fs - 7.60754167271764e-56)) + fs*(fs*(5.02096331201311e-20*fs + 3.21835699976039e-15) - 1.53335572595511e-54)) + Fuzz*(Fuzz*pow(fs,2)*(7.09868387007524e-14*fs + 7.07787491781686e-12) + pow(fs,2)*(-7.09616600760317e-14*fs - 7.07536443616085e-12)) + fs*(fs*(-2.51786247207522e-17*fs - 1.61641996632585e-12) - 1.6091784998802e-10)) + fs*(fs*(5.60496524842164e-17*fs + 1.63110208134281e-12) + 1.69410806769336e-10) + 7.31444772672817e-10;
a1 = Drive*(Fuzz*(Fuzz*fs*(fs*(-4.27512178177797e-16*fs - 6.43443174346988e-16) - 3.26234246975457e-55) + fs*(fs*(4.27176866080457e-16*fs + 6.43214948741896e-16) + 3.45797348759893e-55)) + fs*(fs*(3.35312097339121e-19*fs + 3.24149709132582e-15) - 1.46288954534563e-14) + 2.09093962630242e-53) + Fuzz*(Fuzz*fs*(fs*(2.1438453199082e-13*fs + 7.44787041826973e-12) - 3.21721587173494e-11) + fs*(fs*(-2.14216383033367e-13*fs - 7.44216743501989e-12) + 3.21607474370948e-11)) + Input*(Drive*(Fuzz*(Fuzz*pow(fs,2)*(4.24672495069012e-16*fs - 7.17715343346006e-56) + pow(fs,2)*(-4.24521866169651e-16*fs + 7.60754167271764e-56)) + fs*(fs*(-1.50628899360393e-19*fs - 3.21835699976039e-15) - 1.53335572595511e-54)) + Fuzz*(Fuzz*pow(fs,2)*(-2.12960516102257e-13*fs - 7.07787491781686e-12) + pow(fs,2)*(2.12884980228095e-13*fs + 7.07536443616085e-12)) + fs*(fs*(7.55358741622564e-17*fs + 1.61641996632585e-12) - 1.6091784998802e-10)) + fs*(fs*(-1.68148957452649e-16*fs - 1.63110208134281e-12) + 1.69410806769336e-10) + 2.19433431801845e-9;
a2 = Drive*(Fuzz*(Fuzz*fs*(fs*(4.27512178177797e-16*fs - 6.43443174346988e-16) + 3.26234246975457e-55) + fs*(fs*(-4.27176866080457e-16*fs + 6.43214948741896e-16) - 3.45797348759893e-55)) + fs*(fs*(-3.35312097339121e-19*fs + 3.24149709132582e-15) + 1.46288954534563e-14) + 2.09093962630242e-53) + Fuzz*(Fuzz*fs*(fs*(-2.1438453199082e-13*fs + 7.44787041826973e-12) + 3.21721587173494e-11) + fs*(fs*(2.14216383033367e-13*fs - 7.44216743501989e-12) - 3.21607474370948e-11)) + Input*(Drive*(Fuzz*(Fuzz*pow(fs,2)*(-4.24672495069012e-16*fs - 7.17715343346006e-56) + pow(fs,2)*(4.24521866169651e-16*fs + 7.60754167271764e-56)) + fs*(fs*(1.50628899360393e-19*fs - 3.21835699976039e-15) + 1.53335572595511e-54)) + Fuzz*(Fuzz*pow(fs,2)*(2.12960516102257e-13*fs - 7.07787491781686e-12) + pow(fs,2)*(-2.12884980228095e-13*fs + 7.07536443616085e-12)) + fs*(fs*(-7.55358741622564e-17*fs + 1.61641996632585e-12) + 1.6091784998802e-10)) + fs*(fs*(1.68148957452649e-16*fs - 1.63110208134281e-12) - 1.69410806769336e-10) + 2.19433431801845e-9;
a3 = Drive*(Fuzz*(Fuzz*fs*(fs*(-1.42504059392599e-16*fs + 6.43443174346988e-16) + 3.26234246975457e-55) + fs*(fs*(1.42392288693486e-16*fs - 6.43214948741896e-16) - 3.45797348759893e-55)) + fs*(fs*(1.1177069911304e-19*fs - 3.24149709132582e-15) + 1.46288954534563e-14) + 6.96979875434139e-54) + Fuzz*(Fuzz*fs*(fs*(7.14615106636066e-14*fs - 7.44787041826973e-12) + 3.21721587173494e-11) + fs*(fs*(-7.14054610111223e-14*fs + 7.44216743501989e-12) - 3.21607474370948e-11)) + Input*(Drive*(Fuzz*(Fuzz*pow(fs,2)*(1.41557498356337e-16*fs + 7.17715343346006e-56) + pow(fs,2)*(-1.41507288723217e-16*fs - 7.60754167271764e-56)) + fs*(fs*(-5.02096331201311e-20*fs + 3.21835699976039e-15) + 1.53335572595511e-54)) + Fuzz*(Fuzz*pow(fs,2)*(-7.09868387007524e-14*fs + 7.07787491781686e-12) + pow(fs,2)*(7.09616600760317e-14*fs - 7.07536443616085e-12)) + fs*(fs*(2.51786247207522e-17*fs - 1.61641996632585e-12) + 1.6091784998802e-10)) + fs*(fs*(-5.60496524842164e-17*fs + 1.63110208134281e-12) - 1.69410806769336e-10) + 7.31444772672817e-10;
};
|
3baa831c53d57fed5aa69d8a2ea882380bbd7d646c2b633c3f45169192e05fc6 | ml-wo/VirtualGuitarAmp-Guitarix | tonestack_bm.dsp | //tonestack ba.selector
declare id "tonestack_bm";
import("stdfaust.lib");
/****************************************************************
** Equalisation 3 bandes
** C1
** IN >---------||---------
** | |
** | | R4 | | R1 Treble
** | | | |<------< Out
** | | | |
** | C2 |
** |-------||--------|------
** | | |
** | | | |
** | | |<---- R2 Bass
** | | |
** | |
** | C3 | |
** --------||------>| | R3 Middle
** | |
** |
** _|_
** -
*/
/****************************************************************
** Guitar tone stacks
** values from CAPS plugin tonestack (based on work from D.T. Yeh)
** this version use only one controler like the Big Muff
*/
ts = environment {
k = *(1e3);
M = *(1e6);
nF = *(1e-9);
pF = *(1e-12);
/* Fender */
bassman = environment { /* 59 Bassman 5F6-A */
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
R4 = 56:k;
C1 = 250:pF;
C2 = 20:nF;
C3 = 20:nF;
};
mesa = environment { /* Mesa Boogie Mark */
R1 = 250:k;
R2 = 250:k;
R3 = 25:k;
R4 = 100:k;
C1 = 250:pF;
C2 = 100:nF;
C3 = 47:nF;
};
twin = environment { /* 69 Twin Reverb AA270 */
R1 = 250:k;
R2 = 250:k;
R3 = 10:k;
R4 = 100:k;
C1 = 120:pF;
C2 = 100:nF;
C3 = 47:nF;
};
princeton = environment { /* 64 Princeton AA1164 */
R1 = 250:k;
R2 = 250:k;
R3 = 4.8:k;
R4 = 100:k;
C1 = 250:pF;
C2 = 100:nF;
C3 = 47:nF;
};
/* Marshall */
jcm800 = environment { /* 59/81 JCM-800 Lead 100 2203 */
R1 = 220:k;
R2 = 1:M;
R3 = 22:k;
R4 = 33:k;
C1 = 470:pF;
C2 = 22:nF;
C3 = 22:nF;
};
/* 90 JCM-900 Master 2100: same as JCM-800 */
jcm2000 = environment { /* 81 2000 Lead */
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
R4 = 56:k; /* a 10 k fixed + 100 k pot in series actually */
C1 = 500:pF;
C2 = 22:nF;
C3 = 22:nF;
};
jtm45 = environment { /* JTM 45 */
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
R4 = 33:k;
C1 = 270:pF;
C2 = 22:nF;
C3 = 22:nF;
};
/* parameter order is R1 - R4, C1 - C3 */
mlead = environment { /* 67 Major Lead 200 */
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
R4 = 33:k;
C1 = 500:pF;
C2 = 22:nF;
C3 = 22:nF;
};
m2199 = environment { /* undated M2199 30W solid state */
R1 = 250:k;
R2 = 250:k;
R3 = 25:k;
R4 = 56:k;
C1 = 250:pF;
C2 = 47:nF;
C3 = 47:nF;
};
/* Vox */
ac30 = environment { /* 59/86 AC-30 */
/* R3 is fixed (circuit differs anyway) */
R1 = 1:M;
R2 = 1:M;
R3 = 10:k;
R4 = 100:k;
C1 = 50:pF;
C2 = 22:nF;
C3 = 22:nF;
};
ac15 = environment { /* VOX AC-15 */
R1 = 220:k;
R2 = 220:k;
R3 = 220:k;
R4 = 100:k;
C1 = 470:pF;
C2 = 100:nF;
C3 = 47:nF;
};
soldano = environment { /* Soldano SLO 100 */
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
R4 = 47:k;
C1 = 470:pF;
C2 = 20:nF;
C3 = 20:nF;
};
sovtek = environment { /* MIG 100 H*/
R1 = 500:k;
R2 = 1:M;
R3 = 10:k;
R4 = 47:k;
C1 = 470:pF;
C2 = 22:nF;
C3 = 22:nF;
};
peavey = environment { /* c20*/
R1 = 250:k;
R2 = 250:k;
R3 = 20:k;
R4 = 68:k;
C1 = 270:pF;
C2 = 22:nF;
C3 = 22:nF;
};
ibanez = environment { /* gx20 */
R1 = 250:k;
R2 = 250:k;
R3 = 10:k;
R4 = 100:k;
C1 = 270:pF;
C2 = 100:nF;
C3 = 40:nF;
};
roland = environment { /* Cube 60 */
R1 = 250:k;
R2 = 250:k;
R3 = 10:k;
R4 = 41:k;
C1 = 240:pF;
C2 = 33:nF;
C3 = 82:nF;
};
ampeg = environment { /* VL 501 */
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
R4 = 32:k;
C1 = 470:pF;
C2 = 22:nF;
C3 = 22:nF;
};
ampeg_rev = environment { /* reverbrocket*/
R1 = 250:k;
R2 = 250:k;
R3 = 10:k;
R4 = 100:k;
C1 = 100:pF;
C2 = 100:nF;
C3 = 47:nF;
};
bogner = environment { /* Triple Giant Preamp */
R1 = 250:k;
R2 = 1:M;
R3 = 33:k;
R4 = 51:k;
C1 = 220:pF;
C2 = 15:nF;
C3 = 47:nF;
};
groove = environment { /* Trio Preamp */
R1 = 220:k;
R2 = 1:M;
R3 = 22:k;
R4 = 68:k;
C1 = 470:pF;
C2 = 22:nF;
C3 = 22:nF;
};
crunch = environment { /* Hughes&Kettner */
R1 = 220:k;
R2 = 220:k;
R3 = 10:k;
R4 = 100:k;
C1 = 220:pF;
C2 = 47:nF;
C3 = 47:nF;
};
fender_blues = environment { /* Fender blues junior */
R1 = 250:k;
R2 = 250:k;
R3 = 25:k;
R4 = 100:k;
C1 = 250:pF;
C2 = 22:nF;
C3 = 22:nF;
};
fender_default = environment { /* Fender */
R1 = 250:k;
R2 = 250:k;
R3 = 10:k;
R4 = 100:k;
C1 = 250:pF;
C2 = 100:nF;
C3 = 47:nF;
};
fender_deville = environment { /* Fender Hot Rod */
R1 = 250:k;
R2 = 250:k;
R3 = 25:k;
R4 = 130:k;
C1 = 250:pF;
C2 = 100:nF;
C3 = 22:nF;
};
gibsen = environment { /* gs12 reverbrocket */
R1 = 1:M;
R2 = 1:M;
R3 = 94:k; // 47k fixed
R4 = 270:k;
C1 = 25:pF;
C2 = 60:nF;
C3 = 20:nF;
};
};
t = vslider(".amp.tonestack.tone[alias]", 0.5, 0, 1, 0.01);
m = 0.5;
l = 1-t : (_-1)*3.4 : exp;
tonestack = 1/A0*fi.iir((B0,B1,B2,B3),(A1/A0,A2/A0,A3/A0)) with {
C1 = tse.C1;
C2 = tse.C2;
C3 = tse.C3;
R1 = tse.R1;
R2 = tse.R2;
R3 = tse.R3;
R4 = tse.R4;
b1 = t*C1*R1 + m*C3*R3 + l*(C1*R2 + C2*R2) + (C1*R3 + C2*R3);
b2 = t*(C1*C2*R1*R4 + C1*C3*R1*R4) - m*m*(C1*C3*R3*R3 + C2*C3*R3*R3)
+ m*(C1*C3*R1*R3 + C1*C3*R3*R3 + C2*C3*R3*R3)
+ l*(C1*C2*R1*R2 + C1*C2*R2*R4 + C1*C3*R2*R4)
+ l*m*(C1*C3*R2*R3 + C2*C3*R2*R3)
+ (C1*C2*R1*R3 + C1*C2*R3*R4 + C1*C3*R3*R4);
b3 = l*m*(C1*C2*C3*R1*R2*R3 + C1*C2*C3*R2*R3*R4)
- m*m*(C1*C2*C3*R1*R3*R3 + C1*C2*C3*R3*R3*R4)
+ m*(C1*C2*C3*R1*R3*R3 + C1*C2*C3*R3*R3*R4)
+ t*C1*C2*C3*R1*R3*R4 - t*m*C1*C2*C3*R1*R3*R4
+ t*l*C1*C2*C3*R1*R2*R4;
a0 = 1;
a1 = (C1*R1 + C1*R3 + C2*R3 + C2*R4 + C3*R4)
+ m*C3*R3 + l*(C1*R2 + C2*R2);
a2 = m*(C1*C3*R1*R3 - C2*C3*R3*R4 + C1*C3*R3*R3 + C2*C3*R3*R3)
+ l*m*(C1*C3*R2*R3 + C2*C3*R2*R3)
- m*m*(C1*C3*R3*R3 + C2*C3*R3*R3)
+ l*(C1*C2*R2*R4 + C1*C2*R1*R2 + C1*C3*R2*R4 + C2*C3*R2*R4)
+ (C1*C2*R1*R4 + C1*C3*R1*R4 + C1*C2*R3*R4 + C1*C2*R1*R3 + C1*C3*R3*R4 + C2*C3*R3*R4);
a3 = l*m*(C1*C2*C3*R1*R2*R3 + C1*C2*C3*R2*R3*R4)
- m*m*(C1*C2*C3*R1*R3*R3 + C1*C2*C3*R3*R3*R4)
+ m*(C1*C2*C3*R3*R3*R4 + C1*C2*C3*R1*R3*R3 - C1*C2*C3*R1*R3*R4)
+ l*C1*C2*C3*R1*R2*R4
+ C1*C2*C3*R1*R3*R4;
c = 2*float(ma.SR);
B0 = -b1*c - b2*pow(c,2) - b3*pow(c,3);
B1 = -b1*c + b2*pow(c,2) + 3*b3*pow(c,3);
B2 = b1*c + b2*pow(c,2) - 3*b3*pow(c,3);
B3 = b1*c - b2*pow(c,2) + b3*pow(c,3);
A0 = -a0 - a1*c - a2*pow(c,2) - a3*pow(c,3);
A1 = -3*a0 - a1*c + a2*pow(c,2) + 3*a3*pow(c,3);
A2 = -3*a0 + a1*c + a2*pow(c,2) - 3*a3*pow(c,3);
A3 = -a0 + a1*c - a2*pow(c,2) + a3*pow(c,3);
};
tse = ts.bassman;
process = tonestack;
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/tonestack_bm.dsp | faust | tonestack ba.selector
***************************************************************
** Equalisation 3 bandes
** C1
** IN >---------||---------
** | |
** | | R4 | | R1 Treble
** | | | |<------< Out
** | | | |
** | C2 |
** |-------||--------|------
** | | |
** | | | |
** | | |<---- R2 Bass
** | | |
** | |
** | C3 | |
** --------||------>| | R3 Middle
** | |
** |
** _|_
** -
***************************************************************
** Guitar tone stacks
** values from CAPS plugin tonestack (based on work from D.T. Yeh)
** this version use only one controler like the Big Muff
Fender
59 Bassman 5F6-A
Mesa Boogie Mark
69 Twin Reverb AA270
64 Princeton AA1164
Marshall
59/81 JCM-800 Lead 100 2203
90 JCM-900 Master 2100: same as JCM-800
81 2000 Lead
a 10 k fixed + 100 k pot in series actually
JTM 45
parameter order is R1 - R4, C1 - C3
67 Major Lead 200
undated M2199 30W solid state
Vox
59/86 AC-30
R3 is fixed (circuit differs anyway)
VOX AC-15
Soldano SLO 100
MIG 100 H
c20
gx20
Cube 60
VL 501
reverbrocket
Triple Giant Preamp
Trio Preamp
Hughes&Kettner
Fender blues junior
Fender
Fender Hot Rod
gs12 reverbrocket
47k fixed |
declare id "tonestack_bm";
import("stdfaust.lib");
ts = environment {
k = *(1e3);
M = *(1e6);
nF = *(1e-9);
pF = *(1e-12);
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
R4 = 56:k;
C1 = 250:pF;
C2 = 20:nF;
C3 = 20:nF;
};
R1 = 250:k;
R2 = 250:k;
R3 = 25:k;
R4 = 100:k;
C1 = 250:pF;
C2 = 100:nF;
C3 = 47:nF;
};
R1 = 250:k;
R2 = 250:k;
R3 = 10:k;
R4 = 100:k;
C1 = 120:pF;
C2 = 100:nF;
C3 = 47:nF;
};
R1 = 250:k;
R2 = 250:k;
R3 = 4.8:k;
R4 = 100:k;
C1 = 250:pF;
C2 = 100:nF;
C3 = 47:nF;
};
R1 = 220:k;
R2 = 1:M;
R3 = 22:k;
R4 = 33:k;
C1 = 470:pF;
C2 = 22:nF;
C3 = 22:nF;
};
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
C1 = 500:pF;
C2 = 22:nF;
C3 = 22:nF;
};
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
R4 = 33:k;
C1 = 270:pF;
C2 = 22:nF;
C3 = 22:nF;
};
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
R4 = 33:k;
C1 = 500:pF;
C2 = 22:nF;
C3 = 22:nF;
};
R1 = 250:k;
R2 = 250:k;
R3 = 25:k;
R4 = 56:k;
C1 = 250:pF;
C2 = 47:nF;
C3 = 47:nF;
};
R1 = 1:M;
R2 = 1:M;
R3 = 10:k;
R4 = 100:k;
C1 = 50:pF;
C2 = 22:nF;
C3 = 22:nF;
};
R1 = 220:k;
R2 = 220:k;
R3 = 220:k;
R4 = 100:k;
C1 = 470:pF;
C2 = 100:nF;
C3 = 47:nF;
};
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
R4 = 47:k;
C1 = 470:pF;
C2 = 20:nF;
C3 = 20:nF;
};
R1 = 500:k;
R2 = 1:M;
R3 = 10:k;
R4 = 47:k;
C1 = 470:pF;
C2 = 22:nF;
C3 = 22:nF;
};
R1 = 250:k;
R2 = 250:k;
R3 = 20:k;
R4 = 68:k;
C1 = 270:pF;
C2 = 22:nF;
C3 = 22:nF;
};
R1 = 250:k;
R2 = 250:k;
R3 = 10:k;
R4 = 100:k;
C1 = 270:pF;
C2 = 100:nF;
C3 = 40:nF;
};
R1 = 250:k;
R2 = 250:k;
R3 = 10:k;
R4 = 41:k;
C1 = 240:pF;
C2 = 33:nF;
C3 = 82:nF;
};
R1 = 250:k;
R2 = 1:M;
R3 = 25:k;
R4 = 32:k;
C1 = 470:pF;
C2 = 22:nF;
C3 = 22:nF;
};
R1 = 250:k;
R2 = 250:k;
R3 = 10:k;
R4 = 100:k;
C1 = 100:pF;
C2 = 100:nF;
C3 = 47:nF;
};
R1 = 250:k;
R2 = 1:M;
R3 = 33:k;
R4 = 51:k;
C1 = 220:pF;
C2 = 15:nF;
C3 = 47:nF;
};
R1 = 220:k;
R2 = 1:M;
R3 = 22:k;
R4 = 68:k;
C1 = 470:pF;
C2 = 22:nF;
C3 = 22:nF;
};
R1 = 220:k;
R2 = 220:k;
R3 = 10:k;
R4 = 100:k;
C1 = 220:pF;
C2 = 47:nF;
C3 = 47:nF;
};
R1 = 250:k;
R2 = 250:k;
R3 = 25:k;
R4 = 100:k;
C1 = 250:pF;
C2 = 22:nF;
C3 = 22:nF;
};
R1 = 250:k;
R2 = 250:k;
R3 = 10:k;
R4 = 100:k;
C1 = 250:pF;
C2 = 100:nF;
C3 = 47:nF;
};
R1 = 250:k;
R2 = 250:k;
R3 = 25:k;
R4 = 130:k;
C1 = 250:pF;
C2 = 100:nF;
C3 = 22:nF;
};
R1 = 1:M;
R2 = 1:M;
R4 = 270:k;
C1 = 25:pF;
C2 = 60:nF;
C3 = 20:nF;
};
};
t = vslider(".amp.tonestack.tone[alias]", 0.5, 0, 1, 0.01);
m = 0.5;
l = 1-t : (_-1)*3.4 : exp;
tonestack = 1/A0*fi.iir((B0,B1,B2,B3),(A1/A0,A2/A0,A3/A0)) with {
C1 = tse.C1;
C2 = tse.C2;
C3 = tse.C3;
R1 = tse.R1;
R2 = tse.R2;
R3 = tse.R3;
R4 = tse.R4;
b1 = t*C1*R1 + m*C3*R3 + l*(C1*R2 + C2*R2) + (C1*R3 + C2*R3);
b2 = t*(C1*C2*R1*R4 + C1*C3*R1*R4) - m*m*(C1*C3*R3*R3 + C2*C3*R3*R3)
+ m*(C1*C3*R1*R3 + C1*C3*R3*R3 + C2*C3*R3*R3)
+ l*(C1*C2*R1*R2 + C1*C2*R2*R4 + C1*C3*R2*R4)
+ l*m*(C1*C3*R2*R3 + C2*C3*R2*R3)
+ (C1*C2*R1*R3 + C1*C2*R3*R4 + C1*C3*R3*R4);
b3 = l*m*(C1*C2*C3*R1*R2*R3 + C1*C2*C3*R2*R3*R4)
- m*m*(C1*C2*C3*R1*R3*R3 + C1*C2*C3*R3*R3*R4)
+ m*(C1*C2*C3*R1*R3*R3 + C1*C2*C3*R3*R3*R4)
+ t*C1*C2*C3*R1*R3*R4 - t*m*C1*C2*C3*R1*R3*R4
+ t*l*C1*C2*C3*R1*R2*R4;
a0 = 1;
a1 = (C1*R1 + C1*R3 + C2*R3 + C2*R4 + C3*R4)
+ m*C3*R3 + l*(C1*R2 + C2*R2);
a2 = m*(C1*C3*R1*R3 - C2*C3*R3*R4 + C1*C3*R3*R3 + C2*C3*R3*R3)
+ l*m*(C1*C3*R2*R3 + C2*C3*R2*R3)
- m*m*(C1*C3*R3*R3 + C2*C3*R3*R3)
+ l*(C1*C2*R2*R4 + C1*C2*R1*R2 + C1*C3*R2*R4 + C2*C3*R2*R4)
+ (C1*C2*R1*R4 + C1*C3*R1*R4 + C1*C2*R3*R4 + C1*C2*R1*R3 + C1*C3*R3*R4 + C2*C3*R3*R4);
a3 = l*m*(C1*C2*C3*R1*R2*R3 + C1*C2*C3*R2*R3*R4)
- m*m*(C1*C2*C3*R1*R3*R3 + C1*C2*C3*R3*R3*R4)
+ m*(C1*C2*C3*R3*R3*R4 + C1*C2*C3*R1*R3*R3 - C1*C2*C3*R1*R3*R4)
+ l*C1*C2*C3*R1*R2*R4
+ C1*C2*C3*R1*R3*R4;
c = 2*float(ma.SR);
B0 = -b1*c - b2*pow(c,2) - b3*pow(c,3);
B1 = -b1*c + b2*pow(c,2) + 3*b3*pow(c,3);
B2 = b1*c + b2*pow(c,2) - 3*b3*pow(c,3);
B3 = b1*c - b2*pow(c,2) + b3*pow(c,3);
A0 = -a0 - a1*c - a2*pow(c,2) - a3*pow(c,3);
A1 = -3*a0 - a1*c + a2*pow(c,2) + 3*a3*pow(c,3);
A2 = -3*a0 + a1*c + a2*pow(c,2) - 3*a3*pow(c,3);
A3 = -a0 + a1*c - a2*pow(c,2) + a3*pow(c,3);
};
tse = ts.bassman;
process = tonestack;
|
43a5323dc9de820b362133fa8c3c965733a50840918554c983548ac7ec3bea9f | ml-wo/VirtualGuitarAmp-Guitarix | gxtilttone.dsp | declare id "tiltdrive";
declare name "Tilt Tone Pro";
declare category "External";
import("stdfaust.lib");
import("redeye.lib");
process = pre : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0,b5/a0),(a1/a0,a2/a0,a3/a0,a4/a0,a5/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Body = vslider("Body[name:Body]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Tone = vslider("Tone[name:Tone]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
Drive = vslider("Drive[name:Drive]", 0.5, 0, 1, 0.01) : Inverted(1) : LogPot(1) : si.smooth(s);
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
b0 = Level*(Body*(Drive*pow(fs,2)*(fs*(-3.98252244086665e-19*fs - 1.25414294001131e-16) - 1.8087904407686e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-2.23479676537841e-22*fs - 3.38605570511882e-21) - 3.17641482147733e-31) - 4.81274972951113e-30) + pow(fs,2)*(fs*(fs*(2.23479676537841e-22*fs + 3.38605570511882e-21) + 3.17641482147733e-31) + 4.81274972951113e-30)) + pow(fs,2)*(fs*(3.98252244086665e-19*fs + 1.25414294001131e-16) + 1.8087904407686e-15)) + Drive*pow(fs,2)*(fs*(-8.92085026754128e-20*fs - 5.05613478219161e-16) - 7.64033082180657e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-5.00594475444762e-23*fs - 7.58476477946615e-22) + 4.77520676362908e-16) + 7.23516176307441e-15) + pow(fs,2)*(fs*(fs*(5.00594475444762e-23*fs + 7.58476477946615e-22) - 4.77520676362908e-16) - 7.23516176307441e-15)) + pow(fs,2)*(fs*(8.92085026754128e-20*fs + 5.05613478219161e-16) + 7.64033082180657e-15));
b1 = Level*(Body*(Drive*pow(fs,2)*(fs*(1.19475673226e-18*fs + 1.25414294001131e-16) - 1.8087904407686e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(1.1173983826892e-21*fs + 1.01581671153565e-20) + 3.17641482147733e-31) - 4.81274972951113e-30) + pow(fs,2)*(fs*(fs*(-1.1173983826892e-21*fs - 1.01581671153565e-20) - 3.17641482147733e-31) + 4.81274972951113e-30)) + pow(fs,2)*(fs*(-1.19475673226e-18*fs - 1.25414294001131e-16) + 1.8087904407686e-15)) + Drive*pow(fs,2)*(fs*(2.67625508026238e-19*fs + 5.05613478219161e-16) - 7.64033082180657e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(2.50297237722381e-22*fs + 2.27542943383984e-21) - 4.77520676362908e-16) + 7.23516176307441e-15) + pow(fs,2)*(fs*(fs*(-2.50297237722381e-22*fs - 2.27542943383984e-21) + 4.77520676362908e-16) - 7.23516176307441e-15)) + pow(fs,2)*(fs*(-2.67625508026238e-19*fs - 5.05613478219161e-16) + 7.64033082180657e-15));
b2 = Level*(Body*(Drive*pow(fs,2)*(fs*(-7.9650448817333e-19*fs + 2.50828588002261e-16) + 3.61758088153719e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-2.23479676537841e-21*fs - 6.77211141023765e-21) + 6.35282964295466e-31) + 9.62549945902227e-30) + pow(fs,2)*(fs*(fs*(2.23479676537841e-21*fs + 6.77211141023765e-21) - 6.35282964295466e-31) - 9.62549945902227e-30)) + pow(fs,2)*(fs*(7.9650448817333e-19*fs - 2.50828588002261e-16) - 3.61758088153719e-15)) + Drive*pow(fs,2)*(fs*(-1.78417005350826e-19*fs + 1.01122695643832e-15) + 1.52806616436131e-14) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-5.00594475444762e-22*fs - 1.51695295589323e-21) - 9.55041352725816e-16) - 1.44703235261488e-14) + pow(fs,2)*(fs*(fs*(5.00594475444762e-22*fs + 1.51695295589323e-21) + 9.55041352725816e-16) + 1.44703235261488e-14)) + pow(fs,2)*(fs*(1.78417005350826e-19*fs - 1.01122695643832e-15) - 1.52806616436131e-14));
b3 = Level*(Body*(Drive*pow(fs,2)*(fs*(-7.9650448817333e-19*fs - 2.50828588002261e-16) + 3.61758088153719e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(2.23479676537841e-21*fs - 6.77211141023765e-21) - 6.35282964295466e-31) + 9.62549945902227e-30) + pow(fs,2)*(fs*(fs*(-2.23479676537841e-21*fs + 6.77211141023765e-21) + 6.35282964295466e-31) - 9.62549945902227e-30)) + pow(fs,2)*(fs*(7.9650448817333e-19*fs + 2.50828588002261e-16) - 3.61758088153719e-15)) + Drive*pow(fs,2)*(fs*(-1.78417005350826e-19*fs - 1.01122695643832e-15) + 1.52806616436131e-14) + Tone*(Drive*pow(fs,2)*(fs*(fs*(5.00594475444762e-22*fs - 1.51695295589323e-21) + 9.55041352725816e-16) - 1.44703235261488e-14) + pow(fs,2)*(fs*(fs*(-5.00594475444762e-22*fs + 1.51695295589323e-21) - 9.55041352725816e-16) + 1.44703235261488e-14)) + pow(fs,2)*(fs*(1.78417005350826e-19*fs + 1.01122695643832e-15) - 1.52806616436131e-14));
b4 = Level*(Body*(Drive*pow(fs,2)*(fs*(1.19475673226e-18*fs - 1.25414294001131e-16) - 1.8087904407686e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-1.1173983826892e-21*fs + 1.01581671153565e-20) - 3.17641482147733e-31) - 4.81274972951113e-30) + pow(fs,2)*(fs*(fs*(1.1173983826892e-21*fs - 1.01581671153565e-20) + 3.17641482147733e-31) + 4.81274972951113e-30)) + pow(fs,2)*(fs*(-1.19475673226e-18*fs + 1.25414294001131e-16) + 1.8087904407686e-15)) + Drive*pow(fs,2)*(fs*(2.67625508026238e-19*fs - 5.05613478219161e-16) - 7.64033082180657e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-2.50297237722381e-22*fs + 2.27542943383984e-21) + 4.77520676362908e-16) + 7.23516176307441e-15) + pow(fs,2)*(fs*(fs*(2.50297237722381e-22*fs - 2.27542943383984e-21) - 4.77520676362908e-16) - 7.23516176307441e-15)) + pow(fs,2)*(fs*(-2.67625508026238e-19*fs + 5.05613478219161e-16) + 7.64033082180657e-15));
b5 = Level*(Body*(Drive*pow(fs,2)*(fs*(-3.98252244086665e-19*fs + 1.25414294001131e-16) - 1.8087904407686e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(2.23479676537841e-22*fs - 3.38605570511882e-21) + 3.17641482147733e-31) - 4.81274972951113e-30) + pow(fs,2)*(fs*(fs*(-2.23479676537841e-22*fs + 3.38605570511882e-21) - 3.17641482147733e-31) + 4.81274972951113e-30)) + pow(fs,2)*(fs*(3.98252244086665e-19*fs - 1.25414294001131e-16) + 1.8087904407686e-15)) + Drive*pow(fs,2)*(fs*(-8.92085026754128e-20*fs + 5.05613478219161e-16) - 7.64033082180657e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(5.00594475444762e-23*fs - 7.58476477946615e-22) - 4.77520676362908e-16) + 7.23516176307441e-15) + pow(fs,2)*(fs*(fs*(-5.00594475444762e-23*fs + 7.58476477946615e-22) + 4.77520676362908e-16) - 7.23516176307441e-15)) + pow(fs,2)*(fs*(8.92085026754128e-20*fs - 5.05613478219161e-16) + 7.64033082180657e-15));
a0 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(-2.20212655946247e-25*fs - 2.1715963793545e-22) - 6.19440233250284e-21) - 6.87715895801323e-21) + 1.04834817447643e-32) + fs*(fs*(fs*(fs*(2.62544964130344e-25*fs + 2.80645509263828e-22) + 9.57755921861201e-20) + 2.58687234633677e-18) + 2.86548289917719e-18) + 1.19130474372322e-30) + fs*(fs*(fs*(fs*(2.62544964130344e-24*fs + 4.0544103345737e-21) + 1.08757722986638e-18) + 4.26706837092244e-17) + 4.34866026595172e-16) + 4.47731702996255e-16) + Tone*(Tone*fs*(fs*(fs*(fs*(-2.18656867668347e-25*fs - 7.43012556103548e-22) - 5.07702668620608e-19) - 1.42068098536868e-17) - 1.57601559454686e-17) + fs*(fs*(fs*(fs*(2.28139304701584e-25*fs + 6.72568774912911e-22) + 2.89128836504038e-19) - 4.83903085275556e-17) - 1.60414454195004e-15) - 1.79092681198507e-15) + fs*(fs*(fs*(fs*(2.28139304701584e-24*fs + 8.78318666705471e-21) + 7.93180872955293e-18) + 8.46536337187037e-16) + 1.80810237761262e-14) + 1.9800486833307e-14;
a1 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(1.10106327973123e-24*fs + 6.51478913806351e-22) + 6.19440233250284e-21) - 6.87715895801323e-21) + 3.1450445234293e-32) + fs*(fs*(fs*(fs*(-1.31272482065172e-24*fs - 8.41936527791485e-22) - 9.57755921861201e-20) + 2.58687234633677e-18) + 8.59644869753156e-18) + 5.9565237186161e-30) + fs*(fs*(fs*(fs*(-1.31272482065172e-23*fs - 1.21632310037211e-20) - 1.08757722986638e-18) + 4.26706837092244e-17) + 1.30459807978552e-15) + 2.23865851498128e-15) + Tone*(Tone*fs*(fs*(fs*(fs*(1.09328433834173e-24*fs + 2.22903766831064e-21) + 5.07702668620608e-19) - 1.42068098536868e-17) - 4.72804678364059e-17) + fs*(fs*(fs*(fs*(-1.14069652350792e-24*fs - 2.01770632473873e-21) - 2.89128836504038e-19) - 4.83903085275556e-17) - 4.81243362585013e-15) - 8.95463405992537e-15) + fs*(fs*(fs*(fs*(-1.14069652350792e-23*fs - 2.63495600011641e-20) - 7.93180872955293e-18) + 8.46536337187037e-16) + 5.42430713283786e-14) + 9.90024341665349e-14;
a2 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(-2.20212655946247e-24*fs - 4.343192758709e-22) + 1.23888046650057e-20) + 1.37543179160265e-20) + 2.09669634895287e-32) + fs*(fs*(fs*(fs*(2.62544964130344e-24*fs + 5.61291018527657e-22) - 1.9155118437224e-19) - 5.17374469267354e-18) + 5.73096579835437e-18) + 1.19130474372322e-29) + fs*(fs*(fs*(fs*(2.62544964130344e-23*fs + 8.1088206691474e-21) - 2.17515445973276e-18) - 8.53413674184488e-17) + 8.69732053190344e-16) + 4.47731702996255e-15) + Tone*(Tone*fs*(fs*(fs*(fs*(-2.18656867668347e-24*fs - 1.4860251122071e-21) + 1.01540533724122e-18) + 2.84136197073737e-17) - 3.15203118909373e-17) + fs*(fs*(fs*(fs*(2.28139304701584e-24*fs + 1.34513754982582e-21) - 5.78257673008076e-19) + 9.67806170551113e-17) - 3.20828908390008e-15) - 1.79092681198507e-14) + fs*(fs*(fs*(fs*(2.28139304701584e-23*fs + 1.75663733341094e-20) - 1.58636174591059e-17) - 1.69307267437407e-15) + 3.61620475522524e-14) + 1.9800486833307e-13;
a3 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(2.20212655946247e-24*fs - 4.343192758709e-22) - 1.23888046650057e-20) + 1.37543179160265e-20) - 2.09669634895287e-32) + fs*(fs*(fs*(fs*(-2.62544964130344e-24*fs + 5.61291018527657e-22) + 1.9155118437224e-19) - 5.17374469267354e-18) - 5.73096579835437e-18) + 1.19130474372322e-29) + fs*(fs*(fs*(fs*(-2.62544964130344e-23*fs + 8.1088206691474e-21) + 2.17515445973276e-18) - 8.53413674184488e-17) - 8.69732053190344e-16) + 4.47731702996255e-15) + Tone*(Tone*fs*(fs*(fs*(fs*(2.18656867668347e-24*fs - 1.4860251122071e-21) - 1.01540533724122e-18) + 2.84136197073737e-17) + 3.15203118909373e-17) + fs*(fs*(fs*(fs*(-2.28139304701584e-24*fs + 1.34513754982582e-21) + 5.78257673008076e-19) + 9.67806170551113e-17) + 3.20828908390008e-15) - 1.79092681198507e-14) + fs*(fs*(fs*(fs*(-2.28139304701584e-23*fs + 1.75663733341094e-20) + 1.58636174591059e-17) - 1.69307267437407e-15) - 3.61620475522524e-14) + 1.9800486833307e-13;
a4 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(-1.10106327973123e-24*fs + 6.51478913806351e-22) - 6.19440233250284e-21) - 6.87715895801323e-21) - 3.1450445234293e-32) + fs*(fs*(fs*(fs*(1.31272482065172e-24*fs - 8.41936527791485e-22) + 9.57755921861201e-20) + 2.58687234633677e-18) - 8.59644869753156e-18) + 5.9565237186161e-30) + fs*(fs*(fs*(fs*(1.31272482065172e-23*fs - 1.21632310037211e-20) + 1.08757722986638e-18) + 4.26706837092244e-17) - 1.30459807978552e-15) + 2.23865851498128e-15) + Tone*(Tone*fs*(fs*(fs*(fs*(-1.09328433834173e-24*fs + 2.22903766831064e-21) - 5.07702668620608e-19) - 1.42068098536868e-17) + 4.72804678364059e-17) + fs*(fs*(fs*(fs*(1.14069652350792e-24*fs - 2.01770632473873e-21) + 2.89128836504038e-19) - 4.83903085275556e-17) + 4.81243362585013e-15) - 8.95463405992537e-15) + fs*(fs*(fs*(fs*(1.14069652350792e-23*fs - 2.63495600011641e-20) + 7.93180872955293e-18) + 8.46536337187037e-16) - 5.42430713283786e-14) + 9.90024341665349e-14;
a5 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(2.20212655946247e-25*fs - 2.1715963793545e-22) + 6.19440233250284e-21) - 6.87715895801323e-21) - 1.04834817447643e-32) + fs*(fs*(fs*(fs*(-2.62544964130344e-25*fs + 2.80645509263828e-22) - 9.57755921861201e-20) + 2.58687234633677e-18) - 2.86548289917719e-18) + 1.19130474372322e-30) + fs*(fs*(fs*(fs*(-2.62544964130344e-24*fs + 4.0544103345737e-21) - 1.08757722986638e-18) + 4.26706837092244e-17) - 4.34866026595172e-16) + 4.47731702996255e-16) + Tone*(Tone*fs*(fs*(fs*(fs*(2.18656867668347e-25*fs - 7.43012556103548e-22) + 5.07702668620608e-19) - 1.42068098536868e-17) + 1.57601559454686e-17) + fs*(fs*(fs*(fs*(-2.28139304701584e-25*fs + 6.72568774912911e-22) - 2.89128836504038e-19) - 4.83903085275556e-17) + 1.60414454195004e-15) - 1.79092681198507e-15) + fs*(fs*(fs*(fs*(-2.28139304701584e-24*fs + 8.78318666705471e-21) - 7.93180872955293e-18) + 8.46536337187037e-16) - 1.80810237761262e-14) + 1.9800486833307e-14;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/gxtilttone.dsp | faust | declare id "tiltdrive";
declare name "Tilt Tone Pro";
declare category "External";
import("stdfaust.lib");
import("redeye.lib");
process = pre : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0,b5/a0),(a1/a0,a2/a0,a3/a0,a4/a0,a5/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Body = vslider("Body[name:Body]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Tone = vslider("Tone[name:Tone]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
Drive = vslider("Drive[name:Drive]", 0.5, 0, 1, 0.01) : Inverted(1) : LogPot(1) : si.smooth(s);
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
b0 = Level*(Body*(Drive*pow(fs,2)*(fs*(-3.98252244086665e-19*fs - 1.25414294001131e-16) - 1.8087904407686e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-2.23479676537841e-22*fs - 3.38605570511882e-21) - 3.17641482147733e-31) - 4.81274972951113e-30) + pow(fs,2)*(fs*(fs*(2.23479676537841e-22*fs + 3.38605570511882e-21) + 3.17641482147733e-31) + 4.81274972951113e-30)) + pow(fs,2)*(fs*(3.98252244086665e-19*fs + 1.25414294001131e-16) + 1.8087904407686e-15)) + Drive*pow(fs,2)*(fs*(-8.92085026754128e-20*fs - 5.05613478219161e-16) - 7.64033082180657e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-5.00594475444762e-23*fs - 7.58476477946615e-22) + 4.77520676362908e-16) + 7.23516176307441e-15) + pow(fs,2)*(fs*(fs*(5.00594475444762e-23*fs + 7.58476477946615e-22) - 4.77520676362908e-16) - 7.23516176307441e-15)) + pow(fs,2)*(fs*(8.92085026754128e-20*fs + 5.05613478219161e-16) + 7.64033082180657e-15));
b1 = Level*(Body*(Drive*pow(fs,2)*(fs*(1.19475673226e-18*fs + 1.25414294001131e-16) - 1.8087904407686e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(1.1173983826892e-21*fs + 1.01581671153565e-20) + 3.17641482147733e-31) - 4.81274972951113e-30) + pow(fs,2)*(fs*(fs*(-1.1173983826892e-21*fs - 1.01581671153565e-20) - 3.17641482147733e-31) + 4.81274972951113e-30)) + pow(fs,2)*(fs*(-1.19475673226e-18*fs - 1.25414294001131e-16) + 1.8087904407686e-15)) + Drive*pow(fs,2)*(fs*(2.67625508026238e-19*fs + 5.05613478219161e-16) - 7.64033082180657e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(2.50297237722381e-22*fs + 2.27542943383984e-21) - 4.77520676362908e-16) + 7.23516176307441e-15) + pow(fs,2)*(fs*(fs*(-2.50297237722381e-22*fs - 2.27542943383984e-21) + 4.77520676362908e-16) - 7.23516176307441e-15)) + pow(fs,2)*(fs*(-2.67625508026238e-19*fs - 5.05613478219161e-16) + 7.64033082180657e-15));
b2 = Level*(Body*(Drive*pow(fs,2)*(fs*(-7.9650448817333e-19*fs + 2.50828588002261e-16) + 3.61758088153719e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-2.23479676537841e-21*fs - 6.77211141023765e-21) + 6.35282964295466e-31) + 9.62549945902227e-30) + pow(fs,2)*(fs*(fs*(2.23479676537841e-21*fs + 6.77211141023765e-21) - 6.35282964295466e-31) - 9.62549945902227e-30)) + pow(fs,2)*(fs*(7.9650448817333e-19*fs - 2.50828588002261e-16) - 3.61758088153719e-15)) + Drive*pow(fs,2)*(fs*(-1.78417005350826e-19*fs + 1.01122695643832e-15) + 1.52806616436131e-14) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-5.00594475444762e-22*fs - 1.51695295589323e-21) - 9.55041352725816e-16) - 1.44703235261488e-14) + pow(fs,2)*(fs*(fs*(5.00594475444762e-22*fs + 1.51695295589323e-21) + 9.55041352725816e-16) + 1.44703235261488e-14)) + pow(fs,2)*(fs*(1.78417005350826e-19*fs - 1.01122695643832e-15) - 1.52806616436131e-14));
b3 = Level*(Body*(Drive*pow(fs,2)*(fs*(-7.9650448817333e-19*fs - 2.50828588002261e-16) + 3.61758088153719e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(2.23479676537841e-21*fs - 6.77211141023765e-21) - 6.35282964295466e-31) + 9.62549945902227e-30) + pow(fs,2)*(fs*(fs*(-2.23479676537841e-21*fs + 6.77211141023765e-21) + 6.35282964295466e-31) - 9.62549945902227e-30)) + pow(fs,2)*(fs*(7.9650448817333e-19*fs + 2.50828588002261e-16) - 3.61758088153719e-15)) + Drive*pow(fs,2)*(fs*(-1.78417005350826e-19*fs - 1.01122695643832e-15) + 1.52806616436131e-14) + Tone*(Drive*pow(fs,2)*(fs*(fs*(5.00594475444762e-22*fs - 1.51695295589323e-21) + 9.55041352725816e-16) - 1.44703235261488e-14) + pow(fs,2)*(fs*(fs*(-5.00594475444762e-22*fs + 1.51695295589323e-21) - 9.55041352725816e-16) + 1.44703235261488e-14)) + pow(fs,2)*(fs*(1.78417005350826e-19*fs + 1.01122695643832e-15) - 1.52806616436131e-14));
b4 = Level*(Body*(Drive*pow(fs,2)*(fs*(1.19475673226e-18*fs - 1.25414294001131e-16) - 1.8087904407686e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-1.1173983826892e-21*fs + 1.01581671153565e-20) - 3.17641482147733e-31) - 4.81274972951113e-30) + pow(fs,2)*(fs*(fs*(1.1173983826892e-21*fs - 1.01581671153565e-20) + 3.17641482147733e-31) + 4.81274972951113e-30)) + pow(fs,2)*(fs*(-1.19475673226e-18*fs + 1.25414294001131e-16) + 1.8087904407686e-15)) + Drive*pow(fs,2)*(fs*(2.67625508026238e-19*fs - 5.05613478219161e-16) - 7.64033082180657e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(-2.50297237722381e-22*fs + 2.27542943383984e-21) + 4.77520676362908e-16) + 7.23516176307441e-15) + pow(fs,2)*(fs*(fs*(2.50297237722381e-22*fs - 2.27542943383984e-21) - 4.77520676362908e-16) - 7.23516176307441e-15)) + pow(fs,2)*(fs*(-2.67625508026238e-19*fs + 5.05613478219161e-16) + 7.64033082180657e-15));
b5 = Level*(Body*(Drive*pow(fs,2)*(fs*(-3.98252244086665e-19*fs + 1.25414294001131e-16) - 1.8087904407686e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(2.23479676537841e-22*fs - 3.38605570511882e-21) + 3.17641482147733e-31) - 4.81274972951113e-30) + pow(fs,2)*(fs*(fs*(-2.23479676537841e-22*fs + 3.38605570511882e-21) - 3.17641482147733e-31) + 4.81274972951113e-30)) + pow(fs,2)*(fs*(3.98252244086665e-19*fs - 1.25414294001131e-16) + 1.8087904407686e-15)) + Drive*pow(fs,2)*(fs*(-8.92085026754128e-20*fs + 5.05613478219161e-16) - 7.64033082180657e-15) + Tone*(Drive*pow(fs,2)*(fs*(fs*(5.00594475444762e-23*fs - 7.58476477946615e-22) - 4.77520676362908e-16) + 7.23516176307441e-15) + pow(fs,2)*(fs*(fs*(-5.00594475444762e-23*fs + 7.58476477946615e-22) + 4.77520676362908e-16) - 7.23516176307441e-15)) + pow(fs,2)*(fs*(8.92085026754128e-20*fs - 5.05613478219161e-16) + 7.64033082180657e-15));
a0 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(-2.20212655946247e-25*fs - 2.1715963793545e-22) - 6.19440233250284e-21) - 6.87715895801323e-21) + 1.04834817447643e-32) + fs*(fs*(fs*(fs*(2.62544964130344e-25*fs + 2.80645509263828e-22) + 9.57755921861201e-20) + 2.58687234633677e-18) + 2.86548289917719e-18) + 1.19130474372322e-30) + fs*(fs*(fs*(fs*(2.62544964130344e-24*fs + 4.0544103345737e-21) + 1.08757722986638e-18) + 4.26706837092244e-17) + 4.34866026595172e-16) + 4.47731702996255e-16) + Tone*(Tone*fs*(fs*(fs*(fs*(-2.18656867668347e-25*fs - 7.43012556103548e-22) - 5.07702668620608e-19) - 1.42068098536868e-17) - 1.57601559454686e-17) + fs*(fs*(fs*(fs*(2.28139304701584e-25*fs + 6.72568774912911e-22) + 2.89128836504038e-19) - 4.83903085275556e-17) - 1.60414454195004e-15) - 1.79092681198507e-15) + fs*(fs*(fs*(fs*(2.28139304701584e-24*fs + 8.78318666705471e-21) + 7.93180872955293e-18) + 8.46536337187037e-16) + 1.80810237761262e-14) + 1.9800486833307e-14;
a1 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(1.10106327973123e-24*fs + 6.51478913806351e-22) + 6.19440233250284e-21) - 6.87715895801323e-21) + 3.1450445234293e-32) + fs*(fs*(fs*(fs*(-1.31272482065172e-24*fs - 8.41936527791485e-22) - 9.57755921861201e-20) + 2.58687234633677e-18) + 8.59644869753156e-18) + 5.9565237186161e-30) + fs*(fs*(fs*(fs*(-1.31272482065172e-23*fs - 1.21632310037211e-20) - 1.08757722986638e-18) + 4.26706837092244e-17) + 1.30459807978552e-15) + 2.23865851498128e-15) + Tone*(Tone*fs*(fs*(fs*(fs*(1.09328433834173e-24*fs + 2.22903766831064e-21) + 5.07702668620608e-19) - 1.42068098536868e-17) - 4.72804678364059e-17) + fs*(fs*(fs*(fs*(-1.14069652350792e-24*fs - 2.01770632473873e-21) - 2.89128836504038e-19) - 4.83903085275556e-17) - 4.81243362585013e-15) - 8.95463405992537e-15) + fs*(fs*(fs*(fs*(-1.14069652350792e-23*fs - 2.63495600011641e-20) - 7.93180872955293e-18) + 8.46536337187037e-16) + 5.42430713283786e-14) + 9.90024341665349e-14;
a2 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(-2.20212655946247e-24*fs - 4.343192758709e-22) + 1.23888046650057e-20) + 1.37543179160265e-20) + 2.09669634895287e-32) + fs*(fs*(fs*(fs*(2.62544964130344e-24*fs + 5.61291018527657e-22) - 1.9155118437224e-19) - 5.17374469267354e-18) + 5.73096579835437e-18) + 1.19130474372322e-29) + fs*(fs*(fs*(fs*(2.62544964130344e-23*fs + 8.1088206691474e-21) - 2.17515445973276e-18) - 8.53413674184488e-17) + 8.69732053190344e-16) + 4.47731702996255e-15) + Tone*(Tone*fs*(fs*(fs*(fs*(-2.18656867668347e-24*fs - 1.4860251122071e-21) + 1.01540533724122e-18) + 2.84136197073737e-17) - 3.15203118909373e-17) + fs*(fs*(fs*(fs*(2.28139304701584e-24*fs + 1.34513754982582e-21) - 5.78257673008076e-19) + 9.67806170551113e-17) - 3.20828908390008e-15) - 1.79092681198507e-14) + fs*(fs*(fs*(fs*(2.28139304701584e-23*fs + 1.75663733341094e-20) - 1.58636174591059e-17) - 1.69307267437407e-15) + 3.61620475522524e-14) + 1.9800486833307e-13;
a3 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(2.20212655946247e-24*fs - 4.343192758709e-22) - 1.23888046650057e-20) + 1.37543179160265e-20) - 2.09669634895287e-32) + fs*(fs*(fs*(fs*(-2.62544964130344e-24*fs + 5.61291018527657e-22) + 1.9155118437224e-19) - 5.17374469267354e-18) - 5.73096579835437e-18) + 1.19130474372322e-29) + fs*(fs*(fs*(fs*(-2.62544964130344e-23*fs + 8.1088206691474e-21) + 2.17515445973276e-18) - 8.53413674184488e-17) - 8.69732053190344e-16) + 4.47731702996255e-15) + Tone*(Tone*fs*(fs*(fs*(fs*(2.18656867668347e-24*fs - 1.4860251122071e-21) - 1.01540533724122e-18) + 2.84136197073737e-17) + 3.15203118909373e-17) + fs*(fs*(fs*(fs*(-2.28139304701584e-24*fs + 1.34513754982582e-21) + 5.78257673008076e-19) + 9.67806170551113e-17) + 3.20828908390008e-15) - 1.79092681198507e-14) + fs*(fs*(fs*(fs*(-2.28139304701584e-23*fs + 1.75663733341094e-20) + 1.58636174591059e-17) - 1.69307267437407e-15) - 3.61620475522524e-14) + 1.9800486833307e-13;
a4 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(-1.10106327973123e-24*fs + 6.51478913806351e-22) - 6.19440233250284e-21) - 6.87715895801323e-21) - 3.1450445234293e-32) + fs*(fs*(fs*(fs*(1.31272482065172e-24*fs - 8.41936527791485e-22) + 9.57755921861201e-20) + 2.58687234633677e-18) - 8.59644869753156e-18) + 5.9565237186161e-30) + fs*(fs*(fs*(fs*(1.31272482065172e-23*fs - 1.21632310037211e-20) + 1.08757722986638e-18) + 4.26706837092244e-17) - 1.30459807978552e-15) + 2.23865851498128e-15) + Tone*(Tone*fs*(fs*(fs*(fs*(-1.09328433834173e-24*fs + 2.22903766831064e-21) - 5.07702668620608e-19) - 1.42068098536868e-17) + 4.72804678364059e-17) + fs*(fs*(fs*(fs*(1.14069652350792e-24*fs - 2.01770632473873e-21) + 2.89128836504038e-19) - 4.83903085275556e-17) + 4.81243362585013e-15) - 8.95463405992537e-15) + fs*(fs*(fs*(fs*(1.14069652350792e-23*fs - 2.63495600011641e-20) + 7.93180872955293e-18) + 8.46536337187037e-16) - 5.42430713283786e-14) + 9.90024341665349e-14;
a5 = Body*(Tone*(Tone*fs*(fs*(fs*(fs*(2.20212655946247e-25*fs - 2.1715963793545e-22) + 6.19440233250284e-21) - 6.87715895801323e-21) - 1.04834817447643e-32) + fs*(fs*(fs*(fs*(-2.62544964130344e-25*fs + 2.80645509263828e-22) - 9.57755921861201e-20) + 2.58687234633677e-18) - 2.86548289917719e-18) + 1.19130474372322e-30) + fs*(fs*(fs*(fs*(-2.62544964130344e-24*fs + 4.0544103345737e-21) - 1.08757722986638e-18) + 4.26706837092244e-17) - 4.34866026595172e-16) + 4.47731702996255e-16) + Tone*(Tone*fs*(fs*(fs*(fs*(2.18656867668347e-25*fs - 7.43012556103548e-22) + 5.07702668620608e-19) - 1.42068098536868e-17) + 1.57601559454686e-17) + fs*(fs*(fs*(fs*(-2.28139304701584e-25*fs + 6.72568774912911e-22) - 2.89128836504038e-19) - 4.83903085275556e-17) + 1.60414454195004e-15) - 1.79092681198507e-15) + fs*(fs*(fs*(fs*(-2.28139304701584e-24*fs + 8.78318666705471e-21) - 7.93180872955293e-18) + 8.46536337187037e-16) - 1.80810237761262e-14) + 1.9800486833307e-14;
};
|
|
20724cbbac9a2021728fe18aed1ef6f3e43e283fedef60a6a6b53fe9a7ab2656 | ml-wo/VirtualGuitarAmp-Guitarix | cstb.dsp | // generated automatically
// DO NOT MODIFY!
declare id "cstbt1";
declare name "Colorsound Tone Blender";
declare category "Fuzz";
declare shortname "CS Tone";
declare description "Colorsound Tone Blender";
declare insert_p "tranyclipper3";
declare drywetbox "true";
import("stdfaust.lib");
import("trany.lib");
process = fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0,b5/a0),(a1/a0,a2/a0,a3/a0,a4/a0,a5/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
//clip = tranystage(TB_KT88_68k,86.0,2700.0,5.562895) : tranystage(TB_KT88_68k,86.0,2700.0,5.562895) ;
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Tone = vslider("Tone[name:Tone]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Attack = vslider("Attack[name:Attack]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = Attack*(Attack*(Level*pow(fs,4)*(9.05450478550043e-24*fs + 1.42343600786794e-21) + pow(fs,4)*(9.05450478550042e-27*fs + 1.42343600786794e-24)) + Level*pow(fs,4)*(-9.09472774076109e-22*fs - 1.42975935787076e-19) + pow(fs,4)*(-9.09472774076109e-25*fs - 1.42975935787076e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(-7.65662400320161e-24*fs + 3.10739610519547e-20) + pow(fs,4)*(-7.65662400320161e-27*fs + 3.10739610519547e-23)) + Level*pow(fs,4)*(7.69063713280111e-22*fs - 3.12120013506539e-18) + pow(fs,4)*(7.69063713280111e-25*fs - 3.1212001350654e-21)) + Level*pow(fs,3)*(8.18152886468203e-20*fs - 3.32042567560148e-16) + pow(fs,3)*(8.18152886468203e-23*fs - 3.32042567560148e-19)) + Level*pow(fs,3)*(-9.67524227740542e-20*fs - 1.52102059347953e-17) + pow(fs,3)*(-9.67524227740541e-23*fs - 1.52102059347953e-20);
b1 = Attack*(Attack*(Level*pow(fs,4)*(-4.52725239275021e-23*fs - 4.27030802360382e-21) + pow(fs,4)*(-4.52725239275021e-26*fs - 4.27030802360382e-24)) + Level*pow(fs,4)*(4.54736387038055e-21*fs + 4.28927807361227e-19) + pow(fs,4)*(4.54736387038055e-24*fs + 4.28927807361227e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(3.82831200160081e-23*fs - 9.3221883155864e-20) + pow(fs,4)*(3.82831200160081e-26*fs - 9.3221883155864e-23)) + Level*pow(fs,4)*(-3.84531856640056e-21*fs + 9.36360040519619e-18) + pow(fs,4)*(-3.84531856640056e-24*fs + 9.36360040519619e-21)) + Level*pow(fs,3)*(-2.45445865940461e-19*fs + 3.32042567560148e-16) + pow(fs,3)*(-2.45445865940461e-22*fs + 3.32042567560148e-19)) + Level*pow(fs,3)*(2.90257268322162e-19*fs + 1.52102059347953e-17) + pow(fs,3)*(2.90257268322162e-22*fs + 1.52102059347953e-20);
b2 = Attack*(Attack*(Level*pow(fs,4)*(9.05450478550042e-23*fs + 2.84687201573588e-21) + pow(fs,4)*(9.05450478550042e-26*fs + 2.84687201573588e-24)) + Level*pow(fs,4)*(-9.09472774076109e-21*fs - 2.85951871574151e-19) + pow(fs,4)*(-9.09472774076109e-24*fs - 2.85951871574151e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(-7.65662400320161e-23*fs + 6.21479221039094e-20) + pow(fs,4)*(-7.65662400320161e-26*fs + 6.21479221039094e-23)) + Level*pow(fs,4)*(7.69063713280111e-21*fs - 6.24240027013079e-18) + pow(fs,4)*(7.69063713280111e-24*fs - 6.24240027013079e-21)) + Level*pow(fs,3)*(1.63630577293641e-19*fs + 6.64085135120297e-16) + pow(fs,3)*(1.63630577293641e-22*fs + 6.64085135120297e-19)) + Level*pow(fs,3)*(-1.93504845548108e-19*fs + 3.04204118695905e-17) + pow(fs,3)*(-1.93504845548108e-22*fs + 3.04204118695905e-20);
b3 = Attack*(Attack*(Level*pow(fs,4)*(-9.05450478550042e-23*fs + 2.84687201573588e-21) + pow(fs,4)*(-9.05450478550042e-26*fs + 2.84687201573588e-24)) + Level*pow(fs,4)*(9.09472774076109e-21*fs - 2.85951871574151e-19) + pow(fs,4)*(9.09472774076109e-24*fs - 2.85951871574151e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(7.65662400320161e-23*fs + 6.21479221039094e-20) + pow(fs,4)*(7.65662400320161e-26*fs + 6.21479221039094e-23)) + Level*pow(fs,4)*(-7.69063713280111e-21*fs - 6.24240027013079e-18) + pow(fs,4)*(-7.69063713280111e-24*fs - 6.24240027013079e-21)) + Level*pow(fs,3)*(1.63630577293641e-19*fs - 6.64085135120297e-16) + pow(fs,3)*(1.63630577293641e-22*fs - 6.64085135120297e-19)) + Level*pow(fs,3)*(-1.93504845548108e-19*fs - 3.04204118695905e-17) + pow(fs,3)*(-1.93504845548108e-22*fs - 3.04204118695905e-20);
b4 = Attack*(Attack*(Level*pow(fs,4)*(4.52725239275021e-23*fs - 4.27030802360382e-21) + pow(fs,4)*(4.52725239275021e-26*fs - 4.27030802360382e-24)) + Level*pow(fs,4)*(-4.54736387038055e-21*fs + 4.28927807361227e-19) + pow(fs,4)*(-4.54736387038055e-24*fs + 4.28927807361227e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(-3.82831200160081e-23*fs - 9.3221883155864e-20) + pow(fs,4)*(-3.82831200160081e-26*fs - 9.3221883155864e-23)) + Level*pow(fs,4)*(3.84531856640056e-21*fs + 9.36360040519619e-18) + pow(fs,4)*(3.84531856640056e-24*fs + 9.36360040519619e-21)) + Level*pow(fs,3)*(-2.45445865940461e-19*fs - 3.32042567560148e-16) + pow(fs,3)*(-2.45445865940461e-22*fs - 3.32042567560148e-19)) + Level*pow(fs,3)*(2.90257268322162e-19*fs - 1.52102059347953e-17) + pow(fs,3)*(2.90257268322162e-22*fs - 1.52102059347953e-20);
b5 = Attack*(Attack*(Level*pow(fs,4)*(-9.05450478550043e-24*fs + 1.42343600786794e-21) + pow(fs,4)*(-9.05450478550042e-27*fs + 1.42343600786794e-24)) + Level*pow(fs,4)*(9.09472774076109e-22*fs - 1.42975935787076e-19) + pow(fs,4)*(9.09472774076109e-25*fs - 1.42975935787076e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(7.65662400320161e-24*fs + 3.10739610519547e-20) + pow(fs,4)*(7.65662400320161e-27*fs + 3.10739610519547e-23)) + Level*pow(fs,4)*(-7.69063713280111e-22*fs - 3.12120013506539e-18) + pow(fs,4)*(-7.69063713280111e-25*fs - 3.1212001350654e-21)) + Level*pow(fs,3)*(8.18152886468203e-20*fs + 3.32042567560148e-16) + pow(fs,3)*(8.18152886468203e-23*fs + 3.32042567560148e-19)) + Level*pow(fs,3)*(-9.67524227740542e-20*fs + 1.52102059347953e-17) + pow(fs,3)*(-9.67524227740541e-23*fs + 1.52102059347953e-20);
a0 = Attack*(Attack*fs*(fs*(fs*(fs*(-7.2677502129384e-24*fs - 1.11622970892275e-19) - 5.44781387848185e-17) - 1.11859678983445e-15) - 2.16342879110166e-15) + fs*(fs*(fs*(fs*(7.40213650437857e-24*fs + 1.13632945852435e-19) + 5.46818779890163e-17) + 1.12211896081664e-15) + 2.17010750008645e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(-1.70008798003816e-23*fs - 2.35724702889288e-19) - 1.14989728218871e-16) - 2.52121869652107e-15) - 4.91241778179305e-15) + fs*(fs*(fs*(fs*(1.73152391441475e-23*fs + 2.39957070065024e-19) + 1.15424860004575e-16) + 2.52915851496938e-15) + 4.92758287939703e-15)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(1.72098866161537e-23*fs + 2.43964228204556e-19) + 1.14222007971933e-16) + 2.45620889089652e-16) + pow(fs,2)*(fs*(fs*(-1.75281106567011e-23*fs - 2.48347397038037e-19) - 1.14582451009122e-16) - 2.46379143969851e-16)) + fs*(fs*(fs*(-1.86469262305331e-21*fs - 2.64199358551104e-17) - 1.21896224477789e-14) - 2.62105472308353e-14)) + fs*(fs*(fs*(1.8420467174625e-21*fs + 2.55273478792579e-17) + 1.22792404260186e-14) + 2.69059416486104e-13) + 5.24210944616705e-13) + fs*(fs*(fs*(7.8746133025304e-22*fs + 1.20886112608973e-17) + 5.81722106266131e-15) + 1.19374357533685e-13) + 2.30862500009197e-13;
a1 = Attack*(Attack*fs*(fs*(fs*(fs*(3.6338751064692e-23*fs + 3.34868912676825e-19) + 5.44781387848185e-17) - 1.11859678983445e-15) - 6.49028637330497e-15) + fs*(fs*(fs*(fs*(-3.70106825218929e-23*fs - 3.40898837557304e-19) - 5.46818779890163e-17) + 1.12211896081664e-15) + 6.51032250025936e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(8.50043990019081e-23*fs + 7.07174108667865e-19) + 1.14989728218871e-16) - 2.52121869652107e-15) - 1.47372533453791e-14) + fs*(fs*(fs*(fs*(-8.65761957207373e-23*fs - 7.19871210195072e-19) - 1.15424860004575e-16) + 2.52915851496938e-15) + 1.47827486381911e-14)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(-8.60494330807685e-23*fs - 7.31892684613668e-19) - 1.14222007971933e-16) + 2.45620889089652e-16) + pow(fs,2)*(fs*(fs*(8.76405532835057e-23*fs + 7.45042191114112e-19) + 1.14582451009122e-16) - 2.46379143969851e-16)) + fs*(fs*(fs*(5.59407786915994e-21*fs + 2.64199358551104e-17) - 1.21896224477789e-14) - 7.86316416925058e-14)) + fs*(fs*(fs*(-5.52614015238749e-21*fs - 2.55273478792579e-17) + 1.22792404260186e-14) + 8.07178249458312e-13) + 2.62105472308353e-12) + fs*(fs*(fs*(-2.36238399075912e-21*fs - 1.20886112608973e-17) + 5.81722106266131e-15) + 3.58123072601056e-13) + 1.15431250004598e-12;
a2 = Attack*(Attack*fs*(fs*(fs*(fs*(-7.2677502129384e-23*fs - 2.2324594178455e-19) + 1.08956277569637e-16) + 2.2371935796689e-15) - 4.32685758220331e-15) + fs*(fs*(fs*(fs*(7.40213650437857e-23*fs + 2.27265891704869e-19) - 1.09363755978033e-16) - 2.24423792163328e-15) + 4.3402150001729e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(-1.70008798003816e-22*fs - 4.71449405778577e-19) + 2.29979456437742e-16) + 5.04243739304215e-15) - 9.82483556358609e-15) + fs*(fs*(fs*(fs*(1.73152391441475e-22*fs + 4.79914140130048e-19) - 2.3084972000915e-16) - 5.05831702993876e-15) + 9.85516575879406e-15)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(1.72098866161537e-22*fs + 4.87928456409112e-19) - 2.28444015943865e-16) - 4.91241778179304e-16) + pow(fs,2)*(fs*(fs*(-1.75281106567011e-22*fs - 4.96694794076075e-19) + 2.29164902018244e-16) + 4.92758287939703e-16)) + fs*(fs*(fs*(-3.72938524610662e-21*fs + 5.28398717102207e-17) + 2.43792448955579e-14) - 5.24210944616705e-14)) + fs*(fs*(fs*(3.68409343492499e-21*fs - 5.10546957585158e-17) - 2.45584808520372e-14) + 5.38118832972208e-13) + 5.24210944616705e-12) + fs*(fs*(fs*(1.57492266050608e-21*fs - 2.41772225217946e-17) - 1.16344421253226e-14) + 2.3874871506737e-13) + 2.30862500009197e-12;
a3 = Attack*(Attack*fs*(fs*(fs*(fs*(7.2677502129384e-23*fs - 2.2324594178455e-19) - 1.08956277569637e-16) + 2.2371935796689e-15) + 4.32685758220331e-15) + fs*(fs*(fs*(fs*(-7.40213650437857e-23*fs + 2.27265891704869e-19) + 1.09363755978033e-16) - 2.24423792163328e-15) - 4.3402150001729e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(1.70008798003816e-22*fs - 4.71449405778577e-19) - 2.29979456437742e-16) + 5.04243739304215e-15) + 9.82483556358609e-15) + fs*(fs*(fs*(fs*(-1.73152391441475e-22*fs + 4.79914140130048e-19) + 2.3084972000915e-16) - 5.05831702993876e-15) - 9.85516575879406e-15)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(-1.72098866161537e-22*fs + 4.87928456409112e-19) + 2.28444015943865e-16) - 4.91241778179304e-16) + pow(fs,2)*(fs*(fs*(1.75281106567011e-22*fs - 4.96694794076075e-19) - 2.29164902018244e-16) + 4.92758287939703e-16)) + fs*(fs*(fs*(-3.72938524610662e-21*fs - 5.28398717102207e-17) + 2.43792448955579e-14) + 5.24210944616705e-14)) + fs*(fs*(fs*(3.68409343492499e-21*fs + 5.10546957585158e-17) - 2.45584808520372e-14) - 5.38118832972208e-13) + 5.24210944616705e-12) + fs*(fs*(fs*(1.57492266050608e-21*fs + 2.41772225217946e-17) - 1.16344421253226e-14) - 2.3874871506737e-13) + 2.30862500009197e-12;
a4 = Attack*(Attack*fs*(fs*(fs*(fs*(-3.6338751064692e-23*fs + 3.34868912676825e-19) - 5.44781387848185e-17) - 1.11859678983445e-15) + 6.49028637330497e-15) + fs*(fs*(fs*(fs*(3.70106825218929e-23*fs - 3.40898837557304e-19) + 5.46818779890163e-17) + 1.12211896081664e-15) - 6.51032250025936e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(-8.50043990019081e-23*fs + 7.07174108667865e-19) - 1.14989728218871e-16) - 2.52121869652107e-15) + 1.47372533453791e-14) + fs*(fs*(fs*(fs*(8.65761957207373e-23*fs - 7.19871210195072e-19) + 1.15424860004575e-16) + 2.52915851496938e-15) - 1.47827486381911e-14)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(8.60494330807685e-23*fs - 7.31892684613668e-19) + 1.14222007971933e-16) + 2.45620889089652e-16) + pow(fs,2)*(fs*(fs*(-8.76405532835057e-23*fs + 7.45042191114112e-19) - 1.14582451009122e-16) - 2.46379143969851e-16)) + fs*(fs*(fs*(5.59407786915994e-21*fs - 2.64199358551104e-17) - 1.21896224477789e-14) + 7.86316416925058e-14)) + fs*(fs*(fs*(-5.52614015238749e-21*fs + 2.55273478792579e-17) + 1.22792404260186e-14) - 8.07178249458312e-13) + 2.62105472308353e-12) + fs*(fs*(fs*(-2.36238399075912e-21*fs + 1.20886112608973e-17) + 5.81722106266131e-15) - 3.58123072601056e-13) + 1.15431250004598e-12;
a5 = Attack*(Attack*fs*(fs*(fs*(fs*(7.2677502129384e-24*fs - 1.11622970892275e-19) + 5.44781387848185e-17) - 1.11859678983445e-15) + 2.16342879110166e-15) + fs*(fs*(fs*(fs*(-7.40213650437857e-24*fs + 1.13632945852435e-19) - 5.46818779890163e-17) + 1.12211896081664e-15) - 2.17010750008645e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(1.70008798003816e-23*fs - 2.35724702889288e-19) + 1.14989728218871e-16) - 2.52121869652107e-15) + 4.91241778179305e-15) + fs*(fs*(fs*(fs*(-1.73152391441475e-23*fs + 2.39957070065024e-19) - 1.15424860004575e-16) + 2.52915851496938e-15) - 4.92758287939703e-15)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(-1.72098866161537e-23*fs + 2.43964228204556e-19) - 1.14222007971933e-16) + 2.45620889089652e-16) + pow(fs,2)*(fs*(fs*(1.75281106567011e-23*fs - 2.48347397038037e-19) + 1.14582451009122e-16) - 2.46379143969851e-16)) + fs*(fs*(fs*(-1.86469262305331e-21*fs + 2.64199358551104e-17) - 1.21896224477789e-14) + 2.62105472308353e-14)) + fs*(fs*(fs*(1.8420467174625e-21*fs - 2.55273478792579e-17) + 1.22792404260186e-14) - 2.69059416486104e-13) + 5.24210944616705e-13) + fs*(fs*(fs*(7.8746133025304e-22*fs - 1.20886112608973e-17) + 5.81722106266131e-15) - 1.19374357533685e-13) + 2.30862500009197e-13;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/plugins/cstb.dsp | faust | generated automatically
DO NOT MODIFY!
clip = tranystage(TB_KT88_68k,86.0,2700.0,5.562895) : tranystage(TB_KT88_68k,86.0,2700.0,5.562895) ; | declare id "cstbt1";
declare name "Colorsound Tone Blender";
declare category "Fuzz";
declare shortname "CS Tone";
declare description "Colorsound Tone Blender";
declare insert_p "tranyclipper3";
declare drywetbox "true";
import("stdfaust.lib");
import("trany.lib");
process = fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0,b5/a0),(a1/a0,a2/a0,a3/a0,a4/a0,a5/a0)) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
Level = vslider("Level[name:Level]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Tone = vslider("Tone[name:Tone]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Attack = vslider("Attack[name:Attack]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
b0 = Attack*(Attack*(Level*pow(fs,4)*(9.05450478550043e-24*fs + 1.42343600786794e-21) + pow(fs,4)*(9.05450478550042e-27*fs + 1.42343600786794e-24)) + Level*pow(fs,4)*(-9.09472774076109e-22*fs - 1.42975935787076e-19) + pow(fs,4)*(-9.09472774076109e-25*fs - 1.42975935787076e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(-7.65662400320161e-24*fs + 3.10739610519547e-20) + pow(fs,4)*(-7.65662400320161e-27*fs + 3.10739610519547e-23)) + Level*pow(fs,4)*(7.69063713280111e-22*fs - 3.12120013506539e-18) + pow(fs,4)*(7.69063713280111e-25*fs - 3.1212001350654e-21)) + Level*pow(fs,3)*(8.18152886468203e-20*fs - 3.32042567560148e-16) + pow(fs,3)*(8.18152886468203e-23*fs - 3.32042567560148e-19)) + Level*pow(fs,3)*(-9.67524227740542e-20*fs - 1.52102059347953e-17) + pow(fs,3)*(-9.67524227740541e-23*fs - 1.52102059347953e-20);
b1 = Attack*(Attack*(Level*pow(fs,4)*(-4.52725239275021e-23*fs - 4.27030802360382e-21) + pow(fs,4)*(-4.52725239275021e-26*fs - 4.27030802360382e-24)) + Level*pow(fs,4)*(4.54736387038055e-21*fs + 4.28927807361227e-19) + pow(fs,4)*(4.54736387038055e-24*fs + 4.28927807361227e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(3.82831200160081e-23*fs - 9.3221883155864e-20) + pow(fs,4)*(3.82831200160081e-26*fs - 9.3221883155864e-23)) + Level*pow(fs,4)*(-3.84531856640056e-21*fs + 9.36360040519619e-18) + pow(fs,4)*(-3.84531856640056e-24*fs + 9.36360040519619e-21)) + Level*pow(fs,3)*(-2.45445865940461e-19*fs + 3.32042567560148e-16) + pow(fs,3)*(-2.45445865940461e-22*fs + 3.32042567560148e-19)) + Level*pow(fs,3)*(2.90257268322162e-19*fs + 1.52102059347953e-17) + pow(fs,3)*(2.90257268322162e-22*fs + 1.52102059347953e-20);
b2 = Attack*(Attack*(Level*pow(fs,4)*(9.05450478550042e-23*fs + 2.84687201573588e-21) + pow(fs,4)*(9.05450478550042e-26*fs + 2.84687201573588e-24)) + Level*pow(fs,4)*(-9.09472774076109e-21*fs - 2.85951871574151e-19) + pow(fs,4)*(-9.09472774076109e-24*fs - 2.85951871574151e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(-7.65662400320161e-23*fs + 6.21479221039094e-20) + pow(fs,4)*(-7.65662400320161e-26*fs + 6.21479221039094e-23)) + Level*pow(fs,4)*(7.69063713280111e-21*fs - 6.24240027013079e-18) + pow(fs,4)*(7.69063713280111e-24*fs - 6.24240027013079e-21)) + Level*pow(fs,3)*(1.63630577293641e-19*fs + 6.64085135120297e-16) + pow(fs,3)*(1.63630577293641e-22*fs + 6.64085135120297e-19)) + Level*pow(fs,3)*(-1.93504845548108e-19*fs + 3.04204118695905e-17) + pow(fs,3)*(-1.93504845548108e-22*fs + 3.04204118695905e-20);
b3 = Attack*(Attack*(Level*pow(fs,4)*(-9.05450478550042e-23*fs + 2.84687201573588e-21) + pow(fs,4)*(-9.05450478550042e-26*fs + 2.84687201573588e-24)) + Level*pow(fs,4)*(9.09472774076109e-21*fs - 2.85951871574151e-19) + pow(fs,4)*(9.09472774076109e-24*fs - 2.85951871574151e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(7.65662400320161e-23*fs + 6.21479221039094e-20) + pow(fs,4)*(7.65662400320161e-26*fs + 6.21479221039094e-23)) + Level*pow(fs,4)*(-7.69063713280111e-21*fs - 6.24240027013079e-18) + pow(fs,4)*(-7.69063713280111e-24*fs - 6.24240027013079e-21)) + Level*pow(fs,3)*(1.63630577293641e-19*fs - 6.64085135120297e-16) + pow(fs,3)*(1.63630577293641e-22*fs - 6.64085135120297e-19)) + Level*pow(fs,3)*(-1.93504845548108e-19*fs - 3.04204118695905e-17) + pow(fs,3)*(-1.93504845548108e-22*fs - 3.04204118695905e-20);
b4 = Attack*(Attack*(Level*pow(fs,4)*(4.52725239275021e-23*fs - 4.27030802360382e-21) + pow(fs,4)*(4.52725239275021e-26*fs - 4.27030802360382e-24)) + Level*pow(fs,4)*(-4.54736387038055e-21*fs + 4.28927807361227e-19) + pow(fs,4)*(-4.54736387038055e-24*fs + 4.28927807361227e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(-3.82831200160081e-23*fs - 9.3221883155864e-20) + pow(fs,4)*(-3.82831200160081e-26*fs - 9.3221883155864e-23)) + Level*pow(fs,4)*(3.84531856640056e-21*fs + 9.36360040519619e-18) + pow(fs,4)*(3.84531856640056e-24*fs + 9.36360040519619e-21)) + Level*pow(fs,3)*(-2.45445865940461e-19*fs - 3.32042567560148e-16) + pow(fs,3)*(-2.45445865940461e-22*fs - 3.32042567560148e-19)) + Level*pow(fs,3)*(2.90257268322162e-19*fs - 1.52102059347953e-17) + pow(fs,3)*(2.90257268322162e-22*fs - 1.52102059347953e-20);
b5 = Attack*(Attack*(Level*pow(fs,4)*(-9.05450478550043e-24*fs + 1.42343600786794e-21) + pow(fs,4)*(-9.05450478550042e-27*fs + 1.42343600786794e-24)) + Level*pow(fs,4)*(9.09472774076109e-22*fs - 1.42975935787076e-19) + pow(fs,4)*(9.09472774076109e-25*fs - 1.42975935787076e-22)) + Tone*(Attack*(Attack*(Level*pow(fs,4)*(7.65662400320161e-24*fs + 3.10739610519547e-20) + pow(fs,4)*(7.65662400320161e-27*fs + 3.10739610519547e-23)) + Level*pow(fs,4)*(-7.69063713280111e-22*fs - 3.12120013506539e-18) + pow(fs,4)*(-7.69063713280111e-25*fs - 3.1212001350654e-21)) + Level*pow(fs,3)*(8.18152886468203e-20*fs + 3.32042567560148e-16) + pow(fs,3)*(8.18152886468203e-23*fs + 3.32042567560148e-19)) + Level*pow(fs,3)*(-9.67524227740542e-20*fs + 1.52102059347953e-17) + pow(fs,3)*(-9.67524227740541e-23*fs + 1.52102059347953e-20);
a0 = Attack*(Attack*fs*(fs*(fs*(fs*(-7.2677502129384e-24*fs - 1.11622970892275e-19) - 5.44781387848185e-17) - 1.11859678983445e-15) - 2.16342879110166e-15) + fs*(fs*(fs*(fs*(7.40213650437857e-24*fs + 1.13632945852435e-19) + 5.46818779890163e-17) + 1.12211896081664e-15) + 2.17010750008645e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(-1.70008798003816e-23*fs - 2.35724702889288e-19) - 1.14989728218871e-16) - 2.52121869652107e-15) - 4.91241778179305e-15) + fs*(fs*(fs*(fs*(1.73152391441475e-23*fs + 2.39957070065024e-19) + 1.15424860004575e-16) + 2.52915851496938e-15) + 4.92758287939703e-15)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(1.72098866161537e-23*fs + 2.43964228204556e-19) + 1.14222007971933e-16) + 2.45620889089652e-16) + pow(fs,2)*(fs*(fs*(-1.75281106567011e-23*fs - 2.48347397038037e-19) - 1.14582451009122e-16) - 2.46379143969851e-16)) + fs*(fs*(fs*(-1.86469262305331e-21*fs - 2.64199358551104e-17) - 1.21896224477789e-14) - 2.62105472308353e-14)) + fs*(fs*(fs*(1.8420467174625e-21*fs + 2.55273478792579e-17) + 1.22792404260186e-14) + 2.69059416486104e-13) + 5.24210944616705e-13) + fs*(fs*(fs*(7.8746133025304e-22*fs + 1.20886112608973e-17) + 5.81722106266131e-15) + 1.19374357533685e-13) + 2.30862500009197e-13;
a1 = Attack*(Attack*fs*(fs*(fs*(fs*(3.6338751064692e-23*fs + 3.34868912676825e-19) + 5.44781387848185e-17) - 1.11859678983445e-15) - 6.49028637330497e-15) + fs*(fs*(fs*(fs*(-3.70106825218929e-23*fs - 3.40898837557304e-19) - 5.46818779890163e-17) + 1.12211896081664e-15) + 6.51032250025936e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(8.50043990019081e-23*fs + 7.07174108667865e-19) + 1.14989728218871e-16) - 2.52121869652107e-15) - 1.47372533453791e-14) + fs*(fs*(fs*(fs*(-8.65761957207373e-23*fs - 7.19871210195072e-19) - 1.15424860004575e-16) + 2.52915851496938e-15) + 1.47827486381911e-14)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(-8.60494330807685e-23*fs - 7.31892684613668e-19) - 1.14222007971933e-16) + 2.45620889089652e-16) + pow(fs,2)*(fs*(fs*(8.76405532835057e-23*fs + 7.45042191114112e-19) + 1.14582451009122e-16) - 2.46379143969851e-16)) + fs*(fs*(fs*(5.59407786915994e-21*fs + 2.64199358551104e-17) - 1.21896224477789e-14) - 7.86316416925058e-14)) + fs*(fs*(fs*(-5.52614015238749e-21*fs - 2.55273478792579e-17) + 1.22792404260186e-14) + 8.07178249458312e-13) + 2.62105472308353e-12) + fs*(fs*(fs*(-2.36238399075912e-21*fs - 1.20886112608973e-17) + 5.81722106266131e-15) + 3.58123072601056e-13) + 1.15431250004598e-12;
a2 = Attack*(Attack*fs*(fs*(fs*(fs*(-7.2677502129384e-23*fs - 2.2324594178455e-19) + 1.08956277569637e-16) + 2.2371935796689e-15) - 4.32685758220331e-15) + fs*(fs*(fs*(fs*(7.40213650437857e-23*fs + 2.27265891704869e-19) - 1.09363755978033e-16) - 2.24423792163328e-15) + 4.3402150001729e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(-1.70008798003816e-22*fs - 4.71449405778577e-19) + 2.29979456437742e-16) + 5.04243739304215e-15) - 9.82483556358609e-15) + fs*(fs*(fs*(fs*(1.73152391441475e-22*fs + 4.79914140130048e-19) - 2.3084972000915e-16) - 5.05831702993876e-15) + 9.85516575879406e-15)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(1.72098866161537e-22*fs + 4.87928456409112e-19) - 2.28444015943865e-16) - 4.91241778179304e-16) + pow(fs,2)*(fs*(fs*(-1.75281106567011e-22*fs - 4.96694794076075e-19) + 2.29164902018244e-16) + 4.92758287939703e-16)) + fs*(fs*(fs*(-3.72938524610662e-21*fs + 5.28398717102207e-17) + 2.43792448955579e-14) - 5.24210944616705e-14)) + fs*(fs*(fs*(3.68409343492499e-21*fs - 5.10546957585158e-17) - 2.45584808520372e-14) + 5.38118832972208e-13) + 5.24210944616705e-12) + fs*(fs*(fs*(1.57492266050608e-21*fs - 2.41772225217946e-17) - 1.16344421253226e-14) + 2.3874871506737e-13) + 2.30862500009197e-12;
a3 = Attack*(Attack*fs*(fs*(fs*(fs*(7.2677502129384e-23*fs - 2.2324594178455e-19) - 1.08956277569637e-16) + 2.2371935796689e-15) + 4.32685758220331e-15) + fs*(fs*(fs*(fs*(-7.40213650437857e-23*fs + 2.27265891704869e-19) + 1.09363755978033e-16) - 2.24423792163328e-15) - 4.3402150001729e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(1.70008798003816e-22*fs - 4.71449405778577e-19) - 2.29979456437742e-16) + 5.04243739304215e-15) + 9.82483556358609e-15) + fs*(fs*(fs*(fs*(-1.73152391441475e-22*fs + 4.79914140130048e-19) + 2.3084972000915e-16) - 5.05831702993876e-15) - 9.85516575879406e-15)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(-1.72098866161537e-22*fs + 4.87928456409112e-19) + 2.28444015943865e-16) - 4.91241778179304e-16) + pow(fs,2)*(fs*(fs*(1.75281106567011e-22*fs - 4.96694794076075e-19) - 2.29164902018244e-16) + 4.92758287939703e-16)) + fs*(fs*(fs*(-3.72938524610662e-21*fs - 5.28398717102207e-17) + 2.43792448955579e-14) + 5.24210944616705e-14)) + fs*(fs*(fs*(3.68409343492499e-21*fs + 5.10546957585158e-17) - 2.45584808520372e-14) - 5.38118832972208e-13) + 5.24210944616705e-12) + fs*(fs*(fs*(1.57492266050608e-21*fs + 2.41772225217946e-17) - 1.16344421253226e-14) - 2.3874871506737e-13) + 2.30862500009197e-12;
a4 = Attack*(Attack*fs*(fs*(fs*(fs*(-3.6338751064692e-23*fs + 3.34868912676825e-19) - 5.44781387848185e-17) - 1.11859678983445e-15) + 6.49028637330497e-15) + fs*(fs*(fs*(fs*(3.70106825218929e-23*fs - 3.40898837557304e-19) + 5.46818779890163e-17) + 1.12211896081664e-15) - 6.51032250025936e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(-8.50043990019081e-23*fs + 7.07174108667865e-19) - 1.14989728218871e-16) - 2.52121869652107e-15) + 1.47372533453791e-14) + fs*(fs*(fs*(fs*(8.65761957207373e-23*fs - 7.19871210195072e-19) + 1.15424860004575e-16) + 2.52915851496938e-15) - 1.47827486381911e-14)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(8.60494330807685e-23*fs - 7.31892684613668e-19) + 1.14222007971933e-16) + 2.45620889089652e-16) + pow(fs,2)*(fs*(fs*(-8.76405532835057e-23*fs + 7.45042191114112e-19) - 1.14582451009122e-16) - 2.46379143969851e-16)) + fs*(fs*(fs*(5.59407786915994e-21*fs - 2.64199358551104e-17) - 1.21896224477789e-14) + 7.86316416925058e-14)) + fs*(fs*(fs*(-5.52614015238749e-21*fs + 2.55273478792579e-17) + 1.22792404260186e-14) - 8.07178249458312e-13) + 2.62105472308353e-12) + fs*(fs*(fs*(-2.36238399075912e-21*fs + 1.20886112608973e-17) + 5.81722106266131e-15) - 3.58123072601056e-13) + 1.15431250004598e-12;
a5 = Attack*(Attack*fs*(fs*(fs*(fs*(7.2677502129384e-24*fs - 1.11622970892275e-19) + 5.44781387848185e-17) - 1.11859678983445e-15) + 2.16342879110166e-15) + fs*(fs*(fs*(fs*(-7.40213650437857e-24*fs + 1.13632945852435e-19) - 5.46818779890163e-17) + 1.12211896081664e-15) - 2.17010750008645e-15)) + Tone*(Attack*(Attack*fs*(fs*(fs*(fs*(1.70008798003816e-23*fs - 2.35724702889288e-19) + 1.14989728218871e-16) - 2.52121869652107e-15) + 4.91241778179305e-15) + fs*(fs*(fs*(fs*(-1.73152391441475e-23*fs + 2.39957070065024e-19) - 1.15424860004575e-16) + 2.52915851496938e-15) - 4.92758287939703e-15)) + Tone*(Attack*(Attack*pow(fs,2)*(fs*(fs*(-1.72098866161537e-23*fs + 2.43964228204556e-19) - 1.14222007971933e-16) + 2.45620889089652e-16) + pow(fs,2)*(fs*(fs*(1.75281106567011e-23*fs - 2.48347397038037e-19) + 1.14582451009122e-16) - 2.46379143969851e-16)) + fs*(fs*(fs*(-1.86469262305331e-21*fs + 2.64199358551104e-17) - 1.21896224477789e-14) + 2.62105472308353e-14)) + fs*(fs*(fs*(1.8420467174625e-21*fs - 2.55273478792579e-17) + 1.22792404260186e-14) - 2.69059416486104e-13) + 5.24210944616705e-13) + fs*(fs*(fs*(7.8746133025304e-22*fs - 1.20886112608973e-17) + 5.81722106266131e-15) - 1.19374357533685e-13) + 2.30862500009197e-13;
};
|
7e928205b296776f59ddc441cfb38145329415282e872db0d4e994817a1ee8cb | ml-wo/VirtualGuitarAmp-Guitarix | gx_alembic.dsp | declare id "alembic";
declare name "Alembic Preamp";
declare category "External";
import("stdfaust.lib");
process = pre : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0,b5/a0),(a1/a0,a2/a0,a3/a0,a4/a0,a5/a0)):*(0.1) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Input = vslider("Input[name:Input]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
Bass = vslider("Bass[name:Bass]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
Middle = vslider("Middle[name:Middle]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Treble = vslider("Treble[name:Treble]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
Volume = vslider("Volume[name:Volume]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
b0 = Volume*(Bass*(Input*Treble*pow(fs,4)*(-5.68615530428513e-21*fs - 3.79077020285676e-20) + Input*pow(fs,2)*(fs*(fs*(5.68615530428513e-21*fs + 9.98505002369502e-19) + 4.85778329480724e-15) + 3.23425287520332e-14)) + Input*Treble*pow(fs,2)*(fs*(-3.55687161587197e-19*fs - 1.44694505189894e-17) - 8.06546851671652e-17) + Input*pow(fs,2)*(fs*(3.55687161587197e-19*fs + 1.44694505189894e-17) + 8.06546851671652e-17) + Middle*(Bass*Input*pow(fs,3)*(fs*(7.96061742599918e-22*fs + 4.56560363232067e-18) + 3.04019770269112e-17) + Input*pow(fs,2)*(fs*(4.97962026222076e-20*fs + 2.85365632064909e-16) + 1.90022438253841e-15)));
b1 = Volume*(Bass*(Input*Treble*pow(fs,4)*(2.84307765214256e-20*fs + 1.13723106085703e-19) + Input*pow(fs,2)*(fs*(fs*(-2.84307765214256e-20*fs - 2.99551500710851e-18) - 4.85778329480724e-15) + 3.23425287520332e-14)) + Input*Treble*pow(fs,2)*(fs*(1.06706148476159e-18*fs + 1.44694505189894e-17) - 8.06546851671652e-17) + Input*pow(fs,2)*(fs*(-1.06706148476159e-18*fs - 1.44694505189894e-17) + 8.06546851671652e-17) + Middle*(Bass*Input*pow(fs,3)*(fs*(-3.98030871299959e-21*fs - 1.3696810896962e-17) - 3.04019770269112e-17) + Input*pow(fs,2)*(fs*(-1.49388607866623e-19*fs - 2.85365632064909e-16) + 1.90022438253841e-15)));
b2 = Volume*(Bass*(Input*Treble*pow(fs,4)*(-5.68615530428513e-20*fs - 7.58154040571353e-20) + Input*pow(fs,2)*(fs*(fs*(5.68615530428513e-20*fs + 1.997010004739e-18) - 9.71556658961449e-15) - 6.46850575040665e-14)) + Input*Treble*pow(fs,2)*(fs*(-7.11374323174395e-19*fs + 2.89389010379788e-17) + 1.6130937033433e-16) + Input*pow(fs,2)*(fs*(7.11374323174395e-19*fs - 2.89389010379788e-17) - 1.6130937033433e-16) + Middle*(Bass*Input*pow(fs,3)*(fs*(7.96061742599918e-21*fs + 9.13120726464134e-18) - 6.08039540538225e-17) + Input*pow(fs,2)*(fs*(9.95924052444153e-20*fs - 5.70731264129818e-16) - 3.80044876507682e-15)));
b3 = Volume*(Bass*(Input*Treble*pow(fs,4)*(5.68615530428513e-20*fs - 7.58154040571353e-20) + Input*pow(fs,2)*(fs*(fs*(-5.68615530428513e-20*fs + 1.997010004739e-18) + 9.71556658961449e-15) - 6.46850575040665e-14)) + Input*Treble*pow(fs,2)*(fs*(-7.11374323174395e-19*fs - 2.89389010379788e-17) + 1.6130937033433e-16) + Input*pow(fs,2)*(fs*(7.11374323174395e-19*fs + 2.89389010379788e-17) - 1.6130937033433e-16) + Middle*(Bass*Input*pow(fs,3)*(fs*(-7.96061742599918e-21*fs + 9.13120726464134e-18) + 6.08039540538225e-17) + Input*pow(fs,2)*(fs*(9.95924052444153e-20*fs + 5.70731264129818e-16) - 3.80044876507682e-15)));
b4 = Volume*(Bass*(Input*Treble*pow(fs,4)*(-2.84307765214256e-20*fs + 1.13723106085703e-19) + Input*pow(fs,2)*(fs*(fs*(2.84307765214256e-20*fs - 2.99551500710851e-18) + 4.85778329480724e-15) + 3.23425287520332e-14)) + Input*Treble*pow(fs,2)*(fs*(1.06706148476159e-18*fs - 1.44694505189894e-17) - 8.06546851671652e-17) + Input*pow(fs,2)*(fs*(-1.06706148476159e-18*fs + 1.44694505189894e-17) + 8.06546851671652e-17) + Middle*(Bass*Input*pow(fs,3)*(fs*(3.98030871299959e-21*fs - 1.3696810896962e-17) + 3.04019770269112e-17) + Input*pow(fs,2)*(fs*(-1.49388607866623e-19*fs + 2.85365632064909e-16) + 1.90022438253841e-15)));
b5 = Volume*(Bass*(Input*Treble*pow(fs,4)*(5.68615530428513e-21*fs - 3.79077020285676e-20) + Input*pow(fs,2)*(fs*(fs*(-5.68615530428513e-21*fs + 9.98505002369502e-19) - 4.85778329480724e-15) + 3.23425287520332e-14)) + Input*Treble*pow(fs,2)*(fs*(-3.55687161587197e-19*fs + 1.44694505189894e-17) - 8.06546851671652e-17) + Input*pow(fs,2)*(fs*(3.55687161587197e-19*fs - 1.44694505189894e-17) + 8.06546851671652e-17) + Middle*(Bass*Input*pow(fs,3)*(fs*(-7.96061742599918e-22*fs + 4.56560363232067e-18) - 3.04019770269112e-17) + Input*pow(fs,2)*(fs*(4.97962026222076e-20*fs - 2.85365632064909e-16) + 1.90022438253841e-15)));
a0 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(-4.66400408138021e-24*fs - 4.21107717183568e-20) - 4.69643971510767e-18) - 8.52210149990995e-17) - 4.70934759609501e-16) - 7.98191761744856e-16) + fs*(fs*(fs*(fs*(4.66400408138021e-24*fs + 4.21107717183568e-20) + 4.69643971510767e-18) + 8.52210149990995e-17) + 4.70934759609501e-16) + 7.98191761744856e-16) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(-9.32295933998211e-25*fs + 8.13465102081422e-21) + 8.27894207186978e-19) + 1.21893473917967e-17) + 3.98098141170247e-17) + fs*(fs*(fs*(fs*(9.32295933998211e-25*fs - 8.13465102081422e-21) - 8.27894207186978e-19) - 1.21893473917967e-17) - 3.98098141170247e-17)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(1.03616486126347e-24*fs + 1.0400884417695e-22) + 1.52836235209424e-21) + 4.98869851090535e-21) + pow(fs,2)*(fs*(fs*(-1.03616486126347e-24*fs - 1.0400884417695e-22) - 1.52836235209424e-21) - 4.98869851090535e-21)) + pow(fs,2)*(fs*(fs*(-1.10662407182939e-24*fs - 1.11081445580983e-22) - 1.63229099203665e-21) - 5.32793000964692e-21)) + fs*(fs*(fs*(fs*(9.95692057510089e-25*fs - 8.68780729022958e-21) - 8.84191013275692e-19) - 1.30182230144389e-17) - 4.25168814769824e-17)) + fs*(fs*(fs*(fs*(4.98115635891407e-24*fs + 4.49743041952051e-20) + 5.01579761573499e-18) + 9.10160440190383e-17) + 5.02958323262947e-16) + 8.52468801543507e-16) + Input*(Input*(fs*(fs*(fs*(-2.91748340409741e-22*fs - 2.60665717245934e-18) - 1.19810519513002e-16) - 1.35533771234294e-15) - 3.99095880872428e-15) + fs*(fs*(fs*(2.91748340409741e-22*fs + 2.60665717245934e-18) + 1.19810519513002e-16) + 1.35533771234294e-15) + 3.99095880872428e-15) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(-4.49377473953314e-25*fs - 3.45203422865533e-21) - 7.39641502461285e-20) - 4.31004728634658e-19) - 7.50300256040165e-19) + fs*(fs*(fs*(fs*(4.49377473953314e-25*fs + 3.45203422865533e-21) + 7.39641502461285e-20) + 4.31004728634658e-19) + 7.50300256040165e-19)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-1.08708956034044e-25*fs + 6.17731871560931e-22) + 1.08757485215501e-20) + 3.74212252700032e-20) + pow(fs,2)*(fs*(fs*(1.08708956034044e-25*fs - 6.17731871560931e-22) - 1.08757485215501e-20) - 3.74212252700032e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(7.76492543100316e-26*fs + 1.36369845222938e-24) + 4.68937660025103e-24) + pow(fs,3)*(fs*(-7.76492543100316e-26*fs - 1.36369845222938e-24) - 4.68937660025103e-24)) + pow(fs,3)*(fs*(-8.29294036031137e-26*fs - 1.45642994698098e-24) - 5.0082542090681e-24)) + pow(fs,2)*(fs*(fs*(1.16101165044359e-25*fs - 6.59737638827074e-22) - 1.16152994210155e-20) - 3.99658685883635e-20)) + fs*(fs*(fs*(fs*(4.79935142182139e-25*fs + 3.68677255620389e-21) + 7.89937124628652e-20) + 4.60313050181815e-19) + 8.01320673450896e-19)) + Input*(Input*(fs*(fs*(fs*(-2.81099951792073e-23*fs - 2.15807364568921e-19) - 4.37590986205892e-18) - 2.25888916645809e-17) - 3.19276704697943e-17) + fs*(fs*(fs*(2.81099951792073e-23*fs + 2.15807364568921e-19) + 4.37590986205892e-18) + 2.25888916645809e-17) + 3.19276704697943e-17) + Treble*(Input*(Input*fs*(fs*(fs*(-6.80009214340617e-24*fs + 3.86721597525567e-20) + 6.80858259239558e-19) + 2.34269282072115e-18) + fs*(fs*(fs*(6.80009214340617e-24*fs - 3.86721597525567e-20) - 6.80858259239558e-19) - 2.34269282072115e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(4.85720867386155e-24*fs + 8.53036904160507e-23) + 2.93335472441235e-22) + pow(fs,2)*(fs*(-4.85720867386155e-24*fs - 8.53036904160507e-23) - 2.93335472441235e-22)) + pow(fs,2)*(fs*(-5.18749886368413e-24*fs - 9.11043413643421e-23) - 3.13282284567239e-22)) + fs*(fs*(fs*(7.26249840915779e-24*fs - 4.13018666157306e-20) - 7.27156620867848e-19) - 2.50199593253019e-18)) + fs*(fs*(fs*(3.00214748513934e-23*fs + 2.30482265359608e-19) + 4.67347173267892e-18) + 2.41249362977723e-17) + 3.40987520617403e-17) + Treble*(Input*(Input*(fs*(fs*(fs*(-5.83180860841434e-23*fs + 5.15947717885593e-19) + 2.3901137548476e-17) + 2.70887949322196e-16) + 7.98191761744856e-16) + fs*(fs*(fs*(5.83180860841434e-23*fs - 5.15947717885593e-19) - 2.3901137548476e-17) - 2.70887949322196e-16) - 7.98191761744856e-16) + Treble*(Input*(Input*fs*(fs*(fs*(6.4815418981162e-23*fs + 2.99095367015295e-21) + 3.38701967358278e-20) + 9.9773970218107e-20) + fs*(fs*(fs*(-6.4815418981162e-23*fs - 2.99095367015295e-21) - 3.38701967358278e-20) - 9.9773970218107e-20)) + fs*(fs*(fs*(-6.9222867471881e-23*fs - 3.19433851972335e-21) - 3.61733701138641e-20) - 1.06558600192938e-19)) + fs*(fs*(fs*(6.22837159378651e-23*fs - 5.51032162701814e-19) - 2.55264149017724e-17) - 2.89308329876105e-16) - 8.52468801543507e-16) + fs*(fs*(fs*(3.11587227557603e-22*fs + 2.78390986018658e-18) + 1.27957634839887e-16) + 1.44750067678226e-15) + 4.26234400771753e-15;
a1 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(2.33200204069011e-23*fs + 1.26332315155071e-19) + 4.69643971510767e-18) - 8.52210149990995e-17) - 1.4128042788285e-15) - 3.99095880872428e-15) + fs*(fs*(fs*(fs*(-2.33200204069011e-23*fs - 1.26332315155071e-19) - 4.69643971510767e-18) + 8.52210149990995e-17) + 1.4128042788285e-15) + 3.99095880872428e-15) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(4.66147966999105e-24*fs - 2.44039530624426e-20) - 8.27894207186978e-19) + 1.21893473917967e-17) + 1.19429442351074e-16) + fs*(fs*(fs*(fs*(-4.66147966999105e-24*fs + 2.44039530624426e-20) + 8.27894207186978e-19) - 1.21893473917967e-17) - 1.19429442351074e-16)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-5.18082430631737e-24*fs - 3.12026532530851e-22) - 1.52836235209424e-21) + 4.98869851090535e-21) + pow(fs,2)*(fs*(fs*(5.18082430631737e-24*fs + 3.12026532530851e-22) + 1.52836235209424e-21) - 4.98869851090535e-21)) + pow(fs,2)*(fs*(fs*(5.53312035914695e-24*fs + 3.33244336742949e-22) + 1.63229099203665e-21) - 5.32793000964692e-21)) + fs*(fs*(fs*(fs*(-4.97846028755044e-24*fs + 2.60634218706887e-20) + 8.84191013275692e-19) - 1.30182230144389e-17) - 1.27550644430947e-16)) + fs*(fs*(fs*(fs*(-2.49057817945703e-23*fs - 1.34922912585615e-19) - 5.01579761573499e-18) + 9.10160440190383e-17) + 1.50887496978884e-15) + 4.26234400771753e-15) + Input*(Input*(fs*(fs*(fs*(8.75245021229223e-22*fs + 2.60665717245934e-18) - 1.19810519513002e-16) - 4.06601313702883e-15) - 1.99547940436214e-14) + fs*(fs*(fs*(-8.75245021229223e-22*fs - 2.60665717245934e-18) + 1.19810519513002e-16) + 4.06601313702883e-15) + 1.99547940436214e-14) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(2.24688736976657e-24*fs + 1.0356102685966e-20) + 7.39641502461285e-20) - 4.31004728634658e-19) - 2.2509007681205e-18) + fs*(fs*(fs*(fs*(-2.24688736976657e-24*fs - 1.0356102685966e-20) - 7.39641502461285e-20) + 4.31004728634658e-19) + 2.2509007681205e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(5.43544780170221e-25*fs - 1.85319561468279e-21) - 1.08757485215501e-20) + 3.74212252700032e-20) + pow(fs,2)*(fs*(fs*(-5.43544780170221e-25*fs + 1.85319561468279e-21) + 1.08757485215501e-20) - 3.74212252700032e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(-3.88246271550158e-25*fs - 4.09109535668814e-24) - 4.68937660025103e-24) + pow(fs,3)*(fs*(3.88246271550158e-25*fs + 4.09109535668814e-24) + 4.68937660025103e-24)) + pow(fs,3)*(fs*(4.14647018015568e-25*fs + 4.36928984094294e-24) + 5.0082542090681e-24)) + pow(fs,2)*(fs*(fs*(-5.80505825221796e-25*fs + 1.97921291648122e-21) + 1.16152994210155e-20) - 3.99658685883635e-20)) + fs*(fs*(fs*(fs*(-2.39967571091069e-24*fs - 1.10603176686117e-20) - 7.89937124628652e-20) + 4.60313050181815e-19) + 2.40396202035269e-18)) + Input*(Input*(fs*(fs*(fs*(8.43299855376218e-23*fs + 2.15807364568921e-19) - 4.37590986205892e-18) - 6.77666749937426e-17) - 1.59638352348971e-16) + fs*(fs*(fs*(-8.43299855376218e-23*fs - 2.15807364568921e-19) + 4.37590986205892e-18) + 6.77666749937426e-17) + 1.59638352348971e-16) + Treble*(Input*(Input*fs*(fs*(fs*(2.04002764302185e-23*fs - 3.86721597525567e-20) + 6.80858259239558e-19) + 7.02807846216346e-18) + fs*(fs*(fs*(-2.04002764302185e-23*fs + 3.86721597525567e-20) - 6.80858259239558e-19) - 7.02807846216346e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(-1.45716260215846e-23*fs - 8.53036904160507e-23) + 2.93335472441235e-22) + pow(fs,2)*(fs*(1.45716260215846e-23*fs + 8.53036904160507e-23) - 2.93335472441235e-22)) + pow(fs,2)*(fs*(1.55624965910524e-23*fs + 9.11043413643421e-23) - 3.13282284567239e-22)) + fs*(fs*(fs*(-2.17874952274734e-23*fs + 4.13018666157306e-20) - 7.27156620867848e-19) - 7.50598779759058e-18)) + fs*(fs*(fs*(-9.00644245541801e-23*fs - 2.30482265359608e-19) + 4.67347173267892e-18) + 7.2374808893317e-17) + 1.70493760308701e-16) + Treble*(Input*(Input*(fs*(fs*(fs*(1.7495425825243e-22*fs - 5.15947717885593e-19) + 2.3901137548476e-17) + 8.12663847966588e-16) + 3.99095880872428e-15) + fs*(fs*(fs*(-1.7495425825243e-22*fs + 5.15947717885593e-19) - 2.3901137548476e-17) - 8.12663847966588e-16) - 3.99095880872428e-15) + Treble*(Input*(Input*fs*(fs*(fs*(-1.94446256943486e-22*fs - 2.99095367015295e-21) + 3.38701967358278e-20) + 2.99321910654321e-19) + fs*(fs*(fs*(1.94446256943486e-22*fs + 2.99095367015295e-21) - 3.38701967358278e-20) - 2.99321910654321e-19)) + fs*(fs*(fs*(2.07668602415643e-22*fs + 3.19433851972335e-21) - 3.61733701138641e-20) - 3.19675800578815e-19)) + fs*(fs*(fs*(-1.86851147813595e-22*fs + 5.51032162701814e-19) - 2.55264149017724e-17) - 8.67924989628316e-16) - 4.26234400771753e-15) + fs*(fs*(fs*(-9.3476168267281e-22*fs - 2.78390986018658e-18) + 1.27957634839887e-16) + 4.34250203034679e-15) + 2.13117200385877e-14;
a2 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(-4.66400408138021e-23*fs - 8.42215434367137e-20) + 9.39287943021533e-18) + 1.70442029998199e-16) - 9.41869519219001e-16) - 7.98191761744856e-15) + fs*(fs*(fs*(fs*(4.66400408138021e-23*fs + 8.42215434367137e-20) - 9.39287943021533e-18) - 1.70442029998199e-16) + 9.41869519219001e-16) + 7.98191761744856e-15) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(-9.32295933998211e-24*fs + 1.62693020416284e-20) - 1.65578841437396e-18) - 2.43786947835935e-17) + 7.96196282340494e-17) + fs*(fs*(fs*(fs*(9.32295933998211e-24*fs - 1.62693020416284e-20) + 1.65578841437396e-18) + 2.43786947835935e-17) - 7.96196282340494e-17)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(1.03616486126347e-23*fs + 2.08017688353901e-22) - 3.05672470418848e-21) - 9.97739702181071e-21) + pow(fs,2)*(fs*(fs*(-1.03616486126347e-23*fs - 2.08017688353901e-22) + 3.05672470418848e-21) + 9.97739702181071e-21)) + pow(fs,2)*(fs*(fs*(-1.10662407182939e-23*fs - 2.22162891161966e-22) + 3.26458198407329e-21) + 1.06558600192938e-20)) + fs*(fs*(fs*(fs*(9.95692057510089e-24*fs - 1.73756145804592e-20) + 1.76838202655138e-18) + 2.60364460288779e-17) - 8.50337629539648e-17)) + fs*(fs*(fs*(fs*(4.98115635891407e-23*fs + 8.99486083904102e-20) - 1.003159523147e-17) - 1.82032088038077e-16) + 1.00591664652589e-15) + 8.52468801543507e-15) + Input*(Input*(fs*(fs*(fs*(-5.83496680819482e-22*fs + 5.21331434491869e-18) + 2.39621039026005e-16) - 2.71067542468589e-15) - 3.99095880872428e-14) + fs*(fs*(fs*(5.83496680819482e-22*fs - 5.21331434491869e-18) - 2.39621039026005e-16) + 2.71067542468589e-15) + 3.99095880872428e-14) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(-4.49377473953314e-24*fs - 6.90406845731066e-21) + 1.47928300492257e-19) + 8.62009457269317e-19) - 1.50060051208033e-18) + fs*(fs*(fs*(fs*(4.49377473953314e-24*fs + 6.90406845731066e-21) - 1.47928300492257e-19) - 8.62009457269317e-19) + 1.50060051208033e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-1.08708956034044e-24*fs + 1.23546374312186e-21) - 2.17514970431002e-20) - 7.48424505400065e-20) + pow(fs,2)*(fs*(fs*(1.08708956034044e-24*fs - 1.23546374312186e-21) + 2.17514970431002e-20) + 7.48424505400065e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(7.76492543100316e-25*fs + 2.72739690445876e-24) - 9.37875320050206e-24) + pow(fs,3)*(fs*(-7.76492543100316e-25*fs - 2.72739690445876e-24) + 9.37875320050206e-24)) + pow(fs,3)*(fs*(-8.29294036031137e-25*fs - 2.91285989396196e-24) + 1.00165084181362e-23)) + pow(fs,2)*(fs*(fs*(1.16101165044359e-24*fs - 1.31947527765415e-21) + 2.3230598842031e-20) + 7.99317371767269e-20)) + fs*(fs*(fs*(fs*(4.79935142182139e-24*fs + 7.37354511240778e-21) - 1.5798742492573e-19) - 9.2062610036363e-19) + 1.60264134690179e-18)) + Input*(Input*(fs*(fs*(fs*(-5.62199903584146e-23*fs + 4.31614729137842e-19) + 8.75181972411783e-18) - 4.51777833291617e-17) - 3.19276704697943e-16) + fs*(fs*(fs*(5.62199903584146e-23*fs - 4.31614729137842e-19) - 8.75181972411783e-18) + 4.51777833291617e-17) + 3.19276704697943e-16) + Treble*(Input*(Input*fs*(fs*(fs*(-1.36001842868123e-23*fs - 7.73443195051134e-20) - 1.36171651847912e-18) + 4.68538564144231e-18) + fs*(fs*(fs*(1.36001842868123e-23*fs + 7.73443195051134e-20) + 1.36171651847912e-18) - 4.68538564144231e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(9.7144173477231e-24*fs - 1.70607380832101e-22) - 5.86670944882469e-22) + pow(fs,2)*(fs*(-9.7144173477231e-24*fs + 1.70607380832101e-22) + 5.86670944882469e-22)) + pow(fs,2)*(fs*(-1.03749977273683e-23*fs + 1.82208682728684e-22) + 6.26564569134477e-22)) + fs*(fs*(fs*(1.45249968183156e-23*fs + 8.26037332314611e-20) + 1.4543132417357e-18) - 5.00399186506038e-18)) + fs*(fs*(fs*(6.00429497027867e-23*fs - 4.60964530719215e-19) - 9.34694346535784e-18) + 4.82498725955447e-17) + 3.40987520617403e-16) + Treble*(Input*(Input*(fs*(fs*(fs*(-1.16636172168287e-22*fs - 1.03189543577119e-18) - 4.7802275096952e-17) + 5.41775898644392e-16) + 7.98191761744856e-15) + fs*(fs*(fs*(1.16636172168287e-22*fs + 1.03189543577119e-18) + 4.7802275096952e-17) - 5.41775898644392e-16) - 7.98191761744856e-15) + Treble*(Input*(Input*fs*(fs*(fs*(1.29630837962324e-22*fs - 5.98190734030589e-21) - 6.77403934716556e-20) + 1.99547940436214e-19) + fs*(fs*(fs*(-1.29630837962324e-22*fs + 5.98190734030589e-21) + 6.77403934716556e-20) - 1.99547940436214e-19)) + fs*(fs*(fs*(-1.38445734943762e-22*fs + 6.38867703944669e-21) + 7.23467402277282e-20) - 2.13117200385877e-19)) + fs*(fs*(fs*(1.2456743187573e-22*fs + 1.10206432540363e-18) + 5.10528298035447e-17) - 5.78616659752211e-16) - 8.52468801543507e-15) + fs*(fs*(fs*(6.23174455115207e-22*fs - 5.56781972037316e-18) - 2.55915269679773e-16) + 2.89500135356453e-15) + 4.26234400771753e-14;
a3 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(4.66400408138021e-23*fs - 8.42215434367137e-20) - 9.39287943021533e-18) + 1.70442029998199e-16) + 9.41869519219001e-16) - 7.98191761744856e-15) + fs*(fs*(fs*(fs*(-4.66400408138021e-23*fs + 8.42215434367137e-20) + 9.39287943021533e-18) - 1.70442029998199e-16) - 9.41869519219001e-16) + 7.98191761744856e-15) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(9.32295933998211e-24*fs + 1.62693020416284e-20) + 1.65578841437396e-18) - 2.43786947835935e-17) - 7.96196282340494e-17) + fs*(fs*(fs*(fs*(-9.32295933998211e-24*fs - 1.62693020416284e-20) - 1.65578841437396e-18) + 2.43786947835935e-17) + 7.96196282340494e-17)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-1.03616486126347e-23*fs + 2.08017688353901e-22) + 3.05672470418848e-21) - 9.97739702181071e-21) + pow(fs,2)*(fs*(fs*(1.03616486126347e-23*fs - 2.08017688353901e-22) - 3.05672470418848e-21) + 9.97739702181071e-21)) + pow(fs,2)*(fs*(fs*(1.10662407182939e-23*fs - 2.22162891161966e-22) - 3.26458198407329e-21) + 1.06558600192938e-20)) + fs*(fs*(fs*(fs*(-9.95692057510089e-24*fs - 1.73756145804592e-20) - 1.76838202655138e-18) + 2.60364460288779e-17) + 8.50337629539648e-17)) + fs*(fs*(fs*(fs*(-4.98115635891407e-23*fs + 8.99486083904102e-20) + 1.003159523147e-17) - 1.82032088038077e-16) - 1.00591664652589e-15) + 8.52468801543507e-15) + Input*(Input*(fs*(fs*(fs*(-5.83496680819482e-22*fs - 5.21331434491869e-18) + 2.39621039026005e-16) + 2.71067542468589e-15) - 3.99095880872428e-14) + fs*(fs*(fs*(5.83496680819482e-22*fs + 5.21331434491869e-18) - 2.39621039026005e-16) - 2.71067542468589e-15) + 3.99095880872428e-14) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(4.49377473953314e-24*fs - 6.90406845731066e-21) - 1.47928300492257e-19) + 8.62009457269317e-19) + 1.50060051208033e-18) + fs*(fs*(fs*(fs*(-4.49377473953314e-24*fs + 6.90406845731066e-21) + 1.47928300492257e-19) - 8.62009457269317e-19) - 1.50060051208033e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(1.08708956034044e-24*fs + 1.23546374312186e-21) + 2.17514970431002e-20) - 7.48424505400065e-20) + pow(fs,2)*(fs*(fs*(-1.08708956034044e-24*fs - 1.23546374312186e-21) - 2.17514970431002e-20) + 7.48424505400065e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(-7.76492543100316e-25*fs + 2.72739690445876e-24) + 9.37875320050206e-24) + pow(fs,3)*(fs*(7.76492543100316e-25*fs - 2.72739690445876e-24) - 9.37875320050206e-24)) + pow(fs,3)*(fs*(8.29294036031137e-25*fs - 2.91285989396196e-24) - 1.00165084181362e-23)) + pow(fs,2)*(fs*(fs*(-1.16101165044359e-24*fs - 1.31947527765415e-21) - 2.3230598842031e-20) + 7.99317371767269e-20)) + fs*(fs*(fs*(fs*(-4.79935142182139e-24*fs + 7.37354511240778e-21) + 1.5798742492573e-19) - 9.2062610036363e-19) - 1.60264134690179e-18)) + Input*(Input*(fs*(fs*(fs*(-5.62199903584146e-23*fs - 4.31614729137842e-19) + 8.75181972411783e-18) + 4.51777833291617e-17) - 3.19276704697943e-16) + fs*(fs*(fs*(5.62199903584146e-23*fs + 4.31614729137842e-19) - 8.75181972411783e-18) - 4.51777833291617e-17) + 3.19276704697943e-16) + Treble*(Input*(Input*fs*(fs*(fs*(-1.36001842868123e-23*fs + 7.73443195051134e-20) - 1.36171651847912e-18) - 4.68538564144231e-18) + fs*(fs*(fs*(1.36001842868123e-23*fs - 7.73443195051134e-20) + 1.36171651847912e-18) + 4.68538564144231e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(9.7144173477231e-24*fs + 1.70607380832101e-22) - 5.86670944882469e-22) + pow(fs,2)*(fs*(-9.7144173477231e-24*fs - 1.70607380832101e-22) + 5.86670944882469e-22)) + pow(fs,2)*(fs*(-1.03749977273683e-23*fs - 1.82208682728684e-22) + 6.26564569134477e-22)) + fs*(fs*(fs*(1.45249968183156e-23*fs - 8.26037332314611e-20) + 1.4543132417357e-18) + 5.00399186506038e-18)) + fs*(fs*(fs*(6.00429497027867e-23*fs + 4.60964530719215e-19) - 9.34694346535784e-18) - 4.82498725955447e-17) + 3.40987520617403e-16) + Treble*(Input*(Input*(fs*(fs*(fs*(-1.16636172168287e-22*fs + 1.03189543577119e-18) - 4.7802275096952e-17) - 5.41775898644392e-16) + 7.98191761744856e-15) + fs*(fs*(fs*(1.16636172168287e-22*fs - 1.03189543577119e-18) + 4.7802275096952e-17) + 5.41775898644392e-16) - 7.98191761744856e-15) + Treble*(Input*(Input*fs*(fs*(fs*(1.29630837962324e-22*fs + 5.98190734030589e-21) - 6.77403934716556e-20) - 1.99547940436214e-19) + fs*(fs*(fs*(-1.29630837962324e-22*fs - 5.98190734030589e-21) + 6.77403934716556e-20) + 1.99547940436214e-19)) + fs*(fs*(fs*(-1.38445734943762e-22*fs - 6.38867703944669e-21) + 7.23467402277282e-20) + 2.13117200385877e-19)) + fs*(fs*(fs*(1.2456743187573e-22*fs - 1.10206432540363e-18) + 5.10528298035447e-17) + 5.78616659752211e-16) - 8.52468801543507e-15) + fs*(fs*(fs*(6.23174455115207e-22*fs + 5.56781972037316e-18) - 2.55915269679773e-16) - 2.89500135356453e-15) + 4.26234400771753e-14;
a4 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(-2.33200204069011e-23*fs + 1.26332315155071e-19) - 4.69643971510767e-18) - 8.52210149990995e-17) + 1.4128042788285e-15) - 3.99095880872428e-15) + fs*(fs*(fs*(fs*(2.33200204069011e-23*fs - 1.26332315155071e-19) + 4.69643971510767e-18) + 8.52210149990995e-17) - 1.4128042788285e-15) + 3.99095880872428e-15) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(-4.66147966999105e-24*fs - 2.44039530624426e-20) + 8.27894207186978e-19) + 1.21893473917967e-17) - 1.19429442351074e-16) + fs*(fs*(fs*(fs*(4.66147966999105e-24*fs + 2.44039530624426e-20) - 8.27894207186978e-19) - 1.21893473917967e-17) + 1.19429442351074e-16)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(5.18082430631737e-24*fs - 3.12026532530851e-22) + 1.52836235209424e-21) + 4.98869851090535e-21) + pow(fs,2)*(fs*(fs*(-5.18082430631737e-24*fs + 3.12026532530851e-22) - 1.52836235209424e-21) - 4.98869851090535e-21)) + pow(fs,2)*(fs*(fs*(-5.53312035914695e-24*fs + 3.33244336742949e-22) - 1.63229099203665e-21) - 5.32793000964692e-21)) + fs*(fs*(fs*(fs*(4.97846028755044e-24*fs + 2.60634218706887e-20) - 8.84191013275692e-19) - 1.30182230144389e-17) + 1.27550644430947e-16)) + fs*(fs*(fs*(fs*(2.49057817945703e-23*fs - 1.34922912585615e-19) + 5.01579761573499e-18) + 9.10160440190383e-17) - 1.50887496978884e-15) + 4.26234400771753e-15) + Input*(Input*(fs*(fs*(fs*(8.75245021229223e-22*fs - 2.60665717245934e-18) - 1.19810519513002e-16) + 4.06601313702883e-15) - 1.99547940436214e-14) + fs*(fs*(fs*(-8.75245021229223e-22*fs + 2.60665717245934e-18) + 1.19810519513002e-16) - 4.06601313702883e-15) + 1.99547940436214e-14) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(-2.24688736976657e-24*fs + 1.0356102685966e-20) - 7.39641502461285e-20) - 4.31004728634658e-19) + 2.2509007681205e-18) + fs*(fs*(fs*(fs*(2.24688736976657e-24*fs - 1.0356102685966e-20) + 7.39641502461285e-20) + 4.31004728634658e-19) - 2.2509007681205e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-5.43544780170221e-25*fs - 1.85319561468279e-21) + 1.08757485215501e-20) + 3.74212252700032e-20) + pow(fs,2)*(fs*(fs*(5.43544780170221e-25*fs + 1.85319561468279e-21) - 1.08757485215501e-20) - 3.74212252700032e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(3.88246271550158e-25*fs - 4.09109535668814e-24) + 4.68937660025103e-24) + pow(fs,3)*(fs*(-3.88246271550158e-25*fs + 4.09109535668814e-24) - 4.68937660025103e-24)) + pow(fs,3)*(fs*(-4.14647018015568e-25*fs + 4.36928984094294e-24) - 5.0082542090681e-24)) + pow(fs,2)*(fs*(fs*(5.80505825221796e-25*fs + 1.97921291648122e-21) - 1.16152994210155e-20) - 3.99658685883635e-20)) + fs*(fs*(fs*(fs*(2.39967571091069e-24*fs - 1.10603176686117e-20) + 7.89937124628652e-20) + 4.60313050181815e-19) - 2.40396202035269e-18)) + Input*(Input*(fs*(fs*(fs*(8.43299855376218e-23*fs - 2.15807364568921e-19) - 4.37590986205892e-18) + 6.77666749937426e-17) - 1.59638352348971e-16) + fs*(fs*(fs*(-8.43299855376218e-23*fs + 2.15807364568921e-19) + 4.37590986205892e-18) - 6.77666749937426e-17) + 1.59638352348971e-16) + Treble*(Input*(Input*fs*(fs*(fs*(2.04002764302185e-23*fs + 3.86721597525567e-20) + 6.80858259239558e-19) - 7.02807846216346e-18) + fs*(fs*(fs*(-2.04002764302185e-23*fs - 3.86721597525567e-20) - 6.80858259239558e-19) + 7.02807846216346e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(-1.45716260215846e-23*fs + 8.53036904160507e-23) + 2.93335472441235e-22) + pow(fs,2)*(fs*(1.45716260215846e-23*fs - 8.53036904160507e-23) - 2.93335472441235e-22)) + pow(fs,2)*(fs*(1.55624965910524e-23*fs - 9.11043413643421e-23) - 3.13282284567239e-22)) + fs*(fs*(fs*(-2.17874952274734e-23*fs - 4.13018666157306e-20) - 7.27156620867848e-19) + 7.50598779759058e-18)) + fs*(fs*(fs*(-9.00644245541801e-23*fs + 2.30482265359608e-19) + 4.67347173267892e-18) - 7.2374808893317e-17) + 1.70493760308701e-16) + Treble*(Input*(Input*(fs*(fs*(fs*(1.7495425825243e-22*fs + 5.15947717885593e-19) + 2.3901137548476e-17) - 8.12663847966588e-16) + 3.99095880872428e-15) + fs*(fs*(fs*(-1.7495425825243e-22*fs - 5.15947717885593e-19) - 2.3901137548476e-17) + 8.12663847966588e-16) - 3.99095880872428e-15) + Treble*(Input*(Input*fs*(fs*(fs*(-1.94446256943486e-22*fs + 2.99095367015295e-21) + 3.38701967358278e-20) - 2.99321910654321e-19) + fs*(fs*(fs*(1.94446256943486e-22*fs - 2.99095367015295e-21) - 3.38701967358278e-20) + 2.99321910654321e-19)) + fs*(fs*(fs*(2.07668602415643e-22*fs - 3.19433851972335e-21) - 3.61733701138641e-20) + 3.19675800578815e-19)) + fs*(fs*(fs*(-1.86851147813595e-22*fs - 5.51032162701814e-19) - 2.55264149017724e-17) + 8.67924989628316e-16) - 4.26234400771753e-15) + fs*(fs*(fs*(-9.3476168267281e-22*fs + 2.78390986018658e-18) + 1.27957634839887e-16) - 4.34250203034679e-15) + 2.13117200385877e-14;
a5 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(4.66400408138021e-24*fs - 4.21107717183568e-20) + 4.69643971510767e-18) - 8.52210149990995e-17) + 4.70934759609501e-16) - 7.98191761744856e-16) + fs*(fs*(fs*(fs*(-4.66400408138021e-24*fs + 4.21107717183568e-20) - 4.69643971510767e-18) + 8.52210149990995e-17) - 4.70934759609501e-16) + 7.98191761744856e-16) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(9.32295933998211e-25*fs + 8.13465102081422e-21) - 8.27894207186978e-19) + 1.21893473917967e-17) - 3.98098141170247e-17) + fs*(fs*(fs*(fs*(-9.32295933998211e-25*fs - 8.13465102081422e-21) + 8.27894207186978e-19) - 1.21893473917967e-17) + 3.98098141170247e-17)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-1.03616486126347e-24*fs + 1.0400884417695e-22) - 1.52836235209424e-21) + 4.98869851090535e-21) + pow(fs,2)*(fs*(fs*(1.03616486126347e-24*fs - 1.0400884417695e-22) + 1.52836235209424e-21) - 4.98869851090535e-21)) + pow(fs,2)*(fs*(fs*(1.10662407182939e-24*fs - 1.11081445580983e-22) + 1.63229099203665e-21) - 5.32793000964692e-21)) + fs*(fs*(fs*(fs*(-9.95692057510089e-25*fs - 8.68780729022958e-21) + 8.84191013275692e-19) - 1.30182230144389e-17) + 4.25168814769824e-17)) + fs*(fs*(fs*(fs*(-4.98115635891407e-24*fs + 4.49743041952051e-20) - 5.01579761573499e-18) + 9.10160440190383e-17) - 5.02958323262947e-16) + 8.52468801543507e-16) + Input*(Input*(fs*(fs*(fs*(-2.91748340409741e-22*fs + 2.60665717245934e-18) - 1.19810519513002e-16) + 1.35533771234294e-15) - 3.99095880872428e-15) + fs*(fs*(fs*(2.91748340409741e-22*fs - 2.60665717245934e-18) + 1.19810519513002e-16) - 1.35533771234294e-15) + 3.99095880872428e-15) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(4.49377473953314e-25*fs - 3.45203422865533e-21) + 7.39641502461285e-20) - 4.31004728634658e-19) + 7.50300256040165e-19) + fs*(fs*(fs*(fs*(-4.49377473953314e-25*fs + 3.45203422865533e-21) - 7.39641502461285e-20) + 4.31004728634658e-19) - 7.50300256040165e-19)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(1.08708956034044e-25*fs + 6.17731871560931e-22) - 1.08757485215501e-20) + 3.74212252700032e-20) + pow(fs,2)*(fs*(fs*(-1.08708956034044e-25*fs - 6.17731871560931e-22) + 1.08757485215501e-20) - 3.74212252700032e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(-7.76492543100316e-26*fs + 1.36369845222938e-24) - 4.68937660025103e-24) + pow(fs,3)*(fs*(7.76492543100316e-26*fs - 1.36369845222938e-24) + 4.68937660025103e-24)) + pow(fs,3)*(fs*(8.29294036031137e-26*fs - 1.45642994698098e-24) + 5.0082542090681e-24)) + pow(fs,2)*(fs*(fs*(-1.16101165044359e-25*fs - 6.59737638827074e-22) + 1.16152994210155e-20) - 3.99658685883635e-20)) + fs*(fs*(fs*(fs*(-4.79935142182139e-25*fs + 3.68677255620389e-21) - 7.89937124628652e-20) + 4.60313050181815e-19) - 8.01320673450896e-19)) + Input*(Input*(fs*(fs*(fs*(-2.81099951792073e-23*fs + 2.15807364568921e-19) - 4.37590986205892e-18) + 2.25888916645809e-17) - 3.19276704697943e-17) + fs*(fs*(fs*(2.81099951792073e-23*fs - 2.15807364568921e-19) + 4.37590986205892e-18) - 2.25888916645809e-17) + 3.19276704697943e-17) + Treble*(Input*(Input*fs*(fs*(fs*(-6.80009214340617e-24*fs - 3.86721597525567e-20) + 6.80858259239558e-19) - 2.34269282072115e-18) + fs*(fs*(fs*(6.80009214340617e-24*fs + 3.86721597525567e-20) - 6.80858259239558e-19) + 2.34269282072115e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(4.85720867386155e-24*fs - 8.53036904160507e-23) + 2.93335472441235e-22) + pow(fs,2)*(fs*(-4.85720867386155e-24*fs + 8.53036904160507e-23) - 2.93335472441235e-22)) + pow(fs,2)*(fs*(-5.18749886368413e-24*fs + 9.11043413643421e-23) - 3.13282284567239e-22)) + fs*(fs*(fs*(7.26249840915779e-24*fs + 4.13018666157306e-20) - 7.27156620867848e-19) + 2.50199593253019e-18)) + fs*(fs*(fs*(3.00214748513934e-23*fs - 2.30482265359608e-19) + 4.67347173267892e-18) - 2.41249362977723e-17) + 3.40987520617403e-17) + Treble*(Input*(Input*(fs*(fs*(fs*(-5.83180860841434e-23*fs - 5.15947717885593e-19) + 2.3901137548476e-17) - 2.70887949322196e-16) + 7.98191761744856e-16) + fs*(fs*(fs*(5.83180860841434e-23*fs + 5.15947717885593e-19) - 2.3901137548476e-17) + 2.70887949322196e-16) - 7.98191761744856e-16) + Treble*(Input*(Input*fs*(fs*(fs*(6.4815418981162e-23*fs - 2.99095367015295e-21) + 3.38701967358278e-20) - 9.9773970218107e-20) + fs*(fs*(fs*(-6.4815418981162e-23*fs + 2.99095367015295e-21) - 3.38701967358278e-20) + 9.9773970218107e-20)) + fs*(fs*(fs*(-6.9222867471881e-23*fs + 3.19433851972335e-21) - 3.61733701138641e-20) + 1.06558600192938e-19)) + fs*(fs*(fs*(6.22837159378651e-23*fs + 5.51032162701814e-19) - 2.55264149017724e-17) + 2.89308329876105e-16) - 8.52468801543507e-16) + fs*(fs*(fs*(3.11587227557603e-22*fs - 2.78390986018658e-18) + 1.27957634839887e-16) - 1.44750067678226e-15) + 4.26234400771753e-15;
};
| https://raw.githubusercontent.com/ml-wo/VirtualGuitarAmp-Guitarix/b4f4caaed9caba9826af7d2862f7789a26e730be/trunk/src/LV2/faust/gx_alembic.dsp | faust | declare id "alembic";
declare name "Alembic Preamp";
declare category "External";
import("stdfaust.lib");
process = pre : fi.iir((b0/a0,b1/a0,b2/a0,b3/a0,b4/a0,b5/a0),(a1/a0,a2/a0,a3/a0,a4/a0,a5/a0)):*(0.1) with {
LogPot(a, x) = ba.if(a, (exp(a * x) - 1) / (exp(a) - 1), x);
Inverted(b, x) = ba.if(b, 1 - x, x);
s = 0.993;
fs = float(ma.SR);
pre = _;
Input = vslider("Input[name:Input]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
Bass = vslider("Bass[name:Bass]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
Middle = vslider("Middle[name:Middle]", 0.5, 0, 1, 0.01) : Inverted(0) : si.smooth(s);
Treble = vslider("Treble[name:Treble]", 0.5, 0, 1, 0.01) : Inverted(1) : si.smooth(s);
Volume = vslider("Volume[name:Volume]", 0.5, 0, 1, 0.01) : Inverted(0) : LogPot(1) : si.smooth(s);
b0 = Volume*(Bass*(Input*Treble*pow(fs,4)*(-5.68615530428513e-21*fs - 3.79077020285676e-20) + Input*pow(fs,2)*(fs*(fs*(5.68615530428513e-21*fs + 9.98505002369502e-19) + 4.85778329480724e-15) + 3.23425287520332e-14)) + Input*Treble*pow(fs,2)*(fs*(-3.55687161587197e-19*fs - 1.44694505189894e-17) - 8.06546851671652e-17) + Input*pow(fs,2)*(fs*(3.55687161587197e-19*fs + 1.44694505189894e-17) + 8.06546851671652e-17) + Middle*(Bass*Input*pow(fs,3)*(fs*(7.96061742599918e-22*fs + 4.56560363232067e-18) + 3.04019770269112e-17) + Input*pow(fs,2)*(fs*(4.97962026222076e-20*fs + 2.85365632064909e-16) + 1.90022438253841e-15)));
b1 = Volume*(Bass*(Input*Treble*pow(fs,4)*(2.84307765214256e-20*fs + 1.13723106085703e-19) + Input*pow(fs,2)*(fs*(fs*(-2.84307765214256e-20*fs - 2.99551500710851e-18) - 4.85778329480724e-15) + 3.23425287520332e-14)) + Input*Treble*pow(fs,2)*(fs*(1.06706148476159e-18*fs + 1.44694505189894e-17) - 8.06546851671652e-17) + Input*pow(fs,2)*(fs*(-1.06706148476159e-18*fs - 1.44694505189894e-17) + 8.06546851671652e-17) + Middle*(Bass*Input*pow(fs,3)*(fs*(-3.98030871299959e-21*fs - 1.3696810896962e-17) - 3.04019770269112e-17) + Input*pow(fs,2)*(fs*(-1.49388607866623e-19*fs - 2.85365632064909e-16) + 1.90022438253841e-15)));
b2 = Volume*(Bass*(Input*Treble*pow(fs,4)*(-5.68615530428513e-20*fs - 7.58154040571353e-20) + Input*pow(fs,2)*(fs*(fs*(5.68615530428513e-20*fs + 1.997010004739e-18) - 9.71556658961449e-15) - 6.46850575040665e-14)) + Input*Treble*pow(fs,2)*(fs*(-7.11374323174395e-19*fs + 2.89389010379788e-17) + 1.6130937033433e-16) + Input*pow(fs,2)*(fs*(7.11374323174395e-19*fs - 2.89389010379788e-17) - 1.6130937033433e-16) + Middle*(Bass*Input*pow(fs,3)*(fs*(7.96061742599918e-21*fs + 9.13120726464134e-18) - 6.08039540538225e-17) + Input*pow(fs,2)*(fs*(9.95924052444153e-20*fs - 5.70731264129818e-16) - 3.80044876507682e-15)));
b3 = Volume*(Bass*(Input*Treble*pow(fs,4)*(5.68615530428513e-20*fs - 7.58154040571353e-20) + Input*pow(fs,2)*(fs*(fs*(-5.68615530428513e-20*fs + 1.997010004739e-18) + 9.71556658961449e-15) - 6.46850575040665e-14)) + Input*Treble*pow(fs,2)*(fs*(-7.11374323174395e-19*fs - 2.89389010379788e-17) + 1.6130937033433e-16) + Input*pow(fs,2)*(fs*(7.11374323174395e-19*fs + 2.89389010379788e-17) - 1.6130937033433e-16) + Middle*(Bass*Input*pow(fs,3)*(fs*(-7.96061742599918e-21*fs + 9.13120726464134e-18) + 6.08039540538225e-17) + Input*pow(fs,2)*(fs*(9.95924052444153e-20*fs + 5.70731264129818e-16) - 3.80044876507682e-15)));
b4 = Volume*(Bass*(Input*Treble*pow(fs,4)*(-2.84307765214256e-20*fs + 1.13723106085703e-19) + Input*pow(fs,2)*(fs*(fs*(2.84307765214256e-20*fs - 2.99551500710851e-18) + 4.85778329480724e-15) + 3.23425287520332e-14)) + Input*Treble*pow(fs,2)*(fs*(1.06706148476159e-18*fs - 1.44694505189894e-17) - 8.06546851671652e-17) + Input*pow(fs,2)*(fs*(-1.06706148476159e-18*fs + 1.44694505189894e-17) + 8.06546851671652e-17) + Middle*(Bass*Input*pow(fs,3)*(fs*(3.98030871299959e-21*fs - 1.3696810896962e-17) + 3.04019770269112e-17) + Input*pow(fs,2)*(fs*(-1.49388607866623e-19*fs + 2.85365632064909e-16) + 1.90022438253841e-15)));
b5 = Volume*(Bass*(Input*Treble*pow(fs,4)*(5.68615530428513e-21*fs - 3.79077020285676e-20) + Input*pow(fs,2)*(fs*(fs*(-5.68615530428513e-21*fs + 9.98505002369502e-19) - 4.85778329480724e-15) + 3.23425287520332e-14)) + Input*Treble*pow(fs,2)*(fs*(-3.55687161587197e-19*fs + 1.44694505189894e-17) - 8.06546851671652e-17) + Input*pow(fs,2)*(fs*(3.55687161587197e-19*fs - 1.44694505189894e-17) + 8.06546851671652e-17) + Middle*(Bass*Input*pow(fs,3)*(fs*(-7.96061742599918e-22*fs + 4.56560363232067e-18) - 3.04019770269112e-17) + Input*pow(fs,2)*(fs*(4.97962026222076e-20*fs - 2.85365632064909e-16) + 1.90022438253841e-15)));
a0 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(-4.66400408138021e-24*fs - 4.21107717183568e-20) - 4.69643971510767e-18) - 8.52210149990995e-17) - 4.70934759609501e-16) - 7.98191761744856e-16) + fs*(fs*(fs*(fs*(4.66400408138021e-24*fs + 4.21107717183568e-20) + 4.69643971510767e-18) + 8.52210149990995e-17) + 4.70934759609501e-16) + 7.98191761744856e-16) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(-9.32295933998211e-25*fs + 8.13465102081422e-21) + 8.27894207186978e-19) + 1.21893473917967e-17) + 3.98098141170247e-17) + fs*(fs*(fs*(fs*(9.32295933998211e-25*fs - 8.13465102081422e-21) - 8.27894207186978e-19) - 1.21893473917967e-17) - 3.98098141170247e-17)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(1.03616486126347e-24*fs + 1.0400884417695e-22) + 1.52836235209424e-21) + 4.98869851090535e-21) + pow(fs,2)*(fs*(fs*(-1.03616486126347e-24*fs - 1.0400884417695e-22) - 1.52836235209424e-21) - 4.98869851090535e-21)) + pow(fs,2)*(fs*(fs*(-1.10662407182939e-24*fs - 1.11081445580983e-22) - 1.63229099203665e-21) - 5.32793000964692e-21)) + fs*(fs*(fs*(fs*(9.95692057510089e-25*fs - 8.68780729022958e-21) - 8.84191013275692e-19) - 1.30182230144389e-17) - 4.25168814769824e-17)) + fs*(fs*(fs*(fs*(4.98115635891407e-24*fs + 4.49743041952051e-20) + 5.01579761573499e-18) + 9.10160440190383e-17) + 5.02958323262947e-16) + 8.52468801543507e-16) + Input*(Input*(fs*(fs*(fs*(-2.91748340409741e-22*fs - 2.60665717245934e-18) - 1.19810519513002e-16) - 1.35533771234294e-15) - 3.99095880872428e-15) + fs*(fs*(fs*(2.91748340409741e-22*fs + 2.60665717245934e-18) + 1.19810519513002e-16) + 1.35533771234294e-15) + 3.99095880872428e-15) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(-4.49377473953314e-25*fs - 3.45203422865533e-21) - 7.39641502461285e-20) - 4.31004728634658e-19) - 7.50300256040165e-19) + fs*(fs*(fs*(fs*(4.49377473953314e-25*fs + 3.45203422865533e-21) + 7.39641502461285e-20) + 4.31004728634658e-19) + 7.50300256040165e-19)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-1.08708956034044e-25*fs + 6.17731871560931e-22) + 1.08757485215501e-20) + 3.74212252700032e-20) + pow(fs,2)*(fs*(fs*(1.08708956034044e-25*fs - 6.17731871560931e-22) - 1.08757485215501e-20) - 3.74212252700032e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(7.76492543100316e-26*fs + 1.36369845222938e-24) + 4.68937660025103e-24) + pow(fs,3)*(fs*(-7.76492543100316e-26*fs - 1.36369845222938e-24) - 4.68937660025103e-24)) + pow(fs,3)*(fs*(-8.29294036031137e-26*fs - 1.45642994698098e-24) - 5.0082542090681e-24)) + pow(fs,2)*(fs*(fs*(1.16101165044359e-25*fs - 6.59737638827074e-22) - 1.16152994210155e-20) - 3.99658685883635e-20)) + fs*(fs*(fs*(fs*(4.79935142182139e-25*fs + 3.68677255620389e-21) + 7.89937124628652e-20) + 4.60313050181815e-19) + 8.01320673450896e-19)) + Input*(Input*(fs*(fs*(fs*(-2.81099951792073e-23*fs - 2.15807364568921e-19) - 4.37590986205892e-18) - 2.25888916645809e-17) - 3.19276704697943e-17) + fs*(fs*(fs*(2.81099951792073e-23*fs + 2.15807364568921e-19) + 4.37590986205892e-18) + 2.25888916645809e-17) + 3.19276704697943e-17) + Treble*(Input*(Input*fs*(fs*(fs*(-6.80009214340617e-24*fs + 3.86721597525567e-20) + 6.80858259239558e-19) + 2.34269282072115e-18) + fs*(fs*(fs*(6.80009214340617e-24*fs - 3.86721597525567e-20) - 6.80858259239558e-19) - 2.34269282072115e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(4.85720867386155e-24*fs + 8.53036904160507e-23) + 2.93335472441235e-22) + pow(fs,2)*(fs*(-4.85720867386155e-24*fs - 8.53036904160507e-23) - 2.93335472441235e-22)) + pow(fs,2)*(fs*(-5.18749886368413e-24*fs - 9.11043413643421e-23) - 3.13282284567239e-22)) + fs*(fs*(fs*(7.26249840915779e-24*fs - 4.13018666157306e-20) - 7.27156620867848e-19) - 2.50199593253019e-18)) + fs*(fs*(fs*(3.00214748513934e-23*fs + 2.30482265359608e-19) + 4.67347173267892e-18) + 2.41249362977723e-17) + 3.40987520617403e-17) + Treble*(Input*(Input*(fs*(fs*(fs*(-5.83180860841434e-23*fs + 5.15947717885593e-19) + 2.3901137548476e-17) + 2.70887949322196e-16) + 7.98191761744856e-16) + fs*(fs*(fs*(5.83180860841434e-23*fs - 5.15947717885593e-19) - 2.3901137548476e-17) - 2.70887949322196e-16) - 7.98191761744856e-16) + Treble*(Input*(Input*fs*(fs*(fs*(6.4815418981162e-23*fs + 2.99095367015295e-21) + 3.38701967358278e-20) + 9.9773970218107e-20) + fs*(fs*(fs*(-6.4815418981162e-23*fs - 2.99095367015295e-21) - 3.38701967358278e-20) - 9.9773970218107e-20)) + fs*(fs*(fs*(-6.9222867471881e-23*fs - 3.19433851972335e-21) - 3.61733701138641e-20) - 1.06558600192938e-19)) + fs*(fs*(fs*(6.22837159378651e-23*fs - 5.51032162701814e-19) - 2.55264149017724e-17) - 2.89308329876105e-16) - 8.52468801543507e-16) + fs*(fs*(fs*(3.11587227557603e-22*fs + 2.78390986018658e-18) + 1.27957634839887e-16) + 1.44750067678226e-15) + 4.26234400771753e-15;
a1 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(2.33200204069011e-23*fs + 1.26332315155071e-19) + 4.69643971510767e-18) - 8.52210149990995e-17) - 1.4128042788285e-15) - 3.99095880872428e-15) + fs*(fs*(fs*(fs*(-2.33200204069011e-23*fs - 1.26332315155071e-19) - 4.69643971510767e-18) + 8.52210149990995e-17) + 1.4128042788285e-15) + 3.99095880872428e-15) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(4.66147966999105e-24*fs - 2.44039530624426e-20) - 8.27894207186978e-19) + 1.21893473917967e-17) + 1.19429442351074e-16) + fs*(fs*(fs*(fs*(-4.66147966999105e-24*fs + 2.44039530624426e-20) + 8.27894207186978e-19) - 1.21893473917967e-17) - 1.19429442351074e-16)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-5.18082430631737e-24*fs - 3.12026532530851e-22) - 1.52836235209424e-21) + 4.98869851090535e-21) + pow(fs,2)*(fs*(fs*(5.18082430631737e-24*fs + 3.12026532530851e-22) + 1.52836235209424e-21) - 4.98869851090535e-21)) + pow(fs,2)*(fs*(fs*(5.53312035914695e-24*fs + 3.33244336742949e-22) + 1.63229099203665e-21) - 5.32793000964692e-21)) + fs*(fs*(fs*(fs*(-4.97846028755044e-24*fs + 2.60634218706887e-20) + 8.84191013275692e-19) - 1.30182230144389e-17) - 1.27550644430947e-16)) + fs*(fs*(fs*(fs*(-2.49057817945703e-23*fs - 1.34922912585615e-19) - 5.01579761573499e-18) + 9.10160440190383e-17) + 1.50887496978884e-15) + 4.26234400771753e-15) + Input*(Input*(fs*(fs*(fs*(8.75245021229223e-22*fs + 2.60665717245934e-18) - 1.19810519513002e-16) - 4.06601313702883e-15) - 1.99547940436214e-14) + fs*(fs*(fs*(-8.75245021229223e-22*fs - 2.60665717245934e-18) + 1.19810519513002e-16) + 4.06601313702883e-15) + 1.99547940436214e-14) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(2.24688736976657e-24*fs + 1.0356102685966e-20) + 7.39641502461285e-20) - 4.31004728634658e-19) - 2.2509007681205e-18) + fs*(fs*(fs*(fs*(-2.24688736976657e-24*fs - 1.0356102685966e-20) - 7.39641502461285e-20) + 4.31004728634658e-19) + 2.2509007681205e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(5.43544780170221e-25*fs - 1.85319561468279e-21) - 1.08757485215501e-20) + 3.74212252700032e-20) + pow(fs,2)*(fs*(fs*(-5.43544780170221e-25*fs + 1.85319561468279e-21) + 1.08757485215501e-20) - 3.74212252700032e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(-3.88246271550158e-25*fs - 4.09109535668814e-24) - 4.68937660025103e-24) + pow(fs,3)*(fs*(3.88246271550158e-25*fs + 4.09109535668814e-24) + 4.68937660025103e-24)) + pow(fs,3)*(fs*(4.14647018015568e-25*fs + 4.36928984094294e-24) + 5.0082542090681e-24)) + pow(fs,2)*(fs*(fs*(-5.80505825221796e-25*fs + 1.97921291648122e-21) + 1.16152994210155e-20) - 3.99658685883635e-20)) + fs*(fs*(fs*(fs*(-2.39967571091069e-24*fs - 1.10603176686117e-20) - 7.89937124628652e-20) + 4.60313050181815e-19) + 2.40396202035269e-18)) + Input*(Input*(fs*(fs*(fs*(8.43299855376218e-23*fs + 2.15807364568921e-19) - 4.37590986205892e-18) - 6.77666749937426e-17) - 1.59638352348971e-16) + fs*(fs*(fs*(-8.43299855376218e-23*fs - 2.15807364568921e-19) + 4.37590986205892e-18) + 6.77666749937426e-17) + 1.59638352348971e-16) + Treble*(Input*(Input*fs*(fs*(fs*(2.04002764302185e-23*fs - 3.86721597525567e-20) + 6.80858259239558e-19) + 7.02807846216346e-18) + fs*(fs*(fs*(-2.04002764302185e-23*fs + 3.86721597525567e-20) - 6.80858259239558e-19) - 7.02807846216346e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(-1.45716260215846e-23*fs - 8.53036904160507e-23) + 2.93335472441235e-22) + pow(fs,2)*(fs*(1.45716260215846e-23*fs + 8.53036904160507e-23) - 2.93335472441235e-22)) + pow(fs,2)*(fs*(1.55624965910524e-23*fs + 9.11043413643421e-23) - 3.13282284567239e-22)) + fs*(fs*(fs*(-2.17874952274734e-23*fs + 4.13018666157306e-20) - 7.27156620867848e-19) - 7.50598779759058e-18)) + fs*(fs*(fs*(-9.00644245541801e-23*fs - 2.30482265359608e-19) + 4.67347173267892e-18) + 7.2374808893317e-17) + 1.70493760308701e-16) + Treble*(Input*(Input*(fs*(fs*(fs*(1.7495425825243e-22*fs - 5.15947717885593e-19) + 2.3901137548476e-17) + 8.12663847966588e-16) + 3.99095880872428e-15) + fs*(fs*(fs*(-1.7495425825243e-22*fs + 5.15947717885593e-19) - 2.3901137548476e-17) - 8.12663847966588e-16) - 3.99095880872428e-15) + Treble*(Input*(Input*fs*(fs*(fs*(-1.94446256943486e-22*fs - 2.99095367015295e-21) + 3.38701967358278e-20) + 2.99321910654321e-19) + fs*(fs*(fs*(1.94446256943486e-22*fs + 2.99095367015295e-21) - 3.38701967358278e-20) - 2.99321910654321e-19)) + fs*(fs*(fs*(2.07668602415643e-22*fs + 3.19433851972335e-21) - 3.61733701138641e-20) - 3.19675800578815e-19)) + fs*(fs*(fs*(-1.86851147813595e-22*fs + 5.51032162701814e-19) - 2.55264149017724e-17) - 8.67924989628316e-16) - 4.26234400771753e-15) + fs*(fs*(fs*(-9.3476168267281e-22*fs - 2.78390986018658e-18) + 1.27957634839887e-16) + 4.34250203034679e-15) + 2.13117200385877e-14;
a2 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(-4.66400408138021e-23*fs - 8.42215434367137e-20) + 9.39287943021533e-18) + 1.70442029998199e-16) - 9.41869519219001e-16) - 7.98191761744856e-15) + fs*(fs*(fs*(fs*(4.66400408138021e-23*fs + 8.42215434367137e-20) - 9.39287943021533e-18) - 1.70442029998199e-16) + 9.41869519219001e-16) + 7.98191761744856e-15) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(-9.32295933998211e-24*fs + 1.62693020416284e-20) - 1.65578841437396e-18) - 2.43786947835935e-17) + 7.96196282340494e-17) + fs*(fs*(fs*(fs*(9.32295933998211e-24*fs - 1.62693020416284e-20) + 1.65578841437396e-18) + 2.43786947835935e-17) - 7.96196282340494e-17)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(1.03616486126347e-23*fs + 2.08017688353901e-22) - 3.05672470418848e-21) - 9.97739702181071e-21) + pow(fs,2)*(fs*(fs*(-1.03616486126347e-23*fs - 2.08017688353901e-22) + 3.05672470418848e-21) + 9.97739702181071e-21)) + pow(fs,2)*(fs*(fs*(-1.10662407182939e-23*fs - 2.22162891161966e-22) + 3.26458198407329e-21) + 1.06558600192938e-20)) + fs*(fs*(fs*(fs*(9.95692057510089e-24*fs - 1.73756145804592e-20) + 1.76838202655138e-18) + 2.60364460288779e-17) - 8.50337629539648e-17)) + fs*(fs*(fs*(fs*(4.98115635891407e-23*fs + 8.99486083904102e-20) - 1.003159523147e-17) - 1.82032088038077e-16) + 1.00591664652589e-15) + 8.52468801543507e-15) + Input*(Input*(fs*(fs*(fs*(-5.83496680819482e-22*fs + 5.21331434491869e-18) + 2.39621039026005e-16) - 2.71067542468589e-15) - 3.99095880872428e-14) + fs*(fs*(fs*(5.83496680819482e-22*fs - 5.21331434491869e-18) - 2.39621039026005e-16) + 2.71067542468589e-15) + 3.99095880872428e-14) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(-4.49377473953314e-24*fs - 6.90406845731066e-21) + 1.47928300492257e-19) + 8.62009457269317e-19) - 1.50060051208033e-18) + fs*(fs*(fs*(fs*(4.49377473953314e-24*fs + 6.90406845731066e-21) - 1.47928300492257e-19) - 8.62009457269317e-19) + 1.50060051208033e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-1.08708956034044e-24*fs + 1.23546374312186e-21) - 2.17514970431002e-20) - 7.48424505400065e-20) + pow(fs,2)*(fs*(fs*(1.08708956034044e-24*fs - 1.23546374312186e-21) + 2.17514970431002e-20) + 7.48424505400065e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(7.76492543100316e-25*fs + 2.72739690445876e-24) - 9.37875320050206e-24) + pow(fs,3)*(fs*(-7.76492543100316e-25*fs - 2.72739690445876e-24) + 9.37875320050206e-24)) + pow(fs,3)*(fs*(-8.29294036031137e-25*fs - 2.91285989396196e-24) + 1.00165084181362e-23)) + pow(fs,2)*(fs*(fs*(1.16101165044359e-24*fs - 1.31947527765415e-21) + 2.3230598842031e-20) + 7.99317371767269e-20)) + fs*(fs*(fs*(fs*(4.79935142182139e-24*fs + 7.37354511240778e-21) - 1.5798742492573e-19) - 9.2062610036363e-19) + 1.60264134690179e-18)) + Input*(Input*(fs*(fs*(fs*(-5.62199903584146e-23*fs + 4.31614729137842e-19) + 8.75181972411783e-18) - 4.51777833291617e-17) - 3.19276704697943e-16) + fs*(fs*(fs*(5.62199903584146e-23*fs - 4.31614729137842e-19) - 8.75181972411783e-18) + 4.51777833291617e-17) + 3.19276704697943e-16) + Treble*(Input*(Input*fs*(fs*(fs*(-1.36001842868123e-23*fs - 7.73443195051134e-20) - 1.36171651847912e-18) + 4.68538564144231e-18) + fs*(fs*(fs*(1.36001842868123e-23*fs + 7.73443195051134e-20) + 1.36171651847912e-18) - 4.68538564144231e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(9.7144173477231e-24*fs - 1.70607380832101e-22) - 5.86670944882469e-22) + pow(fs,2)*(fs*(-9.7144173477231e-24*fs + 1.70607380832101e-22) + 5.86670944882469e-22)) + pow(fs,2)*(fs*(-1.03749977273683e-23*fs + 1.82208682728684e-22) + 6.26564569134477e-22)) + fs*(fs*(fs*(1.45249968183156e-23*fs + 8.26037332314611e-20) + 1.4543132417357e-18) - 5.00399186506038e-18)) + fs*(fs*(fs*(6.00429497027867e-23*fs - 4.60964530719215e-19) - 9.34694346535784e-18) + 4.82498725955447e-17) + 3.40987520617403e-16) + Treble*(Input*(Input*(fs*(fs*(fs*(-1.16636172168287e-22*fs - 1.03189543577119e-18) - 4.7802275096952e-17) + 5.41775898644392e-16) + 7.98191761744856e-15) + fs*(fs*(fs*(1.16636172168287e-22*fs + 1.03189543577119e-18) + 4.7802275096952e-17) - 5.41775898644392e-16) - 7.98191761744856e-15) + Treble*(Input*(Input*fs*(fs*(fs*(1.29630837962324e-22*fs - 5.98190734030589e-21) - 6.77403934716556e-20) + 1.99547940436214e-19) + fs*(fs*(fs*(-1.29630837962324e-22*fs + 5.98190734030589e-21) + 6.77403934716556e-20) - 1.99547940436214e-19)) + fs*(fs*(fs*(-1.38445734943762e-22*fs + 6.38867703944669e-21) + 7.23467402277282e-20) - 2.13117200385877e-19)) + fs*(fs*(fs*(1.2456743187573e-22*fs + 1.10206432540363e-18) + 5.10528298035447e-17) - 5.78616659752211e-16) - 8.52468801543507e-15) + fs*(fs*(fs*(6.23174455115207e-22*fs - 5.56781972037316e-18) - 2.55915269679773e-16) + 2.89500135356453e-15) + 4.26234400771753e-14;
a3 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(4.66400408138021e-23*fs - 8.42215434367137e-20) - 9.39287943021533e-18) + 1.70442029998199e-16) + 9.41869519219001e-16) - 7.98191761744856e-15) + fs*(fs*(fs*(fs*(-4.66400408138021e-23*fs + 8.42215434367137e-20) + 9.39287943021533e-18) - 1.70442029998199e-16) - 9.41869519219001e-16) + 7.98191761744856e-15) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(9.32295933998211e-24*fs + 1.62693020416284e-20) + 1.65578841437396e-18) - 2.43786947835935e-17) - 7.96196282340494e-17) + fs*(fs*(fs*(fs*(-9.32295933998211e-24*fs - 1.62693020416284e-20) - 1.65578841437396e-18) + 2.43786947835935e-17) + 7.96196282340494e-17)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-1.03616486126347e-23*fs + 2.08017688353901e-22) + 3.05672470418848e-21) - 9.97739702181071e-21) + pow(fs,2)*(fs*(fs*(1.03616486126347e-23*fs - 2.08017688353901e-22) - 3.05672470418848e-21) + 9.97739702181071e-21)) + pow(fs,2)*(fs*(fs*(1.10662407182939e-23*fs - 2.22162891161966e-22) - 3.26458198407329e-21) + 1.06558600192938e-20)) + fs*(fs*(fs*(fs*(-9.95692057510089e-24*fs - 1.73756145804592e-20) - 1.76838202655138e-18) + 2.60364460288779e-17) + 8.50337629539648e-17)) + fs*(fs*(fs*(fs*(-4.98115635891407e-23*fs + 8.99486083904102e-20) + 1.003159523147e-17) - 1.82032088038077e-16) - 1.00591664652589e-15) + 8.52468801543507e-15) + Input*(Input*(fs*(fs*(fs*(-5.83496680819482e-22*fs - 5.21331434491869e-18) + 2.39621039026005e-16) + 2.71067542468589e-15) - 3.99095880872428e-14) + fs*(fs*(fs*(5.83496680819482e-22*fs + 5.21331434491869e-18) - 2.39621039026005e-16) - 2.71067542468589e-15) + 3.99095880872428e-14) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(4.49377473953314e-24*fs - 6.90406845731066e-21) - 1.47928300492257e-19) + 8.62009457269317e-19) + 1.50060051208033e-18) + fs*(fs*(fs*(fs*(-4.49377473953314e-24*fs + 6.90406845731066e-21) + 1.47928300492257e-19) - 8.62009457269317e-19) - 1.50060051208033e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(1.08708956034044e-24*fs + 1.23546374312186e-21) + 2.17514970431002e-20) - 7.48424505400065e-20) + pow(fs,2)*(fs*(fs*(-1.08708956034044e-24*fs - 1.23546374312186e-21) - 2.17514970431002e-20) + 7.48424505400065e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(-7.76492543100316e-25*fs + 2.72739690445876e-24) + 9.37875320050206e-24) + pow(fs,3)*(fs*(7.76492543100316e-25*fs - 2.72739690445876e-24) - 9.37875320050206e-24)) + pow(fs,3)*(fs*(8.29294036031137e-25*fs - 2.91285989396196e-24) - 1.00165084181362e-23)) + pow(fs,2)*(fs*(fs*(-1.16101165044359e-24*fs - 1.31947527765415e-21) - 2.3230598842031e-20) + 7.99317371767269e-20)) + fs*(fs*(fs*(fs*(-4.79935142182139e-24*fs + 7.37354511240778e-21) + 1.5798742492573e-19) - 9.2062610036363e-19) - 1.60264134690179e-18)) + Input*(Input*(fs*(fs*(fs*(-5.62199903584146e-23*fs - 4.31614729137842e-19) + 8.75181972411783e-18) + 4.51777833291617e-17) - 3.19276704697943e-16) + fs*(fs*(fs*(5.62199903584146e-23*fs + 4.31614729137842e-19) - 8.75181972411783e-18) - 4.51777833291617e-17) + 3.19276704697943e-16) + Treble*(Input*(Input*fs*(fs*(fs*(-1.36001842868123e-23*fs + 7.73443195051134e-20) - 1.36171651847912e-18) - 4.68538564144231e-18) + fs*(fs*(fs*(1.36001842868123e-23*fs - 7.73443195051134e-20) + 1.36171651847912e-18) + 4.68538564144231e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(9.7144173477231e-24*fs + 1.70607380832101e-22) - 5.86670944882469e-22) + pow(fs,2)*(fs*(-9.7144173477231e-24*fs - 1.70607380832101e-22) + 5.86670944882469e-22)) + pow(fs,2)*(fs*(-1.03749977273683e-23*fs - 1.82208682728684e-22) + 6.26564569134477e-22)) + fs*(fs*(fs*(1.45249968183156e-23*fs - 8.26037332314611e-20) + 1.4543132417357e-18) + 5.00399186506038e-18)) + fs*(fs*(fs*(6.00429497027867e-23*fs + 4.60964530719215e-19) - 9.34694346535784e-18) - 4.82498725955447e-17) + 3.40987520617403e-16) + Treble*(Input*(Input*(fs*(fs*(fs*(-1.16636172168287e-22*fs + 1.03189543577119e-18) - 4.7802275096952e-17) - 5.41775898644392e-16) + 7.98191761744856e-15) + fs*(fs*(fs*(1.16636172168287e-22*fs - 1.03189543577119e-18) + 4.7802275096952e-17) + 5.41775898644392e-16) - 7.98191761744856e-15) + Treble*(Input*(Input*fs*(fs*(fs*(1.29630837962324e-22*fs + 5.98190734030589e-21) - 6.77403934716556e-20) - 1.99547940436214e-19) + fs*(fs*(fs*(-1.29630837962324e-22*fs - 5.98190734030589e-21) + 6.77403934716556e-20) + 1.99547940436214e-19)) + fs*(fs*(fs*(-1.38445734943762e-22*fs - 6.38867703944669e-21) + 7.23467402277282e-20) + 2.13117200385877e-19)) + fs*(fs*(fs*(1.2456743187573e-22*fs - 1.10206432540363e-18) + 5.10528298035447e-17) + 5.78616659752211e-16) - 8.52468801543507e-15) + fs*(fs*(fs*(6.23174455115207e-22*fs + 5.56781972037316e-18) - 2.55915269679773e-16) - 2.89500135356453e-15) + 4.26234400771753e-14;
a4 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(-2.33200204069011e-23*fs + 1.26332315155071e-19) - 4.69643971510767e-18) - 8.52210149990995e-17) + 1.4128042788285e-15) - 3.99095880872428e-15) + fs*(fs*(fs*(fs*(2.33200204069011e-23*fs - 1.26332315155071e-19) + 4.69643971510767e-18) + 8.52210149990995e-17) - 1.4128042788285e-15) + 3.99095880872428e-15) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(-4.66147966999105e-24*fs - 2.44039530624426e-20) + 8.27894207186978e-19) + 1.21893473917967e-17) - 1.19429442351074e-16) + fs*(fs*(fs*(fs*(4.66147966999105e-24*fs + 2.44039530624426e-20) - 8.27894207186978e-19) - 1.21893473917967e-17) + 1.19429442351074e-16)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(5.18082430631737e-24*fs - 3.12026532530851e-22) + 1.52836235209424e-21) + 4.98869851090535e-21) + pow(fs,2)*(fs*(fs*(-5.18082430631737e-24*fs + 3.12026532530851e-22) - 1.52836235209424e-21) - 4.98869851090535e-21)) + pow(fs,2)*(fs*(fs*(-5.53312035914695e-24*fs + 3.33244336742949e-22) - 1.63229099203665e-21) - 5.32793000964692e-21)) + fs*(fs*(fs*(fs*(4.97846028755044e-24*fs + 2.60634218706887e-20) - 8.84191013275692e-19) - 1.30182230144389e-17) + 1.27550644430947e-16)) + fs*(fs*(fs*(fs*(2.49057817945703e-23*fs - 1.34922912585615e-19) + 5.01579761573499e-18) + 9.10160440190383e-17) - 1.50887496978884e-15) + 4.26234400771753e-15) + Input*(Input*(fs*(fs*(fs*(8.75245021229223e-22*fs - 2.60665717245934e-18) - 1.19810519513002e-16) + 4.06601313702883e-15) - 1.99547940436214e-14) + fs*(fs*(fs*(-8.75245021229223e-22*fs + 2.60665717245934e-18) + 1.19810519513002e-16) - 4.06601313702883e-15) + 1.99547940436214e-14) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(-2.24688736976657e-24*fs + 1.0356102685966e-20) - 7.39641502461285e-20) - 4.31004728634658e-19) + 2.2509007681205e-18) + fs*(fs*(fs*(fs*(2.24688736976657e-24*fs - 1.0356102685966e-20) + 7.39641502461285e-20) + 4.31004728634658e-19) - 2.2509007681205e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-5.43544780170221e-25*fs - 1.85319561468279e-21) + 1.08757485215501e-20) + 3.74212252700032e-20) + pow(fs,2)*(fs*(fs*(5.43544780170221e-25*fs + 1.85319561468279e-21) - 1.08757485215501e-20) - 3.74212252700032e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(3.88246271550158e-25*fs - 4.09109535668814e-24) + 4.68937660025103e-24) + pow(fs,3)*(fs*(-3.88246271550158e-25*fs + 4.09109535668814e-24) - 4.68937660025103e-24)) + pow(fs,3)*(fs*(-4.14647018015568e-25*fs + 4.36928984094294e-24) - 5.0082542090681e-24)) + pow(fs,2)*(fs*(fs*(5.80505825221796e-25*fs + 1.97921291648122e-21) - 1.16152994210155e-20) - 3.99658685883635e-20)) + fs*(fs*(fs*(fs*(2.39967571091069e-24*fs - 1.10603176686117e-20) + 7.89937124628652e-20) + 4.60313050181815e-19) - 2.40396202035269e-18)) + Input*(Input*(fs*(fs*(fs*(8.43299855376218e-23*fs - 2.15807364568921e-19) - 4.37590986205892e-18) + 6.77666749937426e-17) - 1.59638352348971e-16) + fs*(fs*(fs*(-8.43299855376218e-23*fs + 2.15807364568921e-19) + 4.37590986205892e-18) - 6.77666749937426e-17) + 1.59638352348971e-16) + Treble*(Input*(Input*fs*(fs*(fs*(2.04002764302185e-23*fs + 3.86721597525567e-20) + 6.80858259239558e-19) - 7.02807846216346e-18) + fs*(fs*(fs*(-2.04002764302185e-23*fs - 3.86721597525567e-20) - 6.80858259239558e-19) + 7.02807846216346e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(-1.45716260215846e-23*fs + 8.53036904160507e-23) + 2.93335472441235e-22) + pow(fs,2)*(fs*(1.45716260215846e-23*fs - 8.53036904160507e-23) - 2.93335472441235e-22)) + pow(fs,2)*(fs*(1.55624965910524e-23*fs - 9.11043413643421e-23) - 3.13282284567239e-22)) + fs*(fs*(fs*(-2.17874952274734e-23*fs - 4.13018666157306e-20) - 7.27156620867848e-19) + 7.50598779759058e-18)) + fs*(fs*(fs*(-9.00644245541801e-23*fs + 2.30482265359608e-19) + 4.67347173267892e-18) - 7.2374808893317e-17) + 1.70493760308701e-16) + Treble*(Input*(Input*(fs*(fs*(fs*(1.7495425825243e-22*fs + 5.15947717885593e-19) + 2.3901137548476e-17) - 8.12663847966588e-16) + 3.99095880872428e-15) + fs*(fs*(fs*(-1.7495425825243e-22*fs - 5.15947717885593e-19) - 2.3901137548476e-17) + 8.12663847966588e-16) - 3.99095880872428e-15) + Treble*(Input*(Input*fs*(fs*(fs*(-1.94446256943486e-22*fs + 2.99095367015295e-21) + 3.38701967358278e-20) - 2.99321910654321e-19) + fs*(fs*(fs*(1.94446256943486e-22*fs - 2.99095367015295e-21) - 3.38701967358278e-20) + 2.99321910654321e-19)) + fs*(fs*(fs*(2.07668602415643e-22*fs - 3.19433851972335e-21) - 3.61733701138641e-20) + 3.19675800578815e-19)) + fs*(fs*(fs*(-1.86851147813595e-22*fs - 5.51032162701814e-19) - 2.55264149017724e-17) + 8.67924989628316e-16) - 4.26234400771753e-15) + fs*(fs*(fs*(-9.3476168267281e-22*fs + 2.78390986018658e-18) + 1.27957634839887e-16) - 4.34250203034679e-15) + 2.13117200385877e-14;
a5 = Bass*(Input*(Input*(fs*(fs*(fs*(fs*(4.66400408138021e-24*fs - 4.21107717183568e-20) + 4.69643971510767e-18) - 8.52210149990995e-17) + 4.70934759609501e-16) - 7.98191761744856e-16) + fs*(fs*(fs*(fs*(-4.66400408138021e-24*fs + 4.21107717183568e-20) - 4.69643971510767e-18) + 8.52210149990995e-17) - 4.70934759609501e-16) + 7.98191761744856e-16) + Treble*(Input*(Input*fs*(fs*(fs*(fs*(9.32295933998211e-25*fs + 8.13465102081422e-21) - 8.27894207186978e-19) + 1.21893473917967e-17) - 3.98098141170247e-17) + fs*(fs*(fs*(fs*(-9.32295933998211e-25*fs - 8.13465102081422e-21) + 8.27894207186978e-19) - 1.21893473917967e-17) + 3.98098141170247e-17)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(-1.03616486126347e-24*fs + 1.0400884417695e-22) - 1.52836235209424e-21) + 4.98869851090535e-21) + pow(fs,2)*(fs*(fs*(1.03616486126347e-24*fs - 1.0400884417695e-22) + 1.52836235209424e-21) - 4.98869851090535e-21)) + pow(fs,2)*(fs*(fs*(1.10662407182939e-24*fs - 1.11081445580983e-22) + 1.63229099203665e-21) - 5.32793000964692e-21)) + fs*(fs*(fs*(fs*(-9.95692057510089e-25*fs - 8.68780729022958e-21) + 8.84191013275692e-19) - 1.30182230144389e-17) + 4.25168814769824e-17)) + fs*(fs*(fs*(fs*(-4.98115635891407e-24*fs + 4.49743041952051e-20) - 5.01579761573499e-18) + 9.10160440190383e-17) - 5.02958323262947e-16) + 8.52468801543507e-16) + Input*(Input*(fs*(fs*(fs*(-2.91748340409741e-22*fs + 2.60665717245934e-18) - 1.19810519513002e-16) + 1.35533771234294e-15) - 3.99095880872428e-15) + fs*(fs*(fs*(2.91748340409741e-22*fs - 2.60665717245934e-18) + 1.19810519513002e-16) - 1.35533771234294e-15) + 3.99095880872428e-15) + Middle*(Bass*(Input*(Input*fs*(fs*(fs*(fs*(4.49377473953314e-25*fs - 3.45203422865533e-21) + 7.39641502461285e-20) - 4.31004728634658e-19) + 7.50300256040165e-19) + fs*(fs*(fs*(fs*(-4.49377473953314e-25*fs + 3.45203422865533e-21) - 7.39641502461285e-20) + 4.31004728634658e-19) - 7.50300256040165e-19)) + Treble*(Input*(Input*pow(fs,2)*(fs*(fs*(1.08708956034044e-25*fs + 6.17731871560931e-22) - 1.08757485215501e-20) + 3.74212252700032e-20) + pow(fs,2)*(fs*(fs*(-1.08708956034044e-25*fs - 6.17731871560931e-22) + 1.08757485215501e-20) - 3.74212252700032e-20)) + Treble*(Input*(Input*pow(fs,3)*(fs*(-7.76492543100316e-26*fs + 1.36369845222938e-24) - 4.68937660025103e-24) + pow(fs,3)*(fs*(7.76492543100316e-26*fs - 1.36369845222938e-24) + 4.68937660025103e-24)) + pow(fs,3)*(fs*(8.29294036031137e-26*fs - 1.45642994698098e-24) + 5.0082542090681e-24)) + pow(fs,2)*(fs*(fs*(-1.16101165044359e-25*fs - 6.59737638827074e-22) + 1.16152994210155e-20) - 3.99658685883635e-20)) + fs*(fs*(fs*(fs*(-4.79935142182139e-25*fs + 3.68677255620389e-21) - 7.89937124628652e-20) + 4.60313050181815e-19) - 8.01320673450896e-19)) + Input*(Input*(fs*(fs*(fs*(-2.81099951792073e-23*fs + 2.15807364568921e-19) - 4.37590986205892e-18) + 2.25888916645809e-17) - 3.19276704697943e-17) + fs*(fs*(fs*(2.81099951792073e-23*fs - 2.15807364568921e-19) + 4.37590986205892e-18) - 2.25888916645809e-17) + 3.19276704697943e-17) + Treble*(Input*(Input*fs*(fs*(fs*(-6.80009214340617e-24*fs - 3.86721597525567e-20) + 6.80858259239558e-19) - 2.34269282072115e-18) + fs*(fs*(fs*(6.80009214340617e-24*fs + 3.86721597525567e-20) - 6.80858259239558e-19) + 2.34269282072115e-18)) + Treble*(Input*(Input*pow(fs,2)*(fs*(4.85720867386155e-24*fs - 8.53036904160507e-23) + 2.93335472441235e-22) + pow(fs,2)*(fs*(-4.85720867386155e-24*fs + 8.53036904160507e-23) - 2.93335472441235e-22)) + pow(fs,2)*(fs*(-5.18749886368413e-24*fs + 9.11043413643421e-23) - 3.13282284567239e-22)) + fs*(fs*(fs*(7.26249840915779e-24*fs + 4.13018666157306e-20) - 7.27156620867848e-19) + 2.50199593253019e-18)) + fs*(fs*(fs*(3.00214748513934e-23*fs - 2.30482265359608e-19) + 4.67347173267892e-18) - 2.41249362977723e-17) + 3.40987520617403e-17) + Treble*(Input*(Input*(fs*(fs*(fs*(-5.83180860841434e-23*fs - 5.15947717885593e-19) + 2.3901137548476e-17) - 2.70887949322196e-16) + 7.98191761744856e-16) + fs*(fs*(fs*(5.83180860841434e-23*fs + 5.15947717885593e-19) - 2.3901137548476e-17) + 2.70887949322196e-16) - 7.98191761744856e-16) + Treble*(Input*(Input*fs*(fs*(fs*(6.4815418981162e-23*fs - 2.99095367015295e-21) + 3.38701967358278e-20) - 9.9773970218107e-20) + fs*(fs*(fs*(-6.4815418981162e-23*fs + 2.99095367015295e-21) - 3.38701967358278e-20) + 9.9773970218107e-20)) + fs*(fs*(fs*(-6.9222867471881e-23*fs + 3.19433851972335e-21) - 3.61733701138641e-20) + 1.06558600192938e-19)) + fs*(fs*(fs*(6.22837159378651e-23*fs + 5.51032162701814e-19) - 2.55264149017724e-17) + 2.89308329876105e-16) - 8.52468801543507e-16) + fs*(fs*(fs*(3.11587227557603e-22*fs - 2.78390986018658e-18) + 1.27957634839887e-16) - 1.44750067678226e-15) + 4.26234400771753e-15;
};
|
|
149a590aa14583d2bd6426f38e7c4d160cf1df5986064d858d0826e352f4a36c | reverbrick/contour | contour.dsp | import("stdfaust.lib");
freq = hslider("freq",440,0,2000,0.0001) : si.smoo;
ctFreq = hslider("cutoff",500,50,10000,0.01) : si.smoo;
q = hslider("q",5,1,30,0.1) : si.smoo;
gain = hslider("gain",1,0,1,0.01) : si.smoo;
duty = hslider("duty",0.5,0,1,0.01) : si.smoo;
gate = button("gate") : si.smoo;
process = os.pulsetrain(freq,duty) * 0.5 : fi.resonlp(ctFreq,q,gain)*gate<: dm.zita_rev1;
| https://raw.githubusercontent.com/reverbrick/contour/7f7926311cbe0bbcefe16a7641ad70bf6f10c945/FAUST/contour.dsp | faust | import("stdfaust.lib");
freq = hslider("freq",440,0,2000,0.0001) : si.smoo;
ctFreq = hslider("cutoff",500,50,10000,0.01) : si.smoo;
q = hslider("q",5,1,30,0.1) : si.smoo;
gain = hslider("gain",1,0,1,0.01) : si.smoo;
duty = hslider("duty",0.5,0,1,0.01) : si.smoo;
gate = button("gate") : si.smoo;
process = os.pulsetrain(freq,duty) * 0.5 : fi.resonlp(ctFreq,q,gain)*gate<: dm.zita_rev1;
|
|
eef6cfcb205a913ac27c096159fa5d5958f14e2c10ba0110f5a57214f1790993 | reverbrick/contour | contour.dsp | import("stdfaust.lib");
freq = hslider("freq",440,0,2000,0.0001);// : si.smoo;
bend = hslider("bend",0,0,1,0.01);// : si.smoo;
detune1 = hslider("detune1",0,0,1,0.01);// : si.smoo;
detune2 = hslider("detune2",0,0,1,0.01);// : si.smoo;
ctFreq = hslider("cutoff",10000,50,10000,0.01);// : si.smoo;
q = hslider("q",1,1,30,0.1) : si.smoo;
gain = hslider("gain",1,0,1,0.01) : si.smoo;
duty = hslider("duty",0.5,0,1,0.01) : si.smoo;
release = hslider("release",0.2,0,5,0.01) : si.smoo;
gate = button("gate");// : si.smoo;
drone = checkbox("drone");
osc1 = os.pulsetrain(freq+bend+detune1,duty) * 0.5;
osc2 = os.square(freq+bend+detune2) * 0.5;
flt1 = fi.resonlp(ctFreq,q,gain);
amp1 = en.smoothEnvelope(release,gate)+drone;
process = osc1+osc2 : flt1*amp1;
| https://raw.githubusercontent.com/reverbrick/contour/7f7926311cbe0bbcefe16a7641ad70bf6f10c945/Programs/contour/contour.dsp | faust | : si.smoo;
: si.smoo;
: si.smoo;
: si.smoo;
: si.smoo;
: si.smoo; | import("stdfaust.lib");
q = hslider("q",1,1,30,0.1) : si.smoo;
gain = hslider("gain",1,0,1,0.01) : si.smoo;
duty = hslider("duty",0.5,0,1,0.01) : si.smoo;
release = hslider("release",0.2,0,5,0.01) : si.smoo;
drone = checkbox("drone");
osc1 = os.pulsetrain(freq+bend+detune1,duty) * 0.5;
osc2 = os.square(freq+bend+detune2) * 0.5;
flt1 = fi.resonlp(ctFreq,q,gain);
amp1 = en.smoothEnvelope(release,gate)+drone;
process = osc1+osc2 : flt1*amp1;
|
d1a200450471b213af6ec73507bbcb768873258c94e97440c540e1813ac5f480 | reverbrick/contour | AdditiveSynth.dsp | import("stdfaust.lib");
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Additive synthesizer, must be used with OSC message to program sound.
// It as 8 harmonics. Each have it's own volume envelop.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// OSC messages (see BELA console for precise adress)
// For each harmonics (%rang indicate harmonic number, starting at 0) :
// vol%rang : General Volume (vol0 control the volume of the fundamental)
// A%rang : Attack
// D%rang : Decay
// S%rang : Sustain
// R%rang : Release
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// GENERAL
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 10, 0.01);
// pitchwheel
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
gFreq = midifreq * bend;
partiel(rang) = os.oscrs(gFreq*(rang+1))*volume
with {
// UI
vol = hslider("vol%rang", 1, 0, 1, 0.001);
a = 0.01 * hslider("A%rang", 1, 0, 400, 0.001);
d = 0.01 * hslider("D%rang", 1, 0, 400, 0.001);
s = hslider("S%rang", 1, 0, 1, 0.001);
r = 0.01 * hslider("R%rang", 1, 0, 800, 0.001);
volume = ((en.adsr(a,d,s,r,midigate))*vol) : max (0) : min (1);
};
process = par(i, 8, partiel(i)) :> / (8);
| https://raw.githubusercontent.com/reverbrick/contour/7f7926311cbe0bbcefe16a7641ad70bf6f10c945/FAUST/AdditiveSynth.dsp | faust | /////////////////////////////////////////////////////////////////////////////////////////////////
Additive synthesizer, must be used with OSC message to program sound.
It as 8 harmonics. Each have it's own volume envelop.
/////////////////////////////////////////////////////////////////////////////////////////////////
OSC messages (see BELA console for precise adress)
For each harmonics (%rang indicate harmonic number, starting at 0) :
vol%rang : General Volume (vol0 control the volume of the fundamental)
A%rang : Attack
D%rang : Decay
S%rang : Sustain
R%rang : Release
/////////////////////////////////////////////////////////////////////////////////////////////////
GENERAL
pitchwheel
UI | import("stdfaust.lib");
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 10, 0.01);
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
gFreq = midifreq * bend;
partiel(rang) = os.oscrs(gFreq*(rang+1))*volume
with {
vol = hslider("vol%rang", 1, 0, 1, 0.001);
a = 0.01 * hslider("A%rang", 1, 0, 400, 0.001);
d = 0.01 * hslider("D%rang", 1, 0, 400, 0.001);
s = hslider("S%rang", 1, 0, 1, 0.001);
r = 0.01 * hslider("R%rang", 1, 0, 800, 0.001);
volume = ((en.adsr(a,d,s,r,midigate))*vol) : max (0) : min (1);
};
process = par(i, 8, partiel(i)) :> / (8);
|
370105fe51141436c4a477e87ad13795fc77ba7f20e653dc264aa2fb709bda68 | reverbrick/contour | WaveSynth.dsp | import("stdfaust.lib");
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables.
// It's possible to add more tables step.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// MIDI IMPLEMENTATION:
//
// CC 1 : LFO Depth (wave travel modulation)
// CC 14 : LFO Frequency
// CC 70 : Wave travelling
//
// CC 73 : Attack
// CC 76 : Decay
// CC 77 : Sustain
// CC 72 : Release
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// GENERAL
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 1, 0.01);
waveTravel = hslider("waveTravel [midi:ctrl]",0,0,1,0.01);
// pitchwheel
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
gFreq = midifreq * bend;
// LFO
lfoDepth = hslider("lfoDepth[midi:ctrl 1]",0,0.,1,0.001):si.smoo;
lfoFreq = hslider("lfoFreq[midi:ctrl 14]",0.1,0.01,10,0.001):si.smoo;
moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0);
volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01);
volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01);
volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01);
volR = hslider("R[midi:ctrl 72]",0.8,0.01,8,0.01);
envelop = en.adsre(volA,volD,volS,volR,midigate);
// Out Amplitude
vol = envelop * midigain;
WF(tablesize, rang) = abs((fmod ((1+(float(ba.time)*rang)/float(tablesize)), 4.0))-2) -1.;
// 4 WF maxi with this version:
scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0)
with{
coef = 3.14159 * ((nb-1)*0.5);
soustraction = select2( position>0, 0, (position/(nb-1)) );
};
wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1)))
+ (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3)))
with {
tablesize = 1024;
wt1 = WF(tablesize, 16);
wt2 = WF(tablesize, 8);
wt3 = WF(tablesize, 6);
wt4 = WF(tablesize, 4);
faze = int(os.phasor(tablesize,freq));
};
process = wfosc(gFreq) * vol;
| https://raw.githubusercontent.com/reverbrick/contour/7f7926311cbe0bbcefe16a7641ad70bf6f10c945/FAUST/WaveSynth.dsp | faust | /////////////////////////////////////////////////////////////////////////////////////////////////
Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables.
It's possible to add more tables step.
/////////////////////////////////////////////////////////////////////////////////////////////////
MIDI IMPLEMENTATION:
CC 1 : LFO Depth (wave travel modulation)
CC 14 : LFO Frequency
CC 70 : Wave travelling
CC 73 : Attack
CC 76 : Decay
CC 77 : Sustain
CC 72 : Release
/////////////////////////////////////////////////////////////////////////////////////////////////
GENERAL
pitchwheel
LFO
Out Amplitude
4 WF maxi with this version: | import("stdfaust.lib");
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 1, 0.01);
waveTravel = hslider("waveTravel [midi:ctrl]",0,0,1,0.01);
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
gFreq = midifreq * bend;
lfoDepth = hslider("lfoDepth[midi:ctrl 1]",0,0.,1,0.001):si.smoo;
lfoFreq = hslider("lfoFreq[midi:ctrl 14]",0.1,0.01,10,0.001):si.smoo;
moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0);
volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01);
volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01);
volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01);
volR = hslider("R[midi:ctrl 72]",0.8,0.01,8,0.01);
envelop = en.adsre(volA,volD,volS,volR,midigate);
vol = envelop * midigain;
WF(tablesize, rang) = abs((fmod ((1+(float(ba.time)*rang)/float(tablesize)), 4.0))-2) -1.;
scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0)
with{
coef = 3.14159 * ((nb-1)*0.5);
soustraction = select2( position>0, 0, (position/(nb-1)) );
};
wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1)))
+ (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3)))
with {
tablesize = 1024;
wt1 = WF(tablesize, 16);
wt2 = WF(tablesize, 8);
wt3 = WF(tablesize, 6);
wt4 = WF(tablesize, 4);
faze = int(os.phasor(tablesize,freq));
};
process = wfosc(gFreq) * vol;
|
b8d65a659f596b3af11de04d672ae55102c78419116d47d75efb942df46c77a6 | reverbrick/contour | KarplusStrong.dsp | process = vgroup("Kisana",environment{declare name "Kisana";
declare author "Yann Orlarey";
//Modifications GRAME July 2015
/* ========= DESCRITPION =============
- Kisana : 3-loops string instrument (based on Karplus-Strong)
- Head = Silence
- Tilt = High frequencies
- Front = High + Medium frequencies
- Bottom = High + Medium + Low frequencies
- Left = Minimum brightness
- Right = Maximum birghtness
- Front = Long notes
- Back = Short notes
*/
import("stdfaust.lib");
KEY = 60; // basic midi key
NCY = 15; // note cycle length
CCY = 15; // control cycle length
BPS = 360; // general tempo (ba.beat per sec)
process = kisana;
//-------------------------------kisana----------------------------------
// USAGE: kisana : _,_;
// 3-loops string instrument
//-----------------------------------------------------------------------
kisana = vgroup("Kisana", harpe(C,11,48), harpe(C,11,60), (harpe(C,11,72) : *(1.5), *(1.5))
:>*(l))
with {
l = -20 : ba.db2linear;//hslider("[1]Volume",-20, -60, 0, 0.01) : ba.db2linear;
C = hslider("[2]Brightness[acc:0 1 -10 0 10]", 0.2, 0, 1, 0.01) : ba.automat(BPS, CCY, 0.0);
};
//----------------------------------Harpe--------------------------------
// USAGE: harpe(C,10,60) : _,_;
// C is the filter coefficient 0..1
// Build a N (10) strings harpe using a pentatonic scale
// based on midi key b (60)
// Each string is triggered by a specific
// position of the "hand"
//-----------------------------------------------------------------------
harpe(C,N,b) = hand(b) <: par(i, N, position(i+1)
: string(C,Penta(b).degree2Hz(i), att, lvl)
: pan((i+0.5)/N) )
:> _,_
with {
att = hslider("[3]Resonance[acc:2 1 -10 0 12]", 4, 0.1, 10, 0.01);
hand(48) = vslider("h:[1]Instrument Hands/1 (Note %b)[unit:pk][acc:1 0 -10 0 14]", 0, 0, N, 1) : int : ba.automat(120, CCY, 0.0);
hand(60) = vslider("h:[1]Instrument Hands/2 (Note %b)[unit:pk][acc:1 0 -10 0 14]", 2, 0, N, 1) : int : ba.automat(240, CCY, 0.0);
hand(72) = vslider("h:[1]Instrument Hands/3 (Note %b)[unit:pk][acc:1 0 -10 0 10]", 4, 0, N, 1) : int : ba.automat(480, CCY, 0.0);
//lvl = vslider("h:loop/level", 0, 0, 6, 1) : int : ba.automat(BPS, CCY, 0.0) : -(6) : ba.db2linear;
lvl = 1;
pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p));
position(a,x) = abs(x - a) < 0.5;
};
//----------------------------------Penta-------------------------------
// Pentatonic scale with degree to midi and degree to Hz conversion
// USAGE: Penta(60).degree2midi(3) ==> 67 midikey
// Penta(60).degree2Hz(4) ==> 440 Hz
//-----------------------------------------------------------------------
Penta(key) = environment {
A4Hz = 440;
degree2midi(0) = key+0;
degree2midi(1) = key+2;
degree2midi(2) = key+4;
degree2midi(3) = key+7;
degree2midi(4) = key+9;
degree2midi(d) = degree2midi(d-5)+12;
degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); };
};
//----------------------------------String-------------------------------
// A karplus-strong string.
//
// USAGE: string(440Hz, 4s, 1.0, button("play"))
// or button("play") : string(440Hz, 4s, 1.0)
//-----------------------------------------------------------------------
string(coef, freq, t60, level, trig) = no.noise*level
: *(trig : trigger(freq2samples(freq)))
: resonator(freq2samples(freq), att)
with {
resonator(d,a) = (+ : @(d-1)) ~ (average : *(a));
average(x) = (x*(1+coef)+x'*(1-coef))/2;
trigger(n) = upfront : + ~ decay(n) : >(0.0);
upfront(x) = (x-x') > 0.0;
decay(n,x) = x - (x>0.0)/n;
freq2samples(f) = 44100.0/f;
att = pow(0.001,1.0/(freq*t60)); // attenuation coefficient
random = +(12345)~*(1103515245);
noise = random/2147483647.0;
};
}.process);
| https://raw.githubusercontent.com/reverbrick/contour/7f7926311cbe0bbcefe16a7641ad70bf6f10c945/FAUST/KarplusStrong.dsp | faust | Modifications GRAME July 2015
========= DESCRITPION =============
- Kisana : 3-loops string instrument (based on Karplus-Strong)
- Head = Silence
- Tilt = High frequencies
- Front = High + Medium frequencies
- Bottom = High + Medium + Low frequencies
- Left = Minimum brightness
- Right = Maximum birghtness
- Front = Long notes
- Back = Short notes
basic midi key
note cycle length
control cycle length
general tempo (ba.beat per sec)
-------------------------------kisana----------------------------------
USAGE: kisana : _,_;
3-loops string instrument
-----------------------------------------------------------------------
hslider("[1]Volume",-20, -60, 0, 0.01) : ba.db2linear;
----------------------------------Harpe--------------------------------
USAGE: harpe(C,10,60) : _,_;
C is the filter coefficient 0..1
Build a N (10) strings harpe using a pentatonic scale
based on midi key b (60)
Each string is triggered by a specific
position of the "hand"
-----------------------------------------------------------------------
lvl = vslider("h:loop/level", 0, 0, 6, 1) : int : ba.automat(BPS, CCY, 0.0) : -(6) : ba.db2linear;
----------------------------------Penta-------------------------------
Pentatonic scale with degree to midi and degree to Hz conversion
USAGE: Penta(60).degree2midi(3) ==> 67 midikey
Penta(60).degree2Hz(4) ==> 440 Hz
-----------------------------------------------------------------------
----------------------------------String-------------------------------
A karplus-strong string.
USAGE: string(440Hz, 4s, 1.0, button("play"))
or button("play") : string(440Hz, 4s, 1.0)
-----------------------------------------------------------------------
attenuation coefficient | process = vgroup("Kisana",environment{declare name "Kisana";
declare author "Yann Orlarey";
import("stdfaust.lib");
process = kisana;
kisana = vgroup("Kisana", harpe(C,11,48), harpe(C,11,60), (harpe(C,11,72) : *(1.5), *(1.5))
:>*(l))
with {
C = hslider("[2]Brightness[acc:0 1 -10 0 10]", 0.2, 0, 1, 0.01) : ba.automat(BPS, CCY, 0.0);
};
harpe(C,N,b) = hand(b) <: par(i, N, position(i+1)
: string(C,Penta(b).degree2Hz(i), att, lvl)
: pan((i+0.5)/N) )
:> _,_
with {
att = hslider("[3]Resonance[acc:2 1 -10 0 12]", 4, 0.1, 10, 0.01);
hand(48) = vslider("h:[1]Instrument Hands/1 (Note %b)[unit:pk][acc:1 0 -10 0 14]", 0, 0, N, 1) : int : ba.automat(120, CCY, 0.0);
hand(60) = vslider("h:[1]Instrument Hands/2 (Note %b)[unit:pk][acc:1 0 -10 0 14]", 2, 0, N, 1) : int : ba.automat(240, CCY, 0.0);
hand(72) = vslider("h:[1]Instrument Hands/3 (Note %b)[unit:pk][acc:1 0 -10 0 10]", 4, 0, N, 1) : int : ba.automat(480, CCY, 0.0);
lvl = 1;
pan(p) = _ <: *(sqrt(1-p)), *(sqrt(p));
position(a,x) = abs(x - a) < 0.5;
};
Penta(key) = environment {
A4Hz = 440;
degree2midi(0) = key+0;
degree2midi(1) = key+2;
degree2midi(2) = key+4;
degree2midi(3) = key+7;
degree2midi(4) = key+9;
degree2midi(d) = degree2midi(d-5)+12;
degree2Hz(d) = A4Hz*semiton(degree2midi(d)-69) with { semiton(n) = 2.0^(n/12.0); };
};
string(coef, freq, t60, level, trig) = no.noise*level
: *(trig : trigger(freq2samples(freq)))
: resonator(freq2samples(freq), att)
with {
resonator(d,a) = (+ : @(d-1)) ~ (average : *(a));
average(x) = (x*(1+coef)+x'*(1-coef))/2;
trigger(n) = upfront : + ~ decay(n) : >(0.0);
upfront(x) = (x-x') > 0.0;
decay(n,x) = x - (x>0.0)/n;
freq2samples(f) = 44100.0/f;
random = +(12345)~*(1103515245);
noise = random/2147483647.0;
};
}.process);
|
af2516e0d6f490ecfc222d2685d305e47e108a2e053f5bd3926cc4403b8270d9 | dariosanfilippo/modified_lotka-volterra_B | modified_LV_B.dsp | // =============================================================================
// Modified Lotka-Volterra complex generator (B)
// =============================================================================
//
// Complex sound generator based on modified Lotka-Volterra equations.
// The model is structurally-stable through hyperbolic tangent function
// saturators and allows for parameters in unstable ranges to explore
// different dynamics. Furthermore, this model includes DC-blockers in the
// feedback paths to counterbalance a tendency towards fixed-point attractors
// – thus enhancing complex behaviours – and obtain signals suitable for audio.
// Besides the original parameters in the model, this system includes a
// saturating threshold determining the positive and negative bounds in the
// equations, while the output peaks are within the [-1.0; 1.0] range.
//
// The system can be triggered by an impulse or by a constant of arbitrary
// values for deterministic and reproducable behaviours. Alternatively,
// the oscillator can be fed with external inputs to be used as a nonlinear
// distortion unit.
//
// =============================================================================
import("stdfaust.lib");
declare name "Modified Lotka-Volterra complex generator (B)";
declare author "Dario Sanfilippo";
declare copyright "Copyright (C) 2021 Dario Sanfilippo
<[email protected]>";
declare version "1.1";
declare license "GPL v3.0 license";
lotkavolterra(L, a, b, c, d, e, f, x_0, y_0) =
prey_level(out * (x / L)) ,
pred_level(out * (y / L))
letrec {
'x = fi.highpass(1, 10, tanh(L, (x_0 + a * x - b * x * y) /
(1 + c * x)));
'y = fi.highpass(1, 10, tanh(L, (y_0 + d * y + e * x * y) /
(1 + f * y)));
};
// tanh() saturator with adjustable saturating threshold
tanh(l, x) = l * ma.tanh(x / l);
// smoothing function for click-free parameter variations using
// a one-pole low-pass with a 20-Hz cut-off frequency.
smooth(x) = fi.pole(pole, x * (1.0 - pole))
with {
pole = exp(-2.0 * ma.PI * 20.0 / ma.SR);
};
// GUI parameters
prey_level(x) = attach(x , abs(x) : ba.linear2db :
levels_group(hbargraph("[0]Prey[style:dB]", -60, 0)));
pred_level(x) = attach(x , abs(x) : ba.linear2db :
levels_group(hbargraph("[1]Predator[style:dB]", -60, 0)));
prey_group(x) = vgroup("[0]Prey", x);
pred_group(x) = vgroup("[1]Predator", x);
global_group(x) = vgroup("[2]Global", x);
levels_group(x) = hgroup("[3]Levels (dB)", x);
a = prey_group(hslider("[0]Growth rate[scale:exp]", 4, 0, 10, .000001)
: smooth);
b = prey_group(hslider("[1]Interaction parameter[scale:exp]", 1, 0, 10, .000001)
: smooth);
c = prey_group(hslider("[2]Scaling[scale:exp]", 2, 0, 10, .000001) : smooth);
d = pred_group(hslider("[0]Extinction rate[scale:exp]", 4, 0, 10, .000001)
: smooth);
e = pred_group(hslider("[1]Interaction parameter[scale:exp]", 1, 0, 10, .000001)
: smooth);
f = pred_group(hslider("[2]Scaling[scale:exp]", 2, 0, 10, .000001) : smooth);
input(x) = global_group(nentry("[3]Input value", 1, 0, 10, .000001) <:
_ * impulse + _ * checkbox("[1]Constant inputs") +
x * checkbox("[0]External inputs"));
impulse = button("[02]Impulse inputs") : ba.impulsify;
limit = global_group(
hslider("[5]Saturation limit[scale:exp]", 4, 1, 1024, .000001) : smooth);
out = global_group(hslider("[6]Output scaling[scale:exp]", 0, 0, 1, .000001) :
smooth);
process(x1, x2) = lotkavolterra(limit, a, b, c, d, e, f, input(x1), input(x2));
| https://raw.githubusercontent.com/dariosanfilippo/modified_lotka-volterra_B/5f6a8c62525794d50a4c82ac4d772d9f69412f8a/modified_LV_B.dsp | faust | =============================================================================
Modified Lotka-Volterra complex generator (B)
=============================================================================
Complex sound generator based on modified Lotka-Volterra equations.
The model is structurally-stable through hyperbolic tangent function
saturators and allows for parameters in unstable ranges to explore
different dynamics. Furthermore, this model includes DC-blockers in the
feedback paths to counterbalance a tendency towards fixed-point attractors
– thus enhancing complex behaviours – and obtain signals suitable for audio.
Besides the original parameters in the model, this system includes a
saturating threshold determining the positive and negative bounds in the
equations, while the output peaks are within the [-1.0; 1.0] range.
The system can be triggered by an impulse or by a constant of arbitrary
values for deterministic and reproducable behaviours. Alternatively,
the oscillator can be fed with external inputs to be used as a nonlinear
distortion unit.
=============================================================================
tanh() saturator with adjustable saturating threshold
smoothing function for click-free parameter variations using
a one-pole low-pass with a 20-Hz cut-off frequency.
GUI parameters |
import("stdfaust.lib");
declare name "Modified Lotka-Volterra complex generator (B)";
declare author "Dario Sanfilippo";
declare copyright "Copyright (C) 2021 Dario Sanfilippo
<[email protected]>";
declare version "1.1";
declare license "GPL v3.0 license";
lotkavolterra(L, a, b, c, d, e, f, x_0, y_0) =
prey_level(out * (x / L)) ,
pred_level(out * (y / L))
letrec {
'x = fi.highpass(1, 10, tanh(L, (x_0 + a * x - b * x * y) /
(1 + c * x)));
'y = fi.highpass(1, 10, tanh(L, (y_0 + d * y + e * x * y) /
(1 + f * y)));
};
tanh(l, x) = l * ma.tanh(x / l);
smooth(x) = fi.pole(pole, x * (1.0 - pole))
with {
pole = exp(-2.0 * ma.PI * 20.0 / ma.SR);
};
prey_level(x) = attach(x , abs(x) : ba.linear2db :
levels_group(hbargraph("[0]Prey[style:dB]", -60, 0)));
pred_level(x) = attach(x , abs(x) : ba.linear2db :
levels_group(hbargraph("[1]Predator[style:dB]", -60, 0)));
prey_group(x) = vgroup("[0]Prey", x);
pred_group(x) = vgroup("[1]Predator", x);
global_group(x) = vgroup("[2]Global", x);
levels_group(x) = hgroup("[3]Levels (dB)", x);
a = prey_group(hslider("[0]Growth rate[scale:exp]", 4, 0, 10, .000001)
: smooth);
b = prey_group(hslider("[1]Interaction parameter[scale:exp]", 1, 0, 10, .000001)
: smooth);
c = prey_group(hslider("[2]Scaling[scale:exp]", 2, 0, 10, .000001) : smooth);
d = pred_group(hslider("[0]Extinction rate[scale:exp]", 4, 0, 10, .000001)
: smooth);
e = pred_group(hslider("[1]Interaction parameter[scale:exp]", 1, 0, 10, .000001)
: smooth);
f = pred_group(hslider("[2]Scaling[scale:exp]", 2, 0, 10, .000001) : smooth);
input(x) = global_group(nentry("[3]Input value", 1, 0, 10, .000001) <:
_ * impulse + _ * checkbox("[1]Constant inputs") +
x * checkbox("[0]External inputs"));
impulse = button("[02]Impulse inputs") : ba.impulsify;
limit = global_group(
hslider("[5]Saturation limit[scale:exp]", 4, 1, 1024, .000001) : smooth);
out = global_group(hslider("[6]Output scaling[scale:exp]", 0, 0, 1, .000001) :
smooth);
process(x1, x2) = lotkavolterra(limit, a, b, c, d, e, f, input(x1), input(x2));
|
4f02f6a87b02357e83f3e0577ff6795020a0ec0d7d6fc3e06fa3db9fae0eb376 | dariosanfilippo/maximiser | maximiser.dsp | /*******************************************************************************
********** Eight-band loudness maximiser ****************************
********************************************************************************
*
* This is an eight-band loudness maximiser based on IIR peak limiters and an
* eight-way Linkwitz-Riley fourth-order crossover. The limiter deployes
* cascaded one-pole smoothers for minimal THD and the maximiser has two
* maximisation modalities.
*
* On one hand, the maximiser offers the possibility to dynamically normalise the
* bands so that they have the same level approximately; on a sample-by-sample
* basis, the RMS of the loudest band is the reference value used to calculate a
* gain factor to bring all bands at the same level. The RMS calculation is
* carried out with 2πtau-constant one-pole filters and a one-second response
* time. Connected to this feature is a normalisation depth parameter that sets
* the maximum gain amount for normalisation. Assuming that the input signal
* without amplification is below 0 dB, the dynamical normalisation process does
* not set the limiters of the individual bands into an operational mode; hence,
* this process is free from degradation except for the limiting provided by the
* final limiter stage when the sum of the individual bands exceeds the ceiling.
* Alternatively, the maximisation can be performed by applying a gain
* amplification to the input signal, hence boosting all of the bands equally.
* The main difference is that dynamical normalisation provides maximum
* individual amplification with minimum degradation. On the other hand, the
* global gain amplification results in higher degradation for the predominant
* bands while keeping the overall spectral weights closer to the original
* signal.
*
*******************************************************************************/
import("stdfaust.lib");
declare maximiserMono author "Dario Sanfilippo";
declare maximiserMono copyright
"Copyright (C) 2022 Dario Sanfilippo <[email protected]>";
declare version "0.0";
declare maximiserMono license "MIT-style STK-4.3 license";
peakHold(t, x) = loop ~ _
with {
loop(fb) = ba.sAndH(cond1 | cond2, abs(x))
with {
cond1 = abs(x) >= fb;
cond2 = loop ~ _ <: _ < _'
with {
loop(fb) =
((1 - cond1) * fb + (1 - cond1)) % (t * ma.SR + 1);
};
};
};
peakHoldCascade(N, holdTime, x) = x : seq(i, N, peakHold(holdTime / N));
smoother(N, att, rel, x) = loop ~ _
with {
loop(fb) = ba.if(abs(x) >= fb, attSection, relSection)
with {
attSection = attCoeff * fb + (1.0 - attCoeff) * abs(x);
relSection = relCoeff * fb + (1.0 - relCoeff) * abs(x);
attCoeff =
exp((((-2.0 * ma.PI) / att) * cutoffCorrection) * ma.T);
relCoeff =
exp((((-2.0 * ma.PI) / rel) * cutoffCorrection) * ma.T);
cutoffCorrection = 1.0 / sqrt(pow(2.0, 1.0 / N) - 1.0);
};
};
smootherCascade(N, att, rel, x) = x : seq(i, N, smoother(N, att, rel));
gainAttenuation(N, th, att, hold, rel, x) =
th / (max(th, peakHoldCascade(8, att + hold, x)) :
smootherCascade(N, att, rel));
limiterBand(centreFreq, th, att, hold, rel, preG, x_) =
de.sdelay(.1 * ma.SR, .02 * ma.SR, att * ma.SR, x) * gDisplay
with {
x = x_ * preG;
g = gainAttenuation(4, th, att, hold, rel, x);
gDisplay = attach(g, g : ba.linear2db :
vbargraph("h:Eight-Band Maximiser/h:Display/h:[00]Attenuation (dB)/%4centreFreq Hz", -60, 0));
};
limiter4(th, att, hold, rel, preG, x_) =
de.sdelay(.1 * ma.SR, .02 * ma.SR, att * ma.SR, x) * g : peakDisplay
with {
x = x_ * preG;
g = gainAttenuation(4, th, att, hold, rel, x);
peakDisplay(x) = attach(x, peakHold(2.0, x) : ba.linear2db :
vbargraph("h:Eight-Band Maximiser/h:Display/h:[01]Peaks/[10]Peaks (dB)", -60, 0));
};
crossover = bands , _ : fi.crossover8LR4
with {
bands = par(i, 7, 20 * 2 ^ (i + 2));
};
dynamicNormalisation(N, depth) =
si.bus(N) <:
si.bus(N) ,
(par(i, N, an.rms_envelope_tau(1.0 / (2.0 * ma.PI))) <:
(maxN(N) <: si.bus(N)) ,
si.bus(N) : ro.interleave(N, 2) :
par(i, N, /(max(ma.EPSILON))) : par(i, N, min(depth))) :
ro.interleave(N, 2) : par(i, N, *)
with {
maxN(2) = max;
maxN(N) = maxN(N - 1, max);
};
maximiser8(x) =
x * bypass + (1.0 - bypass) *
(x : crossover : dynamicNormalisation(8, normDepth) :
par(band,
8,
limiterBand(ba.take(band + 1, centreFreq),
1.0,
att,
hold,
rel,
preG)) :>
limiter4(th, att, hold, rel, 1.0))
with {
bypass = checkbox("h:Eight-Band Maximiser/v:Control/[009]Bypass") :
si.smoo;
normDepth =
hslider("h:Eight-Band Maximiser/v:Control/[010]Normalisation Depth (dB)", .0, .0, 60.0, .000001) :
ba.db2linear : si.smoo;
preG =
hslider("h:Eight-Band Maximiser/v:Control/[011]Pre Gain (dB)", 0., .0, 60.0, .000001) :
ba.db2linear : si.smoo;
th =
hslider("h:Eight-Band Maximiser/v:Control/[012]Ceiling (dB)", -.3, -60.0, .0, .000001) :
ba.db2linear : si.smoo;
att =
hslider("h:Eight-Band Maximiser/v:Control/[013]Attack (s)", .01, .001, .1, .000001) :
si.smoo;
hold =
hslider("h:Eight-Band Maximiser/v:Control/[014]Hold (s)", .01, .0, 1.0, .000001) :
si.smoo;
rel =
hslider("h:Eight-Band Maximiser/v:Control/[015]Release (s)", .1, .01, 1.0, .000001) :
si.smoo;
centreFreq = par(i, 8, 30 * 2 ^ (i + 1));
};
process = maximiser8;
| https://raw.githubusercontent.com/dariosanfilippo/maximiser/686e91735466490d5cf3cfab200929860bc8da3c/maximiser.dsp | faust | ******************************************************************************
********** Eight-band loudness maximiser ****************************
********************************************************************************
*
* This is an eight-band loudness maximiser based on IIR peak limiters and an
* eight-way Linkwitz-Riley fourth-order crossover. The limiter deployes
* cascaded one-pole smoothers for minimal THD and the maximiser has two
* maximisation modalities.
*
* On one hand, the maximiser offers the possibility to dynamically normalise the
* bands so that they have the same level approximately; on a sample-by-sample
* basis, the RMS of the loudest band is the reference value used to calculate a
* gain factor to bring all bands at the same level. The RMS calculation is
* carried out with 2πtau-constant one-pole filters and a one-second response
* time. Connected to this feature is a normalisation depth parameter that sets
* the maximum gain amount for normalisation. Assuming that the input signal
* without amplification is below 0 dB, the dynamical normalisation process does
* not set the limiters of the individual bands into an operational mode; hence,
* this process is free from degradation except for the limiting provided by the
* final limiter stage when the sum of the individual bands exceeds the ceiling.
* Alternatively, the maximisation can be performed by applying a gain
* amplification to the input signal, hence boosting all of the bands equally.
* The main difference is that dynamical normalisation provides maximum
* individual amplification with minimum degradation. On the other hand, the
* global gain amplification results in higher degradation for the predominant
* bands while keeping the overall spectral weights closer to the original
* signal.
*
****************************************************************************** |
import("stdfaust.lib");
declare maximiserMono author "Dario Sanfilippo";
declare maximiserMono copyright
"Copyright (C) 2022 Dario Sanfilippo <[email protected]>";
declare version "0.0";
declare maximiserMono license "MIT-style STK-4.3 license";
peakHold(t, x) = loop ~ _
with {
loop(fb) = ba.sAndH(cond1 | cond2, abs(x))
with {
cond1 = abs(x) >= fb;
cond2 = loop ~ _ <: _ < _'
with {
loop(fb) =
((1 - cond1) * fb + (1 - cond1)) % (t * ma.SR + 1);
};
};
};
peakHoldCascade(N, holdTime, x) = x : seq(i, N, peakHold(holdTime / N));
smoother(N, att, rel, x) = loop ~ _
with {
loop(fb) = ba.if(abs(x) >= fb, attSection, relSection)
with {
attSection = attCoeff * fb + (1.0 - attCoeff) * abs(x);
relSection = relCoeff * fb + (1.0 - relCoeff) * abs(x);
attCoeff =
exp((((-2.0 * ma.PI) / att) * cutoffCorrection) * ma.T);
relCoeff =
exp((((-2.0 * ma.PI) / rel) * cutoffCorrection) * ma.T);
cutoffCorrection = 1.0 / sqrt(pow(2.0, 1.0 / N) - 1.0);
};
};
smootherCascade(N, att, rel, x) = x : seq(i, N, smoother(N, att, rel));
gainAttenuation(N, th, att, hold, rel, x) =
th / (max(th, peakHoldCascade(8, att + hold, x)) :
smootherCascade(N, att, rel));
limiterBand(centreFreq, th, att, hold, rel, preG, x_) =
de.sdelay(.1 * ma.SR, .02 * ma.SR, att * ma.SR, x) * gDisplay
with {
x = x_ * preG;
g = gainAttenuation(4, th, att, hold, rel, x);
gDisplay = attach(g, g : ba.linear2db :
vbargraph("h:Eight-Band Maximiser/h:Display/h:[00]Attenuation (dB)/%4centreFreq Hz", -60, 0));
};
limiter4(th, att, hold, rel, preG, x_) =
de.sdelay(.1 * ma.SR, .02 * ma.SR, att * ma.SR, x) * g : peakDisplay
with {
x = x_ * preG;
g = gainAttenuation(4, th, att, hold, rel, x);
peakDisplay(x) = attach(x, peakHold(2.0, x) : ba.linear2db :
vbargraph("h:Eight-Band Maximiser/h:Display/h:[01]Peaks/[10]Peaks (dB)", -60, 0));
};
crossover = bands , _ : fi.crossover8LR4
with {
bands = par(i, 7, 20 * 2 ^ (i + 2));
};
dynamicNormalisation(N, depth) =
si.bus(N) <:
si.bus(N) ,
(par(i, N, an.rms_envelope_tau(1.0 / (2.0 * ma.PI))) <:
(maxN(N) <: si.bus(N)) ,
si.bus(N) : ro.interleave(N, 2) :
par(i, N, /(max(ma.EPSILON))) : par(i, N, min(depth))) :
ro.interleave(N, 2) : par(i, N, *)
with {
maxN(2) = max;
maxN(N) = maxN(N - 1, max);
};
maximiser8(x) =
x * bypass + (1.0 - bypass) *
(x : crossover : dynamicNormalisation(8, normDepth) :
par(band,
8,
limiterBand(ba.take(band + 1, centreFreq),
1.0,
att,
hold,
rel,
preG)) :>
limiter4(th, att, hold, rel, 1.0))
with {
bypass = checkbox("h:Eight-Band Maximiser/v:Control/[009]Bypass") :
si.smoo;
normDepth =
hslider("h:Eight-Band Maximiser/v:Control/[010]Normalisation Depth (dB)", .0, .0, 60.0, .000001) :
ba.db2linear : si.smoo;
preG =
hslider("h:Eight-Band Maximiser/v:Control/[011]Pre Gain (dB)", 0., .0, 60.0, .000001) :
ba.db2linear : si.smoo;
th =
hslider("h:Eight-Band Maximiser/v:Control/[012]Ceiling (dB)", -.3, -60.0, .0, .000001) :
ba.db2linear : si.smoo;
att =
hslider("h:Eight-Band Maximiser/v:Control/[013]Attack (s)", .01, .001, .1, .000001) :
si.smoo;
hold =
hslider("h:Eight-Band Maximiser/v:Control/[014]Hold (s)", .01, .0, 1.0, .000001) :
si.smoo;
rel =
hslider("h:Eight-Band Maximiser/v:Control/[015]Release (s)", .1, .01, 1.0, .000001) :
si.smoo;
centreFreq = par(i, 8, 30 * 2 ^ (i + 1));
};
process = maximiser8;
|
77d5492ce4f93d6295499494e43036ed0983a0132e58a8262a8fb9b2a532655a | dariosanfilippo/concatenative_granulation | cgp.dsp | // =============================================================================
// Live concatenative granular processing
// =============================================================================
//
// This software implements non-overlapping granulation with rectangular
// windowing, i.e., concatenative granular processing live.
//
// The main concerns with concatenative granulation are the artefacts due to
// the interconnection of uncorrelated sonic fragments, which result in signal
// discontinuities.
//
// Reducing low-order derivatives discontinuities is key to drastically reduce
// artefacts. This technique deploys zeroth and first-order derivative
// analysis with Lagrange polynomoials for a smooth transition between grains.
//
// For best results, the algorithm should run at 192 kHz sample rate and
// it should be compiled in double-precision.
//
// For feature requests and bug reports, please email
// sanfilippo.dario at gmail dot com.
//
// Copyright (C) Dario Sanfilippo 2021.
// =============================================================================
import("stdfaust.lib");
declare name "Concatenative Granular Processing";
declare author "Dario Sanfilippo";
declare copyright "Copyright (C) 2021 Dario Sanfilippo
<[email protected]>";
declare version "1.0";
declare license "MIT license";
// -----------------------------------------------------------------------------
// Lagrange interpolation
// -----------------------------------------------------------------------------
lagrange_h(N, x_vals, idx) = par(n, N + 1, prod(k, N + 1, f(n, k)))
with {
vals(i) = ba.take(i + 1, x_vals);
f(n, k) = ((idx - vals(k)) * (n != k) + (n == k)) /
((vals(n) - vals(k)) + (n == k));
};
lagrangeN(N, x_vals, idx) = lagrange_h(N, x_vals, idx) ,
si.bus(N + 1) : si.dot(N + 1);
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Fractional index tables
// -----------------------------------------------------------------------------
frwtable(N, S, init, w_idx, x, r_idx) =
lagrangeN(N, x_vals, f_idx, par(i, N + 1, y_vals(i_idx - int(N / 2) + i)))
with {
x_vals = par(i, N + 1, i);
y_vals(j) = rwtable(S, init, w_idx, x, int(ma.modulo(j, S)));
f_idx = ma.frac(r_idx) + int(N / 2);
i_idx = int(r_idx);
};
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Buffer definitions
// -----------------------------------------------------------------------------
ibuffer(r_idx, x) = rwtable(size, .0, index, x, int(ma.modulo(r_idx, size)));
fbuffer(r_idx, x) = frwtable(5, size, .0, index, x, r_idx);
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Maths
// -----------------------------------------------------------------------------
zc(x) = x * x' < 0;
up(x) = diff(x) > 0;
down(x) = diff(x) < 0;
diff(x) = x - x';
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// One-pole low-pass
// -----------------------------------------------------------------------------
lp1p(cf, x) = fi.pole(b, x * (1 - b))
with {
b = exp(ma.PI * -cf);
};
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Time transposition processing
// -----------------------------------------------------------------------------
pos(x) = os.phasor(size, t_fact) + buff_pos + pos_async
with {
pos_async = lp1p(t_cf, x) * t_depth;
};
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Pitch transposition processing
// -----------------------------------------------------------------------------
ptc(x) = p_fact + ptc_async <:
ba.if(<(0), max(-16, min(-1 / 16)), min(16, max(1 / 16)))
with {
ptc_async = lp1p(p_cf, x) * p_depth;
};
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Input processing for live or looped buffer
// -----------------------------------------------------------------------------
input(x) = +(x * (1 - r)) ~
(de.delay(size - 1, size - 1) * r);
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Buffer size and writing pointer definition
// -----------------------------------------------------------------------------
size = 192000 * 10;
index = ba.period(size);
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Concatenative granulation function
// -----------------------------------------------------------------------------
CGP(len, pos, pitch, x) = loop ~
_ : ! ,
_
with {
loop(y) = grain ,
Lgrain
with {
// Non-interpolated output
grain = fbuffer(offset + line, x);
// Trigger function
t = loop ~
_
with {
loop(reset) =
(fi.pole(1 - reset, 1) >=
ba.sAndH(1 - 1' + reset, len)) & zc(y);
};
// Trigger-locked pitch variations
pitch_sah = ba.sAndH(1 - 1' + t, pitch);
// Pitch transposition function
line = fi.pole(1 - t, 1 - t) * pitch_sah;
// Grain position processing
offset = ba.sAndH(t, zc_sel + corr)
with {
dir = ma.signum(pitch_sah);
zc_sel = ba.if( diff(y) * dir > 0,
zc_up(pos, x),
zc_down(pos, x));
zc_up(read, x) =
ibuffer(read, ba.sAndH(zc(x) & up(x), index));
zc_down(read, x) =
ibuffer(read, ba.sAndH(zc(x) & down(x), index));
corr = y_diff / safe_den(x_diff) + (dir - 1) / 2
with {
y_diff = diff(y);
x_diff = ibuffer(zc_sel, diff(x));
safe_den(den) = ba.if( den < 0,
min(0 - ma.EPSILON, den),
max(ma.EPSILON, den));
};
};
// Switching section (interpolation)
Lgrain = ba.if( lline < L,
lagrangeN(N, x_vals, lline, y_vals),
grain)
with {
N = 5;
halfp = (N + 1) / 2;
// X-axis spacing
x_vals = par(i, N + 1, (i - halfp) *
(i < halfp) + (i + L - halfp) * (i >= halfp));
// Interpolation points
y_vals = l_points ,
r_points
with {
l_points =
par(i, halfp,
ba.sAndH(t, y @ (halfp - 1 - i)));
r_points =
par(i, halfp,
fbuffer(offset + (L + i) * pitch_sah, x));
};
// Interpolation index
lline = min(L, +(1 - t)) ~
*(1 - t);
};
};
};
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// GUI parameters
// -----------------------------------------------------------------------------
L = int(hslider("[00]Interpolation length (samples)", 16, 4, 64, 1));
len = hslider("[01]Grain length (s)", .1, .001, 1, .000001) * ma.SR;
buff_pos = hslider("[02]Buffer position", 0, 0, 1, .000001) * size;
t_fact = hslider("[03]Time transposition", 1, -16, 16, .000001) *
(ma.SR / size);
t_cf = hslider("[04]Time async degree", 0, 0, 1, .000001);
t_depth = hslider("[05]Time async depth", 0, 0, size, .000001);
p_fact = hslider("[06]Pitch transposition", 1, -16, 16, .000001);
p_cf = hslider("[07]Pitch async degree", 0, 0, 1, .000001);
p_depth = hslider("[08]Pitch async depth", 0, 0, 1000, .000001);
r = checkbox("[09]Freeze buffer");
vol = hslider("[10]Volume", 0, 0, 1, .000001);
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Main process
// -----------------------------------------------------------------------------
process(x1, x2) = ( loop1 ~
_) * vol ,
( loop2 ~
_) * vol
with {
loop1(fb) = CGP(len, pos(fb), ptc(fb), input(x1));
loop2(fb) = CGP(len, pos(fb), ptc(fb), input(x2));
};
// -----------------------------------------------------------------------------
| https://raw.githubusercontent.com/dariosanfilippo/concatenative_granulation/5be63aa727beef38ed2c94c0b32ba398bb47a36b/cgp.dsp | faust | =============================================================================
Live concatenative granular processing
=============================================================================
This software implements non-overlapping granulation with rectangular
windowing, i.e., concatenative granular processing live.
The main concerns with concatenative granulation are the artefacts due to
the interconnection of uncorrelated sonic fragments, which result in signal
discontinuities.
Reducing low-order derivatives discontinuities is key to drastically reduce
artefacts. This technique deploys zeroth and first-order derivative
analysis with Lagrange polynomoials for a smooth transition between grains.
For best results, the algorithm should run at 192 kHz sample rate and
it should be compiled in double-precision.
For feature requests and bug reports, please email
sanfilippo.dario at gmail dot com.
Copyright (C) Dario Sanfilippo 2021.
=============================================================================
-----------------------------------------------------------------------------
Lagrange interpolation
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Fractional index tables
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Buffer definitions
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Maths
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
One-pole low-pass
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Time transposition processing
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Pitch transposition processing
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Input processing for live or looped buffer
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Buffer size and writing pointer definition
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Concatenative granulation function
-----------------------------------------------------------------------------
Non-interpolated output
Trigger function
Trigger-locked pitch variations
Pitch transposition function
Grain position processing
Switching section (interpolation)
X-axis spacing
Interpolation points
Interpolation index
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
GUI parameters
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Main process
-----------------------------------------------------------------------------
----------------------------------------------------------------------------- |
import("stdfaust.lib");
declare name "Concatenative Granular Processing";
declare author "Dario Sanfilippo";
declare copyright "Copyright (C) 2021 Dario Sanfilippo
<[email protected]>";
declare version "1.0";
declare license "MIT license";
lagrange_h(N, x_vals, idx) = par(n, N + 1, prod(k, N + 1, f(n, k)))
with {
vals(i) = ba.take(i + 1, x_vals);
f(n, k) = ((idx - vals(k)) * (n != k) + (n == k)) /
((vals(n) - vals(k)) + (n == k));
};
lagrangeN(N, x_vals, idx) = lagrange_h(N, x_vals, idx) ,
si.bus(N + 1) : si.dot(N + 1);
frwtable(N, S, init, w_idx, x, r_idx) =
lagrangeN(N, x_vals, f_idx, par(i, N + 1, y_vals(i_idx - int(N / 2) + i)))
with {
x_vals = par(i, N + 1, i);
y_vals(j) = rwtable(S, init, w_idx, x, int(ma.modulo(j, S)));
f_idx = ma.frac(r_idx) + int(N / 2);
i_idx = int(r_idx);
};
ibuffer(r_idx, x) = rwtable(size, .0, index, x, int(ma.modulo(r_idx, size)));
fbuffer(r_idx, x) = frwtable(5, size, .0, index, x, r_idx);
zc(x) = x * x' < 0;
up(x) = diff(x) > 0;
down(x) = diff(x) < 0;
diff(x) = x - x';
lp1p(cf, x) = fi.pole(b, x * (1 - b))
with {
b = exp(ma.PI * -cf);
};
pos(x) = os.phasor(size, t_fact) + buff_pos + pos_async
with {
pos_async = lp1p(t_cf, x) * t_depth;
};
ptc(x) = p_fact + ptc_async <:
ba.if(<(0), max(-16, min(-1 / 16)), min(16, max(1 / 16)))
with {
ptc_async = lp1p(p_cf, x) * p_depth;
};
input(x) = +(x * (1 - r)) ~
(de.delay(size - 1, size - 1) * r);
size = 192000 * 10;
index = ba.period(size);
CGP(len, pos, pitch, x) = loop ~
_ : ! ,
_
with {
loop(y) = grain ,
Lgrain
with {
grain = fbuffer(offset + line, x);
t = loop ~
_
with {
loop(reset) =
(fi.pole(1 - reset, 1) >=
ba.sAndH(1 - 1' + reset, len)) & zc(y);
};
pitch_sah = ba.sAndH(1 - 1' + t, pitch);
line = fi.pole(1 - t, 1 - t) * pitch_sah;
offset = ba.sAndH(t, zc_sel + corr)
with {
dir = ma.signum(pitch_sah);
zc_sel = ba.if( diff(y) * dir > 0,
zc_up(pos, x),
zc_down(pos, x));
zc_up(read, x) =
ibuffer(read, ba.sAndH(zc(x) & up(x), index));
zc_down(read, x) =
ibuffer(read, ba.sAndH(zc(x) & down(x), index));
corr = y_diff / safe_den(x_diff) + (dir - 1) / 2
with {
y_diff = diff(y);
x_diff = ibuffer(zc_sel, diff(x));
safe_den(den) = ba.if( den < 0,
min(0 - ma.EPSILON, den),
max(ma.EPSILON, den));
};
};
Lgrain = ba.if( lline < L,
lagrangeN(N, x_vals, lline, y_vals),
grain)
with {
N = 5;
halfp = (N + 1) / 2;
x_vals = par(i, N + 1, (i - halfp) *
(i < halfp) + (i + L - halfp) * (i >= halfp));
y_vals = l_points ,
r_points
with {
l_points =
par(i, halfp,
ba.sAndH(t, y @ (halfp - 1 - i)));
r_points =
par(i, halfp,
fbuffer(offset + (L + i) * pitch_sah, x));
};
lline = min(L, +(1 - t)) ~
*(1 - t);
};
};
};
L = int(hslider("[00]Interpolation length (samples)", 16, 4, 64, 1));
len = hslider("[01]Grain length (s)", .1, .001, 1, .000001) * ma.SR;
buff_pos = hslider("[02]Buffer position", 0, 0, 1, .000001) * size;
t_fact = hslider("[03]Time transposition", 1, -16, 16, .000001) *
(ma.SR / size);
t_cf = hslider("[04]Time async degree", 0, 0, 1, .000001);
t_depth = hslider("[05]Time async depth", 0, 0, size, .000001);
p_fact = hslider("[06]Pitch transposition", 1, -16, 16, .000001);
p_cf = hslider("[07]Pitch async degree", 0, 0, 1, .000001);
p_depth = hslider("[08]Pitch async depth", 0, 0, 1000, .000001);
r = checkbox("[09]Freeze buffer");
vol = hslider("[10]Volume", 0, 0, 1, .000001);
process(x1, x2) = ( loop1 ~
_) * vol ,
( loop2 ~
_) * vol
with {
loop1(fb) = CGP(len, pos(fb), ptc(fb), input(x1));
loop2(fb) = CGP(len, pos(fb), ptc(fb), input(x2));
};
|
e7256e88fb61dc945b3a80d0149f913bee5c0eb9c26c7d33e21c1c8df6a73030 | dariosanfilippo/limiterStereo | limiterStereo.dsp | /*******************************************************************************
********** Look-ahead IIR stereo limiter ****************************
********************************************************************************
*
* Yet another look-ahead limiter.
*
* The novel aspect of this limiter is that it
* uses N cascaded one-pole filters for amplitude profiling, which improves
* smoothness in the first to N-1 order derivatives and reduces total
* harmonic distortion. This design uses four cascaded one-pole lowpass filters,
* following the cut-off correction formula (8.9) found in [Zavalishin 2012].
*
* IIR filters produce exponential curves, which are perceptually more natural.
* However, an IIR system, unlike a FIR moving average, for example, will never
* completely reach the target value and is thus not suitable for perfect
* brick-wall limiting. With reasonable settings, though, the limiter
* produces an overshooting of only .002 dB with signals boosted by 120 dBs,
* which I find negligible for most musical applications.
*
* The limiter introduces a delay that is equal to the attack time times
* the samplerate samples.
*
* For better peak detection, N peak-hold sections with 1/N hold time can be
* cascaded, so that secondary peaks that are at least 1/N of the hold time
* plus one sample apart from the primary peak can still be detected.
* The secondary peaks that are closer to the primary peaks can be taken care
* of by the release section. Thanks to Geraint "Signalsmith" Luff and our
* discussions on the topic, which inspired this solution.
*
* The other parameters are the hold time and the release time, for the
* amplitude profiling characteristics, as well as a bypass button, a pre-gain,
* and a ceiling threshold.
*
* The limiter is stereo-linked, hence the relative left-right amplitude
* difference is preserved.
*
* Future developements on this work may include an adaptive mechanism for
* self-adjusting release times to reduce the 'pumping' effect, and a deployment
* in multi-band processing for loudness maximisation.
*
* Note on loudness: while I am aware of the loudness war in the pop music
* context, which is today a rather nostalgic thought, loudness itself has been
* explored as a creative means beautifully, for example, in the work of
* Phil Niblock, which is a reason why I am interested in exploring these
* techniques.
*
*******************************************************************************/
import("stdfaust.lib");
declare limiterStereo author "Dario Sanfilippo";
declare limiterStereo copyright
"Copyright (C) 2022 Dario Sanfilippo <[email protected]>";
declare version "0.4.0";
declare limiterStereo license "MIT-style STK-4.3 license";
sdelay(maxDelay, interpolationLen, delayLen, x) =
loop ~ si.bus(4) : (! , ! , ! , ! , _)
with {
loop(lineState, incrState, lowerDelayState, upperDelayState) =
line , incr , lowerDelay , upperDelay , output
with {
lowerReach = lineState == 0;
upperReach = lineState == 1;
lowerDelayChange = delayLen != lowerDelayState;
upperDelayChange = delayLen != upperDelayState;
incr = ba.if( upperReach & upperDelayChange,
-1.0 / interpolationLen,
ba.if( lowerReach & lowerDelayChange),
1.0 / interpolationLen,
incrState);
line = max(.0, min(1.0, lineState + incr));
lowerDelay = ba.if(upperReach, delayLen, lowerDelayState);
upperDelay = ba.if(lowerReach, delayLen, upperDelayState);
lowerDelayline = de.delay(maxDelay, lowerDelay, x) * (1.0 - line);
upperDelayline = de.delay(maxDelay, upperDelay, x) * line;
output = lowerDelayline + upperDelayline;
};
};
peakHold(t, x) = loop ~ si.bus(2) : ! , _
with {
loop(timerState, outState) = timer , output
with {
isNewPeak = abs(x) >= outState;
isTimeOut = timerState >= rint(t * ma.SR);
bypass = isNewPeak | isTimeOut;
timer = (1 - bypass) * (timerState + 1);
output = bypass * (abs(x) - outState) + outState;
};
};
peakHoldCascade(N, holdTime, x) = x : seq(i, N, peakHold(holdTime / N));
smoother(N, att, rel, x) = loop ~ _
with {
loop(fb) = coeff * fb + (1.0 - coeff) * x
with {
coeff = ba.if(x > fb, attCoeff, relCoeff);
twoPiCT = 2.0 * ma.PI * cutoffCorrection * ma.T;
attCoeff = exp(-twoPiCT / att);
relCoeff = exp(-twoPiCT / rel);
cutoffCorrection = 1.0 / sqrt(pow(2.0, 1.0 / N) - 1.0);
};
};
smootherCascade(N, att, rel, x) = x : seq(i, N, smoother(N, att, rel));
gainAttenuation(th, att, hold, rel, x) =
th / (max(th, peakHoldCascade(8, att + hold, x)) :
smootherCascade(4, att, rel));
limiterStereo(xL_, xR_) =
(xL_ * (bypass) + (1 - bypass) * xLDelayed * stereoAttenuationGain :
peakDisplayL),
(xR_ * (bypass) + (1 - bypass) * xRDelayed * stereoAttenuationGain :
peakDisplayR)
with {
xL = xL_ * preGain;
xR = xR_ * preGain;
delay = rint((attack / 8) * ma.SR) * 8;
xLDelayed = sdelay(.1 * ma.SR, delay, delay, xL);
xRDelayed = sdelay(.1 * ma.SR, delay, delay, xR);
stereoAttenuationGain =
gainAttenuation(threshold,
attack,
hold,
release,
max(abs(xL), abs(xR))) : attenuationDisplay;
horizontalGroup(group) = hgroup("Look-ahead IIR Stereo Limiter", group);
peakGroup(group) = hgroup("Peaks", group);
displayGroup(display) = horizontalGroup(vgroup("Display", display));
controlGroup(param) = horizontalGroup(vgroup("Control", param));
peakDisplayL(peak) =
displayGroup(peakGroup(attach(peak, (peakHold(3, peak) :
ba.linear2db :
vbargraph( "[06]Left Peak (dB)[style:numerical]",
-60,
60)))));
peakDisplayR(peak) =
displayGroup(peakGroup(attach(peak, (peakHold(3, peak) :
ba.linear2db :
vbargraph( "[07]Right Peak (dB)[style:numerical]",
-60,
60)))));
attenuationDisplay(attenuation) =
displayGroup(attach(attenuation, attenuation :
ba.linear2db : vbargraph("[09]Attenuation (dB)", -120, 0)));
bypass = controlGroup(checkbox("[00]Bypass")) : si.smoo;
preGain = controlGroup(ba.db2linear(hslider("[01]Pre Gain (dB)",
0,
0,
120,
.001))) : si.smoo;
threshold = controlGroup(ba.db2linear( hslider("[02]Threshold (dB)",
0,
-60,
0,
.001))) : si.smoo;
attack = controlGroup(hslider( "[03]Attack (s)",
.01,
.001,
.05,
.001)) : si.smoo;
hold = controlGroup(hslider("[04]Hold (s)",
.05,
.000,
1,
.001)) : si.smoo;
release = controlGroup(hslider( "[05]Release (s)",
.15,
.05,
1,
.001)) : si.smoo;
};
process = limiterStereo;
| https://raw.githubusercontent.com/dariosanfilippo/limiterStereo/da1c38cc393f08b5dd79e56ffd4e6256af07a708/limiterStereo.dsp | faust | ******************************************************************************
********** Look-ahead IIR stereo limiter ****************************
********************************************************************************
*
* Yet another look-ahead limiter.
*
* The novel aspect of this limiter is that it
* uses N cascaded one-pole filters for amplitude profiling, which improves
* smoothness in the first to N-1 order derivatives and reduces total
* harmonic distortion. This design uses four cascaded one-pole lowpass filters,
* following the cut-off correction formula (8.9) found in [Zavalishin 2012].
*
* IIR filters produce exponential curves, which are perceptually more natural.
* However, an IIR system, unlike a FIR moving average, for example, will never
* completely reach the target value and is thus not suitable for perfect
* brick-wall limiting. With reasonable settings, though, the limiter
* produces an overshooting of only .002 dB with signals boosted by 120 dBs,
* which I find negligible for most musical applications.
*
* The limiter introduces a delay that is equal to the attack time times
* the samplerate samples.
*
* For better peak detection, N peak-hold sections with 1/N hold time can be
* cascaded, so that secondary peaks that are at least 1/N of the hold time
* plus one sample apart from the primary peak can still be detected.
* The secondary peaks that are closer to the primary peaks can be taken care
* of by the release section. Thanks to Geraint "Signalsmith" Luff and our
* discussions on the topic, which inspired this solution.
*
* The other parameters are the hold time and the release time, for the
* amplitude profiling characteristics, as well as a bypass button, a pre-gain,
* and a ceiling threshold.
*
* The limiter is stereo-linked, hence the relative left-right amplitude
* difference is preserved.
*
* Future developements on this work may include an adaptive mechanism for
* self-adjusting release times to reduce the 'pumping' effect, and a deployment
* in multi-band processing for loudness maximisation.
*
* Note on loudness: while I am aware of the loudness war in the pop music
* context, which is today a rather nostalgic thought, loudness itself has been
* explored as a creative means beautifully, for example, in the work of
* Phil Niblock, which is a reason why I am interested in exploring these
* techniques.
*
****************************************************************************** |
import("stdfaust.lib");
declare limiterStereo author "Dario Sanfilippo";
declare limiterStereo copyright
"Copyright (C) 2022 Dario Sanfilippo <[email protected]>";
declare version "0.4.0";
declare limiterStereo license "MIT-style STK-4.3 license";
sdelay(maxDelay, interpolationLen, delayLen, x) =
loop ~ si.bus(4) : (! , ! , ! , ! , _)
with {
loop(lineState, incrState, lowerDelayState, upperDelayState) =
line , incr , lowerDelay , upperDelay , output
with {
lowerReach = lineState == 0;
upperReach = lineState == 1;
lowerDelayChange = delayLen != lowerDelayState;
upperDelayChange = delayLen != upperDelayState;
incr = ba.if( upperReach & upperDelayChange,
-1.0 / interpolationLen,
ba.if( lowerReach & lowerDelayChange),
1.0 / interpolationLen,
incrState);
line = max(.0, min(1.0, lineState + incr));
lowerDelay = ba.if(upperReach, delayLen, lowerDelayState);
upperDelay = ba.if(lowerReach, delayLen, upperDelayState);
lowerDelayline = de.delay(maxDelay, lowerDelay, x) * (1.0 - line);
upperDelayline = de.delay(maxDelay, upperDelay, x) * line;
output = lowerDelayline + upperDelayline;
};
};
peakHold(t, x) = loop ~ si.bus(2) : ! , _
with {
loop(timerState, outState) = timer , output
with {
isNewPeak = abs(x) >= outState;
isTimeOut = timerState >= rint(t * ma.SR);
bypass = isNewPeak | isTimeOut;
timer = (1 - bypass) * (timerState + 1);
output = bypass * (abs(x) - outState) + outState;
};
};
peakHoldCascade(N, holdTime, x) = x : seq(i, N, peakHold(holdTime / N));
smoother(N, att, rel, x) = loop ~ _
with {
loop(fb) = coeff * fb + (1.0 - coeff) * x
with {
coeff = ba.if(x > fb, attCoeff, relCoeff);
twoPiCT = 2.0 * ma.PI * cutoffCorrection * ma.T;
attCoeff = exp(-twoPiCT / att);
relCoeff = exp(-twoPiCT / rel);
cutoffCorrection = 1.0 / sqrt(pow(2.0, 1.0 / N) - 1.0);
};
};
smootherCascade(N, att, rel, x) = x : seq(i, N, smoother(N, att, rel));
gainAttenuation(th, att, hold, rel, x) =
th / (max(th, peakHoldCascade(8, att + hold, x)) :
smootherCascade(4, att, rel));
limiterStereo(xL_, xR_) =
(xL_ * (bypass) + (1 - bypass) * xLDelayed * stereoAttenuationGain :
peakDisplayL),
(xR_ * (bypass) + (1 - bypass) * xRDelayed * stereoAttenuationGain :
peakDisplayR)
with {
xL = xL_ * preGain;
xR = xR_ * preGain;
delay = rint((attack / 8) * ma.SR) * 8;
xLDelayed = sdelay(.1 * ma.SR, delay, delay, xL);
xRDelayed = sdelay(.1 * ma.SR, delay, delay, xR);
stereoAttenuationGain =
gainAttenuation(threshold,
attack,
hold,
release,
max(abs(xL), abs(xR))) : attenuationDisplay;
horizontalGroup(group) = hgroup("Look-ahead IIR Stereo Limiter", group);
peakGroup(group) = hgroup("Peaks", group);
displayGroup(display) = horizontalGroup(vgroup("Display", display));
controlGroup(param) = horizontalGroup(vgroup("Control", param));
peakDisplayL(peak) =
displayGroup(peakGroup(attach(peak, (peakHold(3, peak) :
ba.linear2db :
vbargraph( "[06]Left Peak (dB)[style:numerical]",
-60,
60)))));
peakDisplayR(peak) =
displayGroup(peakGroup(attach(peak, (peakHold(3, peak) :
ba.linear2db :
vbargraph( "[07]Right Peak (dB)[style:numerical]",
-60,
60)))));
attenuationDisplay(attenuation) =
displayGroup(attach(attenuation, attenuation :
ba.linear2db : vbargraph("[09]Attenuation (dB)", -120, 0)));
bypass = controlGroup(checkbox("[00]Bypass")) : si.smoo;
preGain = controlGroup(ba.db2linear(hslider("[01]Pre Gain (dB)",
0,
0,
120,
.001))) : si.smoo;
threshold = controlGroup(ba.db2linear( hslider("[02]Threshold (dB)",
0,
-60,
0,
.001))) : si.smoo;
attack = controlGroup(hslider( "[03]Attack (s)",
.01,
.001,
.05,
.001)) : si.smoo;
hold = controlGroup(hslider("[04]Hold (s)",
.05,
.000,
1,
.001)) : si.smoo;
release = controlGroup(hslider( "[05]Release (s)",
.15,
.05,
1,
.001)) : si.smoo;
};
process = limiterStereo;
|
a2756ee7c78ea90cab4c16edf8e0c6a479aa69e6790752b90fc6f0a9f66f029d | SpotlightKid/faustfilters | diodeladder.dsp | declare name "DiodeLadder";
declare description "FAUST Diode Ladder 24 dB LPF";
declare author "Christopher Arndt";
declare license "MIT-style STK-4.3 license";
import("stdfaust.lib");
//------------------`diodeLadder`-----------------
// 4th order virtual analog diode ladder filter. In addition to the individual
// states used within each independent 1st-order filter, there are also additional
// feedback paths found in the block diagram. These feedback paths are labeled
// as connecting states. Rather than separately storing these connecting states
// in the Faust implementation, they are simply implicitly calculated by
// tracing back to the other states (s1,s2,s3,s4) each recursive step.
//
// This filter was implemented in Faust by Eric Tarr during the
// [2019 Embedded DSP With Faust Workshop](https://ccrma.stanford.edu/workshops/faust-embedded-19/).
//
// Modified by Christopher Arndt to change the cutoff frequency param
// to be given in Hertz instead of normalized 0.0 - 1.0.
//
// #### References
//
// * <https://www.willpirkle.com/virtual-analog-diode-ladder-filter/>
// * <http://www.willpirkle.com/Downloads/AN-6DiodeLadderFilter.pdf>
//
// #### Usage
//
// ```
// _ : diodeLadder(normFreq,Q) : _
// ```
//
// Where:
//
// * `freq`: cutoff frequency (20-20000 Hz)
// * `Q`: filter Q (0.707 - 25.0)
//---------------------------------------------------------------------
declare diodeLadder author "Eric Tarr";
declare diodeLadder license "MIT-style STK-4.3 license";
diodeLadder(freq,Q) = ef.cubicnl(1,0)*1.5 <:(s1,s2,s3,s4,y) : !,!,!,!,_
letrec{
's1 = _-(s4*B4*SG4*k) :
_-((s4*B4*d3+s3)*B3*SG3*k) :
_-(((s4*B4*d3+s3)*B3*d2 + s2)*B2*SG3*k) :
_-((((s4*B4*d3+s3)*B3*d2 + s2)*B2*d1 + s1)*B1*SG1*k) :
_*alpha0: _*gam1 : _+((s4*B4*d3+s3)*B3*d2 + s2)*B2 : //_+S2
_+((((s4*B4*d3+s3)*B3*d2 + s2)*B2)*d1 + s1)*B1*G2 : // _ + (S2 ...
_*a1 : _-s1 :_*alpha*2 : _+s1;
's2 = _-(s4*B4*SG4*k) :
_-((s4*B4*d3+s3)*B3*SG3*k) :
_-(((s4*B4*d3+s3)*B3*d2 + s2)*B2*SG3*k):
_-((((s4*B4*d3+s3)*B3*d2 + s2)*B2*d1 + s1)*B1*SG1*k) :
_*alpha0: _*gam1 : _+((s4*B4*d3+s3)*B3*d2 + s2)*B2 : //_+S2
_+((((s4*B4*d3+s3)*B3*d2 + s2)*B2)*d1 + s1)*B1*G2 : // _ + (S2 ...
_*a1 : _-s1 :_*alpha : _+s1 : _*gam2 :
_+(s4*B4*d3 + s3)*B3 : //_+S3 :
_+(((s4*B4*d3 + s3)*B3)*d2 + s2)*B2*G3 : //_+(S3...)
_*a2 : _-s2 : _*alpha*2 : _+s2;
's3 = _-(s4*B4*SG4*k) :
_-((s4*B4*d3+s3)*B3*SG3*k) :
_-(((s4*B4*d3+s3)*B3*d2 + s2)*B2*SG3*k) :
_-((((s4*B4*d3+s3)*B3*d2 + s2)*B2*d1 + s1)*B1*SG1*k) :
_*alpha0 : _*gam1 : _+((s4*B4*d3+s3)*B3*d2 + s2)*B2 : //_+S2
_+((((s4*B4*d3+s3)*B3*d2 + s2)*B2)*d1+s1)*B1*G2 : // _ + (S2 ...
_*a1 : _-s1 :_*alpha : _+s1 : _*gam2 :
_+(s4*B4*d3 + s3)*B3 : //_+S3 :
_+(((s4*B4*d3 + s3)*B3)*d2 + s2)*B2*G3 : //_+(S3...)
_*a2 : _-s2 : _*alpha : _+s2 : _*gam3:
_+s4*B4 : // _ + S4
_+((s4*B4)*d3 + s3)*B3*G4: // _ + S4 ...
_*a3 : _-s3 : _*alpha*2 : _+s3;
's4 = _-(s4*B4*SG4*k) :
_-((s4*B4*d3+s3)*B3*SG3*k) :
_-(((s4*B4*d3+s3)*B3*d2 + s2)*B2*SG3*k) :
_-((((s4*B4*d3+s3)*B3*d2 + s2)*B2*d1 + s1 )*B1*SG1*k) :
_*alpha0 : _*gam1 : _+((s4*B4*d3+s3)*B3*d2 + s2)*B2 : //_+S2
_+((((s4*B4*d3+s3)*B3*d2 + s2)*B2)*d1 + s1)*B1*G2 : // _ + (S2 ...
_*a1 : _-s1 :_*alpha : _+s1 : _*gam2 :
_+(s4*B4*d3 + s3)*B3 : //_+S3 :
_+(((s4*B4*d3 + s3)*B3) *d2+s2)*B2*G3 : //_+(S3...)
_*a2 : _-s2 : _*alpha : _+s2 : _*gam3 :
_+s4*B4 : // _ + S4
_+((s4*B4)*d3 + s3)*B3*G4: // _ + S4 ...
_*a3 : _-s3 : _*alpha : _+s3 : _*gam4 : _*a4 : _-s4 : _*alpha*2 : _+s4;
// Output signal
'y = _-(s4*B4*SG4*k) :
_-((s4*B4*d3+s3)*B3*SG3*k) :
_-(((s4*B4*d3+s3)*B3*d2 + s2)*B2*SG3*k) :
_-((((s4*B4*d3+s3)*B3*d2 + s2)*B2*d1 + s1 )*B1*SG1*k) :
_*alpha0: _*gam1 : _+((s4*B4*d3+s3)*B3*d2 + s2)*B2 : //_+S2
_+((((s4*B4*d3+s3)*B3*d2 + s2)*B2)*d1 + s1)*B1*G2 : // _ + (S2 ...
_*a1 : _-s1 :_*alpha : _+s1 : _*gam2 :
_+(s4*B4*d3 + s3)*B3 : //_+S3 :
_+(((s4*B4*d3 + s3)*B3)*d2 + s2)*B2*G3 : //_+(S3...)
_*a2 : _-s2 : _*alpha : _+s2 : _*gam3 :
_+s4*B4 : // _ + S4
_+((s4*B4)*d3 + s3)*B3*G4: // _ + S4 ...
_*a3 : _-s3 : _*alpha : _+s3 : _*gam4 : _*a4 : _-s4 : _*alpha : _+s4;
}
with{
// freq = 2*(10^(3*normFreq+1));
normFreq = (log10(freq) - log10(2)) / 3.0 - (1.0 / 3.0);
k = (17 - (normFreq^10)*9.7)*(Q - 0.707)/(25.0 - 0.707);
wd = 2*ma.PI*freq;
T = 1/ma.SR;
wa = (2/T)*tan(wd*T/2);
g = wa*T/2;
G4 = 0.5*g/(1 + g);
G3 = 0.5*g/(1 + g - 0.5*g*G4);
G2 = 0.5*g/(1 + g - 0.5*g*G3);
G1 = g/(1.0 + g - g*G2);
Gamma = G1*G2*G3*G4;
SG1 = G4*G3*G2; // feedback gain pre-calculated
SG2 = G4*G3;
SG3 = G4;
SG4 = 1;
alpha = g/(1+g);
alpha0 = 1/(1+k*Gamma);
gam1 = 1+G1*G2;
gam2 = 1+G2*G3;
gam3 = 1+G3*G4;
gam4 = 1;
a1 = 1; // a0 for 1st LPF
a2 = 0.5; // a0 for 2nd LPF
a3 = 0.5;
a4 = 0.5;
B1 = 1/(1+g-g*G2); // Beta for 1st block
B2 = 1/(1+g-0.5*g*G3);
B3 = 1/(1+g-0.5*g*G4);
B4 = 1/(1+g);
d1 = g; // delta for 1st block
d2 = 0.5*g;
d3 = 0.5*g;
//d4 = 0;
};
q = hslider("[1]Q[symbol: q][abbrev: q][style:knob]", 1.0, 0.7072, 25.0, 0.01);
cutoff = hslider("[0]Cutoff frequency[symbol: cutoff][abbrev: cutoff][unit: hz][scale: log][style: knob]", 20000.0, 20.0, 20000, 0.1):si.smoo;
process = diodeLadder(cutoff, q);
| https://raw.githubusercontent.com/SpotlightKid/faustfilters/8dfb35de7b83935806abe950187e056623b6c01a/faust/diodeladder.dsp | faust | ------------------`diodeLadder`-----------------
4th order virtual analog diode ladder filter. In addition to the individual
states used within each independent 1st-order filter, there are also additional
feedback paths found in the block diagram. These feedback paths are labeled
as connecting states. Rather than separately storing these connecting states
in the Faust implementation, they are simply implicitly calculated by
tracing back to the other states (s1,s2,s3,s4) each recursive step.
This filter was implemented in Faust by Eric Tarr during the
[2019 Embedded DSP With Faust Workshop](https://ccrma.stanford.edu/workshops/faust-embedded-19/).
Modified by Christopher Arndt to change the cutoff frequency param
to be given in Hertz instead of normalized 0.0 - 1.0.
#### References
* <https://www.willpirkle.com/virtual-analog-diode-ladder-filter/>
* <http://www.willpirkle.com/Downloads/AN-6DiodeLadderFilter.pdf>
#### Usage
```
_ : diodeLadder(normFreq,Q) : _
```
Where:
* `freq`: cutoff frequency (20-20000 Hz)
* `Q`: filter Q (0.707 - 25.0)
---------------------------------------------------------------------
_+S2
_ + (S2 ...
_+S2
_ + (S2 ...
_+S3 :
_+(S3...)
_+S2
_ + (S2 ...
_+S3 :
_+(S3...)
_ + S4
_ + S4 ...
_+S2
_ + (S2 ...
_+S3 :
_+(S3...)
_ + S4
_ + S4 ...
Output signal
_+S2
_ + (S2 ...
_+S3 :
_+(S3...)
_ + S4
_ + S4 ...
freq = 2*(10^(3*normFreq+1));
feedback gain pre-calculated
a0 for 1st LPF
a0 for 2nd LPF
Beta for 1st block
delta for 1st block
d4 = 0; | declare name "DiodeLadder";
declare description "FAUST Diode Ladder 24 dB LPF";
declare author "Christopher Arndt";
declare license "MIT-style STK-4.3 license";
import("stdfaust.lib");
declare diodeLadder author "Eric Tarr";
declare diodeLadder license "MIT-style STK-4.3 license";
diodeLadder(freq,Q) = ef.cubicnl(1,0)*1.5 <:(s1,s2,s3,s4,y) : !,!,!,!,_
letrec{
's1 = _-(s4*B4*SG4*k) :
_-((s4*B4*d3+s3)*B3*SG3*k) :
_-(((s4*B4*d3+s3)*B3*d2 + s2)*B2*SG3*k) :
_-((((s4*B4*d3+s3)*B3*d2 + s2)*B2*d1 + s1)*B1*SG1*k) :
_*a1 : _-s1 :_*alpha*2 : _+s1;
's2 = _-(s4*B4*SG4*k) :
_-((s4*B4*d3+s3)*B3*SG3*k) :
_-(((s4*B4*d3+s3)*B3*d2 + s2)*B2*SG3*k):
_-((((s4*B4*d3+s3)*B3*d2 + s2)*B2*d1 + s1)*B1*SG1*k) :
_*a1 : _-s1 :_*alpha : _+s1 : _*gam2 :
_*a2 : _-s2 : _*alpha*2 : _+s2;
's3 = _-(s4*B4*SG4*k) :
_-((s4*B4*d3+s3)*B3*SG3*k) :
_-(((s4*B4*d3+s3)*B3*d2 + s2)*B2*SG3*k) :
_-((((s4*B4*d3+s3)*B3*d2 + s2)*B2*d1 + s1)*B1*SG1*k) :
_*a1 : _-s1 :_*alpha : _+s1 : _*gam2 :
_*a2 : _-s2 : _*alpha : _+s2 : _*gam3:
_*a3 : _-s3 : _*alpha*2 : _+s3;
's4 = _-(s4*B4*SG4*k) :
_-((s4*B4*d3+s3)*B3*SG3*k) :
_-(((s4*B4*d3+s3)*B3*d2 + s2)*B2*SG3*k) :
_-((((s4*B4*d3+s3)*B3*d2 + s2)*B2*d1 + s1 )*B1*SG1*k) :
_*a1 : _-s1 :_*alpha : _+s1 : _*gam2 :
_*a2 : _-s2 : _*alpha : _+s2 : _*gam3 :
_*a3 : _-s3 : _*alpha : _+s3 : _*gam4 : _*a4 : _-s4 : _*alpha*2 : _+s4;
'y = _-(s4*B4*SG4*k) :
_-((s4*B4*d3+s3)*B3*SG3*k) :
_-(((s4*B4*d3+s3)*B3*d2 + s2)*B2*SG3*k) :
_-((((s4*B4*d3+s3)*B3*d2 + s2)*B2*d1 + s1 )*B1*SG1*k) :
_*a1 : _-s1 :_*alpha : _+s1 : _*gam2 :
_*a2 : _-s2 : _*alpha : _+s2 : _*gam3 :
_*a3 : _-s3 : _*alpha : _+s3 : _*gam4 : _*a4 : _-s4 : _*alpha : _+s4;
}
with{
normFreq = (log10(freq) - log10(2)) / 3.0 - (1.0 / 3.0);
k = (17 - (normFreq^10)*9.7)*(Q - 0.707)/(25.0 - 0.707);
wd = 2*ma.PI*freq;
T = 1/ma.SR;
wa = (2/T)*tan(wd*T/2);
g = wa*T/2;
G4 = 0.5*g/(1 + g);
G3 = 0.5*g/(1 + g - 0.5*g*G4);
G2 = 0.5*g/(1 + g - 0.5*g*G3);
G1 = g/(1.0 + g - g*G2);
Gamma = G1*G2*G3*G4;
SG2 = G4*G3;
SG3 = G4;
SG4 = 1;
alpha = g/(1+g);
alpha0 = 1/(1+k*Gamma);
gam1 = 1+G1*G2;
gam2 = 1+G2*G3;
gam3 = 1+G3*G4;
gam4 = 1;
a3 = 0.5;
a4 = 0.5;
B2 = 1/(1+g-0.5*g*G3);
B3 = 1/(1+g-0.5*g*G4);
B4 = 1/(1+g);
d2 = 0.5*g;
d3 = 0.5*g;
};
q = hslider("[1]Q[symbol: q][abbrev: q][style:knob]", 1.0, 0.7072, 25.0, 0.01);
cutoff = hslider("[0]Cutoff frequency[symbol: cutoff][abbrev: cutoff][unit: hz][scale: log][style: knob]", 20000.0, 20.0, 20000, 0.1):si.smoo;
process = diodeLadder(cutoff, q);
|
16567998b4166ab58da55d22c932739ca9350d21946168b4c2aaa9e51065f321 | unicornsasfuel/satuverb | satuverb.dsp | import("stdfaust.lib");
//declare dattorro_rev author "Jakob Zerbian";
//declare dattorro_rev licence "MIT-style STK-4.3 license";
declare latency_samples "7679";
Q = .71;
stereo_wetdry(wet_percent, l1, r1, l2, r2) = l1 * wet_percent + l2 * (1-wet_percent), r1 * wet_percent + r2 * (1-wet_percent);
mod_dattorro_rev(pre_delay, bw, i_diff1, i_diff2, decay, d_diff1, d_diff2, damping, highpass_freq, lowpass_freq, peak_freq, peak_q, peak_gain, sat_drive, sat_wet, sat_postgain) =
si.bus(2) : + : *(0.5) : predelay : bw_filter : diffusion_network <: ((si.bus(4) :> renetwork) ~ ro.cross(2))
with {
// allpass using delay with fixed size
allpass_f(t, a) = (+ <: @(t),*(a)) ~ *(-a) : mem,_ : +;
// input pre-delay and diffusion
predelay = @(pre_delay);
bw_filter = *(bw) : +~(mem : *(1-bw));
diffusion_network = allpass_f(142, i_diff1) : allpass_f(107, i_diff1) : allpass_f(379, i_diff2) : allpass_f(277, i_diff2);
// reverb tail effects
do_highpass = fi.resonhp(highpass_freq, Q, 1);
do_lowpass = fi.resonlp(lowpass_freq, Q, 1);
do_bell = fi.peak_eq_cq(peak_gain,peak_freq,peak_q);
saturate = _ <: _ * (1-sat_wet) + (_ * sat_drive : aa.clip(-1,1) : aa.parabolic2 : *(sat_wet) : *(sat_postgain));
// reverb loop
renetwork = par(i, 2, block(i)) with {
d = (672, 908, 4453, 4217, 1800, 2656, 3720, 3163);
block(i) = allpass_f(ba.take(i+1, d),-d_diff1) : @(ba.take(i+3, d)) : damp :
saturate : do_highpass : do_lowpass : do_bell :
allpass_f(ba.take(i+5, d), d_diff2) : @(ba.take(i+5, d)) : *(decay)
with {
damp = *(1-damping) : +~*(damping) : *(decay);
};
};
};
// Reverb parameters
bandwidth = 1;//we want to shape this ourselves
df_1 = .75;
df_2 = .63;
decay_df_1 = .70;
decay_df_2 = .50;
damping = 0; //no damping, we want to do our own shaping
// EQ sliders
highpass_freq = vslider("hpfreq[unit:Hz]", 20, 20, 20000, 1);
lowpass_freq = vslider("lpfreq[unit:Hz]", 20000, 20, 20000, 1);
peak_freq = vslider("peakfreq[unit:Hz]", 1000, 20, 20000, 1);
peak_q = vslider("peakq", 50, 0, 100, 1) / 100;
peak_gain = vslider("peakgain[unit:dB]", 0, -20, 20, .1);
// Saturator sliders
sat_drive = vslider("drive[unit:dB]", 0, 0, 40, .1) : ba.db2linear;
sat_wet = vslider("satwet", 100, 0, 100, 1) / 100;
sat_postgain = vslider("postgain[unit:dB]", 0, -40, 0, .1) : ba.db2linear;
// Reverb sliders
effect_wet = hslider("reverbwet", 30, 0, 100, 1) / 100;
decay = hslider("decay", 50, 0, 100, 1) / 100;
pre_delay = hslider("predelay[unit:ms]", 0, 0, 1000, 1) / 1000 * ma.SR;
process = _,_ <: mod_dattorro_rev(pre_delay, bandwidth, df_1, df_2, decay, decay_df_1, decay_df_2, damping,
highpass_freq, lowpass_freq, peak_freq, peak_q, peak_gain,
sat_drive, sat_wet, sat_postgain), (_,_ : @(7679),@(7679)) :
stereo_wetdry(effect_wet);
| https://raw.githubusercontent.com/unicornsasfuel/satuverb/c650abdfebad0a646e3e6a0aabcdb0319d69bc96/satuverb.dsp | faust | declare dattorro_rev author "Jakob Zerbian";
declare dattorro_rev licence "MIT-style STK-4.3 license";
allpass using delay with fixed size
input pre-delay and diffusion
reverb tail effects
reverb loop
Reverb parameters
we want to shape this ourselves
no damping, we want to do our own shaping
EQ sliders
Saturator sliders
Reverb sliders
| import("stdfaust.lib");
declare latency_samples "7679";
Q = .71;
stereo_wetdry(wet_percent, l1, r1, l2, r2) = l1 * wet_percent + l2 * (1-wet_percent), r1 * wet_percent + r2 * (1-wet_percent);
mod_dattorro_rev(pre_delay, bw, i_diff1, i_diff2, decay, d_diff1, d_diff2, damping, highpass_freq, lowpass_freq, peak_freq, peak_q, peak_gain, sat_drive, sat_wet, sat_postgain) =
si.bus(2) : + : *(0.5) : predelay : bw_filter : diffusion_network <: ((si.bus(4) :> renetwork) ~ ro.cross(2))
with {
allpass_f(t, a) = (+ <: @(t),*(a)) ~ *(-a) : mem,_ : +;
predelay = @(pre_delay);
bw_filter = *(bw) : +~(mem : *(1-bw));
diffusion_network = allpass_f(142, i_diff1) : allpass_f(107, i_diff1) : allpass_f(379, i_diff2) : allpass_f(277, i_diff2);
do_highpass = fi.resonhp(highpass_freq, Q, 1);
do_lowpass = fi.resonlp(lowpass_freq, Q, 1);
do_bell = fi.peak_eq_cq(peak_gain,peak_freq,peak_q);
saturate = _ <: _ * (1-sat_wet) + (_ * sat_drive : aa.clip(-1,1) : aa.parabolic2 : *(sat_wet) : *(sat_postgain));
renetwork = par(i, 2, block(i)) with {
d = (672, 908, 4453, 4217, 1800, 2656, 3720, 3163);
block(i) = allpass_f(ba.take(i+1, d),-d_diff1) : @(ba.take(i+3, d)) : damp :
saturate : do_highpass : do_lowpass : do_bell :
allpass_f(ba.take(i+5, d), d_diff2) : @(ba.take(i+5, d)) : *(decay)
with {
damp = *(1-damping) : +~*(damping) : *(decay);
};
};
};
df_1 = .75;
df_2 = .63;
decay_df_1 = .70;
decay_df_2 = .50;
highpass_freq = vslider("hpfreq[unit:Hz]", 20, 20, 20000, 1);
lowpass_freq = vslider("lpfreq[unit:Hz]", 20000, 20, 20000, 1);
peak_freq = vslider("peakfreq[unit:Hz]", 1000, 20, 20000, 1);
peak_q = vslider("peakq", 50, 0, 100, 1) / 100;
peak_gain = vslider("peakgain[unit:dB]", 0, -20, 20, .1);
sat_drive = vslider("drive[unit:dB]", 0, 0, 40, .1) : ba.db2linear;
sat_wet = vslider("satwet", 100, 0, 100, 1) / 100;
sat_postgain = vslider("postgain[unit:dB]", 0, -40, 0, .1) : ba.db2linear;
effect_wet = hslider("reverbwet", 30, 0, 100, 1) / 100;
decay = hslider("decay", 50, 0, 100, 1) / 100;
pre_delay = hslider("predelay[unit:ms]", 0, 0, 1000, 1) / 1000 * ma.SR;
process = _,_ <: mod_dattorro_rev(pre_delay, bandwidth, df_1, df_2, decay, decay_df_1, decay_df_2, damping,
highpass_freq, lowpass_freq, peak_freq, peak_q, peak_gain,
sat_drive, sat_wet, sat_postgain), (_,_ : @(7679),@(7679)) :
stereo_wetdry(effect_wet);
|
730bd7349d0a66c375f48169f5e19b94aef1a115970cea231a055a98b8aef223 | HMaxime/CONDUCT | sine_synth.dsp | // tosc.dsp - test simple oscillator + MIDI bindings
import("stdfaust.lib");
process = g * a * os.oscrs(f*b) <: _,_;
a = hslider("gain [midi:ctrl 7]",1,0,1,0.001);
f = hslider("freq",392.0,200.0,450.0,0.01);
b = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.001));
g = button("gate");
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/SAM/sine_synth/sine_synth.dsp | faust | tosc.dsp - test simple oscillator + MIDI bindings | import("stdfaust.lib");
process = g * a * os.oscrs(f*b) <: _,_;
a = hslider("gain [midi:ctrl 7]",1,0,1,0.001);
f = hslider("freq",392.0,200.0,450.0,0.01);
b = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.001));
g = button("gate");
|
6511ff0b00a6fd5144757bfe32204251fbbdad5e9d6a23d732ad5aeaad296e6c | HMaxime/CONDUCT | AdditiveSynth_Analog.dsp | import("stdfaust.lib");
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Additive synthesizer, must be used with OSC message to program sound.
// It as 8 harmonics. Each have it's own volume envelope.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// ANALOG IMPLEMENTATION:
//
// ANALOG_0 : vol0 (volum of fundamental)
// ANALOG_1 : vol1
// ...
// ANALOG_7 : vol7
//
// OSC messages (see BELA console for precise adress)
// For each harmonics (%rang indicate harmonic number, starting at 0) :
// A%rang : Attack
// D%rang : Decay
// S%rang : Sustain
// R%rang : Release
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// GENERAL
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 10, 0.01);
// pitchwheel
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
gFreq = midifreq * bend;
partiel(rang) = os.oscrs(gFreq*(rang+1))*volume
with {
// UI
vol = hslider("vol%rang[BELA: ANALOG_%rang]", 1, 0, 1, 0.001);
a = 0.01 * hslider("A%rang", 1, 0, 400, 0.001);
d = 0.01 * hslider("D%rang", 1, 0, 400, 0.001);
s = hslider("S%rang", 1, 0, 1, 0.001);
r = 0.01 * hslider("R%rang", 1, 0, 800, 0.001);
volume = ((en.adsr(a,d,s,r,midigate))*vol) : max (0) : min (1);
};
process = par(i, 8, partiel(i)) :> / (8);
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/bela/AdditiveSynth_Analog.dsp | faust | /////////////////////////////////////////////////////////////////////////////////////////////////
Additive synthesizer, must be used with OSC message to program sound.
It as 8 harmonics. Each have it's own volume envelope.
/////////////////////////////////////////////////////////////////////////////////////////////////
ANALOG IMPLEMENTATION:
ANALOG_0 : vol0 (volum of fundamental)
ANALOG_1 : vol1
...
ANALOG_7 : vol7
OSC messages (see BELA console for precise adress)
For each harmonics (%rang indicate harmonic number, starting at 0) :
A%rang : Attack
D%rang : Decay
S%rang : Sustain
R%rang : Release
/////////////////////////////////////////////////////////////////////////////////////////////////
GENERAL
pitchwheel
UI | import("stdfaust.lib");
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 10, 0.01);
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
gFreq = midifreq * bend;
partiel(rang) = os.oscrs(gFreq*(rang+1))*volume
with {
vol = hslider("vol%rang[BELA: ANALOG_%rang]", 1, 0, 1, 0.001);
a = 0.01 * hslider("A%rang", 1, 0, 400, 0.001);
d = 0.01 * hslider("D%rang", 1, 0, 400, 0.001);
s = hslider("S%rang", 1, 0, 1, 0.001);
r = 0.01 * hslider("R%rang", 1, 0, 800, 0.001);
volume = ((en.adsr(a,d,s,r,midigate))*vol) : max (0) : min (1);
};
process = par(i, 8, partiel(i)) :> / (8);
|
ad9a985064d0227dd3507a988ccb81877ddaa3affc7babad0a9dc3622c994661 | HMaxime/CONDUCT | trumpet.dsp | //################################### trumpet.dsp #####################################
// A simple trumpet app... (for large screens).
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with `faust2smartkeyb`. For best results,
// we recommend to use the following parameters to compile it:
//
// ```
// faust2smartkeyb [-ios/-android] -effect reverb.dsp trumpet.dsp
// ```
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
import("stdfaust.lib");
declare interface "SmartKeyboard{
'Number of Keyboards':'5',
'Max Keyboard Polyphony':'1',
'Mono Mode':'1',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 4 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'77',
'Keyboard 1 - Lowest Key':'72',
'Keyboard 2 - Lowest Key':'67',
'Keyboard 3 - Lowest Key':'62',
'Keyboard 4 - Lowest Key':'57',
'Rounding Mode':'2',
'Keyboard 0 - Send Y':'1',
'Keyboard 1 - Send Y':'1',
'Keyboard 2 - Send Y':'1',
'Keyboard 3 - Send Y':'1',
'Keyboard 4 - Send Y':'1',
}";
// standard parameters
f = hslider("freq",300,50,2000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.001)) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
s = hslider("sustain[midi:ctrl 64]",0,0,1,1); // for sustain pedal
t = button("gate");
y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo;
// fomating parameters
gate = t+s : min(1);
freq = f*bend;
cutoff = y*4000+50;
envelope = gate*gain : si.smoo;
process = os.sawtooth(freq)*envelope : fi.lowpass(3,cutoff) <: _,_;
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/smartKeyboard/trumpet.dsp | faust | ################################### trumpet.dsp #####################################
A simple trumpet app... (for large screens).
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with `faust2smartkeyb`. For best results,
we recommend to use the following parameters to compile it:
```
faust2smartkeyb [-ios/-android] -effect reverb.dsp trumpet.dsp
```
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
standard parameters
for sustain pedal
fomating parameters |
import("stdfaust.lib");
declare interface "SmartKeyboard{
'Number of Keyboards':'5',
'Max Keyboard Polyphony':'1',
'Mono Mode':'1',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 4 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'77',
'Keyboard 1 - Lowest Key':'72',
'Keyboard 2 - Lowest Key':'67',
'Keyboard 3 - Lowest Key':'62',
'Keyboard 4 - Lowest Key':'57',
'Rounding Mode':'2',
'Keyboard 0 - Send Y':'1',
'Keyboard 1 - Send Y':'1',
'Keyboard 2 - Send Y':'1',
'Keyboard 3 - Send Y':'1',
'Keyboard 4 - Send Y':'1',
}";
f = hslider("freq",300,50,2000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.001)) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
t = button("gate");
y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo;
gate = t+s : min(1);
freq = f*bend;
cutoff = y*4000+50;
envelope = gate*gain : si.smoo;
process = os.sawtooth(freq)*envelope : fi.lowpass(3,cutoff) <: _,_;
|
9bd4608fedf3414e8a6b48a4093dcd036dbbc5cfd379145eb54fb800b49de856 | HMaxime/CONDUCT | WoodenKeyboard.dsp | process = vgroup("WoodenKeyboard",environment{declare name "WoodenKeyboard";
declare author "ER";
import("stdfaust.lib");
instrument = library("instruments.lib");
//d'apres les enveloppes de John Chowning utilisees dans Turenas
/* =============== DESCRIPTION ================= :
- Wooden keyboard
- Head = Echo/Silence
- Rocking = striking across the keyboard from low frequencies (Left) to high frequencies (Right)
- Back + Rotation = long notes
- Front + Rotation = short notes
*/
//--------------------------------- INSTRUMENT ---------------------------------
marimkey(n) = os.osc(octave(n)) * (0.1)
*(trigger(n+1) : enveloppe : fi.lowpass(1,500));
process = hand <: par(i, 10, marimkey(i)) :> echo *(3);
//---------------------------------- UI ----------------------------------------
hand = hslider("[1]instrumentHand[acc:1 0 -10 0 10]", 5, 0, 10, 1);
hight = hslider("[2]hight[acc:0 1 -10 0 30]", 5, 1, 10, 0.3) : si.smooth(0.99):min(12):max(1);
envsize = hslider("[3]noteDuration[unit:s][acc:2 0 -10 0 10]", 0.2, 0.1, 0.5, 0.01) * (ma.SR) : si.smooth(0.999): min(44100) : max(4410) : int;
feedback = hslider("[4]echoIntensity[acc:1 1 -10 0 15]", 0.1, 0.01, 0.9, 0.01):si.smooth(0.999):min(0.9):max(0.01);
//---------------------------------- FREQUENCY TABLE ---------------------------
freq(0) = 164.81;
freq(1) = 174.61;
freq(d) = freq(d-2);
octave(d) = freq(d)* hight;
//------------------------------------ TRIGGER ---------------------------------
upfront(x) = x>x';
counter(g)= (+(1):*(1-g))~_;
position(a,x) = abs(x - a) < 0.5;
trigger(p) = position(p) : upfront : counter;
//------------------------------------ ECHO ------------------------------------
echo = +~(@(echoDelay)*(feedback));
echoDelay = 8096;
//----------------------------------- ENVELOPPES ------------------------------
/* envelope */
enveloppe = tabchowning.f9;
/* Tables Chowning */
tabchowning = environment
{
corres(x) = int(x*envsize/1024);
// f9 0 1024 7 1 248 0.25 259 0.1 259 0.05 258 0
f9 = ba.bpf.start(0, 0):
ba.bpf.point(corres(2), 0.25):
ba.bpf.point(corres(4), 0.5):
ba.bpf.point(corres(10), 0.9):
ba.bpf.point(corres(248), 0.25):
ba.bpf.point(corres(507), 0.1):
ba.bpf.point(corres(766), 0.05):
ba.bpf.end(corres(1024), 0);
};
}.process);
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/example_romann/WoodenKeyboard.dsp | faust | d'apres les enveloppes de John Chowning utilisees dans Turenas
=============== DESCRIPTION ================= :
- Wooden keyboard
- Head = Echo/Silence
- Rocking = striking across the keyboard from low frequencies (Left) to high frequencies (Right)
- Back + Rotation = long notes
- Front + Rotation = short notes
--------------------------------- INSTRUMENT ---------------------------------
---------------------------------- UI ----------------------------------------
---------------------------------- FREQUENCY TABLE ---------------------------
------------------------------------ TRIGGER ---------------------------------
------------------------------------ ECHO ------------------------------------
----------------------------------- ENVELOPPES ------------------------------
envelope
Tables Chowning
f9 0 1024 7 1 248 0.25 259 0.1 259 0.05 258 0 | process = vgroup("WoodenKeyboard",environment{declare name "WoodenKeyboard";
declare author "ER";
import("stdfaust.lib");
instrument = library("instruments.lib");
marimkey(n) = os.osc(octave(n)) * (0.1)
*(trigger(n+1) : enveloppe : fi.lowpass(1,500));
process = hand <: par(i, 10, marimkey(i)) :> echo *(3);
hand = hslider("[1]instrumentHand[acc:1 0 -10 0 10]", 5, 0, 10, 1);
hight = hslider("[2]hight[acc:0 1 -10 0 30]", 5, 1, 10, 0.3) : si.smooth(0.99):min(12):max(1);
envsize = hslider("[3]noteDuration[unit:s][acc:2 0 -10 0 10]", 0.2, 0.1, 0.5, 0.01) * (ma.SR) : si.smooth(0.999): min(44100) : max(4410) : int;
feedback = hslider("[4]echoIntensity[acc:1 1 -10 0 15]", 0.1, 0.01, 0.9, 0.01):si.smooth(0.999):min(0.9):max(0.01);
freq(0) = 164.81;
freq(1) = 174.61;
freq(d) = freq(d-2);
octave(d) = freq(d)* hight;
upfront(x) = x>x';
counter(g)= (+(1):*(1-g))~_;
position(a,x) = abs(x - a) < 0.5;
trigger(p) = position(p) : upfront : counter;
echo = +~(@(echoDelay)*(feedback));
echoDelay = 8096;
enveloppe = tabchowning.f9;
tabchowning = environment
{
corres(x) = int(x*envsize/1024);
f9 = ba.bpf.start(0, 0):
ba.bpf.point(corres(2), 0.25):
ba.bpf.point(corres(4), 0.5):
ba.bpf.point(corres(10), 0.9):
ba.bpf.point(corres(248), 0.25):
ba.bpf.point(corres(507), 0.1):
ba.bpf.point(corres(766), 0.05):
ba.bpf.end(corres(1024), 0);
};
}.process);
|
9f383217ab19e9fc0175de2496af2f52fef6f2c773b5152f444f56fbb358a8bc | HMaxime/CONDUCT | WaveSynth_Analog.dsp | import("stdfaust.lib");
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables.
// It's possible to add more tables step.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// ANALOG IMPLEMENTATION:
//
// ANALOG_0 : Wave travelling
// ANALOG_1 : LFO Frequency
// ANALOG_2 : LFO Depth (wave travel modulation)
// ANALOG_3 : Release
//
// MIDI:
// CC 73 : Attack
// CC 76 : Decay
// CC 77 : Sustain
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// GENERAL
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 1, 0.01);
waveTravel = hslider("waveTravel[BELA: ANALOG_0]",0,0,1,0.01);
// pitchwheel
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
gFreq = midifreq * bend;
// LFO
lfoDepth = hslider("lfoDepth[BELA: ANALOG_2]",0,0.,1,0.001):si.smoo;
lfoFreq = hslider("lfoFreq[BELA: ANALOG_1]",0.1,0.01,10,0.001):si.smoo;
moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0);
volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01);
volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01);
volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01);
volR = hslider("R[BELA: ANALOG_3]",0.8,0.01,8,0.01);
envelop = en.adsre(volA,volD,volS,volR,midigate);
// Out amplitude
vol = envelop * midigain;
WF(tablesize, rang) = abs((fmod((1+(float(ba.time)*rang)/float(tablesize)), 4.0))-2) -1.;
// 4 WF maxi with this version:
scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0)
with {
coef = 3.14159 * ((nb-1)*0.5);
soustraction = select2( position>0, 0, (position/(nb-1)) );
};
wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1)))
+ (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3)))
with {
tablesize = 1024;
wt1 = WF(tablesize, 16);
wt2 = WF(tablesize, 8);
wt3 = WF(tablesize, 6);
wt4 = WF(tablesize, 4);
faze = int(os.phasor(tablesize,freq));
};
process = wfosc(gFreq) * vol;
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/bela/WaveSynth_Analog.dsp | faust | /////////////////////////////////////////////////////////////////////////////////////////////////
Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables.
It's possible to add more tables step.
/////////////////////////////////////////////////////////////////////////////////////////////////
ANALOG IMPLEMENTATION:
ANALOG_0 : Wave travelling
ANALOG_1 : LFO Frequency
ANALOG_2 : LFO Depth (wave travel modulation)
ANALOG_3 : Release
MIDI:
CC 73 : Attack
CC 76 : Decay
CC 77 : Sustain
/////////////////////////////////////////////////////////////////////////////////////////////////
GENERAL
pitchwheel
LFO
Out amplitude
4 WF maxi with this version: | import("stdfaust.lib");
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 1, 0.01);
waveTravel = hslider("waveTravel[BELA: ANALOG_0]",0,0,1,0.01);
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
gFreq = midifreq * bend;
lfoDepth = hslider("lfoDepth[BELA: ANALOG_2]",0,0.,1,0.001):si.smoo;
lfoFreq = hslider("lfoFreq[BELA: ANALOG_1]",0.1,0.01,10,0.001):si.smoo;
moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0);
volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01);
volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01);
volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01);
volR = hslider("R[BELA: ANALOG_3]",0.8,0.01,8,0.01);
envelop = en.adsre(volA,volD,volS,volR,midigate);
vol = envelop * midigain;
WF(tablesize, rang) = abs((fmod((1+(float(ba.time)*rang)/float(tablesize)), 4.0))-2) -1.;
scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0)
with {
coef = 3.14159 * ((nb-1)*0.5);
soustraction = select2( position>0, 0, (position/(nb-1)) );
};
wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1)))
+ (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3)))
with {
tablesize = 1024;
wt1 = WF(tablesize, 16);
wt2 = WF(tablesize, 8);
wt3 = WF(tablesize, 6);
wt4 = WF(tablesize, 4);
faze = int(os.phasor(tablesize,freq));
};
process = wfosc(gFreq) * vol;
|
cb0b73d082bdf436eea65e995cfc064b33150e5caa1ac85450aef0e47e41c9da | HMaxime/CONDUCT | simpleFX_Analog.dsp | import("stdfaust.lib");
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Simple FX chain build for a mono synthesizer.
// It control general volume and pan.
// FX Chaine is:
// Drive
// Flanger
// Reverberation
//
// This version use ANALOG IN to controle some of the parameters.
// Other parameters continue to be available by MIDI or OSC.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// ANALOG IMPLEMENTATION:
//
// ANALOG_4 : Distortion Drive
// ANALOG_5 : Flanger Dry/Wet
// ANALOG_6 : Reverberation Dry/Wet
// ANALOG_7 : Reverberation Room size
//
// MIDI:
// CC 7 : Volume
// CC 10 : Pan
//
// CC 13 : Flanger Delay
// CC 13 : Flanger Delay
// CC 94 : Flanger Feedback
//
// CC 95 : Reverberation Damp
// CC 90: Reverberation Stereo Width
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// VOLUME:
vol = hslider("volume[midi:ctrl 7]",1,0,1,0.001);// Should be 7 according to MIDI CC norm.
// EFFECTS /////////////////////////////////////////////
drive = hslider ("drive[BELA: ANALOG_4]",0.3,0,1,0.001);
// Flanger
curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001);
fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001);
fldw = hslider("dryWetFlang[BELA: ANALOG_5]",0.5,0,1,0.001);
flanger = efx
with {
fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10);
efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw);
};
// Panoramic:
panno = _ : sp.panner(hslider ("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_;
// REVERB (from freeverb_demo)
reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain :
re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)),
*(1-g), *(1-g) :> _,_
with {
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
origSR = 44100;
damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR;
combfeed = vslider("RoomSize[BELA: ANALOG_7]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom;
spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR;
g = vslider("dryWetReverb[BELA: ANALOG_6]", 0.4, 0, 1, 0.001);
// (g = Dry/Wet)
};
// Dry-Wet (from C. LEBRETON)
dry_wet(dw,x,y) = wet*y + dry*x
with {
wet = 0.5*(dw+1.0);
dry = 1.0-wet;
};
// ALL
effets = _ *(vol) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb;
process = effets;
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/bela/simpleFX_Analog.dsp | faust |
/////////////////////////////////////////////////////////////////////////////////////////////////
Simple FX chain build for a mono synthesizer.
It control general volume and pan.
FX Chaine is:
Drive
Flanger
Reverberation
This version use ANALOG IN to controle some of the parameters.
Other parameters continue to be available by MIDI or OSC.
/////////////////////////////////////////////////////////////////////////////////////////////////
ANALOG IMPLEMENTATION:
ANALOG_4 : Distortion Drive
ANALOG_5 : Flanger Dry/Wet
ANALOG_6 : Reverberation Dry/Wet
ANALOG_7 : Reverberation Room size
MIDI:
CC 7 : Volume
CC 10 : Pan
CC 13 : Flanger Delay
CC 13 : Flanger Delay
CC 94 : Flanger Feedback
CC 95 : Reverberation Damp
CC 90: Reverberation Stereo Width
/////////////////////////////////////////////////////////////////////////////////////////////////
VOLUME:
Should be 7 according to MIDI CC norm.
EFFECTS /////////////////////////////////////////////
Flanger
Panoramic:
REVERB (from freeverb_demo)
(g = Dry/Wet)
Dry-Wet (from C. LEBRETON)
ALL | import("stdfaust.lib");
drive = hslider ("drive[BELA: ANALOG_4]",0.3,0,1,0.001);
curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001);
fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001);
fldw = hslider("dryWetFlang[BELA: ANALOG_5]",0.5,0,1,0.001);
flanger = efx
with {
fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10);
efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw);
};
panno = _ : sp.panner(hslider ("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_;
reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain :
re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)),
*(1-g), *(1-g) :> _,_
with {
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
origSR = 44100;
damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR;
combfeed = vslider("RoomSize[BELA: ANALOG_7]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom;
spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR;
g = vslider("dryWetReverb[BELA: ANALOG_6]", 0.4, 0, 1, 0.001);
};
dry_wet(dw,x,y) = wet*y + dry*x
with {
wet = 0.5*(dw+1.0);
dry = 1.0-wet;
};
effets = _ *(vol) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb;
process = effets;
|
9aba3425fd6c83e900d5a091d0ba60ffcf48acc70e7c4716b78261258fd5e4a8 | HMaxime/CONDUCT | crossDelay2.dsp | import("stdfaust.lib");
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Stereo Delay with feedback and crossfeedback (L to R and R to L feedback).
// And pitch shifting on feedback.
// A pre-delay without feedback is added for a wider stereo effect.
//
// Designed to use the Analog Input for parameters controls.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// ANALOG IN:
// ANALOG 0 : Pre-Delay L
// ANALOG 1 : Pre-Delay R
// ANALOG 2 : Delay L
// ANALOG 3 : Delay R
// ANALOG 4 : Cross feedback
// ANALOG 5 : Feedback
// ANALOG 6 : Pitchshifter L
// ANALOG 7 : Pitchshifter R
//
// Available by OSC : (see BELA console for precise adress)
// Feedback filter:
// crossLF : Crossfeedback Lowpass
// crossHF : Crossfeedback Highpass
// feedbLF : Feedback Lowpass
// feedbHF : Feedback Highpass
//
///////////////////////////////////////////////////////////////////////////////////////////////////
preDelL = ba.sec2samp(hslider("preDelL[BELA: ANALOG_0]", 1,0,2,0.001)):si.smoo;
preDelR = ba.sec2samp(hslider("preDelR[BELA: ANALOG_1]", 1,0,2,0.001)):si.smoo;
delL = ba.sec2samp(hslider("delL[BELA: ANALOG_2]", 1,0,2,0.001)):si.smoo;
delR = ba.sec2samp(hslider("delR[BELA: ANALOG_3]", 1,0,2,0.001)):si.smoo;
crossLF = hslider("crossLF", 12000, 20, 20000, 0.001);
crossHF = hslider("crossHF", 60, 20, 20000, 0.001);
feedbLF = hslider("feedbLF", 12000, 20, 20000, 0.001);
feedbHF = hslider("feedbHF", 60, 20, 20000, 0.001);
CrossFeedb = hslider("CrossFeedb[BELA: ANALOG_4]", 0.0, 0., 1, 0.001):si.smoo;
feedback = hslider("feedback[BELA: ANALOG_5]", 0.0, 0., 1, 0.001):si.smoo;
pitchL = hslider("shiftL[BELA: ANALOG_6]", 0,-12,12,0.001):si.smoo;
pitchR = hslider("shiftR[BELA: ANALOG_7]", 0,-12,12,0.001):si.smoo;
routeur(a,b,c,d) = ((a*CrossFeedb):fi.lowpass(2,crossLF):fi.highpass(2,crossHF))+((b*feedback):fi.lowpass(2,feedbLF):fi.highpass(2,feedbHF))+c,
((b*CrossFeedb):fi.lowpass(2,crossLF):fi.highpass(2,crossHF))+((a*feedback):fi.lowpass(2,feedbLF):fi.highpass(2,feedbHF))+d;
process = (de.sdelay(65536, 512,preDelL),de.sdelay(65536, 512,preDelR)):(routeur : de.sdelay(65536, 512,delL), de.sdelay(65536, 512,delR))~(ef.transpose(512, 256, pitchL), ef.transpose(512, 256, pitchR));
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/bela/crossDelay2.dsp | faust | /////////////////////////////////////////////////////////////////////////////////////////////////
Stereo Delay with feedback and crossfeedback (L to R and R to L feedback).
And pitch shifting on feedback.
A pre-delay without feedback is added for a wider stereo effect.
Designed to use the Analog Input for parameters controls.
/////////////////////////////////////////////////////////////////////////////////////////////////
ANALOG IN:
ANALOG 0 : Pre-Delay L
ANALOG 1 : Pre-Delay R
ANALOG 2 : Delay L
ANALOG 3 : Delay R
ANALOG 4 : Cross feedback
ANALOG 5 : Feedback
ANALOG 6 : Pitchshifter L
ANALOG 7 : Pitchshifter R
Available by OSC : (see BELA console for precise adress)
Feedback filter:
crossLF : Crossfeedback Lowpass
crossHF : Crossfeedback Highpass
feedbLF : Feedback Lowpass
feedbHF : Feedback Highpass
///////////////////////////////////////////////////////////////////////////////////////////////// | import("stdfaust.lib");
preDelL = ba.sec2samp(hslider("preDelL[BELA: ANALOG_0]", 1,0,2,0.001)):si.smoo;
preDelR = ba.sec2samp(hslider("preDelR[BELA: ANALOG_1]", 1,0,2,0.001)):si.smoo;
delL = ba.sec2samp(hslider("delL[BELA: ANALOG_2]", 1,0,2,0.001)):si.smoo;
delR = ba.sec2samp(hslider("delR[BELA: ANALOG_3]", 1,0,2,0.001)):si.smoo;
crossLF = hslider("crossLF", 12000, 20, 20000, 0.001);
crossHF = hslider("crossHF", 60, 20, 20000, 0.001);
feedbLF = hslider("feedbLF", 12000, 20, 20000, 0.001);
feedbHF = hslider("feedbHF", 60, 20, 20000, 0.001);
CrossFeedb = hslider("CrossFeedb[BELA: ANALOG_4]", 0.0, 0., 1, 0.001):si.smoo;
feedback = hslider("feedback[BELA: ANALOG_5]", 0.0, 0., 1, 0.001):si.smoo;
pitchL = hslider("shiftL[BELA: ANALOG_6]", 0,-12,12,0.001):si.smoo;
pitchR = hslider("shiftR[BELA: ANALOG_7]", 0,-12,12,0.001):si.smoo;
routeur(a,b,c,d) = ((a*CrossFeedb):fi.lowpass(2,crossLF):fi.highpass(2,crossHF))+((b*feedback):fi.lowpass(2,feedbLF):fi.highpass(2,feedbHF))+c,
((b*CrossFeedb):fi.lowpass(2,crossLF):fi.highpass(2,crossHF))+((a*feedback):fi.lowpass(2,feedbLF):fi.highpass(2,feedbHF))+d;
process = (de.sdelay(65536, 512,preDelL),de.sdelay(65536, 512,preDelR)):(routeur : de.sdelay(65536, 512,delL), de.sdelay(65536, 512,delR))~(ef.transpose(512, 256, pitchL), ef.transpose(512, 256, pitchR));
|
84a241359aa20268decc1d6037ca50f6372c91b4370dc643f91e80e91d77b027 | HMaxime/CONDUCT | simpleSynth.dsp | import("stdfaust.lib");
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// A very simple subtractive synthesizer with 1 VCO 1 VCF.
// The VCO Waveform is variable between Saw and Square
// The frequency is modulated by an LFO
// The envelope control volum and filter frequency
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// MIDI IMPLEMENTATION:
//
// CC 70 : waveform (Saw to square)
// CC 71 : Filter resonance (Q)
// CC 74 : Filter Cutoff frequency
// CC 79 : Filter keyboard tracking (0 to X2, default 1)
// CC 75 : Filter Envelope Modulation
//
// Envelope
// CC 73 : Attack
// CC 76 : Decay
// CC 77 : Sustain
// CC 72 : Release
//
// CC 78 : LFO frequency (0.001Hz to 10Hz)
// CC 1 : LFO Amplitude (Modulation)
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// HUI //////////////////////////////////////////////////
// Keyboard
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 0.5, 0.01);// MIDI KEYBOARD
// pitchwheel
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
// VCO
wfFade = hslider("waveform[midi:ctrl 70]",0.5,0,1,0.001):si.smoo;
// VCF
res = hslider("resonnance[midi:ctrl 71]",0.5,0,1,0.001):si.smoo;
fr = hslider("fc[midi:ctrl 74]", 15, 15, 12000, 0.001):si.smoo;
track = hslider("tracking[midi:ctrl 79]", 1, 0, 2, 0.001);
envMod = hslider("envMod[midi:ctrl 75]",50,0,100,0.01):si.smoo;
// ENV
att = 0.01 * (hslider("attack[midi:ctrl 73]",0.1,0.1,400,0.001));
dec = 0.01 * (hslider("decay[midi:ctrl 76]",60,0.1,400,0.001));
sust = hslider("sustain[midi:ctrl 77]",0.1,0,1,0.001);
rel = 0.01 * (hslider("release[midi:ctrl 72]",100,0.1,400,0.001));
// LFO
lfoFreq = hslider("lfoFreq[midi:ctrl 78]",6,0.001,10,0.001):si.smoo;
modwheel = hslider("modwheel[midi:ctrl 1]",0,0,0.5,0.001):si.smoo;
// PROCESS /////////////////////////////////////////////
allfreq = (midifreq * bend) + LFO;
// VCF
cutoff = ((allfreq * track) + fr + (envMod * midigain * env)) : min(ma.SR/8);
// VCO
oscillo(f) = (os.sawtooth(f)*(1-wfFade))+(os.square(f)*wfFade);
// VCA
volume = midigain * env;
// Enveloppe
env = en.adsre(att,dec,sust,rel,midigate);
// LFO
LFO = os.lf_triangle(lfoFreq)*modwheel*10;
// SYNTH ////////////////////////////////////////////////
synth = (oscillo(allfreq) :ve.moog_vcf(res,cutoff)) * volume;
// PROCESS /////////////////////////////////////////////
process = synth;
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/bela/simpleSynth.dsp | faust | /////////////////////////////////////////////////////////////////////////////////////////////////
A very simple subtractive synthesizer with 1 VCO 1 VCF.
The VCO Waveform is variable between Saw and Square
The frequency is modulated by an LFO
The envelope control volum and filter frequency
/////////////////////////////////////////////////////////////////////////////////////////////////
MIDI IMPLEMENTATION:
CC 70 : waveform (Saw to square)
CC 71 : Filter resonance (Q)
CC 74 : Filter Cutoff frequency
CC 79 : Filter keyboard tracking (0 to X2, default 1)
CC 75 : Filter Envelope Modulation
Envelope
CC 73 : Attack
CC 76 : Decay
CC 77 : Sustain
CC 72 : Release
CC 78 : LFO frequency (0.001Hz to 10Hz)
CC 1 : LFO Amplitude (Modulation)
/////////////////////////////////////////////////////////////////////////////////////////////////
HUI //////////////////////////////////////////////////
Keyboard
MIDI KEYBOARD
pitchwheel
VCO
VCF
ENV
LFO
PROCESS /////////////////////////////////////////////
VCF
VCO
VCA
Enveloppe
LFO
SYNTH ////////////////////////////////////////////////
PROCESS ///////////////////////////////////////////// | import("stdfaust.lib");
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
wfFade = hslider("waveform[midi:ctrl 70]",0.5,0,1,0.001):si.smoo;
res = hslider("resonnance[midi:ctrl 71]",0.5,0,1,0.001):si.smoo;
fr = hslider("fc[midi:ctrl 74]", 15, 15, 12000, 0.001):si.smoo;
track = hslider("tracking[midi:ctrl 79]", 1, 0, 2, 0.001);
envMod = hslider("envMod[midi:ctrl 75]",50,0,100,0.01):si.smoo;
att = 0.01 * (hslider("attack[midi:ctrl 73]",0.1,0.1,400,0.001));
dec = 0.01 * (hslider("decay[midi:ctrl 76]",60,0.1,400,0.001));
sust = hslider("sustain[midi:ctrl 77]",0.1,0,1,0.001);
rel = 0.01 * (hslider("release[midi:ctrl 72]",100,0.1,400,0.001));
lfoFreq = hslider("lfoFreq[midi:ctrl 78]",6,0.001,10,0.001):si.smoo;
modwheel = hslider("modwheel[midi:ctrl 1]",0,0,0.5,0.001):si.smoo;
allfreq = (midifreq * bend) + LFO;
cutoff = ((allfreq * track) + fr + (envMod * midigain * env)) : min(ma.SR/8);
oscillo(f) = (os.sawtooth(f)*(1-wfFade))+(os.square(f)*wfFade);
volume = midigain * env;
env = en.adsre(att,dec,sust,rel,midigate);
LFO = os.lf_triangle(lfoFreq)*modwheel*10;
synth = (oscillo(allfreq) :ve.moog_vcf(res,cutoff)) * volume;
process = synth;
|
2527a6762ebbc572b5573581ac8a4a33ccace2e4ad7ad415922c85fd298f91a1 | HMaxime/CONDUCT | midiOnly.dsp | //################################### midiOnly.dsp ######################################
// Faust instrument specifically designed for `faust2smartkeyb` implementing a MIDI
// controllable app where the mobile device's touch screen is used to control
// specific parameters of the synth continuously using two separate X/Y control surfaces.
//
// ## `SmartKeyboard` Use Strategy
//
// The `SmartKeyboard` configuration for this instrument consists in a single keyboard
// with two keys. Each key implements a control surface. `Piano Keyboard` mode is
// disabled so that key names are not displayed and that keys don't change color when
// touched. Finally, `Send Freq` is set to 0 so that new voices are not allocated by
// the touch screen and that the `freq` and `bend` parameters are not computed.
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with `faust2smartkeyb`. For best results,
// we recommend to use the following parameters to compile it:
//
// ```
// faust2smartkeyb [-ios/-android] -effect reverb.dsp midiOnly.dsp
// ```
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
// Interface with 4 polyphnic keyboards of 13 keys with the same config
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Keyboard 0 - Number of Keys':'2',
'Keyboard 0 - Send Freq':'0',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 0 - Static Mode':'1',
'Keyboard 0 - Send Key X':'1',
'Keyboard 0 - Key 0 - Label':'Mod Index',
'Keyboard 0 - Key 1 - Label':'Mod Freq'
}";
import("stdfaust.lib");
f = hslider("freq",300,50,2000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.001)) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
key = hslider("key",0,0,1,1) : int;
kb0k0x = hslider("kb0k0x[midi:ctrl 1]",0.5,0,1,0.01) : si.smoo;
kb0k1x = hslider("kb0k1x[midi:ctrl 1]",0.5,0,1,0.01) : si.smoo;
s = hslider("sustain[midi:ctrl 64]",0,0,1,1);
t = button("gate");
// fomating parameters
gate = t+s : min(1);
freq = f*bend;
index = kb0k0x*1000;
modFreqRatio = kb0k1x;
envelope = gain*gate : si.smoo;
process = sy.fm((freq,freq + freq*modFreqRatio),index*envelope)*envelope <: _,_;
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/smartKeyboard/midiOnly.dsp | faust | ################################### midiOnly.dsp ######################################
Faust instrument specifically designed for `faust2smartkeyb` implementing a MIDI
controllable app where the mobile device's touch screen is used to control
specific parameters of the synth continuously using two separate X/Y control surfaces.
## `SmartKeyboard` Use Strategy
The `SmartKeyboard` configuration for this instrument consists in a single keyboard
with two keys. Each key implements a control surface. `Piano Keyboard` mode is
disabled so that key names are not displayed and that keys don't change color when
touched. Finally, `Send Freq` is set to 0 so that new voices are not allocated by
the touch screen and that the `freq` and `bend` parameters are not computed.
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with `faust2smartkeyb`. For best results,
we recommend to use the following parameters to compile it:
```
faust2smartkeyb [-ios/-android] -effect reverb.dsp midiOnly.dsp
```
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
Interface with 4 polyphnic keyboards of 13 keys with the same config
fomating parameters |
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Keyboard 0 - Number of Keys':'2',
'Keyboard 0 - Send Freq':'0',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 0 - Static Mode':'1',
'Keyboard 0 - Send Key X':'1',
'Keyboard 0 - Key 0 - Label':'Mod Index',
'Keyboard 0 - Key 1 - Label':'Mod Freq'
}";
import("stdfaust.lib");
f = hslider("freq",300,50,2000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.001)) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
key = hslider("key",0,0,1,1) : int;
kb0k0x = hslider("kb0k0x[midi:ctrl 1]",0.5,0,1,0.01) : si.smoo;
kb0k1x = hslider("kb0k1x[midi:ctrl 1]",0.5,0,1,0.01) : si.smoo;
s = hslider("sustain[midi:ctrl 64]",0,0,1,1);
t = button("gate");
gate = t+s : min(1);
freq = f*bend;
index = kb0k0x*1000;
modFreqRatio = kb0k1x;
envelope = gain*gate : si.smoo;
process = sy.fm((freq,freq + freq*modFreqRatio),index*envelope)*envelope <: _,_;
|
356225e5e1dedc0f1468a9bf6ee2f1bbf75d928dbc37b4b13b59a0f58ef4a7db | HMaxime/CONDUCT | multiSynth.dsp | //################################### multiSynth.dsp ######################################
// Faust instrument specifically designed for `faust2smartkeyb` where 4 keyboards
// are used to control 4 independent synths.
//
// ## `SmartKeyboard` Use Strategy
//
// The `SmartKeyboard` configuration is relatively simple for this example and
// only consists in four polyphonic keyboards in parallel. The `keyboard` standard
// parameter is used to activate specific elements of the synthesizer.
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with `faust2smartkeyb`. For best results,
// we recommend to use the following parameters to compile it:
//
// ```
// faust2smartkeyb [-ios/-android] -effect reverb.dsp multiSynth.dsp
// ```
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
// Interface with 4 polyphnic keyboards of 13 keys with the same config
declare interface "SmartKeyboard{
'Number of Keyboards':'4',
'Rounding Mode':'2',
'Inter-Keyboard Slide':'0',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'60',
'Keyboard 1 - Lowest Key':'60',
'Keyboard 2 - Lowest Key':'60',
'Keyboard 3 - Lowest Key':'60',
'Keyboard 0 - Send Y':'1',
'Keyboard 1 - Send Y':'1',
'Keyboard 2 - Send Y':'1',
'Keyboard 3 - Send Y':'1'
}";
import("stdfaust.lib");
// standard parameters
f = hslider("freq",300,50,2000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.001)) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
s = hslider("sustain[midi:ctrl 64]",0,0,1,1); // for sustain pedal
t = button("gate");
y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo;
keyboard = hslider("keyboard",0,0,3,1) : int;
// fomating parameters
gate = t+s : min(1);
freq = f*bend;
cutoff = y*4000+50;
// oscillators
oscilators(0) = os.sawtooth(freq);
oscilators(1) = os.triangle(freq);
oscilators(2) = os.square(freq);
oscilators(3) = os.osc(freq);
// oscs are selected in function of the current keyboard
synths = par(i,4,select2(keyboard == i,0,oscilators(i))) :> fi.lowpass(3,cutoff) : *(envelope)
with{
envelope = gate*gain : si.smoo;
};
process = synths <: _,_;
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/smartKeyboard/multiSynth.dsp | faust | ################################### multiSynth.dsp ######################################
Faust instrument specifically designed for `faust2smartkeyb` where 4 keyboards
are used to control 4 independent synths.
## `SmartKeyboard` Use Strategy
The `SmartKeyboard` configuration is relatively simple for this example and
only consists in four polyphonic keyboards in parallel. The `keyboard` standard
parameter is used to activate specific elements of the synthesizer.
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with `faust2smartkeyb`. For best results,
we recommend to use the following parameters to compile it:
```
faust2smartkeyb [-ios/-android] -effect reverb.dsp multiSynth.dsp
```
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
Interface with 4 polyphnic keyboards of 13 keys with the same config
standard parameters
for sustain pedal
fomating parameters
oscillators
oscs are selected in function of the current keyboard |
declare interface "SmartKeyboard{
'Number of Keyboards':'4',
'Rounding Mode':'2',
'Inter-Keyboard Slide':'0',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'60',
'Keyboard 1 - Lowest Key':'60',
'Keyboard 2 - Lowest Key':'60',
'Keyboard 3 - Lowest Key':'60',
'Keyboard 0 - Send Y':'1',
'Keyboard 1 - Send Y':'1',
'Keyboard 2 - Send Y':'1',
'Keyboard 3 - Send Y':'1'
}";
import("stdfaust.lib");
f = hslider("freq",300,50,2000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.001)) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
t = button("gate");
y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo;
keyboard = hslider("keyboard",0,0,3,1) : int;
gate = t+s : min(1);
freq = f*bend;
cutoff = y*4000+50;
oscilators(0) = os.sawtooth(freq);
oscilators(1) = os.triangle(freq);
oscilators(2) = os.square(freq);
oscilators(3) = os.osc(freq);
synths = par(i,4,select2(keyboard == i,0,oscilators(i))) :> fi.lowpass(3,cutoff) : *(envelope)
with{
envelope = gate*gain : si.smoo;
};
process = synths <: _,_;
|
ecb66cceb482db66750504aab40957735d722d60d26d5ea58e86d7ba494c7801 | HMaxime/CONDUCT | WaveSynth_FX_Analog.dsp | import("stdfaust.lib");
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables.
// It's possible to add more tables step.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// ANALOG IMPLEMENTATION:
//
// ANALOG_0 : Wave travelling
// ANALOG_1 : LFO Frequency
// ANALOG_2 : LFO Depth (wave travel modulation)
// ANALOG_3 : Release
//
// MIDI:
// CC 73 : Attack
// CC 76 : Decay
// CC 77 : Sustain
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// GENERAL
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 1, 0.01);
waveTravel = hslider("waveTravel[BELA: ANALOG_0]",0,0,1,0.01);
// pitchwheel
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
gFreq = midifreq * bend;
// LFO
lfoDepth = hslider("lfoDepth[BELA: ANALOG_2]",0,0.,1,0.001):si.smoo;
lfoFreq = hslider("lfoFreq[BELA: ANALOG_1]",0.1,0.01,10,0.001):si.smoo;
moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0);
volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01);
volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01);
volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01);
volR = hslider("R[BELA: ANALOG_3]",0.8,0.01,8,0.01);
envelop = en.adsre(volA,volD,volS,volR,midigate);
// Out amplitude
vol = envelop * midigain;
WF(tablesize, rang) = abs((fmod ((1+(float(ba.time)*rang)/float(tablesize)), 4.0 ))-2) -1.;
// 4 WF maxi with this version:
scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0)
with {
coef = 3.14159 * ((nb-1)*0.5);
soustraction = select2( position>0, 0, (position/(nb-1)) );
};
wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1)))
+ (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3)))
with {
tablesize = 1024;
wt1 = WF(tablesize, 16);
wt2 = WF(tablesize, 8);
wt3 = WF(tablesize, 6);
wt4 = WF(tablesize, 4);
faze = int(os.phasor(tablesize,freq));
};
//#################################################################################################//
//##################################### EFFECT SECTION ############################################//
//#################################################################################################//
//
// Simple FX chaine build for a mono synthesizer.
// It control general volume and pan.
// FX Chaine is:
// Drive
// Flanger
// Reverberation
//
// This version use ANALOG IN to controle some of the parameters.
// Other parameters continue to be available by MIDI or OSC.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// ANALOG IMPLEMENTATION:
//
// ANALOG_4 : Distortion Drive
// ANALOG_5 : Flanger Dry/Wet
// ANALOG_6 : Reverberation Dry/Wet
// ANALOG_7 : Reverberation Room size
//
// MIDI:
// CC 7 : Volume
// CC 10 : Pan
//
// CC 13 : Flanger Delay
// CC 13 : Flanger Delay
// CC 94 : Flanger Feedback
//
// CC 95 : Reverberation Damp
// CC 90 : Reverberation Stereo Width
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// VOLUME:
volFX = hslider("volume[midi:ctrl 7]",1,0,1,0.001);// Should be 7 according to MIDI CC norm.
// EFFECTS /////////////////////////////////////////////
drive = hslider("drive[BELA: ANALOG_4]",0.3,0,1,0.001);
// Flanger
curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001);
fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001);
fldw = hslider("dryWetFlang[BELA: ANALOG_5]",0.5,0,1,0.001);
flanger = efx
with {
fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10);
efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw);
};
// Panoramic:
panno = _ : sp.panner(hslider("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_;
// REVERB (from freeverb_demo)
reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain :
re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)),
*(1-g), *(1-g) :> _,_
with {
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
origSR = 44100;
damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR;
combfeed = vslider("RoomSize[BELA: ANALOG_7]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom;
spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR;
g = vslider("dryWetReverb[BELA: ANALOG_6]", 0.4, 0, 1, 0.001);
// (g = Dry/Wet)
};
// Dry-Wet (from C. LEBRETON)
dry_wet(dw,x,y) = wet*y + dry*x
with {
wet = 0.5*(dw+1.0);
dry = 1.0-wet;
};
// ALL
effect = _ *(volFX) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb;
process = wfosc(gFreq) * vol;
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/bela/WaveSynth_FX_Analog.dsp | faust | /////////////////////////////////////////////////////////////////////////////////////////////////
Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables.
It's possible to add more tables step.
/////////////////////////////////////////////////////////////////////////////////////////////////
ANALOG IMPLEMENTATION:
ANALOG_0 : Wave travelling
ANALOG_1 : LFO Frequency
ANALOG_2 : LFO Depth (wave travel modulation)
ANALOG_3 : Release
MIDI:
CC 73 : Attack
CC 76 : Decay
CC 77 : Sustain
/////////////////////////////////////////////////////////////////////////////////////////////////
GENERAL
pitchwheel
LFO
Out amplitude
4 WF maxi with this version:
#################################################################################################//
##################################### EFFECT SECTION ############################################//
#################################################################################################//
Simple FX chaine build for a mono synthesizer.
It control general volume and pan.
FX Chaine is:
Drive
Flanger
Reverberation
This version use ANALOG IN to controle some of the parameters.
Other parameters continue to be available by MIDI or OSC.
/////////////////////////////////////////////////////////////////////////////////////////////////
ANALOG IMPLEMENTATION:
ANALOG_4 : Distortion Drive
ANALOG_5 : Flanger Dry/Wet
ANALOG_6 : Reverberation Dry/Wet
ANALOG_7 : Reverberation Room size
MIDI:
CC 7 : Volume
CC 10 : Pan
CC 13 : Flanger Delay
CC 13 : Flanger Delay
CC 94 : Flanger Feedback
CC 95 : Reverberation Damp
CC 90 : Reverberation Stereo Width
/////////////////////////////////////////////////////////////////////////////////////////////////
VOLUME:
Should be 7 according to MIDI CC norm.
EFFECTS /////////////////////////////////////////////
Flanger
Panoramic:
REVERB (from freeverb_demo)
(g = Dry/Wet)
Dry-Wet (from C. LEBRETON)
ALL | import("stdfaust.lib");
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 1, 0.01);
waveTravel = hslider("waveTravel[BELA: ANALOG_0]",0,0,1,0.01);
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
gFreq = midifreq * bend;
lfoDepth = hslider("lfoDepth[BELA: ANALOG_2]",0,0.,1,0.001):si.smoo;
lfoFreq = hslider("lfoFreq[BELA: ANALOG_1]",0.1,0.01,10,0.001):si.smoo;
moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0);
volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01);
volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01);
volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01);
volR = hslider("R[BELA: ANALOG_3]",0.8,0.01,8,0.01);
envelop = en.adsre(volA,volD,volS,volR,midigate);
vol = envelop * midigain;
WF(tablesize, rang) = abs((fmod ((1+(float(ba.time)*rang)/float(tablesize)), 4.0 ))-2) -1.;
scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0)
with {
coef = 3.14159 * ((nb-1)*0.5);
soustraction = select2( position>0, 0, (position/(nb-1)) );
};
wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1)))
+ (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3)))
with {
tablesize = 1024;
wt1 = WF(tablesize, 16);
wt2 = WF(tablesize, 8);
wt3 = WF(tablesize, 6);
wt4 = WF(tablesize, 4);
faze = int(os.phasor(tablesize,freq));
};
drive = hslider("drive[BELA: ANALOG_4]",0.3,0,1,0.001);
curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001);
fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001);
fldw = hslider("dryWetFlang[BELA: ANALOG_5]",0.5,0,1,0.001);
flanger = efx
with {
fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10);
efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw);
};
panno = _ : sp.panner(hslider("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_;
reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain :
re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)),
*(1-g), *(1-g) :> _,_
with {
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
origSR = 44100;
damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR;
combfeed = vslider("RoomSize[BELA: ANALOG_7]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom;
spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR;
g = vslider("dryWetReverb[BELA: ANALOG_6]", 0.4, 0, 1, 0.001);
};
dry_wet(dw,x,y) = wet*y + dry*x
with {
wet = 0.5*(dw+1.0);
dry = 1.0-wet;
};
effect = _ *(volFX) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb;
process = wfosc(gFreq) * vol;
|
712e1fb1f67e8c7a382ce19a85cc6021bb257bfa3b6a8ac29197925f6d5e50b6 | HMaxime/CONDUCT | simpleSynth_FX_Analog.dsp | import("stdfaust.lib");
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// A very simple subtractive synthesizer with 1 VCO 1 VCF.
// The VCO Waveform is variable between Saw and Square
// The frequency is modulated by an LFO
// The envelope control volum and filter frequency
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// ANALOG IMPLEMENTATION:
//
// ANALOG_0 : waveform (Saw to square)
// ANALOG_1 : Filter Cutoff frequency
// ANALOG_2 : Filter resonance (Q)
// ANALOG_3 : Filter Envelope Modulation
//
// MIDI:
// CC 79 : Filter keyboard tracking (0 to X2, default 1)
//
// Envelope
// CC 73 : Attack
// CC 76 : Decay
// CC 77 : Sustain
// CC 72 : Release
//
// CC 78 : LFO frequency (0.001Hz to 10Hz)
// CC 1 : LFO Amplitude (Modulation)
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// HUI //////////////////////////////////////////////////
// Keyboard
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 0.5, 0.01);// MIDI KEYBOARD
// pitchwheel
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
// VCO
wfFade = hslider("waveform[BELA: ANALOG_0]",0.5,0,1,0.001):si.smoo;
// VCF
res = hslider("resonnance[BELA: ANALOG_2]",0.5,0,1,0.001):si.smoo;
fr = hslider("fc[BELA: ANALOG_1]", 15, 15, 12000, 0.001):si.smoo;
track = hslider("tracking[midi:ctrl 79]", 1, 0, 2, 0.001);
envMod = hslider("envMod[BELA: ANALOG_3]",50,0,100,0.01):si.smoo;
// ENV
att = 0.01 * (hslider("attack[midi:ctrl 73]",0.1,0.1,400,0.001));
dec = 0.01 * (hslider("decay[midi:ctrl 76]",60,0.1,400,0.001));
sust = hslider ("sustain[midi:ctrl 77]",0.2,0,1,0.001);
rel = 0.01 * (hslider("release[midi:ctrl 72]",100,0.1,400,0.001));
// LFO
lfoFreq = hslider("lfoFreq[midi:ctrl 78]",6,0.001,10,0.001):si.smoo;
modwheel = hslider("modwheel[midi:ctrl 1]",0,0,0.5,0.001):si.smoo;
// PROCESS /////////////////////////////////////////////
allfreq = (midifreq * bend) + LFO;
// VCF
cutoff = ((allfreq * track) + fr + (envMod * midigain * env)) : min(ma.SR/8);
// VCO
oscillo(f) = (os.sawtooth(f)*(1-wfFade))+(os.square(f)*wfFade);
// VCA
volume = midigain * env;
// Enveloppe
env = en.adsre(att,dec,sust,rel,midigate);
// LFO
LFO = os.lf_triangle(lfoFreq)*modwheel*10;
// SYNTH ////////////////////////////////////////////////
synth = (oscillo(allfreq) :ve.moog_vcf(res,cutoff)) * volume;
//#################################################################################################//
//##################################### EFFECT SECTION ############################################//
//#################################################################################################//
//
// Simple FX chaine build for a mono synthesizer.
// It controle general volume and pan.
// FX Chaine is:
// Drive
// Flanger
// Reverberation
//
// This version use ANALOG IN to controle some of the parameters.
// Other parameters continue to be available by MIDI or OSC.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// ANALOG IMPLEMENTATION:
//
// ANALOG_4 : Distortion Drive
// ANALOG_5 : Flanger Dry/Wet
// ANALOG_6 : Reverberation Dry/Wet
// ANALOG_7 : Reverberation Room size
//
// MIDI:
// CC 7 : Volume
// CC 10 : Pan
//
// CC 13 : Flanger Delay
// CC 13 : Flanger Delay
// CC 94 : Flanger Feedback
//
// CC 95 : Reverberation Damp
// CC 90 : Reverberation Stereo Width
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// VOLUME:
volFX = hslider("volume[midi:ctrl 7]",1,0,1,0.001);// Should be 7 according to MIDI CC norm.
// EFFECTS /////////////////////////////////////////////
drive = hslider("drive[BELA: ANALOG_4]",0.3,0,1,0.001);
// Flanger
curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001);
fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001);
fldw = hslider("dryWetFlang[BELA: ANALOG_5]",0.5,0,1,0.001);
flanger = efx
with {
fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10);
efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw);
};
// Pannoramique:
panno = _ : sp.panner(hslider("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_;
// REVERB (from freeverb_demo)
reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain :
re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)),
*(1-g), *(1-g) :> _,_
with {
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
origSR = 44100;
damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR;
combfeed = vslider("RoomSize[BELA: ANALOG_7]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom;
spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR;
g = vslider("dryWetReverb[BELA: ANALOG_6]", 0.4, 0, 1, 0.001);
// (g = Dry/Wet)
};
// Dry-Wet (from C. LEBRETON)
dry_wet(dw,x,y) = wet*y + dry*x
with {
wet = 0.5*(dw+1.0);
dry = 1.0-wet;
};
// ALL
effect = _ *(volFX) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb;
// PROCESS /////////////////////////////////////////////
process = synth;
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/bela/simpleSynth_FX_Analog.dsp | faust | /////////////////////////////////////////////////////////////////////////////////////////////////
A very simple subtractive synthesizer with 1 VCO 1 VCF.
The VCO Waveform is variable between Saw and Square
The frequency is modulated by an LFO
The envelope control volum and filter frequency
/////////////////////////////////////////////////////////////////////////////////////////////////
ANALOG IMPLEMENTATION:
ANALOG_0 : waveform (Saw to square)
ANALOG_1 : Filter Cutoff frequency
ANALOG_2 : Filter resonance (Q)
ANALOG_3 : Filter Envelope Modulation
MIDI:
CC 79 : Filter keyboard tracking (0 to X2, default 1)
Envelope
CC 73 : Attack
CC 76 : Decay
CC 77 : Sustain
CC 72 : Release
CC 78 : LFO frequency (0.001Hz to 10Hz)
CC 1 : LFO Amplitude (Modulation)
/////////////////////////////////////////////////////////////////////////////////////////////////
HUI //////////////////////////////////////////////////
Keyboard
MIDI KEYBOARD
pitchwheel
VCO
VCF
ENV
LFO
PROCESS /////////////////////////////////////////////
VCF
VCO
VCA
Enveloppe
LFO
SYNTH ////////////////////////////////////////////////
#################################################################################################//
##################################### EFFECT SECTION ############################################//
#################################################################################################//
Simple FX chaine build for a mono synthesizer.
It controle general volume and pan.
FX Chaine is:
Drive
Flanger
Reverberation
This version use ANALOG IN to controle some of the parameters.
Other parameters continue to be available by MIDI or OSC.
/////////////////////////////////////////////////////////////////////////////////////////////////
ANALOG IMPLEMENTATION:
ANALOG_4 : Distortion Drive
ANALOG_5 : Flanger Dry/Wet
ANALOG_6 : Reverberation Dry/Wet
ANALOG_7 : Reverberation Room size
MIDI:
CC 7 : Volume
CC 10 : Pan
CC 13 : Flanger Delay
CC 13 : Flanger Delay
CC 94 : Flanger Feedback
CC 95 : Reverberation Damp
CC 90 : Reverberation Stereo Width
/////////////////////////////////////////////////////////////////////////////////////////////////
VOLUME:
Should be 7 according to MIDI CC norm.
EFFECTS /////////////////////////////////////////////
Flanger
Pannoramique:
REVERB (from freeverb_demo)
(g = Dry/Wet)
Dry-Wet (from C. LEBRETON)
ALL
PROCESS ///////////////////////////////////////////// | import("stdfaust.lib");
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
wfFade = hslider("waveform[BELA: ANALOG_0]",0.5,0,1,0.001):si.smoo;
res = hslider("resonnance[BELA: ANALOG_2]",0.5,0,1,0.001):si.smoo;
fr = hslider("fc[BELA: ANALOG_1]", 15, 15, 12000, 0.001):si.smoo;
track = hslider("tracking[midi:ctrl 79]", 1, 0, 2, 0.001);
envMod = hslider("envMod[BELA: ANALOG_3]",50,0,100,0.01):si.smoo;
att = 0.01 * (hslider("attack[midi:ctrl 73]",0.1,0.1,400,0.001));
dec = 0.01 * (hslider("decay[midi:ctrl 76]",60,0.1,400,0.001));
sust = hslider ("sustain[midi:ctrl 77]",0.2,0,1,0.001);
rel = 0.01 * (hslider("release[midi:ctrl 72]",100,0.1,400,0.001));
lfoFreq = hslider("lfoFreq[midi:ctrl 78]",6,0.001,10,0.001):si.smoo;
modwheel = hslider("modwheel[midi:ctrl 1]",0,0,0.5,0.001):si.smoo;
allfreq = (midifreq * bend) + LFO;
cutoff = ((allfreq * track) + fr + (envMod * midigain * env)) : min(ma.SR/8);
oscillo(f) = (os.sawtooth(f)*(1-wfFade))+(os.square(f)*wfFade);
volume = midigain * env;
env = en.adsre(att,dec,sust,rel,midigate);
LFO = os.lf_triangle(lfoFreq)*modwheel*10;
synth = (oscillo(allfreq) :ve.moog_vcf(res,cutoff)) * volume;
drive = hslider("drive[BELA: ANALOG_4]",0.3,0,1,0.001);
curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001);
fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001);
fldw = hslider("dryWetFlang[BELA: ANALOG_5]",0.5,0,1,0.001);
flanger = efx
with {
fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10);
efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw);
};
panno = _ : sp.panner(hslider("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_;
reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain :
re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)),
*(1-g), *(1-g) :> _,_
with {
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
origSR = 44100;
damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR;
combfeed = vslider("RoomSize[BELA: ANALOG_7]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom;
spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR;
g = vslider("dryWetReverb[BELA: ANALOG_6]", 0.4, 0, 1, 0.001);
};
dry_wet(dw,x,y) = wet*y + dry*x
with {
wet = 0.5*(dw+1.0);
dry = 1.0-wet;
};
effect = _ *(volFX) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb;
process = synth;
|
90a22945b13044306e3bdbd50be621231972f983d1a67a85c0d58bb32b09fd18 | HMaxime/CONDUCT | simpleSynth_FX.dsp | import("stdfaust.lib");
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// A very simple subtractive synthesizer with 1 VCO 1 VCF.
// The VCO Waveform is variable between Saw and Square
// The frequency is modulated by an LFO
// The envelope control volum and filter frequency
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// MIDI IMPLEMENTATION:
//
// CC 70 : waveform (Saw to square)
// CC 71 : Filter resonance (Q)
// CC 74 : Filter Cutoff frequency
// CC 79 : Filter keyboard tracking (0 to X2, default 1)
// CC 75 : Filter Envelope Modulation
//
// Envelope
// CC 73 : Attack
// CC 76 : Decay
// CC 77 : Sustain
// CC 72 : Release
//
// CC 78 : LFO frequency (0.001Hz to 10Hz)
// CC 1 : LFO Amplitude (Modulation)
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// HUI //////////////////////////////////////////////////
// Keyboard
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
midigain = nentry("gain", 0.5, 0, 0.5, 0.01);// MIDI KEYBOARD
// pitchwheel
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
// VCO
wfFade = hslider("waveform[midi:ctrl 70]",0.5,0,1,0.001):si.smoo;
// VCF
res = hslider("resonnance[midi:ctrl 71]",0.5,0,1,0.001):si.smoo;
fr = hslider("fc[midi:ctrl 74]", 15, 15, 12000, 0.001):si.smoo;
track = hslider("tracking[midi:ctrl 79]", 1, 0, 2, 0.001);
envMod = hslider("envMod[midi:ctrl 75]",50,0,100,0.01):si.smoo;
// ENV
att = 0.01 * (hslider("attack[midi:ctrl 73]",0.1,0.1,400,0.001));
dec = 0.01 * (hslider("decay[midi:ctrl 76]",60,0.1,400,0.001));
sust = hslider("sustain[midi:ctrl 77]",0.1,0,1,0.001);
rel = 0.01 * (hslider("release[midi:ctrl 72]",100,0.1,400,0.001));
// LFO
lfoFreq = hslider("lfoFreq[midi:ctrl 78]",6,0.001,10,0.001):si.smoo;
modwheel = hslider("modwheel[midi:ctrl 1]",0,0,0.5,0.001):si.smoo;
// PROCESS /////////////////////////////////////////////
allfreq = (midifreq * bend) + LFO;
// VCF
cutoff = ((allfreq * track) + fr + (envMod * midigain * env)) : min(ma.SR/8);
// VCO
oscillo(f) = (os.sawtooth(f)*(1-wfFade))+(os.square(f)*wfFade);
// VCA
volume = midigain * env;
// Enveloppe
env = en.adsre(att,dec,sust,rel,midigate);
// LFO
LFO = os.lf_triangle(lfoFreq)*modwheel*10;
// SYNTH ////////////////////////////////////////////////
synth = (oscillo(allfreq) :ve.moog_vcf(res,cutoff)) * volume;
//#################################################################################################//
//##################################### EFFECT SECTION ############################################//
//#################################################################################################//
// Simple FX chaine build for a mono synthesizer.
// It controle general volume and pan.
// FX Chaine is:
// Drive
// Flanger
// Reverberation
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// MIDI IMPLEMENTATION:
// (All are available by OSC)
//
// CC 7 : Volume
// CC 10 : Pan
//
// CC 92 : Distortion Drive
//
// CC 13 : Flanger Delay
// CC 93 : Flanger Dry/Wet
// CC 94 : Flanger Feedback
//
// CC 12 : Reverberation Room size
// CC 91 : Reverberation Dry/Wet
// CC 95 : Reverberation Damp
// CC 90 : Reverberation Stereo Width
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// VOLUME:
volFX = hslider("volume[midi:ctrl 7]",1,0,1,0.001);// Should be 7 according to MIDI CC norm.
// EFFECTS /////////////////////////////////////////////
drive = hslider("drive[midi:ctrl 92]",0.3,0,1,0.001);
// Flanger
curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001);
fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001);
fldw = hslider("dryWetFlang[midi:ctrl 93]",0.5,0,1,0.001);
flanger = efx
with {
fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10);
efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw);
};
// Pannoramique:
panno = _ : sp.panner(hslider("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_;
// REVERB (from freeverb_demo)
reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain :
re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)),
*(1-g), *(1-g) :> _,_
with {
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
origSR = 44100;
damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR;
combfeed = vslider("RoomSize[midi:ctrl 12]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom;
spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR;
g = vslider("dryWetReverb[midi:ctrl 91]", 0.4, 0, 1, 0.001);
// (g = Dry/Wet)
};
// Dry-Wet (from C. LEBRETON)
dry_wet(dw,x,y) = wet*y + dry*x
with {
wet = 0.5*(dw+1.0);
dry = 1.0-wet;
};
// ALL
effect = _ *(volFX) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb;
// PROCESS /////////////////////////////////////////////
process = synth;
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/bela/simpleSynth_FX.dsp | faust | /////////////////////////////////////////////////////////////////////////////////////////////////
A very simple subtractive synthesizer with 1 VCO 1 VCF.
The VCO Waveform is variable between Saw and Square
The frequency is modulated by an LFO
The envelope control volum and filter frequency
/////////////////////////////////////////////////////////////////////////////////////////////////
MIDI IMPLEMENTATION:
CC 70 : waveform (Saw to square)
CC 71 : Filter resonance (Q)
CC 74 : Filter Cutoff frequency
CC 79 : Filter keyboard tracking (0 to X2, default 1)
CC 75 : Filter Envelope Modulation
Envelope
CC 73 : Attack
CC 76 : Decay
CC 77 : Sustain
CC 72 : Release
CC 78 : LFO frequency (0.001Hz to 10Hz)
CC 1 : LFO Amplitude (Modulation)
/////////////////////////////////////////////////////////////////////////////////////////////////
HUI //////////////////////////////////////////////////
Keyboard
MIDI KEYBOARD
pitchwheel
VCO
VCF
ENV
LFO
PROCESS /////////////////////////////////////////////
VCF
VCO
VCA
Enveloppe
LFO
SYNTH ////////////////////////////////////////////////
#################################################################################################//
##################################### EFFECT SECTION ############################################//
#################################################################################################//
Simple FX chaine build for a mono synthesizer.
It controle general volume and pan.
FX Chaine is:
Drive
Flanger
Reverberation
/////////////////////////////////////////////////////////////////////////////////////////////////
MIDI IMPLEMENTATION:
(All are available by OSC)
CC 7 : Volume
CC 10 : Pan
CC 92 : Distortion Drive
CC 13 : Flanger Delay
CC 93 : Flanger Dry/Wet
CC 94 : Flanger Feedback
CC 12 : Reverberation Room size
CC 91 : Reverberation Dry/Wet
CC 95 : Reverberation Damp
CC 90 : Reverberation Stereo Width
/////////////////////////////////////////////////////////////////////////////////////////////////
VOLUME:
Should be 7 according to MIDI CC norm.
EFFECTS /////////////////////////////////////////////
Flanger
Pannoramique:
REVERB (from freeverb_demo)
(g = Dry/Wet)
Dry-Wet (from C. LEBRETON)
ALL
PROCESS ///////////////////////////////////////////// | import("stdfaust.lib");
midigate = button("gate");
midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1);
bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01));
wfFade = hslider("waveform[midi:ctrl 70]",0.5,0,1,0.001):si.smoo;
res = hslider("resonnance[midi:ctrl 71]",0.5,0,1,0.001):si.smoo;
fr = hslider("fc[midi:ctrl 74]", 15, 15, 12000, 0.001):si.smoo;
track = hslider("tracking[midi:ctrl 79]", 1, 0, 2, 0.001);
envMod = hslider("envMod[midi:ctrl 75]",50,0,100,0.01):si.smoo;
att = 0.01 * (hslider("attack[midi:ctrl 73]",0.1,0.1,400,0.001));
dec = 0.01 * (hslider("decay[midi:ctrl 76]",60,0.1,400,0.001));
sust = hslider("sustain[midi:ctrl 77]",0.1,0,1,0.001);
rel = 0.01 * (hslider("release[midi:ctrl 72]",100,0.1,400,0.001));
lfoFreq = hslider("lfoFreq[midi:ctrl 78]",6,0.001,10,0.001):si.smoo;
modwheel = hslider("modwheel[midi:ctrl 1]",0,0,0.5,0.001):si.smoo;
allfreq = (midifreq * bend) + LFO;
cutoff = ((allfreq * track) + fr + (envMod * midigain * env)) : min(ma.SR/8);
oscillo(f) = (os.sawtooth(f)*(1-wfFade))+(os.square(f)*wfFade);
volume = midigain * env;
env = en.adsre(att,dec,sust,rel,midigate);
LFO = os.lf_triangle(lfoFreq)*modwheel*10;
synth = (oscillo(allfreq) :ve.moog_vcf(res,cutoff)) * volume;
drive = hslider("drive[midi:ctrl 92]",0.3,0,1,0.001);
curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001);
fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001);
fldw = hslider("dryWetFlang[midi:ctrl 93]",0.5,0,1,0.001);
flanger = efx
with {
fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10);
efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw);
};
panno = _ : sp.panner(hslider("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_;
reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain :
re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)),
*(1-g), *(1-g) :> _,_
with {
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
origSR = 44100;
damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR;
combfeed = vslider("RoomSize[midi:ctrl 12]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom;
spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR;
g = vslider("dryWetReverb[midi:ctrl 91]", 0.4, 0, 1, 0.001);
};
dry_wet(dw,x,y) = wet*y + dry*x
with {
wet = 0.5*(dw+1.0);
dry = 1.0-wet;
};
effect = _ *(volFX) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb;
process = synth;
|
6386344256ca61f7007afe2ef02775bedd281edfbd46afaa505d6e63b00ad711 | HMaxime/CONDUCT | virtualAnalogWithEffectsForBrowser.dsp | import("stdfaust.lib");
// These are now in a separate file ./effects.dsp
// echo = echog(component("echo.dsp")); // ./echo.dsp
// flanger = flg(component("flanger.dsp")); // ./flanger.dsp
// chorus = chg(component("chorus.dsp")); // ./chorus.dsp
// reverb = rg(component("freeverb.dsp"));
process = main <: _,_; // Now separate: : echo : flanger : chorus : reverb;
main = (signal + attach(extInput,amp) : filters : *(ampScaling)) ~ _;
signal = oscs + noise * noiseOff * namp;
ampScaling = envelopeAmp * masterVolume; // masterVolume is redundant but easier to find
oscs = par(i,3,(oscamp(i+1)*osc(i+1))) :> _;
controlSelect(1) = osc1(vrockerred); // ("[0] use as LFO"));
octaveSelect(1) = osc1(vslider("[1] Octave1 [midi:ctrl 23] [style:knob]",1,0,5,1):int); // LO, 32', 16', 8', 4', 2'
// Osc1 detunes like Osc2 and Osc3 (unlike in the Minimoog where it would be an expensive extra knob):
detuneOctaves(1) = osc1(vslider("[2] DeTuning1 [units:Octaves] [midi:ctrl 24] [style:knob]",0.0,-1.0,1.0,0.001));
waveSelect(1) = osc1(vslider("[3] Waveform1 [midi:ctrl 25] [style:knob]",5,0,5,1):int);
amp1Enable = mr1(vslider("[1] On [midi:ctrl 12] [style:knob] [color:blue]",1,0,1,1));
oscamp(1) = mr1(vslider("[0] Osc1 Amp [midi:ctrl 26] [style:knob]",0.5,0.0,1.0,0.001)) * amp1Enable;
eei = mr2(vslider("[1] On [midi:ctrl 13] [style:knob] [color:blue]",0,0,1,1)); // External input = MAIN OUTPUT when "off"
sei = mr2(vslider("[0] Ext Input [midi:ctrl 27] [style: knob]",0,0,1.0,0.001));
extInput(fb,extSig) = fb,extSig : select2(eei) : *(sei) : extClipLED;
extClipLED = _ <: _, (abs : >(0.95) : mr2(vbargraph("[2] Ext Input Clip [style:led]",0,1)):!);
keycLED = attach(mr2(vbargraph("[3] Keyboard Ctl [style:led]",0,1)));
controlSelect(2) = osc2(vrockerred); // ("[0] use as LFO"));
octaveSelect(2) = osc2(vslider("[1] Octave2 [midi:ctrl 28] [style:knob]",1,0,5,1):int); // LO, 32', 16', 8', 4', 2'
detuneOctaves(2) = osc2(vslider("[2] DeTuning2 [units:Octaves] [midi:ctrl 29] [style:knob]",0.41667,-1.0,1.0,0.001));
waveSelect(2) = osc2(vslider("[3] Waveform2 [midi:ctrl 30] [style:knob]",5,0,5,1):int);
amp2Enable = mr3(vslider("[1] On [midi:ctrl 14] [style:knob] [color:blue]",1,0,1,1));
oscamp(2) = mr3(vslider("[0] Osc2 Amp [midi:ctrl 31] [style:knob]",0.5,0.0,1.0,0.001)) * amp2Enable;
noise = select2(ntype,no.noise,10.0*no.pink_noise); // pink noise needs some "make-up gain"
namp = mr4(vslider("[0] Noise Amp [midi:ctrl 32] [style: knob]",0.0,0.0,1.0,0.001));
noiseOff = mr4cbg(vslider("[0] On [midi:ctrl 15] [style:knob] [color:blue]",0,0,1,1));
ntype = mr4cbg(vslider("[1] White/Pink [midi:ctrl 16] [tooltip: Choose either White or Pink Noise] [style: knob] [color:blue]",1,0,1,1));
controlSelect(3) = osc3(vrockerred); // ("[0] use as LFO"));
octaveSelect(3) = osc3(vslider("[1] Octave3 [midi:ctrl 33] [style:knob]",0,0,5,1):int); // LO, 32', 16', 8', 4', 2'
detuneOctaves(3) = osc3(vslider("[2] DeTuning3 [units:Octaves] [midi:ctrl 34] [style:knob]",0.3,-1.0,1.0,0.001));
waveSelect(3) = osc3(vslider("[3] Waveform3 [midi:ctrl 35] [style:knob]",0,0,5,1):int);
amp3Enable = mr5(vslider("[1] On [midi:ctrl 17] [style:knob] [color:blue]",0,0,1,1));
oscamp(3) = mr5(vslider("[0] Osc3 Amp [midi:ctrl 36] [style:knob]",0.5,0.0,1.0,0.001)) * amp3Enable;
waveforms(i) = (tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
// compute oscillator frequency scale factor, staying in lg(Hz) as much as possible:
modWheelShift = 1.5*modWheel; // Manual says 0 to 1.5 octaves
modulationCenterShift = 0; // Leave this off until triangle-wave modulation is debugged
modulationShift = select2(oscModEnable, 0.0,
modWheelShift * ( modulationCenterShift + (1.0-modulationCenterShift) * oscNoiseModulation ));
octaveShift(i) = -2+int(octaveSelect(i));
osc3FixedFreq = 369.994; // F# a tritone above middle C
keyFreqGlidedMaybe = select2(osc3Control,osc3FixedFreq,keyFreqGlided);
keyFreqModulatedShifted(3) = keyFreqGlidedMaybe; // osc3 not allowed to FM itself
keyFreqModulatedShifted(i) = keyFreqGlided * pow(2.0, modulationShift); // i=1,2
// When disconnected from the keyboard, Osc3 can detune 3 octaves up or down (Pat video):
detuneBoost(3) = select2(osc3Control,3.0,1.0);
detuneBoost(i) = 1.0; // i=1,2
detuneOctavesFinal(i) = detuneOctaves(i)*detuneBoost(i);
fBase(i) = keyFreqModulatedShifted(i) * pow(2.0, (masterTuneOctaves+octaveShift(i)+detuneOctavesFinal(i)))
: si.smooth(ba.tau2pole(0.016));
fLFOBase(i) = 3.0 * pow(2.0, detuneOctavesFinal(i)); // used when osc3 (only) is in LFO mode
lfoMode(i) = (octaveSelect(i) == 0);
f(i) = select2(lfoMode(i), fBase(i), fLFOBase(i)); // lowest range setting is LFO mode for any osc
// i is 1-based:
osc(i) = ba.selectn(6, int(waveSelect(i)), tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
tri(i) = select2(lfoMode(i),
os.triangle(f(i)),
os.lf_triangle(f(i)));
bent(i) = 0.5*tri(i) + 0.5*saw(i); // from Minimoog manual
saw(i) = select2(lfoMode(i),
os.sawtooth(f(i)),
os.lf_saw(f(i)));
sq(i) = select2(lfoMode(i),
os.square(f(i)),
os.lf_squarewave(f(i)));
ptm(i) = select2(lfoMode(i), // Note: a Duty knob would be better than these two, or in addition
os.pulsetrain(f(i),0.25),
lf_pulsetrain(f(i),0.25));
ptn(i) = select2(lfoMode(i),
os.pulsetrain(f(i),0.125),
lf_pulsetrain(f(i),0.125));
// Soon to appear in oscillators.lib:
lf_pulsetrain(freq,duty) = 2.0*os.lf_pulsetrainpos(freq,duty) - 1.0;
filters = ba.bypass1(bp,vcf); // BYPASS WILL GO AWAY (I think you just open it up all the way to bypass):
bp = 0; // VCF is always on
fcLgHz = vcf1(vslider("[1] Corner Freq [unit:Log2(Hz)]
[tooltip: Corner resonance frequency in Log2(Hertz)]
[style: knob]
[midi:ctrl 74]", // Frequency Cutoff (aka Brightness )
10.6, log(40.0)/log(2), log(20000.0)/log(2), 0.000001)) // 9 octaves (from Minimoog manual)
//p: 40, 30, 80, 0.01))
//p: : ba.pianokey2hz
: si.smooth(ba.tau2pole(0.016));
res = vcf1(vslider("[2] Corner Resonance [midi:ctrl 37] [tooltip: Resonance Q at VCF corner frequency (0 to 1)]
[style: knob]",
0.7, 0, 1, 0.01));
vcfKeyRange = vcf1cbg(vslider("[2] Kbd Ctl [midi:ctrl 38] [tooltip: Keyboard tracking of VCF corner-frequency (0=none, 1=full)]
[style: knob]",
1, 0, 1, 0.001)); // was in mr2
vcfModEnable = vcf1cbg(vslider("[1] Filter Mod. [midi:ctrl 19] [color:red] [style:knob] [tooltip: Filter Modulation => Route Modulation Mix output to VCF frequency]",1,0,1,1));
// Note that VCF has three sources of corner-frequency setting that are added together:
// - Corner Freq knob (40 Hz to 20 kHz)
// - VCF Contour envelope (0 to 4 octaves)
// - Injection 32 of Modulation Mix (0 to 1.5 octaves)
// Manual says maximum vcf sweep spans 0 to 4 octaves:
// Original Knob went to 10, but we're going to 4 so we can say the knob is in "octaves" units:
vcfContourAmountOctaves = vcf1(vslider("[3] Amount of Contour (octaves) [midi:ctrl 39] [style: knob]", 1.2, 0, 4.0, 0.001));
vcfContourOctaves = vcfContourAmountOctaves * envelopeVCF; // in octaves
// We are assuming that the modulation-mix range for the VCF freq is 1.5 octaves like it is for oscs 1 and 2:
vcfModMixModulationOctaves = select2(vcfModEnable, 0, (1.5 * oscNoiseModulation * modWheel)); // octaves
vcfModulationOctaves = vcfModMixModulationOctaves + vcfContourOctaves;
keyFreqLogHzGlided = log(keyFreqGlided)/log(2.0); // FIXME: Start w freqLogHz not freq so we don't need exp(log()) here
keyShiftOctaves = keyFreqLogHzGlided - log(261.625565)/log(2.0); // FIXME: ARBITRARILY centering on middle C - check device
vcfKeyShiftOctaves = vcfKeyRange * keyShiftOctaves;
modulatedFcLgHz = fcLgHz + vcfModulationOctaves + vcfKeyShiftOctaves;
fc = min((0.5*ma.SR), pow(2.0,modulatedFcLgHz));
vcf = ve.moog_vcf_2bn(res,fc);
// Attack, Decay, and Sustain ranges are set according to the Minimoog manual:
attT60VCF = 0.001 * vcf2(vslider("[0] AttackF [midi:ctrl 40] [tooltip: Attack Time] [unit:ms] [style: knob]",1400,10,10000,1));
decT60VCF = 0.001 * vcf2(vslider("[0] DecayF [midi:ctrl 41] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,10,10000,1));
susLvlVCF = 0.01 * vcf2(vslider("[0] SustainF [midi:ctrl 42] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
decayButton = wg(vslider("Decay [midi:ctrl 20] [tooltip:Envelope Release either Decay value or 0][style:knob]",1,0,1,1):int); // was Staccato
legatoButton = wg(vslider("Glide [midi:ctrl 65] [tooltip: Glide from note to note][style:knob]",1,0,1,1)); // was Legato
relT60VCF = select2(decayButton,0.010,decT60VCF);
envelopeVCF = en.adsre(attT60VCF,decT60VCF,susLvlVCF,relT60VCF,gate);
// --- Smart Keyboard interface ---
declare interface "SmartKeyboard{
'Number of Keyboards':'2',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'72',
'Keyboard 1 - Lowest Key':'60'
}";
// --- functions ---
// Signal controls:
keyDownHold = gg(vslider("[0] gateHold [tooltip: lock sustain pedal on (hold gate set at 1)][style:knob]",0,0,1,1));
keyDown = gg(button("[1] gate [tooltip: The gate signal is 1 during a
note and 0 otherwise. For MIDI, NoteOn occurs when the gate
transitions from 0 to 1, and NoteOff is an event corresponding
to the gate transition from 1 to 0. The name of this Faust
button must be 'gate'.]"));
sustain = gg(button("[1] sustain [midi:ctrl 64]
[tooltip: extends the gate (keeps it set to 1)]")); // MIDI only (see smartkeyb doc)
gate = keyDown + keyDownHold + sustain : min(1);
attT60 = 0.001 * ng(vslider("[0] AttackA [midi:ctrl 43] [tooltip: Attack Time] [unit:ms] [style: knob]",2,0,5000,0.1));
decT60 = 0.001 * ng(vslider("[0] DecayA [midi:ctrl 44] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,0,10000,0.1));
susLvl = 0.01 * ng(vslider("[0] SustainA [midi:ctrl 45] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
relT60 = select2(decayButton,0.010,decT60); // right?
envelopeAmpNoAM = en.adsre(attT60,decT60,susLvl,relT60,gate);
AMDepth = 0.5;
envelopeAmp = select2(oscModEnable, envelopeAmpNoAM,
envelopeAmpNoAM * (1.0 + AMDepth*modWheel * 0.5 * (1.0+oscNoiseModulation)));
// Signal Parameters
ampL = volg(vslider("[1] gain [style:knob] [tooltip: Amplitude]",0.2,0,1.0,0.001));
amp = ampL : si.smoo; // envelopeAmp is multiplied once on entire signal sum
//elecGuitar.dsp values used:
bend = wg(ba.semi2ratio(hslider("[0] bend [style:knob] [midi:pitchwheel]",0,-2,2,0.01))) : si.polySmooth(gate,0.999,1);
//Previous guess:
modWheel = wg(vslider("[1] mod [midi:ctrl 1] [style:knob] [tooltip: PitchModulation amplitude in octaves]",
0,0,1.0,0.01)) : si.polySmooth(gate,0.999,1);
//p: MIDI requires frequency in Hz, not piano-keys as we had before
// Frequency Range is 0.1 Hz to 20 kHz according to the Minimoog manual:
// MIDI REQUIRES THE FOLLOWING PARAMETER TO BE NAMED 'freq':
keyFreqBent = bend * kg(hslider("[2] freq [unit:Hz] [style:knob]",220,0.1,20000,0.1));
masterVolume = vg(vslider("MasterVolume [style:knob] [midi:ctrl 7] [tooltip: master volume, MIDI controlled]",
0.7,0,1,0.001))
: si.smooth(ba.tau2pole(0.16));
masterTuneOctaves = dg(vslider("[0] Tune [midi:ctrl 47] [unit:Octaves] [style:knob]
[tooltip: Frequency-shift up or down for all oscillators in Octaves]", 0.0,-1.0,1.0,0.001));
// Oscillator Modulation HrockerRed => apply Modulation Mix output osc1&2 pitches
glide = gmmg(vslider("[0] Glide [midi:ctrl 5] [unit:sec/octave] [style:knob] [scale:log]
[tooltip: Portamento (frequency-glide) in seconds per octave]",
0.008,0.001,1.0,0.001));
legatoPole = select2(legatoButton,0.5,ba.tau2pole(glide*exp(1.0f)/2.0f)); // convert 1/e to 1/2 by slowing down exp
keyFreqGlided = keyFreqBent : si.smooth(legatoPole);
mmix = gmmg(vslider("[1] Mod. Mix [midi:ctrl 48] [style:knob] [tooltip: Modulation Mix: Osc3 (0) to Noise (1)]",
0.0,0.0,1.0,0.001));
oscNoiseModulation = (mmix * noise) + ((1.0-mmix) * osc(3)); // noise amplitude and off-switch ignored here
oscModEnable = dsg(vslider("[0] Osc. Mod. [midi:ctrl 22] [color:red] [style:knob] [tooltip:Oscillator Modulation adds Modulation Mix output to osc1&2 frequencies",1,0,1,1)); // any offset?
osc3Control = dsg(vslider("[1] Osc. 3 Ctl [midi:ctrl 9] [color:red] [style:knob] [tooltip:Oscillator 3 frequency tracks the keyboard if on, else not",0,0,1,1):int);
effect = _,_ : +
: component_echo
: component_flanger
: component_chorus
: component_freeverb;
component_echo = environment {
echo_group(x) = x; // Let layout2.dsp lay us out
knobs_group(x) = ekg(x);
switches_group(x) = esg(x);
dmax = 32768; // one and done
dmaxs = float(dmax)/44100.0;
Nnines = 1.8; // Increase until you get the desired maximum amount of smoothing when fbs==1
//fastpow2 = ffunction(float fastpow2(float), "fast_pow2.h", "");
fbspr(fbs) = 1.0 - pow(2.0, -3.33219*Nnines*fbs); // pole radius of feedback smoother
inputSelect(gi) = _,0 : select2(gi);
echo_mono(dmax,curdel,tapdel,fb,fbspr,gi) = inputSelect(gi) : (+:si.smooth(fbspr)
<: de.fdelay(dmax,curdel),
de.fdelay(dmax,tapdel))
~(*(fb),!) : !,_;
tau2pole(tau) = ba.if(tau>0, exp(-1.0/(tau*ma.SR)), 0.0);
t60smoother(dEchoT60) = si.smooth(tau2pole(dEchoT60/6.91));
dEchoT60 = knobs_group(vslider("[1] DelayT60 [midi:ctrl 60] [style:knob]", 0.5, 0, 100, 0.001));
dEchoSamplesRaw = knobs_group(vslider("[0] Delay [midi:ctrl 61] [style:knob]", 0.5, 0.001, (dmaxs-0.001), 0.001)) * ma.SR;
dEchoSamples = dEchoSamplesRaw : t60smoother(dEchoT60);
warpRaw = knobs_group(vslider("[0] Warp [midi:ctrl 62] [style:knob]", 0, -1.0, 1.0, 0.001));
scrubAmpRaw = 0;
scrubPhaseRaw = 0;
fb = knobs_group(vslider("[2] Feedback [midi:ctrl 2] [style:knob]", .3, 0.0, 1.0, 0.0001));
amp = knobs_group(vslider("[3] Amp [midi:ctrl 75] [style:knob]", .5, 0, 1, 0.001)) : si.smooth(ba.tau2pole(ampT60/6.91));
ampT60 = 0.15661;
fbs = knobs_group(vslider("[5] [midi:ctrl 76] FeedbackSm [style:knob]", 0, 0, 1, 0.00001));
gi = switches_group(1-vslider("[7] [midi:ctrl 105] EnableEcho[style:knob]",0,0,1,1)); // "ground input" switches input to zeros
// Warp and Scrubber stuff:
enableEcho = (scrubAmpRaw > 0.00001);
triggerScrubOn = (enableEcho - enableEcho') > 0; // enableEcho went 0 to 1
triggerScrubOff = (enableEcho - enableEcho') < 0; // enableEcho went 1 to 0
// Ramps up only during scrub "hold" time and is otherwise zero:
counter = (enableEcho * (triggerScrubOn : + ~ +(1) * enableEcho : -(2))) & (dmax-1);
// implementation that continues scrubbing where it left off:
scrubPhase = scrubPhaseRaw : t60smoother(dEchoT60*(1-triggerScrubOff));
scrubAmp = scrubAmpRaw : t60smoother(dEchoT60*(1-triggerScrubOff));
warp = warpRaw : t60smoother(dEchoT60);
dTapSamplesRaw = dEchoSamplesRaw * (1.0 + warp + scrubPhase * scrubAmp) + float(counter);
dTapSamples = dTapSamplesRaw : t60smoother(dEchoT60*(1-triggerScrubOff));
echo_process = _ <: _, amp * echo_mono(dmax,dEchoSamples,dTapSamples,fb,fbspr(fbs),gi) : +;
}.echo_process;
component_flanger = environment {
// Created from flange.dsp 2015/06/21
flanger_mono(dmax,curdel,depth,fb,invert,lfoshape) = _ <: _, (-:de.fdelay(dmax,curdel)) ~ *(fb) : _,*(select2(invert,depth,0-depth)) : + : *(1/(1+depth)); // ideal for dc and reinforced sinusoids (in-phase summed signals)
flanger_process = ba.bypass1(fbp,flanger_mono_gui);
// Kill the groups to save vertical space:
meter_group(x) = flsg(x);
ctl_group(x) = flkg(x);
del_group(x) = flkg(x);
lvl_group(x) = flkf(x);
flangeview = lfo(freq);
flanger_mono_gui = attach(flangeview) : flanger_mono(dmax,curdel,depth,fb,invert,lfoshape);
sinlfo(freq) = (1 + os.oscrs(freq))/2;
trilfo(freq) = 1.0-abs(os.saw1(freq));
lfo(f) = (lfoshape * trilfo(f)) + ((1-lfoshape) * sinlfo(f));
dmax = 2048;
odflange = 44; // ~1 ms at 44.1 kHz = min delay
dflange = ((dmax-1)-odflange)*del_group(vslider("[1] Delay [midi:ctrl 50][style:knob]", 0.22, 0, 1, 1));
freq = ctl_group(vslider("[1] Rate [midi:ctrl 51] [unit:Hz] [style:knob]", 0.5, 0, 10, 0.01)) : si.smooth(ba.tau2pole(freqT60/6.91));
freqT60 = 0.15661;
depth = ctl_group(vslider("[3] Depth [midi:ctrl 52] [style:knob]", .75, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91));
depthT60 = 0.15661;
fb = ctl_group(vslider("[5] Feedback [midi:ctrl 53] [style:knob]", 0, -0.995, 0.99, 0.001)) : si.smooth(ba.tau2pole(fbT60/6.91));
fbT60 = 0.15661;
lfoshape = ctl_group(vslider("[7] Waveshape [midi:ctrl 54] [style:knob]", 0, 0, 1, 0.001));
curdel = odflange+dflange*lfo(freq);
fbp = 1-int(flsg(vslider("[0] Enable [midi:ctrl 102][style:knob]",0,0,1,1)));
invert = flsg(vslider("[1] Invert [midi:ctrl 49][style:knob]",0,0,1,1):int);
}.flanger_process;
component_chorus = environment {
voices = 8; // MUST BE EVEN
chorus_process = ba.bypass1to2(cbp,chorus_mono(dmax,curdel,rate,sigma,do2,voices));
dmax = 8192;
curdel = dmax * ckg(vslider("[0] Delay [midi:ctrl 55] [style:knob]", 0.5, 0, 1, 1)) : si.smooth(0.999);
rateMax = 7.0; // Hz
rateMin = 0.01;
rateT60 = 0.15661;
rate = ckg(vslider("[1] Rate [midi:ctrl 56] [unit:Hz] [style:knob]", 0.5, rateMin, rateMax, 0.0001))
: si.smooth(ba.tau2pole(rateT60/6.91));
depth = ckg(vslider("[4] Depth [midi:ctrl 57] [style:knob]", 0.5, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91));
depthT60 = 0.15661;
delayPerVoice = 0.5*curdel/voices;
sigma = delayPerVoice * ckg(vslider("[6] Deviation [midi:ctrl 58] [style:knob]",0.5,0,1,0.001)) : si.smooth(0.999);
periodic = 1;
do2 = depth; // use when depth=1 means "multivibrato" effect (no original => all are modulated)
cbp = 1-int(csg(vslider("[0] Enable [midi:ctrl 103][style:knob]",0,0,1,1)));
chorus_mono(dmax,curdel,rate,sigma,do2,voices)
= _ <: (*(1-do2)<:_,_),(*(do2) <: par(i,voices,voice(i)) :> _,_) : ro.interleave(2,2) : +,+
with {
angle(i) = 2*ma.PI*(i/2)/voices + (i%2)*ma.PI/2;
voice(i) = de.fdelay(dmax,min(dmax,del(i))) * cos(angle(i));
del(i) = curdel*(i+1)/voices + dev(i);
rates(i) = rate/float(i+1);
dev(i) = sigma * os.oscp(rates(i),i*2*ma.PI/voices);
};
}.chorus_process;
component_freeverb = environment {
import("stdfaust.lib");
declare name "freeverb";
declare version "1.0";
declare author "Grame";
declare license "BSD";
declare copyright "(c) GRAME 2006 and MoForte Inc. 2017";
declare reference "https://ccrma.stanford.edu/~jos/pasp/Freeverb.html";
//======================================================
//
// Freeverb
// Faster version using fixed delays (20% gain)
//
//======================================================
// Constant Parameters
//--------------------
fixedgain = 0.015; //value of the gain of fxctrl
scalewet = 3.0;
scaledry = 2.0;
scaledamp = 0.4;
scaleroom = 0.28;
offsetroom = 0.7;
initialroom = 0.5;
initialdamp = 0.5;
initialwet = 1.0/scalewet;
initialdry = 0;
initialwidth= 1.0;
initialmode = 0.0;
freezemode = 0.5;
stereospread= 23;
allpassfeed = 0.5; //feedback of the delays used in allpass filters
// Filter Parameters
//------------------
combtuningL1 = 1116;
combtuningL2 = 1188;
combtuningL3 = 1277;
combtuningL4 = 1356;
combtuningL5 = 1422;
combtuningL6 = 1491;
combtuningL7 = 1557;
combtuningL8 = 1617;
allpasstuningL1 = 556;
allpasstuningL2 = 441;
allpasstuningL3 = 341;
allpasstuningL4 = 225;
// Control Sliders
//--------------------
// Damp : filters the high frequencies of the echoes (especially active for great values of RoomSize)
// RoomSize : size of the reverberation room
// Dry : original signal
// Wet : reverberated signal
dampSlider = rkg(vslider("Damp [midi:ctrl 3] [style:knob]",0.5, 0, 1, 0.025))*scaledamp;
roomsizeSlider = rkg(vslider("RoomSize [midi:ctrl 4] [style:knob]", 0.5, 0, 1, 0.025))*scaleroom + offsetroom;
wetSlider = rkg(vslider("Wet [midi:ctrl 79] [style:knob]", 0.3333, 0, 1, 0.025));
combfeed = roomsizeSlider;
// Comb and Allpass filters
//-------------------------
allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_);
comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb));
// Reverb components
//------------------
monoReverb(fb1, fb2, damp, spread)
= _ <: comb(combtuningL1+spread, fb1, damp),
comb(combtuningL2+spread, fb1, damp),
comb(combtuningL3+spread, fb1, damp),
comb(combtuningL4+spread, fb1, damp),
comb(combtuningL5+spread, fb1, damp),
comb(combtuningL6+spread, fb1, damp),
comb(combtuningL7+spread, fb1, damp),
comb(combtuningL8+spread, fb1, damp)
+>
allpass (allpasstuningL1+spread, fb2)
: allpass (allpasstuningL2+spread, fb2)
: allpass (allpasstuningL3+spread, fb2)
: allpass (allpasstuningL4+spread, fb2)
;
monoReverbToStereo(fb1, fb2, damp, spread)
= + <: monoReverb(fb1, fb2, damp, 0) <: _,_;
stereoReverb(fb1, fb2, damp, spread)
= + <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread);
monoToStereoReverb(fb1, fb2, damp, spread)
= _ <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread);
// fxctrl : add an input gain and a wet-dry control to a stereo FX
//----------------------------------------------------------------
fxctrl(g,w,Fx) = _,_ <: (*(g),*(g) : Fx : *(w),*(w)), *(1-w), *(1-w) +> _,_;
rbp = 1-int(rsg(vslider("[0] Enable [midi:ctrl 104][style:knob]",0,0,1,1)));
// Freeverb
//---------
//JOS:freeverb = fxctrl(fixedgain, wetSlider, stereoReverb(combfeed, allpassfeed, dampSlider, stereospread));
freeverb = fxctrl(fixedgain, wetSlider, monoReverbToStereo(combfeed, allpassfeed, dampSlider, stereospread));
freeverb_process = ba.bypass2(rbp,freeverb);
}.freeverb_process;
// This layout loosely follows the MiniMoog-V
// Arturia-only features are labeled
// Original versions also added where different
// Need vrocker and hrocker toggle switches in Faust!
// Need orange and blue color choices
// Orange => Connect modulation sources to their destinations
// Blue => Turn audio sources On and Off
// - and later -
// White => Turn performance features On and Off
// Black => Select between modulation sources
// Julius Smith for Analog Devices 3/1/2017
vrocker(x) = checkbox("%%x [style:vrocker]");
hrocker(x) = checkbox("%%x [style:hrocker]");
vrockerblue(x) = checkbox("%x [style:vrocker] [color:blue]");
vrockerblue(x) = checkbox("%x [style:vrocker] [color:blue]");
// USAGE: vrockerorange("[0] ModulationEnable");
hrockerblue(x) = checkbox("%%x [style:hrocker] [color:blue]");
vrockerred(x) = checkbox("%%x [style:vrocker] [color:red]");
hrockerred(x) = checkbox("%%x [style:hrocker] [color:red]");
declare designer "Robert A. Moog";
mmg(x) = hgroup("",x); // Minimoog + Effects
synthg(x) = mmg(vgroup("[0] Minimoog",x));
fxg(x) = mmg(hgroup("[1] Effects",x));
mg(x) = synthg(hgroup("[0]",x));
cg(x) = mg(vgroup("[0] Controllers",x)); // Formerly named "Modules" but "Minimoog" group-title is enough
vg(x) = cg(hgroup("[0] Master Volume", x));
dg(x) = cg(hgroup("[1] Oscillator Tuning & Switching", x));
// Tune knob = master tune
dsg(x) = dg(vgroup("[1] Switches", x));
// Oscillator Modulation HrockerRed => apply Modulation Mix output to osc1&2 pitches
// [MOVED here from osc3 group] Osc 3 Control VrockerRed => use osc3 as LFO instead of osc3
gmmg(x) = cg(hgroup("[2] Glide and ModMix", x));
// Glide knob [0:10] = portamento speed
// Modulation Mix knob [0:10] (between Osc3 and Noise) = mix of noise and osc3 modulating osc1&2 pitch and/or VCF freq
og(x) = mg(vgroup("[1] Oscillator Bank", x));
osc1(x) = og(hgroup("[1] Oscillator 1", x));
// UNUSED Control switch (for alignment) - Could put Oscillator Modulation switch there
// Range rotary switch: LO (slow pulses or rhythm), 32', 16', 8', 4', 2'
// Frequency <something> switch: LED to right
// Waveform rotary switch: tri, impulse/bent-triangle, saw, pulseWide, pulseMed, pulseNarrow
osc2(x) = og(hgroup("[2] Oscillator 2", x));
// UNUSED (originall) or Osc 2 Control VrockerRed
// Range rotary switch: LO, 32', 16', 8', 4', 2'
// Detuning knob: -7 to 7 [NO SWITCH]
// Waveform rotary switch: tri, impulse(?), saw, pulseWide, pulseMed, pulseNarrow
osc3(x) = og(hgroup("[3] Oscillator 3", x));
// Osc 3 Control VrockerRed => use osc3 as LFO instead of osc3
// Range rotary switch: LO, 32', 16', 8', 4', 2'
// Detuning knob: -7 to 7 [NO SWITCH]
// Waveform rotary switch: tri, impulse(?), saw, pulseWide, pulseMed, pulseNarrow
mixg(x) = mg(vgroup("[2] Mixer", x));
// Each row 5 slots to maintain alignment and include red rockers joining VCF area:
mr1(x) = mixg(hgroup("[0] Osc1", x)); // mixer row 1 =
// Osc1 Volume and Osc1 HrockerBlue & _ & _ & Filter Modulation HrockerRed
// Filter Modulation => Modulation Mix output to VCF freq
mr2(x) = mixg(hgroup("[1] Ext In, KeyCtl", x)); // row 2 = Ext In HrockerBlue and Vol and Overload LED and Keyboard Ctl HrockerRed 1
mr3(x) = mixg(hgroup("[2] Osc2", x)); // = Osc2 Volume and Osc2 HrockerBlue and Keyboard Ctl HrockerRed 2
// Keyboard Control Modulation 1&2 => 0, 1/3, 2/3, all of Keyboard Control Signal ("gate?") applied to VCF freq
mr4(x) = mixg(hgroup("[3] Noise", x)); // = Noise HrockerBlue and Volume and Noise Type VrockerBlue
mr4cbg(x) = mr4(vgroup("[1]", x)); // = Noise Off and White/Pink selection
// two rockers
mr5(x) = mixg(hgroup("[4] Osc3", x)); // Osc3 Volume and Osc3 HrockerBlue
modg(x) = mg(vgroup("[3] Modifiers", x));
vcfg(x) = modg(vgroup("[0] Filter", x));
vcf1(x) = vcfg(hgroup("[0] [tooltip:freq, Q, ContourScale]", x));
vcf1cbg(x) = vcf1(vgroup("[0] [tooltip:two checkboxes]", x));
// Filter Modulation switch
// VCF Off switch
// Corner Frequency knob
// Filter Emphasis knob
// Amount of Contour knob
vcf2(x) = vcfg(hgroup("[1] Filter Contour [tooltip:AttFilt, DecFilt, Sustain Level for Filter Contour]", x));
// Attack Time knob
// Decay Time knob
// Sustain Level knob
ng(x) = modg(hgroup("[1] Loudness Contour", x));
// Attack Time knob
// Decay Time knob
// Sustain Level knob
echog(x) = fxg(hgroup("[4] Echo",x));
ekg(x) = echog(vgroup("[0] Knobs",x));
esg(x) = echog(vgroup("[1] Switches",x));
flg(x) = fxg(hgroup("[5] Flanger",x));
flkg(x) = flg(vgroup("[0] Knobs",x));
flsg(x) = flg(vgroup("[1] Switches",x));
chg(x) = fxg(hgroup("[6] Chorus",x));
ckg(x) = chg(vgroup("[0] Knobs",x));
csg(x) = chg(vgroup("[1] Switches",x));
rg(x) = fxg(hgroup("[7] Reverb",x));
rkg(x) = rg(vgroup("[0] Knobs",x));
rsg(x) = rg(vgroup("[1] Switches",x));
outg(x) = fxg(vgroup("[8] Output", x));
volg(x) = outg(hgroup("[0] Volume Main Output", x));
// Volume knob [0-10]
// Unison switch (Arturia) or Output connect/disconnect switch (original)
// When set, all voices are stacked and instrument is in mono mode
tunerg(x) = outg(hgroup("[1] A-440 Switch", x));
vdtpolyg(x) = outg(hgroup("[2] Voice Detune / Poly", x));
// Voice Detune knob [0-10] (Arturia) or
// Polyphonic switch [red LED below] (Arturia)
// When set, instrument is in polyphonic mode with one oscillator per key
clipg(x) = fxg(vgroup("[9] Soft Clip", x));
// Soft Clipping switch [red LED above]
kg(x) = synthg(hgroup("[1] Keyboard Group", x)); // Keyboard was 3 1/2 octaves
ws(x) = kg(vgroup("[0] Wheels and Switches", x));
s1g(x) = ws(hgroup("[0] Jacks and Rockers", x));
jg(x) = s1g(vgroup("[0] MiniJacks",x));
gdlg(x) = s1g(vgroup("[1] Glide/Decay/Legato Enables",x)); // Arturia
// Glide Hrocker (see original Button version below)
// Decay Hrocker (see original Button version below) => Sets Release (R) of ADSR to either 0 or Decay (R)
// Legato Hrocker (not in original)
s2g(x) = ws(hgroup("[1] [tooltip:Wheels+]", x));
bg(x) = s2g(vgroup("[0] [tooltip:Bend Enable and Range]", x));
wg(x) = s2g(hgroup("[1] [tooltip:Bend and Mod Wheels]", x));
// Using Glide/Decay/Legato enables above following Arturia:
// dg(x) = s2g(hgroup("[2] Glide and Decay momentary pushbuttons", x));
// Glide Button injects portamento as set by Glide knob
// Decay Button uses decay of Loudness Contour (else 0)
keys(x) = kg(hgroup("[1] [tooltip:Keys]", x));
gg(x) = keys(hgroup("[0] [tooltip: Gates]",x));
// leave slot 1 open for sustain (below)
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/SAM/virtualAnalog/virtualAnalogWithEffectsForBrowser.dsp | faust | These are now in a separate file ./effects.dsp
echo = echog(component("echo.dsp")); // ./echo.dsp
flanger = flg(component("flanger.dsp")); // ./flanger.dsp
chorus = chg(component("chorus.dsp")); // ./chorus.dsp
reverb = rg(component("freeverb.dsp"));
Now separate: : echo : flanger : chorus : reverb;
masterVolume is redundant but easier to find
("[0] use as LFO"));
LO, 32', 16', 8', 4', 2'
Osc1 detunes like Osc2 and Osc3 (unlike in the Minimoog where it would be an expensive extra knob):
External input = MAIN OUTPUT when "off"
("[0] use as LFO"));
LO, 32', 16', 8', 4', 2'
pink noise needs some "make-up gain"
("[0] use as LFO"));
LO, 32', 16', 8', 4', 2'
compute oscillator frequency scale factor, staying in lg(Hz) as much as possible:
Manual says 0 to 1.5 octaves
Leave this off until triangle-wave modulation is debugged
F# a tritone above middle C
osc3 not allowed to FM itself
i=1,2
When disconnected from the keyboard, Osc3 can detune 3 octaves up or down (Pat video):
i=1,2
used when osc3 (only) is in LFO mode
lowest range setting is LFO mode for any osc
i is 1-based:
from Minimoog manual
Note: a Duty knob would be better than these two, or in addition
Soon to appear in oscillators.lib:
BYPASS WILL GO AWAY (I think you just open it up all the way to bypass):
VCF is always on
Frequency Cutoff (aka Brightness )
9 octaves (from Minimoog manual)
p: 40, 30, 80, 0.01))
p: : ba.pianokey2hz
was in mr2
Note that VCF has three sources of corner-frequency setting that are added together:
- Corner Freq knob (40 Hz to 20 kHz)
- VCF Contour envelope (0 to 4 octaves)
- Injection 32 of Modulation Mix (0 to 1.5 octaves)
Manual says maximum vcf sweep spans 0 to 4 octaves:
Original Knob went to 10, but we're going to 4 so we can say the knob is in "octaves" units:
in octaves
We are assuming that the modulation-mix range for the VCF freq is 1.5 octaves like it is for oscs 1 and 2:
octaves
FIXME: Start w freqLogHz not freq so we don't need exp(log()) here
FIXME: ARBITRARILY centering on middle C - check device
Attack, Decay, and Sustain ranges are set according to the Minimoog manual:
was Staccato
was Legato
--- Smart Keyboard interface ---
--- functions ---
Signal controls:
MIDI only (see smartkeyb doc)
right?
Signal Parameters
envelopeAmp is multiplied once on entire signal sum
elecGuitar.dsp values used:
Previous guess:
p: MIDI requires frequency in Hz, not piano-keys as we had before
Frequency Range is 0.1 Hz to 20 kHz according to the Minimoog manual:
MIDI REQUIRES THE FOLLOWING PARAMETER TO BE NAMED 'freq':
Oscillator Modulation HrockerRed => apply Modulation Mix output osc1&2 pitches
convert 1/e to 1/2 by slowing down exp
noise amplitude and off-switch ignored here
any offset?
Let layout2.dsp lay us out
one and done
Increase until you get the desired maximum amount of smoothing when fbs==1
fastpow2 = ffunction(float fastpow2(float), "fast_pow2.h", "");
pole radius of feedback smoother
"ground input" switches input to zeros
Warp and Scrubber stuff:
enableEcho went 0 to 1
enableEcho went 1 to 0
Ramps up only during scrub "hold" time and is otherwise zero:
implementation that continues scrubbing where it left off:
Created from flange.dsp 2015/06/21
ideal for dc and reinforced sinusoids (in-phase summed signals)
Kill the groups to save vertical space:
~1 ms at 44.1 kHz = min delay
MUST BE EVEN
Hz
use when depth=1 means "multivibrato" effect (no original => all are modulated)
======================================================
Freeverb
Faster version using fixed delays (20% gain)
======================================================
Constant Parameters
--------------------
value of the gain of fxctrl
feedback of the delays used in allpass filters
Filter Parameters
------------------
Control Sliders
--------------------
Damp : filters the high frequencies of the echoes (especially active for great values of RoomSize)
RoomSize : size of the reverberation room
Dry : original signal
Wet : reverberated signal
Comb and Allpass filters
-------------------------
Reverb components
------------------
fxctrl : add an input gain and a wet-dry control to a stereo FX
----------------------------------------------------------------
Freeverb
---------
JOS:freeverb = fxctrl(fixedgain, wetSlider, stereoReverb(combfeed, allpassfeed, dampSlider, stereospread));
This layout loosely follows the MiniMoog-V
Arturia-only features are labeled
Original versions also added where different
Need vrocker and hrocker toggle switches in Faust!
Need orange and blue color choices
Orange => Connect modulation sources to their destinations
Blue => Turn audio sources On and Off
- and later -
White => Turn performance features On and Off
Black => Select between modulation sources
Julius Smith for Analog Devices 3/1/2017
USAGE: vrockerorange("[0] ModulationEnable");
Minimoog + Effects
Formerly named "Modules" but "Minimoog" group-title is enough
Tune knob = master tune
Oscillator Modulation HrockerRed => apply Modulation Mix output to osc1&2 pitches
[MOVED here from osc3 group] Osc 3 Control VrockerRed => use osc3 as LFO instead of osc3
Glide knob [0:10] = portamento speed
Modulation Mix knob [0:10] (between Osc3 and Noise) = mix of noise and osc3 modulating osc1&2 pitch and/or VCF freq
UNUSED Control switch (for alignment) - Could put Oscillator Modulation switch there
Range rotary switch: LO (slow pulses or rhythm), 32', 16', 8', 4', 2'
Frequency <something> switch: LED to right
Waveform rotary switch: tri, impulse/bent-triangle, saw, pulseWide, pulseMed, pulseNarrow
UNUSED (originall) or Osc 2 Control VrockerRed
Range rotary switch: LO, 32', 16', 8', 4', 2'
Detuning knob: -7 to 7 [NO SWITCH]
Waveform rotary switch: tri, impulse(?), saw, pulseWide, pulseMed, pulseNarrow
Osc 3 Control VrockerRed => use osc3 as LFO instead of osc3
Range rotary switch: LO, 32', 16', 8', 4', 2'
Detuning knob: -7 to 7 [NO SWITCH]
Waveform rotary switch: tri, impulse(?), saw, pulseWide, pulseMed, pulseNarrow
Each row 5 slots to maintain alignment and include red rockers joining VCF area:
mixer row 1 =
Osc1 Volume and Osc1 HrockerBlue & _ & _ & Filter Modulation HrockerRed
Filter Modulation => Modulation Mix output to VCF freq
row 2 = Ext In HrockerBlue and Vol and Overload LED and Keyboard Ctl HrockerRed 1
= Osc2 Volume and Osc2 HrockerBlue and Keyboard Ctl HrockerRed 2
Keyboard Control Modulation 1&2 => 0, 1/3, 2/3, all of Keyboard Control Signal ("gate?") applied to VCF freq
= Noise HrockerBlue and Volume and Noise Type VrockerBlue
= Noise Off and White/Pink selection
two rockers
Osc3 Volume and Osc3 HrockerBlue
Filter Modulation switch
VCF Off switch
Corner Frequency knob
Filter Emphasis knob
Amount of Contour knob
Attack Time knob
Decay Time knob
Sustain Level knob
Attack Time knob
Decay Time knob
Sustain Level knob
Volume knob [0-10]
Unison switch (Arturia) or Output connect/disconnect switch (original)
When set, all voices are stacked and instrument is in mono mode
Voice Detune knob [0-10] (Arturia) or
Polyphonic switch [red LED below] (Arturia)
When set, instrument is in polyphonic mode with one oscillator per key
Soft Clipping switch [red LED above]
Keyboard was 3 1/2 octaves
Arturia
Glide Hrocker (see original Button version below)
Decay Hrocker (see original Button version below) => Sets Release (R) of ADSR to either 0 or Decay (R)
Legato Hrocker (not in original)
Using Glide/Decay/Legato enables above following Arturia:
dg(x) = s2g(hgroup("[2] Glide and Decay momentary pushbuttons", x));
Glide Button injects portamento as set by Glide knob
Decay Button uses decay of Loudness Contour (else 0)
leave slot 1 open for sustain (below) | import("stdfaust.lib");
main = (signal + attach(extInput,amp) : filters : *(ampScaling)) ~ _;
signal = oscs + noise * noiseOff * namp;
oscs = par(i,3,(oscamp(i+1)*osc(i+1))) :> _;
detuneOctaves(1) = osc1(vslider("[2] DeTuning1 [units:Octaves] [midi:ctrl 24] [style:knob]",0.0,-1.0,1.0,0.001));
waveSelect(1) = osc1(vslider("[3] Waveform1 [midi:ctrl 25] [style:knob]",5,0,5,1):int);
amp1Enable = mr1(vslider("[1] On [midi:ctrl 12] [style:knob] [color:blue]",1,0,1,1));
oscamp(1) = mr1(vslider("[0] Osc1 Amp [midi:ctrl 26] [style:knob]",0.5,0.0,1.0,0.001)) * amp1Enable;
sei = mr2(vslider("[0] Ext Input [midi:ctrl 27] [style: knob]",0,0,1.0,0.001));
extInput(fb,extSig) = fb,extSig : select2(eei) : *(sei) : extClipLED;
extClipLED = _ <: _, (abs : >(0.95) : mr2(vbargraph("[2] Ext Input Clip [style:led]",0,1)):!);
keycLED = attach(mr2(vbargraph("[3] Keyboard Ctl [style:led]",0,1)));
detuneOctaves(2) = osc2(vslider("[2] DeTuning2 [units:Octaves] [midi:ctrl 29] [style:knob]",0.41667,-1.0,1.0,0.001));
waveSelect(2) = osc2(vslider("[3] Waveform2 [midi:ctrl 30] [style:knob]",5,0,5,1):int);
amp2Enable = mr3(vslider("[1] On [midi:ctrl 14] [style:knob] [color:blue]",1,0,1,1));
oscamp(2) = mr3(vslider("[0] Osc2 Amp [midi:ctrl 31] [style:knob]",0.5,0.0,1.0,0.001)) * amp2Enable;
namp = mr4(vslider("[0] Noise Amp [midi:ctrl 32] [style: knob]",0.0,0.0,1.0,0.001));
noiseOff = mr4cbg(vslider("[0] On [midi:ctrl 15] [style:knob] [color:blue]",0,0,1,1));
ntype = mr4cbg(vslider("[1] White/Pink [midi:ctrl 16] [tooltip: Choose either White or Pink Noise] [style: knob] [color:blue]",1,0,1,1));
detuneOctaves(3) = osc3(vslider("[2] DeTuning3 [units:Octaves] [midi:ctrl 34] [style:knob]",0.3,-1.0,1.0,0.001));
waveSelect(3) = osc3(vslider("[3] Waveform3 [midi:ctrl 35] [style:knob]",0,0,5,1):int);
amp3Enable = mr5(vslider("[1] On [midi:ctrl 17] [style:knob] [color:blue]",0,0,1,1));
oscamp(3) = mr5(vslider("[0] Osc3 Amp [midi:ctrl 36] [style:knob]",0.5,0.0,1.0,0.001)) * amp3Enable;
waveforms(i) = (tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
modulationShift = select2(oscModEnable, 0.0,
modWheelShift * ( modulationCenterShift + (1.0-modulationCenterShift) * oscNoiseModulation ));
octaveShift(i) = -2+int(octaveSelect(i));
keyFreqGlidedMaybe = select2(osc3Control,osc3FixedFreq,keyFreqGlided);
detuneBoost(3) = select2(osc3Control,3.0,1.0);
detuneOctavesFinal(i) = detuneOctaves(i)*detuneBoost(i);
fBase(i) = keyFreqModulatedShifted(i) * pow(2.0, (masterTuneOctaves+octaveShift(i)+detuneOctavesFinal(i)))
: si.smooth(ba.tau2pole(0.016));
lfoMode(i) = (octaveSelect(i) == 0);
osc(i) = ba.selectn(6, int(waveSelect(i)), tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
tri(i) = select2(lfoMode(i),
os.triangle(f(i)),
os.lf_triangle(f(i)));
saw(i) = select2(lfoMode(i),
os.sawtooth(f(i)),
os.lf_saw(f(i)));
sq(i) = select2(lfoMode(i),
os.square(f(i)),
os.lf_squarewave(f(i)));
os.pulsetrain(f(i),0.25),
lf_pulsetrain(f(i),0.25));
ptn(i) = select2(lfoMode(i),
os.pulsetrain(f(i),0.125),
lf_pulsetrain(f(i),0.125));
lf_pulsetrain(freq,duty) = 2.0*os.lf_pulsetrainpos(freq,duty) - 1.0;
fcLgHz = vcf1(vslider("[1] Corner Freq [unit:Log2(Hz)]
[tooltip: Corner resonance frequency in Log2(Hertz)]
[style: knob]
: si.smooth(ba.tau2pole(0.016));
res = vcf1(vslider("[2] Corner Resonance [midi:ctrl 37] [tooltip: Resonance Q at VCF corner frequency (0 to 1)]
[style: knob]",
0.7, 0, 1, 0.01));
vcfKeyRange = vcf1cbg(vslider("[2] Kbd Ctl [midi:ctrl 38] [tooltip: Keyboard tracking of VCF corner-frequency (0=none, 1=full)]
[style: knob]",
vcfModEnable = vcf1cbg(vslider("[1] Filter Mod. [midi:ctrl 19] [color:red] [style:knob] [tooltip: Filter Modulation => Route Modulation Mix output to VCF frequency]",1,0,1,1));
vcfContourAmountOctaves = vcf1(vslider("[3] Amount of Contour (octaves) [midi:ctrl 39] [style: knob]", 1.2, 0, 4.0, 0.001));
vcfModulationOctaves = vcfModMixModulationOctaves + vcfContourOctaves;
vcfKeyShiftOctaves = vcfKeyRange * keyShiftOctaves;
modulatedFcLgHz = fcLgHz + vcfModulationOctaves + vcfKeyShiftOctaves;
fc = min((0.5*ma.SR), pow(2.0,modulatedFcLgHz));
vcf = ve.moog_vcf_2bn(res,fc);
attT60VCF = 0.001 * vcf2(vslider("[0] AttackF [midi:ctrl 40] [tooltip: Attack Time] [unit:ms] [style: knob]",1400,10,10000,1));
decT60VCF = 0.001 * vcf2(vslider("[0] DecayF [midi:ctrl 41] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,10,10000,1));
susLvlVCF = 0.01 * vcf2(vslider("[0] SustainF [midi:ctrl 42] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
relT60VCF = select2(decayButton,0.010,decT60VCF);
envelopeVCF = en.adsre(attT60VCF,decT60VCF,susLvlVCF,relT60VCF,gate);
declare interface "SmartKeyboard{
'Number of Keyboards':'2',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'72',
'Keyboard 1 - Lowest Key':'60'
}";
keyDownHold = gg(vslider("[0] gateHold [tooltip: lock sustain pedal on (hold gate set at 1)][style:knob]",0,0,1,1));
keyDown = gg(button("[1] gate [tooltip: The gate signal is 1 during a
note and 0 otherwise. For MIDI, NoteOn occurs when the gate
transitions from 0 to 1, and NoteOff is an event corresponding
to the gate transition from 1 to 0. The name of this Faust
button must be 'gate'.]"));
sustain = gg(button("[1] sustain [midi:ctrl 64]
gate = keyDown + keyDownHold + sustain : min(1);
attT60 = 0.001 * ng(vslider("[0] AttackA [midi:ctrl 43] [tooltip: Attack Time] [unit:ms] [style: knob]",2,0,5000,0.1));
decT60 = 0.001 * ng(vslider("[0] DecayA [midi:ctrl 44] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,0,10000,0.1));
susLvl = 0.01 * ng(vslider("[0] SustainA [midi:ctrl 45] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
envelopeAmpNoAM = en.adsre(attT60,decT60,susLvl,relT60,gate);
AMDepth = 0.5;
envelopeAmp = select2(oscModEnable, envelopeAmpNoAM,
envelopeAmpNoAM * (1.0 + AMDepth*modWheel * 0.5 * (1.0+oscNoiseModulation)));
ampL = volg(vslider("[1] gain [style:knob] [tooltip: Amplitude]",0.2,0,1.0,0.001));
bend = wg(ba.semi2ratio(hslider("[0] bend [style:knob] [midi:pitchwheel]",0,-2,2,0.01))) : si.polySmooth(gate,0.999,1);
modWheel = wg(vslider("[1] mod [midi:ctrl 1] [style:knob] [tooltip: PitchModulation amplitude in octaves]",
0,0,1.0,0.01)) : si.polySmooth(gate,0.999,1);
keyFreqBent = bend * kg(hslider("[2] freq [unit:Hz] [style:knob]",220,0.1,20000,0.1));
masterVolume = vg(vslider("MasterVolume [style:knob] [midi:ctrl 7] [tooltip: master volume, MIDI controlled]",
0.7,0,1,0.001))
: si.smooth(ba.tau2pole(0.16));
masterTuneOctaves = dg(vslider("[0] Tune [midi:ctrl 47] [unit:Octaves] [style:knob]
[tooltip: Frequency-shift up or down for all oscillators in Octaves]", 0.0,-1.0,1.0,0.001));
glide = gmmg(vslider("[0] Glide [midi:ctrl 5] [unit:sec/octave] [style:knob] [scale:log]
[tooltip: Portamento (frequency-glide) in seconds per octave]",
0.008,0.001,1.0,0.001));
keyFreqGlided = keyFreqBent : si.smooth(legatoPole);
mmix = gmmg(vslider("[1] Mod. Mix [midi:ctrl 48] [style:knob] [tooltip: Modulation Mix: Osc3 (0) to Noise (1)]",
0.0,0.0,1.0,0.001));
osc3Control = dsg(vslider("[1] Osc. 3 Ctl [midi:ctrl 9] [color:red] [style:knob] [tooltip:Oscillator 3 frequency tracks the keyboard if on, else not",0,0,1,1):int);
effect = _,_ : +
: component_echo
: component_flanger
: component_chorus
: component_freeverb;
component_echo = environment {
knobs_group(x) = ekg(x);
switches_group(x) = esg(x);
dmaxs = float(dmax)/44100.0;
inputSelect(gi) = _,0 : select2(gi);
echo_mono(dmax,curdel,tapdel,fb,fbspr,gi) = inputSelect(gi) : (+:si.smooth(fbspr)
<: de.fdelay(dmax,curdel),
de.fdelay(dmax,tapdel))
~(*(fb),!) : !,_;
tau2pole(tau) = ba.if(tau>0, exp(-1.0/(tau*ma.SR)), 0.0);
t60smoother(dEchoT60) = si.smooth(tau2pole(dEchoT60/6.91));
dEchoT60 = knobs_group(vslider("[1] DelayT60 [midi:ctrl 60] [style:knob]", 0.5, 0, 100, 0.001));
dEchoSamplesRaw = knobs_group(vslider("[0] Delay [midi:ctrl 61] [style:knob]", 0.5, 0.001, (dmaxs-0.001), 0.001)) * ma.SR;
dEchoSamples = dEchoSamplesRaw : t60smoother(dEchoT60);
warpRaw = knobs_group(vslider("[0] Warp [midi:ctrl 62] [style:knob]", 0, -1.0, 1.0, 0.001));
scrubAmpRaw = 0;
scrubPhaseRaw = 0;
fb = knobs_group(vslider("[2] Feedback [midi:ctrl 2] [style:knob]", .3, 0.0, 1.0, 0.0001));
amp = knobs_group(vslider("[3] Amp [midi:ctrl 75] [style:knob]", .5, 0, 1, 0.001)) : si.smooth(ba.tau2pole(ampT60/6.91));
ampT60 = 0.15661;
fbs = knobs_group(vslider("[5] [midi:ctrl 76] FeedbackSm [style:knob]", 0, 0, 1, 0.00001));
enableEcho = (scrubAmpRaw > 0.00001);
counter = (enableEcho * (triggerScrubOn : + ~ +(1) * enableEcho : -(2))) & (dmax-1);
scrubPhase = scrubPhaseRaw : t60smoother(dEchoT60*(1-triggerScrubOff));
scrubAmp = scrubAmpRaw : t60smoother(dEchoT60*(1-triggerScrubOff));
warp = warpRaw : t60smoother(dEchoT60);
dTapSamplesRaw = dEchoSamplesRaw * (1.0 + warp + scrubPhase * scrubAmp) + float(counter);
dTapSamples = dTapSamplesRaw : t60smoother(dEchoT60*(1-triggerScrubOff));
echo_process = _ <: _, amp * echo_mono(dmax,dEchoSamples,dTapSamples,fb,fbspr(fbs),gi) : +;
}.echo_process;
component_flanger = environment {
flanger_process = ba.bypass1(fbp,flanger_mono_gui);
meter_group(x) = flsg(x);
ctl_group(x) = flkg(x);
del_group(x) = flkg(x);
lvl_group(x) = flkf(x);
flangeview = lfo(freq);
flanger_mono_gui = attach(flangeview) : flanger_mono(dmax,curdel,depth,fb,invert,lfoshape);
sinlfo(freq) = (1 + os.oscrs(freq))/2;
trilfo(freq) = 1.0-abs(os.saw1(freq));
lfo(f) = (lfoshape * trilfo(f)) + ((1-lfoshape) * sinlfo(f));
dmax = 2048;
dflange = ((dmax-1)-odflange)*del_group(vslider("[1] Delay [midi:ctrl 50][style:knob]", 0.22, 0, 1, 1));
freq = ctl_group(vslider("[1] Rate [midi:ctrl 51] [unit:Hz] [style:knob]", 0.5, 0, 10, 0.01)) : si.smooth(ba.tau2pole(freqT60/6.91));
freqT60 = 0.15661;
depth = ctl_group(vslider("[3] Depth [midi:ctrl 52] [style:knob]", .75, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91));
depthT60 = 0.15661;
fb = ctl_group(vslider("[5] Feedback [midi:ctrl 53] [style:knob]", 0, -0.995, 0.99, 0.001)) : si.smooth(ba.tau2pole(fbT60/6.91));
fbT60 = 0.15661;
lfoshape = ctl_group(vslider("[7] Waveshape [midi:ctrl 54] [style:knob]", 0, 0, 1, 0.001));
curdel = odflange+dflange*lfo(freq);
fbp = 1-int(flsg(vslider("[0] Enable [midi:ctrl 102][style:knob]",0,0,1,1)));
invert = flsg(vslider("[1] Invert [midi:ctrl 49][style:knob]",0,0,1,1):int);
}.flanger_process;
component_chorus = environment {
chorus_process = ba.bypass1to2(cbp,chorus_mono(dmax,curdel,rate,sigma,do2,voices));
dmax = 8192;
curdel = dmax * ckg(vslider("[0] Delay [midi:ctrl 55] [style:knob]", 0.5, 0, 1, 1)) : si.smooth(0.999);
rateMin = 0.01;
rateT60 = 0.15661;
rate = ckg(vslider("[1] Rate [midi:ctrl 56] [unit:Hz] [style:knob]", 0.5, rateMin, rateMax, 0.0001))
: si.smooth(ba.tau2pole(rateT60/6.91));
depth = ckg(vslider("[4] Depth [midi:ctrl 57] [style:knob]", 0.5, 0, 1, 0.001)) : si.smooth(ba.tau2pole(depthT60/6.91));
depthT60 = 0.15661;
delayPerVoice = 0.5*curdel/voices;
sigma = delayPerVoice * ckg(vslider("[6] Deviation [midi:ctrl 58] [style:knob]",0.5,0,1,0.001)) : si.smooth(0.999);
periodic = 1;
cbp = 1-int(csg(vslider("[0] Enable [midi:ctrl 103][style:knob]",0,0,1,1)));
chorus_mono(dmax,curdel,rate,sigma,do2,voices)
= _ <: (*(1-do2)<:_,_),(*(do2) <: par(i,voices,voice(i)) :> _,_) : ro.interleave(2,2) : +,+
with {
angle(i) = 2*ma.PI*(i/2)/voices + (i%2)*ma.PI/2;
voice(i) = de.fdelay(dmax,min(dmax,del(i))) * cos(angle(i));
del(i) = curdel*(i+1)/voices + dev(i);
rates(i) = rate/float(i+1);
dev(i) = sigma * os.oscp(rates(i),i*2*ma.PI/voices);
};
}.chorus_process;
component_freeverb = environment {
import("stdfaust.lib");
declare name "freeverb";
declare version "1.0";
declare author "Grame";
declare license "BSD";
declare copyright "(c) GRAME 2006 and MoForte Inc. 2017";
declare reference "https://ccrma.stanford.edu/~jos/pasp/Freeverb.html";
scalewet = 3.0;
scaledry = 2.0;
scaledamp = 0.4;
scaleroom = 0.28;
offsetroom = 0.7;
initialroom = 0.5;
initialdamp = 0.5;
initialwet = 1.0/scalewet;
initialdry = 0;
initialwidth= 1.0;
initialmode = 0.0;
freezemode = 0.5;
stereospread= 23;
combtuningL1 = 1116;
combtuningL2 = 1188;
combtuningL3 = 1277;
combtuningL4 = 1356;
combtuningL5 = 1422;
combtuningL6 = 1491;
combtuningL7 = 1557;
combtuningL8 = 1617;
allpasstuningL1 = 556;
allpasstuningL2 = 441;
allpasstuningL3 = 341;
allpasstuningL4 = 225;
dampSlider = rkg(vslider("Damp [midi:ctrl 3] [style:knob]",0.5, 0, 1, 0.025))*scaledamp;
roomsizeSlider = rkg(vslider("RoomSize [midi:ctrl 4] [style:knob]", 0.5, 0, 1, 0.025))*scaleroom + offsetroom;
wetSlider = rkg(vslider("Wet [midi:ctrl 79] [style:knob]", 0.3333, 0, 1, 0.025));
combfeed = roomsizeSlider;
allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_);
comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb));
monoReverb(fb1, fb2, damp, spread)
= _ <: comb(combtuningL1+spread, fb1, damp),
comb(combtuningL2+spread, fb1, damp),
comb(combtuningL3+spread, fb1, damp),
comb(combtuningL4+spread, fb1, damp),
comb(combtuningL5+spread, fb1, damp),
comb(combtuningL6+spread, fb1, damp),
comb(combtuningL7+spread, fb1, damp),
comb(combtuningL8+spread, fb1, damp)
+>
allpass (allpasstuningL1+spread, fb2)
: allpass (allpasstuningL2+spread, fb2)
: allpass (allpasstuningL3+spread, fb2)
: allpass (allpasstuningL4+spread, fb2)
;
monoReverbToStereo(fb1, fb2, damp, spread)
= + <: monoReverb(fb1, fb2, damp, 0) <: _,_;
stereoReverb(fb1, fb2, damp, spread)
= + <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread);
monoToStereoReverb(fb1, fb2, damp, spread)
= _ <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread);
fxctrl(g,w,Fx) = _,_ <: (*(g),*(g) : Fx : *(w),*(w)), *(1-w), *(1-w) +> _,_;
rbp = 1-int(rsg(vslider("[0] Enable [midi:ctrl 104][style:knob]",0,0,1,1)));
freeverb = fxctrl(fixedgain, wetSlider, monoReverbToStereo(combfeed, allpassfeed, dampSlider, stereospread));
freeverb_process = ba.bypass2(rbp,freeverb);
}.freeverb_process;
vrocker(x) = checkbox("%%x [style:vrocker]");
hrocker(x) = checkbox("%%x [style:hrocker]");
vrockerblue(x) = checkbox("%x [style:vrocker] [color:blue]");
vrockerblue(x) = checkbox("%x [style:vrocker] [color:blue]");
hrockerblue(x) = checkbox("%%x [style:hrocker] [color:blue]");
vrockerred(x) = checkbox("%%x [style:vrocker] [color:red]");
hrockerred(x) = checkbox("%%x [style:hrocker] [color:red]");
declare designer "Robert A. Moog";
synthg(x) = mmg(vgroup("[0] Minimoog",x));
fxg(x) = mmg(hgroup("[1] Effects",x));
mg(x) = synthg(hgroup("[0]",x));
vg(x) = cg(hgroup("[0] Master Volume", x));
dg(x) = cg(hgroup("[1] Oscillator Tuning & Switching", x));
dsg(x) = dg(vgroup("[1] Switches", x));
gmmg(x) = cg(hgroup("[2] Glide and ModMix", x));
og(x) = mg(vgroup("[1] Oscillator Bank", x));
osc1(x) = og(hgroup("[1] Oscillator 1", x));
osc2(x) = og(hgroup("[2] Oscillator 2", x));
osc3(x) = og(hgroup("[3] Oscillator 3", x));
mixg(x) = mg(vgroup("[2] Mixer", x));
modg(x) = mg(vgroup("[3] Modifiers", x));
vcfg(x) = modg(vgroup("[0] Filter", x));
vcf1(x) = vcfg(hgroup("[0] [tooltip:freq, Q, ContourScale]", x));
vcf1cbg(x) = vcf1(vgroup("[0] [tooltip:two checkboxes]", x));
vcf2(x) = vcfg(hgroup("[1] Filter Contour [tooltip:AttFilt, DecFilt, Sustain Level for Filter Contour]", x));
ng(x) = modg(hgroup("[1] Loudness Contour", x));
echog(x) = fxg(hgroup("[4] Echo",x));
ekg(x) = echog(vgroup("[0] Knobs",x));
esg(x) = echog(vgroup("[1] Switches",x));
flg(x) = fxg(hgroup("[5] Flanger",x));
flkg(x) = flg(vgroup("[0] Knobs",x));
flsg(x) = flg(vgroup("[1] Switches",x));
chg(x) = fxg(hgroup("[6] Chorus",x));
ckg(x) = chg(vgroup("[0] Knobs",x));
csg(x) = chg(vgroup("[1] Switches",x));
rg(x) = fxg(hgroup("[7] Reverb",x));
rkg(x) = rg(vgroup("[0] Knobs",x));
rsg(x) = rg(vgroup("[1] Switches",x));
outg(x) = fxg(vgroup("[8] Output", x));
volg(x) = outg(hgroup("[0] Volume Main Output", x));
tunerg(x) = outg(hgroup("[1] A-440 Switch", x));
vdtpolyg(x) = outg(hgroup("[2] Voice Detune / Poly", x));
clipg(x) = fxg(vgroup("[9] Soft Clip", x));
ws(x) = kg(vgroup("[0] Wheels and Switches", x));
s1g(x) = ws(hgroup("[0] Jacks and Rockers", x));
jg(x) = s1g(vgroup("[0] MiniJacks",x));
s2g(x) = ws(hgroup("[1] [tooltip:Wheels+]", x));
bg(x) = s2g(vgroup("[0] [tooltip:Bend Enable and Range]", x));
wg(x) = s2g(hgroup("[1] [tooltip:Bend and Mod Wheels]", x));
keys(x) = kg(hgroup("[1] [tooltip:Keys]", x));
gg(x) = keys(hgroup("[0] [tooltip: Gates]",x));
|
f00dbbddd5a5e2ea65d8e153284aa02eeaf480703447add94023e9ac034784cd | HMaxime/CONDUCT | virtualAnalog.dsp | import("stdfaust.lib");
// These are now in a separate file ./effects.dsp
// echo = echog(component("echo.dsp")); // ./echo.dsp
// flanger = flg(component("flanger.dsp")); // ./flanger.dsp
// chorus = chg(component("chorus.dsp")); // ./chorus.dsp
// reverb = rg(component("freeverb.dsp"));
process = main <: _,_; // Now separate: : echo : flanger : chorus : reverb;
main = (signal + extInput : filters : *(ampScaling)) ~ _;
signal = oscs + noise * noiseOff * namp;
ampScaling = envelopeAmp * masterVolume; // masterVolume is redundant but easier to find
oscs = par(i,3,(oscamp(i+1)*osc(i+1))) :> _;
controlSelect(1) = osc1(vrockerred); // ("[0] use as LFO"));
octaveSelect(1) = osc1(vslider("[1] Octave1 [midi:ctrl 23] [style:knob]",1,0,5,1):int); // LO, 32', 16', 8', 4', 2'
// Osc1 detunes like Osc2 and Osc3 (unlike in the Minimoog where it would be an expensive extra knob):
detuneOctaves(1) = osc1(vslider("[2] DeTuning1 [units:Octaves] [midi:ctrl 24] [style:knob]",0.0,-1.0,1.0,0.001));
waveSelect(1) = osc1(vslider("[3] Waveform1 [midi:ctrl 25] [style:knob]",5,0,5,1):int);
amp1Enable = mr1(vslider("[1] On [midi:ctrl 12] [style:knob] [color:blue]",1,0,1,1));
oscamp(1) = mr1(vslider("[0] Osc1 Amp [midi:ctrl 26] [style:knob]",0.5,0.0,1.0,0.001)) * amp1Enable;
eei = mr2(vslider("[1] On [midi:ctrl 13] [style:knob] [color:blue]",0,0,1,1)); // External input = MAIN OUTPUT when "off"
sei = mr2(vslider("[0] Ext Input [midi:ctrl 27] [style: knob]",0,0,1.0,0.001));
extInput(fb,extSig) = fb,extSig : select2(eei) : *(sei) : extClipLED;
extClipLED = _ <: _, (abs : >(0.95) : mr2(vbargraph("[2] Ext Input Clip [style:led]",0,1)):!);
keycLED = attach(mr2(vbargraph("[3] Keyboard Ctl [style:led]",0,1)));
controlSelect(2) = osc2(vrockerred); // ("[0] use as LFO"));
octaveSelect(2) = osc2(vslider("[1] Octave2 [midi:ctrl 28] [style:knob]",1,0,5,1):int); // LO, 32', 16', 8', 4', 2'
detuneOctaves(2) = osc2(vslider("[2] DeTuning2 [units:Octaves] [midi:ctrl 29] [style:knob]",0.41667,-1.0,1.0,0.001));
waveSelect(2) = osc2(vslider("[3] Waveform2 [midi:ctrl 30] [style:knob]",5,0,5,1):int);
amp2Enable = mr3(vslider("[1] On [midi:ctrl 14] [style:knob] [color:blue]",1,0,1,1));
oscamp(2) = mr3(vslider("[0] Osc2 Amp [midi:ctrl 31] [style:knob]",0.5,0.0,1.0,0.001)) * amp2Enable;
noise = select2(ntype,no.noise,10.0*no.pink_noise); // pink noise needs some "make-up gain"
namp = mr4(vslider("[0] Noise Amp [midi:ctrl 32] [style: knob]",0.0,0.0,1.0,0.001));
noiseOff = mr4cbg(vslider("[0] On [midi:ctrl 15] [style:knob] [color:blue]",0,0,1,1));
ntype = mr4cbg(vslider("[1] White/Pink [midi:ctrl 16] [tooltip: Choose either White or Pink Noise] [style: knob] [color:blue]",1,0,1,1));
controlSelect(3) = osc3(vrockerred); // ("[0] use as LFO"));
octaveSelect(3) = osc3(vslider("[1] Octave3 [midi:ctrl 33] [style:knob]",0,0,5,1):int); // LO, 32', 16', 8', 4', 2'
detuneOctaves(3) = osc3(vslider("[2] DeTuning3 [units:Octaves] [midi:ctrl 34] [style:knob]",0.3,-1.0,1.0,0.001));
waveSelect(3) = osc3(vslider("[3] Waveform3 [midi:ctrl 35] [style:knob]",0,0,5,1):int);
amp3Enable = mr5(vslider("[1] On [midi:ctrl 17] [style:knob] [color:blue]",0,0,1,1));
oscamp(3) = mr5(vslider("[0] Osc3 Amp [midi:ctrl 36] [style:knob]",0.5,0.0,1.0,0.001)) * amp3Enable;
waveforms(i) = (tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
// compute oscillator frequency scale factor, staying in lg(Hz) as much as possible:
modWheelShift = 1.5*modWheel; // Manual says 0 to 1.5 octaves
modulationCenterShift = 0; // Leave this off until triangle-wave modulation is debugged
modulationShift = select2(oscModEnable, 0.0,
modWheelShift * ( modulationCenterShift + (1.0-modulationCenterShift) * oscNoiseModulation ));
octaveShift(i) = -2+int(octaveSelect(i));
osc3FixedFreq = 369.994; // F# a tritone above middle C
keyFreqGlidedMaybe = select2(osc3Control,osc3FixedFreq,keyFreqGlided);
keyFreqModulatedShifted(3) = keyFreqGlidedMaybe; // osc3 not allowed to FM itself
keyFreqModulatedShifted(i) = keyFreqGlided * pow(2.0, modulationShift); // i=1,2
// When disconnected from the keyboard, Osc3 can detune 3 octaves up or down (Pat video):
detuneBoost(3) = select2(osc3Control,3.0,1.0);
detuneBoost(i) = 1.0; // i=1,2
detuneOctavesFinal(i) = detuneOctaves(i)*detuneBoost(i);
fBase(i) = keyFreqModulatedShifted(i) * pow(2.0, (masterTuneOctaves+octaveShift(i)+detuneOctavesFinal(i)))
: si.smooth(ba.tau2pole(0.016));
fLFOBase(i) = 3.0 * pow(2.0, detuneOctavesFinal(i)); // used when osc3 (only) is in LFO mode
lfoMode(i) = (octaveSelect(i) == 0);
f(i) = select2(lfoMode(i), fBase(i), fLFOBase(i)); // lowest range setting is LFO mode for any osc
// i is 1-based:
osc(i) = ba.selectn(6, int(waveSelect(i)), tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
tri(i) = select2(lfoMode(i),
os.triangle(f(i)),
os.lf_triangle(f(i)));
bent(i) = 0.5*tri(i) + 0.5*saw(i); // from Minimoog manual
saw(i) = select2(lfoMode(i),
os.sawtooth(f(i)),
os.lf_saw(f(i)));
sq(i) = select2(lfoMode(i),
os.square(f(i)),
os.lf_squarewave(f(i)));
ptm(i) = select2(lfoMode(i), // Note: a Duty knob would be better than these two, or in addition
os.pulsetrain(f(i),0.25),
lf_pulsetrain(f(i),0.25));
ptn(i) = select2(lfoMode(i),
os.pulsetrain(f(i),0.125),
lf_pulsetrain(f(i),0.125));
// Soon to appear in oscillators.lib:
lf_pulsetrain(freq,duty) = 2.0*os.lf_pulsetrainpos(freq,duty) - 1.0;
import("layout2.dsp"); // follows the Mini Moog front panel: ./layout2.dsp
filters = ba.bypass1(bp,vcf); // BYPASS WILL GO AWAY (I think you just open it up all the way to bypass):
bp = 0; // VCF is always on
fcLgHz = vcf1(vslider("[1] Corner Freq [unit:Log2(Hz)]
[tooltip: Corner resonance frequency in Log2(Hertz)]
[style: knob]
[midi:ctrl 74]", // Frequency Cutoff (aka Brightness )
10.6, log(40.0)/log(2), log(20000.0)/log(2), 0.000001)) // 9 octaves (from Minimoog manual)
//p: 40, 30, 80, 0.01))
//p: : ba.pianokey2hz
: si.smooth(ba.tau2pole(0.016));
res = vcf1(vslider("[2] Corner Resonance [midi:ctrl 37] [tooltip: Resonance Q at VCF corner frequency (0 to 1)]
[style: knob]",
0.7, 0, 1, 0.01));
vcfKeyRange = vcf1cbg(vslider("[2] Kbd Ctl [midi:ctrl 38] [tooltip: Keyboard tracking of VCF corner-frequency (0=none, 1=full)]
[style: knob]",
1, 0, 1, 0.001)); // was in mr2
vcfModEnable = vcf1cbg(vslider("[1] Filter Mod. [midi:ctrl 19] [color:red] [style:knob] [tooltip: Filter Modulation => Route Modulation Mix output to VCF frequency]",1,0,1,1));
// Note that VCF has three sources of corner-frequency setting that are added together:
// - Corner Freq knob (40 Hz to 20 kHz)
// - VCF Contour envelope (0 to 4 octaves)
// - Injection 32 of Modulation Mix (0 to 1.5 octaves)
// Manual says maximum vcf sweep spans 0 to 4 octaves:
// Original Knob went to 10, but we're going to 4 so we can say the knob is in "octaves" units:
vcfContourAmountOctaves = vcf1(vslider("[3] Amount of Contour (octaves) [midi:ctrl 39] [style: knob]", 1.2, 0, 4.0, 0.001));
vcfContourOctaves = vcfContourAmountOctaves * envelopeVCF; // in octaves
// We are assuming that the modulation-mix range for the VCF freq is 1.5 octaves like it is for oscs 1 and 2:
vcfModMixModulationOctaves = select2(vcfModEnable, 0, (1.5 * oscNoiseModulation * modWheel)); // octaves
vcfModulationOctaves = vcfModMixModulationOctaves + vcfContourOctaves;
keyFreqLogHzGlided = log(keyFreqGlided)/log(2.0); // FIXME: Start w freqLogHz not freq so we don't need exp(log()) here
keyShiftOctaves = keyFreqLogHzGlided - log(261.625565)/log(2.0); // FIXME: ARBITRARILY centering on middle C - check device
vcfKeyShiftOctaves = vcfKeyRange * keyShiftOctaves;
modulatedFcLgHz = fcLgHz + vcfModulationOctaves + vcfKeyShiftOctaves;
fc = min((0.5*ma.SR), pow(2.0,modulatedFcLgHz));
vcf = ve.moog_vcf_2bn(res,fc);
// Attack, Decay, and Sustain ranges are set according to the Minimoog manual:
attT60VCF = 0.001 * vcf2(vslider("[0] AttackF [midi:ctrl 40] [tooltip: Attack Time] [unit:ms] [style: knob]",1400,10,10000,1));
decT60VCF = 0.001 * vcf2(vslider("[0] DecayF [midi:ctrl 41] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,10,10000,1));
susLvlVCF = 0.01 * vcf2(vslider("[0] SustainF [midi:ctrl 42] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
decayButton = wg(vslider("Decay [midi:ctrl 20] [tooltip:Envelope Release either Decay value or 0][style:knob]",1,0,1,1):int); // was Staccato
legatoButton = wg(vslider("Glide [midi:ctrl 65] [tooltip: Glide from note to note][style:knob]",1,0,1,1)); // was Legato
relT60VCF = select2(decayButton,0.010,decT60VCF);
envelopeVCF = en.adsre(attT60VCF,decT60VCF,susLvlVCF,relT60VCF,gate);
// --- Smart Keyboard interface ---
declare interface "SmartKeyboard{
'Number of Keyboards':'2',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'72',
'Keyboard 1 - Lowest Key':'60'
}";
// --- functions ---
// Signal controls:
keyDownHold = gg(vslider("[0] gateHold [tooltip: lock sustain pedal on (hold gate set at 1)][style:knob]",0,0,1,1));
keyDown = gg(button("[1] gate [tooltip: The gate signal is 1 during a
note and 0 otherwise. For MIDI, NoteOn occurs when the gate
transitions from 0 to 1, and NoteOff is an event corresponding
to the gate transition from 1 to 0. The name of this Faust
button must be 'gate'.]"));
sustain = gg(button("[1] sustain [midi:ctrl 64]
[tooltip: extends the gate (keeps it set to 1)]")); // MIDI only (see smartkeyb doc)
gate = keyDown + keyDownHold + sustain : min(1);
attT60 = 0.001 * ng(vslider("[0] AttackA [midi:ctrl 43] [tooltip: Attack Time] [unit:ms] [style: knob]",2,0,5000,0.1));
decT60 = 0.001 * ng(vslider("[0] DecayA [midi:ctrl 44] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,0,10000,0.1));
susLvl = 0.01 * ng(vslider("[0] SustainA [midi:ctrl 45] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
relT60 = select2(decayButton,0.010,decT60); // right?
envelopeAmpNoAM = en.adsre(attT60,decT60,susLvl,relT60,gate);
AMDepth = 0.5;
envelopeAmp = select2(oscModEnable, envelopeAmpNoAM,
envelopeAmpNoAM * (1.0 + AMDepth*modWheel * 0.5 * (1.0+oscNoiseModulation)));
// Signal Parameters
ampL = volg(vslider("[1] gain [style:knob] [tooltip: Amplitude]",0.2,0,1.0,0.001));
amp = ampL : si.smoo; // envelopeAmp is multiplied once on entire signal sum
//elecGuitar.dsp values used:
bend = wg(ba.semi2ratio(hslider("[0] bend [style:knob] [midi:pitchwheel]",0,-2,2,0.01))) : si.polySmooth(gate,0.999,1);
//Previous guess:
modWheel = wg(vslider("[1] mod [midi:ctrl 1] [style:knob] [tooltip: PitchModulation amplitude in octaves]",
0,0,1.0,0.01)) : si.polySmooth(gate,0.999,1);
//p: MIDI requires frequency in Hz, not piano-keys as we had before
// Frequency Range is 0.1 Hz to 20 kHz according to the Minimoog manual:
// MIDI REQUIRES THE FOLLOWING PARAMETER TO BE NAMED 'freq':
keyFreqBent = bend * kg(hslider("[2] freq [unit:Hz] [style:knob]",220,0.1,20000,0.1));
masterVolume = vg(vslider("MasterVolume [style:knob] [midi:ctrl 7] [tooltip: master volume, MIDI controlled]",
0.7,0,1,0.001))
: si.smooth(ba.tau2pole(0.16));
masterTuneOctaves = dg(vslider("[0] Tune [midi:ctrl 47] [unit:Octaves] [style:knob]
[tooltip: Frequency-shift up or down for all oscillators in Octaves]", 0.0,-1.0,1.0,0.001));
// Oscillator Modulation HrockerRed => apply Modulation Mix output osc1&2 pitches
glide = gmmg(vslider("[0] Glide [midi:ctrl 5] [unit:sec/octave] [style:knob] [scale:log]
[tooltip: Portamento (frequency-glide) in seconds per octave]",
0.008,0.001,1.0,0.001));
legatoPole = select2(legatoButton,0.5,ba.tau2pole(glide*exp(1.0f)/2.0f)); // convert 1/e to 1/2 by slowing down exp
keyFreqGlided = keyFreqBent : si.smooth(legatoPole);
mmix = gmmg(vslider("[1] Mod. Mix [midi:ctrl 48] [style:knob] [tooltip: Modulation Mix: Osc3 (0) to Noise (1)]",
0.0,0.0,1.0,0.001));
oscNoiseModulation = (mmix * noise) + ((1.0-mmix) * osc(3)); // noise amplitude and off-switch ignored here
oscModEnable = dsg(vslider("[0] Osc. Mod. [midi:ctrl 22] [color:red] [style:knob] [tooltip:Oscillator Modulation adds Modulation Mix output to osc1&2 frequencies",1,0,1,1)); // any offset?
osc3Control = dsg(vslider("[1] Osc. 3 Ctl [midi:ctrl 9] [color:red] [style:knob] [tooltip:Oscillator 3 frequency tracks the keyboard if on, else not",0,0,1,1):int);
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/SAM/virtualAnalog/virtualAnalog.dsp | faust | These are now in a separate file ./effects.dsp
echo = echog(component("echo.dsp")); // ./echo.dsp
flanger = flg(component("flanger.dsp")); // ./flanger.dsp
chorus = chg(component("chorus.dsp")); // ./chorus.dsp
reverb = rg(component("freeverb.dsp"));
Now separate: : echo : flanger : chorus : reverb;
masterVolume is redundant but easier to find
("[0] use as LFO"));
LO, 32', 16', 8', 4', 2'
Osc1 detunes like Osc2 and Osc3 (unlike in the Minimoog where it would be an expensive extra knob):
External input = MAIN OUTPUT when "off"
("[0] use as LFO"));
LO, 32', 16', 8', 4', 2'
pink noise needs some "make-up gain"
("[0] use as LFO"));
LO, 32', 16', 8', 4', 2'
compute oscillator frequency scale factor, staying in lg(Hz) as much as possible:
Manual says 0 to 1.5 octaves
Leave this off until triangle-wave modulation is debugged
F# a tritone above middle C
osc3 not allowed to FM itself
i=1,2
When disconnected from the keyboard, Osc3 can detune 3 octaves up or down (Pat video):
i=1,2
used when osc3 (only) is in LFO mode
lowest range setting is LFO mode for any osc
i is 1-based:
from Minimoog manual
Note: a Duty knob would be better than these two, or in addition
Soon to appear in oscillators.lib:
follows the Mini Moog front panel: ./layout2.dsp
BYPASS WILL GO AWAY (I think you just open it up all the way to bypass):
VCF is always on
Frequency Cutoff (aka Brightness )
9 octaves (from Minimoog manual)
p: 40, 30, 80, 0.01))
p: : ba.pianokey2hz
was in mr2
Note that VCF has three sources of corner-frequency setting that are added together:
- Corner Freq knob (40 Hz to 20 kHz)
- VCF Contour envelope (0 to 4 octaves)
- Injection 32 of Modulation Mix (0 to 1.5 octaves)
Manual says maximum vcf sweep spans 0 to 4 octaves:
Original Knob went to 10, but we're going to 4 so we can say the knob is in "octaves" units:
in octaves
We are assuming that the modulation-mix range for the VCF freq is 1.5 octaves like it is for oscs 1 and 2:
octaves
FIXME: Start w freqLogHz not freq so we don't need exp(log()) here
FIXME: ARBITRARILY centering on middle C - check device
Attack, Decay, and Sustain ranges are set according to the Minimoog manual:
was Staccato
was Legato
--- Smart Keyboard interface ---
--- functions ---
Signal controls:
MIDI only (see smartkeyb doc)
right?
Signal Parameters
envelopeAmp is multiplied once on entire signal sum
elecGuitar.dsp values used:
Previous guess:
p: MIDI requires frequency in Hz, not piano-keys as we had before
Frequency Range is 0.1 Hz to 20 kHz according to the Minimoog manual:
MIDI REQUIRES THE FOLLOWING PARAMETER TO BE NAMED 'freq':
Oscillator Modulation HrockerRed => apply Modulation Mix output osc1&2 pitches
convert 1/e to 1/2 by slowing down exp
noise amplitude and off-switch ignored here
any offset? | import("stdfaust.lib");
main = (signal + extInput : filters : *(ampScaling)) ~ _;
signal = oscs + noise * noiseOff * namp;
oscs = par(i,3,(oscamp(i+1)*osc(i+1))) :> _;
detuneOctaves(1) = osc1(vslider("[2] DeTuning1 [units:Octaves] [midi:ctrl 24] [style:knob]",0.0,-1.0,1.0,0.001));
waveSelect(1) = osc1(vslider("[3] Waveform1 [midi:ctrl 25] [style:knob]",5,0,5,1):int);
amp1Enable = mr1(vslider("[1] On [midi:ctrl 12] [style:knob] [color:blue]",1,0,1,1));
oscamp(1) = mr1(vslider("[0] Osc1 Amp [midi:ctrl 26] [style:knob]",0.5,0.0,1.0,0.001)) * amp1Enable;
sei = mr2(vslider("[0] Ext Input [midi:ctrl 27] [style: knob]",0,0,1.0,0.001));
extInput(fb,extSig) = fb,extSig : select2(eei) : *(sei) : extClipLED;
extClipLED = _ <: _, (abs : >(0.95) : mr2(vbargraph("[2] Ext Input Clip [style:led]",0,1)):!);
keycLED = attach(mr2(vbargraph("[3] Keyboard Ctl [style:led]",0,1)));
detuneOctaves(2) = osc2(vslider("[2] DeTuning2 [units:Octaves] [midi:ctrl 29] [style:knob]",0.41667,-1.0,1.0,0.001));
waveSelect(2) = osc2(vslider("[3] Waveform2 [midi:ctrl 30] [style:knob]",5,0,5,1):int);
amp2Enable = mr3(vslider("[1] On [midi:ctrl 14] [style:knob] [color:blue]",1,0,1,1));
oscamp(2) = mr3(vslider("[0] Osc2 Amp [midi:ctrl 31] [style:knob]",0.5,0.0,1.0,0.001)) * amp2Enable;
namp = mr4(vslider("[0] Noise Amp [midi:ctrl 32] [style: knob]",0.0,0.0,1.0,0.001));
noiseOff = mr4cbg(vslider("[0] On [midi:ctrl 15] [style:knob] [color:blue]",0,0,1,1));
ntype = mr4cbg(vslider("[1] White/Pink [midi:ctrl 16] [tooltip: Choose either White or Pink Noise] [style: knob] [color:blue]",1,0,1,1));
detuneOctaves(3) = osc3(vslider("[2] DeTuning3 [units:Octaves] [midi:ctrl 34] [style:knob]",0.3,-1.0,1.0,0.001));
waveSelect(3) = osc3(vslider("[3] Waveform3 [midi:ctrl 35] [style:knob]",0,0,5,1):int);
amp3Enable = mr5(vslider("[1] On [midi:ctrl 17] [style:knob] [color:blue]",0,0,1,1));
oscamp(3) = mr5(vslider("[0] Osc3 Amp [midi:ctrl 36] [style:knob]",0.5,0.0,1.0,0.001)) * amp3Enable;
waveforms(i) = (tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
modulationShift = select2(oscModEnable, 0.0,
modWheelShift * ( modulationCenterShift + (1.0-modulationCenterShift) * oscNoiseModulation ));
octaveShift(i) = -2+int(octaveSelect(i));
keyFreqGlidedMaybe = select2(osc3Control,osc3FixedFreq,keyFreqGlided);
detuneBoost(3) = select2(osc3Control,3.0,1.0);
detuneOctavesFinal(i) = detuneOctaves(i)*detuneBoost(i);
fBase(i) = keyFreqModulatedShifted(i) * pow(2.0, (masterTuneOctaves+octaveShift(i)+detuneOctavesFinal(i)))
: si.smooth(ba.tau2pole(0.016));
lfoMode(i) = (octaveSelect(i) == 0);
osc(i) = ba.selectn(6, int(waveSelect(i)), tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
tri(i) = select2(lfoMode(i),
os.triangle(f(i)),
os.lf_triangle(f(i)));
saw(i) = select2(lfoMode(i),
os.sawtooth(f(i)),
os.lf_saw(f(i)));
sq(i) = select2(lfoMode(i),
os.square(f(i)),
os.lf_squarewave(f(i)));
os.pulsetrain(f(i),0.25),
lf_pulsetrain(f(i),0.25));
ptn(i) = select2(lfoMode(i),
os.pulsetrain(f(i),0.125),
lf_pulsetrain(f(i),0.125));
lf_pulsetrain(freq,duty) = 2.0*os.lf_pulsetrainpos(freq,duty) - 1.0;
fcLgHz = vcf1(vslider("[1] Corner Freq [unit:Log2(Hz)]
[tooltip: Corner resonance frequency in Log2(Hertz)]
[style: knob]
: si.smooth(ba.tau2pole(0.016));
res = vcf1(vslider("[2] Corner Resonance [midi:ctrl 37] [tooltip: Resonance Q at VCF corner frequency (0 to 1)]
[style: knob]",
0.7, 0, 1, 0.01));
vcfKeyRange = vcf1cbg(vslider("[2] Kbd Ctl [midi:ctrl 38] [tooltip: Keyboard tracking of VCF corner-frequency (0=none, 1=full)]
[style: knob]",
vcfModEnable = vcf1cbg(vslider("[1] Filter Mod. [midi:ctrl 19] [color:red] [style:knob] [tooltip: Filter Modulation => Route Modulation Mix output to VCF frequency]",1,0,1,1));
vcfContourAmountOctaves = vcf1(vslider("[3] Amount of Contour (octaves) [midi:ctrl 39] [style: knob]", 1.2, 0, 4.0, 0.001));
vcfModulationOctaves = vcfModMixModulationOctaves + vcfContourOctaves;
vcfKeyShiftOctaves = vcfKeyRange * keyShiftOctaves;
modulatedFcLgHz = fcLgHz + vcfModulationOctaves + vcfKeyShiftOctaves;
fc = min((0.5*ma.SR), pow(2.0,modulatedFcLgHz));
vcf = ve.moog_vcf_2bn(res,fc);
attT60VCF = 0.001 * vcf2(vslider("[0] AttackF [midi:ctrl 40] [tooltip: Attack Time] [unit:ms] [style: knob]",1400,10,10000,1));
decT60VCF = 0.001 * vcf2(vslider("[0] DecayF [midi:ctrl 41] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,10,10000,1));
susLvlVCF = 0.01 * vcf2(vslider("[0] SustainF [midi:ctrl 42] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
relT60VCF = select2(decayButton,0.010,decT60VCF);
envelopeVCF = en.adsre(attT60VCF,decT60VCF,susLvlVCF,relT60VCF,gate);
declare interface "SmartKeyboard{
'Number of Keyboards':'2',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'72',
'Keyboard 1 - Lowest Key':'60'
}";
keyDownHold = gg(vslider("[0] gateHold [tooltip: lock sustain pedal on (hold gate set at 1)][style:knob]",0,0,1,1));
keyDown = gg(button("[1] gate [tooltip: The gate signal is 1 during a
note and 0 otherwise. For MIDI, NoteOn occurs when the gate
transitions from 0 to 1, and NoteOff is an event corresponding
to the gate transition from 1 to 0. The name of this Faust
button must be 'gate'.]"));
sustain = gg(button("[1] sustain [midi:ctrl 64]
gate = keyDown + keyDownHold + sustain : min(1);
attT60 = 0.001 * ng(vslider("[0] AttackA [midi:ctrl 43] [tooltip: Attack Time] [unit:ms] [style: knob]",2,0,5000,0.1));
decT60 = 0.001 * ng(vslider("[0] DecayA [midi:ctrl 44] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,0,10000,0.1));
susLvl = 0.01 * ng(vslider("[0] SustainA [midi:ctrl 45] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
envelopeAmpNoAM = en.adsre(attT60,decT60,susLvl,relT60,gate);
AMDepth = 0.5;
envelopeAmp = select2(oscModEnable, envelopeAmpNoAM,
envelopeAmpNoAM * (1.0 + AMDepth*modWheel * 0.5 * (1.0+oscNoiseModulation)));
ampL = volg(vslider("[1] gain [style:knob] [tooltip: Amplitude]",0.2,0,1.0,0.001));
bend = wg(ba.semi2ratio(hslider("[0] bend [style:knob] [midi:pitchwheel]",0,-2,2,0.01))) : si.polySmooth(gate,0.999,1);
modWheel = wg(vslider("[1] mod [midi:ctrl 1] [style:knob] [tooltip: PitchModulation amplitude in octaves]",
0,0,1.0,0.01)) : si.polySmooth(gate,0.999,1);
keyFreqBent = bend * kg(hslider("[2] freq [unit:Hz] [style:knob]",220,0.1,20000,0.1));
masterVolume = vg(vslider("MasterVolume [style:knob] [midi:ctrl 7] [tooltip: master volume, MIDI controlled]",
0.7,0,1,0.001))
: si.smooth(ba.tau2pole(0.16));
masterTuneOctaves = dg(vslider("[0] Tune [midi:ctrl 47] [unit:Octaves] [style:knob]
[tooltip: Frequency-shift up or down for all oscillators in Octaves]", 0.0,-1.0,1.0,0.001));
glide = gmmg(vslider("[0] Glide [midi:ctrl 5] [unit:sec/octave] [style:knob] [scale:log]
[tooltip: Portamento (frequency-glide) in seconds per octave]",
0.008,0.001,1.0,0.001));
keyFreqGlided = keyFreqBent : si.smooth(legatoPole);
mmix = gmmg(vslider("[1] Mod. Mix [midi:ctrl 48] [style:knob] [tooltip: Modulation Mix: Osc3 (0) to Noise (1)]",
0.0,0.0,1.0,0.001));
osc3Control = dsg(vslider("[1] Osc. 3 Ctl [midi:ctrl 9] [color:red] [style:knob] [tooltip:Oscillator 3 frequency tracks the keyboard if on, else not",0,0,1,1):int);
|
38861cb36ec63ee2009887404f362f9c2b432876c1fe7f01ebf2cdd40514b5c9 | HMaxime/CONDUCT | virtualAnalogForBrowser.dsp | import("stdfaust.lib");
// These are now in a separate file ./effects.dsp
// echo = echog(component("echo.dsp")); // ./echo.dsp
// flanger = flg(component("flanger.dsp")); // ./flanger.dsp
// chorus = chg(component("chorus.dsp")); // ./chorus.dsp
// reverb = rg(component("freeverb.dsp"));
process = main <: _,_; // Now separate: : echo : flanger : chorus : reverb;
main = (signal + attach(extInput,amp) : filters : *(ampScaling)) ~ _;
signal = oscs + noise * noiseOff * namp;
ampScaling = envelopeAmp * masterVolume; // masterVolume is redundant but easier to find
oscs = par(i,3,(oscamp(i+1)*osc(i+1))) :> _;
controlSelect(1) = osc1(vrockerred); // ("[0] use as LFO"));
octaveSelect(1) = osc1(vslider("[1] Octave1 [midi:ctrl 23] [style:knob]",1,0,5,1):int); // LO, 32', 16', 8', 4', 2'
// Osc1 detunes like Osc2 and Osc3 (unlike in the Minimoog where it would be an expensive extra knob):
detuneOctaves(1) = osc1(vslider("[2] DeTuning1 [units:Octaves] [midi:ctrl 24] [style:knob]",0.0,-1.0,1.0,0.001));
waveSelect(1) = osc1(vslider("[3] Waveform1 [midi:ctrl 25] [style:knob]",5,0,5,1):int);
amp1Enable = mr1(vslider("[1] On [midi:ctrl 12] [style:knob] [color:blue]",1,0,1,1));
oscamp(1) = mr1(vslider("[0] Osc1 Amp [midi:ctrl 26] [style:knob]",0.5,0.0,1.0,0.001)) * amp1Enable;
eei = mr2(vslider("[1] On [midi:ctrl 13] [style:knob] [color:blue]",0,0,1,1)); // External input = MAIN OUTPUT when "off"
sei = mr2(vslider("[0] Ext Input [midi:ctrl 27] [style: knob]",0,0,1.0,0.001));
extInput(fb,extSig) = fb,extSig : select2(eei) : *(sei) : extClipLED;
extClipLED = _ <: _, (abs : >(0.95) : mr2(vbargraph("[2] Ext Input Clip [style:led]",0,1)):!);
keycLED = attach(mr2(vbargraph("[3] Keyboard Ctl [style:led]",0,1)));
controlSelect(2) = osc2(vrockerred); // ("[0] use as LFO"));
octaveSelect(2) = osc2(vslider("[1] Octave2 [midi:ctrl 28] [style:knob]",1,0,5,1):int); // LO, 32', 16', 8', 4', 2'
detuneOctaves(2) = osc2(vslider("[2] DeTuning2 [units:Octaves] [midi:ctrl 29] [style:knob]",0.41667,-1.0,1.0,0.001));
waveSelect(2) = osc2(vslider("[3] Waveform2 [midi:ctrl 30] [style:knob]",5,0,5,1):int);
amp2Enable = mr3(vslider("[1] On [midi:ctrl 14] [style:knob] [color:blue]",1,0,1,1));
oscamp(2) = mr3(vslider("[0] Osc2 Amp [midi:ctrl 31] [style:knob]",0.5,0.0,1.0,0.001)) * amp2Enable;
noise = select2(ntype,no.noise,10.0*no.pink_noise); // pink noise needs some "make-up gain"
namp = mr4(vslider("[0] Noise Amp [midi:ctrl 32] [style: knob]",0.0,0.0,1.0,0.001));
noiseOff = mr4cbg(vslider("[0] On [midi:ctrl 15] [style:knob] [color:blue]",0,0,1,1));
ntype = mr4cbg(vslider("[1] White/Pink [midi:ctrl 16] [tooltip: Choose either White or Pink Noise] [style: knob] [color:blue]",1,0,1,1));
controlSelect(3) = osc3(vrockerred); // ("[0] use as LFO"));
octaveSelect(3) = osc3(vslider("[1] Octave3 [midi:ctrl 33] [style:knob]",0,0,5,1):int); // LO, 32', 16', 8', 4', 2'
detuneOctaves(3) = osc3(vslider("[2] DeTuning3 [units:Octaves] [midi:ctrl 34] [style:knob]",0.3,-1.0,1.0,0.001));
waveSelect(3) = osc3(vslider("[3] Waveform3 [midi:ctrl 35] [style:knob]",0,0,5,1):int);
amp3Enable = mr5(vslider("[1] On [midi:ctrl 17] [style:knob] [color:blue]",0,0,1,1));
oscamp(3) = mr5(vslider("[0] Osc3 Amp [midi:ctrl 36] [style:knob]",0.5,0.0,1.0,0.001)) * amp3Enable;
waveforms(i) = (tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
// compute oscillator frequency scale factor, staying in lg(Hz) as much as possible:
modWheelShift = 1.5*modWheel; // Manual says 0 to 1.5 octaves
modulationCenterShift = 0; // Leave this off until triangle-wave modulation is debugged
modulationShift = select2(oscModEnable, 0.0,
modWheelShift * ( modulationCenterShift + (1.0-modulationCenterShift) * oscNoiseModulation ));
octaveShift(i) = -2+int(octaveSelect(i));
osc3FixedFreq = 369.994; // F# a tritone above middle C
keyFreqGlidedMaybe = select2(osc3Control,osc3FixedFreq,keyFreqGlided);
keyFreqModulatedShifted(3) = keyFreqGlidedMaybe; // osc3 not allowed to FM itself
keyFreqModulatedShifted(i) = keyFreqGlided * pow(2.0, modulationShift); // i=1,2
// When disconnected from the keyboard, Osc3 can detune 3 octaves up or down (Pat video):
detuneBoost(3) = select2(osc3Control,3.0,1.0);
detuneBoost(i) = 1.0; // i=1,2
detuneOctavesFinal(i) = detuneOctaves(i)*detuneBoost(i);
fBase(i) = keyFreqModulatedShifted(i) * pow(2.0, (masterTuneOctaves+octaveShift(i)+detuneOctavesFinal(i)))
: si.smooth(ba.tau2pole(0.016));
fLFOBase(i) = 3.0 * pow(2.0, detuneOctavesFinal(i)); // used when osc3 (only) is in LFO mode
lfoMode(i) = (octaveSelect(i) == 0);
f(i) = select2(lfoMode(i), fBase(i), fLFOBase(i)); // lowest range setting is LFO mode for any osc
// i is 1-based:
osc(i) = ba.selectn(6, int(waveSelect(i)), tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
tri(i) = select2(lfoMode(i),
os.triangle(f(i)),
os.lf_triangle(f(i)));
bent(i) = 0.5*tri(i) + 0.5*saw(i); // from Minimoog manual
saw(i) = select2(lfoMode(i),
os.sawtooth(f(i)),
os.lf_saw(f(i)));
sq(i) = select2(lfoMode(i),
os.square(f(i)),
os.lf_squarewave(f(i)));
ptm(i) = select2(lfoMode(i), // Note: a Duty knob would be better than these two, or in addition
os.pulsetrain(f(i),0.25),
lf_pulsetrain(f(i),0.25));
ptn(i) = select2(lfoMode(i),
os.pulsetrain(f(i),0.125),
lf_pulsetrain(f(i),0.125));
// Soon to appear in oscillators.lib:
lf_pulsetrain(freq,duty) = 2.0*os.lf_pulsetrainpos(freq,duty) - 1.0;
filters = ba.bypass1(bp,vcf); // BYPASS WILL GO AWAY (I think you just open it up all the way to bypass):
bp = 0; // VCF is always on
fcLgHz = vcf1(vslider("[1] Corner Freq [unit:Log2(Hz)]
[tooltip: Corner resonance frequency in Log2(Hertz)]
[style: knob]
[midi:ctrl 74]", // Frequency Cutoff (aka Brightness )
10.6, log(40.0)/log(2), log(20000.0)/log(2), 0.000001)) // 9 octaves (from Minimoog manual)
//p: 40, 30, 80, 0.01))
//p: : ba.pianokey2hz
: si.smooth(ba.tau2pole(0.016));
res = vcf1(vslider("[2] Corner Resonance [midi:ctrl 37] [tooltip: Resonance Q at VCF corner frequency (0 to 1)]
[style: knob]",
0.7, 0, 1, 0.01));
vcfKeyRange = vcf1cbg(vslider("[2] Kbd Ctl [midi:ctrl 38] [tooltip: Keyboard tracking of VCF corner-frequency (0=none, 1=full)]
[style: knob]",
1, 0, 1, 0.001)); // was in mr2
vcfModEnable = vcf1cbg(vslider("[1] Filter Mod. [midi:ctrl 19] [color:red] [style:knob] [tooltip: Filter Modulation => Route Modulation Mix output to VCF frequency]",1,0,1,1));
// Note that VCF has three sources of corner-frequency setting that are added together:
// - Corner Freq knob (40 Hz to 20 kHz)
// - VCF Contour envelope (0 to 4 octaves)
// - Injection 32 of Modulation Mix (0 to 1.5 octaves)
// Manual says maximum vcf sweep spans 0 to 4 octaves:
// Original Knob went to 10, but we're going to 4 so we can say the knob is in "octaves" units:
vcfContourAmountOctaves = vcf1(vslider("[3] Amount of Contour (octaves) [midi:ctrl 39] [style: knob]", 1.2, 0, 4.0, 0.001));
vcfContourOctaves = vcfContourAmountOctaves * envelopeVCF; // in octaves
// We are assuming that the modulation-mix range for the VCF freq is 1.5 octaves like it is for oscs 1 and 2:
vcfModMixModulationOctaves = select2(vcfModEnable, 0, (1.5 * oscNoiseModulation * modWheel)); // octaves
vcfModulationOctaves = vcfModMixModulationOctaves + vcfContourOctaves;
keyFreqLogHzGlided = log(keyFreqGlided)/log(2.0); // FIXME: Start w freqLogHz not freq so we don't need exp(log()) here
keyShiftOctaves = keyFreqLogHzGlided - log(261.625565)/log(2.0); // FIXME: ARBITRARILY centering on middle C - check device
vcfKeyShiftOctaves = vcfKeyRange * keyShiftOctaves;
modulatedFcLgHz = fcLgHz + vcfModulationOctaves + vcfKeyShiftOctaves;
fc = min((0.5*ma.SR), pow(2.0,modulatedFcLgHz));
vcf = ve.moog_vcf_2bn(res,fc);
// Attack, Decay, and Sustain ranges are set according to the Minimoog manual:
attT60VCF = 0.001 * vcf2(vslider("[0] AttackF [midi:ctrl 40] [tooltip: Attack Time] [unit:ms] [style: knob]",1400,10,10000,1));
decT60VCF = 0.001 * vcf2(vslider("[0] DecayF [midi:ctrl 41] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,10,10000,1));
susLvlVCF = 0.01 * vcf2(vslider("[0] SustainF [midi:ctrl 42] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
decayButton = wg(vslider("Decay [midi:ctrl 20] [tooltip:Envelope Release either Decay value or 0][style:knob]",1,0,1,1):int); // was Staccato
legatoButton = wg(vslider("Glide [midi:ctrl 65] [tooltip: Glide from note to note][style:knob]",1,0,1,1)); // was Legato
relT60VCF = select2(decayButton,0.010,decT60VCF);
envelopeVCF = en.adsre(attT60VCF,decT60VCF,susLvlVCF,relT60VCF,gate);
// --- Smart Keyboard interface ---
declare interface "SmartKeyboard{
'Number of Keyboards':'2',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'72',
'Keyboard 1 - Lowest Key':'60'
}";
// --- functions ---
// Signal controls:
keyDownHold = gg(vslider("[0] gateHold [tooltip: lock sustain pedal on (hold gate set at 1)][style:knob]",0,0,1,1));
keyDown = gg(button("[1] gate [tooltip: The gate signal is 1 during a
note and 0 otherwise. For MIDI, NoteOn occurs when the gate
transitions from 0 to 1, and NoteOff is an event corresponding
to the gate transition from 1 to 0. The name of this Faust
button must be 'gate'.]"));
sustain = gg(button("[1] sustain [midi:ctrl 64]
[tooltip: extends the gate (keeps it set to 1)]")); // MIDI only (see smartkeyb doc)
gate = keyDown + keyDownHold + sustain : min(1);
attT60 = 0.001 * ng(vslider("[0] AttackA [midi:ctrl 43] [tooltip: Attack Time] [unit:ms] [style: knob]",2,0,5000,0.1));
decT60 = 0.001 * ng(vslider("[0] DecayA [midi:ctrl 44] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,0,10000,0.1));
susLvl = 0.01 * ng(vslider("[0] SustainA [midi:ctrl 45] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
relT60 = select2(decayButton,0.010,decT60); // right?
envelopeAmpNoAM = en.adsre(attT60,decT60,susLvl,relT60,gate);
AMDepth = 0.5;
envelopeAmp = select2(oscModEnable, envelopeAmpNoAM,
envelopeAmpNoAM * (1.0 + AMDepth*modWheel * 0.5 * (1.0+oscNoiseModulation)));
// Signal Parameters
ampL = volg(vslider("[1] gain [style:knob] [tooltip: Amplitude]",0.2,0,1.0,0.001));
amp = ampL : si.smoo; // envelopeAmp is multiplied once on entire signal sum
//elecGuitar.dsp values used:
bend = wg(ba.semi2ratio(hslider("[0] bend [style:knob] [midi:pitchwheel]",0,-2,2,0.01))) : si.polySmooth(gate,0.999,1);
//Previous guess:
modWheel = wg(vslider("[1] mod [midi:ctrl 1] [style:knob] [tooltip: PitchModulation amplitude in octaves]",
0,0,1.0,0.01)) : si.polySmooth(gate,0.999,1);
//p: MIDI requires frequency in Hz, not piano-keys as we had before
// Frequency Range is 0.1 Hz to 20 kHz according to the Minimoog manual:
// MIDI REQUIRES THE FOLLOWING PARAMETER TO BE NAMED 'freq':
keyFreqBent = bend * kg(hslider("[2] freq [unit:Hz] [style:knob]",220,0.1,20000,0.1));
masterVolume = vg(vslider("MasterVolume [style:knob] [midi:ctrl 7] [tooltip: master volume, MIDI controlled]",
0.7,0,1,0.001))
: si.smooth(ba.tau2pole(0.16));
masterTuneOctaves = dg(vslider("[0] Tune [midi:ctrl 47] [unit:Octaves] [style:knob]
[tooltip: Frequency-shift up or down for all oscillators in Octaves]", 0.0,-1.0,1.0,0.001));
// Oscillator Modulation HrockerRed => apply Modulation Mix output osc1&2 pitches
glide = gmmg(vslider("[0] Glide [midi:ctrl 5] [unit:sec/octave] [style:knob] [scale:log]
[tooltip: Portamento (frequency-glide) in seconds per octave]",
0.008,0.001,1.0,0.001));
legatoPole = select2(legatoButton,0.5,ba.tau2pole(glide*exp(1.0f)/2.0f)); // convert 1/e to 1/2 by slowing down exp
keyFreqGlided = keyFreqBent : si.smooth(legatoPole);
mmix = gmmg(vslider("[1] Mod. Mix [midi:ctrl 48] [style:knob] [tooltip: Modulation Mix: Osc3 (0) to Noise (1)]",
0.0,0.0,1.0,0.001));
oscNoiseModulation = (mmix * noise) + ((1.0-mmix) * osc(3)); // noise amplitude and off-switch ignored here
oscModEnable = dsg(vslider("[0] Osc. Mod. [midi:ctrl 22] [color:red] [style:knob] [tooltip:Oscillator Modulation adds Modulation Mix output to osc1&2 frequencies",1,0,1,1)); // any offset?
osc3Control = dsg(vslider("[1] Osc. 3 Ctl [midi:ctrl 9] [color:red] [style:knob] [tooltip:Oscillator 3 frequency tracks the keyboard if on, else not",0,0,1,1):int);
// This layout loosely follows the MiniMoog-V
// Arturia-only features are labeled
// Original versions also added where different
// Need vrocker and hrocker toggle switches in Faust!
// Need orange and blue color choices
// Orange => Connect modulation sources to their destinations
// Blue => Turn audio sources On and Off
// - and later -
// White => Turn performance features On and Off
// Black => Select between modulation sources
// Julius Smith for Analog Devices 3/1/2017
vrocker(x) = checkbox("%%x [style:vrocker]");
hrocker(x) = checkbox("%%x [style:hrocker]");
vrockerblue(x) = checkbox("%x [style:vrocker] [color:blue]");
vrockerblue(x) = checkbox("%x [style:vrocker] [color:blue]");
// USAGE: vrockerorange("[0] ModulationEnable");
hrockerblue(x) = checkbox("%%x [style:hrocker] [color:blue]");
vrockerred(x) = checkbox("%%x [style:vrocker] [color:red]");
hrockerred(x) = checkbox("%%x [style:hrocker] [color:red]");
declare designer "Robert A. Moog";
mmg(x) = hgroup("",x); // Minimoog + Effects
synthg(x) = mmg(vgroup("[0] Minimoog",x));
fxg(x) = mmg(hgroup("[1] Effects",x));
mg(x) = synthg(hgroup("[0]",x));
cg(x) = mg(vgroup("[0] Controllers",x)); // Formerly named "Modules" but "Minimoog" group-title is enough
vg(x) = cg(hgroup("[0] Master Volume", x));
dg(x) = cg(hgroup("[1] Oscillator Tuning & Switching", x));
// Tune knob = master tune
dsg(x) = dg(vgroup("[1] Switches", x));
// Oscillator Modulation HrockerRed => apply Modulation Mix output to osc1&2 pitches
// [MOVED here from osc3 group] Osc 3 Control VrockerRed => use osc3 as LFO instead of osc3
gmmg(x) = cg(hgroup("[2] Glide and ModMix", x));
// Glide knob [0:10] = portamento speed
// Modulation Mix knob [0:10] (between Osc3 and Noise) = mix of noise and osc3 modulating osc1&2 pitch and/or VCF freq
og(x) = mg(vgroup("[1] Oscillator Bank", x));
osc1(x) = og(hgroup("[1] Oscillator 1", x));
// UNUSED Control switch (for alignment) - Could put Oscillator Modulation switch there
// Range rotary switch: LO (slow pulses or rhythm), 32', 16', 8', 4', 2'
// Frequency <something> switch: LED to right
// Waveform rotary switch: tri, impulse/bent-triangle, saw, pulseWide, pulseMed, pulseNarrow
osc2(x) = og(hgroup("[2] Oscillator 2", x));
// UNUSED (originall) or Osc 2 Control VrockerRed
// Range rotary switch: LO, 32', 16', 8', 4', 2'
// Detuning knob: -7 to 7 [NO SWITCH]
// Waveform rotary switch: tri, impulse(?), saw, pulseWide, pulseMed, pulseNarrow
osc3(x) = og(hgroup("[3] Oscillator 3", x));
// Osc 3 Control VrockerRed => use osc3 as LFO instead of osc3
// Range rotary switch: LO, 32', 16', 8', 4', 2'
// Detuning knob: -7 to 7 [NO SWITCH]
// Waveform rotary switch: tri, impulse(?), saw, pulseWide, pulseMed, pulseNarrow
mixg(x) = mg(vgroup("[2] Mixer", x));
// Each row 5 slots to maintain alignment and include red rockers joining VCF area:
mr1(x) = mixg(hgroup("[0] Osc1", x)); // mixer row 1 =
// Osc1 Volume and Osc1 HrockerBlue & _ & _ & Filter Modulation HrockerRed
// Filter Modulation => Modulation Mix output to VCF freq
mr2(x) = mixg(hgroup("[1] Ext In, KeyCtl", x)); // row 2 = Ext In HrockerBlue and Vol and Overload LED and Keyboard Ctl HrockerRed 1
mr3(x) = mixg(hgroup("[2] Osc2", x)); // = Osc2 Volume and Osc2 HrockerBlue and Keyboard Ctl HrockerRed 2
// Keyboard Control Modulation 1&2 => 0, 1/3, 2/3, all of Keyboard Control Signal ("gate?") applied to VCF freq
mr4(x) = mixg(hgroup("[3] Noise", x)); // = Noise HrockerBlue and Volume and Noise Type VrockerBlue
mr4cbg(x) = mr4(vgroup("[1]", x)); // = Noise Off and White/Pink selection
// two rockers
mr5(x) = mixg(hgroup("[4] Osc3", x)); // Osc3 Volume and Osc3 HrockerBlue
modg(x) = mg(vgroup("[3] Modifiers", x));
vcfg(x) = modg(vgroup("[0] Filter", x));
vcf1(x) = vcfg(hgroup("[0] [tooltip:freq, Q, ContourScale]", x));
vcf1cbg(x) = vcf1(vgroup("[0] [tooltip:two checkboxes]", x));
// Filter Modulation switch
// VCF Off switch
// Corner Frequency knob
// Filter Emphasis knob
// Amount of Contour knob
vcf2(x) = vcfg(hgroup("[1] Filter Contour [tooltip:AttFilt, DecFilt, Sustain Level for Filter Contour]", x));
// Attack Time knob
// Decay Time knob
// Sustain Level knob
ng(x) = modg(hgroup("[1] Loudness Contour", x));
// Attack Time knob
// Decay Time knob
// Sustain Level knob
echog(x) = fxg(hgroup("[4] Echo",x));
ekg(x) = echog(vgroup("[0] Knobs",x));
esg(x) = echog(vgroup("[1] Switches",x));
flg(x) = fxg(hgroup("[5] Flanger",x));
flkg(x) = flg(vgroup("[0] Knobs",x));
flsg(x) = flg(vgroup("[1] Switches",x));
chg(x) = fxg(hgroup("[6] Chorus",x));
ckg(x) = chg(vgroup("[0] Knobs",x));
csg(x) = chg(vgroup("[1] Switches",x));
rg(x) = fxg(hgroup("[7] Reverb",x));
rkg(x) = rg(vgroup("[0] Knobs",x));
rsg(x) = rg(vgroup("[1] Switches",x));
outg(x) = fxg(vgroup("[8] Output", x));
volg(x) = outg(hgroup("[0] Volume Main Output", x));
// Volume knob [0-10]
// Unison switch (Arturia) or Output connect/disconnect switch (original)
// When set, all voices are stacked and instrument is in mono mode
tunerg(x) = outg(hgroup("[1] A-440 Switch", x));
vdtpolyg(x) = outg(hgroup("[2] Voice Detune / Poly", x));
// Voice Detune knob [0-10] (Arturia) or
// Polyphonic switch [red LED below] (Arturia)
// When set, instrument is in polyphonic mode with one oscillator per key
clipg(x) = fxg(vgroup("[9] Soft Clip", x));
// Soft Clipping switch [red LED above]
kg(x) = synthg(hgroup("[1] Keyboard Group", x)); // Keyboard was 3 1/2 octaves
ws(x) = kg(vgroup("[0] Wheels and Switches", x));
s1g(x) = ws(hgroup("[0] Jacks and Rockers", x));
jg(x) = s1g(vgroup("[0] MiniJacks",x));
gdlg(x) = s1g(vgroup("[1] Glide/Decay/Legato Enables",x)); // Arturia
// Glide Hrocker (see original Button version below)
// Decay Hrocker (see original Button version below) => Sets Release (R) of ADSR to either 0 or Decay (R)
// Legato Hrocker (not in original)
s2g(x) = ws(hgroup("[1] [tooltip:Wheels+]", x));
bg(x) = s2g(vgroup("[0] [tooltip:Bend Enable and Range]", x));
wg(x) = s2g(hgroup("[1] [tooltip:Bend and Mod Wheels]", x));
// Using Glide/Decay/Legato enables above following Arturia:
// dg(x) = s2g(hgroup("[2] Glide and Decay momentary pushbuttons", x));
// Glide Button injects portamento as set by Glide knob
// Decay Button uses decay of Loudness Contour (else 0)
keys(x) = kg(hgroup("[1] [tooltip:Keys]", x));
gg(x) = keys(hgroup("[0] [tooltip: Gates]",x));
// leave slot 1 open for sustain (below)
| https://raw.githubusercontent.com/HMaxime/CONDUCT/a70e4ab8db098cf38fb32d9fa948eb3c2939f07e/Faust%26PureData/old/faust-master-dev/examples/SAM/virtualAnalog/virtualAnalogForBrowser.dsp | faust | These are now in a separate file ./effects.dsp
echo = echog(component("echo.dsp")); // ./echo.dsp
flanger = flg(component("flanger.dsp")); // ./flanger.dsp
chorus = chg(component("chorus.dsp")); // ./chorus.dsp
reverb = rg(component("freeverb.dsp"));
Now separate: : echo : flanger : chorus : reverb;
masterVolume is redundant but easier to find
("[0] use as LFO"));
LO, 32', 16', 8', 4', 2'
Osc1 detunes like Osc2 and Osc3 (unlike in the Minimoog where it would be an expensive extra knob):
External input = MAIN OUTPUT when "off"
("[0] use as LFO"));
LO, 32', 16', 8', 4', 2'
pink noise needs some "make-up gain"
("[0] use as LFO"));
LO, 32', 16', 8', 4', 2'
compute oscillator frequency scale factor, staying in lg(Hz) as much as possible:
Manual says 0 to 1.5 octaves
Leave this off until triangle-wave modulation is debugged
F# a tritone above middle C
osc3 not allowed to FM itself
i=1,2
When disconnected from the keyboard, Osc3 can detune 3 octaves up or down (Pat video):
i=1,2
used when osc3 (only) is in LFO mode
lowest range setting is LFO mode for any osc
i is 1-based:
from Minimoog manual
Note: a Duty knob would be better than these two, or in addition
Soon to appear in oscillators.lib:
BYPASS WILL GO AWAY (I think you just open it up all the way to bypass):
VCF is always on
Frequency Cutoff (aka Brightness )
9 octaves (from Minimoog manual)
p: 40, 30, 80, 0.01))
p: : ba.pianokey2hz
was in mr2
Note that VCF has three sources of corner-frequency setting that are added together:
- Corner Freq knob (40 Hz to 20 kHz)
- VCF Contour envelope (0 to 4 octaves)
- Injection 32 of Modulation Mix (0 to 1.5 octaves)
Manual says maximum vcf sweep spans 0 to 4 octaves:
Original Knob went to 10, but we're going to 4 so we can say the knob is in "octaves" units:
in octaves
We are assuming that the modulation-mix range for the VCF freq is 1.5 octaves like it is for oscs 1 and 2:
octaves
FIXME: Start w freqLogHz not freq so we don't need exp(log()) here
FIXME: ARBITRARILY centering on middle C - check device
Attack, Decay, and Sustain ranges are set according to the Minimoog manual:
was Staccato
was Legato
--- Smart Keyboard interface ---
--- functions ---
Signal controls:
MIDI only (see smartkeyb doc)
right?
Signal Parameters
envelopeAmp is multiplied once on entire signal sum
elecGuitar.dsp values used:
Previous guess:
p: MIDI requires frequency in Hz, not piano-keys as we had before
Frequency Range is 0.1 Hz to 20 kHz according to the Minimoog manual:
MIDI REQUIRES THE FOLLOWING PARAMETER TO BE NAMED 'freq':
Oscillator Modulation HrockerRed => apply Modulation Mix output osc1&2 pitches
convert 1/e to 1/2 by slowing down exp
noise amplitude and off-switch ignored here
any offset?
This layout loosely follows the MiniMoog-V
Arturia-only features are labeled
Original versions also added where different
Need vrocker and hrocker toggle switches in Faust!
Need orange and blue color choices
Orange => Connect modulation sources to their destinations
Blue => Turn audio sources On and Off
- and later -
White => Turn performance features On and Off
Black => Select between modulation sources
Julius Smith for Analog Devices 3/1/2017
USAGE: vrockerorange("[0] ModulationEnable");
Minimoog + Effects
Formerly named "Modules" but "Minimoog" group-title is enough
Tune knob = master tune
Oscillator Modulation HrockerRed => apply Modulation Mix output to osc1&2 pitches
[MOVED here from osc3 group] Osc 3 Control VrockerRed => use osc3 as LFO instead of osc3
Glide knob [0:10] = portamento speed
Modulation Mix knob [0:10] (between Osc3 and Noise) = mix of noise and osc3 modulating osc1&2 pitch and/or VCF freq
UNUSED Control switch (for alignment) - Could put Oscillator Modulation switch there
Range rotary switch: LO (slow pulses or rhythm), 32', 16', 8', 4', 2'
Frequency <something> switch: LED to right
Waveform rotary switch: tri, impulse/bent-triangle, saw, pulseWide, pulseMed, pulseNarrow
UNUSED (originall) or Osc 2 Control VrockerRed
Range rotary switch: LO, 32', 16', 8', 4', 2'
Detuning knob: -7 to 7 [NO SWITCH]
Waveform rotary switch: tri, impulse(?), saw, pulseWide, pulseMed, pulseNarrow
Osc 3 Control VrockerRed => use osc3 as LFO instead of osc3
Range rotary switch: LO, 32', 16', 8', 4', 2'
Detuning knob: -7 to 7 [NO SWITCH]
Waveform rotary switch: tri, impulse(?), saw, pulseWide, pulseMed, pulseNarrow
Each row 5 slots to maintain alignment and include red rockers joining VCF area:
mixer row 1 =
Osc1 Volume and Osc1 HrockerBlue & _ & _ & Filter Modulation HrockerRed
Filter Modulation => Modulation Mix output to VCF freq
row 2 = Ext In HrockerBlue and Vol and Overload LED and Keyboard Ctl HrockerRed 1
= Osc2 Volume and Osc2 HrockerBlue and Keyboard Ctl HrockerRed 2
Keyboard Control Modulation 1&2 => 0, 1/3, 2/3, all of Keyboard Control Signal ("gate?") applied to VCF freq
= Noise HrockerBlue and Volume and Noise Type VrockerBlue
= Noise Off and White/Pink selection
two rockers
Osc3 Volume and Osc3 HrockerBlue
Filter Modulation switch
VCF Off switch
Corner Frequency knob
Filter Emphasis knob
Amount of Contour knob
Attack Time knob
Decay Time knob
Sustain Level knob
Attack Time knob
Decay Time knob
Sustain Level knob
Volume knob [0-10]
Unison switch (Arturia) or Output connect/disconnect switch (original)
When set, all voices are stacked and instrument is in mono mode
Voice Detune knob [0-10] (Arturia) or
Polyphonic switch [red LED below] (Arturia)
When set, instrument is in polyphonic mode with one oscillator per key
Soft Clipping switch [red LED above]
Keyboard was 3 1/2 octaves
Arturia
Glide Hrocker (see original Button version below)
Decay Hrocker (see original Button version below) => Sets Release (R) of ADSR to either 0 or Decay (R)
Legato Hrocker (not in original)
Using Glide/Decay/Legato enables above following Arturia:
dg(x) = s2g(hgroup("[2] Glide and Decay momentary pushbuttons", x));
Glide Button injects portamento as set by Glide knob
Decay Button uses decay of Loudness Contour (else 0)
leave slot 1 open for sustain (below) | import("stdfaust.lib");
main = (signal + attach(extInput,amp) : filters : *(ampScaling)) ~ _;
signal = oscs + noise * noiseOff * namp;
oscs = par(i,3,(oscamp(i+1)*osc(i+1))) :> _;
detuneOctaves(1) = osc1(vslider("[2] DeTuning1 [units:Octaves] [midi:ctrl 24] [style:knob]",0.0,-1.0,1.0,0.001));
waveSelect(1) = osc1(vslider("[3] Waveform1 [midi:ctrl 25] [style:knob]",5,0,5,1):int);
amp1Enable = mr1(vslider("[1] On [midi:ctrl 12] [style:knob] [color:blue]",1,0,1,1));
oscamp(1) = mr1(vslider("[0] Osc1 Amp [midi:ctrl 26] [style:knob]",0.5,0.0,1.0,0.001)) * amp1Enable;
sei = mr2(vslider("[0] Ext Input [midi:ctrl 27] [style: knob]",0,0,1.0,0.001));
extInput(fb,extSig) = fb,extSig : select2(eei) : *(sei) : extClipLED;
extClipLED = _ <: _, (abs : >(0.95) : mr2(vbargraph("[2] Ext Input Clip [style:led]",0,1)):!);
keycLED = attach(mr2(vbargraph("[3] Keyboard Ctl [style:led]",0,1)));
detuneOctaves(2) = osc2(vslider("[2] DeTuning2 [units:Octaves] [midi:ctrl 29] [style:knob]",0.41667,-1.0,1.0,0.001));
waveSelect(2) = osc2(vslider("[3] Waveform2 [midi:ctrl 30] [style:knob]",5,0,5,1):int);
amp2Enable = mr3(vslider("[1] On [midi:ctrl 14] [style:knob] [color:blue]",1,0,1,1));
oscamp(2) = mr3(vslider("[0] Osc2 Amp [midi:ctrl 31] [style:knob]",0.5,0.0,1.0,0.001)) * amp2Enable;
namp = mr4(vslider("[0] Noise Amp [midi:ctrl 32] [style: knob]",0.0,0.0,1.0,0.001));
noiseOff = mr4cbg(vslider("[0] On [midi:ctrl 15] [style:knob] [color:blue]",0,0,1,1));
ntype = mr4cbg(vslider("[1] White/Pink [midi:ctrl 16] [tooltip: Choose either White or Pink Noise] [style: knob] [color:blue]",1,0,1,1));
detuneOctaves(3) = osc3(vslider("[2] DeTuning3 [units:Octaves] [midi:ctrl 34] [style:knob]",0.3,-1.0,1.0,0.001));
waveSelect(3) = osc3(vslider("[3] Waveform3 [midi:ctrl 35] [style:knob]",0,0,5,1):int);
amp3Enable = mr5(vslider("[1] On [midi:ctrl 17] [style:knob] [color:blue]",0,0,1,1));
oscamp(3) = mr5(vslider("[0] Osc3 Amp [midi:ctrl 36] [style:knob]",0.5,0.0,1.0,0.001)) * amp3Enable;
waveforms(i) = (tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
modulationShift = select2(oscModEnable, 0.0,
modWheelShift * ( modulationCenterShift + (1.0-modulationCenterShift) * oscNoiseModulation ));
octaveShift(i) = -2+int(octaveSelect(i));
keyFreqGlidedMaybe = select2(osc3Control,osc3FixedFreq,keyFreqGlided);
detuneBoost(3) = select2(osc3Control,3.0,1.0);
detuneOctavesFinal(i) = detuneOctaves(i)*detuneBoost(i);
fBase(i) = keyFreqModulatedShifted(i) * pow(2.0, (masterTuneOctaves+octaveShift(i)+detuneOctavesFinal(i)))
: si.smooth(ba.tau2pole(0.016));
lfoMode(i) = (octaveSelect(i) == 0);
osc(i) = ba.selectn(6, int(waveSelect(i)), tri(i), bent(i), saw(i), sq(i), ptm(i), ptn(i));
tri(i) = select2(lfoMode(i),
os.triangle(f(i)),
os.lf_triangle(f(i)));
saw(i) = select2(lfoMode(i),
os.sawtooth(f(i)),
os.lf_saw(f(i)));
sq(i) = select2(lfoMode(i),
os.square(f(i)),
os.lf_squarewave(f(i)));
os.pulsetrain(f(i),0.25),
lf_pulsetrain(f(i),0.25));
ptn(i) = select2(lfoMode(i),
os.pulsetrain(f(i),0.125),
lf_pulsetrain(f(i),0.125));
lf_pulsetrain(freq,duty) = 2.0*os.lf_pulsetrainpos(freq,duty) - 1.0;
fcLgHz = vcf1(vslider("[1] Corner Freq [unit:Log2(Hz)]
[tooltip: Corner resonance frequency in Log2(Hertz)]
[style: knob]
: si.smooth(ba.tau2pole(0.016));
res = vcf1(vslider("[2] Corner Resonance [midi:ctrl 37] [tooltip: Resonance Q at VCF corner frequency (0 to 1)]
[style: knob]",
0.7, 0, 1, 0.01));
vcfKeyRange = vcf1cbg(vslider("[2] Kbd Ctl [midi:ctrl 38] [tooltip: Keyboard tracking of VCF corner-frequency (0=none, 1=full)]
[style: knob]",
vcfModEnable = vcf1cbg(vslider("[1] Filter Mod. [midi:ctrl 19] [color:red] [style:knob] [tooltip: Filter Modulation => Route Modulation Mix output to VCF frequency]",1,0,1,1));
vcfContourAmountOctaves = vcf1(vslider("[3] Amount of Contour (octaves) [midi:ctrl 39] [style: knob]", 1.2, 0, 4.0, 0.001));
vcfModulationOctaves = vcfModMixModulationOctaves + vcfContourOctaves;
vcfKeyShiftOctaves = vcfKeyRange * keyShiftOctaves;
modulatedFcLgHz = fcLgHz + vcfModulationOctaves + vcfKeyShiftOctaves;
fc = min((0.5*ma.SR), pow(2.0,modulatedFcLgHz));
vcf = ve.moog_vcf_2bn(res,fc);
attT60VCF = 0.001 * vcf2(vslider("[0] AttackF [midi:ctrl 40] [tooltip: Attack Time] [unit:ms] [style: knob]",1400,10,10000,1));
decT60VCF = 0.001 * vcf2(vslider("[0] DecayF [midi:ctrl 41] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,10,10000,1));
susLvlVCF = 0.01 * vcf2(vslider("[0] SustainF [midi:ctrl 42] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
relT60VCF = select2(decayButton,0.010,decT60VCF);
envelopeVCF = en.adsre(attT60VCF,decT60VCF,susLvlVCF,relT60VCF,gate);
declare interface "SmartKeyboard{
'Number of Keyboards':'2',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'72',
'Keyboard 1 - Lowest Key':'60'
}";
keyDownHold = gg(vslider("[0] gateHold [tooltip: lock sustain pedal on (hold gate set at 1)][style:knob]",0,0,1,1));
keyDown = gg(button("[1] gate [tooltip: The gate signal is 1 during a
note and 0 otherwise. For MIDI, NoteOn occurs when the gate
transitions from 0 to 1, and NoteOff is an event corresponding
to the gate transition from 1 to 0. The name of this Faust
button must be 'gate'.]"));
sustain = gg(button("[1] sustain [midi:ctrl 64]
gate = keyDown + keyDownHold + sustain : min(1);
attT60 = 0.001 * ng(vslider("[0] AttackA [midi:ctrl 43] [tooltip: Attack Time] [unit:ms] [style: knob]",2,0,5000,0.1));
decT60 = 0.001 * ng(vslider("[0] DecayA [midi:ctrl 44] [tooltip: Decay-to-Sustain Time] [unit:ms] [style: knob]",10,0,10000,0.1));
susLvl = 0.01 * ng(vslider("[0] SustainA [midi:ctrl 45] [tooltip: Sustain level as percent of max] [style: knob]",80,0,100,0.1));
envelopeAmpNoAM = en.adsre(attT60,decT60,susLvl,relT60,gate);
AMDepth = 0.5;
envelopeAmp = select2(oscModEnable, envelopeAmpNoAM,
envelopeAmpNoAM * (1.0 + AMDepth*modWheel * 0.5 * (1.0+oscNoiseModulation)));
ampL = volg(vslider("[1] gain [style:knob] [tooltip: Amplitude]",0.2,0,1.0,0.001));
bend = wg(ba.semi2ratio(hslider("[0] bend [style:knob] [midi:pitchwheel]",0,-2,2,0.01))) : si.polySmooth(gate,0.999,1);
modWheel = wg(vslider("[1] mod [midi:ctrl 1] [style:knob] [tooltip: PitchModulation amplitude in octaves]",
0,0,1.0,0.01)) : si.polySmooth(gate,0.999,1);
keyFreqBent = bend * kg(hslider("[2] freq [unit:Hz] [style:knob]",220,0.1,20000,0.1));
masterVolume = vg(vslider("MasterVolume [style:knob] [midi:ctrl 7] [tooltip: master volume, MIDI controlled]",
0.7,0,1,0.001))
: si.smooth(ba.tau2pole(0.16));
masterTuneOctaves = dg(vslider("[0] Tune [midi:ctrl 47] [unit:Octaves] [style:knob]
[tooltip: Frequency-shift up or down for all oscillators in Octaves]", 0.0,-1.0,1.0,0.001));
glide = gmmg(vslider("[0] Glide [midi:ctrl 5] [unit:sec/octave] [style:knob] [scale:log]
[tooltip: Portamento (frequency-glide) in seconds per octave]",
0.008,0.001,1.0,0.001));
keyFreqGlided = keyFreqBent : si.smooth(legatoPole);
mmix = gmmg(vslider("[1] Mod. Mix [midi:ctrl 48] [style:knob] [tooltip: Modulation Mix: Osc3 (0) to Noise (1)]",
0.0,0.0,1.0,0.001));
osc3Control = dsg(vslider("[1] Osc. 3 Ctl [midi:ctrl 9] [color:red] [style:knob] [tooltip:Oscillator 3 frequency tracks the keyboard if on, else not",0,0,1,1):int);
vrocker(x) = checkbox("%%x [style:vrocker]");
hrocker(x) = checkbox("%%x [style:hrocker]");
vrockerblue(x) = checkbox("%x [style:vrocker] [color:blue]");
vrockerblue(x) = checkbox("%x [style:vrocker] [color:blue]");
hrockerblue(x) = checkbox("%%x [style:hrocker] [color:blue]");
vrockerred(x) = checkbox("%%x [style:vrocker] [color:red]");
hrockerred(x) = checkbox("%%x [style:hrocker] [color:red]");
declare designer "Robert A. Moog";
synthg(x) = mmg(vgroup("[0] Minimoog",x));
fxg(x) = mmg(hgroup("[1] Effects",x));
mg(x) = synthg(hgroup("[0]",x));
vg(x) = cg(hgroup("[0] Master Volume", x));
dg(x) = cg(hgroup("[1] Oscillator Tuning & Switching", x));
dsg(x) = dg(vgroup("[1] Switches", x));
gmmg(x) = cg(hgroup("[2] Glide and ModMix", x));
og(x) = mg(vgroup("[1] Oscillator Bank", x));
osc1(x) = og(hgroup("[1] Oscillator 1", x));
osc2(x) = og(hgroup("[2] Oscillator 2", x));
osc3(x) = og(hgroup("[3] Oscillator 3", x));
mixg(x) = mg(vgroup("[2] Mixer", x));
modg(x) = mg(vgroup("[3] Modifiers", x));
vcfg(x) = modg(vgroup("[0] Filter", x));
vcf1(x) = vcfg(hgroup("[0] [tooltip:freq, Q, ContourScale]", x));
vcf1cbg(x) = vcf1(vgroup("[0] [tooltip:two checkboxes]", x));
vcf2(x) = vcfg(hgroup("[1] Filter Contour [tooltip:AttFilt, DecFilt, Sustain Level for Filter Contour]", x));
ng(x) = modg(hgroup("[1] Loudness Contour", x));
echog(x) = fxg(hgroup("[4] Echo",x));
ekg(x) = echog(vgroup("[0] Knobs",x));
esg(x) = echog(vgroup("[1] Switches",x));
flg(x) = fxg(hgroup("[5] Flanger",x));
flkg(x) = flg(vgroup("[0] Knobs",x));
flsg(x) = flg(vgroup("[1] Switches",x));
chg(x) = fxg(hgroup("[6] Chorus",x));
ckg(x) = chg(vgroup("[0] Knobs",x));
csg(x) = chg(vgroup("[1] Switches",x));
rg(x) = fxg(hgroup("[7] Reverb",x));
rkg(x) = rg(vgroup("[0] Knobs",x));
rsg(x) = rg(vgroup("[1] Switches",x));
outg(x) = fxg(vgroup("[8] Output", x));
volg(x) = outg(hgroup("[0] Volume Main Output", x));
tunerg(x) = outg(hgroup("[1] A-440 Switch", x));
vdtpolyg(x) = outg(hgroup("[2] Voice Detune / Poly", x));
clipg(x) = fxg(vgroup("[9] Soft Clip", x));
ws(x) = kg(vgroup("[0] Wheels and Switches", x));
s1g(x) = ws(hgroup("[0] Jacks and Rockers", x));
jg(x) = s1g(vgroup("[0] MiniJacks",x));
s2g(x) = ws(hgroup("[1] [tooltip:Wheels+]", x));
bg(x) = s2g(vgroup("[0] [tooltip:Bend Enable and Range]", x));
wg(x) = s2g(hgroup("[1] [tooltip:Bend and Mod Wheels]", x));
keys(x) = kg(hgroup("[1] [tooltip:Keys]", x));
gg(x) = keys(hgroup("[0] [tooltip: Gates]",x));
|
2a7a14454aabea1409f71258b70a8c53cb8a91dfd3db7a73f394a81e5160c08b | Rickr922/Faust-FDS | trialStuff.dsp | import("stdfaust.lib");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,1);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,1);
nPoints=3;
force = os.osc(440):ba.selectoutn(nPoints,inPoint);//1 <: par(i, nPoints, *(i==inPoint));
process = force:ba.selectn(nPoints,outPoint);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/oldRoute/stiffStringDamp/trialStuff.dsp | faust | 1 <: par(i, nPoints, *(i==inPoint)); | import("stdfaust.lib");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,1);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,1);
nPoints=3;
process = force:ba.selectn(nPoints,outPoint);
|
e82f9e3084630b6112fcefbb3702c1ccad107ceb3b89832afd950b39f649c708 | Rickr922/Faust-FDS | hammerTrial.dsp | import("stdfaust.lib");
k = 1/ma.SR;
excit = button("click me"):ba.impulsify*0.006;
KH = 1000;
mH = 0.9;
omega0SqrH = KH/mH;
sigma0H = 14;
alpha = 2.5;
nlHammer(omega0Sqr,sigma0,kH,alpha,K,offset,fIn) =
(hammerForce<:hammerModel(fIn,K,offset,_),_)~_:_,!
with
{
hammerModel(in,K,offset) =
(_,_,_*forceCoeff,in :> _) ~ (_ <: A*_,B*_') :_-offset;
hammerForce(uh,u)=select2((uh-u)>0,0,((uh-u)^alpha)*(-kH));
A = (2-omega0Sqr^2*K^2)/(1+sigma0*K);
B = (-1)*(1-sigma0*K)/(1+sigma0*K);
forceCoeff = K^2/(1+sigma0*K);
};
process = 0:nlHammer(omega0SqrH,sigma0H,10000,alpha,k,0.23,excit);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/hammerTrial.dsp | faust | import("stdfaust.lib");
k = 1/ma.SR;
excit = button("click me"):ba.impulsify*0.006;
KH = 1000;
mH = 0.9;
omega0SqrH = KH/mH;
sigma0H = 14;
alpha = 2.5;
nlHammer(omega0Sqr,sigma0,kH,alpha,K,offset,fIn) =
(hammerForce<:hammerModel(fIn,K,offset,_),_)~_:_,!
with
{
hammerModel(in,K,offset) =
(_,_,_*forceCoeff,in :> _) ~ (_ <: A*_,B*_') :_-offset;
hammerForce(uh,u)=select2((uh-u)>0,0,((uh-u)^alpha)*(-kH));
A = (2-omega0Sqr^2*K^2)/(1+sigma0*K);
B = (-1)*(1-sigma0*K)/(1+sigma0*K);
forceCoeff = K^2/(1+sigma0*K);
};
process = 0:nlHammer(omega0SqrH,sigma0H,10000,alpha,k,0.23,excit);
|
|
ec3efbe38cf533102edf19643c2c722b47fb9b32f124b4f809e4ba011f8a9e56 | Rickr922/Faust-FDS | 1dDampedWaveEquation.dsp | import("stdfaust.lib");
import("fds.lib");
//--------------------------------Model Settings-----------------------------//
nPoints = 100;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 500;
lambda = c*k/h;
//----------------------------------Equations--------------------------------//
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
A = 2*(1-lambda*lambda)/C1;
B = lambda*lambda/C1;
C = C2/C1;
midCoeff = B,A,B;
midCoeffDel = 0,C,0;
r=1;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
//----------------------------------Controls---------------------------------//
play = button("Play");
inPoint=hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force---------------------------------//
forceModel = play:ba.impulsify;
//----------------------------------Process---------------------------------//
process = forceModel<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)):
linInterp1DOut(nPoints,outPoint)<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/library/1dDampedWaveEquation.dsp | faust | --------------------------------Model Settings-----------------------------//
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Process---------------------------------// | import("stdfaust.lib");
import("fds.lib");
nPoints = 100;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 500;
lambda = c*k/h;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
A = 2*(1-lambda*lambda)/C1;
B = lambda*lambda/C1;
C = C2/C1;
midCoeff = B,A,B;
midCoeffDel = 0,C,0;
r=1;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
play = button("Play");
inPoint=hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
forceModel = play:ba.impulsify;
process = forceModel<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)):
linInterp1DOut(nPoints,outPoint)<:_,_;
|
75e3bb3e77007d2bc4a717ceb520a0715f143c35ac9c7a2b8de8c65f44696d66 | Rickr922/Faust-FDS | 1dWaveWithLibrary.dsp | import("stdfaust.lib");
/*
u_l^n+1 = 2(1-lambda^2)u_l^n - u_l^n-1 + lambda^2(u_l+1^n + u_l-1^n)
*/
k=1/ma.SR;
c=344;
h=c*k;
lambda=c*k/h;
A = 2*(1-lambda^2);
B = lambda^2;
C = -1;
r=1; t=1;
midCoeff = B,A,B;
midCoeffDel = 0,C,0;
/*
u_l^n+1 = 2(1-lambda^2)u_l^n - u_l^n-1 + 2*lambda^2(u_l+1^n)*/
D = 2*lambda^2;
leftCoeff = 0,A,D;
scheme(points) = leftCoeff,midCoeffDel,par(i,points-1,midCoeff,midCoeffDel);
play = button("Play") : ba.impulsify;
inPoint = hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint = hslider("Output Point", floor(nPoints/2),0,nPoints-1,0.01);
process = play<:fd.linInterp1D(nPoints,inPoint):fd.model1D(nPoints,r,t,scheme(nPoints)):fd.linInterp1DOut(nPoints,outPoint);
nPoints = 100;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/FaustPM_Workshop_2021/1dWaveWithLibrary.dsp | faust |
u_l^n+1 = 2(1-lambda^2)u_l^n - u_l^n-1 + lambda^2(u_l+1^n + u_l-1^n)
u_l^n+1 = 2(1-lambda^2)u_l^n - u_l^n-1 + 2*lambda^2(u_l+1^n) | import("stdfaust.lib");
k=1/ma.SR;
c=344;
h=c*k;
lambda=c*k/h;
A = 2*(1-lambda^2);
B = lambda^2;
C = -1;
r=1; t=1;
midCoeff = B,A,B;
midCoeffDel = 0,C,0;
D = 2*lambda^2;
leftCoeff = 0,A,D;
scheme(points) = leftCoeff,midCoeffDel,par(i,points-1,midCoeff,midCoeffDel);
play = button("Play") : ba.impulsify;
inPoint = hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint = hslider("Output Point", floor(nPoints/2),0,nPoints-1,0.01);
process = play<:fd.linInterp1D(nPoints,inPoint):fd.model1D(nPoints,r,t,scheme(nPoints)):fd.linInterp1DOut(nPoints,outPoint);
nPoints = 100;
|
964aa95a4008fcbfabf291eb462a7f7dbe0f5f71ca458ca32f8e23a432f2f22f | Rickr922/Faust-FDS | jamesString.dsp |
import("stdfaust.lib");
// simple loopback
straight2(X) = par(i, X*3, _);
// surface4i(X,Y,x,y): creates the connections for a surface of X*Y nodes with 3 inputs and 3 outputs
// one left, one right and one injection into itself
// with an injection point of coord x,y.
surface2i(X, x0) = route(X*3+1, X*3,
par(x, X, connections(x)),
in, C(x0),
in, C(x0)
)
with {
in = X*3 + 1; // additional input for signal injection
connections(x) = L(x), R(x-1),
C(x), C(x),
R(x), L(x+1);
L(x) = (1 + 0 + (x)*3) * (x>=0) * (x<X);
C(x) = (1 + 1 + (x)*3) * (x>=0) * (x<X);
R(x) = (1 + 2 + (x)*3) * (x>=0) * (x<X);
};
listen4(X, x) = route(X*3, 1,
L(x), 0,
C(x), 1,
R(x), 0
)
with {
L(x) = (1 + 0 + (x)*3) * (x>=0) * (x<X);
C(x) = (1 + 1 + (x)*3) * (x>=0) * (x<X);
R(x) = (1 + 2 + (x)*3) * (x>=0) * (x<X);
};
// Physical parameters for the system
K = 0.4;
Z = 0.001;
invM = 1;
// "precomputed" parameters for the update scheme
A = 2 - 2 * (K+Z)*invM;
B = 2 * Z *invM - 1;
C = (K+Z)*invM;
D = -Z*invM;
E = invM;
model(X, node) =
par (x, 1, left),
par (y, X-2, node),
par (x, 1, right)
with {
right(l, c, r) = 0, 0, 0 ;
left(l, c, r) = 0, 0, 0 ;
};
node(l, c, r) = A*c + B*c' + C*(l+r) + D*(l'+r') <:_,_,_;
example(X) = (surface2i(X, 60) : model(X, node)) ~ straight2(X) : listen4(X, 4);
process = button("play")* 0.1:ba.impulsify: example(100);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/newRoute/dampedString/jamesString.dsp | faust | simple loopback
surface4i(X,Y,x,y): creates the connections for a surface of X*Y nodes with 3 inputs and 3 outputs
one left, one right and one injection into itself
with an injection point of coord x,y.
additional input for signal injection
Physical parameters for the system
"precomputed" parameters for the update scheme |
import("stdfaust.lib");
straight2(X) = par(i, X*3, _);
surface2i(X, x0) = route(X*3+1, X*3,
par(x, X, connections(x)),
in, C(x0),
in, C(x0)
)
with {
connections(x) = L(x), R(x-1),
C(x), C(x),
R(x), L(x+1);
L(x) = (1 + 0 + (x)*3) * (x>=0) * (x<X);
C(x) = (1 + 1 + (x)*3) * (x>=0) * (x<X);
R(x) = (1 + 2 + (x)*3) * (x>=0) * (x<X);
};
listen4(X, x) = route(X*3, 1,
L(x), 0,
C(x), 1,
R(x), 0
)
with {
L(x) = (1 + 0 + (x)*3) * (x>=0) * (x<X);
C(x) = (1 + 1 + (x)*3) * (x>=0) * (x<X);
R(x) = (1 + 2 + (x)*3) * (x>=0) * (x<X);
};
K = 0.4;
Z = 0.001;
invM = 1;
A = 2 - 2 * (K+Z)*invM;
B = 2 * Z *invM - 1;
C = (K+Z)*invM;
D = -Z*invM;
E = invM;
model(X, node) =
par (x, 1, left),
par (y, X-2, node),
par (x, 1, right)
with {
right(l, c, r) = 0, 0, 0 ;
left(l, c, r) = 0, 0, 0 ;
};
node(l, c, r) = A*c + B*c' + C*(l+r) + D*(l'+r') <:_,_,_;
example(X) = (surface2i(X, 60) : model(X, node)) ~ straight2(X) : listen4(X, 4);
process = button("play")* 0.1:ba.impulsify: example(100);
|
7cb5e7ec0ca4a181f3e625d8b7aef86428dfddd6c7de40e72d1a6564255780ee | Rickr922/Faust-FDS | 2dWave.dsp | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
lambda = c*k/h;
nInputs = inputs(schemeMidPoint);
routing(X, Y, x0, y0) = route(X*Y*4+1, X*Y*4,
par(x, X, par(y, Y, connections(x,y))),
in, C(x0,y0))
with {
in = X*Y*4 + 1; // additional input for signal injection
connections(x,y) = N(x,y), S(x,y-1),
S(x,y), N(x,y+1),
C(x,y), C(x,y),
W(x,y), E(x-1,y),
E(x,y), W(x+1,y);
N(x,y) = (1 + 0 + (x+y*X)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
S(x,y) = (1 + 1 + (x+y*X)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
C(x,y) = (1 + 2 + (x+y*X)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
W(x,y) = (1 + 3 + (x+y*X)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
E(x,y) = (1 + 4 + (x+y*X)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
};
model(X,Y, node) =
par (x, X, par(y,Y, schemeMidPoint));
schemeMidPoint(u_n,u_s,u,u_w,u_e) = u*2*(1-2*lambda*lambda) - u' + lambda*lambda*(u_e+u_w+u_n+u_s)<:si.bus(nInputs);
outPointX=hslider("output point x",0,0,X*Y-1,1);
outPointY=hslider("output point y",0,0,Y-1,1);
example(X,Y) = (routing(X,Y, 1,1) : model(X, Y, schemeMidPoint)) ~ si.bus(X*Y) : si.bus(X*Y*nInputs):ba.selectn(X*Y*nInputs,outPointX);
process = button("play") : example(6,10);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/newRoute/2dWave/2dWave.dsp | faust | additional input for signal injection | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
lambda = c*k/h;
nInputs = inputs(schemeMidPoint);
routing(X, Y, x0, y0) = route(X*Y*4+1, X*Y*4,
par(x, X, par(y, Y, connections(x,y))),
in, C(x0,y0))
with {
connections(x,y) = N(x,y), S(x,y-1),
S(x,y), N(x,y+1),
C(x,y), C(x,y),
W(x,y), E(x-1,y),
E(x,y), W(x+1,y);
N(x,y) = (1 + 0 + (x+y*X)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
S(x,y) = (1 + 1 + (x+y*X)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
C(x,y) = (1 + 2 + (x+y*X)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
W(x,y) = (1 + 3 + (x+y*X)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
E(x,y) = (1 + 4 + (x+y*X)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
};
model(X,Y, node) =
par (x, X, par(y,Y, schemeMidPoint));
schemeMidPoint(u_n,u_s,u,u_w,u_e) = u*2*(1-2*lambda*lambda) - u' + lambda*lambda*(u_e+u_w+u_n+u_s)<:si.bus(nInputs);
outPointX=hslider("output point x",0,0,X*Y-1,1);
outPointY=hslider("output point y",0,0,Y-1,1);
example(X,Y) = (routing(X,Y, 1,1) : model(X, Y, schemeMidPoint)) ~ si.bus(X*Y) : si.bus(X*Y*nInputs):ba.selectn(X*Y*nInputs,outPointX);
process = button("play") : example(6,10);
|
fb23327a7e619a1320760e14282143ea82202babc6076745ae6cb21a5b2a757e | Rickr922/Faust-FDS | 1dWaveNoLibrary.dsp | import("stdfaust.lib");
k = 1/ma.SR;
c=344;
h=c*k;
lambda=c*k/h;
/*
u_l^n+1 = 2(1-lambda^2)u_l^n - u_l^n-1 + lambda^2(u_l+1^n + u_l-1^n)
*/
updateEq(fIn, u_w, u, u_e) = 2*(1-lambda^2)*u - u' + lambda^2*(u_w+u_e) + fIn;
nPoints= 3;
build1DScheme(points) = par(i,points,updateEq);
routing = route(6,12, (1,3), (1,6), (2,4), (2,7), (2,10), (3,8), (3,11), (4,1), (5,5), (6,9), (0,2), (0,12));
model(points) = (routing : build1DScheme(points))~si.bus(points);
play = button("Play") : ba.impulsify;
inPoint = hslider("Input Point", 1,0,nPoints-1,1);
outPoint = hslider("Output Point", 1,0,nPoints-1,1);
pointSelectorIn(points,point) = ba.selectoutn(points,point);
pointSelectorOut(points,point) = ba.selectn(points,point);
process = play: pointSelectorIn(nPoints,inPoint) : model(nPoints) : pointSelectorOut(nPoints, outPoint);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/FaustPM_Workshop_2021/1dWaveNoLibrary.dsp | faust |
u_l^n+1 = 2(1-lambda^2)u_l^n - u_l^n-1 + lambda^2(u_l+1^n + u_l-1^n)
| import("stdfaust.lib");
k = 1/ma.SR;
c=344;
h=c*k;
lambda=c*k/h;
updateEq(fIn, u_w, u, u_e) = 2*(1-lambda^2)*u - u' + lambda^2*(u_w+u_e) + fIn;
nPoints= 3;
build1DScheme(points) = par(i,points,updateEq);
routing = route(6,12, (1,3), (1,6), (2,4), (2,7), (2,10), (3,8), (3,11), (4,1), (5,5), (6,9), (0,2), (0,12));
model(points) = (routing : build1DScheme(points))~si.bus(points);
play = button("Play") : ba.impulsify;
inPoint = hslider("Input Point", 1,0,nPoints-1,1);
outPoint = hslider("Output Point", 1,0,nPoints-1,1);
pointSelectorIn(points,point) = ba.selectoutn(points,point);
pointSelectorOut(points,point) = ba.selectn(points,point);
process = play: pointSelectorIn(nPoints,inPoint) : model(nPoints) : pointSelectorOut(nPoints, outPoint);
|
5c9fb4b7a61835e97ac53ca5b3c66e9d5a1da9c677b457992bb79470cf4b1513 | Rickr922/Faust-FDS | 1dDampedWaveEquation.dsp | import("stdfaust.lib");
declare name "1dDampedWaveEquation";
declare description "1D wave equation with added frequency independent damping.";
declare author "Riccardo Russo";
//--------------------------------Model Settings-----------------------------//
nPoints = 100;
k = 1/ma.SR;
c = 344;
h = c*k;
sigma0 = 5;
lambda = c*k/h;
//----------------------------------Equations--------------------------------//
A = 2*(1-lambda^2)/C1;
B = lambda^2/C1;
C = C2/C1;
C1 = (sigma0*k) + 1;
C2 = (sigma0*k) - 1;
midCoeff = B,A,B;
midCoeffDel = 0,C,0;
r = 1;
t = 1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
//----------------------------------Controls---------------------------------//
play = button("Play");
inPoint = hslider("Input Point",floor(nPoints/2),0,nPoints-1,0.01);
outPoint = hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force---------------------------------//
forceModel = play:ba.impulsify;
//----------------------------------Process---------------------------------//
process = forceModel<:fd.linInterp1D(nPoints,inPoint):
fd.model1D(nPoints,r,t,scheme(nPoints)):
fd.linInterp1DOut(nPoints,outPoint)<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ead5c05c0eced6ed111dcfd8eeea14d313f74ef6/library/CorrectExamples/1dDampedWaveEquation.dsp | faust | --------------------------------Model Settings-----------------------------//
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Process---------------------------------//
| import("stdfaust.lib");
declare name "1dDampedWaveEquation";
declare description "1D wave equation with added frequency independent damping.";
declare author "Riccardo Russo";
nPoints = 100;
k = 1/ma.SR;
c = 344;
h = c*k;
sigma0 = 5;
lambda = c*k/h;
A = 2*(1-lambda^2)/C1;
B = lambda^2/C1;
C = C2/C1;
C1 = (sigma0*k) + 1;
C2 = (sigma0*k) - 1;
midCoeff = B,A,B;
midCoeffDel = 0,C,0;
r = 1;
t = 1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
play = button("Play");
inPoint = hslider("Input Point",floor(nPoints/2),0,nPoints-1,0.01);
outPoint = hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
forceModel = play:ba.impulsify;
process = forceModel<:fd.linInterp1D(nPoints,inPoint):
fd.model1D(nPoints,r,t,scheme(nPoints)):
fd.linInterp1DOut(nPoints,outPoint)<:_,_;
|
1e8de9937f00e057ed4bfa867cc7da065fd56dd6eaf6d82b082bc4575e4e027a | Rickr922/Faust-FDS | 2dWave_oldMatrixOrder.dsp | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 3;
nPointsY = 3;
lambda = c*k/h;
nInputs = inputs(schemeMidPoint)-2;
routing(X, Y, x0, y0) = route(X*Y+1, X*Y*nInputs,
par(x, X, par(y, Y, connections(x,y))),
in, C(x0,y0))
with {
in = X*Y + 1; // additional input for signal injection
connections(x,y) = P(x,y), S(x,y+1),
P(x,y), N(x,y-1),
P(x,y), C(x,y),
P(x,y), E(x-1,y),
P(x,y), W(x+1,y);
P(x,y) = x*Y+y+1;
W(x,y) = (1 + 0 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
E(x,y) = (1 + 1 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
C(x,y) = (1 + 2 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
S(x,y) = (1 + 3 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
N(x,y) = (1 + 4 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
};
model(X,Y) =
par (x, X, par(y,Y, schemeMidPoint));
schemeMidPoint(i,j, uSide_w, uSide_e,u, uSide_s, uSide_n) = u*2*(1-2*lambda*lambda) - u' + lambda*lambda*(uSide_e+uSide_w+uSide_n+uSide_s);
outPoint=hslider("output point x",1,0,nPointsX*nPointsY,1);
outPointY=hslider("output point y",0,0,Y-1,1);
example(X,Y) = (routing(X,Y, 0,0) : par (x, X, par(y,Y, schemeMidPoint(x,y)))) ~ si.bus(X*Y) : ba.selectn(X*Y,outPoint);
process = button("play"):ba.impulsify : example(nPointsX,nPointsY);
//process=model(3,3);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/newRoute/2dWave/2dWave_oldMatrixOrder.dsp | faust | additional input for signal injection
process=model(3,3); | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 3;
nPointsY = 3;
lambda = c*k/h;
nInputs = inputs(schemeMidPoint)-2;
routing(X, Y, x0, y0) = route(X*Y+1, X*Y*nInputs,
par(x, X, par(y, Y, connections(x,y))),
in, C(x0,y0))
with {
connections(x,y) = P(x,y), S(x,y+1),
P(x,y), N(x,y-1),
P(x,y), C(x,y),
P(x,y), E(x-1,y),
P(x,y), W(x+1,y);
P(x,y) = x*Y+y+1;
W(x,y) = (1 + 0 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
E(x,y) = (1 + 1 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
C(x,y) = (1 + 2 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
S(x,y) = (1 + 3 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
N(x,y) = (1 + 4 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
};
model(X,Y) =
par (x, X, par(y,Y, schemeMidPoint));
schemeMidPoint(i,j, uSide_w, uSide_e,u, uSide_s, uSide_n) = u*2*(1-2*lambda*lambda) - u' + lambda*lambda*(uSide_e+uSide_w+uSide_n+uSide_s);
outPoint=hslider("output point x",1,0,nPointsX*nPointsY,1);
outPointY=hslider("output point y",0,0,Y-1,1);
example(X,Y) = (routing(X,Y, 0,0) : par (x, X, par(y,Y, schemeMidPoint(x,y)))) ~ si.bus(X*Y) : ba.selectn(X*Y,outPoint);
process = button("play"):ba.impulsify : example(nPointsX,nPointsY);
|
90795ef0946be5487e2309468d5917efe1cdae80500d4739672d8750566ddee5 | Rickr922/Faust-FDS | schemePointTrialSelector.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 4;
nPointsY = 3;
lambda = c*k/h;
alpha = lambda*lambda;
beta = 2*(1-2*lambda*lambda);
midCoeff = 0,alpha,0,
alpha,beta,alpha,
0,alpha,0;
midCoeffDelay1 = 0,0,0,
0,-1,0,
0,0,0;
r=1;
t=1;
coefficients = midCoeff,midCoeffDelay1;
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, coefficients));
//WITH selector
schemePoint2D(R,T,coeffs,fIn) = neighbors<:
sum(t,T+1,
sum(i,nNeighbors,
ba.selector(int(i+t*nNeighbors),nNeighbors*(T+1),coeffs)*
ba.selector(i,nNeighbors,neighbors)@(t)))
+ fIn
with
{
nNeighbors = (2*R+1)^2;
neighbors = si.bus(nNeighbors);
};
buildScheme2D(R,T,pointsX,pointsY,coefficients) =
par (x, pointsX,
par(y,pointsY, schemePoint2D(R,T,par(i,coeffsLength,coeffs(x,y,i)))))
with
{
nPoints = pointsX*pointsY;
nNeighbors = (2*R+1)^2;
coeffsLength = int(nNeighbors*(T+1));
coeffs(x,y,i) = ba.selector((x*pointsY+y)*coeffsLength+i,coeffsLength*nPoints,coefficients);
};
//process = 10,par(i,(2*r+1)^2,i):schemePoint2D(r,t,coefficients);
process = par(i,120,i):buildScheme2D(r,t,nPointsX,nPointsY,scheme(nPointsX,nPointsY));
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/caRoute/2dWave/schemePointTrialSelector.dsp | faust | --------------------------------Model Settings-----------------------------//
WITH selector
process = 10,par(i,(2*r+1)^2,i):schemePoint2D(r,t,coefficients); | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 4;
nPointsY = 3;
lambda = c*k/h;
alpha = lambda*lambda;
beta = 2*(1-2*lambda*lambda);
midCoeff = 0,alpha,0,
alpha,beta,alpha,
0,alpha,0;
midCoeffDelay1 = 0,0,0,
0,-1,0,
0,0,0;
r=1;
t=1;
coefficients = midCoeff,midCoeffDelay1;
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, coefficients));
schemePoint2D(R,T,coeffs,fIn) = neighbors<:
sum(t,T+1,
sum(i,nNeighbors,
ba.selector(int(i+t*nNeighbors),nNeighbors*(T+1),coeffs)*
ba.selector(i,nNeighbors,neighbors)@(t)))
+ fIn
with
{
nNeighbors = (2*R+1)^2;
neighbors = si.bus(nNeighbors);
};
buildScheme2D(R,T,pointsX,pointsY,coefficients) =
par (x, pointsX,
par(y,pointsY, schemePoint2D(R,T,par(i,coeffsLength,coeffs(x,y,i)))))
with
{
nPoints = pointsX*pointsY;
nNeighbors = (2*R+1)^2;
coeffsLength = int(nNeighbors*(T+1));
coeffs(x,y,i) = ba.selector((x*pointsY+y)*coeffsLength+i,coeffsLength*nPoints,coefficients);
};
process = par(i,120,i):buildScheme2D(r,t,nPointsX,nPointsY,scheme(nPointsX,nPointsY));
|
3b2c32d6b94709642441fc6b2db526e3c75d7bc82dd8a41bd1ec7f8deaf7f9ce | Rickr922/Faust-FDS | 2dWaveFIN.dsp | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 30;
nPointsY = 30;
lambda = c*k/h;
nInputs = inputs(schemeMidPoint);
routing(X, Y, x0, y0) = route(X*Y*2, X*Y*nInputs,
par(x, X, par(y, Y, connections(x,y))))
with {
in = X*Y + 1; // additional input for signal injection
connections(x,y) = P(x,y) + X*Y, F(x,y),
P(x,y), S(x,y-1),
P(x,y), N(x,y+1),
P(x,y), C(x,y),
P(x,y), E(x-1,y),
P(x,y), W(x+1,y);
P(x,y) = x*Y+y+1;
F(x,y) = (1 + 0 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
N(x,y) = (1 + 1 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
S(x,y) = (1 + 2 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
C(x,y) = (1 + 3 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
W(x,y) = (1 + 4 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
E(x,y) = (1 + 5 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
};
model(X,Y) =
par (x, X, par(y,Y, schemeMidPoint));
schemeMidPoint(fIn,u_n,u_s,u,u_w,u_e) = u*2*(1-2*lambda*lambda) - u' + lambda*lambda*(u_e+u_w+u_n+u_s) + fIn;
inPoint=hslider("input point",1,0,nPointsX*nPointsY,1);
outPoint=hslider("output point",1,0,nPointsX*nPointsY,1);
outPointY=hslider("output point y",0,0,Y-1,1);
forceModel = button("play") : ba.impulsify;
example(X,Y) = (routing(X,Y, 2,2) : par (x, X, par(y,Y, schemeMidPoint))) ~ si.bus(X*Y) : si.bus(X*Y):ba.selectn(X*Y,outPoint);
process = forceModel : ba.selectoutn(nPointsX*nPointsY,inPoint) : example(nPointsX,nPointsY);
//process=model(3,3);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/newRoute/2dWave/2dWaveFIN.dsp | faust | additional input for signal injection
process=model(3,3); | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 30;
nPointsY = 30;
lambda = c*k/h;
nInputs = inputs(schemeMidPoint);
routing(X, Y, x0, y0) = route(X*Y*2, X*Y*nInputs,
par(x, X, par(y, Y, connections(x,y))))
with {
connections(x,y) = P(x,y) + X*Y, F(x,y),
P(x,y), S(x,y-1),
P(x,y), N(x,y+1),
P(x,y), C(x,y),
P(x,y), E(x-1,y),
P(x,y), W(x+1,y);
P(x,y) = x*Y+y+1;
F(x,y) = (1 + 0 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
N(x,y) = (1 + 1 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
S(x,y) = (1 + 2 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
C(x,y) = (1 + 3 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
W(x,y) = (1 + 4 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
E(x,y) = (1 + 5 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
};
model(X,Y) =
par (x, X, par(y,Y, schemeMidPoint));
schemeMidPoint(fIn,u_n,u_s,u,u_w,u_e) = u*2*(1-2*lambda*lambda) - u' + lambda*lambda*(u_e+u_w+u_n+u_s) + fIn;
inPoint=hslider("input point",1,0,nPointsX*nPointsY,1);
outPoint=hslider("output point",1,0,nPointsX*nPointsY,1);
outPointY=hslider("output point y",0,0,Y-1,1);
forceModel = button("play") : ba.impulsify;
example(X,Y) = (routing(X,Y, 2,2) : par (x, X, par(y,Y, schemeMidPoint))) ~ si.bus(X*Y) : si.bus(X*Y):ba.selectn(X*Y,outPoint);
process = forceModel : ba.selectoutn(nPointsX*nPointsY,inPoint) : example(nPointsX,nPointsY);
|
ba001f50ed8c6b54657b06ca85366f4d537bc068c319ed7882a097e8d7353573 | Rickr922/Faust-FDS | damped1dWave.dsp | /*
NOTE: There is an error both in the slides and in the code used in the video: the coefficients C1 and C2 are wrong, here you can find the correct ones.
There is not much perceptual difference, but it's error in the discretization of the PDE.
*/
import("stdfaust.lib");
k=1/ma.SR;
c=344;
h=c*k;
lambda=c*k/h;
play = button("Play") : ba.impulsify;
inPoint = hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint = hslider("Output Point", floor(nPoints/2),0,nPoints-1,0.01);
process = play<:fd.linInterp1D(nPoints,inPoint):fd.model1D(nPoints,r,t,scheme(nPoints)):fd.linInterp1DOut(nPoints,outPoint)<:_,_;
/*
u_l^n+1 = 2(1-lambda^2)/C1 u_l^n +C2/C1 u_l^n-1 + lambda^2/C1 (u_l+1^n + u_l-1^n)
C1 = sigma_0 k + 1;
C2 = sigma_0 k - 1;*/
sigma0 = 5;
r=1; t=1;
A = 2*(1-lambda^2)/C1;
B = lambda^2/C1;
C = C2/C1;
C1 = (sigma0*k) + 1;
C2 = (sigma0*k) - 1;
midCoeff = B,A,B;
midCoeffDel = 0,C,0;
scheme(points) = par(i,points, midCoeff, midCoeffDel);
nPoints=100; | https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/FaustPM_Workshop_2021/damped1dWave.dsp | faust |
NOTE: There is an error both in the slides and in the code used in the video: the coefficients C1 and C2 are wrong, here you can find the correct ones.
There is not much perceptual difference, but it's error in the discretization of the PDE.
u_l^n+1 = 2(1-lambda^2)/C1 u_l^n +C2/C1 u_l^n-1 + lambda^2/C1 (u_l+1^n + u_l-1^n)
C1 = sigma_0 k + 1;
C2 = sigma_0 k - 1; |
import("stdfaust.lib");
k=1/ma.SR;
c=344;
h=c*k;
lambda=c*k/h;
play = button("Play") : ba.impulsify;
inPoint = hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint = hslider("Output Point", floor(nPoints/2),0,nPoints-1,0.01);
process = play<:fd.linInterp1D(nPoints,inPoint):fd.model1D(nPoints,r,t,scheme(nPoints)):fd.linInterp1DOut(nPoints,outPoint)<:_,_;
sigma0 = 5;
r=1; t=1;
A = 2*(1-lambda^2)/C1;
B = lambda^2/C1;
C = C2/C1;
C1 = (sigma0*k) + 1;
C2 = (sigma0*k) - 1;
midCoeff = B,A,B;
midCoeffDel = 0,C,0;
scheme(points) = par(i,points, midCoeff, midCoeffDel);
nPoints=100; |
6134ba90cd9cbadcfa8cd4d585a627ea725ba0e519db8ff6a42e304226c18f5f | Rickr922/Faust-FDS | StiffString.dsp | import("stdfaust.lib");
import("fds.lib");
//----------------------------------String Settings---------------------------//
//nPoints=int(Length/h);
nPoints = 100;
k = 1/ma.SR;
//Stability condition
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
T = 150; // Tension [N]
radius = 3.5560e-04; // Radius (0.016 gauge) [m]
rho = 8.05*10^3; // Density [kg/m^3];
Area = ma.PI*radius^2; // Area of string section
I = (ma.PI*radius^4)/ 4; // Moment of Inertia
Emod = 174e4; // Young modulus [Pa]
K = sqrt(Emod*I/rho/Area); // Stiffness parameter
c = sqrt(T/rho/Area); // Wave speed
sigma1 = 0.01; // Frequency dependent damping
sigma0 = 0.0005; // Frequency independent damping
//----------------------------------Equations--------------------------------//
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
//----------------------------------Controls---------------------------------//
play = button("Play");
inPoint=hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force---------------------------------//
forceModel = play:ba.impulsify;
//----------------------------------Process---------------------------------//
process = forceModel<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)):
linInterp1DOut(nPoints,outPoint)<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/library/StiffString.dsp | faust | ----------------------------------String Settings---------------------------//
nPoints=int(Length/h);
Stability condition
Tension [N]
Radius (0.016 gauge) [m]
Density [kg/m^3];
Area of string section
Moment of Inertia
Young modulus [Pa]
Stiffness parameter
Wave speed
Frequency dependent damping
Frequency independent damping
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Process---------------------------------// | import("stdfaust.lib");
import("fds.lib");
nPoints = 100;
k = 1/ma.SR;
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
play = button("Play");
inPoint=hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
forceModel = play:ba.impulsify;
process = forceModel<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)):
linInterp1DOut(nPoints,outPoint)<:_,_;
|
f05ac7be2ac54568f754e592ffadd3997618ec48cd6c8c83e0cdc7a9e78ce56d | Rickr922/Faust-FDS | dampedString.dsp | import("stdfaust.lib");
nInputs = 3;
surface4i(X, x0) = route(X*nInputs+1, X*nInputs,
par(x, X, connections(x)),
in, C(x0))
with {
in = X*nInputs + 1; // additional input for signal injection
connections(x) = W(x), E(x-1),
C(x), C(x),
E(x), W(x+1);
W(x) = (1 + 0 + (x*nInputs)) * (x>=0) * (x<X);
C(x) = (1 + 1 + (x*nInputs)) * (x>=0) * (x<X);
E(x) = (1 + 2 + (x*nInputs)) * (x>=0) * (x<X);
};
model(X, node) = par (x, X, node)
//west,
//par (x, X-2, node),
//east
with {
east(e,c,w) = c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1,
c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1,
0;
west(e,c,w) = 0,
c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1,
c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1;
};
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 500;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
node(e,c,w) = c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1,
c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1,
c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1;
example(X) = (surface4i(X,45) : model(X, node)) ~ si.bus(X*nInputs) : ba.selectn(X*nInputs,outPoint*nInputs+1);
nPoints = 90;
outPoint = hslider("outPoint",5,1,nPoints,1);
process = button("play") :ba.impulsify : example(nPoints);
//model(4,4, _, node); //listen4(3,3, 1,1); //surface4(2,2); //surface4i(4,4,1,1);
/*
0 1 2
q
3 4 5
6 7 8
0 1
2 3
*/
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/newRoute/dampedString/dampedString.dsp | faust | additional input for signal injection
west,
par (x, X-2, node),
east
model(4,4, _, node); //listen4(3,3, 1,1); //surface4(2,2); //surface4i(4,4,1,1);
0 1 2
q
3 4 5
6 7 8
0 1
2 3
| import("stdfaust.lib");
nInputs = 3;
surface4i(X, x0) = route(X*nInputs+1, X*nInputs,
par(x, X, connections(x)),
in, C(x0))
with {
connections(x) = W(x), E(x-1),
C(x), C(x),
E(x), W(x+1);
W(x) = (1 + 0 + (x*nInputs)) * (x>=0) * (x<X);
C(x) = (1 + 1 + (x*nInputs)) * (x>=0) * (x<X);
E(x) = (1 + 2 + (x*nInputs)) * (x>=0) * (x<X);
};
model(X, node) = par (x, X, node)
with {
east(e,c,w) = c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1,
c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1,
0;
west(e,c,w) = 0,
c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1,
c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1;
};
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 500;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
node(e,c,w) = c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1,
c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1,
c*2*(1-lambda*lambda)/C1+c'*C2/C1+ lambda*lambda*(e+w)/C1;
example(X) = (surface4i(X,45) : model(X, node)) ~ si.bus(X*nInputs) : ba.selectn(X*nInputs,outPoint*nInputs+1);
nPoints = 90;
outPoint = hslider("outPoint",5,1,nPoints,1);
process = button("play") :ba.impulsify : example(nPoints);
|
4be13184cd489f772dfde6bd9bb0adb83b6192ed652061c876b75f6df06a4e25 | Rickr922/Faust-FDS | schemePointTrialTake.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 4;
nPointsY = 3;
lambda = c*k/h;
alpha = 1;// lambda*lambda;
beta = 2; //2*(1-2*lambda*lambda);
midCoeff = 0,alpha,0,
alpha,beta,alpha,
0,alpha,0,
0,0,0,
0,-1,0,
0,0,0;
r=1;
t=1;
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, midCoeff));
schemePoint2D(R,T,coeff,fIn) = si.bus(nNeighbors)<:neighbors:
sum(t,T+1,
sum(i,nNeighbors,
ba.take(i+1+int(t*nNeighbors),coeff)*ba.take(i+1,neighbors)@(t)))
+ fIn
with
{
nNeighbors = (2*R+1)^2;
neighbors = si.bus(nNeighbors*(T+1));
};
buildScheme2D(R,T,pointsX,pointsY,coefficients) =
par (x, pointsX,
par(y,pointsY, schemePoint2D(R,T,par(i,coeffsLength,coeffs(x,y,i)))))
with
{
nPoints = pointsX*pointsY;
nNeighbors = (2*R+1)^2;
//coeff(x,y) = ba.subseq(coeffs,int((x*pointsY+y)*coeffLength),coeffLength);
coeffsLength = int(nNeighbors*(T+1));
coeffs(x,y,i) = ba.selector((x*pointsY+y)*coeffsLength+i,coeffsLength*nPoints,coefficients);
};
//process = 10,par(i,(2*r+1)^2,i):schemePoint2D(r,t,midCoeff);
process = par(i,120,i):buildScheme2D(r,t,nPointsX,nPointsY,scheme(nPointsX,nPointsY));
//process = ba.take(20,scheme(nPointsX,nPointsY));
//process=ba.count(scheme(nPointsX,nPointsY));
//process=takeFromCoeff(1,scheme(nPointsX,nPointsY));
//process = scheme(nPointsX,nPointsY);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/caRoute/2dWave/schemePointTrialTake.dsp | faust | --------------------------------Model Settings-----------------------------//
lambda*lambda;
2*(1-2*lambda*lambda);
coeff(x,y) = ba.subseq(coeffs,int((x*pointsY+y)*coeffLength),coeffLength);
process = 10,par(i,(2*r+1)^2,i):schemePoint2D(r,t,midCoeff);
process = ba.take(20,scheme(nPointsX,nPointsY));
process=ba.count(scheme(nPointsX,nPointsY));
process=takeFromCoeff(1,scheme(nPointsX,nPointsY));
process = scheme(nPointsX,nPointsY); | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 4;
nPointsY = 3;
lambda = c*k/h;
midCoeff = 0,alpha,0,
alpha,beta,alpha,
0,alpha,0,
0,0,0,
0,-1,0,
0,0,0;
r=1;
t=1;
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, midCoeff));
schemePoint2D(R,T,coeff,fIn) = si.bus(nNeighbors)<:neighbors:
sum(t,T+1,
sum(i,nNeighbors,
ba.take(i+1+int(t*nNeighbors),coeff)*ba.take(i+1,neighbors)@(t)))
+ fIn
with
{
nNeighbors = (2*R+1)^2;
neighbors = si.bus(nNeighbors*(T+1));
};
buildScheme2D(R,T,pointsX,pointsY,coefficients) =
par (x, pointsX,
par(y,pointsY, schemePoint2D(R,T,par(i,coeffsLength,coeffs(x,y,i)))))
with
{
nPoints = pointsX*pointsY;
nNeighbors = (2*R+1)^2;
coeffsLength = int(nNeighbors*(T+1));
coeffs(x,y,i) = ba.selector((x*pointsY+y)*coeffsLength+i,coeffsLength*nPoints,coefficients);
};
process = par(i,120,i):buildScheme2D(r,t,nPointsX,nPointsY,scheme(nPointsX,nPointsY));
|
37f3b838807c119347e04384451f1d888bdefff4055b4178da134b0bab22a6b5 | Rickr922/Faust-FDS | string1_D_route.dsp | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c*k;
lambda = c*k/h;
string1dMidPoint(fIn, uSide_l, uSide_r) = u
letrec
{
'u = 2*u-u'+ lambda*lambda*(uSide_l-2*u+uSide_r) + fIn;
};
updatePoint(fIn, uSide_l, uSide_r) = string1dMidPoint(fIn, uSide_l, uSide_r)<:_,_; //u_(l-1)=uSide_l, u_(l+1)=uSide_r
updatePointOut(fIn, uSide_l, uSide_r) = string1dMidPoint(fIn, uSide_l, uSide_r)<:_,_,_; //u_(l-1)=uSide_l, u_(l+1)=uSide_r
fixedPoint(uSide) = 0;
freePoint(uSide) = u
letrec
{
'u = 2*u-u'+ lambda*lambda*2*(uSide - u);
};
hit = button("hit"):ba.impulsify;
model =
(route(17,17,
(1,2),
(2,1),
(3,4),
(4,3),
(5,6),
(6,5),
(7,9),//out 8 is left free for the force in->everything else jumps one place
(8,7),
(9,11),
(10,10),
(11,13),
(12,12),
(13,15),
(14,14),
(15,17),
(16,16),
(17,8))://force in
fixedPoint,
updatePoint(0),
updatePoint(0),
updatePoint(0),
updatePoint,
updatePoint(0),
updatePointOut(0),
updatePoint(0),
fixedPoint :
route(17,17, //routeOut
(1,1),
(2,2),
(3,3),
(4,4),
(5,5),
(6,6),
(7,7),
(8,8),
(9,9),
(10,10),
(11,11),
(12,12),
(13,13),
(14,17),//out signal->routed to last slot
(15,14),
(16,15),
(17,16))
)~par(i, 16, _): par(i, 16,!), par(i, 1, _);
process = hit:model<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/oldRoute/string/string1_D_route.dsp | faust | u_(l-1)=uSide_l, u_(l+1)=uSide_r
u_(l-1)=uSide_l, u_(l+1)=uSide_r
out 8 is left free for the force in->everything else jumps one place
force in
routeOut
out signal->routed to last slot | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c*k;
lambda = c*k/h;
string1dMidPoint(fIn, uSide_l, uSide_r) = u
letrec
{
'u = 2*u-u'+ lambda*lambda*(uSide_l-2*u+uSide_r) + fIn;
};
fixedPoint(uSide) = 0;
freePoint(uSide) = u
letrec
{
'u = 2*u-u'+ lambda*lambda*2*(uSide - u);
};
hit = button("hit"):ba.impulsify;
model =
(route(17,17,
(1,2),
(2,1),
(3,4),
(4,3),
(5,6),
(6,5),
(8,7),
(9,11),
(10,10),
(11,13),
(12,12),
(13,15),
(14,14),
(15,17),
(16,16),
fixedPoint,
updatePoint(0),
updatePoint(0),
updatePoint(0),
updatePoint,
updatePoint(0),
updatePointOut(0),
updatePoint(0),
fixedPoint :
(1,1),
(2,2),
(3,3),
(4,4),
(5,5),
(6,6),
(7,7),
(8,8),
(9,9),
(10,10),
(11,11),
(12,12),
(13,13),
(15,14),
(16,15),
(17,16))
)~par(i, 16, _): par(i, 16,!), par(i, 1, _);
process = hit:model<:_,_;
|
161909eee016181827f0395954c674509b15becc24be731ff6b7c7f6ed6b70d0 | Rickr922/Faust-FDS | hammeredString.dsp | import("stdfaust.lib");
import("fds.lib");
//nPoints=int(Length/h);
nPoints = 100;
k = 1/ma.SR;
//Stability condition
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
T = 150; // Tension [N]
radius = 3.5560e-04; // Radius (0.016 gauge) [m]
rho = 8.05*10^3; // Density [kg/m^3];
Area = ma.PI*radius^2; // Area of string section
I = (ma.PI*radius^4)/ 4; // Moment of Inertia
Emod = 174e4; // Young modulus [Pa]
K = sqrt(Emod*I/rho/Area); // Stiffness parameter
c = sqrt(T/rho/Area); // Wave speed
sigma1 = 0.01; // Frequency dependent damping
sigma0 = 0.0005;
//----------------------------------Equations--------------------------------//
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
//----------------------------------Controls---------------------------------//
play = button("Play"):ba.impulsify;
inPoint=hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force---------------------------------//
JCoeff = (k^2/den/rho/Area);
KH = 300;
mH = 1;
omega0SqrH = KH/mH;
sigma0H = 14;
alpha = 2.5;
offset=1;
forceScaling = 0.009;
//----------------------------------Process---------------------------------//
gain = 500;
process = (linInterp1D(nPoints,inPoint):>
hammer(JCoeff,omega0SqrH,sigma0H,10000,alpha,k,offset,play*forceScaling)<:
linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)))~si.bus(nPoints):
linInterp1DOut(nPoints,outPoint)*gain<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/hammeredString.dsp | faust | nPoints=int(Length/h);
Stability condition
Tension [N]
Radius (0.016 gauge) [m]
Density [kg/m^3];
Area of string section
Moment of Inertia
Young modulus [Pa]
Stiffness parameter
Wave speed
Frequency dependent damping
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Process---------------------------------// | import("stdfaust.lib");
import("fds.lib");
nPoints = 100;
k = 1/ma.SR;
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
sigma0 = 0.0005;
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
play = button("Play"):ba.impulsify;
inPoint=hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
JCoeff = (k^2/den/rho/Area);
KH = 300;
mH = 1;
omega0SqrH = KH/mH;
sigma0H = 14;
alpha = 2.5;
offset=1;
forceScaling = 0.009;
gain = 500;
process = (linInterp1D(nPoints,inPoint):>
hammer(JCoeff,omega0SqrH,sigma0H,10000,alpha,k,offset,play*forceScaling)<:
linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)))~si.bus(nPoints):
linInterp1DOut(nPoints,outPoint)*gain<:_,_;
|
9b3e3674e1c6eeef37589bd71305383a2744e261cb8c625b5c0ccf856aa6269f | Rickr922/Faust-FDS | BowedString.dsp | import("stdfaust.lib");
import("fds.lib");
//----------------------------------String Settings---------------------------//
// Generic string
//nPoints=int(Length/h);
nPoints = 100;
k = 1/ma.SR;
//Stability condition
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
T = 150; // Tension [N]
radius = 3.5560e-04; // Radius (0.016 gauge) [m]
rho = 8.05*10^3; // Density [kg/m^3];
Area = ma.PI*radius^2; // Area of string section
I = (ma.PI*radius^4)/ 4; // Moment of Inertia
Emod = 174e4; // Young modulus [Pa]
K = sqrt(Emod*I/rho/Area);// Stiffness parameter
c = sqrt(T/rho/Area); // Wave speed
sigma1 = 0.01; // Frequency dependent damping
sigma0 = 0.0005;
//----------------------------------Equations--------------------------------//
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
//----------------------------------Controls---------------------------------//
play = button("hit");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,1);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force---------------------------------//
Vb = hslider("bow vel", 0,-10,10,0.01); //bow velocity [m/s]
Fb = 1000000; //[m/s^2]
J = Fb*k^2/den/h;
alpha=0.0001;
//----------------------------------Process---------------------------------//
//TODO: lin interp in input causes 0 output at .5 due to opposite phase
process =
(stairsInterp1D(nPoints,inPoint):>bow(J,alpha,k,Vb)<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)))~si.bus(nPoints):linInterp1DOut(nPoints,outPoint)
<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/library/BowedString.dsp | faust | ----------------------------------String Settings---------------------------//
Generic string
nPoints=int(Length/h);
Stability condition
Tension [N]
Radius (0.016 gauge) [m]
Density [kg/m^3];
Area of string section
Moment of Inertia
Young modulus [Pa]
Stiffness parameter
Wave speed
Frequency dependent damping
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
bow velocity [m/s]
[m/s^2]
----------------------------------Process---------------------------------//
TODO: lin interp in input causes 0 output at .5 due to opposite phase | import("stdfaust.lib");
import("fds.lib");
nPoints = 100;
k = 1/ma.SR;
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
sigma0 = 0.0005;
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
play = button("hit");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,1);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
J = Fb*k^2/den/h;
alpha=0.0001;
process =
(stairsInterp1D(nPoints,inPoint):>bow(J,alpha,k,Vb)<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)))~si.bus(nPoints):linInterp1DOut(nPoints,outPoint)
<:_,_;
|
3e79031ae232b7bde01dd22a3b4ec9c6530d55a93283f6a2c99986c0a808b381 | Rickr922/Faust-FDS | CelloBowedString.dsp | import("stdfaust.lib");
import("fds.lib");
//----------------------------------String Settings---------------------------//
// Data:
// https://www.gamutmusic.com/cello-equal-tensioned/
L = 0.67; //[m]
//nPoints=int(Length/h);
nPoints = 200;
k = 1/ma.SR;
//Stability condition
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
T = 117.6; // Tension [N]
radius = 1.375e-03; // Radius [m]
rho = 8.05*10^3; // Density [kg/m^3];
Area = ma.PI*radius^2; // Area of string section
I = (ma.PI*radius^4)/ 4; // Moment of Inertia
Emod = 174e4; // Young modulus [Pa]
K = sqrt(Emod*I/rho/Area); // Stiffness parameter
c = sqrt(T/rho/Area); // Wave speed
sigma1 = 0.01; // Frequency dependent damping
sigma0 = 0.0005; // Frequency independent damping
mass = Area*L*rho;
//----------------------------------Equations--------------------------------//
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
//----------------------------------Controls---------------------------------//
play = button("Play");
inPoint=hslider("Input Point", floor(nPoints/2),0,nPoints-1,1);
outPoint=hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force------------------------------------//
Vb = hslider("Bow Vel", 0,-10,10,0.01); //bow velocity [m/s]
Fb = 4000; //[m/s^]
J = Fb*k^2/den/h;
alpha=0.01;
gain=60;
//----------------------------------Process---------------------------------//
//TODO: linear interp in input causes 0 output at .5 due to opposite phases
process =
(stairsInterp1D(nPoints,inPoint):>bow(J,alpha,k,Vb)<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)))~si.bus(nPoints):linInterp1DOut(nPoints,outPoint)
<:_*gain,_*gain;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/CelloBowedString.dsp | faust | ----------------------------------String Settings---------------------------//
Data:
https://www.gamutmusic.com/cello-equal-tensioned/
[m]
nPoints=int(Length/h);
Stability condition
Tension [N]
Radius [m]
Density [kg/m^3];
Area of string section
Moment of Inertia
Young modulus [Pa]
Stiffness parameter
Wave speed
Frequency dependent damping
Frequency independent damping
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force------------------------------------//
bow velocity [m/s]
[m/s^]
----------------------------------Process---------------------------------//
TODO: linear interp in input causes 0 output at .5 due to opposite phases | import("stdfaust.lib");
import("fds.lib");
nPoints = 200;
k = 1/ma.SR;
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
mass = Area*L*rho;
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
play = button("Play");
inPoint=hslider("Input Point", floor(nPoints/2),0,nPoints-1,1);
outPoint=hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
J = Fb*k^2/den/h;
alpha=0.01;
gain=60;
process =
(stairsInterp1D(nPoints,inPoint):>bow(J,alpha,k,Vb)<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)))~si.bus(nPoints):linInterp1DOut(nPoints,outPoint)
<:_*gain,_*gain;
|
0cc1f2818a969c4b4153ef09e9d429daa1ac3443549fcf305a3a93df6536883d | Rickr922/Faust-FDS | 2dKirchhoffThinPlate.dsp | /*
WARNING:
- At the moment, 2D models with more than 30x20 points might crash the c++
compiler.
- 2D models need to be compiled with the command line compiler, the online
compiler might not work.
*/
import("stdfaust.lib");
import("fds.lib");
//--------------------------------Model Settings-----------------------------//
nPointsX = 20;
nPointsY = 10;
k = 1/ma.SR;
K = 20; //Plate stiffness parameter
s0 = 2; //Frequency independent damping
s1 = 0.05; //Frequency dependent damping
c=344; //Speed of sound in the plate
coeff = c^2*k^2+4*s1*k;
h = sqrt((coeff+sqrt(coeff*coeff+16*K*K*k*k)));
lambda = c*k/h;
//----------------------------------Equations--------------------------------//
mu=K*K*k*k/(h^4);
den = 1+s0*k;
A = 2*(1-10*mu-2*lambda*lambda-4*s1*k*k)/den;
B = (s0*k+4*k*k-1)/den;
C = (8*mu + lambda*lambda + 2*s1*k*k)/den;
D = -2*mu/den;
E = -mu/den;
F = -2*s1*k*k/den;
midCoeff = 0,0,E,0,0,
0,D,C,D,0,
E,C,A,C,E,
0,D,C,D,0,
0,0,E,0,0;
midCoeffDelay1 = 0,0,0,0,0,
0,0,F,0,0,
0,F,B,F,0,
0,0,F,0,0,
0,0,0,0,0;
r=2;
t=1;
coefficients = midCoeff,midCoeffDelay1;
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, coefficients));
//----------------------------------Controls---------------------------------//
inPointX=hslider("Input Point X", floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("Input Point Y", floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("Output Point X",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("Output Point Y",floor(nPointsY/2),0,nPointsY-1,0.01);
hit = button("Play");
//----------------------------------Force---------------------------------//
forceModel = hit:ba.impulsify;
//----------------------------------Process---------------------------------//
process =
forceModel<:linInterp2D(nPointsX,nPointsY,inPointX,inPointY):
model2D(nPointsX,nPointsY,r,t,scheme(nPointsX,nPointsY)):
linInterp2DOut(nPointsX,nPointsY,outPointX,outPointY);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/library/2dKirchhoffThinPlate.dsp | faust |
WARNING:
- At the moment, 2D models with more than 30x20 points might crash the c++
compiler.
- 2D models need to be compiled with the command line compiler, the online
compiler might not work.
--------------------------------Model Settings-----------------------------//
Plate stiffness parameter
Frequency independent damping
Frequency dependent damping
Speed of sound in the plate
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Process---------------------------------// |
import("stdfaust.lib");
import("fds.lib");
nPointsX = 20;
nPointsY = 10;
k = 1/ma.SR;
coeff = c^2*k^2+4*s1*k;
h = sqrt((coeff+sqrt(coeff*coeff+16*K*K*k*k)));
lambda = c*k/h;
mu=K*K*k*k/(h^4);
den = 1+s0*k;
A = 2*(1-10*mu-2*lambda*lambda-4*s1*k*k)/den;
B = (s0*k+4*k*k-1)/den;
C = (8*mu + lambda*lambda + 2*s1*k*k)/den;
D = -2*mu/den;
E = -mu/den;
F = -2*s1*k*k/den;
midCoeff = 0,0,E,0,0,
0,D,C,D,0,
E,C,A,C,E,
0,D,C,D,0,
0,0,E,0,0;
midCoeffDelay1 = 0,0,0,0,0,
0,0,F,0,0,
0,F,B,F,0,
0,0,F,0,0,
0,0,0,0,0;
r=2;
t=1;
coefficients = midCoeff,midCoeffDelay1;
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, coefficients));
inPointX=hslider("Input Point X", floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("Input Point Y", floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("Output Point X",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("Output Point Y",floor(nPointsY/2),0,nPointsY-1,0.01);
hit = button("Play");
forceModel = hit:ba.impulsify;
process =
forceModel<:linInterp2D(nPointsX,nPointsY,inPointX,inPointY):
model2D(nPointsX,nPointsY,r,t,scheme(nPointsX,nPointsY)):
linInterp2DOut(nPointsX,nPointsY,outPointX,outPointY);
|
ea05a44ae7e6b28164513ac121aea062964084e315e593ef2cab9a9953ce6edc | Rickr922/Faust-FDS | 2dWaveV2.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 30;
nPointsY = 10;
lambda = c*k/h;
//----------------------------------Equations--------------------------------//
schemeMidPoint(fIn,u_n,u_s,u,u_w,u_e) = u*2*(1-2*lambda*lambda) - u' + lambda*lambda*(u_e+u_w+u_n+u_s) + fIn;
buildScheme(X,Y) = par (x, X,
par(y,Y, schemeMidPoint));
//----------------------------------Controls---------------------------------//
inPointX=hslider("input point x", floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("input point y", floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("output point x",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("output point y",floor(nPointsY/2),0,nPointsY-1,0.01);
forceModel = button("play") : ba.impulsify;
stop = button("Stop");
//----------------------------------Interpolation---------------------------------//
linInterpolation2D(pointX,pointY) =
par(i,nPointsX,
par(j,nPointsY,_*
select2((i==intX) & (j==intY),
select2((i==(intX+1)) & (j==intY),
select2((i==intX) & (j==(intY+1)),
select2((i==(intX+1)) & (j==(intY+1)),
0,
fractionX*fractionY),
(1-fractionX)*fractionY),
fractionX*(1-fractionY)),
(1-fractionX)*(1-fractionY))))
with
{
fractionX = ma.frac(pointX);
fractionY = ma.frac(pointY);
intX = int(pointX);
intY = int(pointY);
};
//----------------------------------Force---------------------------------//
stairsForce(X,Y,pointX,pointY) = ba.selectoutn(X*Y,pointY+pointX*Y);
//----------------------------------Output-------------------------------//
stairsOutput(X,Y,pointX,pointY) = ba.selectn(X*Y,pointY+pointX*Y);
linInterpolation2DOut(pointX,pointY) = linInterpolation2D(pointX,pointY):>_;
//----------------------------------Build Model-------------------------------//
nInputs = inputs(schemeMidPoint);
routing(X, Y) = route(X*Y*2, X*Y*nInputs,
par(x, X, par(y, Y, connections(x,y))))
with
{
connections(x,y) = P(x,y) + X*Y, F(x,y),
P(x,y), S(x,y-1),
P(x,y), N(x,y+1),
P(x,y), C(x,y),
P(x,y), E(x-1,y),
P(x,y), W(x+1,y);
P(x,y) = x*Y+y+1;
F(x,y) = (1 + 0 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
N(x,y) = (1 + 1 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
S(x,y) = (1 + 2 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
C(x,y) = (1 + 3 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
W(x,y) = (1 + 4 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
E(x,y) = (1 + 5 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
};
model(X,Y) = (routing(X,Y) : buildScheme(X,Y)) ~ par(i,X*Y,_*(stop==0));
process = forceModel <: linInterpolation2D(inPointX,inPointY) : model(nPointsX,nPointsY) : linInterpolation2DOut(outPointX,outPointY)<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/newRoute/2dWave/2dWaveV2.dsp | faust | --------------------------------Model Settings-----------------------------//
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Interpolation---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Output-------------------------------//
----------------------------------Build Model-------------------------------// | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 30;
nPointsY = 10;
lambda = c*k/h;
schemeMidPoint(fIn,u_n,u_s,u,u_w,u_e) = u*2*(1-2*lambda*lambda) - u' + lambda*lambda*(u_e+u_w+u_n+u_s) + fIn;
buildScheme(X,Y) = par (x, X,
par(y,Y, schemeMidPoint));
inPointX=hslider("input point x", floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("input point y", floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("output point x",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("output point y",floor(nPointsY/2),0,nPointsY-1,0.01);
forceModel = button("play") : ba.impulsify;
stop = button("Stop");
linInterpolation2D(pointX,pointY) =
par(i,nPointsX,
par(j,nPointsY,_*
select2((i==intX) & (j==intY),
select2((i==(intX+1)) & (j==intY),
select2((i==intX) & (j==(intY+1)),
select2((i==(intX+1)) & (j==(intY+1)),
0,
fractionX*fractionY),
(1-fractionX)*fractionY),
fractionX*(1-fractionY)),
(1-fractionX)*(1-fractionY))))
with
{
fractionX = ma.frac(pointX);
fractionY = ma.frac(pointY);
intX = int(pointX);
intY = int(pointY);
};
stairsForce(X,Y,pointX,pointY) = ba.selectoutn(X*Y,pointY+pointX*Y);
stairsOutput(X,Y,pointX,pointY) = ba.selectn(X*Y,pointY+pointX*Y);
linInterpolation2DOut(pointX,pointY) = linInterpolation2D(pointX,pointY):>_;
nInputs = inputs(schemeMidPoint);
routing(X, Y) = route(X*Y*2, X*Y*nInputs,
par(x, X, par(y, Y, connections(x,y))))
with
{
connections(x,y) = P(x,y) + X*Y, F(x,y),
P(x,y), S(x,y-1),
P(x,y), N(x,y+1),
P(x,y), C(x,y),
P(x,y), E(x-1,y),
P(x,y), W(x+1,y);
P(x,y) = x*Y+y+1;
F(x,y) = (1 + 0 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
N(x,y) = (1 + 1 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
S(x,y) = (1 + 2 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
C(x,y) = (1 + 3 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
W(x,y) = (1 + 4 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
E(x,y) = (1 + 5 + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
};
model(X,Y) = (routing(X,Y) : buildScheme(X,Y)) ~ par(i,X*Y,_*(stop==0));
process = forceModel <: linInterpolation2D(inPointX,inPointY) : model(nPointsX,nPointsY) : linInterpolation2DOut(outPointX,outPointY)<:_,_;
|
5cdbf9535643d79a42e5d4a94320df8e9155c268b8a95f3e5a03b1c98ee87fd5 | Rickr922/mobile-vocoder | VocoderGUI.dsp | /*Polyphony limited to 2 because smartphone is not powerful enough*/
declare interface "SmartKeyboard{
'Number of Keyboards':'3',
'Rounding Mode':'0',
'Rounding Cycles':'3',
'Max Keyboard Polyphony':'2'
'Keyboard 0 - Orientation':'1',
'Keyboard 2 - Orientation':'1',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'4',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'60',
'Keyboard 2 - Lowest Key':'48',
'Keyboard 0 - Send Y':'1',
'Keyboard 2 - Send Y':'1',
'Keyboard 1 - Send Key X':'1'
'Keyboard 1 - Send Freq':'0'
'Keyboard 1 - Static Mode':'1',
'Keyboard 1 - Key 0 - Label':'Cutoff',
'Keyboard 1 - Key 1 - Label':'Wet/Dry',
'Keyboard 1 - Key 2 - Label':'Voice Gain',
'Keyboard 1 - Key 3 - Label':'Tone',
}";
import("stdfaust.lib");
oneVocoderBand(band, nBands, bwRatio, bandGain, x) = x : fi.resonbp(bandFreq, bandQ, bandGain)
with
{
bandFreq = 25*pow(2,(band+1)*(9/nBands));
bandWidth = (bandFreq - 25*pow(2,band*9/nBands))*bwRatio;
bandQ = bandFreq/bandWidth;
};
vocoder(nBands, att, rel, bwRatio, sourceGain, gate, excitation, source) = source <:
par(i, nBands, oneVocoderBand(i, nBands, bwRatio,gainIn):
an.amp_follower_ud(att, rel) : _, excitation : oneVocoderBand(i, nBands, bwRatio)) :>
(_*(1-mix) + mix*excitation)*gate * 0.125<:_,_
with
{
gainIn = source:an.amp_follower_ud(0.001,0.005)*sourceGain;
};
vocoderDemo = mainOsc*envelope, source : vocoder(bands, att, rel, bwRatio, sourceGain, gate):filter,filter
with
{
source = _;
bands = 74;
att = 0.1*0.001;
rel = 5*0.001;
bwRatio = 0.5;
};
gate = button("gate");
f = nentry("freq",200,40,2000,0.01);
maxBend = 1.06; //2^(1/12) semitone
//bend = hslider("bend[acc: 0 0 -100 0 100]",1,(1/maxBend),maxBend,0.001):si.polySmooth(t,0.999,1); //DEBUG
bend = nentry("bend[acc: 0 0 -1000 0 1000]",1,0,10,0.01) : si.polySmooth(t,0.999,1);
//bend = 1; //DEBUG
g = nentry("gain",1,0,1,0.01);
t = button("gate");
y = hslider("y",0.5,0,1,0.01):si.smoo;
mix = hslider("kb1k1x",0,0,1,0.01):si.smoo;
xParam = hslider("kb1k0x", 1, 0, 1, 0.001);
keyboard = hslider("keyboard",0,0,2,1) : int;
sourceGain = hslider("kb1k2x", 0.2, 0, 1, 0.01);
toneParam = hslider("kb1k3x",0,0,1,0.01):si.smoo;
filter = fi.lowpass(3,cutoff);
freq = f*bend;
gainParam = select2(keyboard==2, 1-y, y);
gain = gainParam*g;
envelope = t*gain : si.smoo;
lowFreq = 80;
highFreq = 10000;
cutoff = xParam * (highFreq-lowFreq) + lowFreq;
sawOsc = os.sawtooth(freq);
squareOsc = os.lf_squarewave(freq);
mainOsc = toneParam*sawOsc + (1-toneParam)*squareOsc;
process = vocoderDemo;
| https://raw.githubusercontent.com/Rickr922/mobile-vocoder/3d61ab782b9e46dd64a6bd5a93e9eb6c6e18e186/VocoderGUI.dsp | faust | Polyphony limited to 2 because smartphone is not powerful enough
2^(1/12) semitone
bend = hslider("bend[acc: 0 0 -100 0 100]",1,(1/maxBend),maxBend,0.001):si.polySmooth(t,0.999,1); //DEBUG
bend = 1; //DEBUG
| declare interface "SmartKeyboard{
'Number of Keyboards':'3',
'Rounding Mode':'0',
'Rounding Cycles':'3',
'Max Keyboard Polyphony':'2'
'Keyboard 0 - Orientation':'1',
'Keyboard 2 - Orientation':'1',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'4',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'60',
'Keyboard 2 - Lowest Key':'48',
'Keyboard 0 - Send Y':'1',
'Keyboard 2 - Send Y':'1',
'Keyboard 1 - Send Key X':'1'
'Keyboard 1 - Send Freq':'0'
'Keyboard 1 - Static Mode':'1',
'Keyboard 1 - Key 0 - Label':'Cutoff',
'Keyboard 1 - Key 1 - Label':'Wet/Dry',
'Keyboard 1 - Key 2 - Label':'Voice Gain',
'Keyboard 1 - Key 3 - Label':'Tone',
}";
import("stdfaust.lib");
oneVocoderBand(band, nBands, bwRatio, bandGain, x) = x : fi.resonbp(bandFreq, bandQ, bandGain)
with
{
bandFreq = 25*pow(2,(band+1)*(9/nBands));
bandWidth = (bandFreq - 25*pow(2,band*9/nBands))*bwRatio;
bandQ = bandFreq/bandWidth;
};
vocoder(nBands, att, rel, bwRatio, sourceGain, gate, excitation, source) = source <:
par(i, nBands, oneVocoderBand(i, nBands, bwRatio,gainIn):
an.amp_follower_ud(att, rel) : _, excitation : oneVocoderBand(i, nBands, bwRatio)) :>
(_*(1-mix) + mix*excitation)*gate * 0.125<:_,_
with
{
gainIn = source:an.amp_follower_ud(0.001,0.005)*sourceGain;
};
vocoderDemo = mainOsc*envelope, source : vocoder(bands, att, rel, bwRatio, sourceGain, gate):filter,filter
with
{
source = _;
bands = 74;
att = 0.1*0.001;
rel = 5*0.001;
bwRatio = 0.5;
};
gate = button("gate");
f = nentry("freq",200,40,2000,0.01);
bend = nentry("bend[acc: 0 0 -1000 0 1000]",1,0,10,0.01) : si.polySmooth(t,0.999,1);
g = nentry("gain",1,0,1,0.01);
t = button("gate");
y = hslider("y",0.5,0,1,0.01):si.smoo;
mix = hslider("kb1k1x",0,0,1,0.01):si.smoo;
xParam = hslider("kb1k0x", 1, 0, 1, 0.001);
keyboard = hslider("keyboard",0,0,2,1) : int;
sourceGain = hslider("kb1k2x", 0.2, 0, 1, 0.01);
toneParam = hslider("kb1k3x",0,0,1,0.01):si.smoo;
filter = fi.lowpass(3,cutoff);
freq = f*bend;
gainParam = select2(keyboard==2, 1-y, y);
gain = gainParam*g;
envelope = t*gain : si.smoo;
lowFreq = 80;
highFreq = 10000;
cutoff = xParam * (highFreq-lowFreq) + lowFreq;
sawOsc = os.sawtooth(freq);
squareOsc = os.lf_squarewave(freq);
mainOsc = toneParam*sawOsc + (1-toneParam)*squareOsc;
process = vocoderDemo;
|
ce9aa143061535c019091591536c6957f7e6198bd4aa8c070d787b32f090536c | Rickr922/Faust-FDS | 2dKirchhoffThinPlate.dsp | import("stdfaust.lib");
/*
WARNING:
- At the moment, 2D models with more than 30x20 points might crash the c++
compiler.
- 2D models need to be compiled with the command line compiler, the online
compiler might not work.
*/
declare name "2dKirchhoffThinPlate";
declare description "Linear plate model with impulse excitation based on Kirchhoff-Love plates theory with added damping.";
declare author "Riccardo Russo";
//--------------------------------Model Settings-----------------------------//
nPointsX = 20;
nPointsY = 10;
k = 1/ma.SR;
K = 20; //Plate stiffness parameter
s0 = 2; //Frequency independent damping
s1 = 0.05; //Frequency dependent damping
c=344; //Speed of sound in the plate
coeff = c^2*k^2+4*s1*k;
h = sqrt((coeff+sqrt(coeff*coeff+16*K*K*k*k)));
lambda = c*k/h;
//----------------------------------Equations--------------------------------//
mu = K*K*k*k/(h^4);
den = 1+s0*k;
A = 2*(1-10*mu-2*lambda*lambda-4*s1*k*k)/den;
B = (s0*k+4*k*k-1)/den;
C = (8*mu + lambda*lambda + 2*s1*k*k)/den;
D = -2*mu/den;
E = -mu/den;
F = -2*s1*k*k/den;
midCoeff = 0,0,E,0,0,
0,D,C,D,0,
E,C,A,C,E,
0,D,C,D,0,
0,0,E,0,0;
midCoeffDelay1 = 0,0,0,0,0,
0,0,F,0,0,
0,F,B,F,0,
0,0,F,0,0,
0,0,0,0,0;
r = 2;
t = 1;
coefficients = midCoeff,midCoeffDelay1;
scheme(pointsX,pointsY) = par(i, pointsX,
par(j,pointsY, coefficients));
//----------------------------------Controls---------------------------------//
inPointX=hslider("Input Point X",floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("Input Point Y",floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("Output Point X",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("Output Point Y",floor(nPointsY/2),0,nPointsY-1,0.01);
hit = button("Play");
//----------------------------------Force---------------------------------//
forceModel = hit:ba.impulsify;
//----------------------------------Process---------------------------------//
process =
forceModel<:fd.linInterp2D(nPointsX,nPointsY,inPointX,inPointY):
fd.model2D(nPointsX,nPointsY,r,t,scheme(nPointsX,nPointsY)):
fd.linInterp2DOut(nPointsX,nPointsY,outPointX,outPointY);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/e6f6db399332dc26ad2904e47971f302b9a8fc63/library/CorrectExamples/2dKirchhoffThinPlate.dsp | faust |
WARNING:
- At the moment, 2D models with more than 30x20 points might crash the c++
compiler.
- 2D models need to be compiled with the command line compiler, the online
compiler might not work.
--------------------------------Model Settings-----------------------------//
Plate stiffness parameter
Frequency independent damping
Frequency dependent damping
Speed of sound in the plate
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Process---------------------------------// | import("stdfaust.lib");
declare name "2dKirchhoffThinPlate";
declare description "Linear plate model with impulse excitation based on Kirchhoff-Love plates theory with added damping.";
declare author "Riccardo Russo";
nPointsX = 20;
nPointsY = 10;
k = 1/ma.SR;
coeff = c^2*k^2+4*s1*k;
h = sqrt((coeff+sqrt(coeff*coeff+16*K*K*k*k)));
lambda = c*k/h;
mu = K*K*k*k/(h^4);
den = 1+s0*k;
A = 2*(1-10*mu-2*lambda*lambda-4*s1*k*k)/den;
B = (s0*k+4*k*k-1)/den;
C = (8*mu + lambda*lambda + 2*s1*k*k)/den;
D = -2*mu/den;
E = -mu/den;
F = -2*s1*k*k/den;
midCoeff = 0,0,E,0,0,
0,D,C,D,0,
E,C,A,C,E,
0,D,C,D,0,
0,0,E,0,0;
midCoeffDelay1 = 0,0,0,0,0,
0,0,F,0,0,
0,F,B,F,0,
0,0,F,0,0,
0,0,0,0,0;
r = 2;
t = 1;
coefficients = midCoeff,midCoeffDelay1;
scheme(pointsX,pointsY) = par(i, pointsX,
par(j,pointsY, coefficients));
inPointX=hslider("Input Point X",floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("Input Point Y",floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("Output Point X",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("Output Point Y",floor(nPointsY/2),0,nPointsY-1,0.01);
hit = button("Play");
forceModel = hit:ba.impulsify;
process =
forceModel<:fd.linInterp2D(nPointsX,nPointsY,inPointX,inPointY):
fd.model2D(nPointsX,nPointsY,r,t,scheme(nPointsX,nPointsY)):
fd.linInterp2DOut(nPointsX,nPointsY,outPointX,outPointY);
|
5fc4e63f94ef8274e0e661fbe6b3f847ee1ddd03a0c31f5745c5f90ee4a68a75 | Rickr922/Faust-FDS | HammeredString.dsp | import("stdfaust.lib");
declare name "HammeredString";
declare description "Linear string model coupled with a hammer model for excitation.";
declare author "Riccardo Russo";
//----------------------------------String Settings---------------------------//
//nPoints=int(Length/h);
nPoints = 100;
k = 1/ma.SR;
//Stability condition
coeff = c^2*k^2 + 4*sigma1*k;
h = sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
T = 150; // Tension [N]
radius = 3.5560e-04; // Radius (0.016 gauge) [m]
rho = 8.05*10^3; // Density [kg/m^3];
Area = ma.PI*radius^2; // Area of string section
I = (ma.PI*radius^4)/ 4; // Moment of Inertia
Emod = 174e4; // Young modulus [Pa]
K = sqrt(Emod*I/rho/Area); // Stiffness parameter
c = sqrt(T/rho/Area); // Wave speed
sigma1 = 0.01; // Frequency dependent damping
sigma0 = 0.0005; // Frequency independent damping
//----------------------------------Equations--------------------------------//
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2-6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2+4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = -K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r = 2;
t = 1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
//----------------------------------Controls---------------------------------//
play = button("Play"):ba.impulsify;
inPoint = hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint = hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force---------------------------------//
/*Hammer stiffness from:
A. Sutlov,
Experimental and theoretical studies of piano hammer,
Proceedings of SMAC 03,
pages 175-178*/
KHammer = 30000;
JCoeff = (k^2/den/rho/Area);
KH = 1000;
mH = 0.9;
omega0SqrH = KH/mH;
sigma0H = 14;
alpha = 2.5;
offset = 0.23;
forceScaling = 0.01;
//----------------------------------Process---------------------------------//
gain = 600;
process = (fd.linInterp1D(nPoints,inPoint):>
fd.hammer(JCoeff,omega0SqrH,sigma0H,KHammer,alpha,k,offset,play*forceScaling)<:
fd.linInterp1D(nPoints,inPoint):
fd.model1D(nPoints,r,t,scheme(nPoints)))~si.bus(nPoints):
fd.linInterp1DOut(nPoints,outPoint)*gain<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ead5c05c0eced6ed111dcfd8eeea14d313f74ef6/library/CorrectExamples/HammeredString.dsp | faust | ----------------------------------String Settings---------------------------//
nPoints=int(Length/h);
Stability condition
Tension [N]
Radius (0.016 gauge) [m]
Density [kg/m^3];
Area of string section
Moment of Inertia
Young modulus [Pa]
Stiffness parameter
Wave speed
Frequency dependent damping
Frequency independent damping
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
Hammer stiffness from:
A. Sutlov,
Experimental and theoretical studies of piano hammer,
Proceedings of SMAC 03,
pages 175-178
----------------------------------Process---------------------------------//
| import("stdfaust.lib");
declare name "HammeredString";
declare description "Linear string model coupled with a hammer model for excitation.";
declare author "Riccardo Russo";
nPoints = 100;
k = 1/ma.SR;
coeff = c^2*k^2 + 4*sigma1*k;
h = sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2-6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2+4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = -K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r = 2;
t = 1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
play = button("Play"):ba.impulsify;
inPoint = hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint = hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
KHammer = 30000;
JCoeff = (k^2/den/rho/Area);
KH = 1000;
mH = 0.9;
omega0SqrH = KH/mH;
sigma0H = 14;
alpha = 2.5;
offset = 0.23;
forceScaling = 0.01;
gain = 600;
process = (fd.linInterp1D(nPoints,inPoint):>
fd.hammer(JCoeff,omega0SqrH,sigma0H,KHammer,alpha,k,offset,play*forceScaling)<:
fd.linInterp1D(nPoints,inPoint):
fd.model1D(nPoints,r,t,scheme(nPoints)))~si.bus(nPoints):
fd.linInterp1DOut(nPoints,outPoint)*gain<:_,_;
|
8b0478f941236229cb37a8fcec2e754660a1a347bb6624c29aa408d0b4b11585 | Rickr922/Faust-FDS | stringDampedAuto.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
nPoints = 4;
//modelType: 1->free-fixed; 2->fixed-free; else->fixed-fixed
modelType = 0;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 1000;
//----------------------------------Equations--------------------------------//
spaceDep = 2; //n° of spatial side points needed by the update eq
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
stringDampMidPoint(fIn, uSide_l, uSide_r) = u //u_(l-1)=uSide_l,u_(l+1)=uSide_r
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(uSide_l+uSide_r)/C1 + fIn;
}<:par(i,spaceDep,_);
stringDampFreePoint(fIn,uSide) = u
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*uSide/C1 + fIn;
}<:par(i,spaceDep-1,_);
fixedPoint(fIn,uSide) = par(i,spaceDep-1,0);
buildStringDamp(nPoints,modelType) =
//modelType: 1->free-fixed; 2->fixed-free; else->fixed-fixed
(_,_<:(fixedPoint, stringDampFreePoint:select2(modelType==1))),
par(i, nPoints-2, stringDampMidPoint),
(_,_<:(fixedPoint, stringDampFreePoint:select2(modelType==2)));
//----------------------------------Controls---------------------------------//
hit = button("hit"):ba.impulsify;
inPoint=hslider("input point", 1,0,nPoints-1,1);
outPoint=hslider("output point",1,0,(nPoints*spaceDep-2)/spaceDep,1);
//because every module has 2 outs, except
//the boundaries-> -2
//----------------------------------Build Model-------------------------------//
nConnections = nPoints*spaceDep-2+nPoints;
K = (nPoints*spaceDep-4)/2;
model =
(route(nConnections,nConnections,
par(i,K+1,(1+2*i,4+3*i),(2+2*i,2+3*i)),
(2+2*K+1,1),
par(i,nPoints-1,(2+2*K+(i+2),3*(i+1)))):
buildStringDamp(nPoints,modelType))~par(i, (nPoints*spaceDep-2), _):
_,par(i,nPoints-2,!,_),_:ba.selectn(nPoints,outPoint);
process = hit:ba.selectoutn(nPoints,inPoint):model<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/oldRoute/stringDamped/stringDampedAuto.dsp | faust | --------------------------------Model Settings-----------------------------//
modelType: 1->free-fixed; 2->fixed-free; else->fixed-fixed
----------------------------------Equations--------------------------------//
n° of spatial side points needed by the update eq
u_(l-1)=uSide_l,u_(l+1)=uSide_r
modelType: 1->free-fixed; 2->fixed-free; else->fixed-fixed
----------------------------------Controls---------------------------------//
because every module has 2 outs, except
the boundaries-> -2
----------------------------------Build Model-------------------------------// | import("stdfaust.lib");
nPoints = 4;
modelType = 0;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 1000;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(uSide_l+uSide_r)/C1 + fIn;
}<:par(i,spaceDep,_);
stringDampFreePoint(fIn,uSide) = u
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*uSide/C1 + fIn;
}<:par(i,spaceDep-1,_);
fixedPoint(fIn,uSide) = par(i,spaceDep-1,0);
buildStringDamp(nPoints,modelType) =
(_,_<:(fixedPoint, stringDampFreePoint:select2(modelType==1))),
par(i, nPoints-2, stringDampMidPoint),
(_,_<:(fixedPoint, stringDampFreePoint:select2(modelType==2)));
hit = button("hit"):ba.impulsify;
inPoint=hslider("input point", 1,0,nPoints-1,1);
outPoint=hslider("output point",1,0,(nPoints*spaceDep-2)/spaceDep,1);
nConnections = nPoints*spaceDep-2+nPoints;
K = (nPoints*spaceDep-4)/2;
model =
(route(nConnections,nConnections,
par(i,K+1,(1+2*i,4+3*i),(2+2*i,2+3*i)),
(2+2*K+1,1),
par(i,nPoints-1,(2+2*K+(i+2),3*(i+1)))):
buildStringDamp(nPoints,modelType))~par(i, (nPoints*spaceDep-2), _):
_,par(i,nPoints-2,!,_),_:ba.selectn(nPoints,outPoint);
process = hit:ba.selectoutn(nPoints,inPoint):model<:_,_;
|
3bb4c56b703fcced189f3377229340a3ada96ca15b1f73234ab960472918448e | Rickr922/Faust-FDS | dampedStringv2.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
nPoints = 5;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 500;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
//----------------------------------Equations--------------------------------//
lambda = c*k/h;
nInputs = inputs(schemeMidPoint);
schemeMidPoint(u_w,u,u_e) = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(u_w+u_e)/C1<:_,_,_;
//----------------------------------Controls---------------------------------//
hit = button("hit"):ba.impulsify;
stop = button("Stop");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force---------------------------------//
forceModel = hit;
linInterpolForce(i,inPoint,force) = force*select2(
i==int(inPoint), select2(i==int(inPoint+1),0,fraction),(1-fraction))
with
{
fraction = ma.frac(inPoint);
};
//----------------------------------Output-------------------------------//
linInterp(outPoint) = par(i,nPoints,_*select2(
i==int(outPoint), select2(i==int(outPoint+1),0,fraction),(1-fraction)))
with
{
fraction = ma.frac(outPoint);
};
linInterpOut(outPoint) = par(i,nPoints,_*select2(
i==int(outPoint), select2(i==int(outPoint+1),0,fraction),(1-fraction))):>_
with
{
fraction = ma.frac(outPoint);
};
//----------------------------------Build Model-------------------------------//
buildScheme(nPoints, node) = par (i, nPoints, node);
routing(nPoints,nInputs) = route(nPoints*nInputs+nPoints, nPoints*nInputs,
par(x, nPoints, connections(x)),
par(i, nPoints, nPoints*nInputs + 1 + i, C(i)))
with {
connections(x) = W(x), E(x-1),
C(x), C(x),
E(x), W(x+1);
W(x) = (1 + 0 + (x*nInputs)) * (x>=0) * (x<nPoints);
C(x) = (1 + 1 + (x*nInputs)) * (x>=0) * (x<nPoints);
E(x) = (1 + 2 + (x*nInputs)) * (x>=0) * (x<nPoints);
};
model(nPoints) = (routing(nPoints,nInputs) : buildScheme(nPoints, schemeMidPoint)) ~ si.bus(nPoints*nInputs) : par(i,nPoints,!,_,!);
process = forceModel<:linInterp(inPoint): model(nPoints):linInterpOut(outPoint)<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/newRoute/dampedString/dampedStringv2.dsp | faust | --------------------------------Model Settings-----------------------------//
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Output-------------------------------//
----------------------------------Build Model-------------------------------// | import("stdfaust.lib");
nPoints = 5;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 500;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
nInputs = inputs(schemeMidPoint);
schemeMidPoint(u_w,u,u_e) = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(u_w+u_e)/C1<:_,_,_;
hit = button("hit"):ba.impulsify;
stop = button("Stop");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
forceModel = hit;
linInterpolForce(i,inPoint,force) = force*select2(
i==int(inPoint), select2(i==int(inPoint+1),0,fraction),(1-fraction))
with
{
fraction = ma.frac(inPoint);
};
linInterp(outPoint) = par(i,nPoints,_*select2(
i==int(outPoint), select2(i==int(outPoint+1),0,fraction),(1-fraction)))
with
{
fraction = ma.frac(outPoint);
};
linInterpOut(outPoint) = par(i,nPoints,_*select2(
i==int(outPoint), select2(i==int(outPoint+1),0,fraction),(1-fraction))):>_
with
{
fraction = ma.frac(outPoint);
};
buildScheme(nPoints, node) = par (i, nPoints, node);
routing(nPoints,nInputs) = route(nPoints*nInputs+nPoints, nPoints*nInputs,
par(x, nPoints, connections(x)),
par(i, nPoints, nPoints*nInputs + 1 + i, C(i)))
with {
connections(x) = W(x), E(x-1),
C(x), C(x),
E(x), W(x+1);
W(x) = (1 + 0 + (x*nInputs)) * (x>=0) * (x<nPoints);
C(x) = (1 + 1 + (x*nInputs)) * (x>=0) * (x<nPoints);
E(x) = (1 + 2 + (x*nInputs)) * (x>=0) * (x<nPoints);
};
model(nPoints) = (routing(nPoints,nInputs) : buildScheme(nPoints, schemeMidPoint)) ~ si.bus(nPoints*nInputs) : par(i,nPoints,!,_,!);
process = forceModel<:linInterp(inPoint): model(nPoints):linInterpOut(outPoint)<:_,_;
|
7fcc38f9187f9b55d37197a09d91e587e235b623c71a7b8c67a73aa92da58ba9 | Rickr922/Faust-FDS | PianoHammeredString.dsp | import("stdfaust.lib");
import("fds.lib");
//----------------------------------String Settings---------------------------//
/* Data:
Music wire ASTM A 228
https://materials.gelsonluz.com/2020/09/astm-a228-properties-chem-mech-rankings.html
A. Stulov,
Physical modelling of the piano string scale,
Applied Acoustics,
Volume 69, Issue 11,
2008,
Pages 977-984,
ISSN 0003-682X,*/
L = 0.77; //[m]
//nPoints=int(Length/h);
nPoints = 77;
k = 1/ma.SR;
//Stability condition
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
T = 667.1; // Tension [N]
radius = 0.5e-03; // Radius (0.016 gauge) [m]
rho = 7.9*10^3; // Density [kg/m^3];
Area = ma.PI*radius^2; // Area of string section
I = (ma.PI*radius^4)/ 4; // Moment of Inertia
Emod = 200e9; // Young modulus [Pa]
K = sqrt(Emod*I/rho/Area); // Stiffness parameter
c = sqrt(T/rho/Area); // Wave speed
sigma1 = 0.01; // Frequency dependent damping
sigma0 = 0.05; // Frequency independent damping
mass = Area*L*rho;
//----------------------------------Equations--------------------------------//
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
//----------------------------------Controls---------------------------------//
play = button("Play"):ba.impulsify;
inPoint=hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force---------------------------------//
/*Hammer stiffness from:
A. Sutlov,
Experimental and theoretical studies of piano hammer,
Proceedings of SMAC 03,
pages 175-178*/
KHammer = 30000;
JCoeff = (k^2/den/rho/Area);
KH = 1000;
mH = 0.9;
omega0SqrH = KH/mH;
sigma0H = 14;
alpha = 2.5;
offset=0.23;
forceScaling = 0.01;
//----------------------------------Process---------------------------------//
gain = 1000;
process = (linInterp1D(nPoints,inPoint):>
hammer(JCoeff,omega0SqrH,sigma0H,KHammer,alpha,k,offset,play*forceScaling)<:
linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)))~si.bus(nPoints):
linInterp1DOut(nPoints,outPoint)*gain<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/library/PianoHammeredString.dsp | faust | ----------------------------------String Settings---------------------------//
Data:
Music wire ASTM A 228
https://materials.gelsonluz.com/2020/09/astm-a228-properties-chem-mech-rankings.html
A. Stulov,
Physical modelling of the piano string scale,
Applied Acoustics,
Volume 69, Issue 11,
2008,
Pages 977-984,
ISSN 0003-682X,
[m]
nPoints=int(Length/h);
Stability condition
Tension [N]
Radius (0.016 gauge) [m]
Density [kg/m^3];
Area of string section
Moment of Inertia
Young modulus [Pa]
Stiffness parameter
Wave speed
Frequency dependent damping
Frequency independent damping
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
Hammer stiffness from:
A. Sutlov,
Experimental and theoretical studies of piano hammer,
Proceedings of SMAC 03,
pages 175-178
----------------------------------Process---------------------------------// | import("stdfaust.lib");
import("fds.lib");
nPoints = 77;
k = 1/ma.SR;
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
mass = Area*L*rho;
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
play = button("Play"):ba.impulsify;
inPoint=hslider("Input Point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
KHammer = 30000;
JCoeff = (k^2/den/rho/Area);
KH = 1000;
mH = 0.9;
omega0SqrH = KH/mH;
sigma0H = 14;
alpha = 2.5;
offset=0.23;
forceScaling = 0.01;
gain = 1000;
process = (linInterp1D(nPoints,inPoint):>
hammer(JCoeff,omega0SqrH,sigma0H,KHammer,alpha,k,offset,play*forceScaling)<:
linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)))~si.bus(nPoints):
linInterp1DOut(nPoints,outPoint)*gain<:_,_;
|
71c02a1a3c4eb509595c3456bab380b10834b78239a0fcb9500cd95d474967b1 | Rickr922/Faust-FDS | stringDampedOutSelector.dsp | import("stdfaust.lib");
/*Number of points: 19*/
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 1000;
nPoints = 19;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
//------------------------------------------Equations--------------------------
nSpatialDependency = 2; //n° of spatial side points needed by the update eq
stringDampMidPoint(fIn, uSide_l, uSide_r) = u //u_(l-1)=uSide_l, u_(l+1)=uSide_
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(uSide_l+uSide_r)/C1 + fIn;
}<:_,_;
stringDampFreePoint(uSide) = u
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*uSide/C1;
};
fixedPoint(uSide) = 0;
//----------------------------------------Controls-----------------------------
hit = button("hit"):ba.impulsify;
outPoint=hslider("output point",5,0,(nPoints*nSpatialDependency-2)/nSpatialDependency,1);
//because every module has 2 outs, except
//the boundaries-> -2
//-----------------------------------------Model------------------------------
model =
(route((nPoints*nSpatialDependency-2+1),(nPoints*nSpatialDependency-2+1),
(1,2),
(2,1),(3,4),
(4,3),(5,6),
(6,5),(7,8),
(8,7),(9,10),
(10,9),(11,12),
(12,11),(13,14),
(14,13),(15,16),
(16,15),(17,19),//out 18 left free for the force in->everything else jumps one place
(18,17),(19,21),
(20,20),(21,23),
(22,22),(23,25),
(24,24),(25,27),
(26,26),(27,29),
(28,28),(29,31),
(30,30),(31,33),
(32,32),(33,35),
(34,34),(35,37),
(36,36),(37,18))://force in
stringDampFreePoint,
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint ,
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
fixedPoint)~par(i, (nPoints*nSpatialDependency-2), _):
_,par(i,nPoints-2,!,_),_:ba.selectn(19,outPoint);
process = hit:model<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/oldRoute/stringDamped/stringDampedOutSelector.dsp | faust | Number of points: 19
------------------------------------------Equations--------------------------
n° of spatial side points needed by the update eq
u_(l-1)=uSide_l, u_(l+1)=uSide_
----------------------------------------Controls-----------------------------
because every module has 2 outs, except
the boundaries-> -2
-----------------------------------------Model------------------------------
out 18 left free for the force in->everything else jumps one place
force in | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 1000;
nPoints = 19;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(uSide_l+uSide_r)/C1 + fIn;
}<:_,_;
stringDampFreePoint(uSide) = u
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*uSide/C1;
};
fixedPoint(uSide) = 0;
hit = button("hit"):ba.impulsify;
outPoint=hslider("output point",5,0,(nPoints*nSpatialDependency-2)/nSpatialDependency,1);
model =
(route((nPoints*nSpatialDependency-2+1),(nPoints*nSpatialDependency-2+1),
(1,2),
(2,1),(3,4),
(4,3),(5,6),
(6,5),(7,8),
(8,7),(9,10),
(10,9),(11,12),
(12,11),(13,14),
(14,13),(15,16),
(18,17),(19,21),
(20,20),(21,23),
(22,22),(23,25),
(24,24),(25,27),
(26,26),(27,29),
(28,28),(29,31),
(30,30),(31,33),
(32,32),(33,35),
(34,34),(35,37),
stringDampFreePoint,
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint ,
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
stringDampMidPoint(0),
fixedPoint)~par(i, (nPoints*nSpatialDependency-2), _):
_,par(i,nPoints-2,!,_),_:ba.selectn(19,outPoint);
process = hit:model<:_,_;
|
667ad97ecb1c2ec74a306ffe43a729f76b4e17e9ec4b8a0463cc56a828bd9379 | Rickr922/Faust-FDS | stringDampedOptim.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
nPoints = 4;
//modelType: 1->free-fixed; 2->fixed-free; else->fixed-fixed
modelType = 0;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 1000;
//----------------------------------Equations--------------------------------//
spaceDep = 2; //n° of spatial side points needed by the update eq
nPointInputs = inputs(stringDampMidPoint);
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
stringDampMidPoint(fIn, uSide_l, uSide_r) = u //u_(l-1)=uSide_l,u_(l+1)=uSide_r
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(uSide_l+uSide_r)/C1 + fIn;
};
stringDampFreePointL(fIn, uSide_l, uSide_r) = u
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*uSide_r/C1 + fIn;
};
stringDampFreePointR(fIn, uSide_l, uSide_r) = u
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*uSide_l/C1 + fIn;
};
fixedPoint(fIn, uSide_l, uSide_r) = 0;
buildStringDamp(nPoints,modelType) =
//modelType: 1->free-fixed; 2->fixed-free; else->fixed-fixed
(si.bus(nPointInputs)<:(stringDampMidPoint, stringDampFreePointL:select2(modelType==1))),
par(i, nPoints-2, stringDampMidPoint),
(si.bus(nPointInputs)<:(stringDampMidPoint, stringDampFreePointR:select2(modelType==2)));
//Nota che non mi servono i fixed points perchè nelle connessioni
// vuote entra 0!! Praticamente è come se avessi dei virtual boundaries
//----------------------------------Controls---------------------------------//
hit = button("hit"):ba.impulsify;
inPoint=hslider("input point", 1,0,nPoints-1,1);
outPoint=hslider("output point",1,0,nPoints-1,1);
//----------------------------------Build Model-------------------------------//
model =
(route(2*nPoints,nPoints*spaceDep+nPoints,
par(i,nPoints,(i+1,nPointInputs*i),(i+1,5+nPointInputs*i)),
par(i,nPoints,(nPoints+1+i,1+nPointInputs*i))):
buildStringDamp(nPoints,modelType))~si.bus(nPoints):
si.bus(nPoints):ba.selectn(nPoints,outPoint);
process = hit:ba.selectoutn(nPoints,inPoint):model<:_,_;
//process = buildStringDamp(nPoints,modelType);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/oldRoute/stringDamped/stringDampedOptim.dsp | faust | --------------------------------Model Settings-----------------------------//
modelType: 1->free-fixed; 2->fixed-free; else->fixed-fixed
----------------------------------Equations--------------------------------//
n° of spatial side points needed by the update eq
u_(l-1)=uSide_l,u_(l+1)=uSide_r
modelType: 1->free-fixed; 2->fixed-free; else->fixed-fixed
Nota che non mi servono i fixed points perchè nelle connessioni
vuote entra 0!! Praticamente è come se avessi dei virtual boundaries
----------------------------------Controls---------------------------------//
----------------------------------Build Model-------------------------------//
process = buildStringDamp(nPoints,modelType); | import("stdfaust.lib");
nPoints = 4;
modelType = 0;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 1000;
nPointInputs = inputs(stringDampMidPoint);
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(uSide_l+uSide_r)/C1 + fIn;
};
stringDampFreePointL(fIn, uSide_l, uSide_r) = u
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*uSide_r/C1 + fIn;
};
stringDampFreePointR(fIn, uSide_l, uSide_r) = u
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*uSide_l/C1 + fIn;
};
fixedPoint(fIn, uSide_l, uSide_r) = 0;
buildStringDamp(nPoints,modelType) =
(si.bus(nPointInputs)<:(stringDampMidPoint, stringDampFreePointL:select2(modelType==1))),
par(i, nPoints-2, stringDampMidPoint),
(si.bus(nPointInputs)<:(stringDampMidPoint, stringDampFreePointR:select2(modelType==2)));
hit = button("hit"):ba.impulsify;
inPoint=hslider("input point", 1,0,nPoints-1,1);
outPoint=hslider("output point",1,0,nPoints-1,1);
model =
(route(2*nPoints,nPoints*spaceDep+nPoints,
par(i,nPoints,(i+1,nPointInputs*i),(i+1,5+nPointInputs*i)),
par(i,nPoints,(nPoints+1+i,1+nPointInputs*i))):
buildStringDamp(nPoints,modelType))~si.bus(nPoints):
si.bus(nPoints):ba.selectn(nPoints,outPoint);
process = hit:ba.selectoutn(nPoints,inPoint):model<:_,_;
|
4548ae0d5b1adc5d8c733285867c3590d3ef8f999893770ba9451ee002f8d5f6 | Rickr922/Faust-FDS | dampedStringFIN.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
nPoints = 60;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 500;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
//----------------------------------Equations--------------------------------//
lambda = c*k/h;
nInputs = inputs(schemeMidPoint);
//west=left, east=right
schemeMidPoint(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(u_w+u_e)/C1 + fIn;
schemeFreePointWest(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*u_e/C1 + fIn;
schemeFreePointEast(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*u_w/C1 + fIn;
schemeFixedPoint(fIn,u_w,u,u_e) = 0;
//----------------------------------Controls---------------------------------//
hit = button("hit"):ba.impulsify;
stop = button("Stop");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force---------------------------------//
forceModel = hit;
linInterp1DForce(i,inPoint,force) = force*select2(
i==int(inPoint), select2(i==int(inPoint+1),0,fraction),(1-fraction))
with
{
fraction = ma.frac(inPoint);
};
linInterp1D(outPoint,nPoints) = par(i,nPoints,_*select2(
i==int(outPoint), select2(i==int(outPoint+1),0,fraction),(1-fraction)))
with
{
fraction = ma.frac(outPoint);
};
//----------------------------------Output-------------------------------//
linInterp1DOut(outPoint,nPoints) = linInterp1D(outPoint,nPoints):>_;
//----------------------------------Build Model-------------------------------//
buildScheme(nPoints) = par (i, nPoints, schemeMidPoint);
/*schemeFixedPoint,
par (i, nPoints-2, schemeMidPoint),
schemeFreePointEast;*/
routing(nPoints,nInputs) = route(nPoints+nPoints, nPoints*nInputs,
par(x, nPoints, connections(x)))
with {
connections(x) = Current(x)+nPoints, F(x),
Current(x), E(x-1),
Current(x), C(x),
Current(x), W(x+1);
Current(x) = x+1;
F(x) = (1 + 0 + (x*nInputs)) * (x>=0) * (x<nPoints);
W(x) = (1 + 1 + (x*nInputs)) * (x>=0) * (x<nPoints);
C(x) = (1 + 2 + (x*nInputs)) * (x>=0) * (x<nPoints);
E(x) = (1 + 3 + (x*nInputs)) * (x>=0) * (x<nPoints);
};
model(nPoints) = (routing(nPoints,nInputs) : buildScheme(nPoints)) ~ si.bus(nPoints);
process = forceModel<:linInterp1D(inPoint,nPoints): model(nPoints):linInterp1DOut(outPoint,nPoints)<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/newRoute/dampedString/dampedStringFIN.dsp | faust | --------------------------------Model Settings-----------------------------//
----------------------------------Equations--------------------------------//
west=left, east=right
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Output-------------------------------//
----------------------------------Build Model-------------------------------//
schemeFixedPoint,
par (i, nPoints-2, schemeMidPoint),
schemeFreePointEast; | import("stdfaust.lib");
nPoints = 60;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 500;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
nInputs = inputs(schemeMidPoint);
schemeMidPoint(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(u_w+u_e)/C1 + fIn;
schemeFreePointWest(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*u_e/C1 + fIn;
schemeFreePointEast(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*u_w/C1 + fIn;
schemeFixedPoint(fIn,u_w,u,u_e) = 0;
hit = button("hit"):ba.impulsify;
stop = button("Stop");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
forceModel = hit;
linInterp1DForce(i,inPoint,force) = force*select2(
i==int(inPoint), select2(i==int(inPoint+1),0,fraction),(1-fraction))
with
{
fraction = ma.frac(inPoint);
};
linInterp1D(outPoint,nPoints) = par(i,nPoints,_*select2(
i==int(outPoint), select2(i==int(outPoint+1),0,fraction),(1-fraction)))
with
{
fraction = ma.frac(outPoint);
};
linInterp1DOut(outPoint,nPoints) = linInterp1D(outPoint,nPoints):>_;
buildScheme(nPoints) = par (i, nPoints, schemeMidPoint);
routing(nPoints,nInputs) = route(nPoints+nPoints, nPoints*nInputs,
par(x, nPoints, connections(x)))
with {
connections(x) = Current(x)+nPoints, F(x),
Current(x), E(x-1),
Current(x), C(x),
Current(x), W(x+1);
Current(x) = x+1;
F(x) = (1 + 0 + (x*nInputs)) * (x>=0) * (x<nPoints);
W(x) = (1 + 1 + (x*nInputs)) * (x>=0) * (x<nPoints);
C(x) = (1 + 2 + (x*nInputs)) * (x>=0) * (x<nPoints);
E(x) = (1 + 3 + (x*nInputs)) * (x>=0) * (x<nPoints);
};
model(nPoints) = (routing(nPoints,nInputs) : buildScheme(nPoints)) ~ si.bus(nPoints);
process = forceModel<:linInterp1D(inPoint,nPoints): model(nPoints):linInterp1DOut(outPoint,nPoints)<:_,_;
|
2e2e73a6ffe7be79e619a395f7f2a8c0d8ea28bea03f01c40eff7e735b47a24c | Rickr922/Faust-FDS | 2dWaveOldAutoRoute.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 3;
nPointsY = 3;
lambda = c*k/h;
r=1;
alpha = lambda*lambda;
beta = 2*(1-2*lambda*lambda);
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, coefficients));
//----------------------------------Controls---------------------------------//
inPointX=hslider("input point x", floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("input point y", floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("output point x",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("output point y",floor(nPointsY/2),0,nPointsY-1,0.01);
forceModel = button("play") : ba.impulsify;
stop = button("Stop");
//----------------------------------Library---------------------------------//
schemeMidPoint(fIn,u_nw,u_n,u_ne,u_w,u,u_e,u_sw,u_s,u_se) =
0*(u_nw@0)+alpha*(u_n@0)+0*(u_ne@0)+alpha*(u_w@0)+beta*(u@0)+alpha*(u_e@0)+0*(u_sw@0)+alpha*(u_s@0)+0*(u_se@0) +
0*(u_nw@1)+0*(u_n@1)+0*(u_ne@1)+0*(u_w@1)+(-1)*(u@1)+0*(u_e@1)+0*(u_sw@1)+0*(u_s@1)+0*(u_se@1) +
fIn;
buildScheme(X,Y) = par (x, X,
par(y,Y, schemeMidPoint));
//----------------------------------Interpolation---------------------------------//
linInterpolation2D(pointX,pointY) =
par(i,nPointsX,
par(j,nPointsY,_*
select2((i==intX) & (j==intY),
select2((i==(intX+1)) & (j==intY),
select2((i==intX) & (j==(intY+1)),
select2((i==(intX+1)) & (j==(intY+1)),
0,
fractionX*fractionY),
(1-fractionX)*fractionY),
fractionX*(1-fractionY)),
(1-fractionX)*(1-fractionY))))
with
{
fractionX = ma.frac(pointX);
fractionY = ma.frac(pointY);
intX = int(pointX);
intY = int(pointY);
};
//----------------------------------Force---------------------------------//
stairsForce(X,Y,pointX,pointY) = ba.selectoutn(X*Y,pointY+pointX*Y);
//----------------------------------Output-------------------------------//
stairsOutput(X,Y,pointX,pointY) = ba.selectn(X*Y,pointY+pointX*Y);
linInterpolation2DOut(pointX,pointY) = linInterpolation2D(pointX,pointY):>_;
//----------------------------------Build Model-------------------------------//
route2D(X, Y, r) = route(X*Y*2, X*Y*nInputs,
par(x, X, par(y, Y, connections(x,y))))
with
{
connections(x,y) = P(x,y) + X*Y, C(x,y,0),
par(j,nNeighborsXY,
par(i,nNeighborsXY,
P(x,y),C(x+i-r,y+j-r,nNeighbors-(i*nNeighborsXY+j))));
P(x,y) = x*Y+y+1;
C(x,y,count) = (1 + count + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
nNeighborsXY = 2*r+1;
nNeighbors = nNeighborsXY^2;
nInputs = nNeighbors+1;
};
model(X,Y,r) = (route2D(X,Y,r) : buildScheme(X,Y)) ~ par(i,X*Y,_/**(stop==0)*/);
process = forceModel <: linInterpolation2D(inPointX,inPointY) : model(nPointsX,nPointsY,r) : linInterpolation2DOut(outPointX,outPointY)<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/caRoute/2dWave/2dWaveOldAutoRoute.dsp | faust | --------------------------------Model Settings-----------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Library---------------------------------//
----------------------------------Interpolation---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Output-------------------------------//
----------------------------------Build Model-------------------------------//
*(stop==0) | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 3;
nPointsY = 3;
lambda = c*k/h;
r=1;
alpha = lambda*lambda;
beta = 2*(1-2*lambda*lambda);
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, coefficients));
inPointX=hslider("input point x", floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("input point y", floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("output point x",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("output point y",floor(nPointsY/2),0,nPointsY-1,0.01);
forceModel = button("play") : ba.impulsify;
stop = button("Stop");
schemeMidPoint(fIn,u_nw,u_n,u_ne,u_w,u,u_e,u_sw,u_s,u_se) =
0*(u_nw@0)+alpha*(u_n@0)+0*(u_ne@0)+alpha*(u_w@0)+beta*(u@0)+alpha*(u_e@0)+0*(u_sw@0)+alpha*(u_s@0)+0*(u_se@0) +
0*(u_nw@1)+0*(u_n@1)+0*(u_ne@1)+0*(u_w@1)+(-1)*(u@1)+0*(u_e@1)+0*(u_sw@1)+0*(u_s@1)+0*(u_se@1) +
fIn;
buildScheme(X,Y) = par (x, X,
par(y,Y, schemeMidPoint));
linInterpolation2D(pointX,pointY) =
par(i,nPointsX,
par(j,nPointsY,_*
select2((i==intX) & (j==intY),
select2((i==(intX+1)) & (j==intY),
select2((i==intX) & (j==(intY+1)),
select2((i==(intX+1)) & (j==(intY+1)),
0,
fractionX*fractionY),
(1-fractionX)*fractionY),
fractionX*(1-fractionY)),
(1-fractionX)*(1-fractionY))))
with
{
fractionX = ma.frac(pointX);
fractionY = ma.frac(pointY);
intX = int(pointX);
intY = int(pointY);
};
stairsForce(X,Y,pointX,pointY) = ba.selectoutn(X*Y,pointY+pointX*Y);
stairsOutput(X,Y,pointX,pointY) = ba.selectn(X*Y,pointY+pointX*Y);
linInterpolation2DOut(pointX,pointY) = linInterpolation2D(pointX,pointY):>_;
route2D(X, Y, r) = route(X*Y*2, X*Y*nInputs,
par(x, X, par(y, Y, connections(x,y))))
with
{
connections(x,y) = P(x,y) + X*Y, C(x,y,0),
par(j,nNeighborsXY,
par(i,nNeighborsXY,
P(x,y),C(x+i-r,y+j-r,nNeighbors-(i*nNeighborsXY+j))));
P(x,y) = x*Y+y+1;
C(x,y,count) = (1 + count + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
nNeighborsXY = 2*r+1;
nNeighbors = nNeighborsXY^2;
nInputs = nNeighbors+1;
};
process = forceModel <: linInterpolation2D(inPointX,inPointY) : model(nPointsX,nPointsY,r) : linInterpolation2DOut(outPointX,outPointY)<:_,_;
|
580d53e79737fc204e3d99bd14815b1d4871eb040fc81ab1a8e27f48c6aed6f6 | Rickr922/Faust-FDS | string1_D.dsp | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c*k;
lambda = c*k/h;
string1dMidPoint(fIn, uSide_l, uSide_r) = u
letrec
{
'u = 2*u-u'+ lambda*lambda*(uSide_l-2*u+uSide_r) + fIn;
};
updatePoint(fIn, uSide_l, uSide_r) = string1dMidPoint(fIn, uSide_l, uSide_r)<:_,_; //u_(l-1)=uSide_l, u_(l+1)=uSide_r
updatePointOut(fIn, uSide_l, uSide_r) = string1dMidPoint(fIn, uSide_l, uSide_r)<:_,_,_; //u_(l-1)=uSide_l, u_(l+1)=uSide_r
fixedPoint(uSide) = 0;
freePoint(uSide) = u
letrec
{
'u = 2*u-u'+ lambda*lambda*2*(uSide - u);
};
/*
NOTATION: u_n_m
n indicates the number of element (update or fixed point)
m indicates the connection: 1 is left connection, 2 is right connections
Ex: the extreme left point 0 gives out only x02 because it only has a right
connection, a generic element gives xn1, xn2, the extreme right point N
gives out only xN1 because it has only a left connection
*/
//routeOut takes the output and puts it as the last connection
routeOut(
u02,
u11,u12,
u21,u22,
u31,u32,
u41,u42,
u51,u52,
u61,u62,uOut,
u71,u72,
u81) = u02,u11,u12,u21,u22,u31,u32,u41,u42,u51,u52,u61,u62,u71,u72,u81,uOut;
//routeIn needs to switch all the connections and give them to the proper elements
routeIn(u02,u11,u12,u21,u22,u31,u32,u41,u42,u51,u52,u61,u62,u71,u72,u81,fIn) =
u11,
u02,u21,
u12,u31,
u22,u41,
fIn,u32,u51,
u42,u61,
u52,u71,
u62,u81,
u72;
hit = button("hit"):ba.impulsify;
model =
(routeIn:
fixedPoint,
updatePoint(0),
updatePoint(0),
updatePoint(0),
updatePoint,
updatePoint(0),
updatePointOut(0),
updatePoint(0),
fixedPoint : routeOut)~par(i, 16, _): par(i, 16,!), par(i, 1, _);
process = hit:model<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/oldRoute/string/string1_D.dsp | faust | u_(l-1)=uSide_l, u_(l+1)=uSide_r
u_(l-1)=uSide_l, u_(l+1)=uSide_r
NOTATION: u_n_m
n indicates the number of element (update or fixed point)
m indicates the connection: 1 is left connection, 2 is right connections
Ex: the extreme left point 0 gives out only x02 because it only has a right
connection, a generic element gives xn1, xn2, the extreme right point N
gives out only xN1 because it has only a left connection
routeOut takes the output and puts it as the last connection
routeIn needs to switch all the connections and give them to the proper elements | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c*k;
lambda = c*k/h;
string1dMidPoint(fIn, uSide_l, uSide_r) = u
letrec
{
'u = 2*u-u'+ lambda*lambda*(uSide_l-2*u+uSide_r) + fIn;
};
fixedPoint(uSide) = 0;
freePoint(uSide) = u
letrec
{
'u = 2*u-u'+ lambda*lambda*2*(uSide - u);
};
routeOut(
u02,
u11,u12,
u21,u22,
u31,u32,
u41,u42,
u51,u52,
u61,u62,uOut,
u71,u72,
u81) = u02,u11,u12,u21,u22,u31,u32,u41,u42,u51,u52,u61,u62,u71,u72,u81,uOut;
routeIn(u02,u11,u12,u21,u22,u31,u32,u41,u42,u51,u52,u61,u62,u71,u72,u81,fIn) =
u11,
u02,u21,
u12,u31,
u22,u41,
fIn,u32,u51,
u42,u61,
u52,u71,
u62,u81,
u72;
hit = button("hit"):ba.impulsify;
model =
(routeIn:
fixedPoint,
updatePoint(0),
updatePoint(0),
updatePoint(0),
updatePoint,
updatePoint(0),
updatePointOut(0),
updatePoint(0),
fixedPoint : routeOut)~par(i, 16, _): par(i, 16,!), par(i, 1, _);
process = hit:model<:_,_;
|
8b2bf4d5f9edf40dd410cb8a4ba652a343a5ec620a8656092c4dd6f393707ce6 | Rickr922/Faust-FDS | stringDamped.dsp | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 1000;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
stringDampMidPoint(fIn, uSide_l, uSide_r) = u //u_(l-1)=uSide_l, u_(l+1)=uSide_
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(uSide_l+uSide_r)/C1 + fIn;
};
//------------------------------------------Boundaries--------------------------------------
stringDampFreePoint(uSide) = u
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*uSide/C1;
};
fixedPoint(uSide) = 0;
hit = button("hit"):ba.impulsify;
model =
(route(37,37,
(1,2),
(2,1),(3,4),
(4,3),(5,6),
(6,5),(7,8),
(8,7),(9,10),
(10,9),(11,12),
(12,11),(13,14),
(14,13),(15,16),
(16,15),(17,19),//out 18 left free for the force in->everything else jumps one place
(18,17),(19,21),
(20,20),(21,23),
(22,22),(23,25),
(24,24),(25,27),
(26,26),(27,29),
(28,28),(29,31),
(30,30),(31,33),
(32,32),(33,35),
(34,34),(35,37),
(36,36),(37,18))://force in
stringDampFreePoint,
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint <:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
fixedPoint :
route(37,37, //routeOut
(1,1),
(2,2),
(3,3),
(4,4),
(5,5),
(6,6),
(7,7),
(8,8),
(9,9),
(10,10),
(11,11),
(12,12),
(13,13),
(14,14),
(15,15),
(16,16),
(17,17),
(18,18),
(19,19),
(20,20),
(21,21),
(22,22),
(23,23),
(24,24),
(25,25),
(26,26),
(27,27),
(28,37),//out signal->routed to last slot
(29,28),
(30,29),
(31,30),
(32,31),
(33,32),
(34,33),
(35,34),
(36,35),
(37,36))
)~par(i, 36, _): par(i, 36,!), par(i, 1, _);
process = hit:model<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/oldRoute/stringDamped/stringDamped.dsp | faust | u_(l-1)=uSide_l, u_(l+1)=uSide_
------------------------------------------Boundaries--------------------------------------
out 18 left free for the force in->everything else jumps one place
force in
routeOut
out signal->routed to last slot | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 1000;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
lambda = c*k/h;
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(uSide_l+uSide_r)/C1 + fIn;
};
stringDampFreePoint(uSide) = u
letrec
{
'u = u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*uSide/C1;
};
fixedPoint(uSide) = 0;
hit = button("hit"):ba.impulsify;
model =
(route(37,37,
(1,2),
(2,1),(3,4),
(4,3),(5,6),
(6,5),(7,8),
(8,7),(9,10),
(10,9),(11,12),
(12,11),(13,14),
(14,13),(15,16),
(18,17),(19,21),
(20,20),(21,23),
(22,22),(23,25),
(24,24),(25,27),
(26,26),(27,29),
(28,28),(29,31),
(30,30),(31,33),
(32,32),(33,35),
(34,34),(35,37),
stringDampFreePoint,
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint <:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
(stringDampMidPoint(0)<:_,_),
fixedPoint :
(1,1),
(2,2),
(3,3),
(4,4),
(5,5),
(6,6),
(7,7),
(8,8),
(9,9),
(10,10),
(11,11),
(12,12),
(13,13),
(14,14),
(15,15),
(16,16),
(17,17),
(18,18),
(19,19),
(20,20),
(21,21),
(22,22),
(23,23),
(24,24),
(25,25),
(26,26),
(27,27),
(29,28),
(30,29),
(31,30),
(32,31),
(33,32),
(34,33),
(35,34),
(36,35),
(37,36))
)~par(i, 36, _): par(i, 36,!), par(i, 1, _);
process = hit:model<:_,_;
|
09883a94bbd346541206de6c41ef514267b49ea104b5a4d505e46fe4447c52d4 | Rickr922/Faust-FDS | stiffString.dsp | import("stdfaust.lib");
nPoints = 10;
L = 0.1; // String length [m]
//nPoints=int(L/h);
k = 1/ma.SR;
//Stability condition
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
T = 150; // Tension [N]
//T = hslider("Tension",150,10,1000,0.1);
radius = 3.5560e-04; // Radius (0.016 gauge) [m]
rho = 8.05*10^3; // Density [kg/m^3];
Area = ma.PI*radius^2; // Area of string section
I = (ma.PI*radius^4)/ 4; // Moment of Inertia
Emod = 174e4; // Young modulus [Pa]
K = sqrt(Emod*I/rho/Area); // Stiffness parameter
c = sqrt(T/rho/Area); // Wave speed
sigma1 = 0.01; // Frequency dependent damping
sigma0 = 0.0005;
//----------------------------------Equations--------------------------------//
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
//----------------------------------Controls---------------------------------//
play = button("hit");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Library-------------------------------//
schemePoint1D(R,T) = routing:operations:>_
with
{
nNeighbors = (2*R+1);
routing =
route(nNeighbors*(T+1)+nNeighbors+1,2*nNeighbors*(T+1)+1,
(1,1),
par(t,T+1,
par(i,nNeighbors,i+t*nNeighbors+2,2*(i+t*nNeighbors)+3,
i+nNeighbors*(T+1)+2,2*(i+t*nNeighbors)+2)));
operations = _,par(t,T+1,
par(i,nNeighbors,(_@t),_:*));
};
buildScheme1D(points,R,T) =
par (x, points,schemePoint1D(R,T));
//----------------------------------Interpolation---------------------------------//
linInterp1D(points,point) = par(i,points,_*select2(
i==int(point), select2(i==int(point+1),0,fraction),(1-fraction)))
with
{
fraction = ma.frac(point);
};
//----------------------------------Force---------------------------------//
forceModel = play:ba.impulsify;
stairsForce(points,point) = ba.selectoutn(points,point);
linInterp1DOut(points,point) = linInterp1D(points,point):>_;
route1D(points, R, T) = route(points*2+points*nCoeffs, points*nInputs,
par(x, nPoints, connections(x)))
with
{
connections(x) = par(k,nCoeffs,x*nCoeffs+k+1,C(x,k+1)),
P(x) + points, C(x,0),
par(i, nNeighbors, P(x),C(x-R+i,nInputs-1-i));
P(x) = x+1 + nCoeffs*points;
C(x,count) = (1 + count + (x*nInputs)) * (x>=0) * (x<points);
nNeighbors = 2*R+1;
nCoeffs = nNeighbors*(T+1);
nInputs = nNeighbors+1+nCoeffs;
};
model1D(points,R,T,scheme) =
(route1D(points,R,T,scheme) : buildScheme1D(points,R,T)) ~ si.bus(points);
process = forceModel<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)):
linInterp1DOut(nPoints,outPoint)<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/caRoute/stiffString/stiffString.dsp | faust | String length [m]
nPoints=int(L/h);
Stability condition
Tension [N]
T = hslider("Tension",150,10,1000,0.1);
Radius (0.016 gauge) [m]
Density [kg/m^3];
Area of string section
Moment of Inertia
Young modulus [Pa]
Stiffness parameter
Wave speed
Frequency dependent damping
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Library-------------------------------//
----------------------------------Interpolation---------------------------------//
----------------------------------Force---------------------------------// | import("stdfaust.lib");
nPoints = 10;
k = 1/ma.SR;
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
sigma0 = 0.0005;
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r=2;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
play = button("hit");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
schemePoint1D(R,T) = routing:operations:>_
with
{
nNeighbors = (2*R+1);
routing =
route(nNeighbors*(T+1)+nNeighbors+1,2*nNeighbors*(T+1)+1,
(1,1),
par(t,T+1,
par(i,nNeighbors,i+t*nNeighbors+2,2*(i+t*nNeighbors)+3,
i+nNeighbors*(T+1)+2,2*(i+t*nNeighbors)+2)));
operations = _,par(t,T+1,
par(i,nNeighbors,(_@t),_:*));
};
buildScheme1D(points,R,T) =
par (x, points,schemePoint1D(R,T));
linInterp1D(points,point) = par(i,points,_*select2(
i==int(point), select2(i==int(point+1),0,fraction),(1-fraction)))
with
{
fraction = ma.frac(point);
};
forceModel = play:ba.impulsify;
stairsForce(points,point) = ba.selectoutn(points,point);
linInterp1DOut(points,point) = linInterp1D(points,point):>_;
route1D(points, R, T) = route(points*2+points*nCoeffs, points*nInputs,
par(x, nPoints, connections(x)))
with
{
connections(x) = par(k,nCoeffs,x*nCoeffs+k+1,C(x,k+1)),
P(x) + points, C(x,0),
par(i, nNeighbors, P(x),C(x-R+i,nInputs-1-i));
P(x) = x+1 + nCoeffs*points;
C(x,count) = (1 + count + (x*nInputs)) * (x>=0) * (x<points);
nNeighbors = 2*R+1;
nCoeffs = nNeighbors*(T+1);
nInputs = nNeighbors+1+nCoeffs;
};
model1D(points,R,T,scheme) =
(route1D(points,R,T,scheme) : buildScheme1D(points,R,T)) ~ si.bus(points);
process = forceModel<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)):
linInterp1DOut(nPoints,outPoint)<:_,_;
|
e06ebe1e0b446036d61124e08f3f10bd52ec389af39421d078da94f60d00d261 | Rickr922/Faust-FDS | 1dDampedWave.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
nPoints = 6;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 500;
lambda = c*k/h;
//----------------------------------Equations--------------------------------//
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
A = 2*(1-lambda*lambda)/C1;
B = lambda*lambda/C1;
C = C2/C1;
midCoeff = B,A,B;
midCoeffDel = 0,C,0;
r=1;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
/*
//west=left, east=right
schemeMidPoint(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(u_w+u_e)/C1 + fIn;
schemeFreePointWest(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*u_e/C1 + fIn;
schemeFreePointEast(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*u_w/C1 + fIn;*/
//----------------------------------Controls---------------------------------//
play = button("hit");
stop = button("Stop");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Library-------------------------------//
schemePoint1D(R,T) = routing:operations:>_
with
{
nNeighbors = (2*R+1);
routing =
route(nNeighbors*(T+1)+nNeighbors+1,2*nNeighbors*(T+1)+1,
(1,1),
par(t,T+1,
par(i,nNeighbors,i+t*nNeighbors+2,2*(i+t*nNeighbors)+3,
i+nNeighbors*(T+1)+2,2*(i+t*nNeighbors)+2)));
operations = _,par(t,T+1,
par(i,nNeighbors,(_@t),_:*));
};
buildScheme1D(points,R,T) =
par (x, points,schemePoint1D(R,T));
//----------------------------------Interpolation---------------------------------//
linInterp1D(points,point) = par(i,points,_*select2(
i==int(point), select2(i==int(point+1),0,fraction),(1-fraction)))
with
{
fraction = ma.frac(point);
};
//----------------------------------Force---------------------------------//
forceModel = play:ba.impulsify;
stairsForce(points,point) = ba.selectoutn(points,point);
linInterp1DOut(points,point) = linInterp1D(points,point):>_;
route1D(points, R, T) = route(points*2+points*nCoeffs, points*nInputs,
par(x, nPoints, connections(x)))
with
{
connections(x) = par(k,nCoeffs,x*nCoeffs+k+1,C(x,k+1)),
P(x) + points, C(x,0),
par(i, nNeighbors, P(x),C(x-R+i,nInputs-1-i));
P(x) = x+1 + nCoeffs*points;
C(x,count) = (1 + count + (x*nInputs)) * (x>=0) * (x<points);
nNeighbors = 2*R+1;
nCoeffs = nNeighbors*(T+1);
nInputs = nNeighbors+1+nCoeffs;
};
model1D(points,R,T,scheme) =
(route1D(points,R,T,scheme) : buildScheme1D(points,R,T)) ~ si.bus(points);
process = forceModel<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)):
linInterp1DOut(nPoints,outPoint)<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/caRoute/1dDampedWave/1dDampedWave.dsp | faust | --------------------------------Model Settings-----------------------------//
----------------------------------Equations--------------------------------//
//west=left, east=right
schemeMidPoint(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*(u_w+u_e)/C1 + fIn;
schemeFreePointWest(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*u_e/C1 + fIn;
schemeFreePointEast(fIn,u_w,u,u_e) =
u*2*(1-lambda*lambda)/C1+u'*C2/C1+ lambda*lambda*2*u_w/C1 + fIn;
----------------------------------Controls---------------------------------//
----------------------------------Library-------------------------------//
----------------------------------Interpolation---------------------------------//
----------------------------------Force---------------------------------// | import("stdfaust.lib");
nPoints = 6;
k = 1/ma.SR;
c = 344;
h = c*k;
s0 = 500;
lambda = c*k/h;
C1 = 1+(2*s0*k*k/h);
C2 = (2*s0*k*k/h)-1;
A = 2*(1-lambda*lambda)/C1;
B = lambda*lambda/C1;
C = C2/C1;
midCoeff = B,A,B;
midCoeffDel = 0,C,0;
r=1;
t=1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
play = button("hit");
stop = button("Stop");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
schemePoint1D(R,T) = routing:operations:>_
with
{
nNeighbors = (2*R+1);
routing =
route(nNeighbors*(T+1)+nNeighbors+1,2*nNeighbors*(T+1)+1,
(1,1),
par(t,T+1,
par(i,nNeighbors,i+t*nNeighbors+2,2*(i+t*nNeighbors)+3,
i+nNeighbors*(T+1)+2,2*(i+t*nNeighbors)+2)));
operations = _,par(t,T+1,
par(i,nNeighbors,(_@t),_:*));
};
buildScheme1D(points,R,T) =
par (x, points,schemePoint1D(R,T));
linInterp1D(points,point) = par(i,points,_*select2(
i==int(point), select2(i==int(point+1),0,fraction),(1-fraction)))
with
{
fraction = ma.frac(point);
};
forceModel = play:ba.impulsify;
stairsForce(points,point) = ba.selectoutn(points,point);
linInterp1DOut(points,point) = linInterp1D(points,point):>_;
route1D(points, R, T) = route(points*2+points*nCoeffs, points*nInputs,
par(x, nPoints, connections(x)))
with
{
connections(x) = par(k,nCoeffs,x*nCoeffs+k+1,C(x,k+1)),
P(x) + points, C(x,0),
par(i, nNeighbors, P(x),C(x-R+i,nInputs-1-i));
P(x) = x+1 + nCoeffs*points;
C(x,count) = (1 + count + (x*nInputs)) * (x>=0) * (x<points);
nNeighbors = 2*R+1;
nCoeffs = nNeighbors*(T+1);
nInputs = nNeighbors+1+nCoeffs;
};
model1D(points,R,T,scheme) =
(route1D(points,R,T,scheme) : buildScheme1D(points,R,T)) ~ si.bus(points);
process = forceModel<:linInterp1D(nPoints,inPoint):
model1D(nPoints,r,t,scheme(nPoints)):
linInterp1DOut(nPoints,outPoint)<:_,_;
|
9e972d7d9d9b8073418cc8abe5a958cd0d3d7277b63b5862c5c2542fcd140d5d | Rickr922/Faust-FDS | 2dWaveNewSchemePoint.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 10;
nPointsY = 10;
lambda = c*k/h;
A = lambda*lambda;
B = 2*(1-2*lambda*lambda);
C = -1;
midCoeff = 0,A,0,
A,B,A,
0,A,0;
midCoeffDelay1 = 0,0,0,
0,C,0,
0,0,0;
r=1;
t=1;
coefficients = midCoeff,midCoeffDelay1;
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, coefficients));
//----------------------------------Controls---------------------------------//
inPointX=hslider("input point x", floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("input point y", floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("output point x",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("output point y",floor(nPointsY/2),0,nPointsY-1,0.01);
hit = button("play");
stop = button("Stop");
//----------------------------------Library---------------------------------//
schemePoint2D(R,T) = routing:operations:>_
with
{
nNeighbors = (2*R+1)^2;
routing =
route(nNeighbors*(T+1)+nNeighbors+1,2*nNeighbors*(T+1)+1,
(1,1),
par(t,T+1,
par(i,nNeighbors,i+t*nNeighbors+2,2*(i+t*nNeighbors)+3,
i+nNeighbors*(T+1)+2,2*(i+t*nNeighbors)+2)));
operations = _,par(t,T+1,
par(i,nNeighbors,(_@t),_:*));
};
buildScheme2D(pointsX,pointsY,R,T) =
par (x, pointsX,
par(y,pointsY, schemePoint2D(R,T)));
//----------------------------------Interpolation---------------------------------//
linInterpolation2D(X,Y,pointX,pointY) =
par(i,X,
par(j,Y,_*
select2((i==intX) & (j==intY),
select2((i==(intX+1)) & (j==intY),
select2((i==intX) & (j==(intY+1)),
select2((i==(intX+1)) & (j==(intY+1)),
0,
fractionX*fractionY),
(1-fractionX)*fractionY),
fractionX*(1-fractionY)),
(1-fractionX)*(1-fractionY))))
with
{
fractionX = ma.frac(pointX);
fractionY = ma.frac(pointY);
intX = int(pointX);
intY = int(pointY);
};
//----------------------------------Force---------------------------------//
forceModel = hit:ba.impulsify;
stairsForce(X,Y,pointX,pointY) = ba.selectoutn(X*Y,pointY+pointX*Y);
//----------------------------------Output-------------------------------//
stairsOutput(X,Y,pointX,pointY) = ba.selectn(X*Y,pointY+pointX*Y);
linInterpolation2DOut(X,Y,pointX,pointY) = linInterpolation2D(X,Y,pointX,pointY):>_;
//----------------------------------Build Model-------------------------------//
route2D(X, Y, R, T) = route(nPoints*2+nPoints*nCoeffs, nPoints*nInputs,
par(x, X, par(y, Y, connections(x,y))))
with
{
connections(x,y) = P(x,y) + nPoints, C(x,y,0),
par(k,nCoeffs,(x*Y+y)*nCoeffs+k+1,C(x,y,k+1)),
par(j,nNeighborsXY,
par(i,nNeighborsXY,
P(x,y),C(x+i-R,y+j-R,nInputs-1-(i*nNeighborsXY+j))));
P(x,y) = x*Y+y+1 + nCoeffs*nPoints;
C(x,y,count) = (1 + count + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
nNeighborsXY = 2*R+1;
nNeighbors = nNeighborsXY^2;
nCoeffs = nNeighbors*(T+1);
nInputs = nNeighbors+1+nCoeffs;
nPoints = X*Y;
};
model2D(X,Y,r,t,scheme) =
(route2D(X,Y,r,t,scheme) : buildScheme2D(X,Y,r,t)) ~ si.bus(X*Y);
process =
forceModel<:linInterpolation2D(nPointsX,nPointsY,inPointX,inPointY):
model2D(nPointsX,nPointsY,r,t,scheme(nPointsX,nPointsY)):
linInterpolation2DOut(nPointsX,nPointsY,outPointX,outPointY);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/caRoute/2dWave/2dWaveNewSchemePoint.dsp | faust | --------------------------------Model Settings-----------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Library---------------------------------//
----------------------------------Interpolation---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Output-------------------------------//
----------------------------------Build Model-------------------------------// | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 10;
nPointsY = 10;
lambda = c*k/h;
A = lambda*lambda;
B = 2*(1-2*lambda*lambda);
C = -1;
midCoeff = 0,A,0,
A,B,A,
0,A,0;
midCoeffDelay1 = 0,0,0,
0,C,0,
0,0,0;
r=1;
t=1;
coefficients = midCoeff,midCoeffDelay1;
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, coefficients));
inPointX=hslider("input point x", floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("input point y", floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("output point x",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("output point y",floor(nPointsY/2),0,nPointsY-1,0.01);
hit = button("play");
stop = button("Stop");
schemePoint2D(R,T) = routing:operations:>_
with
{
nNeighbors = (2*R+1)^2;
routing =
route(nNeighbors*(T+1)+nNeighbors+1,2*nNeighbors*(T+1)+1,
(1,1),
par(t,T+1,
par(i,nNeighbors,i+t*nNeighbors+2,2*(i+t*nNeighbors)+3,
i+nNeighbors*(T+1)+2,2*(i+t*nNeighbors)+2)));
operations = _,par(t,T+1,
par(i,nNeighbors,(_@t),_:*));
};
buildScheme2D(pointsX,pointsY,R,T) =
par (x, pointsX,
par(y,pointsY, schemePoint2D(R,T)));
linInterpolation2D(X,Y,pointX,pointY) =
par(i,X,
par(j,Y,_*
select2((i==intX) & (j==intY),
select2((i==(intX+1)) & (j==intY),
select2((i==intX) & (j==(intY+1)),
select2((i==(intX+1)) & (j==(intY+1)),
0,
fractionX*fractionY),
(1-fractionX)*fractionY),
fractionX*(1-fractionY)),
(1-fractionX)*(1-fractionY))))
with
{
fractionX = ma.frac(pointX);
fractionY = ma.frac(pointY);
intX = int(pointX);
intY = int(pointY);
};
forceModel = hit:ba.impulsify;
stairsForce(X,Y,pointX,pointY) = ba.selectoutn(X*Y,pointY+pointX*Y);
stairsOutput(X,Y,pointX,pointY) = ba.selectn(X*Y,pointY+pointX*Y);
linInterpolation2DOut(X,Y,pointX,pointY) = linInterpolation2D(X,Y,pointX,pointY):>_;
route2D(X, Y, R, T) = route(nPoints*2+nPoints*nCoeffs, nPoints*nInputs,
par(x, X, par(y, Y, connections(x,y))))
with
{
connections(x,y) = P(x,y) + nPoints, C(x,y,0),
par(k,nCoeffs,(x*Y+y)*nCoeffs+k+1,C(x,y,k+1)),
par(j,nNeighborsXY,
par(i,nNeighborsXY,
P(x,y),C(x+i-R,y+j-R,nInputs-1-(i*nNeighborsXY+j))));
P(x,y) = x*Y+y+1 + nCoeffs*nPoints;
C(x,y,count) = (1 + count + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
nNeighborsXY = 2*R+1;
nNeighbors = nNeighborsXY^2;
nCoeffs = nNeighbors*(T+1);
nInputs = nNeighbors+1+nCoeffs;
nPoints = X*Y;
};
model2D(X,Y,r,t,scheme) =
(route2D(X,Y,r,t,scheme) : buildScheme2D(X,Y,r,t)) ~ si.bus(X*Y);
process =
forceModel<:linInterpolation2D(nPointsX,nPointsY,inPointX,inPointY):
model2D(nPointsX,nPointsY,r,t,scheme(nPointsX,nPointsY)):
linInterpolation2DOut(nPointsX,nPointsY,outPointX,outPointY);
|
37c92fe96094daa237ccd3fcb636d3d4ef4e768f25f8e770f5e3bf85b3196dd1 | Rickr922/Faust-FDS | stiffStringAutoRoute.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
nPoints = 100;
L = 0.1; // String length [m]
//nPoints=int(L/h);
k = 1/48000;//1/ma.SR;
//Stability condition
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
T = 150; // Tension [N]
//T = hslider("Tension",150,10,1000,0.1);
radius = 3.5560e-04; // Radius (0.016 gauge) [m]
rho = 8.05*10^3; // Density [kg/m^3];
Area = ma.PI*radius^2; // Area of string section
I = (ma.PI*radius^4)/ 4; // Moment of Inertia
Emod = 174e4; // Young modulus [Pa]
K = sqrt(Emod*I/rho/Area); // Stiffness parameter
c = sqrt(T/rho/Area); // Wave speed
sigma1 = 0.01; // Frequency dependent damping
sigma0 = 0.0005;
//----------------------------------Equations--------------------------------//
nInputs = inputs(schemeMidPoint);
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
//west=left, east=right
schemeMidPoint(u_ww,u_w,u,u_e,u_ee,fIn) =
A*u + B*u' + C*(u_e+u_w) + D*(u_e'+u_w') + E*(u_ee+u_ww) + fIn;
schemeFixedPoint(u_ww,u_w,u,u_e,u_ee,fIn) = 0;
//----------------------------------Controls---------------------------------//
hit = button("hit"):ba.impulsify;
stop = button("Stop");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force---------------------------------//
forceModel = hit;
linInterp1DForce(i,inPoint,force) = force*select2(
i==int(inPoint), select2(i==int(inPoint+1),0,fraction),(1-fraction))
with
{
fraction = ma.frac(inPoint);
};
linInterp1D(selectedPoint,nPoints) = par(i,nPoints,_*select2(
i==int(selectedPoint), select2(i==int(selectedPoint+1),0,fraction),(1-fraction)))
with
{
fraction = ma.frac(outPoint);
};
//----------------------------------Output-------------------------------//
linInterp1DOut(outPoint,nPoints) = linInterp1D(outPoint,nPoints):>_;
//----------------------------------Build Model-------------------------------//
buildScheme(nPoints) = par (i, nPoints, schemeMidPoint);
/*schemeFixedPoint,
par (i, nPoints-2, schemeMidPoint),
schemeFreePointEast;*/
routing(nPoints,nInputs) = route(nPoints+nPoints, nPoints*nInputs,
par(x, nPoints, connections(x)))
with
{
connections(x) = par(i, nInputs-1, U(x),I(x-spaceDepX+i,nInputs-2-i)),
U(x)+nPoints, I(x,nInputs-1);
U(x) = x+1;
I(x,j) = (1 + j + (x*nInputs)) * (x>=0) * (x<nPoints);
spaceDepX = (nInputs - 2)/2;
};
model(nPoints) = (routing(nPoints,nInputs) : buildScheme(nPoints)) ~
(par(i, nPoints, _*(stop==0)));
process = forceModel<:linInterp1D(inPoint,nPoints): model(nPoints):linInterp1DOut(outPoint,nPoints)<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/newRoute/stiffString/stiffStringAutoRoute.dsp | faust | --------------------------------Model Settings-----------------------------//
String length [m]
nPoints=int(L/h);
1/ma.SR;
Stability condition
Tension [N]
T = hslider("Tension",150,10,1000,0.1);
Radius (0.016 gauge) [m]
Density [kg/m^3];
Area of string section
Moment of Inertia
Young modulus [Pa]
Stiffness parameter
Wave speed
Frequency dependent damping
----------------------------------Equations--------------------------------//
west=left, east=right
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Output-------------------------------//
----------------------------------Build Model-------------------------------//
schemeFixedPoint,
par (i, nPoints-2, schemeMidPoint),
schemeFreePointEast; | import("stdfaust.lib");
nPoints = 100;
coeff = c^2*k^2 + 4*sigma1*k;
h =sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
sigma0 = 0.0005;
nInputs = inputs(schemeMidPoint);
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
schemeMidPoint(u_ww,u_w,u,u_e,u_ee,fIn) =
A*u + B*u' + C*(u_e+u_w) + D*(u_e'+u_w') + E*(u_ee+u_ww) + fIn;
schemeFixedPoint(u_ww,u_w,u,u_e,u_ee,fIn) = 0;
hit = button("hit"):ba.impulsify;
stop = button("Stop");
inPoint=hslider("input point", floor(nPoints/2),0,nPoints-1,0.01);
outPoint=hslider("output point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
forceModel = hit;
linInterp1DForce(i,inPoint,force) = force*select2(
i==int(inPoint), select2(i==int(inPoint+1),0,fraction),(1-fraction))
with
{
fraction = ma.frac(inPoint);
};
linInterp1D(selectedPoint,nPoints) = par(i,nPoints,_*select2(
i==int(selectedPoint), select2(i==int(selectedPoint+1),0,fraction),(1-fraction)))
with
{
fraction = ma.frac(outPoint);
};
linInterp1DOut(outPoint,nPoints) = linInterp1D(outPoint,nPoints):>_;
buildScheme(nPoints) = par (i, nPoints, schemeMidPoint);
routing(nPoints,nInputs) = route(nPoints+nPoints, nPoints*nInputs,
par(x, nPoints, connections(x)))
with
{
connections(x) = par(i, nInputs-1, U(x),I(x-spaceDepX+i,nInputs-2-i)),
U(x)+nPoints, I(x,nInputs-1);
U(x) = x+1;
I(x,j) = (1 + j + (x*nInputs)) * (x>=0) * (x<nPoints);
spaceDepX = (nInputs - 2)/2;
};
model(nPoints) = (routing(nPoints,nInputs) : buildScheme(nPoints)) ~
(par(i, nPoints, _*(stop==0)));
process = forceModel<:linInterp1D(inPoint,nPoints): model(nPoints):linInterp1DOut(outPoint,nPoints)<:_,_;
|
cf388787e209e2d545509d8a7f253a9f59b9896ee81df62e2a35b27fbbd756e1 | Rickr922/Faust-FDS | 2dWaveNewRoute.dsp | import("stdfaust.lib");
//--------------------------------Model Settings-----------------------------//
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 10;
nPointsY = 10;
lambda = c*k/h;
A = lambda*lambda;
B = 2*(1-2*lambda*lambda);
C = -1;
midCoeff = 0,A,0,
A,B,A,
0,A,0;
midCoeffDelay1 = 0,0,0,
0,C,0,
0,0,0;
r=1;
t=1;
coefficients = midCoeff,midCoeffDelay1;
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, coefficients));
//----------------------------------Controls---------------------------------//
inPointX=hslider("input point x", floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("input point y", floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("output point x",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("output point y",floor(nPointsY/2),0,nPointsY-1,0.01);
hit = button("play");
stop = button("Stop");
//----------------------------------Library---------------------------------//
schemePoint2D(R,T,fIn) = coeffs,neighbors<:
sum(t,T+1,
sum(i,nNeighbors,
ba.selector(int(i+t*nNeighbors),nNeighbors*(T+1),coeffs)*
ba.selector(i,nNeighbors,neighbors)@(t)))
+ fIn
with
{
nNeighbors = (2*R+1)^2;
neighbors = si.bus(nNeighbors);
coeffs=si.bus(nNeighbors*(T+1));
};
buildScheme2D(R,T,pointsX,pointsY) =
par (x, pointsX,
par(y,pointsY, schemePoint2D(R,T)));
//----------------------------------Interpolation---------------------------------//
linInterpolation2D(X,Y,pointX,pointY) =
par(i,X,
par(j,Y,_*
select2((i==intX) & (j==intY),
select2((i==(intX+1)) & (j==intY),
select2((i==intX) & (j==(intY+1)),
select2((i==(intX+1)) & (j==(intY+1)),
0,
fractionX*fractionY),
(1-fractionX)*fractionY),
fractionX*(1-fractionY)),
(1-fractionX)*(1-fractionY))))
with
{
fractionX = ma.frac(pointX);
fractionY = ma.frac(pointY);
intX = int(pointX);
intY = int(pointY);
};
//----------------------------------Force---------------------------------//
forceModel = hit:ba.impulsify;
stairsForce(X,Y,pointX,pointY) = ba.selectoutn(X*Y,pointY+pointX*Y);
//----------------------------------Output-------------------------------//
stairsOutput(X,Y,pointX,pointY) = ba.selectn(X*Y,pointY+pointX*Y);
linInterpolation2DOut(X,Y,pointX,pointY) = linInterpolation2D(X,Y,pointX,pointY):>_;
//----------------------------------Build Model-------------------------------//
//nInputs = inputs(schemeMidPoint);
route2D(X, Y, R, T) = route(nPoints*2+nPoints*nCoeffs, nPoints*nInputs,
par(x, X, par(y, Y, connections(x,y))))
with
{
connections(x,y) = par(k,nCoeffs,(x*Y+y)*nCoeffs+k+1,C(x,y,k+1)),
P(x,y) + nPoints, C(x,y,0),
par(j,nNeighborsXY,
par(i,nNeighborsXY,
P(x,y),C(x+i-R,y+j-R,nInputs-1-(i*nNeighborsXY+j))));
P(x,y) = x*Y+y+1 + nCoeffs*nPoints;
C(x,y,count) = (1 + count + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
nNeighborsXY = 2*R+1;
nNeighbors = nNeighborsXY^2;
nCoeffs = nNeighbors*(T+1);
nInputs = nNeighbors+1+nCoeffs;
nPoints = X*Y;
};
model(X,Y,r,t,scheme) =
(route2D(X,Y,r,t,scheme) : buildScheme2D(r,t,X,Y)) ~ par(i,X*Y,_*(stop==0));
process =
forceModel<:linInterpolation2D(nPointsX,nPointsY,inPointX,inPointY):
model(nPointsX,nPointsY,r,t,scheme(nPointsX,nPointsY)):
linInterpolation2DOut(nPointsX,nPointsY,outPointX,outPointY);
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/caRoute/2dWave/2dWaveNewRoute.dsp | faust | --------------------------------Model Settings-----------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Library---------------------------------//
----------------------------------Interpolation---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Output-------------------------------//
----------------------------------Build Model-------------------------------//
nInputs = inputs(schemeMidPoint); | import("stdfaust.lib");
k = 1/ma.SR;
c = 344;
h = c * k*sqrt(2);
nPointsX = 10;
nPointsY = 10;
lambda = c*k/h;
A = lambda*lambda;
B = 2*(1-2*lambda*lambda);
C = -1;
midCoeff = 0,A,0,
A,B,A,
0,A,0;
midCoeffDelay1 = 0,0,0,
0,C,0,
0,0,0;
r=1;
t=1;
coefficients = midCoeff,midCoeffDelay1;
scheme(pointsX,pointsY) = par (i, pointsX,
par(j,pointsY, coefficients));
inPointX=hslider("input point x", floor(nPointsX/2),0,nPointsX-1,0.01);
inPointY=hslider("input point y", floor(nPointsY/2),0,nPointsY-1,0.01);
outPointX=hslider("output point x",floor(nPointsX/2),0,nPointsX-1,0.01);
outPointY=hslider("output point y",floor(nPointsY/2),0,nPointsY-1,0.01);
hit = button("play");
stop = button("Stop");
schemePoint2D(R,T,fIn) = coeffs,neighbors<:
sum(t,T+1,
sum(i,nNeighbors,
ba.selector(int(i+t*nNeighbors),nNeighbors*(T+1),coeffs)*
ba.selector(i,nNeighbors,neighbors)@(t)))
+ fIn
with
{
nNeighbors = (2*R+1)^2;
neighbors = si.bus(nNeighbors);
coeffs=si.bus(nNeighbors*(T+1));
};
buildScheme2D(R,T,pointsX,pointsY) =
par (x, pointsX,
par(y,pointsY, schemePoint2D(R,T)));
linInterpolation2D(X,Y,pointX,pointY) =
par(i,X,
par(j,Y,_*
select2((i==intX) & (j==intY),
select2((i==(intX+1)) & (j==intY),
select2((i==intX) & (j==(intY+1)),
select2((i==(intX+1)) & (j==(intY+1)),
0,
fractionX*fractionY),
(1-fractionX)*fractionY),
fractionX*(1-fractionY)),
(1-fractionX)*(1-fractionY))))
with
{
fractionX = ma.frac(pointX);
fractionY = ma.frac(pointY);
intX = int(pointX);
intY = int(pointY);
};
forceModel = hit:ba.impulsify;
stairsForce(X,Y,pointX,pointY) = ba.selectoutn(X*Y,pointY+pointX*Y);
stairsOutput(X,Y,pointX,pointY) = ba.selectn(X*Y,pointY+pointX*Y);
linInterpolation2DOut(X,Y,pointX,pointY) = linInterpolation2D(X,Y,pointX,pointY):>_;
route2D(X, Y, R, T) = route(nPoints*2+nPoints*nCoeffs, nPoints*nInputs,
par(x, X, par(y, Y, connections(x,y))))
with
{
connections(x,y) = par(k,nCoeffs,(x*Y+y)*nCoeffs+k+1,C(x,y,k+1)),
P(x,y) + nPoints, C(x,y,0),
par(j,nNeighborsXY,
par(i,nNeighborsXY,
P(x,y),C(x+i-R,y+j-R,nInputs-1-(i*nNeighborsXY+j))));
P(x,y) = x*Y+y+1 + nCoeffs*nPoints;
C(x,y,count) = (1 + count + (x*Y+y)*nInputs) * (x>=0) * (x<X) * (y>=0) * (y<Y);
nNeighborsXY = 2*R+1;
nNeighbors = nNeighborsXY^2;
nCoeffs = nNeighbors*(T+1);
nInputs = nNeighbors+1+nCoeffs;
nPoints = X*Y;
};
model(X,Y,r,t,scheme) =
(route2D(X,Y,r,t,scheme) : buildScheme2D(r,t,X,Y)) ~ par(i,X*Y,_*(stop==0));
process =
forceModel<:linInterpolation2D(nPointsX,nPointsY,inPointX,inPointY):
model(nPointsX,nPointsY,r,t,scheme(nPointsX,nPointsY)):
linInterpolation2DOut(nPointsX,nPointsY,outPointX,outPointY);
|
9b12169157f15ec0dce62e64856078551192713c4f7fe318cbbdbb0c86e89cef | Rickr922/Faust-FDS | ControllableNonPhysicalString.dsp | import("stdfaust.lib");
/*DISCLAMER:
This is a creative "non physical" finite difference scheme physical model
of a string, intended to show how changing the different physical
parameters has an impact on the sounding characteristics of the string.
I have to say that to make things physically correct, the number of
string points should change according to the variations of each
parameter. However, this cannot be done at run time, so physically
correct models can become a bit boring. You can use this model to
get an idea on how the parameters work, and then try with values even
outside these sliders range, to explore new sounds.
Beware that, being non physical, some parameters configurations could
blow up the model. In case that happens, simply re-run the program
to reset the dsp.
Have fun!
*/
//----------------------------------String Settings---------------------------//
//nPoints=int(Length/h);
nPoints = 100;
k = 1/ma.SR;
//Stability condition
coeff = c^2*k^2 + 4*sigma1*k;
h = sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
T = hslider("[4]String Tension (N)", 150,20,1000,0.1); // Tension [N]
radius = hslider("[5]String Radius (m)", 3.6e-04,2e-5,1e-3,0.00001); // Radius (0.016 gauge) [m]
rho = hslider("[6]String Material Density (kg/m^3)", 8.05*10^3,1e1,1e6,1); // Density [kg/m^3];
Emod = hslider("[7]String Young Modulus (Pa)",174e4,1e-3,1e8,1); // Young modulus [Pa]
Area = ma.PI*radius^2; // Area of string section
I = (ma.PI*radius^4)/ 4; // Moment of Inertia
K = sqrt(Emod*I/rho/Area); // Stiffness parameter
c = sqrt(T/rho/Area); // Wave speed
sigma1 = hslider("[9]Frequency Dependent Damping", 0.01,1e-5,1,0.0001); // Frequency dependent damping
sigma0 = hslider("[8]Damping", 0.0005,1e-6,100,0.0001); // Frequency independent damping
//----------------------------------Equations--------------------------------//
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r = 2;
t = 1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
//----------------------------------Controls---------------------------------//
play = button("[3]Play");
inPoint = hslider("[1]Input Point",floor(nPoints/2),0,nPoints-1,0.01);
outPoint = hslider("[2]Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
//----------------------------------Force---------------------------------//
forceModel = play:ba.impulsify;
//----------------------------------Process---------------------------------//
process = forceModel<:fd.linInterp1D(nPoints,inPoint):
fd.model1D(nPoints,r,t,scheme(nPoints)):
fd.linInterp1DOut(nPoints,outPoint)<:_,_;
| https://raw.githubusercontent.com/Rickr922/Faust-FDS/ada5dcf25eceaac3c2b5d13de55f2a37c9e7a34e/library/ControllableNonPhysicalString.dsp | faust | DISCLAMER:
This is a creative "non physical" finite difference scheme physical model
of a string, intended to show how changing the different physical
parameters has an impact on the sounding characteristics of the string.
I have to say that to make things physically correct, the number of
string points should change according to the variations of each
parameter. However, this cannot be done at run time, so physically
correct models can become a bit boring. You can use this model to
get an idea on how the parameters work, and then try with values even
outside these sliders range, to explore new sounds.
Beware that, being non physical, some parameters configurations could
blow up the model. In case that happens, simply re-run the program
to reset the dsp.
Have fun!
----------------------------------String Settings---------------------------//
nPoints=int(Length/h);
Stability condition
Tension [N]
Radius (0.016 gauge) [m]
Density [kg/m^3];
Young modulus [Pa]
Area of string section
Moment of Inertia
Stiffness parameter
Wave speed
Frequency dependent damping
Frequency independent damping
----------------------------------Equations--------------------------------//
----------------------------------Controls---------------------------------//
----------------------------------Force---------------------------------//
----------------------------------Process---------------------------------// | import("stdfaust.lib");
nPoints = 100;
k = 1/ma.SR;
coeff = c^2*k^2 + 4*sigma1*k;
h = sqrt((coeff + sqrt((coeff)^2 + 16*k^2*K^2))/2);
den = 1+sigma0*k;
A = (2*h^4-2*c^2*k^2*h^2-4*sigma1*k*h^2+6*K^2*k^2)/den/h^4;
B = (sigma0*k*h^2-h^2+4*sigma1*k)/den/h^2;
C = (c^2*k^2*h^2+2*sigma1*k*h^2-4*K^2*k^2)/den/h^4;
D = -2*sigma1*k/den/h^2;
E = K^2*k^2/den/h^4;
midCoeff = E,C,A,C,E;
midCoeffDel = 0,D,B,D,0;
r = 2;
t = 1;
scheme(points) = par(i,points,midCoeff,midCoeffDel);
play = button("[3]Play");
inPoint = hslider("[1]Input Point",floor(nPoints/2),0,nPoints-1,0.01);
outPoint = hslider("[2]Output Point",floor(nPoints/2),0,nPoints-1,0.01):si.smoo;
forceModel = play:ba.impulsify;
process = forceModel<:fd.linInterp1D(nPoints,inPoint):
fd.model1D(nPoints,r,t,scheme(nPoints)):
fd.linInterp1DOut(nPoints,outPoint)<:_,_;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.