_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
755ee317f9b8ce4583c5d47d70ab86508803d4f2fa523eb79018ece0f828e822
s-e-a-m/faust-libraries
msheadphones.dsp
declare name "MID SIDE HEADPHONES"; declare version "001"; declare author "Giuseppe Silvi"; declare license "GNU-GPL-v3"; declare copyright "(c)SEAM 2019"; declare description "MID SIDE PANNER"; import("stdfaust.lib"); //import("../seam.lib"); deg2rad = *(ma.PI/180); mspan(x) = m, s with{ pot = vslider("[01] Azimuth [style:knob]", 0, -180, 180, 0.1) : deg2rad : si.smoo; m = (0.5 * x) + (0.5 * (x * cos(pot))); s = x *(sin(-pot)); }; process = os.osc(250)*0.0123 : mspan;
https://raw.githubusercontent.com/s-e-a-m/faust-libraries/9120cccb9335f42407062eb4bf149188d8018b07/examples/msheadphones.dsp
faust
import("../seam.lib");
declare name "MID SIDE HEADPHONES"; declare version "001"; declare author "Giuseppe Silvi"; declare license "GNU-GPL-v3"; declare copyright "(c)SEAM 2019"; declare description "MID SIDE PANNER"; import("stdfaust.lib"); deg2rad = *(ma.PI/180); mspan(x) = m, s with{ pot = vslider("[01] Azimuth [style:knob]", 0, -180, 180, 0.1) : deg2rad : si.smoo; m = (0.5 * x) + (0.5 * (x * cos(pot))); s = x *(sin(-pot)); }; process = os.osc(250)*0.0123 : mspan;
7fecd94a725658d736d5cef84d5745fcee6bd8d00b292990e0fdd68bf5db66d0
s-e-a-m/faust-libraries
abmodule.dsp
declare name "MICHAEL GERZON AB-MODULE"; declare version "001"; declare author "Giuseppe Silvi"; declare license "GNU-GPL-v3"; declare copyright "(c)SEAM 2019"; declare description "MICHAEL GERZON AB-MODULE"; import("stdfaust.lib"); //import("../../seam.lib"); abmodule(LFU,RFD,RBU,LBD) = W,X,Y,Z with{ W = (0.5 * (LFU + RFD + RBU + LBD)); X = (0.5 * (LFU + RFD - RBU - LBD)); Y = (0.5 * (LFU - RFD - RBU + LBD)); Z = (0.5 * (LFU - RFD + RBU - LBD)); }; process = abmodule;
https://raw.githubusercontent.com/s-e-a-m/faust-libraries/9120cccb9335f42407062eb4bf149188d8018b07/examples/vst/abmodule.dsp
faust
import("../../seam.lib");
declare name "MICHAEL GERZON AB-MODULE"; declare version "001"; declare author "Giuseppe Silvi"; declare license "GNU-GPL-v3"; declare copyright "(c)SEAM 2019"; declare description "MICHAEL GERZON AB-MODULE"; import("stdfaust.lib"); abmodule(LFU,RFD,RBU,LBD) = W,X,Y,Z with{ W = (0.5 * (LFU + RFD + RBU + LBD)); X = (0.5 * (LFU + RFD - RBU - LBD)); Y = (0.5 * (LFU - RFD - RBU + LBD)); Z = (0.5 * (LFU - RFD + RBU - LBD)); }; process = abmodule;
a4f208cff65c9bc6f2cac1b912eac2865a491c6b3281f63412d3d8ecbc0af791
friskgit/snares
disperse.dsp
// -*- compile-command: "cd .. && make jack src=src/disperse.dsp && cd -"; -*-&& cd -"; -*- declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); //---------------`Disperse audio randomly over x channels` -------------------------- // // Each hit is output to a channel <= channels as controlled by the lfo // in rndctrl. Due to the ma.fabs, there is a greater chance that signal // is sent to lower outputs than higher // // // 18 Juli 2019 Henrik Frisk [email protected] //--------------------------------------------------- // GUI posgroup(x) = vgroup("[0]position", x); // Set the number of channels at compile time. channels = 14; integ(x) = x - ma.frac(x); //imp = ba.pulse(hslider("tempo", 5000, 500, 10000, 1)); // Control the output channel focus = posgroup(hslider("[1]disperse", 1, 0, 1, 0.0001)); position = posgroup(hslider("[0]position", 1, 0, channels, 1)); rate = ma.SR/1000.0; rndctrl = (no.lfnoise(rate) * (channels + 1)) * focus : ma.fabs + position : int ; outputctrl(imp) = rndctrl : ba.sAndH(imp); // Wrap channels around the array. ch_wrapped(imp) = ma.modulo(outputctrl(imp), channels); // Main gate process(imp, sig) = sig : ba.selectoutn(channels, ch_wrapped(imp)) ;
https://raw.githubusercontent.com/friskgit/snares/bb43ea5e706a0ead6d65dd176a5c492b2f5d8f74/faust/snare/src/disperse.dsp
faust
-*- compile-command: "cd .. && make jack src=src/disperse.dsp && cd -"; -*-&& cd -"; -*- ---------------`Disperse audio randomly over x channels` -------------------------- Each hit is output to a channel <= channels as controlled by the lfo in rndctrl. Due to the ma.fabs, there is a greater chance that signal is sent to lower outputs than higher 18 Juli 2019 Henrik Frisk [email protected] --------------------------------------------------- GUI Set the number of channels at compile time. imp = ba.pulse(hslider("tempo", 5000, 500, 10000, 1)); Control the output channel Wrap channels around the array. Main gate
declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); posgroup(x) = vgroup("[0]position", x); channels = 14; integ(x) = x - ma.frac(x); focus = posgroup(hslider("[1]disperse", 1, 0, 1, 0.0001)); position = posgroup(hslider("[0]position", 1, 0, channels, 1)); rate = ma.SR/1000.0; rndctrl = (no.lfnoise(rate) * (channels + 1)) * focus : ma.fabs + position : int ; outputctrl(imp) = rndctrl : ba.sAndH(imp); ch_wrapped(imp) = ma.modulo(outputctrl(imp), channels); process(imp, sig) = sig : ba.selectoutn(channels, ch_wrapped(imp)) ;
915ac99d2b4762f217fd43b6681b68154c3145c3353215107b5c4c2500611616
jameslnrd/mi_introduction_workshop_2020
harmonicOscillator2.dsp
declare name "Harmonic Oscillator v2"; declare author "James Leonard"; declare date "April 2020"; /* ========= DESCRITPION ============= The simplest mass-interaction construct: a harmonic oscillator, built by assembling three elements: a mass, a fixed point and a spring-damper interaction. The resulting model is identical to an mi.osc element (which integrates them together). - inputs: force impulse - outputs: oscillator' position. - controls: none. */ import("stdfaust.lib"); in1 = button("Frc Input 1"): ba.impulsify * 0.25; //write a specific force input signal operation here OutGain = 1; model = ( mi.mass(1., 0, 0., 0.), mi.ground(0.), par(i, nbFrcIn,_): RoutingMassToLink , par(i, nbFrcIn,_): mi.springDamper(0.1, 0.0003, 0., 0.), par(i, nbOut+nbFrcIn, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ RoutingMassToLink(m0, m1) = /* routed positions */ m1, m0, /* outputs */ m0; RoutingLinkToMass(l0_f1, l0_f2, p_out1, f_in1) = /* routed forces */ f_in1 + l0_f2, l0_f1, /* pass-through */ p_out1; nbMass = 2; nbFrcIn = 1; nbOut = 1; }; process = in1 : model:*(OutGain); /* ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard # Assembled harmonic oscillator with M = 1, K = 0.1, Z = 0.0003 @m mass 1. 0. 0. @g ground 0. @sp springDamper @g @m 0.1 0.0003 # Add force input to the model @in1 frcInput @m # Add position output from the oscillator @out1 posOutput @m # end of MIMS script */
https://raw.githubusercontent.com/jameslnrd/mi_introduction_workshop_2020/2f487dbc5b8e7cd83cbd962254e737bdb82948f6/00_BasicOscillator/harmonicOscillator2.dsp
faust
========= DESCRITPION ============= The simplest mass-interaction construct: a harmonic oscillator, built by assembling three elements: a mass, a fixed point and a spring-damper interaction. The resulting model is identical to an mi.osc element (which integrates them together). - inputs: force impulse - outputs: oscillator' position. - controls: none. write a specific force input signal operation here routed positions outputs routed forces pass-through ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard # Assembled harmonic oscillator with M = 1, K = 0.1, Z = 0.0003 @m mass 1. 0. 0. @g ground 0. @sp springDamper @g @m 0.1 0.0003 # Add force input to the model @in1 frcInput @m # Add position output from the oscillator @out1 posOutput @m # end of MIMS script
declare name "Harmonic Oscillator v2"; declare author "James Leonard"; declare date "April 2020"; import("stdfaust.lib"); OutGain = 1; model = ( mi.mass(1., 0, 0., 0.), mi.ground(0.), par(i, nbFrcIn,_): RoutingMassToLink , par(i, nbFrcIn,_): mi.springDamper(0.1, 0.0003, 0., 0.), par(i, nbOut+nbFrcIn, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ nbMass = 2; nbFrcIn = 1; nbOut = 1; }; process = in1 : model:*(OutGain);
ee8d4e53149a7fc63a4fee5b0a9ca1b299f34b35c7a9090717e9db7add4701be
jameslnrd/mi_introduction_workshop_2020
bowedOsc.dsp
declare name "Bowed Oscillator"; declare author "James Leonard"; declare date "April 2020"; /* ========= DESCRITPION ============= Friction-based interaction with a simple oscillator => cool squeaky sounds. - inputs: position control of the "bowing" mass - outputs: oscillator position. - controls: none. Note: the "type" parameter changes the way the friction interaction is calculated (set to 0 for piecewise linear function or 1 for friction à-la-Bilbao). */ import("stdfaust.lib"); in1 = hslider("Bow Position", 0, 0, 100, 0.001):si.smoo:si.smoo:si.smoo; //Need very smooth position data here ! OutGain = 20; type = 0; model = ( mi.oscil(1., 0.1, 0.0003, 0, 0., 0.), mi.posInput(1.): RoutingMassToLink : mi.nlBow(1.2, 0.001, type, 0., 1.), par(i, nbOut, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ RoutingMassToLink(m0, m1) = /* routed positions */ m0, m1, /* outputs */ m0; RoutingLinkToMass(l0_f1, l0_f2, p_out1) = /* routed forces */ l0_f1, l0_f2, /* pass-through */ p_out1; nbMass = 2; nbOut = 1; }; process = in1 : model:*(OutGain); /* ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard # parameter to switch how the # bowing interaction is calculated @type param 0 # Integrated harmonic oscillator @o osc 1. 0.1 0.0003 0. 0. # Position input, controlled by audio signal @in1 posInput 1. @b nlBow @o @in1 1.2 0.001 type # Add position output from the oscillator @out1 posOutput @o # end of MIMS script */
https://raw.githubusercontent.com/jameslnrd/mi_introduction_workshop_2020/2f487dbc5b8e7cd83cbd962254e737bdb82948f6/06_BowedOscillator/bowedOsc.dsp
faust
========= DESCRITPION ============= Friction-based interaction with a simple oscillator => cool squeaky sounds. - inputs: position control of the "bowing" mass - outputs: oscillator position. - controls: none. Note: the "type" parameter changes the way the friction interaction is calculated (set to 0 for piecewise linear function or 1 for friction à-la-Bilbao). Need very smooth position data here ! routed positions outputs routed forces pass-through ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard # parameter to switch how the # bowing interaction is calculated @type param 0 # Integrated harmonic oscillator @o osc 1. 0.1 0.0003 0. 0. # Position input, controlled by audio signal @in1 posInput 1. @b nlBow @o @in1 1.2 0.001 type # Add position output from the oscillator @out1 posOutput @o # end of MIMS script
declare name "Bowed Oscillator"; declare author "James Leonard"; declare date "April 2020"; import("stdfaust.lib"); OutGain = 20; type = 0; model = ( mi.oscil(1., 0.1, 0.0003, 0, 0., 0.), mi.posInput(1.): RoutingMassToLink : mi.nlBow(1.2, 0.001, type, 0., 1.), par(i, nbOut, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ nbMass = 2; nbOut = 1; }; process = in1 : model:*(OutGain);
d0bd42c06f782ab376b5de0509cbbac2e2ec7f71a4a6eaf8fcc2e77560f3b230
grame-cncm/smartfaust
sfTrashShift.dsp
declare name "sfTrashShift"; declare version "1.1"; declare author "Christophe Lebreton"; declare license "BSD"; declare copyright "SmartFaust - GRAME(c)2013-2018"; import("stdfaust.lib"); //-------------------- MAIN ------------------------------- process = pitchshifter_drywet; //-------------------------------------------------------------------------------------------------- // from FAUST example and adapted by Christophe Lebreton // very simple real time pitch shifter transpose (w, x, s, sig) = de.fdelay1s(d,sig)* ma.fmin(d/x,1) + de.fdelay1s(d+w,sig)*(1- ma.fmin(d/x,1)) with { i = 1 - pow(2, s/12); d = i : (+ : +(w) : fmod(_,w)) ~ _; }; pitchshifter = transpose(w,x,s) with { //w = hslider("window [units (ms)]", 75, 10, 1000, 1)*SR*0.001; w = (75)* ma.SR*(0.001); //x = hslider("xfade [units (ms)]", 10, 1, 500, 1)*SR*0.001 : smooth (0.99); x = w * 0.5; s = (hslider("v:sfTrashShift parameter(s)/shift [units (cents)] [acc:0 1 -10 0 10][color: 255 0 0 ][hidden:1]", 0, -3600, 3600, 0.1))*0.01 : si.smooth (0.998); }; dry_wet(x,y) = (1-c)*x + c*y with { c = hslider("v:sfTrashShift parameter(s)/dry_wet [acc:1 1 -10 0 10][color: 255 255 0 ][hidden:1] ",100,0,100,0.01):*(0.01):fi.lowpass(1,1):max(0):min(1); }; pitchshifter_drywet = _<: _ , pitchshifter: dry_wet:*(volume):*(gain):*(out) with { volume = vslider ("h:sfTrashShift/Volume",1,0,2,0.001): si.smooth(0.998):max(0):min(2); gain = hslider ("v:sfTrashShift parameter(s)/gain[acc:2 1 -10 0 10][color:255 255 0][hidden:1]",0.2,0,1,0.001): fi.lowpass(1,1):max(0):min(1); out = checkbox ("h:sfTrashShift/ON/OFF"): si.smooth(0.998); };
https://raw.githubusercontent.com/grame-cncm/smartfaust/0a9c93ea7eda9899e1401402901848f221366c99/src/sfTrashShift/sfTrashShift.dsp
faust
-------------------- MAIN ------------------------------- -------------------------------------------------------------------------------------------------- from FAUST example and adapted by Christophe Lebreton very simple real time pitch shifter w = hslider("window [units (ms)]", 75, 10, 1000, 1)*SR*0.001; x = hslider("xfade [units (ms)]", 10, 1, 500, 1)*SR*0.001 : smooth (0.99);
declare name "sfTrashShift"; declare version "1.1"; declare author "Christophe Lebreton"; declare license "BSD"; declare copyright "SmartFaust - GRAME(c)2013-2018"; import("stdfaust.lib"); process = pitchshifter_drywet; transpose (w, x, s, sig) = de.fdelay1s(d,sig)* ma.fmin(d/x,1) + de.fdelay1s(d+w,sig)*(1- ma.fmin(d/x,1)) with { i = 1 - pow(2, s/12); d = i : (+ : +(w) : fmod(_,w)) ~ _; }; pitchshifter = transpose(w,x,s) with { w = (75)* ma.SR*(0.001); x = w * 0.5; s = (hslider("v:sfTrashShift parameter(s)/shift [units (cents)] [acc:0 1 -10 0 10][color: 255 0 0 ][hidden:1]", 0, -3600, 3600, 0.1))*0.01 : si.smooth (0.998); }; dry_wet(x,y) = (1-c)*x + c*y with { c = hslider("v:sfTrashShift parameter(s)/dry_wet [acc:1 1 -10 0 10][color: 255 255 0 ][hidden:1] ",100,0,100,0.01):*(0.01):fi.lowpass(1,1):max(0):min(1); }; pitchshifter_drywet = _<: _ , pitchshifter: dry_wet:*(volume):*(gain):*(out) with { volume = vslider ("h:sfTrashShift/Volume",1,0,2,0.001): si.smooth(0.998):max(0):min(2); gain = hslider ("v:sfTrashShift parameter(s)/gain[acc:2 1 -10 0 10][color:255 255 0][hidden:1]",0.2,0,1,0.001): fi.lowpass(1,1):max(0):min(1); out = checkbox ("h:sfTrashShift/ON/OFF"): si.smooth(0.998); };
869adf6f42d10499485b3d2a9bc91193f048f771aaa4a5b8d71e68efa87007f6
s-e-a-m/faust-libraries
cardiosc_plot.dsp
declare name "MID SIDE PANNER - LEFT RIGHT LOUDSPEAKER"; declare version "001"; declare author "Giuseppe Silvi"; declare license "GNU-GPL-v3"; declare copyright "(c)SEAM 2019"; declare description "MID SIDE PANNER - LEFT RIGHT LOUDSPEAKER"; import("stdfaust.lib"); import("../../seam.lib"); pisweep = (os.lf_trianglepos(1)*360)-180; rad = 45 : deg2rad; //process = os.osc(50), 0 : mspan; process = os.osc(50) <: *(sin(rad)), *(cos(rad));
https://raw.githubusercontent.com/s-e-a-m/faust-libraries/9120cccb9335f42407062eb4bf149188d8018b07/plots/dsp/cardiosc_plot.dsp
faust
process = os.osc(50), 0 : mspan;
declare name "MID SIDE PANNER - LEFT RIGHT LOUDSPEAKER"; declare version "001"; declare author "Giuseppe Silvi"; declare license "GNU-GPL-v3"; declare copyright "(c)SEAM 2019"; declare description "MID SIDE PANNER - LEFT RIGHT LOUDSPEAKER"; import("stdfaust.lib"); import("../../seam.lib"); pisweep = (os.lf_trianglepos(1)*360)-180; rad = 45 : deg2rad; process = os.osc(50) <: *(sin(rad)), *(cos(rad));
521b151eca25ee9c21639e1b8242c431bdf2b039af03496e0798eea895c12059
afalaize/faust
vumeter.dsp
declare name "vumeter"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; //------------------------------------------------- // Simple vumeter //------------------------------------------------- import("stdfaust.lib"); vmeter(x) = attach(x, envelop(x) : vbargraph("[2][unit:dB]", -70, +5)); hmeter(x) = attach(x, envelop(x) : hbargraph("[2][unit:dB]", -70, +5)); envelop = abs : max ~ -(1.0/ma.SR) : max(ba.db2linear(-70)) : ba.linear2db; process = hmeter,hmeter;
https://raw.githubusercontent.com/afalaize/faust/8f9f5fe3aa167eaeecc15a99d4da984ac2797be3/examples/analysis/vumeter.dsp
faust
------------------------------------------------- Simple vumeter -------------------------------------------------
declare name "vumeter"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; import("stdfaust.lib"); vmeter(x) = attach(x, envelop(x) : vbargraph("[2][unit:dB]", -70, +5)); hmeter(x) = attach(x, envelop(x) : hbargraph("[2][unit:dB]", -70, +5)); envelop = abs : max ~ -(1.0/ma.SR) : max(ba.db2linear(-70)) : ba.linear2db; process = hmeter,hmeter;
15cb7f1e45d806d9ae21bbb1705192edb4d4b0600a1fe7e816a6571787c8dc7a
afalaize/faust
osci.dsp
declare name "osci"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2009"; //----------------------------------------------- // Sinusoidal Oscillator // (with linear interpolation) //----------------------------------------------- import("stdfaust.lib"); vol = hslider("volume [unit:dB]", 0, -96, 0, 0.1) : ba.db2linear : si.smoo ; freq = hslider("freq [unit:Hz]", 1000, 20, 24000, 1); process = vgroup("Oscillator", os.osci(freq) * vol);
https://raw.githubusercontent.com/afalaize/faust/8f9f5fe3aa167eaeecc15a99d4da984ac2797be3/examples/generator/osci.dsp
faust
----------------------------------------------- Sinusoidal Oscillator (with linear interpolation) -----------------------------------------------
declare name "osci"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2009"; import("stdfaust.lib"); vol = hslider("volume [unit:dB]", 0, -96, 0, 0.1) : ba.db2linear : si.smoo ; freq = hslider("freq [unit:Hz]", 1000, 20, 24000, 1); process = vgroup("Oscillator", os.osci(freq) * vol);
40d7dcf24b805069728dd0d049b863f0f5f9ba06f59372d8898688ab579a2475
SMERM/BN-Tedesco
spanner_1x8.dsp
declare filename "spanner_1x8.dsp"; declare name "spanner_1x8"; declare name "spanner_1x8"; declare version "1.0"; declare author "THC-SCALAS"; declare license "BSD"; declare copyright "Cecilia-labs"; //========================================================== // // spanner_1x8 // traspose panner_1x8 // //========================================================== import("stdfaust.lib"); nch = 8; //NUMERO DI CANALI IN USCITA angstep = 360.0/nch; //DISTANZA ANGOLARE INTERSPEAKER IN GRADI ang = nentry("Angle[style:knob]",360,0,360,0.1) : si.smooth(ba.tau2pole(0.02)); //DIREZIONE ANGOLARE DELLA SORGENTE IN GRADI sep = hslider("Separation", 12, 0, 100, 0.1) : si.smooth(ba.tau2pole(0.02)); //SEPARAZIONE INTERSPEAKER DELLA SORGENTE angr = ang*ma.PI/180; //ANGOLO IN RADIANTI angstepr= angstep*ma.PI/180; //DISTANZA ANGOLARE INTERSPEAKER IN RADIANTI //*********** CALCOLA I SEGNALE PER TUTTELE 8 USCITE ***********************// process(sig) = sig*(pow(10, ((0.5*cos(angstepr*1-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*2-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*3-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*4-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*5-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*6-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*7-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*8-angr)-0.5)*sep)*0.2));
https://raw.githubusercontent.com/SMERM/BN-Tedesco/2a77e1707f7e64c512dd40d58d29c0db8092463d/COME-04/20200507/spanner_1x8.dsp
faust
========================================================== spanner_1x8 traspose panner_1x8 ========================================================== NUMERO DI CANALI IN USCITA DISTANZA ANGOLARE INTERSPEAKER IN GRADI DIREZIONE ANGOLARE DELLA SORGENTE IN GRADI SEPARAZIONE INTERSPEAKER DELLA SORGENTE ANGOLO IN RADIANTI DISTANZA ANGOLARE INTERSPEAKER IN RADIANTI *********** CALCOLA I SEGNALE PER TUTTELE 8 USCITE ***********************//
declare filename "spanner_1x8.dsp"; declare name "spanner_1x8"; declare name "spanner_1x8"; declare version "1.0"; declare author "THC-SCALAS"; declare license "BSD"; declare copyright "Cecilia-labs"; import("stdfaust.lib"); process(sig) = sig*(pow(10, ((0.5*cos(angstepr*1-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*2-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*3-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*4-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*5-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*6-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*7-angr)-0.5)*sep)*0.2)), sig*(pow(10, ((0.5*cos(angstepr*8-angr)-0.5)*sep)*0.2));
604c9deae2f2134db6278577ad9c8795460dd8e9ea64893a607ffd3a14922aeb
inria-emeraude/syfala
lmsN.dsp
declare name "Least Mean Square Algorithm"; declare version "1.0"; declare author "Pierre Lecomte"; declare author "Loic Alexandre"; declare license "CC-BY-NC-SA-4.0"; import("stdfaust.lib"); N = 500; coeffs = si.bus(N); h = fi.fir((1,2,3,4,5)); // target filter y = _:h; // Output signal from target system h_hat(N) = (si.bus(N),(_<:(si.bus(N)))):ro.interleave(N,2):sum(i, N, (_,@(i):*)); // Adapted filter y_hat(N) = ((si.bus(N)<:si.bus(2*N)),_):(si.bus(N),h_hat(N)); // Output signal from adapted system buffer = _<:par(i,N,@(i)); // To obtain x_n, the reference signal at time n signal = no.noise; // Reference signal x = (signal:_<:(_,_,_)); mu = -0.0001; // Convergence coefficient (smaller for slower convergence) // No input // Output 0 = error signal (y - y_hat) process = ((coeffs,x):(y_hat(N),y,_):(coeffs,(-<:(_,_*mu)),buffer):(coeffs,_,(_<:si.bus(N)),coeffs):(coeffs,_,ro.interleave(N,2)):(coeffs,_,par(i,N,*)):(coeffs,ro.cross1n(N)):(ro.interleave(N,2),_):(par(i,N,+),_))~si.bus(N):(par(i,N,!),_);
https://raw.githubusercontent.com/inria-emeraude/syfala/95ed6765d73520362f6a1ad35e4a3b2a5e16fbc9/tools/multiN/dsp/lmsN.dsp
faust
target filter Output signal from target system Adapted filter Output signal from adapted system To obtain x_n, the reference signal at time n Reference signal Convergence coefficient (smaller for slower convergence) No input Output 0 = error signal (y - y_hat)
declare name "Least Mean Square Algorithm"; declare version "1.0"; declare author "Pierre Lecomte"; declare author "Loic Alexandre"; declare license "CC-BY-NC-SA-4.0"; import("stdfaust.lib"); N = 500; coeffs = si.bus(N); x = (signal:_<:(_,_,_)); process = ((coeffs,x):(y_hat(N),y,_):(coeffs,(-<:(_,_*mu)),buffer):(coeffs,_,(_<:si.bus(N)),coeffs):(coeffs,_,ro.interleave(N,2)):(coeffs,_,par(i,N,*)):(coeffs,ro.cross1n(N)):(ro.interleave(N,2),_):(par(i,N,+),_))~si.bus(N):(par(i,N,!),_);
f9b856f7070103ce40ba126f3bcda34c08d07782063513978711c0a967632c8c
inria-emeraude/syfala
lms_standalone.dsp
declare name "Least Mean Square Algorithm"; declare version "1.0"; declare author "Pierre Lecomte"; declare author "Loic Alexandre"; declare license "CC-BY-NC-SA-4.0"; import("stdfaust.lib"); N = 30; // Number of coefficients coeffs = si.bus(N); h = fi.fir((1,2,3,4,5)); // target filter y = _:h; // Output signal from target system h_hat(N) = (si.bus(N),(_<:(si.bus(N)))):ro.interleave(N,2):sum(i, N, (_,@(i):*)); // Adapted filter y_hat(N) = ((si.bus(N)<:si.bus(2*N)),_):(si.bus(N),h_hat(N)); // Output signal from adapted system buffer = _<:par(i,N,@(i)); // To obtain x_n, the reference signal at time n signal = no.noise; // Reference signal x = (signal:_<:(_,_,_)); mu = -0.0001; // Convergence coefficient (smaller for slower convergence) // No input // Output 0 = error signal (y - y_hat) process = ((coeffs,x):(y_hat(N),y,_):(coeffs,(-<:(_,_*mu)),buffer):(coeffs,_,(_<:si.bus(N)),coeffs):(coeffs,_,ro.interleave(N,2)):(coeffs,_,par(i,N,*)):(coeffs,ro.cross1n(N)):(ro.interleave(N,2),_):(par(i,N,+),_))~si.bus(N):(par(i,N,!),_);
https://raw.githubusercontent.com/inria-emeraude/syfala/95ed6765d73520362f6a1ad35e4a3b2a5e16fbc9/examples/lms_standalone.dsp
faust
Number of coefficients target filter Output signal from target system Adapted filter Output signal from adapted system To obtain x_n, the reference signal at time n Reference signal Convergence coefficient (smaller for slower convergence) No input Output 0 = error signal (y - y_hat)
declare name "Least Mean Square Algorithm"; declare version "1.0"; declare author "Pierre Lecomte"; declare author "Loic Alexandre"; declare license "CC-BY-NC-SA-4.0"; import("stdfaust.lib"); coeffs = si.bus(N); x = (signal:_<:(_,_,_)); process = ((coeffs,x):(y_hat(N),y,_):(coeffs,(-<:(_,_*mu)),buffer):(coeffs,_,(_<:si.bus(N)),coeffs):(coeffs,_,ro.interleave(N,2)):(coeffs,_,par(i,N,*)):(coeffs,ro.cross1n(N)):(ro.interleave(N,2),_):(par(i,N,+),_))~si.bus(N):(par(i,N,!),_);
5aba287c9f6e8ee48d46141310c85695da4256b04e4880d70af67333fd620a25
rottingsounds/bitDSP-faust
DarioGen3.dsp
declare name "DarioGen3"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); // bit = library("bitDSP.lib"); bit_gen = library("bitDSP_gen.lib"); // SuperCollider // export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ // faust2supercollider -I ../../lib -noprefix DarioGen3.dsp c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); // Final output process = bit_gen.gen1(c1, c2) : si.bus(2);
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/d70843492b65bb2cb9cf97c2240905fefacc7383/synths/_sc/DarioGen3.dsp
faust
bit = library("bitDSP.lib"); SuperCollider export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ faust2supercollider -I ../../lib -noprefix DarioGen3.dsp Final output
declare name "DarioGen3"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit_gen = library("bitDSP_gen.lib"); c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); process = bit_gen.gen1(c1, c2) : si.bus(2);
55e9120ad5d2d5ff2ccdf36be2fd08c6358af88971b928a05f68709ea2cc2b23
rottingsounds/bitDSP-faust
DarioGen2.dsp
declare name "DarioGen2"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); // bit = library("bitDSP.lib"); bit_gen = library("bitDSP_gen.lib"); // SuperCollider // export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ // faust2supercollider -I ../../lib -noprefix DarioGen2.dsp c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); // Final output process = bit_gen.gen2(c1, c2) : si.bus(2);
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/d70843492b65bb2cb9cf97c2240905fefacc7383/synths/_sc/DarioGen2.dsp
faust
bit = library("bitDSP.lib"); SuperCollider export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ faust2supercollider -I ../../lib -noprefix DarioGen2.dsp Final output
declare name "DarioGen2"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit_gen = library("bitDSP_gen.lib"); c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); process = bit_gen.gen2(c1, c2) : si.bus(2);
236896dceac16a85b502b2997e1b60a2fc8866fd018beaf2d7abb5b6db8e2f02
rottingsounds/bitDSP-faust
DarioGen1.dsp
declare name "DarioGen1"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); // bit = library("bitDSP.lib"); bit_gen = library("bitDSP_gen.lib"); // SuperCollider // export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ // faust2supercollider -I ../../lib -noprefix DarioGen1.dsp c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); // Final output process = bit_gen.gen1(c1, c2) : si.bus(2);
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/d70843492b65bb2cb9cf97c2240905fefacc7383/synths/_sc/DarioGen1.dsp
faust
bit = library("bitDSP.lib"); SuperCollider export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ faust2supercollider -I ../../lib -noprefix DarioGen1.dsp Final output
declare name "DarioGen1"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit_gen = library("bitDSP_gen.lib"); c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); process = bit_gen.gen1(c1, c2) : si.bus(2);
457a0959dd4613a24811dbac841c615658e67031b05c86a71d272ceef3d09774
rottingsounds/bitDSP-faust
DarioGen4.dsp
declare name "DarioGen4"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); // bit = library("bitDSP.lib"); bit_gen = library("bitDSP_gen.lib"); // SuperCollider // export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ // faust2supercollider -I ../../lib -noprefix DarioGen4.dsp c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); // Final output process = bit_gen.gen4(c1, c2) : si.bus(2);
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/d70843492b65bb2cb9cf97c2240905fefacc7383/synths/_sc/DarioGen4.dsp
faust
bit = library("bitDSP.lib"); SuperCollider export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ faust2supercollider -I ../../lib -noprefix DarioGen4.dsp Final output
declare name "DarioGen4"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit_gen = library("bitDSP_gen.lib"); c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); process = bit_gen.gen4(c1, c2) : si.bus(2);
d3a4cb12e796230e0ba92ebb4991e9537144d1fb7487fe28b3290fa428dc9148
rottingsounds/bitDSP-faust
Higks.dsp
declare name "Higks"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); // bit = library("bitDSP.lib"); bit_gen = library("bitDSP_gen.lib"); // SuperCollider // export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ // faust2supercollider -I ../../lib -noprefix Higks.dsp c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); // Final output process = bit_gen.higks(c1, c2) : si.bus(2);
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/d70843492b65bb2cb9cf97c2240905fefacc7383/synths/_sc/Higks.dsp
faust
bit = library("bitDSP.lib"); SuperCollider export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ faust2supercollider -I ../../lib -noprefix Higks.dsp Final output
declare name "Higks"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit_gen = library("bitDSP_gen.lib"); c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); process = bit_gen.higks(c1, c2) : si.bus(2);
4e9aa99e354f6aac204c509783e4783bcf9a7aeb004da79c23adc508deedcc6c
rottingsounds/bitDSP-faust
Bfb.dsp
declare name "Bfb"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); // bit = library("bitDSP.lib"); bit_gen = library("bitDSP_gen.lib"); // SuperCollider // export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ // faust2supercollider -I ../../lib -noprefix Bfb.dsp c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); // Final output process = bit_gen.bfb(c1, c2) : si.bus(2);
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/d70843492b65bb2cb9cf97c2240905fefacc7383/synths/_sc/Bfb.dsp
faust
bit = library("bitDSP.lib"); SuperCollider export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ faust2supercollider -I ../../lib -noprefix Bfb.dsp Final output
declare name "Bfb"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit_gen = library("bitDSP_gen.lib"); c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); process = bit_gen.bfb(c1, c2) : si.bus(2);
7d0546ab51bfea4b8966a59611df3e45578c17622e369c58481e68829d57d19c
rottingsounds/bitDSP-faust
Trck.dsp
declare name "Trck"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); // bit = library("bitDSP.lib"); bit_gen = library("bitDSP_gen.lib"); // SuperCollider // export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ // faust2supercollider -I ../../lib -noprefix Trck.dsp c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); // Final output process = bit_gen.trck(c1, c2) : si.bus(2);
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/d70843492b65bb2cb9cf97c2240905fefacc7383/synths/_sc/Trck.dsp
faust
bit = library("bitDSP.lib"); SuperCollider export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ faust2supercollider -I ../../lib -noprefix Trck.dsp Final output
declare name "Trck"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit_gen = library("bitDSP_gen.lib"); c1 = hslider("c1",0,0,1,0.001); c2 = hslider("c2",0.5,0,1,0.001); process = bit_gen.trck(c1, c2) : si.bus(2);
492636850a58f92019579481e92865ef2f396732ef00b901e241c54f24f890c5
Frando/studiox-switcher
switcher.dsp
declare name "studiox-switcher"; declare version "1.0"; declare author "Franz Heinzmann"; declare license "BSD"; declare options "[osc:on]"; import("stdfaust.lib"); merge2 = _,_: ba.parallelMean(2); // helpers to build a VU meter envelop = abs : max ~ -(1.0/ma.SR) : max(ba.db2linear(-70)) : ba.linear2db; vumeterM(x) = envelop(x) : vbargraph("level[2][unit:dB][style:dB]", -60, +5); vumeterS(a,b) = a,b <: _,_,_,_ : (a, b, attach(0,vumeterM((a+b)/2)), 0) :> _,_; vumeter = _,_ : vumeterS(_,_); vumeterI(i) = _,_ : vgroup("level/%i", vumeter) : _,_; silenceDetect( analysisWin, dBSilenceTh, timeSilenceTh, xInput ) = ba.linear2db( an.rms_envelope_t19( analysisWin, xInput ) ) < dBSilenceTh <: fi.pole > (timeSilenceTh * ma.SR); stereoSilenceFallback( analysisWin, dBSilenceTh, timeSilenceTh, mainActive, xMainL, xMainR, xBackupL, xBackupR ) = ba.select2stereo(cond, xMainL, xMainR, xBackupL, xBackupR) with { cond = ba.if( mainActive, silenceDetect( analysisWin, dBSilenceTh, timeSilenceTh, merge2(xMainL, xMainR) ), 1.0 ); }; applySilenceFallback(xBackupL, xBackupR, xMainL, xMainR) = stereoSilenceFallback( .01, vslider("threshold[style:knob][unit:dB]", -60, -70, 0, 0.1), vslider("timeout[style:knob]", 1.0, 0.1, 60.0, 0.1), 1.0, xMainL, xMainR, xBackupL, xBackupR ); switcherN(N, xBackupL, xBackupR) = par(n, N, _,_) : hgroup("active", selector(N)) with { selector(1) = ba.select2stereo( checkbox("1"), xBackupL, xBackupR, _,_ ); selector(n) = ba.select2stereo( checkbox("%n"), selector(n-1), _,_ ); }; fallbackSwitcherN(N, xBackupL, xBackupR) = switcherN(N, xBackupL, xBackupR) : _,_ : applySilenceFallback(xBackupL, xBackupR); inputMeters(N) = hgroup("input", par(n, N, vgroup("%n", vumeter))); N = 3; process = par(n, N + 1, _,_) : inputMeters(N + 1) : fallbackSwitcherN(N) : vumeter : _,_;
https://raw.githubusercontent.com/Frando/studiox-switcher/84ce1d192c86c11aaf89edb5e097b29555f632f4/dsp/switcher.dsp
faust
helpers to build a VU meter
declare name "studiox-switcher"; declare version "1.0"; declare author "Franz Heinzmann"; declare license "BSD"; declare options "[osc:on]"; import("stdfaust.lib"); merge2 = _,_: ba.parallelMean(2); envelop = abs : max ~ -(1.0/ma.SR) : max(ba.db2linear(-70)) : ba.linear2db; vumeterM(x) = envelop(x) : vbargraph("level[2][unit:dB][style:dB]", -60, +5); vumeterS(a,b) = a,b <: _,_,_,_ : (a, b, attach(0,vumeterM((a+b)/2)), 0) :> _,_; vumeter = _,_ : vumeterS(_,_); vumeterI(i) = _,_ : vgroup("level/%i", vumeter) : _,_; silenceDetect( analysisWin, dBSilenceTh, timeSilenceTh, xInput ) = ba.linear2db( an.rms_envelope_t19( analysisWin, xInput ) ) < dBSilenceTh <: fi.pole > (timeSilenceTh * ma.SR); stereoSilenceFallback( analysisWin, dBSilenceTh, timeSilenceTh, mainActive, xMainL, xMainR, xBackupL, xBackupR ) = ba.select2stereo(cond, xMainL, xMainR, xBackupL, xBackupR) with { cond = ba.if( mainActive, silenceDetect( analysisWin, dBSilenceTh, timeSilenceTh, merge2(xMainL, xMainR) ), 1.0 ); }; applySilenceFallback(xBackupL, xBackupR, xMainL, xMainR) = stereoSilenceFallback( .01, vslider("threshold[style:knob][unit:dB]", -60, -70, 0, 0.1), vslider("timeout[style:knob]", 1.0, 0.1, 60.0, 0.1), 1.0, xMainL, xMainR, xBackupL, xBackupR ); switcherN(N, xBackupL, xBackupR) = par(n, N, _,_) : hgroup("active", selector(N)) with { selector(1) = ba.select2stereo( checkbox("1"), xBackupL, xBackupR, _,_ ); selector(n) = ba.select2stereo( checkbox("%n"), selector(n-1), _,_ ); }; fallbackSwitcherN(N, xBackupL, xBackupR) = switcherN(N, xBackupL, xBackupR) : _,_ : applySilenceFallback(xBackupL, xBackupR); inputMeters(N) = hgroup("input", par(n, N, vgroup("%n", vumeter))); N = 3; process = par(n, N + 1, _,_) : inputMeters(N + 1) : fallbackSwitcherN(N) : vumeter : _,_;
30b48aef23af25448a628b3c24e5775f7dbc0e6badaad3794d88f05e09bd3ecb
magnetophon/MBdistortion
MBdistortion.dsp
declare name "MBdistortion"; declare author "Bart Brouns ([email protected]"; declare copyright "Bart Brouns"; declare version "1.1.1"; declare license "GPLv2"; import("stdfaust.lib"); MS = (checkbox("[0] mid/side [tooltip: When this is checked, process mid-side, otherwise process stereo]")); freq_group(x) = (hgroup("[1] crossover frequencies", x)); fc1 = freq_group(vslider("[1] L/LM [unit:Hz] [style:knob] [tooltip: Crossover frequency (Hz) separating low and low middle frequencies]", 120 , 20, 1000, 1)):si.smooth(0.999); fc2 = freq_group(vslider("[2] LM/HM [unit:Hz] [style:knob] [tooltip: Crossover frequency (Hz) separating low middle and high middle frequencies]", 1000, 100, 3000, 1)):si.smooth(0.999); fc3 = freq_group(vslider("[3] HM/H [unit:Hz] [style:knob] [tooltip: Crossover frequency (Hz) separating high middle and high frequencies]", 6000, 500, 10000, 1)):si.smooth(0.999); bands_group(x) = (hgroup("[2] frequency bands", x)); low_group(x) = bands_group(hgroup("[1] low", x)); lowmid_group(x) = bands_group(hgroup("[2] low mid", x)); himid_group(x) = bands_group(hgroup("[3] high mid", x)); high_group(x) = bands_group(hgroup("[4] high", x)); drive1A = low_group(vslider("[1] Drive A [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); drive1B = low_group(vslider("[2] Drive B [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); offset1A = low_group(vslider("[3] Offset A [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); offset1B = low_group(vslider("[4] Offset B [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); drive2A = lowmid_group(vslider("[1] Drive A [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); drive2B = lowmid_group(vslider("[2] Drive B [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); offset2A = lowmid_group(vslider("[3] Offset A [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); offset2B = lowmid_group(vslider("[4] Offset B [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); drive3A = himid_group(vslider("[1] Drive A [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); drive3B = himid_group(vslider("[2] Drive B [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); offset3A = himid_group(vslider("[3] Offset A [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); offset3B = himid_group(vslider("[4] Offset B [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); drive4A = high_group(vslider("[1] Drive A [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); drive4B = high_group(vslider("[2] Drive B [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); offset4A = high_group(vslider("[3] Offset A [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); offset4B = high_group(vslider("[4] Offset B [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); outgain_group(x) = (vgroup("[3] output gain", x)); drygain = outgain_group(hslider("[1] Dry gain [unit:dB][tooltip: ]", -144, -144, 0, 0.01)):ba.db2linear:si.smooth(0.999); wetgain = outgain_group(hslider("[2] Wet gain [unit:dB][tooltip: ]", 0, -144, 0, 0.01)):ba.db2linear:si.smooth(0.999); MBdist( drive1,offset1, drive2,offset2, drive3,offset3, drive4,offset4)= fi.filterbank(3,(fc1,fc2,fc3)): ( ef.cubicnl(drive4,offset4), ef.cubicnl(drive3,offset3), ef.cubicnl(drive2,offset2), ef.cubicnl(drive1,offset1) ) :>fi.dcblocker; stereo2MS(MS, x,y) = (x+(MS*y)), ((MS*x) + ((MS*-2)+1)*y); MS2stereo(MS, m,s) = ((m+(MS*s))/(MS+1)), (((MS*m) + ((MS*-2)+1)*s)/(MS+1)); MSMBdist(x,y) = ( stereo2MS(MS, x,y) : (MBdist( drive1A,offset1A, drive2A,offset2A, drive3A,offset3A, drive4A,offset4A)*wetgain, MBdist( drive1B,offset1B, drive2B,offset2B, drive3B,offset3B, drive4B,offset4B)*wetgain) : MS2stereo(MS) ) , ((x:fi.filterbank(3,(fc1,fc2,fc3)):>_)*drygain,(y:fi.filterbank(3,(fc1,fc2,fc3)):>_)*drygain) :>(_,_); process(x,y) = MSMBdist(x,y);
https://raw.githubusercontent.com/magnetophon/MBdistortion/612e511d7f6f09877f8bb804faacfb90a01afe9c/MBdistortion.dsp
faust
declare name "MBdistortion"; declare author "Bart Brouns ([email protected]"; declare copyright "Bart Brouns"; declare version "1.1.1"; declare license "GPLv2"; import("stdfaust.lib"); MS = (checkbox("[0] mid/side [tooltip: When this is checked, process mid-side, otherwise process stereo]")); freq_group(x) = (hgroup("[1] crossover frequencies", x)); fc1 = freq_group(vslider("[1] L/LM [unit:Hz] [style:knob] [tooltip: Crossover frequency (Hz) separating low and low middle frequencies]", 120 , 20, 1000, 1)):si.smooth(0.999); fc2 = freq_group(vslider("[2] LM/HM [unit:Hz] [style:knob] [tooltip: Crossover frequency (Hz) separating low middle and high middle frequencies]", 1000, 100, 3000, 1)):si.smooth(0.999); fc3 = freq_group(vslider("[3] HM/H [unit:Hz] [style:knob] [tooltip: Crossover frequency (Hz) separating high middle and high frequencies]", 6000, 500, 10000, 1)):si.smooth(0.999); bands_group(x) = (hgroup("[2] frequency bands", x)); low_group(x) = bands_group(hgroup("[1] low", x)); lowmid_group(x) = bands_group(hgroup("[2] low mid", x)); himid_group(x) = bands_group(hgroup("[3] high mid", x)); high_group(x) = bands_group(hgroup("[4] high", x)); drive1A = low_group(vslider("[1] Drive A [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); drive1B = low_group(vslider("[2] Drive B [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); offset1A = low_group(vslider("[3] Offset A [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); offset1B = low_group(vslider("[4] Offset B [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); drive2A = lowmid_group(vslider("[1] Drive A [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); drive2B = lowmid_group(vslider("[2] Drive B [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); offset2A = lowmid_group(vslider("[3] Offset A [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); offset2B = lowmid_group(vslider("[4] Offset B [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); drive3A = himid_group(vslider("[1] Drive A [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); drive3B = himid_group(vslider("[2] Drive B [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); offset3A = himid_group(vslider("[3] Offset A [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); offset3B = himid_group(vslider("[4] Offset B [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); drive4A = high_group(vslider("[1] Drive A [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); drive4B = high_group(vslider("[2] Drive B [tooltip: Amount of distortion]", 0, 0, 1, 0.01)):si.smooth(0.999); offset4A = high_group(vslider("[3] Offset A [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); offset4B = high_group(vslider("[4] Offset B [tooltip: Brings in even harmonics]", 0, 0, 1, 0.01)):si.smooth(0.999); outgain_group(x) = (vgroup("[3] output gain", x)); drygain = outgain_group(hslider("[1] Dry gain [unit:dB][tooltip: ]", -144, -144, 0, 0.01)):ba.db2linear:si.smooth(0.999); wetgain = outgain_group(hslider("[2] Wet gain [unit:dB][tooltip: ]", 0, -144, 0, 0.01)):ba.db2linear:si.smooth(0.999); MBdist( drive1,offset1, drive2,offset2, drive3,offset3, drive4,offset4)= fi.filterbank(3,(fc1,fc2,fc3)): ( ef.cubicnl(drive4,offset4), ef.cubicnl(drive3,offset3), ef.cubicnl(drive2,offset2), ef.cubicnl(drive1,offset1) ) :>fi.dcblocker; stereo2MS(MS, x,y) = (x+(MS*y)), ((MS*x) + ((MS*-2)+1)*y); MS2stereo(MS, m,s) = ((m+(MS*s))/(MS+1)), (((MS*m) + ((MS*-2)+1)*s)/(MS+1)); MSMBdist(x,y) = ( stereo2MS(MS, x,y) : (MBdist( drive1A,offset1A, drive2A,offset2A, drive3A,offset3A, drive4A,offset4A)*wetgain, MBdist( drive1B,offset1B, drive2B,offset2B, drive3B,offset3B, drive4B,offset4B)*wetgain) : MS2stereo(MS) ) , ((x:fi.filterbank(3,(fc1,fc2,fc3)):>_)*drygain,(y:fi.filterbank(3,(fc1,fc2,fc3)):>_)*drygain) :>(_,_); process(x,y) = MSMBdist(x,y);
fc6cc0319086b0544f131cdea95968d74ca13ac2a955f8a05687a1603326df7f
s-e-a-m/faust-libraries
m2bfmt.dsp
declare name "MICHAEL GERZON MONO TO BFORMAT ENCODER"; declare version "001"; declare author "Giuseppe Silvi"; declare license "GNU-GPL-v3"; declare copyright "(c)SEAM 2019"; declare description "MICHAEL GERZON MONO TO BFORMAT ENCODER"; import("stdfaust.lib"); import("../../seam.lib"); // LS and RS are dead channels to create VST routing consistency m2bfmt(L,R,LS,RS) = W,X,Y,Z with{ encoder(x) = hgroup("BFMT ENCODER", x); azi = encoder(vslider("[01] Azimuth [style:knob]", 0, 0, 360, 0.1) : deg2rad : si.smoo); elv = encoder(vslider("[01] Elevation [style:knob]", 0, 0, 360, 0.1) : deg2rad : si.smoo); W = L * 0.707; X = L * cos(azi) * cos(elv); Y = L * sin(azi) * cos(elv); Z = L * sin(elv); }; process = m2bfmt;
https://raw.githubusercontent.com/s-e-a-m/faust-libraries/9120cccb9335f42407062eb4bf149188d8018b07/examples/vst/m2bfmt.dsp
faust
LS and RS are dead channels to create VST routing consistency
declare name "MICHAEL GERZON MONO TO BFORMAT ENCODER"; declare version "001"; declare author "Giuseppe Silvi"; declare license "GNU-GPL-v3"; declare copyright "(c)SEAM 2019"; declare description "MICHAEL GERZON MONO TO BFORMAT ENCODER"; import("stdfaust.lib"); import("../../seam.lib"); m2bfmt(L,R,LS,RS) = W,X,Y,Z with{ encoder(x) = hgroup("BFMT ENCODER", x); azi = encoder(vslider("[01] Azimuth [style:knob]", 0, 0, 360, 0.1) : deg2rad : si.smoo); elv = encoder(vslider("[01] Elevation [style:knob]", 0, 0, 360, 0.1) : deg2rad : si.smoo); W = L * 0.707; X = L * cos(azi) * cos(elv); Y = L * sin(azi) * cos(elv); Z = L * sin(elv); }; process = m2bfmt;
6dc8f93ac874a79b85bcfae675fe9b3e87820ba89a3e4446e0fe64b18ef83f3e
madskjeldgaard/komet
plat.dsp
declare name "Plat"; declare author "Mads Kjeldgaard"; declare copyright "Mads Kjeldgaard"; declare version "1.00"; declare license "GPL"; import("stdfaust.lib"); import("lib/mkdelay.dsp"); // Static order = 4; numDelays = 8; maxdelay = 0.1 * ma.SR; // Controls delay = vslider("delaytime",0.1,0.001,2.0,0.01) : *(ma.SR) : si.smoo; fb = vslider("fb",0.1,0.001,2.0,0.01); lpf = vslider("cutoff",3500,20.0,20000.0,1); delayOffset=vslider("delayoffset",0.5,0.0,1.0,0.00001) : si.smoo; modFreq=vslider("modFreq",0.05,0.0,1.0,0.00001) : si.smoo; modDepth=vslider("modDepth",0.05,0.0,1.0,0.00001) : si.smoo; // apFb = vslider("apFb",0.25,0.0,1.0,0.00001) : si.smoo; // Process process = _ <: mkd.parallel_comb_lpf(numDelays, order, maxdelay, delay, delayOffset, fb, lpf) :> fi.allpass_fcomb(maxdelay,apdelay(modFreq, modDepth),fb) with{ apdelay(modFreq, modDepth) = os.lf_triangle(modFreq) + 1.0 : /(2.0) : *(maxdelay) : *(modDepth); };
https://raw.githubusercontent.com/madskjeldgaard/komet/defd9b0b2f4055dcb12b75565631a30152fa779c/faust/plat.dsp
faust
Static Controls apFb = vslider("apFb",0.25,0.0,1.0,0.00001) : si.smoo; Process
declare name "Plat"; declare author "Mads Kjeldgaard"; declare copyright "Mads Kjeldgaard"; declare version "1.00"; declare license "GPL"; import("stdfaust.lib"); import("lib/mkdelay.dsp"); order = 4; numDelays = 8; maxdelay = 0.1 * ma.SR; delay = vslider("delaytime",0.1,0.001,2.0,0.01) : *(ma.SR) : si.smoo; fb = vslider("fb",0.1,0.001,2.0,0.01); lpf = vslider("cutoff",3500,20.0,20000.0,1); delayOffset=vslider("delayoffset",0.5,0.0,1.0,0.00001) : si.smoo; modFreq=vslider("modFreq",0.05,0.0,1.0,0.00001) : si.smoo; modDepth=vslider("modDepth",0.05,0.0,1.0,0.00001) : si.smoo; process = _ <: mkd.parallel_comb_lpf(numDelays, order, maxdelay, delay, delayOffset, fb, lpf) :> fi.allpass_fcomb(maxdelay,apdelay(modFreq, modDepth),fb) with{ apdelay(modFreq, modDepth) = os.lf_triangle(modFreq) + 1.0 : /(2.0) : *(maxdelay) : *(modDepth); };
7711054442f63c5055f39bc66e365dd85e4d129e0444d47cc65058e4e7523538
jameslnrd/mi_introduction_workshop_2020
2massChain.dsp
declare name "2-mass Chain"; declare author "James Leonard"; declare date "April 2020"; /* ========= DESCRITPION ============= A logical step from a simple oscillator: a chain of two masses connected by spring-dampers, fixed at one end to a fixed point ! - inputs: force impulse on the last mass of the chain. - outputs: position of the last mass of the chain. - controls: none */ import("stdfaust.lib"); in1 = button("Frc Input 1"): ba.impulsify; OutGain = 0.1; K1 = 0.1; Z1 = 0.0003; K2 = 0.1; Z2 = 0.0003; model = ( mi.ground(0.), mi.mass(1., 0, 0., 0.), mi.mass(1., 0, 0., 0.), par(i, nbFrcIn,_): RoutingMassToLink , par(i, nbFrcIn,_): mi.springDamper(K1, Z1, 0., 0.), mi.springDamper(K2, Z2, 0., 0.), par(i, nbOut+nbFrcIn, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ RoutingMassToLink(m0, m1, m2) = /* routed positions */ m0, m1, m1, m2, /* outputs */ m2; RoutingLinkToMass(l0_f1, l0_f2, l1_f1, l1_f2, p_out1, f_in1) = /* routed forces */ l0_f1, l0_f2 + l1_f1, f_in1 + l1_f2, /* pass-through */ p_out1; nbMass = 3; nbFrcIn = 1; nbOut = 1; }; process = in1 : model:*(OutGain); /* ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard @K1 param 0.1 @Z1 param 0.0003 @K2 param 0.1 @Z2 param 0.0003 @g ground 0. @m1 mass 1. 0. 0. @m2 mass 1. 0. 0. @s1 springDamper @g @m1 K1 Z1 @s2 springDamper @m1 @m2 K2 Z2 # Add force input to the model @in1 frcInput @m2 # Add position output from the oscillator @out1 posOutput @m2 # end of MIMS script */
https://raw.githubusercontent.com/jameslnrd/mi_introduction_workshop_2020/2f487dbc5b8e7cd83cbd962254e737bdb82948f6/08_TwoMassChain/2massChain.dsp
faust
========= DESCRITPION ============= A logical step from a simple oscillator: a chain of two masses connected by spring-dampers, fixed at one end to a fixed point ! - inputs: force impulse on the last mass of the chain. - outputs: position of the last mass of the chain. - controls: none routed positions outputs routed forces pass-through ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard @K1 param 0.1 @Z1 param 0.0003 @K2 param 0.1 @Z2 param 0.0003 @g ground 0. @m1 mass 1. 0. 0. @m2 mass 1. 0. 0. @s1 springDamper @g @m1 K1 Z1 @s2 springDamper @m1 @m2 K2 Z2 # Add force input to the model @in1 frcInput @m2 # Add position output from the oscillator @out1 posOutput @m2 # end of MIMS script
declare name "2-mass Chain"; declare author "James Leonard"; declare date "April 2020"; import("stdfaust.lib"); in1 = button("Frc Input 1"): ba.impulsify; OutGain = 0.1; K1 = 0.1; Z1 = 0.0003; K2 = 0.1; Z2 = 0.0003; model = ( mi.ground(0.), mi.mass(1., 0, 0., 0.), mi.mass(1., 0, 0., 0.), par(i, nbFrcIn,_): RoutingMassToLink , par(i, nbFrcIn,_): mi.springDamper(K1, Z1, 0., 0.), mi.springDamper(K2, Z2, 0., 0.), par(i, nbOut+nbFrcIn, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ nbMass = 3; nbFrcIn = 1; nbOut = 1; }; process = in1 : model:*(OutGain);
b2ad1e81b612236daa5d6acb5e09b644c1e43994df5bc0fb0efe9651692a2c23
rottingsounds/bitDSP-faust
DSM2bipolar.dsp
declare name "DSM2bipolar"; declare author "Till Bovermann, Dario Sanfilippo"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); // plot // CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib DSM2bipolar.dsp // ./DSM2bipolar -n 10 // compile // CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib DSM2bipolar.dsp // ./DSM2bipolar // SuperCollider // export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ // faust2supercollider -I ../faust/bitDSP-faust/lib -noprefix DSM2bipolar.dsp // Final output // Bipolar multi-bit signal to bipolar one-bit signal process = bit.dsm2;
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/21cf36105c55b6e18969a867a319530a0ef1ea63/examples/_sc/DSM2bipolar.dsp
faust
plot CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib DSM2bipolar.dsp ./DSM2bipolar -n 10 compile CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib DSM2bipolar.dsp ./DSM2bipolar SuperCollider export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ faust2supercollider -I ../faust/bitDSP-faust/lib -noprefix DSM2bipolar.dsp Final output Bipolar multi-bit signal to bipolar one-bit signal
declare name "DSM2bipolar"; declare author "Till Bovermann, Dario Sanfilippo"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); process = bit.dsm2;
a917ca78818353ea977a6da71c44edd52d952bb7bc63d9aa2f6f35b3617766f0
rottingsounds/bitDSP-faust
DSMAdd.dsp
declare name "DSMAdd"; declare author "Till Bovermann, Dario Sanfilippo"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); // plot // CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib DSMAdd.dsp // ./DSM2bipolar -n 10 // compile // CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib DSMAdd.dsp // ./DSM2bipolar // SuperCollider // export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ // faust2supercollider -I ../faust/bitDSP-faust/lib -noprefix DSMAdd.dsp // Final output // Bipolar multi-bit signal to bipolar one-bit signal process = bit.bitstream_adder;
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/21cf36105c55b6e18969a867a319530a0ef1ea63/examples/_sc/DSMAdd.dsp
faust
plot CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib DSMAdd.dsp ./DSM2bipolar -n 10 compile CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib DSMAdd.dsp ./DSM2bipolar SuperCollider export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ faust2supercollider -I ../faust/bitDSP-faust/lib -noprefix DSMAdd.dsp Final output Bipolar multi-bit signal to bipolar one-bit signal
declare name "DSMAdd"; declare author "Till Bovermann, Dario Sanfilippo"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); process = bit.bitstream_adder;
1ee56568c9a4ea0137c28f425f25f22eadcff3cecc71c2831db4b2bdab4d0b99
rottingsounds/bitDSP-faust
DSM2unipolar.dsp
declare name "DSM2unipolar"; declare author "Till Bovermann, Dario Sanfilippo"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); // plot // CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib DSM2unipolar.dsp // ./DSM2unipolar -n 10 // compile // CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib DSM2unipolar.dsp // ./DSM2unipolar // SuperCollider // export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ // faust2supercollider -I ../faust/bitDSP-faust/lib -noprefix DSM2unipolar.dsp // Final output // Bipolar multi-bit signal to bipolar one-bit signal process = bit.dsm2 > 0;
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/21cf36105c55b6e18969a867a319530a0ef1ea63/examples/_sc/DSM2unipolar.dsp
faust
plot CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib DSM2unipolar.dsp ./DSM2unipolar -n 10 compile CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib DSM2unipolar.dsp ./DSM2unipolar SuperCollider export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ faust2supercollider -I ../faust/bitDSP-faust/lib -noprefix DSM2unipolar.dsp Final output Bipolar multi-bit signal to bipolar one-bit signal
declare name "DSM2unipolar"; declare author "Till Bovermann, Dario Sanfilippo"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); process = bit.dsm2 > 0;
c672b1927ea600b0593cdc19af5fb20829e1ecbf91d7a9d6718d4e464caacf18
afalaize/faust
karplus.dsp
declare name "karplus"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; //----------------------------------------------- // karplus-strong //----------------------------------------------- import("stdfaust.lib"); // Excitator //----------- upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); trigger(n) = upfront : release(n) : >(0.0); size = hslider("excitation [unit:f]", 128, 2, 512, 1); // resonator //------------ dur = hslider("duration [unit:f]", 128, 2, 512, 1); att = hslider("attenuation", 0.1, 0, 1, 0.01); average(x) = (x+x')/2; resonator(d, a) = (+ : de.delay(4096, d-1.5)) ~ (average : *(1.0-a)) ; process = no.noise * hslider("level", 0.5, 0, 1, 0.01) : vgroup("excitator", *(button("play"): trigger(size))) : vgroup("resonator", resonator(dur, att));
https://raw.githubusercontent.com/afalaize/faust/8f9f5fe3aa167eaeecc15a99d4da984ac2797be3/examples/physicalModeling/old/karplus.dsp
faust
----------------------------------------------- karplus-strong ----------------------------------------------- Excitator ----------- resonator ------------
declare name "karplus"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; import("stdfaust.lib"); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0.0)/n; release(n) = + ~ decay(n); trigger(n) = upfront : release(n) : >(0.0); size = hslider("excitation [unit:f]", 128, 2, 512, 1); dur = hslider("duration [unit:f]", 128, 2, 512, 1); att = hslider("attenuation", 0.1, 0, 1, 0.01); average(x) = (x+x')/2; resonator(d, a) = (+ : de.delay(4096, d-1.5)) ~ (average : *(1.0-a)) ; process = no.noise * hslider("level", 0.5, 0, 1, 0.01) : vgroup("excitator", *(button("play"): trigger(size))) : vgroup("resonator", resonator(dur, att));
f865256dfacc5ce8abe6f41e359e7130c6f6c76fe31bad121e5f68a0a68fbdd6
friskgit/snares
i_snare_phase.dsp
// -*- compile-command: "cd .. && make jack src=i_snare_phase.dsp && cd -"; -*-&& cd -"; -*- declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); import("math.lib") ; // for PI definition import("music.lib") ; // for osci definition //---------------`Four drum instances phased equally` -------------------------- // // Generating an impulse and feeding it to a generic_snarefs. Each impulse is delayed by 25% // and sent to a separate instance of generic_snarefs. This allows for faster impulses 4X the // speed of the pulse which is in samples. // // disperse.dsp doe not pass on the impules as generic_snarefs does. // // 18 Juli 2019 Henrik Frisk [email protected] //--------------------------------------------------- p = hslider("pulse", 1, 1, 10000, 1);// : si.smooth(0.999); per = ma.SR / p : int : *(4); //This is to avoid lagging when modulating the pulse hit(t) = (diff(ba.period(t)) < 0) + impulse with { diff(x) = x <: _ - _'; impulse = 1 - 1'; }; delA = per : *(0.25); delB = per : *(0.5); delC = per : *(0.75); imp_delA = hit(per) : de.sdelay(192000, 64, delA); imp_delB = hit(per) : de.sdelay(192000, 64, delB); imp_delC = hit(per) : de.sdelay(192000, 64, delC); process = ((hit(per) : component("generic_snarefs.dsp")[accent = 2;]), (imp_delA : component("generic_snarefs.dsp")), (imp_delB : component("generic_snarefs.dsp")), (imp_delC : component("generic_snarefs.dsp"))) :> _;
https://raw.githubusercontent.com/friskgit/snares/bb43ea5e706a0ead6d65dd176a5c492b2f5d8f74/faust/snare/src/i_snare_phase.dsp
faust
-*- compile-command: "cd .. && make jack src=i_snare_phase.dsp && cd -"; -*-&& cd -"; -*- for PI definition for osci definition ---------------`Four drum instances phased equally` -------------------------- Generating an impulse and feeding it to a generic_snarefs. Each impulse is delayed by 25% and sent to a separate instance of generic_snarefs. This allows for faster impulses 4X the speed of the pulse which is in samples. disperse.dsp doe not pass on the impules as generic_snarefs does. 18 Juli 2019 Henrik Frisk [email protected] --------------------------------------------------- : si.smooth(0.999); This is to avoid lagging when modulating the pulse
declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); per = ma.SR / p : int : *(4); hit(t) = (diff(ba.period(t)) < 0) + impulse with { diff(x) = x <: _ - _'; impulse = 1 - 1'; }; delA = per : *(0.25); delB = per : *(0.5); delC = per : *(0.75); imp_delA = hit(per) : de.sdelay(192000, 64, delA); imp_delB = hit(per) : de.sdelay(192000, 64, delB); imp_delC = hit(per) : de.sdelay(192000, 64, delC); process = ((hit(per) : component("generic_snarefs.dsp")[accent = 2;]), (imp_delA : component("generic_snarefs.dsp")), (imp_delB : component("generic_snarefs.dsp")), (imp_delC : component("generic_snarefs.dsp"))) :> _;
85949597c388c8ee1806b196f52f54760ebdbcc0b328e8b6f5c8ff700af0bd3b
friskgit/snares
snare.dsp
// -*- compile-command: "cd .. && make sc && cd -"; -*- declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); //---------------`Snare drum synth` -------------------------- // A take at a snare drum synth // // A single hit snare drum synth // // Where: // * midi note 67-89 // * stiffness 0-0.55 (mapped to note as in note 67 -> 0)§ // * midi velocity is mapped to pressure // A useful parameter setting is: // // 30 Juni 2018 Henrik Frisk [email protected] //--------------------------------------------------- channels = 2; //imp = ba.pulse(hslider("tempo", 1000, 500, 10000, 1)); // env = en.ar(0.000001, 0.1, button("play")); env = en.ar(attack, rel, imp) * amp with { attack = hslider("attack", 0.00000001, 0, 0.1, 0.000000001) : si.smooth(0.1); rel = hslider("rel", 0.1, 0.0000001, 0.5, 0.0000001) : si.smooth(0.2); imp = button("gate"); amp = hslider("vol", 0.5, 0, 1, 0.0001); }; // Control the output channel focus = hslider("focus", 1, 0, 1, 0.0001); position = hslider("position", 1, 0, channels, 1); rate = ma.SR/1000.0; rndctrl = (no.lfnoise(rate) * (channels + 1)) * focus : ma.fabs + position : int ; outputctrl = rndctrl : ba.sAndH(imp); n = no.multinoise(8) : par(i, 8, _ * env * 0.1); filt = fi.resonbp(frq, q, gain) with { frq = hslider("freq", 200, 50, 5000, 0.1); q = hslider("q", 1, 0.01, 10, 0.01); gain = hslider("gain", 0, 0, 2, 0.00001); }; ch_wrapped = ma.modulo(outputctrl, channels); process = n : par(i, 8, filt); // :> ba.selectoutn(channels, ch_wrapped); //process = n : par(i, 8, filt) :> _,_;
https://raw.githubusercontent.com/friskgit/snares/bb43ea5e706a0ead6d65dd176a5c492b2f5d8f74/max/snare%7E.mxo/snare.dsp
faust
-*- compile-command: "cd .. && make sc && cd -"; -*- ---------------`Snare drum synth` -------------------------- A take at a snare drum synth A single hit snare drum synth Where: * midi note 67-89 * stiffness 0-0.55 (mapped to note as in note 67 -> 0)§ * midi velocity is mapped to pressure A useful parameter setting is: 30 Juni 2018 Henrik Frisk [email protected] --------------------------------------------------- imp = ba.pulse(hslider("tempo", 1000, 500, 10000, 1)); env = en.ar(0.000001, 0.1, button("play")); Control the output channel :> ba.selectoutn(channels, ch_wrapped); process = n : par(i, 8, filt) :> _,_;
declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); channels = 2; env = en.ar(attack, rel, imp) * amp with { attack = hslider("attack", 0.00000001, 0, 0.1, 0.000000001) : si.smooth(0.1); rel = hslider("rel", 0.1, 0.0000001, 0.5, 0.0000001) : si.smooth(0.2); imp = button("gate"); amp = hslider("vol", 0.5, 0, 1, 0.0001); }; focus = hslider("focus", 1, 0, 1, 0.0001); position = hslider("position", 1, 0, channels, 1); rate = ma.SR/1000.0; rndctrl = (no.lfnoise(rate) * (channels + 1)) * focus : ma.fabs + position : int ; outputctrl = rndctrl : ba.sAndH(imp); n = no.multinoise(8) : par(i, 8, _ * env * 0.1); filt = fi.resonbp(frq, q, gain) with { frq = hslider("freq", 200, 50, 5000, 0.1); q = hslider("q", 1, 0.01, 10, 0.01); gain = hslider("gain", 0, 0, 2, 0.00001); }; ch_wrapped = ma.modulo(outputctrl, channels); process = n : par(i, 8, filt);
c1b07341ec500f0c4cfeedb9211871ffc5c7115df583b736404368e8fdc9c664
chmaha/Enover
enover.dsp
declare name "Enover"; declare description "A feedback-delay-network reverb"; declare author "Julius O. Smith III, Christopher Arndt, chmaha"; declare copyright "Copyright (C) 2003-2019 by Julius O. Smith III <[email protected]>"; declare license "GPLv3"; declare version "0.1.0"; import("stdfaust.lib"); zita_rev1 = _,_ <: re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ : out_eq,_,_ : dry_wet : out_level with{ fsmax = 48000.0; // highest sampling rate that will be used fdn_group(x) = hgroup( "[0] Zita_Rev1 [tooltip: ~ ZITA REV1 FEEDBACK DELAY NETWORK (FDN) & SCHROEDER ALLPASS-COMB REVERBERATOR (8x8). See Faust's reverbs.lib for documentation and references]", x); in_group(x) = fdn_group(hgroup("[1] Input", x)); rdel = in_group(vslider("[1] Initial Delay [unit:ms] [style:knob] [tooltip: Delay in ms before reverberation begins]",40,20,100,1)); freq_group(x) = fdn_group(hgroup("[2] Decay Times in Bands (see tooltips)", x)); f1 = freq_group(vslider("[1] LowFreq X [unit:Hz] [style:knob] [scale:log] [tooltip: Crossover frequency (Hz) separating low and middle frequencies]", 250, 50, 1000, 1)); t60dc = freq_group(vslider("[2] Bass Mult [unit:x] [style:knob] [scale:log] [style:knob] [tooltip: Bass Mult = Low Decay is equal to Mid Decay x Low Mult]", 1.5, 0.5, 2, 0.1)) * t60m; t60m = freq_group(vslider("[3] Mid Decay [unit:s] [style:knob] [scale:log] [tooltip: T60 = time (in seconds) to decay 60dB in middle band]",2, 1, 8, 0.1)); f2 = freq_group(vslider("[4] HF Damping [unit:Hz] [style:knob] [scale:log] [tooltip: Frequency (Hz) at which the high-frequency T60 is half the middle-band's T60]", 3000, 1500, 0.49*fsmax, 1)); out_eq = pareq_stereo(eq1f,eq1l,eq1q) : pareq_stereo(eq2f,eq2l,eq2q); // Zolzer style peaking eq (not used in zita-rev1) (filters.lib): // pareq_stereo(eqf,eql,Q) = peak_eq(eql,eqf,eqf/Q), peak_eq(eql,eqf,eqf/Q); // Regalia-Mitra peaking eq with "Q" hard-wired near sqrt(g)/2 (filters.lib): pareq_stereo(eqf,eql,Q) = fi.peak_eq_rm(eql,eqf,tpbt), fi.peak_eq_rm(eql,eqf,tpbt) with { tpbt = wcT/sqrt(max(0,g)); // tan(PI*B/SR), B bw in Hz (Q^2 ~ g/4) wcT = 2*ma.PI*eqf/ma.SR; // peak frequency in rad/sample g = ba.db2linear(eql); // peak gain }; eq1_group(x) = fdn_group(hgroup("[3] RM Peaking Equalizer 1", x)); eq1f = 315; eq1l = 0; eq1q = 3; eq2_group(x) = fdn_group(hgroup("[4] RM Peaking Equalizer 2", x)); eq2f = 1500; eq2l = 0; eq2q = 3; out_group(x) = fdn_group(hgroup("[5] Output", x)); dry_wet(x,y) = *(wet) + dry*x, *(wet) + dry*y with { wet = 0.5*(drywet+1.0); dry = 1.0-wet; }; drywet = out_group(vslider("[1] Wet/Dry Mix [style:knob] [tooltip: -1 = dry, 1 = wet]", 0, -1.0, 1.0, 0.01)) : si.smoo; out_level = *(gain),*(gain); gain = out_group(vslider("[2] Level [unit:dB] [style:knob] [tooltip: Output scale factor]", 0, -20, 20, 0.1)) : ba.db2linear : si.smoo; }; process = _,_ : zita_rev1 : _,_;
https://raw.githubusercontent.com/chmaha/Enover/fc8f665d2d4b627e4196437d068fe0050deadf87/faust/enover.dsp
faust
highest sampling rate that will be used Zolzer style peaking eq (not used in zita-rev1) (filters.lib): pareq_stereo(eqf,eql,Q) = peak_eq(eql,eqf,eqf/Q), peak_eq(eql,eqf,eqf/Q); Regalia-Mitra peaking eq with "Q" hard-wired near sqrt(g)/2 (filters.lib): tan(PI*B/SR), B bw in Hz (Q^2 ~ g/4) peak frequency in rad/sample peak gain
declare name "Enover"; declare description "A feedback-delay-network reverb"; declare author "Julius O. Smith III, Christopher Arndt, chmaha"; declare copyright "Copyright (C) 2003-2019 by Julius O. Smith III <[email protected]>"; declare license "GPLv3"; declare version "0.1.0"; import("stdfaust.lib"); zita_rev1 = _,_ <: re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ : out_eq,_,_ : dry_wet : out_level with{ fdn_group(x) = hgroup( "[0] Zita_Rev1 [tooltip: ~ ZITA REV1 FEEDBACK DELAY NETWORK (FDN) & SCHROEDER ALLPASS-COMB REVERBERATOR (8x8). See Faust's reverbs.lib for documentation and references]", x); in_group(x) = fdn_group(hgroup("[1] Input", x)); rdel = in_group(vslider("[1] Initial Delay [unit:ms] [style:knob] [tooltip: Delay in ms before reverberation begins]",40,20,100,1)); freq_group(x) = fdn_group(hgroup("[2] Decay Times in Bands (see tooltips)", x)); f1 = freq_group(vslider("[1] LowFreq X [unit:Hz] [style:knob] [scale:log] [tooltip: Crossover frequency (Hz) separating low and middle frequencies]", 250, 50, 1000, 1)); t60dc = freq_group(vslider("[2] Bass Mult [unit:x] [style:knob] [scale:log] [style:knob] [tooltip: Bass Mult = Low Decay is equal to Mid Decay x Low Mult]", 1.5, 0.5, 2, 0.1)) * t60m; t60m = freq_group(vslider("[3] Mid Decay [unit:s] [style:knob] [scale:log] [tooltip: T60 = time (in seconds) to decay 60dB in middle band]",2, 1, 8, 0.1)); f2 = freq_group(vslider("[4] HF Damping [unit:Hz] [style:knob] [scale:log] [tooltip: Frequency (Hz) at which the high-frequency T60 is half the middle-band's T60]", 3000, 1500, 0.49*fsmax, 1)); out_eq = pareq_stereo(eq1f,eq1l,eq1q) : pareq_stereo(eq2f,eq2l,eq2q); pareq_stereo(eqf,eql,Q) = fi.peak_eq_rm(eql,eqf,tpbt), fi.peak_eq_rm(eql,eqf,tpbt) with { }; eq1_group(x) = fdn_group(hgroup("[3] RM Peaking Equalizer 1", x)); eq1f = 315; eq1l = 0; eq1q = 3; eq2_group(x) = fdn_group(hgroup("[4] RM Peaking Equalizer 2", x)); eq2f = 1500; eq2l = 0; eq2q = 3; out_group(x) = fdn_group(hgroup("[5] Output", x)); dry_wet(x,y) = *(wet) + dry*x, *(wet) + dry*y with { wet = 0.5*(drywet+1.0); dry = 1.0-wet; }; drywet = out_group(vslider("[1] Wet/Dry Mix [style:knob] [tooltip: -1 = dry, 1 = wet]", 0, -1.0, 1.0, 0.01)) : si.smoo; out_level = *(gain),*(gain); gain = out_group(vslider("[2] Level [unit:dB] [style:knob] [tooltip: Output scale factor]", 0, -20, 20, 0.1)) : ba.db2linear : si.smoo; }; process = _,_ : zita_rev1 : _,_;
9de4496beaa05d32e41227c23d2b6dcdf5a60f807118f73be82029d545419587
rottingsounds/bitDSP-faust
boolOsc0.dsp
declare name "boolOsc0"; declare description "bool_osc_0 - example"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); // SuperCollider // CXXFLAGS="-I ../../../../include" faust2supercollider -I ../../lib -noprefix boolOsc0.dsp // plot // CXXFLAGS="-I ../include" faust2csvplot -I ../lib boolOsc0.dsp // ./boolOsc0 -n 10 // compile // CXXFLAGS="-I ../../../include" faust2caqt -I ../lib boolOsc0.dsp // ./boolOsc0 dt1 = int(hslider("dt1",0,0,1,0) * ma.SR); dt2 = int(hslider("dt2",0,0,1,0) * ma.SR); dt3 = int(hslider("dt3",0,0,1,0) * ma.SR); dt4 = int(hslider("dt4",0,0,1,0) * ma.SR); // mono out process = bit.bool_osc0(dt1, dt2, dt3, dt4);
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/21cf36105c55b6e18969a867a319530a0ef1ea63/examples/_sc/boolOsc0.dsp
faust
SuperCollider CXXFLAGS="-I ../../../../include" faust2supercollider -I ../../lib -noprefix boolOsc0.dsp plot CXXFLAGS="-I ../include" faust2csvplot -I ../lib boolOsc0.dsp ./boolOsc0 -n 10 compile CXXFLAGS="-I ../../../include" faust2caqt -I ../lib boolOsc0.dsp ./boolOsc0 mono out
declare name "boolOsc0"; declare description "bool_osc_0 - example"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); dt1 = int(hslider("dt1",0,0,1,0) * ma.SR); dt2 = int(hslider("dt2",0,0,1,0) * ma.SR); dt3 = int(hslider("dt3",0,0,1,0) * ma.SR); dt4 = int(hslider("dt4",0,0,1,0) * ma.SR); process = bit.bool_osc0(dt1, dt2, dt3, dt4);
6f83840bb923386cdaebd2bad7ddc6d6d0790f63d05bf33ae3115396cab6ea8a
rottingsounds/BoolOscFB1
BoolOscFB1.dsp
declare name "BoolOscFB1"; declare description "bool_osc FB alternative 1"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); // bit = library("bitDSP.lib"); // SuperCollider // CXXFLAGS="-I ../../../../include" faust2supercollider -I ../../lib -noprefix BoolOscFB1.dsp // plot // CXXFLAGS="-I ../include" faust2csvplot -I ../lib boolOsc_fb.dsp // ./boolOsc_fb -n 10 // compile // CXXFLAGS="-I ../../../include" faust2caqt -I ../lib boolOsc_fb.dsp // ./boolOsc_fb // bool_osc1_mod(del1, del2) = node1 letrec { // 'node1 = not(node1 xor node2 & node1) @ min(maxDel,(del1 % maxDel)); // 'node2 = not(node2 xor node1 xor node2) @ min(maxDel,(del2 % maxDel)); // }; // bool_osc2_mod(del1, del2) = node1 letrec { // 'node1 = not(node1 & node2) @ min(maxDel,(del1 % maxDel)); // 'node2 = not(node1 & node2) @ min(maxDel,(del2 % maxDel)); // }; bool_osc1_mod(d1, d2) = node1 letrec { 'node1 = delay(d1, not(node1 xor node2 & node1)); 'node2 = delay(d2, not(node2 xor node1 xor node2)); }; bool_osc2_mod(d1, d2) = node1 letrec { 'node1 = delay(d1, not(node1 & node2)); 'node2 = delay(d2, not(node1 & node2)); }; delay(d, x) = de.delay(maxDel, (d % maxDel), x); not(x) = rint(1 - x); maxDel = ma.SR / 4; oscfb1(leakcoef, bias1, bias2, mod1, mod2) = loop ~ _ with { loop(fb) = bool_osc1_mod( (fb : map(bias1, mod2)), (fb : map(bias2, mod1)) ) : leakdc(leakcoef); }; oscfb2(leakcoef, bias1, bias2, mod1, mod2) = loop ~ _ with { loop(fb) = bool_osc2_mod( (fb : map(bias1, mod1)), (fb : map(bias2, mod2)) ) : leakdc(leakcoef); }; map(bias, scale, in) = max(0, (bias * biasfac) + (scale * in * modfac)) with { biasfac = 15000; modfac = 15000; }; // sc-like leakdc leakdc(coef, x) = y letrec { 'y = x - x' + coef * y; }; // MS processor // ms(x, y, width) = (x + y) * 0.5, (x-y) * 0.5 * width; ms(1, midIn, sideIn) = (midIn + sideIn) * 0.5, (midIn-sideIn) * 0.5; ms(width, midIn, sideIn) = (mid + side) * 0.5, (mid-side) * 0.5 with { mid = midIn; side = sideIn * width; }; rotate2(r, x, y) = xout, yout with { xout = cos(r) * x + sin(r) * y; yout = cos(r) * y - sin(r) * x; }; // stereo out process = ( oscfb1(leakcoef, bias1, bias2, mod1, mod2), oscfb2(leakcoef, bias1, bias2, mod1, mod2) ) : leakDC : rotate2(rot) : ms(1) : ms(width) : vca(distort) : tanh : vca(amp) : fi.lowpass(lporder, lpfreq), fi.lowpass(lporder, lpfreq) // <: si.bus(2) with { mod1 = hslider("[01]mod1[scale:exp]", 0.0001, 0.0001, 1, 0.00001) : si.smoo; mod2 = hslider("[02]mod2[scale:exp]", 0.0001, 0.0001, 1, 0.00001) : si.smoo; bias1 = hslider("[03]bias1[scale:exp]", 0.0001, 0.0001, 1, 0.00001) : si.smoo; bias2 = hslider("[04]bias2[scale:exp]", 0.0001, 0.0001, 1, 0.00001) : si.smoo; leak = hslider("[05]leak", 0.01, 0, 1, 0.0001) : si.smoo; leakcoef = 1 - (leak * 0.001); distort = hslider("[06]distort[scale:exp]", 1, 1, 10, 0.001) : si.smoo; amp = hslider("[07]amp", 0.5, 0, 1, 0.001) : si.smoo; width = hslider("[08]width", 1, 0, 1, 0.001) : si.smoo; rot = hslider("[09]rot", 0.25, 0, 1, 0.001) : si.smoo * ma.PI; lpfreq = hslider("[10]lpfreq[scale:exp]", 10000, 10, 20000, 1) : si.smoo; lporder = 4; tanh = ma.tanh(_), ma.tanh(_); leakDC = leakdc(0.999), leakdc(0.999); vca(amp) = _ * amp, _ * amp; };
https://raw.githubusercontent.com/rottingsounds/BoolOscFB1/b6e58251575b296268d16c2f0c48256137f4f35c/faust/BoolOscFB1.dsp
faust
bit = library("bitDSP.lib"); SuperCollider CXXFLAGS="-I ../../../../include" faust2supercollider -I ../../lib -noprefix BoolOscFB1.dsp plot CXXFLAGS="-I ../include" faust2csvplot -I ../lib boolOsc_fb.dsp ./boolOsc_fb -n 10 compile CXXFLAGS="-I ../../../include" faust2caqt -I ../lib boolOsc_fb.dsp ./boolOsc_fb bool_osc1_mod(del1, del2) = node1 letrec { 'node1 = not(node1 xor node2 & node1) @ min(maxDel,(del1 % maxDel)); 'node2 = not(node2 xor node1 xor node2) @ min(maxDel,(del2 % maxDel)); }; bool_osc2_mod(del1, del2) = node1 letrec { 'node1 = not(node1 & node2) @ min(maxDel,(del1 % maxDel)); 'node2 = not(node1 & node2) @ min(maxDel,(del2 % maxDel)); }; sc-like leakdc MS processor ms(x, y, width) = (x + y) * 0.5, (x-y) * 0.5 * width; stereo out <: si.bus(2)
declare name "BoolOscFB1"; declare description "bool_osc FB alternative 1"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bool_osc1_mod(d1, d2) = node1 letrec { 'node1 = delay(d1, not(node1 xor node2 & node1)); 'node2 = delay(d2, not(node2 xor node1 xor node2)); }; bool_osc2_mod(d1, d2) = node1 letrec { 'node1 = delay(d1, not(node1 & node2)); 'node2 = delay(d2, not(node1 & node2)); }; delay(d, x) = de.delay(maxDel, (d % maxDel), x); not(x) = rint(1 - x); maxDel = ma.SR / 4; oscfb1(leakcoef, bias1, bias2, mod1, mod2) = loop ~ _ with { loop(fb) = bool_osc1_mod( (fb : map(bias1, mod2)), (fb : map(bias2, mod1)) ) : leakdc(leakcoef); }; oscfb2(leakcoef, bias1, bias2, mod1, mod2) = loop ~ _ with { loop(fb) = bool_osc2_mod( (fb : map(bias1, mod1)), (fb : map(bias2, mod2)) ) : leakdc(leakcoef); }; map(bias, scale, in) = max(0, (bias * biasfac) + (scale * in * modfac)) with { biasfac = 15000; modfac = 15000; }; leakdc(coef, x) = y letrec { 'y = x - x' + coef * y; }; ms(1, midIn, sideIn) = (midIn + sideIn) * 0.5, (midIn-sideIn) * 0.5; ms(width, midIn, sideIn) = (mid + side) * 0.5, (mid-side) * 0.5 with { mid = midIn; side = sideIn * width; }; rotate2(r, x, y) = xout, yout with { xout = cos(r) * x + sin(r) * y; yout = cos(r) * y - sin(r) * x; }; process = ( oscfb1(leakcoef, bias1, bias2, mod1, mod2), oscfb2(leakcoef, bias1, bias2, mod1, mod2) ) : leakDC : rotate2(rot) : ms(1) : ms(width) : vca(distort) : tanh : vca(amp) : fi.lowpass(lporder, lpfreq), fi.lowpass(lporder, lpfreq) with { mod1 = hslider("[01]mod1[scale:exp]", 0.0001, 0.0001, 1, 0.00001) : si.smoo; mod2 = hslider("[02]mod2[scale:exp]", 0.0001, 0.0001, 1, 0.00001) : si.smoo; bias1 = hslider("[03]bias1[scale:exp]", 0.0001, 0.0001, 1, 0.00001) : si.smoo; bias2 = hslider("[04]bias2[scale:exp]", 0.0001, 0.0001, 1, 0.00001) : si.smoo; leak = hslider("[05]leak", 0.01, 0, 1, 0.0001) : si.smoo; leakcoef = 1 - (leak * 0.001); distort = hslider("[06]distort[scale:exp]", 1, 1, 10, 0.001) : si.smoo; amp = hslider("[07]amp", 0.5, 0, 1, 0.001) : si.smoo; width = hslider("[08]width", 1, 0, 1, 0.001) : si.smoo; rot = hslider("[09]rot", 0.25, 0, 1, 0.001) : si.smoo * ma.PI; lpfreq = hslider("[10]lpfreq[scale:exp]", 10000, 10, 20000, 1) : si.smoo; lporder = 4; tanh = ma.tanh(_), ma.tanh(_); leakDC = leakdc(0.999), leakdc(0.999); vca(amp) = _ * amp, _ * amp; };
c666d59a4e2cbebe49201f297fbc4f4dbaa8162cf5ca885423c60a3acaa76431
LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust
1.01_Wavetable_Realtime_Recorder.dsp
// --------------------------------------------------------------------------------- declare name "Realtime Recorder"; declare version "1.0"; declare author "Luca Spanedda"; /* Oscillator from wave-table recording */ // import Standard Faust library // https://github.com/grame-cncm/faustlibraries/ import("stdfaust.lib"); // GUI freqgui = hslider("[1] Frequency",1,0,2,0.001) : si.smoo; ampgui = hslider("[2] Amp",1,0,2,0.001) : si.smoo; buttongui = button("[0] Rec"); // WAVETABLE RECORDER looptable(recstart,freq) = _*buttongui : rwtable(dimension,0.0,indexwrite,_,indexread) with{ offset = 2 : int; // Offset for write and read. For point the write index at 0 when stopped. record = recstart : int; // record the memory with the int value of 1 dimension = 1024+offset : int; // dimension in samples the memory table decimal(x)= x-int(x); // rescale the int (for the phasor) phasor = ((ma.SR/dimension)/ma.SR)*freq : (+ : decimal)~ _; // phasor from 0 to 1 indexwrite = ((phasor*recstart)*(dimension-offset)):_+offset*recstart :int; // write the input indexread = ((phasor)*(dimension-offset)):_+offset :int; // read the written signal+offset }; wavetable = _ : looptable(buttongui,freqgui)*ampgui; // routing of the GUI process = wavetable <: _,_; // ---------------------------------------------------------------------------------
https://raw.githubusercontent.com/LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust/bb01eff05a51424c16420a00b383441d8973d85e/0_work-in-progress/1.01_Wavetable_Realtime_Recorder.dsp
faust
--------------------------------------------------------------------------------- Oscillator from wave-table recording import Standard Faust library https://github.com/grame-cncm/faustlibraries/ GUI WAVETABLE RECORDER Offset for write and read. For point the write index at 0 when stopped. record the memory with the int value of 1 dimension in samples the memory table rescale the int (for the phasor) phasor from 0 to 1 write the input read the written signal+offset routing of the GUI ---------------------------------------------------------------------------------
declare name "Realtime Recorder"; declare version "1.0"; declare author "Luca Spanedda"; import("stdfaust.lib"); freqgui = hslider("[1] Frequency",1,0,2,0.001) : si.smoo; ampgui = hslider("[2] Amp",1,0,2,0.001) : si.smoo; buttongui = button("[0] Rec"); looptable(recstart,freq) = _*buttongui : rwtable(dimension,0.0,indexwrite,_,indexread) with{ }; process = wavetable <: _,_;
c740113e345c994aa96285975cbd9788530fd8f2a9594799a897d55555bce826
inria-emeraude/syfala
lms_live.dsp
declare name "Least Mean Square Algorithm"; declare version "1.0"; declare author "Pierre Lecomte"; declare author "Loic Alexandre"; declare license "CC-BY-NC-SA-4.0"; import("stdfaust.lib"); N = 5; // Number of coefficients (should be >= 200 to identify a system with narrow frequency band) coeffs = si.bus(N); y = _; // y = x*[room impulse response] h_hat(N) = (si.bus(N),(_<:(si.bus(N)))):ro.interleave(N,2):sum(i, N, (_,@(i):*)); // Adapted filter y_hat(N) = ((si.bus(N)<:si.bus(2*N)),_):(si.bus(N),h_hat(N)); // Output from the adapted system buffer = _<:par(i,N,@(i)); // To obtain x_n, the reference signal at time n filter_freq = fi.lowpass(4,800); // Lowpass filter for frequency band reduction signal = no.noise; // Excitation signal x = (signal:_<:(_,_,_)); // Reference signal in = _,x:ro.crossn1(3); // Inputs including the external microphone signal and the reference signal mu = -0.0001; // Convergence coefficient (smaller for slower convergence) // Input = microphone signal whichcorresponds to the target system ouput y // Output 0 = x (white noise signal) // Output 1 = error signal (y - y_hat) process = ((coeffs,in):(y_hat(N),y,_,_):(coeffs,(-<:(_,_*mu)),buffer,_):(coeffs,_,(_<:si.bus(N)),coeffs,_):(coeffs,_,ro.interleave(N,2),_):(coeffs,_,par(i,N,*),_):(coeffs,ro.cross1n(N),_):(ro.interleave(N,2),_,_):(par(i,N,+),_,_))~si.bus(N):(par(i,N,!),ro.cross(2));
https://raw.githubusercontent.com/inria-emeraude/syfala/95ed6765d73520362f6a1ad35e4a3b2a5e16fbc9/examples/lms_live.dsp
faust
Number of coefficients (should be >= 200 to identify a system with narrow frequency band) y = x*[room impulse response] Adapted filter Output from the adapted system To obtain x_n, the reference signal at time n Lowpass filter for frequency band reduction Excitation signal Reference signal Inputs including the external microphone signal and the reference signal Convergence coefficient (smaller for slower convergence) Input = microphone signal whichcorresponds to the target system ouput y Output 0 = x (white noise signal) Output 1 = error signal (y - y_hat)
declare name "Least Mean Square Algorithm"; declare version "1.0"; declare author "Pierre Lecomte"; declare author "Loic Alexandre"; declare license "CC-BY-NC-SA-4.0"; import("stdfaust.lib"); coeffs = si.bus(N); process = ((coeffs,in):(y_hat(N),y,_,_):(coeffs,(-<:(_,_*mu)),buffer,_):(coeffs,_,(_<:si.bus(N)),coeffs,_):(coeffs,_,ro.interleave(N,2),_):(coeffs,_,par(i,N,*),_):(coeffs,ro.cross1n(N),_):(ro.interleave(N,2),_,_):(par(i,N,+),_,_))~si.bus(N):(par(i,N,!),ro.cross(2));
2b9e7139d114887475436b633e726dca09e08fbcc5cfccb3622088001e0d8ea6
s-e-a-m/faust-libraries
lr2bfmt.dsp
declare name "MICHAEL GERZON STEREO TO BFORMAT ENCODER"; declare version "001"; declare author "Giuseppe Silvi"; declare license "GNU-GPL-v3"; declare copyright "(c)SEAM 2019"; declare description "MICHAEL GERZON STEREO TO BFORMAT ENCODER"; import("stdfaust.lib"); import("../../seam.lib"); // LS and RS are dead channels to create VST routing consistency // lr2bfmt(L,R,LR,RS) = W,X,Y,Z // with{ // azi = 45.0 : deg2rad; // elv = 00.0 : deg2rad; // // WL = L * 0.707; // XL = L * cos(azi) * cos(elv); // YL = L * sin(azi) * cos(elv); // ZL = L * sin(elv); // // WR = R * 0.707; // XR = R * cos(-azi) * cos(elv); // YR = R * sin(-azi) * cos(elv); // ZR = R * sin(elv); // // W = 0.707 * (WL + WR); // X = 0.707 * (XL + XR); // Y = 0.707 * (YL + YR); // Z = 0.707 * (ZL + ZR); // }; process = lrms2bfmt;
https://raw.githubusercontent.com/s-e-a-m/faust-libraries/9120cccb9335f42407062eb4bf149188d8018b07/examples/vst/lr2bfmt.dsp
faust
LS and RS are dead channels to create VST routing consistency lr2bfmt(L,R,LR,RS) = W,X,Y,Z with{ azi = 45.0 : deg2rad; elv = 00.0 : deg2rad; WL = L * 0.707; XL = L * cos(azi) * cos(elv); YL = L * sin(azi) * cos(elv); ZL = L * sin(elv); WR = R * 0.707; XR = R * cos(-azi) * cos(elv); YR = R * sin(-azi) * cos(elv); ZR = R * sin(elv); W = 0.707 * (WL + WR); X = 0.707 * (XL + XR); Y = 0.707 * (YL + YR); Z = 0.707 * (ZL + ZR); };
declare name "MICHAEL GERZON STEREO TO BFORMAT ENCODER"; declare version "001"; declare author "Giuseppe Silvi"; declare license "GNU-GPL-v3"; declare copyright "(c)SEAM 2019"; declare description "MICHAEL GERZON STEREO TO BFORMAT ENCODER"; import("stdfaust.lib"); import("../../seam.lib"); process = lrms2bfmt;
a7d0f33e6af3129c2bdc757b0f79228b48db5ce4576bb27bc65967287a109a9c
sonosaurus/sonobus
compressjlc.dsp
//----------------------------`(dm.)compressor_demo`------------------------- // Compressor demo application. // // #### Usage // // ``` // _,_ : compressor_demo : _,_; // ``` //------------------------------------------------------------ declare name "compressor"; declare version "0.0"; declare author "JOS, revised by RM"; declare description "Compressor demo application"; import("stdfaust.lib"); compressorjlc_demo = ba.bypass2(cbp,compressor_stereo_demo) with{ main_group(x) = vgroup("compressor [tooltip: Reference: http://en.wikipedia.org/wiki/Dynamic_range_compression]", x); comp_group(x) = main_group(hgroup("[0] comp", x)); env_group(x) = main_group(hgroup("[1] env", x)); gain_group(x) = main_group(hgroup("[2] gain", x)); cbp = main_group(checkbox("[0] Bypass [tooltip: When this is checked, the compressor has no effect]")); //gainview = co.compression_gain_mono(ratio,threshold,attack,release) : gainview = co.compression_gain_mono(ratio,threshold,attack,release) : ba.linear2db : gain_group(hbargraph("[1] outgain [unit:db] [tooltip: Current gain of the compressor in linear gain]",0,2.0)) ; displaygain = _,_ <: _,_,(abs,abs:+) : _,_,gainview : _,attach; compressor_stereo_demo = displaygain(co.compressor_stereo(ratio,threshold,attack,release)) : *(makeupgain) , *(makeupgain); //ctl_group(x) = knob_group(hgroup("[3] Compression Control", x)); ratio = comp_group(hslider("[1] ratio [style:knob] [tooltip: A compression Ratio of N means that for each N dB increase in input signal level above Threshold, the output level goes up 1 dB]", 5, 1, 20, 0.1)); threshold = comp_group(hslider("[0] threshold [unit:dB] [style:knob] [tooltip: When the signal level exceeds the Threshold (in dB), its level is compressed according to the Ratio]", -30, -100, 10, 0.1)); // env_group(x) = knob_group(hgroup("[4] Compression Response", x)); attack = env_group(hslider("[0] attack [unit:sec] [style:knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new lower target level (the compression `kicking in')]", 50, 1, 1000, 0.1)) : max(1/ma.SR); release = env_group(hslider("[1] release [unit:sec] [style: knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new higher target level (the compression 'releasing')]", 500, 1, 1000, 0.1)) : max(1/ma.SR); makeupgain = gain_group(hslider("[0] makeup gain [unit:dB] [tooltip: The compressed-signal output level is increased by this amount (in dB) to make up for the level lost due to compression]", 40, -96, 96, 0.1)) : ba.db2linear : si.smoo; }; process = compressorjlc_demo;
https://raw.githubusercontent.com/sonosaurus/sonobus/52cb09f046b94ba2d5d9d47e85c8d9789d86c96e/scripts/compressjlc.dsp
faust
----------------------------`(dm.)compressor_demo`------------------------- Compressor demo application. #### Usage ``` _,_ : compressor_demo : _,_; ``` ------------------------------------------------------------ en.wikipedia.org/wiki/Dynamic_range_compression]", x); gainview = co.compression_gain_mono(ratio,threshold,attack,release) : ctl_group(x) = knob_group(hgroup("[3] Compression Control", x)); env_group(x) = knob_group(hgroup("[4] Compression Response", x));
declare name "compressor"; declare version "0.0"; declare author "JOS, revised by RM"; declare description "Compressor demo application"; import("stdfaust.lib"); compressorjlc_demo = ba.bypass2(cbp,compressor_stereo_demo) with{ main_group(x) = vgroup("compressor [tooltip: Reference: comp_group(x) = main_group(hgroup("[0] comp", x)); env_group(x) = main_group(hgroup("[1] env", x)); gain_group(x) = main_group(hgroup("[2] gain", x)); cbp = main_group(checkbox("[0] Bypass [tooltip: When this is checked, the compressor has no effect]")); gainview = co.compression_gain_mono(ratio,threshold,attack,release) : ba.linear2db : gain_group(hbargraph("[1] outgain [unit:db] [tooltip: Current gain of the compressor in linear gain]",0,2.0)) ; displaygain = _,_ <: _,_,(abs,abs:+) : _,_,gainview : _,attach; compressor_stereo_demo = displaygain(co.compressor_stereo(ratio,threshold,attack,release)) : *(makeupgain) , *(makeupgain); ratio = comp_group(hslider("[1] ratio [style:knob] [tooltip: A compression Ratio of N means that for each N dB increase in input signal level above Threshold, the output level goes up 1 dB]", 5, 1, 20, 0.1)); threshold = comp_group(hslider("[0] threshold [unit:dB] [style:knob] [tooltip: When the signal level exceeds the Threshold (in dB), its level is compressed according to the Ratio]", -30, -100, 10, 0.1)); attack = env_group(hslider("[0] attack [unit:sec] [style:knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new lower target level (the compression `kicking in')]", 50, 1, 1000, 0.1)) : max(1/ma.SR); release = env_group(hslider("[1] release [unit:sec] [style: knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new higher target level (the compression 'releasing')]", 500, 1, 1000, 0.1)) : max(1/ma.SR); makeupgain = gain_group(hslider("[0] makeup gain [unit:dB] [tooltip: The compressed-signal output level is increased by this amount (in dB) to make up for the level lost due to compression]", 40, -96, 96, 0.1)) : ba.db2linear : si.smoo; }; process = compressorjlc_demo;
ad0c9caa8b6ac986ac12ae675e4fbc8a664b2fcab3572d26c6464e306da665ca
jpecquais/faustLab
jlpCompressor.dsp
import("lib/jlpLibs.lib"); import("stdfaust.lib"); declare name "Compressor"; declare author "Jean-Loup Pecquais"; declare version "1.00"; declare license "GPL3"; // TODO : TO BE IMPLEMENTED IN A PROPER LIB delay(time) = @(max(0,floor(0.5+ma.SR*time))); //TODO : FORCE FEEDFORWARD WHEN LAH IS ON comp_BigBrother_nCh(strength,thresh,att,rel,hld,rms,knee,lad,link,FBFF,meter,N) = si.bus(N) <: si.bus(N*2): ( ( ( (ro.interleave(N,2):par(i, N*2, abs) :par(i, N, it.interpolate_linear(FBFF)) : jlpDyn.comp_genericGainComputer_nCh(strength*(1+(((FBFF*-1)+1)*1)),thresh,att,rel,hld,rms,knee,link,N)) ,si.bus(N) ) :(ro.interleave(N,2):par(i,N,meter*@(max(0,floor(0.5+ma.SR*lad))))) )~si.bus(N) ); comp_HybridComp_nCh(strength,thresh,att,rel,hld,rms,knee,lad,link,FBFF,meter,N) = si.bus(N) <: si.bus(N*2) : ( ( (( (jlpDyn.comp_genericGainComputer_nCh(strength,thresh,att,rel,hld,0.005,knee,0,N),jlpDyn.comp_genericGainComputer_nCh(strength,thresh,att,rel,hld,rms,knee,link,N)) : ro.interleave(N,2) : par(i, N, it.interpolate_linear(FBFF))),si.bus(N)) : (ro.interleave(N,2) : par(i,N,meter*delay(lad))) )~si.bus(N) ); comp_HybridComp_nCh2(strength,thresh,att,rel,hld,rms,knee,lad,link,FBFF,meter,N) = si.bus(N) <: si.bus(N*2) : ((si.bus(N) <: si.bus(N*2)),(jlpDyn.crestFactorComputer_nCh(rms,link,N))):(si.bus(N*2),si.block(N)) : ( ( (( (jlpDyn.comp_genericGainComputer_nCh(strength,thresh,att,rel,hld,0.005,knee,0,N),jlpDyn.comp_genericGainComputer_nCh(strength,thresh,att,rel,hld,rms,knee,link,N)) : ro.interleave(N,2) : par(i, N, it.interpolate_linear(FBFF))),si.bus(N)) : (ro.interleave(N,2) : par(i,N,meter*delay(lad))) )~si.bus(N) ); process = comp_HybridComp_nCh(strength,thresh,att,rel,hld,rms,knee,lad,0,1,meter,1) //process = jlpDyn.crestFactorComputer_nCh(1,0,0,2) with{ strength = hslider("Strenght", 0, 0, 1, 0.01); thresh = hslider("Threshold", 0, -96, 0, 0.1); att = hslider("Attack", 0, 0, 120, 0.1)/1000; rel = hslider("Release", 0, 0, 3000, 0.1)/1000; hld = hslider("Hold", 0, 0, 3000, 0.1)/1000; rms = hslider("RMS Size", 0, 0, 3000, 0.1)/1000; knee = hslider("Knee", 0, 0, 24, 0.1); lad = ba.if(checkbox("Perfect attack"),att, 0);//hslider("Look Ahead", 0, 0, 120, 0.1); meter = _<:(_, (ba.linear2db:max(maxGR):(hbargraph("GainReduction[1][unit:dB][tooltip: gain reduction in dB]", maxGR, 0)))):attach; maxGR = 0; };
https://raw.githubusercontent.com/jpecquais/faustLab/822700f7f05a3a033f22bc3eaebd3640904ab703/dsp/Dynamic/jlpCompressor.dsp
faust
TODO : TO BE IMPLEMENTED IN A PROPER LIB TODO : FORCE FEEDFORWARD WHEN LAH IS ON process = jlpDyn.crestFactorComputer_nCh(1,0,0,2) hslider("Look Ahead", 0, 0, 120, 0.1);
import("lib/jlpLibs.lib"); import("stdfaust.lib"); declare name "Compressor"; declare author "Jean-Loup Pecquais"; declare version "1.00"; declare license "GPL3"; delay(time) = @(max(0,floor(0.5+ma.SR*time))); comp_BigBrother_nCh(strength,thresh,att,rel,hld,rms,knee,lad,link,FBFF,meter,N) = si.bus(N) <: si.bus(N*2): ( ( ( (ro.interleave(N,2):par(i, N*2, abs) :par(i, N, it.interpolate_linear(FBFF)) : jlpDyn.comp_genericGainComputer_nCh(strength*(1+(((FBFF*-1)+1)*1)),thresh,att,rel,hld,rms,knee,link,N)) ,si.bus(N) ) :(ro.interleave(N,2):par(i,N,meter*@(max(0,floor(0.5+ma.SR*lad))))) )~si.bus(N) ); comp_HybridComp_nCh(strength,thresh,att,rel,hld,rms,knee,lad,link,FBFF,meter,N) = si.bus(N) <: si.bus(N*2) : ( ( (( (jlpDyn.comp_genericGainComputer_nCh(strength,thresh,att,rel,hld,0.005,knee,0,N),jlpDyn.comp_genericGainComputer_nCh(strength,thresh,att,rel,hld,rms,knee,link,N)) : ro.interleave(N,2) : par(i, N, it.interpolate_linear(FBFF))),si.bus(N)) : (ro.interleave(N,2) : par(i,N,meter*delay(lad))) )~si.bus(N) ); comp_HybridComp_nCh2(strength,thresh,att,rel,hld,rms,knee,lad,link,FBFF,meter,N) = si.bus(N) <: si.bus(N*2) : ((si.bus(N) <: si.bus(N*2)),(jlpDyn.crestFactorComputer_nCh(rms,link,N))):(si.bus(N*2),si.block(N)) : ( ( (( (jlpDyn.comp_genericGainComputer_nCh(strength,thresh,att,rel,hld,0.005,knee,0,N),jlpDyn.comp_genericGainComputer_nCh(strength,thresh,att,rel,hld,rms,knee,link,N)) : ro.interleave(N,2) : par(i, N, it.interpolate_linear(FBFF))),si.bus(N)) : (ro.interleave(N,2) : par(i,N,meter*delay(lad))) )~si.bus(N) ); process = comp_HybridComp_nCh(strength,thresh,att,rel,hld,rms,knee,lad,0,1,meter,1) with{ strength = hslider("Strenght", 0, 0, 1, 0.01); thresh = hslider("Threshold", 0, -96, 0, 0.1); att = hslider("Attack", 0, 0, 120, 0.1)/1000; rel = hslider("Release", 0, 0, 3000, 0.1)/1000; hld = hslider("Hold", 0, 0, 3000, 0.1)/1000; rms = hslider("RMS Size", 0, 0, 3000, 0.1)/1000; knee = hslider("Knee", 0, 0, 24, 0.1); meter = _<:(_, (ba.linear2db:max(maxGR):(hbargraph("GainReduction[1][unit:dB][tooltip: gain reduction in dB]", maxGR, 0)))):attach; maxGR = 0; };
fde506e545978ab239094cb5bbf07eee0a87667a75d8c41e87aca800429c1571
olegkapitonov/Kapitonov-Plugins-Pack
kpp_single2humbucker.dsp
/* * Copyright (C) 2018-2020 Oleg Kapitonov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * -------------------------------------------------------------------------- */ /* * This pugin is very primitive imitator of humbucker sound (Les Paul) * for single-coiled guitars (Stratocaster). * Good for playing hard rock and metal with Stratocaster. * Probably bad for playing blues :)) * */ declare name "kpp_single2humbucker"; declare author "Oleg Kapitonov"; declare license "GPLv3"; declare version "1.2"; import("stdfaust.lib"); delay_samples = ma.SR / 2880 / 2; process = output with { effect_knob = vslider("Humbuckerize", 1, 0, 1, 0.001); filter_knob = vslider("Bass Cut", 20, 20, 720, 0.001); effect = fi.highpass(1,20) <: _, de.delay(50, delay_samples) : + : fi.lowpass(2, 5500) : fi.peak_eq(6.0, 550, 750); filter = fi.highpass(1,filter_knob); output = _,_ :> _ <: (*(effect_knob) : effect), (*(1.0 - effect_knob)) : + : filter : *(ba.db2linear(-10.0)) <: _,_ ; };
https://raw.githubusercontent.com/olegkapitonov/Kapitonov-Plugins-Pack/ed4541172d53ecf04bad43cd583365f278ccf176/LV2/kpp_single2humbucker/kpp_single2humbucker.dsp
faust
* Copyright (C) 2018-2020 Oleg Kapitonov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * -------------------------------------------------------------------------- * This pugin is very primitive imitator of humbucker sound (Les Paul) * for single-coiled guitars (Stratocaster). * Good for playing hard rock and metal with Stratocaster. * Probably bad for playing blues :)) *
declare name "kpp_single2humbucker"; declare author "Oleg Kapitonov"; declare license "GPLv3"; declare version "1.2"; import("stdfaust.lib"); delay_samples = ma.SR / 2880 / 2; process = output with { effect_knob = vslider("Humbuckerize", 1, 0, 1, 0.001); filter_knob = vslider("Bass Cut", 20, 20, 720, 0.001); effect = fi.highpass(1,20) <: _, de.delay(50, delay_samples) : + : fi.lowpass(2, 5500) : fi.peak_eq(6.0, 550, 750); filter = fi.highpass(1,filter_knob); output = _,_ :> _ <: (*(effect_knob) : effect), (*(1.0 - effect_knob)) : + : filter : *(ba.db2linear(-10.0)) <: _,_ ; };
fe603ee64f6dd5b3a0321e101fe391a7c9c25654dd6db586dfc1e00eb36cd9aa
olegkapitonov/Kapitonov-Plugins-Pack
kpp_single2humbucker.dsp
/* * Copyright (C) 2018-2020 Oleg Kapitonov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * -------------------------------------------------------------------------- */ /* * This pugin is very primitive imitator of humbucker sound (Les Paul) * for single-coiled guitars (Stratocaster). * Good for playing hard rock and metal with Stratocaster. * Probably bad for playing blues :)) * */ declare name "kpp_single2humbucker"; declare author "Oleg Kapitonov"; declare license "GPLv3"; declare version "1.1"; import("stdfaust.lib"); delay_samples = ma.SR / 2880 / 2; process = output with { effect_knob = vslider("Humbuckerize", 0, 0, 1, 0.001); filter_knob = vslider("Bass Cut", 20, 20, 720, 0.001); effect = fi.highpass(1,20) <: _, de.delay(50, delay_samples) : + : fi.lowpass(2, 5500) : fi.peak_eq(6.0, 550, 750); filter = fi.highpass(1,filter_knob); output = _ <: (*(effect_knob) : effect), (*(1.0 - effect_knob)) : + : filter : *(ba.db2linear(-10.0)) : _ ; };
https://raw.githubusercontent.com/olegkapitonov/Kapitonov-Plugins-Pack/ed4541172d53ecf04bad43cd583365f278ccf176/LADSPA/kpp_single2humbucker/kpp_single2humbucker.dsp
faust
* Copyright (C) 2018-2020 Oleg Kapitonov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * -------------------------------------------------------------------------- * This pugin is very primitive imitator of humbucker sound (Les Paul) * for single-coiled guitars (Stratocaster). * Good for playing hard rock and metal with Stratocaster. * Probably bad for playing blues :)) *
declare name "kpp_single2humbucker"; declare author "Oleg Kapitonov"; declare license "GPLv3"; declare version "1.1"; import("stdfaust.lib"); delay_samples = ma.SR / 2880 / 2; process = output with { effect_knob = vslider("Humbuckerize", 0, 0, 1, 0.001); filter_knob = vslider("Bass Cut", 20, 20, 720, 0.001); effect = fi.highpass(1,20) <: _, de.delay(50, delay_samples) : + : fi.lowpass(2, 5500) : fi.peak_eq(6.0, 550, 750); filter = fi.highpass(1,filter_knob); output = _ <: (*(effect_knob) : effect), (*(1.0 - effect_knob)) : + : filter : *(ba.db2linear(-10.0)) : _ ; };
5832966bcfbb29a79a1bdff9a5bb9216027ab0fdac1c70997aff95c7da04870b
sebastien-clara/panoplie
tube12AX7.dsp
declare name "Tube Amp Emulation 12AX7"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_12AX7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_12AX7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_12AX7 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
https://raw.githubusercontent.com/sebastien-clara/panoplie/bfb061ab2874a404826a2d62a5359dcd92264f30/audioFX/ampli/tube12AX7%7E.mxo/tube12AX7.dsp
faust
declare name "Tube Amp Emulation 12AX7"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_12AX7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_12AX7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_12AX7 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
97a6569ff7018bbe7d695010da4f649624f54556c900a185f32d04c6fe39b37b
sebastien-clara/panoplie
tube6C16.dsp
declare name "Tube Amp Emulation 6C16"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_6C16 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_6C16 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_6C16 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
https://raw.githubusercontent.com/sebastien-clara/panoplie/bfb061ab2874a404826a2d62a5359dcd92264f30/audioFX/ampli/tube6C16%7E.mxo/tube6C16.dsp
faust
declare name "Tube Amp Emulation 6C16"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_6C16 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_6C16 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_6C16 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
28aadfb46a0235c289f97ddf2a8fac01cb397010e5174a08cee9d1e5079023bf
sebastien-clara/panoplie
tube6DJ8.dsp
declare name "Tube Amp Emulation 6DJ8"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_6DJ8 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_6DJ8 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_6DJ8 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
https://raw.githubusercontent.com/sebastien-clara/panoplie/bfb061ab2874a404826a2d62a5359dcd92264f30/audioFX/ampli/tube6DJ8%7E.mxo/tube6DJ8.dsp
faust
declare name "Tube Amp Emulation 6DJ8"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_6DJ8 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_6DJ8 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_6DJ8 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
aa328a55da06c3cbd31b84cb6faad643f179823cc2cf65dc3bcdc8de487b1ea9
sebastien-clara/panoplie
tube12AT7.dsp
declare name "Tube Amp Emulation 12AT7"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_12AT7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_12AT7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_12AT7 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
https://raw.githubusercontent.com/sebastien-clara/panoplie/bfb061ab2874a404826a2d62a5359dcd92264f30/audioFX/ampli/tube12AT7%7E.mxo/tube12AT7.dsp
faust
declare name "Tube Amp Emulation 12AT7"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_12AT7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_12AT7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_12AT7 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
9657d3a413e9c9d2b03cf534ec3216e9068529e5ad91d2e150c4bf005ff0f2a6
sebastien-clara/panoplie
tube12AU7.dsp
declare name "Tube Amp Emulation 12AU7"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_12AU7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_12AU7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_12AU7 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
https://raw.githubusercontent.com/sebastien-clara/panoplie/bfb061ab2874a404826a2d62a5359dcd92264f30/audioFX/ampli/tube12AU7%7E.mxo/tube12AU7.dsp
faust
declare name "Tube Amp Emulation 12AU7"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_12AU7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_12AU7 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_12AU7 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
80d098c8c4b62876e07d41d2116adcf6080c796f819f63bdeeb156445e58c90a
sebastien-clara/panoplie
tube6V6.dsp
declare name "Tube Amp Emulation 6V6"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_6V6 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_6V6 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_6V6 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
https://raw.githubusercontent.com/sebastien-clara/panoplie/bfb061ab2874a404826a2d62a5359dcd92264f30/audioFX/ampli/tube6V6%7E.mxo/tube6V6.dsp
faust
declare name "Tube Amp Emulation 6V6"; declare author "Guitarix"; import("stdfaust.lib"); process = component("tubes.lib").T1_6V6 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T2_6V6 : *(preamp): fi.lowpass(1,6531.0) : component("tubes.lib").T3_6V6 : *(gain) with { preamp = vslider("Pregain",-6,-20,20,0.1) : ba.db2linear : si.smooth(0.999); gain = vslider("Gain", -6, -20.0, 20.0, 0.1) : ba.db2linear : si.smooth(0.999); };
ce551794d4c9ae72253d48e5b7106551c09e2307f4d361cc8fdda0a7e8639f4f
rottingsounds/bitDSP-faust
bitDAC.dsp
declare name "bitDAC"; declare description "bitDAC - example"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit32 = library("bitDSP_int32.lib"); // plot // CXXFLAGS="-I ../include" faust2csvplot -I ../lib bitDAC.dsp // ./bitDAC -n 10 // compile // CXXFLAGS="-I ../../../include" faust2caqt -I ../lib bitDAC.dsp // ./bitDAC dac_bits = int(hslider("dac bits",1,1,32,1)); dac_offset = min(int(hslider("dac offset",0,0,31,1)), 32-dac_bits); // counting samples from start of execution, starting at 0 sample_count = int((1:+~_)) - 1; // select bits of the samplecount and interpret that chunk as a PCM value process = bit32.bitDAC(dac_offset, dac_bits, sample_count) <: _,_;
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/21cf36105c55b6e18969a867a319530a0ef1ea63/examples/bitDAC.dsp
faust
plot CXXFLAGS="-I ../include" faust2csvplot -I ../lib bitDAC.dsp ./bitDAC -n 10 compile CXXFLAGS="-I ../../../include" faust2caqt -I ../lib bitDAC.dsp ./bitDAC counting samples from start of execution, starting at 0 select bits of the samplecount and interpret that chunk as a PCM value
declare name "bitDAC"; declare description "bitDAC - example"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit32 = library("bitDSP_int32.lib"); dac_bits = int(hslider("dac bits",1,1,32,1)); dac_offset = min(int(hslider("dac offset",0,0,31,1)), 32-dac_bits); sample_count = int((1:+~_)) - 1; process = bit32.bitDAC(dac_offset, dac_bits, sample_count) <: _,_;
eb0cbc77b590a52c27a1289eecf9d3f33b04a9aba3a901e796f43aa2250abca6
pingdynasty/OwlPatches
Qompander.dsp
declare name "qompander"; declare version "1.2"; declare author "Bart Brouns"; declare license "GNU 3.0"; declare copyright "(c) Bart Brouns 2014"; declare credits "ported from qompander in pd by Katja Vetter"; declare see "http://www.katjaas.nl/compander/compander.html"; declare additional "filter coefficients by Olli Niemitalo"; //----------------------------------------------- // imports //----------------------------------------------- import("stdfaust.lib"); //----------------------------------------------- // the GUI //----------------------------------------------- qompanderGroup(x) = (vgroup("[0] qompander [tooltip: Reference: http://www.katjaas.nl/compander/compander.html]", x)); factor = qompanderGroup(hslider("[0] Factor[unit:: 1][style:knob][OWL:PARAMETER_A]", 3, 0.8, 8, 0.01):si.smooth(0.999)); threshold = qompanderGroup(hslider("[1] Threshold [unit: dB][style:knob][OWL:PARAMETER_B]", -40, -96, -20, 0.01):si.smooth(0.999)); attack = qompanderGroup(hslider("[2] Attack[unit: ms][style:knob][OWL:PARAMETER_C]", 1, 1, 20, 0.01):si.smooth(0.999)); release = qompanderGroup(hslider("[3] Release[unit: ms][style:knob][OWL:PARAMETER_D]", 20, 20, 1000, 0.01):si.smooth(0.999)); //----------------------------------------------- // the DSP //----------------------------------------------- magnitude = (threshold):ba.db2linear; exponent = log(magnitude)/log(sin(factor*magnitude*ma.PI/2)); // to go from puredata biquad coefficients to max/msp and faust notation: the first two parameters are negated and put last olli1(x) = x: fi.tf2(0.161758, 0, -1, 0, -0.161758):fi.tf2(0.733029, 0, -1, 0, -0.733029):fi.tf2(0.94535 , 0, -1, 0, -0.94535 ):fi.tf2(0.990598, 0, -1, 0, -0.990598); olli2(x) = x:mem: fi.tf2(0.479401, 0, -1, 0, -0.479401):fi.tf2(0.876218, 0, -1, 0, -0.876218):fi.tf2(0.976599, 0, -1, 0, -0.976599):fi.tf2(0.9975 , 0, -1, 0, -0.9975 ); pyth(x) = sqrt((olli1(x)*olli1(x))+(olli2(x)*olli2(x))):max(0.00001):min(100); //compute instantaneous amplitudes attackDecay(x) = pyth(x) :an.amp_follower_ud(attack/1000,release/1000); mapping(x) = attackDecay(x) : ((sin((min(1/factor)*(factor/4)) * (2*ma.PI)): max(0.0000001):min(1),exponent) : pow ); qompander(x) = (mapping(x) / attackDecay(x))<: (_,olli1(x):*),(_,olli2(x):*):+:_*(sqrt(0.5)); process(x) = qompander(x);
https://raw.githubusercontent.com/pingdynasty/OwlPatches/2be8a65bb257b53ee7ee0b9d4b5a1ad249e16dab/Faust/Qompander.dsp
faust
----------------------------------------------- imports ----------------------------------------------- ----------------------------------------------- the GUI ----------------------------------------------- ----------------------------------------------- the DSP ----------------------------------------------- to go from puredata biquad coefficients to max/msp and faust notation: the first two parameters are negated and put last compute instantaneous amplitudes
declare name "qompander"; declare version "1.2"; declare author "Bart Brouns"; declare license "GNU 3.0"; declare copyright "(c) Bart Brouns 2014"; declare credits "ported from qompander in pd by Katja Vetter"; declare see "http://www.katjaas.nl/compander/compander.html"; declare additional "filter coefficients by Olli Niemitalo"; import("stdfaust.lib"); qompanderGroup(x) = (vgroup("[0] qompander [tooltip: Reference: http://www.katjaas.nl/compander/compander.html]", x)); factor = qompanderGroup(hslider("[0] Factor[unit:: 1][style:knob][OWL:PARAMETER_A]", 3, 0.8, 8, 0.01):si.smooth(0.999)); threshold = qompanderGroup(hslider("[1] Threshold [unit: dB][style:knob][OWL:PARAMETER_B]", -40, -96, -20, 0.01):si.smooth(0.999)); attack = qompanderGroup(hslider("[2] Attack[unit: ms][style:knob][OWL:PARAMETER_C]", 1, 1, 20, 0.01):si.smooth(0.999)); release = qompanderGroup(hslider("[3] Release[unit: ms][style:knob][OWL:PARAMETER_D]", 20, 20, 1000, 0.01):si.smooth(0.999)); magnitude = (threshold):ba.db2linear; exponent = log(magnitude)/log(sin(factor*magnitude*ma.PI/2)); olli1(x) = x: fi.tf2(0.161758, 0, -1, 0, -0.161758):fi.tf2(0.733029, 0, -1, 0, -0.733029):fi.tf2(0.94535 , 0, -1, 0, -0.94535 ):fi.tf2(0.990598, 0, -1, 0, -0.990598); olli2(x) = x:mem: fi.tf2(0.479401, 0, -1, 0, -0.479401):fi.tf2(0.876218, 0, -1, 0, -0.876218):fi.tf2(0.976599, 0, -1, 0, -0.976599):fi.tf2(0.9975 , 0, -1, 0, -0.9975 ); attackDecay(x) = pyth(x) :an.amp_follower_ud(attack/1000,release/1000); mapping(x) = attackDecay(x) : ((sin((min(1/factor)*(factor/4)) * (2*ma.PI)): max(0.0000001):min(1),exponent) : pow ); qompander(x) = (mapping(x) / attackDecay(x))<: (_,olli1(x):*),(_,olli2(x):*):+:_*(sqrt(0.5)); process(x) = qompander(x);
562cea5e761efa826f2f3cfdc47a399776cc2adc3fd7a3c21beeb7daa902bc6c
magnetophon/faustExperiments
slidingOp.dsp
declare name "LazyLeveler"; declare version "0.1"; declare author "Bart Brouns"; declare license "GPLv3"; import("stdfaust.lib"); // N = hslider("maxN", 0, 0, maxN, 1); // maxN = pow(2,4); N = maxN; maxN = 14; process = // pow(2,32); // maxn; slidingMax(N,maxN); // ba.slidingMax(N,maxN); slidingMin(n,maxn) = slidingReduce(min,n,maxn,ma.INFINITY); slidingMax(n,maxn) = slidingReduce(max,n,maxn,0-ma.INFINITY); slidingReduce(op,N,0,disabledVal) = _; slidingReduce(op,N,maxN,disabledVal) = sequentialOperatorParOut(maxNrBits(maxN+1)-1,op) : par(i,maxNrBits(maxN+1) , _@sumOfPrevBlockSizes(i) : useVal(i) ) : combine(maxNrBits(maxN+1)) with { sequentialOperatorParOut(N,op) = seq(i, N, operator(i)); operator(i) = myBus(i) , (_<: _ , op(_,_@(pow2(i) )) ) ; // todo: myBus(0) = 0:! ; myBus(i) = si.bus(i); // The sum of all the sizes of the previous blocks sumOfPrevBlockSizes(0) = 0; sumOfPrevBlockSizes(i) = (ba.subseq((allBlockSizes),0,i):>_); allBlockSizes = par(i, maxNrBits(maxN), (pow2(i)) * isUsed(i)); maxNrBits(n) = int2nrOfBits(n); // Apply <op> to <N> parallel input signals combine(2) = op; combine(N) = op(combine(N-1),_); // Decide wether or not to use a certain value, based on N useVal(i) = select2(isUsed(i), disabledVal, _) ; isUsed(i) = ba.take(i+1, (int2bin(N+1,maxN*2+1))); pow2(i) = 1<<i; // same as: // pow2(i) = int(pow(2,i)); // but in the block diagram, it will be displayed as a number, instead of a formula // convert N into a list of ones and zeros int2bin(N,maxN) = par(j, maxNrBits(maxN), int(floor((N)/(pow2(j))))%2); // calculate how many ones and zeros are needed to represent maxN int2nrOfBits(N) = int(floor(log(N)/log(2))+1); };
https://raw.githubusercontent.com/magnetophon/faustExperiments/0cb3f5027fc4350b3b448e51e2b8515107fc5e64/slidingOp.dsp
faust
N = hslider("maxN", 0, 0, maxN, 1); maxN = pow(2,4); pow(2,32); maxn; ba.slidingMax(N,maxN); todo: The sum of all the sizes of the previous blocks Apply <op> to <N> parallel input signals Decide wether or not to use a certain value, based on N same as: pow2(i) = int(pow(2,i)); but in the block diagram, it will be displayed as a number, instead of a formula convert N into a list of ones and zeros calculate how many ones and zeros are needed to represent maxN
declare name "LazyLeveler"; declare version "0.1"; declare author "Bart Brouns"; declare license "GPLv3"; import("stdfaust.lib"); N = maxN; maxN = 14; process = slidingMax(N,maxN); slidingMin(n,maxn) = slidingReduce(min,n,maxn,ma.INFINITY); slidingMax(n,maxn) = slidingReduce(max,n,maxn,0-ma.INFINITY); slidingReduce(op,N,0,disabledVal) = _; slidingReduce(op,N,maxN,disabledVal) = sequentialOperatorParOut(maxNrBits(maxN+1)-1,op) : par(i,maxNrBits(maxN+1) , _@sumOfPrevBlockSizes(i) : useVal(i) ) : combine(maxNrBits(maxN+1)) with { sequentialOperatorParOut(N,op) = seq(i, N, operator(i)); operator(i) = myBus(i) , (_<: _ , op(_,_@(pow2(i) )) ) ; myBus(0) = 0:! ; myBus(i) = si.bus(i); sumOfPrevBlockSizes(0) = 0; sumOfPrevBlockSizes(i) = (ba.subseq((allBlockSizes),0,i):>_); allBlockSizes = par(i, maxNrBits(maxN), (pow2(i)) * isUsed(i)); maxNrBits(n) = int2nrOfBits(n); combine(2) = op; combine(N) = op(combine(N-1),_); useVal(i) = select2(isUsed(i), disabledVal, _) ; isUsed(i) = ba.take(i+1, (int2bin(N+1,maxN*2+1))); pow2(i) = 1<<i; int2bin(N,maxN) = par(j, maxNrBits(maxN), int(floor((N)/(pow2(j))))%2); int2nrOfBits(N) = int(floor(log(N)/log(2))+1); };
a15784adb5fa65f95d345569e58a710e5f8505718c1e1420f457119fe37d71f3
friskgit/snares
filter_bank.dsp
// -*- compile-command: "cd .. && make jack src=src/filter_bank.dsp && cd -"; -*- declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); //---------------`Filterbank for snaredrum` -------------------------- // // A filterbank for use with snare drum synths and channel disperser. It // takes a trigger and a signal as input and outputs as many channels as // there are filterbands. // // Parameter 'bands' is set at compile time. // // 18 Juli 2019 Henrik Frisk [email protected] //--------------------------------------------------- bands = 16; // Control the output channel del_group(x) = vgroup("delay", x); del = del_group(hslider("delay", 0, 0, 1024, 1)); fb = fi.mth_octave_filterbank(order,M,ftop,bands) : par(i, bands, (*(ba.db2linear(fader(bands-i))))) : par(i, bands, de.sdelay(8192, 512, *(del, i))) with { M = 2; order = 1; ftop = 10000; bp1 = ba.bypass1; slider_group(x) = mofb_group(hgroup("[1]", x)); mofb_group(x) = vgroup("constant-q filter bank (Butterworth dyadic tree) [tooltip: See Faust's filters.lib for more info", x); fader(i) = slider_group(vslider("Band%2i [unit:dB] [tooltip: Bandpass filter gain in dB]", -10, -70, 10, 0.1)) : si.smoo; bp = bypass_group(checkbox("[0] Bypassc[tooltip: When this is checked, the filter-bank has no effect]")); }; ch_wrapped(x) = ma.modulo((offset+x), bands); offset = hslider("offset", 0, 0, bands, 1); process(trig, sig) = sig : fb : par(i, bands, ba.selectoutn(bands, ch_wrapped(i))) :> par(i, bands, _);
https://raw.githubusercontent.com/friskgit/snares/bb43ea5e706a0ead6d65dd176a5c492b2f5d8f74/faust/snare/src/filter_bank.dsp
faust
-*- compile-command: "cd .. && make jack src=src/filter_bank.dsp && cd -"; -*- ---------------`Filterbank for snaredrum` -------------------------- A filterbank for use with snare drum synths and channel disperser. It takes a trigger and a signal as input and outputs as many channels as there are filterbands. Parameter 'bands' is set at compile time. 18 Juli 2019 Henrik Frisk [email protected] --------------------------------------------------- Control the output channel
declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); bands = 16; del_group(x) = vgroup("delay", x); del = del_group(hslider("delay", 0, 0, 1024, 1)); fb = fi.mth_octave_filterbank(order,M,ftop,bands) : par(i, bands, (*(ba.db2linear(fader(bands-i))))) : par(i, bands, de.sdelay(8192, 512, *(del, i))) with { M = 2; order = 1; ftop = 10000; bp1 = ba.bypass1; slider_group(x) = mofb_group(hgroup("[1]", x)); mofb_group(x) = vgroup("constant-q filter bank (Butterworth dyadic tree) [tooltip: See Faust's filters.lib for more info", x); fader(i) = slider_group(vslider("Band%2i [unit:dB] [tooltip: Bandpass filter gain in dB]", -10, -70, 10, 0.1)) : si.smoo; bp = bypass_group(checkbox("[0] Bypassc[tooltip: When this is checked, the filter-bank has no effect]")); }; ch_wrapped(x) = ma.modulo((offset+x), bands); offset = hslider("offset", 0, 0, bands, 1); process(trig, sig) = sig : fb : par(i, bands, ba.selectoutn(bands, ch_wrapped(i))) :> par(i, bands, _);
5328da9f9f7d7745808e015b19e8b04d4d9e758f87885d0388de01ecfe58d5ee
friskgit/snares
snares.dsp
// -*- compile-command: "cd .. && make jack src=src/snares.dsp && cd -"; -*- declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); //---------------`Snare drum synth` -------------------------- // A take at a snare drum synth // // Continuously playing, optionally multichannel dispersing (see focus parameter). // // Where: // * midi note 67-89 // * stiffness 0-0.55 (mapped to note as in note 67 -> 0)§ // * midi velocity is mapped to pressure // A useful parameter setting is: // // 30 Juni 2018 Henrik Frisk [email protected] //--------------------------------------------------- channels = 14; //imp = ba.pulse(hslider("tempo", 10000, 500, 10000, 1)); imp = ba.beat(hslider("tempo", 100, 1, 2000, 1)); master_env = 1; //en.smoothEnvelope(0.1, button("play")); env = en.ar(attack, rel, imp) * amp with { attack = hslider("attack", 0.00000001, 0, 0.1, 0.000000001) : si.smooth(0.1); rel = hslider("rel", 0.1, 0.0000001, 0.5, 0.0000001) : si.smooth(0.2); amp = hslider("vol", 0.5, 0, 1, 0.0001); }; // Control the output channel focus = hslider("focus", 1, 0, 1, 0.0001); position = hslider("position", 1, 0, channels, 1); rate = ma.SR/1000.0; rndctrl = (no.lfnoise(rate) * (channels + 1)) * focus : ma.fabs + position : int ; outputctrl = rndctrl : ba.sAndH(imp); // Filter n = no.multinoise(8) : par(i, 8, _ * env * 0.1); filt = fi.resonbp(frq, q, gain) with { frq = hslider("freq", 200, 50, 5000, 0.1); q = hslider("q", 1, 0.01, 10, 0.01); gain = hslider("gain", 0, 0, 2, 0.00001); }; // Wrap channels ch_wrapped = ma.modulo(outputctrl, channels); //process = n : par(i, 8, filt); process = n : par(i, 8, filt) :> _,_ :> *(_, master_env) :> ba.selectoutn(channels, ch_wrapped);
https://raw.githubusercontent.com/friskgit/snares/bb43ea5e706a0ead6d65dd176a5c492b2f5d8f74/faust/snare/src/extras/snares.dsp
faust
-*- compile-command: "cd .. && make jack src=src/snares.dsp && cd -"; -*- ---------------`Snare drum synth` -------------------------- A take at a snare drum synth Continuously playing, optionally multichannel dispersing (see focus parameter). Where: * midi note 67-89 * stiffness 0-0.55 (mapped to note as in note 67 -> 0)§ * midi velocity is mapped to pressure A useful parameter setting is: 30 Juni 2018 Henrik Frisk [email protected] --------------------------------------------------- imp = ba.pulse(hslider("tempo", 10000, 500, 10000, 1)); en.smoothEnvelope(0.1, button("play")); Control the output channel Filter Wrap channels process = n : par(i, 8, filt);
declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); channels = 14; imp = ba.beat(hslider("tempo", 100, 1, 2000, 1)); env = en.ar(attack, rel, imp) * amp with { attack = hslider("attack", 0.00000001, 0, 0.1, 0.000000001) : si.smooth(0.1); rel = hslider("rel", 0.1, 0.0000001, 0.5, 0.0000001) : si.smooth(0.2); amp = hslider("vol", 0.5, 0, 1, 0.0001); }; focus = hslider("focus", 1, 0, 1, 0.0001); position = hslider("position", 1, 0, channels, 1); rate = ma.SR/1000.0; rndctrl = (no.lfnoise(rate) * (channels + 1)) * focus : ma.fabs + position : int ; outputctrl = rndctrl : ba.sAndH(imp); n = no.multinoise(8) : par(i, 8, _ * env * 0.1); filt = fi.resonbp(frq, q, gain) with { frq = hslider("freq", 200, 50, 5000, 0.1); q = hslider("q", 1, 0.01, 10, 0.01); gain = hslider("gain", 0, 0, 2, 0.00001); }; ch_wrapped = ma.modulo(outputctrl, channels); process = n : par(i, 8, filt) :> _,_ :> *(_, master_env) :> ba.selectoutn(channels, ch_wrapped);
a5feefe76a60641267dc096bf0796540aecf3647d408f5ed49474f4eac74c312
dariosanfilippo/modified_hindmarsh-rose
modified_hindmarshrose.dsp
// ============================================================================= // Modified Hindmarsh-Rose complex generator // ============================================================================= // // Complex sound generator based on modified Hindmarsh-Rose 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 Hindmarsh-Rose complex generator"; declare author "Dario Sanfilippo"; declare copyright "Copyright (C) 2021 Dario Sanfilippo <[email protected]>"; declare version "1.1"; declare license "GPL v3.0 license"; // Hindmarsh–Rose model // dx/dt=y+F(x)-z+I // dy/dt=G(x)-y // dz/dt=r(s(x-x_r)-z) // F(x)=-ax^3+bx^2 // G(x)c-dx^2 hindmarshrose(l, a, b, I, c, d, r, s, x_R, dt, x_0, y_0, z_0) = x_level(out * (x / l)) , y_level(out * (y / l)) , z_level(out * (z / l)) letrec { 'x = fi.highpass(1, 10, tanh(l, (x_0 + x + (y + phi(x) - z + I) * dt))); 'y = fi.highpass(1, 10, tanh(l, (y_0 + y + (psi(x) - y) * dt))); 'z = fi.highpass(1, 10, tanh(l, (z_0 + z + (r * (s * (x - x_R) - z)) * dt))); } with { phi(x) = b * x ^ 2.0 - a * x ^ 3.0; psi(x) = c - d * x ^ 2.0; }; // 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); }; // tanh() saturator with adjustable saturating threshold tanh(l, x) = l * ma.tanh(x / l); // GUI parameters x_level(x) = attach(x , abs(x) : ba.linear2db : levels_group(hbargraph("[5]x[style:dB]", -60, 0))); y_level(x) = attach(x , abs(x) : ba.linear2db : levels_group(hbargraph("[6]y[style:dB]", -60, 0))); z_level(x) = attach(x , abs(x) : ba.linear2db : levels_group(hbargraph("[7]z[style:dB]", -60, 0))); x_param_group(x) = vgroup("[0]x-parameters", x); y_param_group(x) = vgroup("[1]y-parameters", x); z_param_group(x) = vgroup("[2]z-parameters", x); global_group(x) = vgroup("[3]Global", x); levels_group(x) = hgroup("[4]Levels (dB)", x); a = x_param_group(hslider("[1]a[scale:exp]", 1, 0, 20, .000001) : smooth); b = x_param_group(hslider("[2]b[scale:exp]", 3, 0, 20, .000001) : smooth); I = x_param_group(hslider("[3]I", 2, -20, 20, .000001) : smooth); c = y_param_group(hslider("[4]c", 1, -20, 20, .000001) : smooth); d = y_param_group(hslider("[5]d[scale:exp]", 5, 0, 20, .000001) : smooth); r = z_param_group(hslider("[6]r[scale:exp]", 1, 0, 2, .000001) : smooth); s = z_param_group(hslider("[7]s[scale:exp]", 4, 0, 20, .000001) : smooth); x_r = z_param_group(hslider("[8]x_R", 1.6, -20, 20, .000001) : smooth); dt = global_group( hslider("[4]dt (integration step)[scale:exp]", 0.1, 0.000001, 1, .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("[2]Impulse inputs") : ba.impulsify; limit = global_group( hslider("[5]Saturation limit[scale:exp]", 4, 1, 64, .000001) : smooth); out = global_group(hslider("[6]Output scaling[scale:exp]", 0, 0, 1, .000001) : smooth); process(x1, x2, x3) = hindmarshrose(limit, a, b, I, c, d, r, s, x_r, dt, input(x1), input(x2), input(x3));
https://raw.githubusercontent.com/dariosanfilippo/modified_hindmarsh-rose/b19fa8bdd70aa59576980cfa2e01b145a0f939d2/modified_hindmarshrose.dsp
faust
============================================================================= Modified Hindmarsh-Rose complex generator ============================================================================= Complex sound generator based on modified Hindmarsh-Rose 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. ============================================================================= Hindmarsh–Rose model dx/dt=y+F(x)-z+I dy/dt=G(x)-y dz/dt=r(s(x-x_r)-z) F(x)=-ax^3+bx^2 G(x)c-dx^2 smoothing function for click-free parameter variations using a one-pole low-pass with a 20-Hz cut-off frequency. tanh() saturator with adjustable saturating threshold GUI parameters
import("stdfaust.lib"); declare name "Modified Hindmarsh-Rose complex generator"; declare author "Dario Sanfilippo"; declare copyright "Copyright (C) 2021 Dario Sanfilippo <[email protected]>"; declare version "1.1"; declare license "GPL v3.0 license"; hindmarshrose(l, a, b, I, c, d, r, s, x_R, dt, x_0, y_0, z_0) = x_level(out * (x / l)) , y_level(out * (y / l)) , z_level(out * (z / l)) letrec { 'x = fi.highpass(1, 10, tanh(l, (x_0 + x + (y + phi(x) - z + I) * dt))); 'y = fi.highpass(1, 10, tanh(l, (y_0 + y + (psi(x) - y) * dt))); 'z = fi.highpass(1, 10, tanh(l, (z_0 + z + (r * (s * (x - x_R) - z)) * dt))); } with { phi(x) = b * x ^ 2.0 - a * x ^ 3.0; psi(x) = c - d * x ^ 2.0; }; smooth(x) = fi.pole(pole, x * (1.0 - pole)) with { pole = exp(-2.0 * ma.PI * 20.0 / ma.SR); }; tanh(l, x) = l * ma.tanh(x / l); x_level(x) = attach(x , abs(x) : ba.linear2db : levels_group(hbargraph("[5]x[style:dB]", -60, 0))); y_level(x) = attach(x , abs(x) : ba.linear2db : levels_group(hbargraph("[6]y[style:dB]", -60, 0))); z_level(x) = attach(x , abs(x) : ba.linear2db : levels_group(hbargraph("[7]z[style:dB]", -60, 0))); x_param_group(x) = vgroup("[0]x-parameters", x); y_param_group(x) = vgroup("[1]y-parameters", x); z_param_group(x) = vgroup("[2]z-parameters", x); global_group(x) = vgroup("[3]Global", x); levels_group(x) = hgroup("[4]Levels (dB)", x); a = x_param_group(hslider("[1]a[scale:exp]", 1, 0, 20, .000001) : smooth); b = x_param_group(hslider("[2]b[scale:exp]", 3, 0, 20, .000001) : smooth); I = x_param_group(hslider("[3]I", 2, -20, 20, .000001) : smooth); c = y_param_group(hslider("[4]c", 1, -20, 20, .000001) : smooth); d = y_param_group(hslider("[5]d[scale:exp]", 5, 0, 20, .000001) : smooth); r = z_param_group(hslider("[6]r[scale:exp]", 1, 0, 2, .000001) : smooth); s = z_param_group(hslider("[7]s[scale:exp]", 4, 0, 20, .000001) : smooth); x_r = z_param_group(hslider("[8]x_R", 1.6, -20, 20, .000001) : smooth); dt = global_group( hslider("[4]dt (integration step)[scale:exp]", 0.1, 0.000001, 1, .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("[2]Impulse inputs") : ba.impulsify; limit = global_group( hslider("[5]Saturation limit[scale:exp]", 4, 1, 64, .000001) : smooth); out = global_group(hslider("[6]Output scaling[scale:exp]", 0, 0, 1, .000001) : smooth); process(x1, x2, x3) = hindmarshrose(limit, a, b, I, c, d, r, s, x_r, dt, input(x1), input(x2), input(x3));
a61ddf8811b9b6780f352440ced31d41e5be03b74a18aca5fefb72c90730c67f
gabrielsanchez/faust-guitarix-sc37
sloop.dsp
declare id "sloop"; declare version "1.0"; declare author "brummer"; declare license "BSD"; import("stdfaust.lib"); B = checkbox("Capture"); // Capture sound while pressed C = checkbox("Play"); I = int(B); // convert button signal from float to integer R = (I-I') <= 0; // Reset capture when button is pressed D = (+(I):*(R))~_; // Compute capture duration while button is pressed: 0..NNNN0..MMM capture = ( *(B) : (+ : de.de.fdelay(2097152, D-1)) ~ *(1.0-B)) *(C); si.smooth(c) = *(1-c) : +~*(c); level = hslider("gain", 0, -96, 4, 0.1) : ba.db2linear : si.smooth(0.999); process = vgroup( "SampleLooper", _ <:_, (capture : *(level)):>_ ) ;
https://raw.githubusercontent.com/gabrielsanchez/faust-guitarix-sc37/c0608695e24870abb56f7f0d1355cbf2f563ed30/Faust/sloop.dsp
faust
Capture sound while pressed convert button signal from float to integer Reset capture when button is pressed Compute capture duration while button is pressed: 0..NNNN0..MMM
declare id "sloop"; declare version "1.0"; declare author "brummer"; declare license "BSD"; import("stdfaust.lib"); C = checkbox("Play"); capture = ( *(B) : (+ : de.de.fdelay(2097152, D-1)) ~ *(1.0-B)) *(C); si.smooth(c) = *(1-c) : +~*(c); level = hslider("gain", 0, -96, 4, 0.1) : ba.db2linear : si.smooth(0.999); process = vgroup( "SampleLooper", _ <:_, (capture : *(level)):>_ ) ;
f3a0a7073fb6f2e8a7af29753c6335de8e741e452515c433e6d8614463a02813
sekisushai/ambitools
hoa_mic_encoder_lebedev50.dsp
declare name "MemsBedev HOA Encoder"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2014"; // Description: This tool does the Discrete Spherical Fourier Transform (DSFT) [1] of signal from a rigid spherical microphone with 50-node Lebedev grid geometry [1]. // CAUTION: This tool does only the DSFT, to obtain the Ambisonics components you should filter the signals with corresponding radial filters [1]. // Inputs: 50 // Outputs: (M+1)^2 // References: // [1] P. Lecomte, P.-A. Gauthier, C. Langrenne, A. Garcia, and A. Berry, “On the use of a Lebedev grid for Ambisonics,” in Audio Engineering Society Convention 139, 2015. import("stdfaust.lib"); import("lebedev.lib"); import("ymn.lib"); import("gui.lib"); // Maximum order M=5 for 50-node Lebedev grid [1]. M = 5; ins = 50; outs = (M+1)^2; // VU-Meters activation (choose between vumeteron or off) insvumeter = insvumeteroff; outsvumeter = outsvumeteroff; insvumeteron = par(i,ins,id(i,0)); insvumeteroff = par(i,ins,_); outsvumeteron = par(i,M+1,metermute(i)); outsvumeteroff = par(i,outs,_); vol = hslider("[1]Gain[unit:dB][style:knob]", 0, -10, 50, 0.1) : ba.db2linear : si.smooth(0.999); // Vector of weighted spherical harmonics : spherical harmonics times the speaker weight for weighed quadrature rules [1]. row(i) = par(j,ins,yacn(i,azimuth(j),elevation(j))*(weight5(j))); process = hgroup("[0]Inputs",insvumeter)<:par(i,outs,buswg(row(i)):>_):hgroup("[1]Outputs",par(i,outs,*(vol)):outsvumeter);
https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_mic_encoder_lebedev50.dsp
faust
Description: This tool does the Discrete Spherical Fourier Transform (DSFT) [1] of signal from a rigid spherical microphone with 50-node Lebedev grid geometry [1]. CAUTION: This tool does only the DSFT, to obtain the Ambisonics components you should filter the signals with corresponding radial filters [1]. Inputs: 50 Outputs: (M+1)^2 References: [1] P. Lecomte, P.-A. Gauthier, C. Langrenne, A. Garcia, and A. Berry, “On the use of a Lebedev grid for Ambisonics,” in Audio Engineering Society Convention 139, 2015. Maximum order M=5 for 50-node Lebedev grid [1]. VU-Meters activation (choose between vumeteron or off) Vector of weighted spherical harmonics : spherical harmonics times the speaker weight for weighed quadrature rules [1].
declare name "MemsBedev HOA Encoder"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2014"; import("stdfaust.lib"); import("lebedev.lib"); import("ymn.lib"); import("gui.lib"); M = 5; ins = 50; outs = (M+1)^2; insvumeter = insvumeteroff; outsvumeter = outsvumeteroff; insvumeteron = par(i,ins,id(i,0)); insvumeteroff = par(i,ins,_); outsvumeteron = par(i,M+1,metermute(i)); outsvumeteroff = par(i,outs,_); vol = hslider("[1]Gain[unit:dB][style:knob]", 0, -10, 50, 0.1) : ba.db2linear : si.smooth(0.999); row(i) = par(j,ins,yacn(i,azimuth(j),elevation(j))*(weight5(j))); process = hgroup("[0]Inputs",insvumeter)<:par(i,outs,buswg(row(i)):>_):hgroup("[1]Outputs",par(i,outs,*(vol)):outsvumeter);
3a9f356497df9453a8cd301f66188f9958085844188e43603e159a6b80b050f1
scottericpetersen/OMI-Faust-Workshop
pulsee_v2.dsp
declare name " Pulsee "; declare author " Scott E. Petersen " ; declare copyright " (c) SEP 2023 "; declare version " 0.02a "; declare license " BSD "; // Import the standard library so we can use preexisting objects import("stdfaust.lib"); /* -- OSCILLATOR SECTION -- comment/uncomment to choose your source. For this workshop, use os.lf_imptrain and keep lfn line uncommented */ // src = no.noise*0.1; // src = os.pulsetrain(2 + lfn, 0.5)*0.2; // src = os.square(1 + lfn)*0.25; lfn = no.lfnoiseN(3, 48000/100) : abs * drift; src = os.lf_imptrain(pfreq + lfn)*amp; /* -- GUI SECTION -- */ // knob for overall amplitude scaler amp = oscGroup(hslider("[1]amp[style:knob]",0.1,0.0,0.3,0.001)) : si.smoo; // knob for impulse frequency pfreq = oscGroup(hslider("[2]freq[style:knob]",1.0,0.0,30.0,0.1)) : si.smoo; // knob for random number amount drift = oscGroup(hslider("[3]drift[style:knob]",0.0,0.0,10.0,0.1)) : si.smoo; // button for filter order order = filtGroup(hslider("[1]order[style:menu{'2nd':0;'4th':1}]",0,0,1,1)); // knob for filter cutoff cutoff = filtGroup(hslider("cut[style:knob]",500,10,2800,10)) : si.smoo; // knob for delay delay = combGroup(hslider("delay[style:knob]",mdel/2, 0, mdel, 0.1)) : si.smoo; // knob for feedback fdbk = combGroup(hslider("fdbk[style:knob]",0.2,0.0,1.0,0.01)) : si.smoo; // knob for feedback mix = verbGroup(hslider("wet amnt[style:knob]",0.01,0.0,0.1,0.001)) : si.smoo; // Groups for GUI elements listed above oscGroup(x) = pulseeGUI(hgroup("[A]Oscillator",x)); filtGroup(y) = pulseeGUI(hgroup("[B]Filter",y)); combGroup(z) = pulseeGUI(hgroup("[C]Comb", z)); verbGroup(v) = pulseeGUI(hgroup("[D]Reverb", v)); pulseeGUI(a) = hgroup("PULSEE", a); /* -- FILTER SECTION -- */ // low pass filter2 = src : fi.lowpass(2, cutoff); filter4 = src : fi.lowpass(4, cutoff); //comb mdel = 8092; comb = fi.fb_comb(mdel, delay, delay, fdbk); // panning pan = sp.panner(0.5); // reverb verb = re.stereo_freeverb(0.91521,0.9459,0.495, 7); // signal with no reverb, panned dry = select2(order, filter2, filter4) : comb : pan : _*(1-mix), _*(1-mix); // inverse of mix for wet/dry // dry signal processed through reverb wet = dry : _*mix, _*mix : verb ; /* -- OUTPUT -- */ process = wet,dry :> _,_; // here we do not "sum" like wet + dry, but parallel process the two, resulting in 4 chans out which have to be reduced to two using the merge operator.
https://raw.githubusercontent.com/scottericpetersen/OMI-Faust-Workshop/28d952b574cd8f08c82416b6fdbfbc8fa9f9de74/examples/omi/pulsee_v2.dsp
faust
Import the standard library so we can use preexisting objects -- OSCILLATOR SECTION -- comment/uncomment to choose your source. For this workshop, use os.lf_imptrain and keep lfn line uncommented src = no.noise*0.1; src = os.pulsetrain(2 + lfn, 0.5)*0.2; src = os.square(1 + lfn)*0.25; -- GUI SECTION -- knob for overall amplitude scaler knob for impulse frequency knob for random number amount button for filter order knob for filter cutoff knob for delay knob for feedback knob for feedback Groups for GUI elements listed above -- FILTER SECTION -- low pass comb panning reverb signal with no reverb, panned inverse of mix for wet/dry dry signal processed through reverb -- OUTPUT -- here we do not "sum" like wet + dry, but parallel process the two, resulting in 4 chans out which have to be reduced to two using the merge operator.
declare name " Pulsee "; declare author " Scott E. Petersen " ; declare copyright " (c) SEP 2023 "; declare version " 0.02a "; declare license " BSD "; import("stdfaust.lib"); lfn = no.lfnoiseN(3, 48000/100) : abs * drift; src = os.lf_imptrain(pfreq + lfn)*amp; amp = oscGroup(hslider("[1]amp[style:knob]",0.1,0.0,0.3,0.001)) : si.smoo; pfreq = oscGroup(hslider("[2]freq[style:knob]",1.0,0.0,30.0,0.1)) : si.smoo; drift = oscGroup(hslider("[3]drift[style:knob]",0.0,0.0,10.0,0.1)) : si.smoo; order = filtGroup(hslider("[1]order[style:menu{'2nd':0;'4th':1}]",0,0,1,1)); cutoff = filtGroup(hslider("cut[style:knob]",500,10,2800,10)) : si.smoo; delay = combGroup(hslider("delay[style:knob]",mdel/2, 0, mdel, 0.1)) : si.smoo; fdbk = combGroup(hslider("fdbk[style:knob]",0.2,0.0,1.0,0.01)) : si.smoo; mix = verbGroup(hslider("wet amnt[style:knob]",0.01,0.0,0.1,0.001)) : si.smoo; oscGroup(x) = pulseeGUI(hgroup("[A]Oscillator",x)); filtGroup(y) = pulseeGUI(hgroup("[B]Filter",y)); combGroup(z) = pulseeGUI(hgroup("[C]Comb", z)); verbGroup(v) = pulseeGUI(hgroup("[D]Reverb", v)); pulseeGUI(a) = hgroup("PULSEE", a); filter2 = src : fi.lowpass(2, cutoff); filter4 = src : fi.lowpass(4, cutoff); mdel = 8092; comb = fi.fb_comb(mdel, delay, delay, fdbk); pan = sp.panner(0.5); verb = re.stereo_freeverb(0.91521,0.9459,0.495, 7); wet = dry : _*mix, _*mix : verb ;
630ca4cc6ff0e0bb72dfc52e1586af49494217ab52db66eac1ef360140887655
Msc-program/Jacklink
compressordsp.dsp
declare name "compressor"; declare version "0.0"; declare author "Julius Smith"; declare license "MIT Style STK-4.2"; declare description "Compressor demo application, adapted from the Faust Library's dm.compressor_demo in demos.lib"; declare documentation "https://faustlibraries.grame.fr/libs/compressors/#cocompressor_mono"; import("stdfaust.lib"); //----------------------------`(dm.)compressor_mono_demo`------------------------- // Mono Compressor // // #### Usage // // ``` // _ : compressor_mono_demo : _; // ``` //------------------------------------------------------------ compressor_demo = ba.bypass1(cbp,compressor_mono_demo) with { comp_group(x) = vgroup("COMPRESSOR [tooltip: References: https://faustlibraries.grame.fr/libs/compressors/ http://en.wikipedia.org/wiki/Dynamic_range_compression]", x); meter_group(x) = comp_group(hgroup("[0]", x)); knob_group(x) = comp_group(hgroup("[1]", x)); cbp = meter_group(checkbox("[0] Bypass [tooltip: When this is checked, the compressor has no effect]")); gainview = co.compression_gain_mono(ratio,threshold,attack,release) : ba.linear2db : meter_group(hbargraph("[1] Compressor Gain [unit:dB] [tooltip: Compressor gain in dB]",-50,+10)); displaygain = _ <: _,abs : _,gainview : attach; compressor_stereo_demo = displaygain(co.compressor_stereo(ratio,threshold,attack,release)) : *(makeupgain), *(makeupgain); compressor_mono_demo = displaygain(co.compressor_mono(ratio,threshold,attack,release)) : *(makeupgain); ctl_group(x) = knob_group(hgroup("[3] Compression Control", x)); ratio = ctl_group(hslider("[0] Ratio [style:knob] [tooltip: A compression Ratio of N means that for each N dB increase in input signal level above Threshold, the output level goes up 1 dB]", 2, 1, 20, 0.1)); threshold = ctl_group(hslider("[1] Threshold [unit:dB] [style:knob] [tooltip: When the signal level exceeds the Threshold (in dB), its level is compressed according to the Ratio]", -24, -100, 10, 0.1)); env_group(x) = knob_group(hgroup("[4] Compression Response", x)); attack = env_group(hslider("[1] Attack [unit:ms] [style:knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new lower target level (the compression `kicking in')]", 15, 1, 1000, 0.1)) : *(0.001) : max(1/ma.SR); release = env_group(hslider("[2] Release [unit:ms] [style: knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new higher target level (the compression 'releasing')]", 40, 1, 1000, 0.1)) : *(0.001) : max(1/ma.SR); makeupgain = comp_group(hslider("[5] MakeUpGain [unit:dB] [tooltip: The compressed-signal output level is increased by this amount (in dB) to make up for the level lost due to compression]", 2, -96, 96, 0.1)) : ba.db2linear; }; process = _ : compressor_demo : _;
https://raw.githubusercontent.com/Msc-program/Jacklink/70b8634173e66d89884bb77b70b7b3ed01f71f79/faust-src/compressordsp.dsp
faust
----------------------------`(dm.)compressor_mono_demo`------------------------- Mono Compressor #### Usage ``` _ : compressor_mono_demo : _; ``` ------------------------------------------------------------ faustlibraries.grame.fr/libs/compressors/ en.wikipedia.org/wiki/Dynamic_range_compression]", x);
declare name "compressor"; declare version "0.0"; declare author "Julius Smith"; declare license "MIT Style STK-4.2"; declare description "Compressor demo application, adapted from the Faust Library's dm.compressor_demo in demos.lib"; declare documentation "https://faustlibraries.grame.fr/libs/compressors/#cocompressor_mono"; import("stdfaust.lib"); compressor_demo = ba.bypass1(cbp,compressor_mono_demo) with { comp_group(x) = vgroup("COMPRESSOR [tooltip: References: meter_group(x) = comp_group(hgroup("[0]", x)); knob_group(x) = comp_group(hgroup("[1]", x)); cbp = meter_group(checkbox("[0] Bypass [tooltip: When this is checked, the compressor has no effect]")); gainview = co.compression_gain_mono(ratio,threshold,attack,release) : ba.linear2db : meter_group(hbargraph("[1] Compressor Gain [unit:dB] [tooltip: Compressor gain in dB]",-50,+10)); displaygain = _ <: _,abs : _,gainview : attach; compressor_stereo_demo = displaygain(co.compressor_stereo(ratio,threshold,attack,release)) : *(makeupgain), *(makeupgain); compressor_mono_demo = displaygain(co.compressor_mono(ratio,threshold,attack,release)) : *(makeupgain); ctl_group(x) = knob_group(hgroup("[3] Compression Control", x)); ratio = ctl_group(hslider("[0] Ratio [style:knob] [tooltip: A compression Ratio of N means that for each N dB increase in input signal level above Threshold, the output level goes up 1 dB]", 2, 1, 20, 0.1)); threshold = ctl_group(hslider("[1] Threshold [unit:dB] [style:knob] [tooltip: When the signal level exceeds the Threshold (in dB), its level is compressed according to the Ratio]", -24, -100, 10, 0.1)); env_group(x) = knob_group(hgroup("[4] Compression Response", x)); attack = env_group(hslider("[1] Attack [unit:ms] [style:knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new lower target level (the compression `kicking in')]", 15, 1, 1000, 0.1)) : *(0.001) : max(1/ma.SR); release = env_group(hslider("[2] Release [unit:ms] [style: knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new higher target level (the compression 'releasing')]", 40, 1, 1000, 0.1)) : *(0.001) : max(1/ma.SR); makeupgain = comp_group(hslider("[5] MakeUpGain [unit:dB] [tooltip: The compressed-signal output level is increased by this amount (in dB) to make up for the level lost due to compression]", 2, -96, 96, 0.1)) : ba.db2linear; }; process = _ : compressor_demo : _;
56ebe845c833711f01291b01c8c8ceb3cada5e7a1916a90771b864cb0e1d7b6a
afalaize/faust
bandFilter.dsp
// WARNING: This a "legacy example based on a deprecated library". Check filters.lib // for more accurate examples of filter functions declare name "bandFilter"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; import("stdfaust.lib"); //---------------------second order filter-------------------------- // filter(Q,F,G) // Q : quality factor [1..100] // F : frequency (Hz) // G : gain [0..1] //------------------------------------------------------------------ filter(Q,F,G) = fi.TF2( (1 + K/Q + K*K) / D, 2 * (K*K - 1) / D, (1 - K/Q + K*K) / D, 2 * (K*K - 1) / D, (1 - V*K/Q + K*K) / D ) with { V = ba.db2linear(G); K = tan(ma.PI*F/ma.SR); D = 1 + V*K/Q + K*K; }; //--------------- Band Filter with user interface ------------------ // bandfilter(F) // F : default frequency (Hz) // //------------------------------------------------------------------ bandfilter(F) = filter( nentry("Q factor [style:knob]",50,0.1,100,0.1), nentry("freq [unit:Hz][style:knob]", F, 20, 20000, 1), 0 - vslider("gain [unit:dB]", 0, -50, 50, 0.1) ); //------------------------- Process -------------------------------- process = vgroup("Bandfilter", bandfilter(1000));
https://raw.githubusercontent.com/afalaize/faust/8f9f5fe3aa167eaeecc15a99d4da984ac2797be3/examples/filtering/bandFilter.dsp
faust
WARNING: This a "legacy example based on a deprecated library". Check filters.lib for more accurate examples of filter functions ---------------------second order filter-------------------------- filter(Q,F,G) Q : quality factor [1..100] F : frequency (Hz) G : gain [0..1] ------------------------------------------------------------------ --------------- Band Filter with user interface ------------------ bandfilter(F) F : default frequency (Hz) ------------------------------------------------------------------ ------------------------- Process --------------------------------
declare name "bandFilter"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; import("stdfaust.lib"); filter(Q,F,G) = fi.TF2( (1 + K/Q + K*K) / D, 2 * (K*K - 1) / D, (1 - K/Q + K*K) / D, 2 * (K*K - 1) / D, (1 - V*K/Q + K*K) / D ) with { V = ba.db2linear(G); K = tan(ma.PI*F/ma.SR); D = 1 + V*K/Q + K*K; }; bandfilter(F) = filter( nentry("Q factor [style:knob]",50,0.1,100,0.1), nentry("freq [unit:Hz][style:knob]", F, 20, 20000, 1), 0 - vslider("gain [unit:dB]", 0, -50, 50, 0.1) ); process = vgroup("Bandfilter", bandfilter(1000));
3b1511349ca72fe851c435384f68cfce7062b43b06823e864ca8d826988cbaa3
rottingsounds/bitDSP-faust
DSMSine.dsp
declare name "DSMSine"; declare author "Till Bovermann, Dario Sanfilippo"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); // plot // CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib dsm2-example.dsp // ./DSMSine -n 10 // compile // CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib dsm2-example.dsp // open ./DSMSine // SuperCollider // export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ // faust2supercollider -I ../faust/bitDSP-faust/lib -noprefix DSMSine.dsp freq = hslider("freq",100,0,20000,0); // High-precision sinewave sine(f) = sin(os.phasor(2 * ma.PI, f)); // Bipolar multi-bit signal to bipolar one-bit signal // Standard test with a 1 kHz tone onebitstream = bit.dsm2(sine(freq)); // Final output process = onebitstream;
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/21cf36105c55b6e18969a867a319530a0ef1ea63/examples/_sc/DSMSine.dsp
faust
plot CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib dsm2-example.dsp ./DSMSine -n 10 compile CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib dsm2-example.dsp open ./DSMSine SuperCollider export SUPERCOLLIDER_HEADERS=/localvol/sound/src/supercollider/include/ faust2supercollider -I ../faust/bitDSP-faust/lib -noprefix DSMSine.dsp High-precision sinewave Bipolar multi-bit signal to bipolar one-bit signal Standard test with a 1 kHz tone Final output
declare name "DSMSine"; declare author "Till Bovermann, Dario Sanfilippo"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); freq = hslider("freq",100,0,20000,0); sine(f) = sin(os.phasor(2 * ma.PI, f)); onebitstream = bit.dsm2(sine(freq)); process = onebitstream;
16c79a8e4eda52d08a5cd68ba11f6ceae98b347cdfbf9ae0d24f4793f819ecee
PierreKy-org/plugins_server_webaudiomodules
granulator.dsp
// FROM FAUST DEMO // Designed to use the Analog Input for parameter controls. // /////////////////////////////////////////////////////////////////////////////////////////////////// // // ANALOG IN: // ANALOG 0 : Grain Size // ANALOG 1 : Speed // ANALOG 2 : Probability // (others analog inputs are not used) // /////////////////////////////////////////////////////////////////////////////////////////////////// process = vgroup("Granulator", environment { declare name "Granulator"; declare author "Adapted from sfIter by Christophe Lebreton"; /* =========== DESCRIPTION ============= - The granulator takes very small parts of a sound, called GRAINS, and plays them at a varying speed - Front = Medium size grains - Back = short grains - Left Slow rhythm - Right = Fast rhythm - Bottom = Regular occurrences - Head = Irregular occurrences */ import("stdfaust.lib"); process = hgroup("Granulator", *(excitation : ampf)); excitation = noiseburst(gate,P) * (gain); ampf = an.amp_follower_ud(duree_env,duree_env); //----------------------- NOISEBURST ------------------------- noiseburst(gate,P) = no.noise : *(gate : trigger(P)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); trigger(n) = upfront : release(n) : > (0.0); }; //------------------------------------------------------------- P = freq; // fundamental period in samples freq = hslider("[1]GrainSize[BELA: ANALOG_0]", 200,5,2205,1); // the frequency gives the white noise band width Pmax = 4096; // maximum P (for de.delay-line allocation) // PHASOR_BIN ////////////////////////////// phasor_bin(init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); gate = phasor_bin(1) :-(0.001):pulsar; gain = 1; // PULSAR ////////////////////////////// // Pulsar allows to create a more or less random 'pulse'(proba). pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch)); speed = hslider ("[2]Speed[BELA: ANALOG_1]", 10,1,20,0.0001):fi.lowpass(1,1); ratio_env = 0.5; fade = (0.5); // min > 0 to avoid division by 0 proba = hslider ("[3]Probability[BELA: ANALOG_2]", 70,50,100,1) * (0.01):fi.lowpass(1,1); duree_env = 1/(speed: / (ratio_env*(0.25)*fade)); }.process);
https://raw.githubusercontent.com/PierreKy-org/plugins_server_webaudiomodules/a8162fbb0a9341ad67d3cbb78714e7a2f7c56b0b/plugins/granulator/granulator.dsp
faust
FROM FAUST DEMO Designed to use the Analog Input for parameter controls. ///////////////////////////////////////////////////////////////////////////////////////////////// ANALOG IN: ANALOG 0 : Grain Size ANALOG 1 : Speed ANALOG 2 : Probability (others analog inputs are not used) ///////////////////////////////////////////////////////////////////////////////////////////////// =========== DESCRIPTION ============= - The granulator takes very small parts of a sound, called GRAINS, and plays them at a varying speed - Front = Medium size grains - Back = short grains - Left Slow rhythm - Right = Fast rhythm - Bottom = Regular occurrences - Head = Irregular occurrences ----------------------- NOISEBURST ------------------------- ------------------------------------------------------------- fundamental period in samples the frequency gives the white noise band width maximum P (for de.delay-line allocation) PHASOR_BIN ////////////////////////////// PULSAR ////////////////////////////// Pulsar allows to create a more or less random 'pulse'(proba). min > 0 to avoid division by 0
process = vgroup("Granulator", environment { declare name "Granulator"; declare author "Adapted from sfIter by Christophe Lebreton"; import("stdfaust.lib"); process = hgroup("Granulator", *(excitation : ampf)); excitation = noiseburst(gate,P) * (gain); ampf = an.amp_follower_ud(duree_env,duree_env); noiseburst(gate,P) = no.noise : *(gate : trigger(P)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); trigger(n) = upfront : release(n) : > (0.0); }; freq = hslider("[1]GrainSize[BELA: ANALOG_0]", 200,5,2205,1); phasor_bin(init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); gate = phasor_bin(1) :-(0.001):pulsar; gain = 1; pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch)); speed = hslider ("[2]Speed[BELA: ANALOG_1]", 10,1,20,0.0001):fi.lowpass(1,1); ratio_env = 0.5; proba = hslider ("[3]Probability[BELA: ANALOG_2]", 70,50,100,1) * (0.01):fi.lowpass(1,1); duree_env = 1/(speed: / (ratio_env*(0.25)*fade)); }.process);
8905bc904a74557d73b02f8816041bf8e8864bb53a3288811b12d0c7429d90e8
jameslnrd/mi_introduction_workshop_2020
hammerOsc.dsp
declare name "Hammered Oscillator"; declare author "James Leonard"; declare date "April 2020"; /* ========= DESCRITPION ============= An oscillator struck by a hammer (a second "loose" oscillator placed above it) - inputs: force impulse onto the hammer mass - outputs: oscillator and hammer positions. - controls: none. Note: The "clicking" sound is because we are listening to the hammer mass position on the second output channel. Listening to this mass allows to plot the collision, but if you were just interested in the oscillator's sound you should only listen to that. */ import("stdfaust.lib"); in1 = button("Frc Input 1"): ba.impulsify * -0.1; OutGain = 1; model = ( mi.oscil(1., 0.1, 0.0003, 0, 0., 0.), mi.mass(0.3, 0, 1., 1.), mi.ground(1.), par(i, nbFrcIn,_): RoutingMassToLink , par(i, nbFrcIn,_): mi.springDamper(0.0001, 0.05, 1., 1.), mi.collision(0.1, 0.001, 0, 0., 1.), par(i, nbOut+nbFrcIn, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ RoutingMassToLink(m0, m1, m2) = /* routed positions */ m2, m1, m0, m1, /* outputs */ m0, m1; RoutingLinkToMass(l0_f1, l0_f2, l1_f1, l1_f2, p_out1, p_out2, f_in1) = /* routed forces */ l1_f1, f_in1 + l0_f2 + l1_f2, l0_f1, /* pass-through */ p_out1, p_out2; nbMass = 3; nbFrcIn = 1; nbOut = 2; }; process = in1 : model:*(OutGain), *(OutGain); /* ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard # Integrated harmonic oscillator @o osc 1. 0.1 0.0003 0. 0. # A slow moving oscillator placed above the other # serving as a hammer @ham mass 0.3 1. 0. @g ground 1. @sp springDamper @g @ham 0.0001 0.05 # Add force input to the hammer @in1 frcInput @ham @c contact @o @ham 0.1 0.001 # Add position output from the oscillator @out1 posOutput @o @out2 posOutput @ham # end of MIMS script */
https://raw.githubusercontent.com/jameslnrd/mi_introduction_workshop_2020/2f487dbc5b8e7cd83cbd962254e737bdb82948f6/03_HammerTime/hammerOsc.dsp
faust
========= DESCRITPION ============= An oscillator struck by a hammer (a second "loose" oscillator placed above it) - inputs: force impulse onto the hammer mass - outputs: oscillator and hammer positions. - controls: none. Note: The "clicking" sound is because we are listening to the hammer mass position on the second output channel. Listening to this mass allows to plot the collision, but if you were just interested in the oscillator's sound you should only listen to that. routed positions outputs routed forces pass-through ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard # Integrated harmonic oscillator @o osc 1. 0.1 0.0003 0. 0. # A slow moving oscillator placed above the other # serving as a hammer @ham mass 0.3 1. 0. @g ground 1. @sp springDamper @g @ham 0.0001 0.05 # Add force input to the hammer @in1 frcInput @ham @c contact @o @ham 0.1 0.001 # Add position output from the oscillator @out1 posOutput @o @out2 posOutput @ham # end of MIMS script
declare name "Hammered Oscillator"; declare author "James Leonard"; declare date "April 2020"; import("stdfaust.lib"); in1 = button("Frc Input 1"): ba.impulsify * -0.1; OutGain = 1; model = ( mi.oscil(1., 0.1, 0.0003, 0, 0., 0.), mi.mass(0.3, 0, 1., 1.), mi.ground(1.), par(i, nbFrcIn,_): RoutingMassToLink , par(i, nbFrcIn,_): mi.springDamper(0.0001, 0.05, 1., 1.), mi.collision(0.1, 0.001, 0, 0., 1.), par(i, nbOut+nbFrcIn, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ nbMass = 3; nbFrcIn = 1; nbOut = 2; }; process = in1 : model:*(OutGain), *(OutGain);
0978644648aa9dedcb11df2c29460aadee4adf8027f460af5f1a221dbbe2b52a
osam-cologne/faustsimplesynth
faustsimplesynth.dsp
// faustsimplesynth - a simple sawtooth wave synthesizer implemented in Faust // Copyright (C) 2018 Daniel Appelt // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. declare name "faustsimplesynth"; declare version "0.1.0"; declare author "Daniel Appelt"; declare license "GPL3"; declare copyright "Copyright (C) 2018 Daniel Appelt"; // Declaring nvoices takes care of creating a synth plugin / app declare nvoices "1"; import("stdfaust.lib"); // MIDI note input (by naming convention) midigate = button("gate [hidden]"); midifreq = hslider("freq [unit:Hz][hidden]", 440, 20, 20000, 1); midigain = hslider("gain [hidden]", 0.5, 0, 1, 0.001); // ADSR amp envelope a = hslider("h:Env/[0]Attack [unit: s][scale:log][style:knob]", 0.1, 0.001, 2, 0.001); d = hslider("h:Env/[1]Decay [unit: s][scale:log][style:knob]", 0.3, 0.001, 2, 0.001); s = hslider("h:Env/[2]Sustain [style:knob]", 0.8, 0, 1, 0.01); r = hslider("h:Env/[2]Release [unit: s][scale:log][style:knob]", 2.0, 0.001, 4, 0.001); // Volume always sets the maximum loudness amp_vol = hslider("h:Amplifier/[0]Volume [style:knob]", 0.5, 0, 1, 0.01); // Velocity determines how much of the volume will be affected by MIDI note velocity. // 0 = no effect, 1 = max velocity leads to max volume, -1 = min velocity leads to max volume amp_vel = hslider("h:Amplifier/[1]Velocity [style:knob]", 0, -1, 1, 0.01); amp_mod = (midigain * amp_vel + (amp_vel < 0) + 1 - abs(amp_vel)) * en.adsr(a, d, s, r, midigate); process = midifreq : os.sawtooth * amp_mod * amp_vol;
https://raw.githubusercontent.com/osam-cologne/faustsimplesynth/a283944a816dd41fd4986a7dede5a14399c04200/src/faustsimplesynth.dsp
faust
faustsimplesynth - a simple sawtooth wave synthesizer implemented in Faust Copyright (C) 2018 Daniel Appelt This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Declaring nvoices takes care of creating a synth plugin / app MIDI note input (by naming convention) ADSR amp envelope Volume always sets the maximum loudness Velocity determines how much of the volume will be affected by MIDI note velocity. 0 = no effect, 1 = max velocity leads to max volume, -1 = min velocity leads to max volume
declare name "faustsimplesynth"; declare version "0.1.0"; declare author "Daniel Appelt"; declare license "GPL3"; declare copyright "Copyright (C) 2018 Daniel Appelt"; declare nvoices "1"; import("stdfaust.lib"); midigate = button("gate [hidden]"); midifreq = hslider("freq [unit:Hz][hidden]", 440, 20, 20000, 1); midigain = hslider("gain [hidden]", 0.5, 0, 1, 0.001); a = hslider("h:Env/[0]Attack [unit: s][scale:log][style:knob]", 0.1, 0.001, 2, 0.001); d = hslider("h:Env/[1]Decay [unit: s][scale:log][style:knob]", 0.3, 0.001, 2, 0.001); s = hslider("h:Env/[2]Sustain [style:knob]", 0.8, 0, 1, 0.01); r = hslider("h:Env/[2]Release [unit: s][scale:log][style:knob]", 2.0, 0.001, 4, 0.001); amp_vol = hslider("h:Amplifier/[0]Volume [style:knob]", 0.5, 0, 1, 0.01); amp_vel = hslider("h:Amplifier/[1]Velocity [style:knob]", 0, -1, 1, 0.01); amp_mod = (midigain * amp_vel + (amp_vel < 0) + 1 - abs(amp_vel)) * en.adsr(a, d, s, r, midigate); process = midifreq : os.sawtooth * amp_mod * amp_vol;
36b6b1dd77bd663d212dbeafb31db7681720615685bb55f3838babfa5e5881a7
clearly-broken-software/Uprising
test.dsp
import("stdfaust.lib"); declare author "Bart Brouns"; declare license "GPLv3"; xVal = hslider("xVal", 0, 0, maxSamples, 1)/defaultSR*ma.SR; yVal = hslider("yVal", 0, 0, 1, 0.001); slope = hslider("slope", 0, -1, 1, 0.001); goBtn = button("resetBtn");//:ba.impulsify; maxSeconds = 5; maxSamples = maxSeconds*defaultSR; defaultSR = 48000; process = envelope; // ramp from 0 to 1 in n samples. // when reset == 1, go back to 0. ramp(n,reset) = select2(reset,_+(1/n):min(1),0)~_; xVal_target(reset) = rwtable(3, 0.0,nextValIndex(reset),xVal,currentValIndex(reset)); yVal_target(reset) = rwtable(3, 0.0,nextValIndex(reset),yVal,currentValIndex(reset)); currentValIndex(reset) = reset :ba.toggle; nextValIndex(reset) = currentValIndex(reset)*-1+1; xfade(a,b,x) = a*(1-x)+b*x; envelope = FB~_ with { FB(prev) = ((xfade(ba.sAndH(reset),yVal_target(reset),position)+(yVal*startPulse))~(_)) ,(reset':ba.impulsify:hbargraph("[1]endpoint", 0, 1)) with { reset = ( (prev==yVal_target(_)) :xor(goBtn) )~(_<:(_,_)); position = ramp(xVal_target(reset),reset):hbargraph("[0]position", 0, 1); // the commented out stuff is WIP for changing the curve of the ramp // position = ramp(xVal_target(reset),reset):hbargraph("pos", 0, 1):pow(power):max(0):min(1); }; startPulse = 1-1'; // power = select2(slope<0,slope*px+1,1+slope*mx):hbargraph("power", 0, 10); // px = hslider("px", 1, 1, 9, 1); // mx = hslider("mx", 0.5, 0, 1, 0.001); };
https://raw.githubusercontent.com/clearly-broken-software/Uprising/89f5b49d90cd47611da7e7dc2009061768716b4c/plugins/uprising/dsp/faust/test.dsp
faust
:ba.impulsify; ramp from 0 to 1 in n samples. when reset == 1, go back to 0. the commented out stuff is WIP for changing the curve of the ramp position = ramp(xVal_target(reset),reset):hbargraph("pos", 0, 1):pow(power):max(0):min(1); power = select2(slope<0,slope*px+1,1+slope*mx):hbargraph("power", 0, 10); px = hslider("px", 1, 1, 9, 1); mx = hslider("mx", 0.5, 0, 1, 0.001);
import("stdfaust.lib"); declare author "Bart Brouns"; declare license "GPLv3"; xVal = hslider("xVal", 0, 0, maxSamples, 1)/defaultSR*ma.SR; yVal = hslider("yVal", 0, 0, 1, 0.001); slope = hslider("slope", 0, -1, 1, 0.001); maxSeconds = 5; maxSamples = maxSeconds*defaultSR; defaultSR = 48000; process = envelope; ramp(n,reset) = select2(reset,_+(1/n):min(1),0)~_; xVal_target(reset) = rwtable(3, 0.0,nextValIndex(reset),xVal,currentValIndex(reset)); yVal_target(reset) = rwtable(3, 0.0,nextValIndex(reset),yVal,currentValIndex(reset)); currentValIndex(reset) = reset :ba.toggle; nextValIndex(reset) = currentValIndex(reset)*-1+1; xfade(a,b,x) = a*(1-x)+b*x; envelope = FB~_ with { FB(prev) = ((xfade(ba.sAndH(reset),yVal_target(reset),position)+(yVal*startPulse))~(_)) ,(reset':ba.impulsify:hbargraph("[1]endpoint", 0, 1)) with { reset = ( (prev==yVal_target(_)) :xor(goBtn) )~(_<:(_,_)); position = ramp(xVal_target(reset),reset):hbargraph("[0]position", 0, 1); }; startPulse = 1-1'; };
8377f08e3c150ae8f9d741e065315617a020231da2661c1e31773149ec264821
sonejostudios/DeLooper
DeLooper.dsp
declare name "DeLooper"; declare version "1.0"; declare author "Vincent Rateau"; declare license "GPL v3"; declare reference "www.sonejo.net"; declare description "Sample-accurate Looper/Delay with free mode and midi-clock sync mode"; import("stdfaust.lib"); // variables at compilation time loopsec = 32 ; //max loop time (sec) process = masterloop ; masterloop = _ <: _*(1-switcher), _*switcher : ((loop*loopvol*mute), _) :> _ ; switcher = (rec*looptime) == 0 : si.smooth(0.99) ; // bypass signal if looptime == 0 loop = + ~ de.fdelay(8388608, looptime)*erase*loopfback ; // fdelay better because sdelay makes a dobble signal bug in free mode //Compute the loop time in free mode and sync mode and switch between them //////////////////////////////////// looptime = select2(sync, counttime, barssync) : _/divide : looplength : int with { counttime = ba.countup(ma.SR*loopsec, (1-setloop) ) : ba.sAndH(setloop != new) ; // : looplength2 ; // sync mode with more-or-less function barssync = counttime <: barsync2, _ : moreless : _ - midiclock2beat : _ + setloop*midiclock2beat ; barsync2 = _ / midiclock2beat : int : _*midiclock2beat : _ + midiclock2beat ; moreless(x,y) = select2(setrange(x,y), x, x + midiclock2beat ) ; setrange(x,y) = (y > (x - midiclock2beat/2))*(y < (x + midiclock2beat/2)) ; }; // GUI ///////////////////// setloop = checkbox("set loop length[midi:ctrl 59]") ; rec = checkbox("rec[midi:ctrl 60]") ; new = button("set new loop[midi:ctrl 58]") : ba.impulsify ; looplength = vbargraph("loop length",0, 44100*loopsec) ; // (== looplength2 in free mode, but snyced in sync mode) //looplength2 = vbargraph("real loop length",0, 44100*loopsec) ; // the real number of the sample counter sync = checkbox("sync") ; erase = 1-button("erase") : si.smooth(0.99); loopfback = hslider("feedback",1,0,1,0.01) : si.smooth(0.999); loopvol = hslider("loop vol[midi:ctrl 118]",1,0,1,0.01) : si.smooth(0.999); mute = 1-checkbox("mute") : si.smooth(0.999); divide = nentry("divide loop length by",1,1,100,1) : si.smooth(ba.tau2pole(2)); //MIDICLOCK to BEAT (AMOUNT OF SAMPLES IN 1 BEAT) to BPM and SAMPLES ////////////////////////////////// //send midi clock signal, count sample amount, latch stable signal between beat recognition (after 16000 samples), convert to bpm, // convert bpm to sample-accurate loop length (in sample) midiclock2beat = vgroup("MIDI Clock",((clocker, play)) : attach : midi2count <: (_@16000==_@16001), _ : ba.latch : s2bpm : int : bpm2s : result3) with{ //clockersim = ba.pulse(1837.5 /2) ; // replace it with clocker for internal clock for testing clocker = checkbox("Clock Signal[midi:clock]") ; // create a square signal (1/0), changing state at each received clock play = checkbox("Start/Stop Signal[midi:start] [midi:stop]") ; // just to show start stop signal // takes clocker signal(24 changes/beat), count samples between every changes, latch the highest number. // re-latch to fix the highest number, * by 24 to get on beat (in samples) midi2count = _ <: _ != _@1 : ba.countup(8388608,_) : result1 <: _==0,_@1 : ba.latch <: _>_@1, _ : ba.latch : _*24 : result2; result1 = _ ; //: vbargraph("samplecount midi", 0, 8388608); result2 = _ ; //: vbargraph("sample amount midi2", 0, 8388608); result3 = _ ; //: vbargraph("one-beat length (samples) from bpm", 0, 8388608); // convert bpm to sample amount for loop length bpm2s = 60/_ : _* ma.SR ; // round down sampleholder and convert it to bpm s2bpm = _/10 : int : _*10 : ma.SR/_ : _*60 : int : bpm ; bpm = vbargraph("bpm", 0, 240.0) ; };
https://raw.githubusercontent.com/sonejostudios/DeLooper/0ff9ac414d6c7daa3ef494d43524b9e1c9e3f7f5/DeLooper.dsp
faust
variables at compilation time max loop time (sec) bypass signal if looptime == 0 fdelay better because sdelay makes a dobble signal bug in free mode Compute the loop time in free mode and sync mode and switch between them ////////////////////////////////// : looplength2 ; sync mode with more-or-less function GUI /////////////////// (== looplength2 in free mode, but snyced in sync mode) looplength2 = vbargraph("real loop length",0, 44100*loopsec) ; // the real number of the sample counter MIDICLOCK to BEAT (AMOUNT OF SAMPLES IN 1 BEAT) to BPM and SAMPLES //////////////////////////////// send midi clock signal, count sample amount, latch stable signal between beat recognition (after 16000 samples), convert to bpm, convert bpm to sample-accurate loop length (in sample) clockersim = ba.pulse(1837.5 /2) ; // replace it with clocker for internal clock for testing create a square signal (1/0), changing state at each received clock just to show start stop signal takes clocker signal(24 changes/beat), count samples between every changes, latch the highest number. re-latch to fix the highest number, * by 24 to get on beat (in samples) : vbargraph("samplecount midi", 0, 8388608); : vbargraph("sample amount midi2", 0, 8388608); : vbargraph("one-beat length (samples) from bpm", 0, 8388608); convert bpm to sample amount for loop length round down sampleholder and convert it to bpm
declare name "DeLooper"; declare version "1.0"; declare author "Vincent Rateau"; declare license "GPL v3"; declare reference "www.sonejo.net"; declare description "Sample-accurate Looper/Delay with free mode and midi-clock sync mode"; import("stdfaust.lib"); process = masterloop ; masterloop = _ <: _*(1-switcher), _*switcher : ((loop*loopvol*mute), _) :> _ ; looptime = select2(sync, counttime, barssync) : _/divide : looplength : int with { barssync = counttime <: barsync2, _ : moreless : _ - midiclock2beat : _ + setloop*midiclock2beat ; barsync2 = _ / midiclock2beat : int : _*midiclock2beat : _ + midiclock2beat ; moreless(x,y) = select2(setrange(x,y), x, x + midiclock2beat ) ; setrange(x,y) = (y > (x - midiclock2beat/2))*(y < (x + midiclock2beat/2)) ; }; setloop = checkbox("set loop length[midi:ctrl 59]") ; rec = checkbox("rec[midi:ctrl 60]") ; new = button("set new loop[midi:ctrl 58]") : ba.impulsify ; sync = checkbox("sync") ; erase = 1-button("erase") : si.smooth(0.99); loopfback = hslider("feedback",1,0,1,0.01) : si.smooth(0.999); loopvol = hslider("loop vol[midi:ctrl 118]",1,0,1,0.01) : si.smooth(0.999); mute = 1-checkbox("mute") : si.smooth(0.999); divide = nentry("divide loop length by",1,1,100,1) : si.smooth(ba.tau2pole(2)); midiclock2beat = vgroup("MIDI Clock",((clocker, play)) : attach : midi2count <: (_@16000==_@16001), _ : ba.latch : s2bpm : int : bpm2s : result3) with{ midi2count = _ <: _ != _@1 : ba.countup(8388608,_) : result1 <: _==0,_@1 : ba.latch <: _>_@1, _ : ba.latch : _*24 : result2; bpm2s = 60/_ : _* ma.SR ; s2bpm = _/10 : int : _*10 : ma.SR/_ : _*60 : int : bpm ; bpm = vbargraph("bpm", 0, 240.0) ; };
51bd5286935b6bfb490f5088cca10b48317ff6aefe952728cab067dbb2a2f112
afalaize/faust
DNN.dsp
// Forward Deep Neural Net (DNN), any number of layers of any size each declare name "DNN"; declare author "JOS"; declare license "STK-4.3"; import("stdfaust.lib"); layerSizes = (8,5,8); // autoencoder with 8 in & out, 5-state hidden layer w(m,n,k) = m*100+n*10+k; // placeholder weights: m=layer, n=fromNode, k=destNode M = ba.count(layerSizes); N(l) = ba.take(l+1,layerSizes); // Nodes per layer process = seq(m, M-1, layer(m)) // look at weights: // process = par(m,M,par(n,N(m),par(k,N(m),w(m,n,k)))) with { layer(m) = weights(m) :> nonlinearities(m); nonlinearities(m) = bus(N(m)*N(m+1)) :> par(n,N(m+1),nl(n)); weights(m) = bus(N(m)) <: par(n,N(m),(bus(N(m+1))<:wts(m,n))); wts(m,n) = bus(N(m+1)) : par(k,N(m+1),*(w(m,n,k))); nl(n,x) = x * (x>0); // ReLU bus(N) = par(k,N,_); };
https://raw.githubusercontent.com/afalaize/faust/8f9f5fe3aa167eaeecc15a99d4da984ac2797be3/examples/filtering/DNN.dsp
faust
Forward Deep Neural Net (DNN), any number of layers of any size each autoencoder with 8 in & out, 5-state hidden layer placeholder weights: m=layer, n=fromNode, k=destNode Nodes per layer look at weights: process = par(m,M,par(n,N(m),par(k,N(m),w(m,n,k)))) ReLU
declare name "DNN"; declare author "JOS"; declare license "STK-4.3"; import("stdfaust.lib"); M = ba.count(layerSizes); process = seq(m, M-1, layer(m)) with { layer(m) = weights(m) :> nonlinearities(m); nonlinearities(m) = bus(N(m)*N(m+1)) :> par(n,N(m+1),nl(n)); weights(m) = bus(N(m)) <: par(n,N(m),(bus(N(m+1))<:wts(m,n))); wts(m,n) = bus(N(m+1)) : par(k,N(m+1),*(w(m,n,k))); bus(N) = par(k,N,_); };
27814aa5531e4dbc4ee7eadca0578d3290aa4bb09e9a3dcc9086e538b236f38f
CICM-research-composition/livepatching
help.dsp
process = vgroup("SAtonalSoftHarp",environment{declare name "Atonal Soft Harp"; declare author "ER"; //Adapted from NLFeks by Julius Smith and Romain Michon; /* =============== DESCRIPTION ======================== : - Soft Atonal Harp - Swing = Plucking all the strings one by one - Left = Slow rhythm /Low frequencies/ Silence - Right = Fast rhythm/ High frequencies - Back = Short and dry notes - Front = Long and bright notes */ import("stdfaust.lib"); //==================== INSTRUMENT ======================= process = par(i, N, NFLeks(i)):>_; NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); //==================== GUI SPECIFICATION ================ N = 20; hand = hslider("h:[1]/Hand[acc:0 1 -10 0 10]", 10, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate with{ bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; gain = 1; pickangle = 0.9; beta = 0.5; // String decay time in seconds: t60 = hslider("h:[2]Reverberation/ Resonance[unit:s][acc:2 1 -10 0 10]", 5, 0.5, 10, 0.01):min(10):max(0.5); // -60db decay time (sec) B = 0; L = -10 : ba.db2linear; //---------------------------------- FREQUENCY TABLE --------------------------- freq(0) = 200; freq(1) = 215; freq(2) = 230; freq(3) = 245; freq(4) = 260; freq(5) = 275; freq(d) = freq(d-6)*(2); //==================== SIGNAL PROCESSING ================ //----------------------- noiseburst ------------------------- // White noise burst (adapted from Faust's karplus.dsp example) // Requires music.lib (for no.noise) noiseburst(d,e) = no.noise : *(trigger(d,e)) with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; P(f) = ma.SR/f ; // fundamental period in samples Pmax = 4096; // maximum P (for delay-line allocation) ppdel(f) = beta*P(f); // pick position delay pickposfilter(f) = fi.ffcombfilter(Pmax,ppdel(f),-1); // defined in filter.lib excitation(d,e) = noiseburst(d,e) : *(gain); // defined in signal.lib rho(f) = pow(0.001,1.0/(f*t60)); // multiplies loop-gain // Original EKS damping filter: b1 = 0.5*B; b0 = 1.0-b1; // S and 1-S dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); // Linear phase FIR3 damping filter: h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); loopfilter(f) = dampingfilter2(f); // or dampingfilter1 filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) : pickposfilter(f) : fi.levelfilter(L,f); // see filter.lib stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); }.process);
https://raw.githubusercontent.com/CICM-research-composition/livepatching/da47667b3f5236b4b81cb05593f35d408caaca9e/source/help.dsp
faust
Adapted from NLFeks by Julius Smith and Romain Michon; =============== DESCRIPTION ======================== : - Soft Atonal Harp - Swing = Plucking all the strings one by one - Left = Slow rhythm /Low frequencies/ Silence - Right = Fast rhythm/ High frequencies - Back = Short and dry notes - Front = Long and bright notes ==================== INSTRUMENT ======================= ==================== GUI SPECIFICATION ================ => gate String decay time in seconds: -60db decay time (sec) ---------------------------------- FREQUENCY TABLE --------------------------- ==================== SIGNAL PROCESSING ================ ----------------------- noiseburst ------------------------- White noise burst (adapted from Faust's karplus.dsp example) Requires music.lib (for no.noise) fundamental period in samples maximum P (for delay-line allocation) pick position delay defined in filter.lib defined in signal.lib multiplies loop-gain Original EKS damping filter: S and 1-S Linear phase FIR3 damping filter: or dampingfilter1 see filter.lib
process = vgroup("SAtonalSoftHarp",environment{declare name "Atonal Soft Harp"; import("stdfaust.lib"); process = par(i, N, NFLeks(i)):>_; NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n)); N = 20; with{ bps = hslider("h:[1]/Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 1):si.smooth(0.999) : min(720) : max(180) : int; }; gain = 1; pickangle = 0.9; beta = 0.5; B = 0; L = -10 : ba.db2linear; freq(0) = 200; freq(1) = 215; freq(2) = 230; freq(3) = 245; freq(4) = 260; freq(5) = 275; freq(d) = freq(d-6)*(2); noiseburst(d,e) = no.noise : *(trigger(d,e)) with{ upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); position(d) = abs(hand - d) < 0.5; trigger(d,n) = position(d) : upfront : release(n) : > (0.0); }; dampingfilter1(f,x) = rho(f) * ((b0 * x) + (b1 * x')); h0 = (1.0 + B)/2; h1 = (1.0 - B)/4; dampingfilter2(f,x) = rho(f) * (h0 * x' + h1*(x+x'')); filtered_excitation(d,e,f) = excitation(d,e) : si.smooth(pickangle) stringloop(f) = (+ : de.fdelay4(Pmax, P(f)-2)) ~ (loopfilter(f)); }.process);
63fcd9dc923f0deee8318cba9745e5f89733158d01372a4ab1e2bfebbb845fa3
friskgit/snares
snare_multi.dsp
// -*- compile-command: "cd .. && make sc && cd -"; -*- declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); //---------------`Snare drum synth` -------------------------- // A take at a snare drum synth // // Each hit is output to a channel <= channels as controlled by the lfo // in rndctrl. Due to the ma.fabs, there is a greater chance that signal // is sent to lower outputs than higher // // Where: // * midi note 67-89 // * stiffness 0-0.55 (mapped to note as in note 67 -> 0)§ // * midi velocity 75-127 // * midi velocity is mapped to pressure // A useful parameter setting is: // // // 30 Juni 2018 Henrik Frisk [email protected] //--------------------------------------------------- channels = 14; integ(x) = x - ma.frac(x); imp = ba.pulse(hslider("tempo", 1000, 500, 10000, 1)); // env = en.ar(0.000001, 0.1, button("play")); env = en.ar(attack, rel, imp) * amp with { attack = hslider("attack", 0.00000001, 0, 0.1, 0.000000001) : si.smooth(0.1); rel = hslider("rel", 0.1, 0.0000001, 0.5, 0.0000001) : si.smooth(0.2); // imp = button("gate"); amp = hslider("vol", 0.5, 0, 1, 0.0001); }; // Control the output channel focus = hslider("focus", 1, 0, 1, 0.0001); position = hslider("position", 1, 0, channels, 1); rate = ma.SR/1000.0; rndctrl = (no.lfnoise(rate) * (channels + 1)) * focus : ma.fabs + position : int ; outputctrl = rndctrl : ba.sAndH(imp); n = no.multinoise(8) : par(i, 8, _ * env * 0.1); filt = fi.resonbp(frq, q, gain) with { frq = hslider("freq", 200, 50, 5000, 0.1); q = hslider("q", 1, 0.01, 10, 0.01); gain = hslider("gain", 0, 0, 2, 0.00001); }; ch_wrapped = ma.modulo(outputctrl, channels); process = n : par(i, 8, filt) :> ba.selectoutn(channels, ch_wrapped); //process = n : par(i, 8, filt) :> _,_;
https://raw.githubusercontent.com/friskgit/snares/bb43ea5e706a0ead6d65dd176a5c492b2f5d8f74/faust/snare/src/snare_multi.dsp
faust
-*- compile-command: "cd .. && make sc && cd -"; -*- ---------------`Snare drum synth` -------------------------- A take at a snare drum synth Each hit is output to a channel <= channels as controlled by the lfo in rndctrl. Due to the ma.fabs, there is a greater chance that signal is sent to lower outputs than higher Where: * midi note 67-89 * stiffness 0-0.55 (mapped to note as in note 67 -> 0)§ * midi velocity 75-127 * midi velocity is mapped to pressure A useful parameter setting is: 30 Juni 2018 Henrik Frisk [email protected] --------------------------------------------------- env = en.ar(0.000001, 0.1, button("play")); imp = button("gate"); Control the output channel process = n : par(i, 8, filt) :> _,_;
declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); channels = 14; integ(x) = x - ma.frac(x); imp = ba.pulse(hslider("tempo", 1000, 500, 10000, 1)); env = en.ar(attack, rel, imp) * amp with { attack = hslider("attack", 0.00000001, 0, 0.1, 0.000000001) : si.smooth(0.1); rel = hslider("rel", 0.1, 0.0000001, 0.5, 0.0000001) : si.smooth(0.2); amp = hslider("vol", 0.5, 0, 1, 0.0001); }; focus = hslider("focus", 1, 0, 1, 0.0001); position = hslider("position", 1, 0, channels, 1); rate = ma.SR/1000.0; rndctrl = (no.lfnoise(rate) * (channels + 1)) * focus : ma.fabs + position : int ; outputctrl = rndctrl : ba.sAndH(imp); n = no.multinoise(8) : par(i, 8, _ * env * 0.1); filt = fi.resonbp(frq, q, gain) with { frq = hslider("freq", 200, 50, 5000, 0.1); q = hslider("q", 1, 0.01, 10, 0.01); gain = hslider("gain", 0, 0, 2, 0.00001); }; ch_wrapped = ma.modulo(outputctrl, channels); process = n : par(i, 8, filt) :> ba.selectoutn(channels, ch_wrapped);
3075f484cc33c701fce57660447e394e40776ef34ff3efd01b6de8477aee6964
friskgit/snares
i_snare_phase_disp.dsp
// -*- compile-command: "cd .. && make sc src=i_snare_phase_disp.dsp && cd -"; -*-&& cd -"; -*- declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); import("math.lib") ; // for PI definition import("music.lib") ; // for osci definition //---------------`Snare drum dispersing over X channels` -------------------------- // // Generating an impulse and feeding it to a generic_snarefs. Each impulse is delayed by 25% // and sent to a separate instance of generic_snarefs. This allows for faster impulses 4X the // speed of the pulse which is in samples. // // disperse.dsp doe not pass on the impules as generic_snarefs does. // // 18 Juli 2019 Henrik Frisk [email protected] //--------------------------------------------------- p = hslider("pulse[scale:exp]", 1, 1, 2000, 0.1) : si.smooth(0.5); //per = hslider("pulse", 192000, 10, 192000, 1) : *(4); per = ma.SR / p : int : *(4); //p = hslider("pulse", 1, 1, 1000, 0.01); imp = ba.pulse(per); impsp = ba.pulse(per / 4); // imp = os.imptrain(p); delA = per : *(0.25); delB = per : *(0.5); delC = per : *(0.75); imp_delA = imp : de.sdelay(192000, 64, delA); imp_delB = imp : de.sdelay(192000, 64, delB); imp_delC = imp : de.sdelay(192000, 64, delC); //imp = os.impulse; // divisor = 0.25; // snares(d) = imp : de.sdelay(192000, 64, (per : *(divisor * d))) : component("generic_snarefs.dsp"); // process = par(i, 4, snares(i+1)); // n = (p / 20000) - 1 : ma.fabs : ma.log1p; process = impsp, ((imp : component("generic_snarefs.dsp")), (imp_delA : component("generic_snarefs.dsp")), (imp_delB : component("generic_snarefs.dsp")), (imp_delC : component("generic_snarefs.dsp")) :> _ ) : component("disperse.dsp")[channels = 29;];
https://raw.githubusercontent.com/friskgit/snares/bb43ea5e706a0ead6d65dd176a5c492b2f5d8f74/faust/snare/src/i_snare_phase_disp.dsp
faust
-*- compile-command: "cd .. && make sc src=i_snare_phase_disp.dsp && cd -"; -*-&& cd -"; -*- for PI definition for osci definition ---------------`Snare drum dispersing over X channels` -------------------------- Generating an impulse and feeding it to a generic_snarefs. Each impulse is delayed by 25% and sent to a separate instance of generic_snarefs. This allows for faster impulses 4X the speed of the pulse which is in samples. disperse.dsp doe not pass on the impules as generic_snarefs does. 18 Juli 2019 Henrik Frisk [email protected] --------------------------------------------------- per = hslider("pulse", 192000, 10, 192000, 1) : *(4); p = hslider("pulse", 1, 1, 1000, 0.01); imp = os.imptrain(p); imp = os.impulse; divisor = 0.25; snares(d) = imp : de.sdelay(192000, 64, (per : *(divisor * d))) : component("generic_snarefs.dsp"); process = par(i, 4, snares(i+1)); n = (p / 20000) - 1 : ma.fabs : ma.log1p;
declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); p = hslider("pulse[scale:exp]", 1, 1, 2000, 0.1) : si.smooth(0.5); per = ma.SR / p : int : *(4); imp = ba.pulse(per); impsp = ba.pulse(per / 4); delA = per : *(0.25); delB = per : *(0.5); delC = per : *(0.75); imp_delA = imp : de.sdelay(192000, 64, delA); imp_delB = imp : de.sdelay(192000, 64, delB); imp_delC = imp : de.sdelay(192000, 64, delC); process = impsp, ((imp : component("generic_snarefs.dsp")), (imp_delA : component("generic_snarefs.dsp")), (imp_delB : component("generic_snarefs.dsp")), (imp_delC : component("generic_snarefs.dsp")) :> _ ) : component("disperse.dsp")[channels = 29;];
fc45fb557c5528aa7c201bec3f2c45de3ccac7234f7ff08249625869ac344d48
afalaize/faust
karplus32.dsp
declare name "karplus32"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; //----------------------------------------------- // karplus-strong // with 32 resonators in parallel //----------------------------------------------- import("stdfaust.lib"); // Excitator //----------- upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); trigger(n) = upfront : release(n) : >(0.0) : +(leak); leak = 1.0/65536.0; size = hslider("excitation (samples)", 128, 2, 512, 1); // Resonator //----------- dur = hslider("duration (samples)", 128, 2, 512, 1); att = hslider("attenuation", 0.1, 0, 1, 0.01); average(x) = (x+x')/2; resonator(d, a) = (+ : de.delay(4096, d-1.5)) ~ (average : *(1.0-a)) ; // Polyphony //----------- detune = hslider("detune", 32, 0, 512, 1); polyphony = hslider("polyphony", 1, 0, 32, 1); output = hslider("output volume", 0.5, 0, 1, 0.1); process = vgroup("karplus32", vgroup("noise generator", no.noise * hslider("level", 0.5, 0, 1, 0.1)) : vgroup("excitator", *(button("play"): trigger(size))) <: vgroup("resonator x32", par(i,32, resonator(dur+i*detune, att) * (polyphony > i))) :> *(output),*(output) );
https://raw.githubusercontent.com/afalaize/faust/8f9f5fe3aa167eaeecc15a99d4da984ac2797be3/examples/physicalModeling/old/karplus32.dsp
faust
----------------------------------------------- karplus-strong with 32 resonators in parallel ----------------------------------------------- Excitator ----------- Resonator ----------- Polyphony -----------
declare name "karplus32"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; import("stdfaust.lib"); upfront(x) = (x-x') > 0.0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); trigger(n) = upfront : release(n) : >(0.0) : +(leak); leak = 1.0/65536.0; size = hslider("excitation (samples)", 128, 2, 512, 1); dur = hslider("duration (samples)", 128, 2, 512, 1); att = hslider("attenuation", 0.1, 0, 1, 0.01); average(x) = (x+x')/2; resonator(d, a) = (+ : de.delay(4096, d-1.5)) ~ (average : *(1.0-a)) ; detune = hslider("detune", 32, 0, 512, 1); polyphony = hslider("polyphony", 1, 0, 32, 1); output = hslider("output volume", 0.5, 0, 1, 0.1); process = vgroup("karplus32", vgroup("noise generator", no.noise * hslider("level", 0.5, 0, 1, 0.1)) : vgroup("excitator", *(button("play"): trigger(size))) <: vgroup("resonator x32", par(i,32, resonator(dur+i*detune, att) * (polyphony > i))) :> *(output),*(output) );
5797d29298865cb574def425fecc17a7a7880d2bb85c3707d1c4adb72a9b4f7d
afalaize/faust
tester.dsp
declare name "tester"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; //----------------------------------------------- // Tester : tests louspeakers // Send a test signal( sine, noise, pink) to one // of 8 loudspeakers //----------------------------------------------- import("stdfaust.lib"); // TODO: this should be rewritten with the pink noise function of noises.lib pink = f : (+ ~ g) with { f(x) = 0.04957526213389*x - 0.06305581334498*x' + 0.01483220320740*x''; g(x) = 1.80116083982126*x - 0.80257737639225*x'; }; // User interface //---------------- vol = hslider("[2] volume [unit:dB]", -96, -96, 0, 1): ba.db2linear : si.smoo; freq = hslider("[1] freq [unit:Hz]", 1000, 10, 20000, 1); dest = hslider("[3] destination", 0, 0, 8, 1); testsignal = os.osci(freq)*checkbox("sine wave") + no.noise * checkbox("white noise") + pink(no.noise) * ba.db2linear(20) * checkbox("pink noise"); process = vgroup( "Audio Tester", testsignal*vol <: par(i, 8, *(dest==i)) );
https://raw.githubusercontent.com/afalaize/faust/8f9f5fe3aa167eaeecc15a99d4da984ac2797be3/examples/misc/tester.dsp
faust
----------------------------------------------- Tester : tests louspeakers Send a test signal( sine, noise, pink) to one of 8 loudspeakers ----------------------------------------------- TODO: this should be rewritten with the pink noise function of noises.lib User interface ----------------
declare name "tester"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; import("stdfaust.lib"); pink = f : (+ ~ g) with { f(x) = 0.04957526213389*x - 0.06305581334498*x' + 0.01483220320740*x''; g(x) = 1.80116083982126*x - 0.80257737639225*x'; }; vol = hslider("[2] volume [unit:dB]", -96, -96, 0, 1): ba.db2linear : si.smoo; freq = hslider("[1] freq [unit:Hz]", 1000, 10, 20000, 1); dest = hslider("[3] destination", 0, 0, 8, 1); testsignal = os.osci(freq)*checkbox("sine wave") + no.noise * checkbox("white noise") + pink(no.noise) * ba.db2linear(20) * checkbox("pink noise"); process = vgroup( "Audio Tester", testsignal*vol <: par(i, 8, *(dest==i)) );
cd2c4a4b7cb0e9c8ba9317175b2d4b1651357ad173f84ff64028d494cb3a0ad2
sekisushai/ambitools
hoa_mirroring.dsp
declare name "HOA scene mirroring"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2015"; // Description: This tool mirros an HOA scene: Axes left-right, front-back, up-down can be reversed by changing a the sign of particular spherical harmonics [1,p.46-47] // References: // [1] Kronlachner, M. (2014). Spatial Transformations for the Alteration of Ambisonic Recordings. Graz University Of Technology, Austria. // Inputs: (M+1)^2 // Outputs: (M+1)^2 import("stdfaust.lib"); ud=checkbox("up-down"); lr=checkbox("left-right"); fb=checkbox("front-back"); M = 10; //up-down switching: all spherical harmonics with order and degree as m+n odd updown = par(m,M+1,par(i,2*m+1,term with{ term = _<:ba.if((ud==1) & (i%2==1),_*-1,_); // i+m^2 = m^2+m+n }) ); //left-right switching : all spherical harmonics of degree n<0 leftright = par(m,M+1,par(i,2*m+1,term with{ term = _<:ba.if((lr==1) & ((i-m)<0),_*-1,_); // i+m^2 = m^2+m+n }) ); //front-back switching : all spherical harmonics of degree (n<0 & n even) or (n>0 & n odd) frontback = par(m,M+1,par(i,2*m+1,term with{ term = _<: ba.if( ((fb==1) & ( ( ((i-m)<0) & ((i-m)%2==0) ) | ( ((i-m)>0) & ((i-m)%2==1) ) ) ) ,_*-1,_); // i+m^2 = m^2+m+n }) ); process=vgroup("HOA scene mirroring",updown:leftright:frontback); //EXAMPLE AT ORDER 5 //up-down switching : all spherical harmonics with order and degree as m+n odd // updown=( // _, // _,u,_, // _,u,_,u,_, // _,u,_,u,_,u,_, // _,u,_,u,_,u,_,u,_, // _,u,_,u,_,u,_,u,_,u,_ // ) // with { u = (_<:ba.if(ud==1,_*-1,_)); }; //left-right switching : all spherical harmonics of degree n<0 // leftright=( // _, // l,_,_, // l,l,_,_,_, // l,l,l,_,_,_,_, // l,l,l,l,_,_,_,_,_, // l,l,l,l,l,_,_,_,_,_,_ // ) // with { l = (_<:ba.if(lr==1,_*-1,_)); }; //front-back switching : all spherical harmonics of degree (n<0 & n even) and (n>0 & n odd) // frontback=( // _, // _,_,f, // f,_,_,f,_, // _,f,_,_,f,_,f, // f,_,f,_,_,f,_,f,_, // _,f,_,f,_,_,f,_,f,_,f // ) // with { f = (_<:ba.if(fb==1,_*-1,_)); };
https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_mirroring.dsp
faust
Description: This tool mirros an HOA scene: Axes left-right, front-back, up-down can be reversed by changing a the sign of particular spherical harmonics [1,p.46-47] References: [1] Kronlachner, M. (2014). Spatial Transformations for the Alteration of Ambisonic Recordings. Graz University Of Technology, Austria. Inputs: (M+1)^2 Outputs: (M+1)^2 up-down switching: all spherical harmonics with order and degree as m+n odd i+m^2 = m^2+m+n left-right switching : all spherical harmonics of degree n<0 i+m^2 = m^2+m+n front-back switching : all spherical harmonics of degree (n<0 & n even) or (n>0 & n odd) i+m^2 = m^2+m+n EXAMPLE AT ORDER 5 up-down switching : all spherical harmonics with order and degree as m+n odd updown=( _, _,u,_, _,u,_,u,_, _,u,_,u,_,u,_, _,u,_,u,_,u,_,u,_, _,u,_,u,_,u,_,u,_,u,_ ) with { u = (_<:ba.if(ud==1,_*-1,_)); }; left-right switching : all spherical harmonics of degree n<0 leftright=( _, l,_,_, l,l,_,_,_, l,l,l,_,_,_,_, l,l,l,l,_,_,_,_,_, l,l,l,l,l,_,_,_,_,_,_ ) with { l = (_<:ba.if(lr==1,_*-1,_)); }; front-back switching : all spherical harmonics of degree (n<0 & n even) and (n>0 & n odd) frontback=( _, _,_,f, f,_,_,f,_, _,f,_,_,f,_,f, f,_,f,_,_,f,_,f,_, _,f,_,f,_,_,f,_,f,_,f ) with { f = (_<:ba.if(fb==1,_*-1,_)); };
declare name "HOA scene mirroring"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2015"; import("stdfaust.lib"); ud=checkbox("up-down"); lr=checkbox("left-right"); fb=checkbox("front-back"); M = 10; updown = par(m,M+1,par(i,2*m+1,term }) ); leftright = par(m,M+1,par(i,2*m+1,term }) ); frontback = par(m,M+1,par(i,2*m+1,term with{ term = _<: ba.if( ((fb==1) & ( ( ((i-m)<0) & ((i-m)%2==0) ) | ( ((i-m)>0) & ((i-m)%2==1) ) ) ) }) ); process=vgroup("HOA scene mirroring",updown:leftright:frontback);
20670b6d9a323c7c096899e859420c369ec031a9ae0936c78c97ca7c410d550a
sekisushai/ambitools
hoa_mic_encoder_eigenmike32.dsp
declare name "eigenmike32 HOA Encoder"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2015"; // Description: This tool does the Discrete Spherical Fourier Transform (DSFT) [1] of signal from a rigid spherical microphone with Pentakis dodecahedron geometry (mh acoustics eigenmike32 [1]). // CAUTION: This tool does only the DSFT, to obtain the Ambisonics components you should filter the signals with corresponding radial filters [2]. // Inputs: 32 // Outputs: (M+1)^2 // References: // [1] G. Elko, R. A. Kubli, and J. Meyer, “Audio system based on at least second-order eigenbeams,” 2009. // [2] S. Moreau, J. Daniel, and S. Bertet, “3d sound field recording with higher order ambisonics-objective measurements and validation of spherical microphone,” in Audio Engineering Society Convention 120, 2006, pp. 1–24. // [3] P. Lecomte, P.-A. Gauthier, C. Langrenne, A. Garcia, and A. Berry, “On the use of a Lebedev grid for Ambisonics,” in Audio Engineering Society Convention 139, 2015. import("stdfaust.lib"); import("eigenmike32.lib"); import("ymn.lib"); import("gui.lib"); // Maximum order M=4 for eigenmike32 [2]. M = 4; ins = 32; outs = (M+1)^2; vol = hslider("[1]Gain[unit:dB][style:knob]", 0, -10, 50, 0.1) : ba.db2linear : si.smooth(0.999); // Vector of weighted spherical harmonics : spherical harmonics times the speaker weight for weighed quadrature rules [3]. row(i) = par(j,ins,yacn(i,azimuth(j),elevation(j))*weight(j)); process = hgroup("[0]Inputs",par(i,ins,id(i,0)))<:par(i,outs,buswg(row(i)):>_):hgroup("[1]Outputs",par(i,outs,*(vol)):par(i,M+1,metermute(i)));
https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_mic_encoder_eigenmike32.dsp
faust
Description: This tool does the Discrete Spherical Fourier Transform (DSFT) [1] of signal from a rigid spherical microphone with Pentakis dodecahedron geometry (mh acoustics eigenmike32 [1]). CAUTION: This tool does only the DSFT, to obtain the Ambisonics components you should filter the signals with corresponding radial filters [2]. Inputs: 32 Outputs: (M+1)^2 References: [1] G. Elko, R. A. Kubli, and J. Meyer, “Audio system based on at least second-order eigenbeams,” 2009. [2] S. Moreau, J. Daniel, and S. Bertet, “3d sound field recording with higher order ambisonics-objective measurements and validation of spherical microphone,” in Audio Engineering Society Convention 120, 2006, pp. 1–24. [3] P. Lecomte, P.-A. Gauthier, C. Langrenne, A. Garcia, and A. Berry, “On the use of a Lebedev grid for Ambisonics,” in Audio Engineering Society Convention 139, 2015. Maximum order M=4 for eigenmike32 [2]. Vector of weighted spherical harmonics : spherical harmonics times the speaker weight for weighed quadrature rules [3].
declare name "eigenmike32 HOA Encoder"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2015"; import("stdfaust.lib"); import("eigenmike32.lib"); import("ymn.lib"); import("gui.lib"); M = 4; ins = 32; outs = (M+1)^2; vol = hslider("[1]Gain[unit:dB][style:knob]", 0, -10, 50, 0.1) : ba.db2linear : si.smooth(0.999); row(i) = par(j,ins,yacn(i,azimuth(j),elevation(j))*weight(j)); process = hgroup("[0]Inputs",par(i,ins,id(i,0)))<:par(i,outs,buswg(row(i)):>_):hgroup("[1]Outputs",par(i,outs,*(vol)):par(i,M+1,metermute(i)));
9dff396c75de403d77397f5ab50145529afed191877d3b39170ebacdddf9b9ea
sekisushai/ambitools
hoa_converter_acn_n3d_to_fuma.dsp
declare name "HOA Converter : ACN N3D to FuMa"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2016"; import("stdfaust.lib"); import("gui.lib"); //Description : this tool converts HOA signals defined with a convention 1 to HOA signals defined with convention 2. Proposed conventions are ACN N3D, ACN SN3D, FuMa. For ACN to FuMa, the ordering change is as in [1] //[1] https://en.wikipedia.org/wiki/Ambisonic_data_exchange_formats // Input ACN: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // Output FuMa: 0 3 1 2 6 7 5 8 4 12 13 11 14 10 15 9 : W XYZ RSTUV KLMNOPQ // Input FuMa: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 : W XYZ RSTUV KLMNOPQ // Output ACN: 0 2 3 1 6 8 4 5 7 15 13 11 9 10 12 14 // Maximum required order (M = 3 for FuMa). M = 3; // Number of inputs ins = (M+1)^2; outs = ins; // ACN_N3D Input conversion(1,3) = par(i,M+1,ACNFuMa(i)); // ACN_N3D to FuMa ACNFuMa(0) = _*(1/sqrt(2)); ACNFuMa(1) = ro.cross(3):(_,ro.cross(2)): (_*(1/sqrt(3)),_*(1/sqrt(3)),_*(1/sqrt(3))); ACNFuMa(2) = (ro.cross(3),_,_):(_,ro.cross(3),_):(_,_,ro.cross(2),_):(_,_,_,ro.cross(2)): (_*(1/sqrt(5)),_*(2/sqrt(15)),_*(2/sqrt(15)),_*(2/sqrt(15)),_*(2/sqrt(15))); ACNFuMa(3) = (ro.cross(4),_,_,_):(_,ro.cross(4),_,_):(_,_,ro.cross(3),_,_):(_,_,_,ro.cross(3),_):(_,_,_,_,ro.cross(2),_):(_,_,_,_,_,ro.cross(2)): (_*(1/sqrt(7)),_*sqrt(45/224),_*sqrt(45/224),_*(3/sqrt(35)),_*(3/sqrt(35)),_*sqrt(8/35),_*sqrt(8/35)); ACNFuMa(m) = par(i,2*m+1,!:0); process = si.bus(ins):hgroup("[1]ACN N3D",par(i,M+1,meterm(i))):conversion(1,3):hgroup("[2]FuMa",par(i,M+1,meterm(i)));
https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_converter_acn_n3d_to_fuma.dsp
faust
Description : this tool converts HOA signals defined with a convention 1 to HOA signals defined with convention 2. Proposed conventions are ACN N3D, ACN SN3D, FuMa. For ACN to FuMa, the ordering change is as in [1] [1] https://en.wikipedia.org/wiki/Ambisonic_data_exchange_formats Input ACN: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Output FuMa: 0 3 1 2 6 7 5 8 4 12 13 11 14 10 15 9 : W XYZ RSTUV KLMNOPQ Input FuMa: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 : W XYZ RSTUV KLMNOPQ Output ACN: 0 2 3 1 6 8 4 5 7 15 13 11 9 10 12 14 Maximum required order (M = 3 for FuMa). Number of inputs ACN_N3D Input ACN_N3D to FuMa
declare name "HOA Converter : ACN N3D to FuMa"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2016"; import("stdfaust.lib"); import("gui.lib"); M = 3; ins = (M+1)^2; outs = ins; ACNFuMa(0) = _*(1/sqrt(2)); ACNFuMa(1) = ro.cross(3):(_,ro.cross(2)): (_*(1/sqrt(3)),_*(1/sqrt(3)),_*(1/sqrt(3))); ACNFuMa(2) = (ro.cross(3),_,_):(_,ro.cross(3),_):(_,_,ro.cross(2),_):(_,_,_,ro.cross(2)): (_*(1/sqrt(5)),_*(2/sqrt(15)),_*(2/sqrt(15)),_*(2/sqrt(15)),_*(2/sqrt(15))); ACNFuMa(3) = (ro.cross(4),_,_,_):(_,ro.cross(4),_,_):(_,_,ro.cross(3),_,_):(_,_,_,ro.cross(3),_):(_,_,_,_,ro.cross(2),_):(_,_,_,_,_,ro.cross(2)): (_*(1/sqrt(7)),_*sqrt(45/224),_*sqrt(45/224),_*(3/sqrt(35)),_*(3/sqrt(35)),_*sqrt(8/35),_*sqrt(8/35)); ACNFuMa(m) = par(i,2*m+1,!:0); process = si.bus(ins):hgroup("[1]ACN N3D",par(i,M+1,meterm(i))):conversion(1,3):hgroup("[2]FuMa",par(i,M+1,meterm(i)));
d9bd8ffe5f963d03aff26d6d3c03f601bd7d3ca5437a2a7253a11225d76ea474
tonal-glyph/faustus
dbmeter.dsp
declare name "dbmeter"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; //------------------------------------------------- // A dB Vumeter //------------------------------------------------- import("stdfaust.lib"); vmeter(x) = attach(x, envelop(x) : vbargraph("[unit:dB]", -70, 10)); hmeter(x) = attach(x, envelop(x) : hbargraph("[unit:dB]", -70, 10)); envelop = abs : max(ba.db2linear(-70)) : ba.linear2db : min(10) : max ~ -(80.0/ma.SR); null(x) = attach(0,x); process = hgroup("8 channels dB meter", par(i,8, vgroup("%i", vmeter : null)));
https://raw.githubusercontent.com/tonal-glyph/faustus/cc887b115aceaee202edbdb37ee0e4087bfb5a33/examples/analysis/dbmeter.dsp
faust
------------------------------------------------- A dB Vumeter -------------------------------------------------
declare name "dbmeter"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; import("stdfaust.lib"); vmeter(x) = attach(x, envelop(x) : vbargraph("[unit:dB]", -70, 10)); hmeter(x) = attach(x, envelop(x) : hbargraph("[unit:dB]", -70, 10)); envelop = abs : max(ba.db2linear(-70)) : ba.linear2db : min(10) : max ~ -(80.0/ma.SR); null(x) = attach(0,x); process = hgroup("8 channels dB meter", par(i,8, vgroup("%i", vmeter : null)));
66a7ae4236b0b8f6fd8024b9bde45921b902b71253baad1cd8165866a9ea1c9f
LucaSpanedda/Musical_Plugins
Granulator2HEADS.dsp
declare name "Timestretching Overlap Add to One"; declare version "xxx"; declare author "Luca Spanedda"; declare license "GNU-GPL-v3"; declare copyright "(c)Luca Spanedda 2022"; declare description "Overlap Add to One Timestretcher"; // FAUST standard library import("stdfaust.lib"); // Phasor Function LetrecPhasor(f) = Xn letrec{ 'Xn = (Xn+(f/ma.SR))-int(Xn); }; // Sample and Hold Circuit: Sig --> circuit(control signal for trigger) SAH(trig,x) = loop with{ loop = ((_,x) : Selector(trig))~_ with{ Selector(sel) = (_*(1-sel)+_*(sel)); }; }; floorint(x) = x-int(x); // read section // stretchFactor - 0 Normal / 1 Extreme stretch (Freeze) stretch = LetrecPhasor(1-hslider("[7]Stretch Factor", 0, 0, 1, .001)) * hslider("[5]Read Section", 0, 0, 1, .001); // Jitter Amount in the position for the reads jitter = no.noise*hslider("[6]Read Jitter", 0, 0, 1, .001); // position in the Buffer for the Reads cntrlRead = hslider("[4]Read Position", 0, 0, 1, .001)+stretch+jitter : floorint; // Timestretcher - sum of the 2 Head Reads // Bufpos = 0 to 1 signals for the reads timeStretcher(bufPos, x) = x <: head1 + head2 <: _,_, rIdxgraph, wIdxgraph with{ offset = 2; // tableMax = table Max Dimension - 10 Seconds tableMax = 192000 * 10 + offset; // L = buffer dimension in seconds L = ma.SR * hslider("[2]Table Dimension[unit:Sec]", 1, 1, 10, 1); // Write index - ramp 0 to L wIdx = offset + ((+(1) : %(L)) ~ _) * checkbox("[3]Record") : int; buffer(p, x) = it.frwtable(3, tableMax, .0, wIdx, x, p); // Hanning window Equation hann(x) = sin(ma.frac(x) * ma.PI) ^ 2.0; // Grain in Milliseconds grainms = 1000/hslider("[8]Grain Dimension[unit:ms.]", 80, 1, 1000, 1) : si.smoo; // Position of the grain in the Buffer timePhase = offset + (bufPos * L); // two Heads for the read // 0° ph1 = LetrecPhasor(grainms); // 180* ph2 = ma.frac(.5 + ph1); // Buffer positions = Position in the Buffer + Grain Read pos1 = SAH(ph1 < ph1', timePhase) + ph1*(ma.SR/grainms); pos2 = SAH(ph2 < ph2', timePhase) + ph2*(ma.SR/grainms); // Windows + Buffer Reads head1 = hann(ph1) * buffer(pos1); head2 = hann(ph2) * buffer(pos2); wIdxgraph = (wIdx/L) : hbargraph("[0]Write Head",0,1) : _*ma.EPSILON; rIdxgraph = bufPos : hbargraph("[1]Read Head",0,1) : _*ma.EPSILON; }; process = timeStretcher(cntrlRead);
https://raw.githubusercontent.com/LucaSpanedda/Musical_Plugins/d17556035378ac5c6a0a2033de7f0a93390e94e1/Granulator%202%20Heads/Granulator2HEADS.dsp
faust
FAUST standard library Phasor Function Sample and Hold Circuit: Sig --> circuit(control signal for trigger) read section stretchFactor - 0 Normal / 1 Extreme stretch (Freeze) Jitter Amount in the position for the reads position in the Buffer for the Reads Timestretcher - sum of the 2 Head Reads Bufpos = 0 to 1 signals for the reads tableMax = table Max Dimension - 10 Seconds L = buffer dimension in seconds Write index - ramp 0 to L Hanning window Equation Grain in Milliseconds Position of the grain in the Buffer two Heads for the read 0° 180* Buffer positions = Position in the Buffer + Grain Read Windows + Buffer Reads
declare name "Timestretching Overlap Add to One"; declare version "xxx"; declare author "Luca Spanedda"; declare license "GNU-GPL-v3"; declare copyright "(c)Luca Spanedda 2022"; declare description "Overlap Add to One Timestretcher"; import("stdfaust.lib"); LetrecPhasor(f) = Xn letrec{ 'Xn = (Xn+(f/ma.SR))-int(Xn); }; SAH(trig,x) = loop with{ loop = ((_,x) : Selector(trig))~_ with{ Selector(sel) = (_*(1-sel)+_*(sel)); }; }; floorint(x) = x-int(x); stretch = LetrecPhasor(1-hslider("[7]Stretch Factor", 0, 0, 1, .001)) * hslider("[5]Read Section", 0, 0, 1, .001); jitter = no.noise*hslider("[6]Read Jitter", 0, 0, 1, .001); cntrlRead = hslider("[4]Read Position", 0, 0, 1, .001)+stretch+jitter : floorint; timeStretcher(bufPos, x) = x <: head1 + head2 <: _,_, rIdxgraph, wIdxgraph with{ offset = 2; tableMax = 192000 * 10 + offset; L = ma.SR * hslider("[2]Table Dimension[unit:Sec]", 1, 1, 10, 1); wIdx = offset + ((+(1) : %(L)) ~ _) * checkbox("[3]Record") : int; buffer(p, x) = it.frwtable(3, tableMax, .0, wIdx, x, p); hann(x) = sin(ma.frac(x) * ma.PI) ^ 2.0; grainms = 1000/hslider("[8]Grain Dimension[unit:ms.]", 80, 1, 1000, 1) : si.smoo; timePhase = offset + (bufPos * L); ph1 = LetrecPhasor(grainms); ph2 = ma.frac(.5 + ph1); pos1 = SAH(ph1 < ph1', timePhase) + ph1*(ma.SR/grainms); pos2 = SAH(ph2 < ph2', timePhase) + ph2*(ma.SR/grainms); head1 = hann(ph1) * buffer(pos1); head2 = hann(ph2) * buffer(pos2); wIdxgraph = (wIdx/L) : hbargraph("[0]Write Head",0,1) : _*ma.EPSILON; rIdxgraph = bufPos : hbargraph("[1]Read Head",0,1) : _*ma.EPSILON; }; process = timeStretcher(cntrlRead);
efac903b3af6aa55762cd96c2e7d46d3940a020474f7dc5823d175f1d0d50d30
rottingsounds/bitDSP-faust
bitRot.dsp
declare name "bitRot"; declare description "bitRot - example"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); // plot // CXXFLAGS="-I ../include" faust2csvplot -I ../lib bitRot.dsp // ./bitRot -n 10 // compile // CXXFLAGS="-I ../../../include" faust2caqt -I ../lib bitRot.dsp // ./bitRot /////////////////////////// UI //////////////////////////////// chance = hslider("chance", 0, 0, 1, 0.0001); type = hslider("type" , 1, 1, 3, 1); amp = hslider("amp" , 0, 0, 1, 0.001) : si.smoo; /////////////////////////// Input ///////////////////////////// bitSin = bit.ddsm1(os.osc(50)); dirac = 1 - 1'; silence = fbPath(dirac) ~ _ with { fbPath(init, fb) = -fb + init; }; // noise needs to be unimodal noise = (no.noise + 1) * 0.5; // process = bitSin <: _, bitrot(noise, chance, type) : bit2mbit, bit2mbit with { // bit2mbit(x) = fi.lowpass(4, 4000, x); // }; process = bitSin : bit.bitrot(noise, chance, type) : outPCM(2, amp) with { outPCM(N, amp, x) = fi.lowpass(2, 4000, x) * amp : leakdc(0.999) <: si.bus(N); leakdc(coef, x) = y letrec { 'y = x - x' + coef * y; }; };
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/21cf36105c55b6e18969a867a319530a0ef1ea63/examples/bitRot.dsp
faust
plot CXXFLAGS="-I ../include" faust2csvplot -I ../lib bitRot.dsp ./bitRot -n 10 compile CXXFLAGS="-I ../../../include" faust2caqt -I ../lib bitRot.dsp ./bitRot ///////////////////////// UI //////////////////////////////// ///////////////////////// Input ///////////////////////////// noise needs to be unimodal process = bitSin <: _, bitrot(noise, chance, type) : bit2mbit, bit2mbit with { bit2mbit(x) = fi.lowpass(4, 4000, x); };
declare name "bitRot"; declare description "bitRot - example"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); chance = hslider("chance", 0, 0, 1, 0.0001); type = hslider("type" , 1, 1, 3, 1); amp = hslider("amp" , 0, 0, 1, 0.001) : si.smoo; bitSin = bit.ddsm1(os.osc(50)); dirac = 1 - 1'; silence = fbPath(dirac) ~ _ with { fbPath(init, fb) = -fb + init; }; noise = (no.noise + 1) * 0.5; process = bitSin : bit.bitrot(noise, chance, type) : outPCM(2, amp) with { outPCM(N, amp, x) = fi.lowpass(2, 4000, x) * amp : leakdc(0.999) <: si.bus(N); leakdc(coef, x) = y letrec { 'y = x - x' + coef * y; }; };
91c96e1008ba5b4d8eeadf7292d79d9a4e6a1941d5ef0163a110dca368d34a10
grame-cncm/GameLAN
Sequenceur.dsp
declare name "Sequenceur"; declare author "Developpement Grame - CNCM par Elodie Rabibisoa et Romain Constant."; import ("stdfaust.lib"); process = sequenceur * onOff <:_,_; N = 4; onOff = checkbox("[1]ON/OFF"); sequenceur = par(i, N, play(sample(i), file_index, i) * (sample_pick == i)) :>_ ; seq_select = ba.beat(bps) : ba.pulse_countup_loop(15, 1) : hbargraph("Suivi",0,15); bps = bpm.a25*(typeBpm == 7)+ bpm.b37*(typeBpm == 6) + bpm.c50*(typeBpm == 5) + bpm.d62*(typeBpm == 4) + bpm.e75*(typeBpm == 3) + bpm.f100*(typeBpm == 2) + bpm.g125*(typeBpm == 1) + bpm.h150*(typeBpm == 0); typeBpm = vslider("[1]Tempo [style:radio{'150 BPM':0;'125 BPM':1;'100 BPM':2;'75 BPM':3;'62.5 BPM':4;'50 BPM':5;'37.5 BPM':6;'25 BPM':7}]", 0, 0, 7, 1):int; bpm = environment { // bpm * 4, semiquaver (16th) a25 = 25 * 4; b37 = 37.5 * 4; c50 = 50 * 4; d62 = 62.5 * 4; e75 = 75 * 4; f100 = 100 * 4; g125 = 125 * 4; h150 = 150 * 4; }; check(0) = checkbox("h:[04]/01") * 1; check(1) = checkbox("h:[04]/02") * 2; check(2) = checkbox("h:[05]/03") * 3; check(3) = checkbox("h:[05]/04") * 4; check(4) = checkbox("h:[06]/05") * 5; check(5) = checkbox("h:[06]/06") * 6; check(6) = checkbox("h:[07]/07") * 7; check(7) = checkbox("h:[07]/08") * 8; check(8) = checkbox("h:[08]/09") * 9; check(9) = checkbox("h:[08]/10") * 10; check(10) = checkbox("h:[09]/11") * 11; check(11) = checkbox("h:[09]/12") * 12; check(12) = checkbox("h:[10]/13") * 13; check(13) = checkbox("h:[10]/14") * 14; check(14) = checkbox("h:[11]/15") * 15; check(15) = checkbox("h:[11]/16") * 16; // ------------------------------------ Samples ------------------------------------- sample_pick = hslider("[0]Samples[style:radio{'Bip Square':0;'Hi-Hat':1;'Kick':2;'Snare':3}]", 0, 0, 3, 1); sample(0) = soundfile("sample_2 [url:bipsquare_oneshot.flac]", 1); sample(1) = soundfile("sample_4 [url:Hihat_oneshot_N.flac]", 1); sample(2) = soundfile("sample_6 [url:Kick_oneshot_N.flac]", 1); sample(3) = soundfile("sample_8 [url:Snare_oneshot_N.flac]", 1); // ------------------------------------ Player -------------------------------------- file_index = 0; trigger = par(i, 16, vgroup("[3]Steps",check(i)) == (seq_select + 1) : upfront) :>_; upfront(x) = (x-x')>0.5; counter(sampleSize) = trigger : decrease > (0.0) with { //trig impulse to launch stream of 1 decay(y) = y - (y>0.0)/sampleDuration; decrease = +~decay; sampleDuration = hslider("Decay[acc:0 0 -8 0 8][hidden:1]", 1, 0.001, 1.5, 0.001) * (ma.SR): min(sampleSize) : max(44) : int; }; index(sampleSize) = +(counter(sampleSize))~_ * (1 - (trigger : upfront)) : int; //increment loop with reinit to 0 through reversed impulse (trig : upfront) play(s, part) = (part, reader(s)) : outs(s) with { length(s) = part,0 : s : _,si.block(outputs(s)-1); srate(s) = part,0 : s : !,_,si.block(outputs(s)-2); outs(s) = s : si.block(2), si.bus(outputs(s)-2); reader(s,n) = index(length(s)); };
https://raw.githubusercontent.com/grame-cncm/GameLAN/8d1dc26d709d721d27ec1156fbb66b03478f2529/sequenceur/Sequenceur.dsp
faust
bpm * 4, semiquaver (16th) ------------------------------------ Samples ------------------------------------- ------------------------------------ Player -------------------------------------- trig impulse to launch stream of 1 increment loop with reinit to 0 through reversed impulse (trig : upfront)
declare name "Sequenceur"; declare author "Developpement Grame - CNCM par Elodie Rabibisoa et Romain Constant."; import ("stdfaust.lib"); process = sequenceur * onOff <:_,_; N = 4; onOff = checkbox("[1]ON/OFF"); sequenceur = par(i, N, play(sample(i), file_index, i) * (sample_pick == i)) :>_ ; seq_select = ba.beat(bps) : ba.pulse_countup_loop(15, 1) : hbargraph("Suivi",0,15); bps = bpm.a25*(typeBpm == 7)+ bpm.b37*(typeBpm == 6) + bpm.c50*(typeBpm == 5) + bpm.d62*(typeBpm == 4) + bpm.e75*(typeBpm == 3) + bpm.f100*(typeBpm == 2) + bpm.g125*(typeBpm == 1) + bpm.h150*(typeBpm == 0); typeBpm = vslider("[1]Tempo [style:radio{'150 BPM':0;'125 BPM':1;'100 BPM':2;'75 BPM':3;'62.5 BPM':4;'50 BPM':5;'37.5 BPM':6;'25 BPM':7}]", 0, 0, 7, 1):int; a25 = 25 * 4; b37 = 37.5 * 4; c50 = 50 * 4; d62 = 62.5 * 4; e75 = 75 * 4; f100 = 100 * 4; g125 = 125 * 4; h150 = 150 * 4; }; check(0) = checkbox("h:[04]/01") * 1; check(1) = checkbox("h:[04]/02") * 2; check(2) = checkbox("h:[05]/03") * 3; check(3) = checkbox("h:[05]/04") * 4; check(4) = checkbox("h:[06]/05") * 5; check(5) = checkbox("h:[06]/06") * 6; check(6) = checkbox("h:[07]/07") * 7; check(7) = checkbox("h:[07]/08") * 8; check(8) = checkbox("h:[08]/09") * 9; check(9) = checkbox("h:[08]/10") * 10; check(10) = checkbox("h:[09]/11") * 11; check(11) = checkbox("h:[09]/12") * 12; check(12) = checkbox("h:[10]/13") * 13; check(13) = checkbox("h:[10]/14") * 14; check(14) = checkbox("h:[11]/15") * 15; check(15) = checkbox("h:[11]/16") * 16; sample_pick = hslider("[0]Samples[style:radio{'Bip Square':0;'Hi-Hat':1;'Kick':2;'Snare':3}]", 0, 0, 3, 1); sample(0) = soundfile("sample_2 [url:bipsquare_oneshot.flac]", 1); sample(1) = soundfile("sample_4 [url:Hihat_oneshot_N.flac]", 1); sample(2) = soundfile("sample_6 [url:Kick_oneshot_N.flac]", 1); sample(3) = soundfile("sample_8 [url:Snare_oneshot_N.flac]", 1); file_index = 0; trigger = par(i, 16, vgroup("[3]Steps",check(i)) == (seq_select + 1) : upfront) :>_; upfront(x) = (x-x')>0.5; counter(sampleSize) = trigger : decrease > (0.0) decay(y) = y - (y>0.0)/sampleDuration; decrease = +~decay; sampleDuration = hslider("Decay[acc:0 0 -8 0 8][hidden:1]", 1, 0.001, 1.5, 0.001) * (ma.SR): min(sampleSize) : max(44) : int; }; play(s, part) = (part, reader(s)) : outs(s) with { length(s) = part,0 : s : _,si.block(outputs(s)-1); srate(s) = part,0 : s : !,_,si.block(outputs(s)-2); outs(s) = s : si.block(2), si.bus(outputs(s)-2); reader(s,n) = index(length(s)); };
a0d0bf6adf5b9d830938bb6cdd6241c56852e6e79aa46a6e4a5f431fa03c89b9
grame-cncm/GameLAN
AttacKey.dsp
declare name "Attackey"; declare author "Developpement Grame - CNCM par Elodie Rabibisoa, Romain Constant et Stéphane Letz."; import("stdfaust.lib"); declare nvoices "12"; // Specific syntax for faust2android, [style:keyboard] doesn't exist in iOS process = vgroup("Attackey [style:keyboard]", instru); freq = hslider("freq", 349.23, 261.63, 783.99, 0.001); gain = hslider("gain",0.5,0,1,0.01); gate = button("gate"); envelope = en.adsr(0.01,0.01,0.9,0.1,gate)*gain; instru = play1(noteOn, instrument) * envelope * volume : attackey_reverb * 0.5 <:_,_; instrument = hslider("Instruments[style:radio{'1':0;'2':1;'3':2;'4':3;'5':4}]", 0, 0, 4, 1); volume = hslider("Volume [acc: 0 0 -8 0 0][hidden:1]", 1, 0, 1, 0.001):si.smoo; noteOn = soundfile("Instrus [url:{'Piano_F.flac';'Ether_F.flac';'Bell_F.flac';'Saw_F.flac';'Vibraphone_F.flac'}]", 1); // -------------------- Interpolation Players ------------------- // speed = freq/(349.23*2); //reference pitch = F * 2 (midi keyboard plays one octave higher) srate(s, part) = part,0 : s : !,_,si.block(outputs(s)-2):float; // Reset when button is pressed (0 when trig is on, 1 when trig is off) reset(trig) = (trig-trig') <= 0; // Ramp with a given step, reset when trig is on ramp(trig, step) = (+(step):*(reset(trig))) ~ _; // Outputs outs(s, level) = s : si.block(2), bus_level(outputs(s)-2) with { bus_level(n) = par(i,n,*(level)); }; // Plays a soundfile given a parametric 'reader' player(s, part, reader, level) = (part, reader(s,part)) : outs(s,level); // Plays a soundfile given a parametric 'reader' with linear interpolation linear_player(s, part, reader, level) = (lplayer(id0), lplayer(id1)) : ro.interleave(sound_outs, 2) : par(i, sound_outs, linear(c)) with { lplayer(reader) = (part, reader) : outs(s, level); reader1 = reader(s, part); id0 = int(reader1); id1 = id0 + 1; c = reader1 - id0; sound_outs = outputs(s)-2; linear(c,v0,v1) = v0*(1-c)+v1*c; }; // Plays a soundfile given a parametric 'reader' with cubic interpolation cubic_player(s, part, reader, level) = (lplayer(id0), lplayer(id1), lplayer(id2), lplayer(id3)) : ro.interleave(sound_outs, 4) : par(i, sound_outs, cubic(c)) with { lplayer(reader) = (part, reader) : outs(s, level); reader1 = reader(s, part); id0 = int(reader1); id1 = id0 + 1; id2 = id1 + 1; id3 = id2 + 1; c = reader1 - id0; sound_outs = outputs(s)-2; cubic(c,v0,v1,v2,v3) = v1 + 0.5 * c * (v2 - v0 + c * (2.0*v0 - 5.0*v1 + 4.0*v2 - v3 + c*(3.0*(v1 -v2) + v3 - v0))); }; fullsample_reader(gate) = \(s,part).(ramp(gate, speed*srate(s,part)/ma.SR)); play1(s, part) = cubic_player(s, part, fullsample_reader(gate), 1); // -------------------- Reverb ------------------- // attackey_reverb = _<: instrReverb :>_; instrReverb = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = 1; roomSize = 1; rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
https://raw.githubusercontent.com/grame-cncm/GameLAN/8d1dc26d709d721d27ec1156fbb66b03478f2529/attacKey/AttacKey.dsp
faust
Specific syntax for faust2android, [style:keyboard] doesn't exist in iOS -------------------- Interpolation Players ------------------- // reference pitch = F * 2 (midi keyboard plays one octave higher) Reset when button is pressed (0 when trig is on, 1 when trig is off) Ramp with a given step, reset when trig is on Outputs Plays a soundfile given a parametric 'reader' Plays a soundfile given a parametric 'reader' with linear interpolation Plays a soundfile given a parametric 'reader' with cubic interpolation -------------------- Reverb ------------------- //
declare name "Attackey"; declare author "Developpement Grame - CNCM par Elodie Rabibisoa, Romain Constant et Stéphane Letz."; import("stdfaust.lib"); declare nvoices "12"; process = vgroup("Attackey [style:keyboard]", instru); freq = hslider("freq", 349.23, 261.63, 783.99, 0.001); gain = hslider("gain",0.5,0,1,0.01); gate = button("gate"); envelope = en.adsr(0.01,0.01,0.9,0.1,gate)*gain; instru = play1(noteOn, instrument) * envelope * volume : attackey_reverb * 0.5 <:_,_; instrument = hslider("Instruments[style:radio{'1':0;'2':1;'3':2;'4':3;'5':4}]", 0, 0, 4, 1); volume = hslider("Volume [acc: 0 0 -8 0 0][hidden:1]", 1, 0, 1, 0.001):si.smoo; noteOn = soundfile("Instrus [url:{'Piano_F.flac';'Ether_F.flac';'Bell_F.flac';'Saw_F.flac';'Vibraphone_F.flac'}]", 1); srate(s, part) = part,0 : s : !,_,si.block(outputs(s)-2):float; reset(trig) = (trig-trig') <= 0; ramp(trig, step) = (+(step):*(reset(trig))) ~ _; outs(s, level) = s : si.block(2), bus_level(outputs(s)-2) with { bus_level(n) = par(i,n,*(level)); }; player(s, part, reader, level) = (part, reader(s,part)) : outs(s,level); linear_player(s, part, reader, level) = (lplayer(id0), lplayer(id1)) : ro.interleave(sound_outs, 2) : par(i, sound_outs, linear(c)) with { lplayer(reader) = (part, reader) : outs(s, level); reader1 = reader(s, part); id0 = int(reader1); id1 = id0 + 1; c = reader1 - id0; sound_outs = outputs(s)-2; linear(c,v0,v1) = v0*(1-c)+v1*c; }; cubic_player(s, part, reader, level) = (lplayer(id0), lplayer(id1), lplayer(id2), lplayer(id3)) : ro.interleave(sound_outs, 4) : par(i, sound_outs, cubic(c)) with { lplayer(reader) = (part, reader) : outs(s, level); reader1 = reader(s, part); id0 = int(reader1); id1 = id0 + 1; id2 = id1 + 1; id3 = id2 + 1; c = reader1 - id0; sound_outs = outputs(s)-2; cubic(c,v0,v1,v2,v3) = v1 + 0.5 * c * (v2 - v0 + c * (2.0*v0 - 5.0*v1 + 4.0*v2 - v3 + c*(3.0*(v1 -v2) + v3 - v0))); }; fullsample_reader(gate) = \(s,part).(ramp(gate, speed*srate(s,part)/ma.SR)); play1(s, part) = cubic_player(s, part, fullsample_reader(gate), 1); attackey_reverb = _<: instrReverb :>_; instrReverb = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) : re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+ with { reverbGain = 1; roomSize = 1; rdel = 20; f1 = 200; f2 = 6000; t60dc = roomSize*3; t60m = roomSize*2; fsmax = 48000; };
10379a1260eb4638f19eb9f00fecb72f3a36b189f341ee5812e8fbc2d8a218c6
publicsamples/Xolotls-Weird-Delay
granul.dsp
process = vgroup("Granulator", environment { declare name "Granulator"; declare author "Adapted from sfIter by Christophe Lebreton"; /* =========== DESCRIPTION ============= - The granulator takes very small parts of a sound, called GRAINS, and plays them at a varying speed - Front = Medium size grains - Back = short grains - Left Slow rhythm - Right = Fast rhythm - Bottom = Regular occurrences - Head = Irregular occurrences */ import("stdfaust.lib"); process = hgroup("Granulator", *(excitation : ampf)), hgroup("Granulator", *(excitation : ampf)); excitation = noiseburst(gate,P) * (gain); ampf = an.amp_follower_ud(duree_env,duree_env); //----------------------- NOISEBURST ------------------------- noiseburst(gate,P) = no.noise : *(gate : trigger(P)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); trigger(n) = upfront : release(n) : > (0.0); }; //------------------------------------------------------------- P = freq; // fundamental period in samples freq = hslider("[1]GrainSize[BELA: ANALOG_0]", 200,5,2205,1); // the frequency gives the white noise band width Pmax = 4096; // maximum P (for de.delay-line allocation) // PHASOR_BIN ////////////////////////////// phasor_bin(init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); gate = phasor_bin(1) :-(0.001):pulsar; gain = 1; // PULSAR ////////////////////////////// // Pulsar allows to create a more or less random 'pulse'(proba). pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch)); speed = hslider ("[2]Speed[BELA: ANALOG_1]", 10,1,20,0.0001):fi.lowpass(1,1); ratio_env = 0.5; fade = (0.5); // min > 0 to avoid division by 0 proba = hslider ("[3]Probability[BELA: ANALOG_2]", 70,50,100,1) * (0.01):fi.lowpass(1,1); duree_env = 1/(speed: / (ratio_env*(0.25)*fade)); }.process);
https://raw.githubusercontent.com/publicsamples/Xolotls-Weird-Delay/dc304161575f8abca9ae4a878efde701126b18be/DspNetworks/CodeLibrary/faust/granul.dsp
faust
=========== DESCRIPTION ============= - The granulator takes very small parts of a sound, called GRAINS, and plays them at a varying speed - Front = Medium size grains - Back = short grains - Left Slow rhythm - Right = Fast rhythm - Bottom = Regular occurrences - Head = Irregular occurrences ----------------------- NOISEBURST ------------------------- ------------------------------------------------------------- fundamental period in samples the frequency gives the white noise band width maximum P (for de.delay-line allocation) PHASOR_BIN ////////////////////////////// PULSAR ////////////////////////////// Pulsar allows to create a more or less random 'pulse'(proba). min > 0 to avoid division by 0
process = vgroup("Granulator", environment { declare name "Granulator"; declare author "Adapted from sfIter by Christophe Lebreton"; import("stdfaust.lib"); process = hgroup("Granulator", *(excitation : ampf)), hgroup("Granulator", *(excitation : ampf)); excitation = noiseburst(gate,P) * (gain); ampf = an.amp_follower_ud(duree_env,duree_env); noiseburst(gate,P) = no.noise : *(gate : trigger(P)) with { upfront(x) = (x-x') > 0; decay(n,x) = x - (x>0)/n; release(n) = + ~ decay(n); trigger(n) = upfront : release(n) : > (0.0); }; freq = hslider("[1]GrainSize[BELA: ANALOG_0]", 200,5,2205,1); phasor_bin(init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init); gate = phasor_bin(1) :-(0.001):pulsar; gain = 1; pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch)); speed = hslider ("[2]Speed[BELA: ANALOG_1]", 10,1,20,0.0001):fi.lowpass(1,1); ratio_env = 0.5; proba = hslider ("[3]Probability[BELA: ANALOG_2]", 70,50,100,1) * (0.01):fi.lowpass(1,1); duree_env = 1/(speed: / (ratio_env*(0.25)*fade)); }.process);
333cfe84799a6488297243aefdbd80810b7a7629192cfd7401c7ca6c54538e1a
RuolunWeng/ruolunweng.github.io
Loop.dsp
declare name "Loop"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; /* =========== DESCRITPION =========== - Record and Loop up to 20s of sound - Activate the Loop Mode : 1 = ON, 0 = OFF - When Loop Mode is active : ==> Head = Not recording/ Looping the recorded sound ==> Bottom = Recording sound ==> Swift movements around Head = scratched record effect */ import("stdfaust.lib"); B = hslider("Start/Stop Recording (Max 20s)[acc:1 0 -10 0 12]", 1,0,1,1); // Capture sound while pressed I = int(B); // convert button signal from float to integer R = (I-I') <= 0; // Reset capture when button is pressed D = (+(I):*(R))~_; // Compute capture duration while button is pressed: 0..NNNN0..MMM capture = *(B) : (+ : de.delay(1048576, D-1)) ~ *(1.0-B) ; level = hslider("Volume [unit:dB]", 0, -96, 4, 0.1) : ba.db2linear : si.smooth(0.999); captONOFF = hslider("Loop Mode ON/OFF",0,0,1,1); process = vgroup( "LOOP", _<:_,(_<:capture,_ : select2(B)): select2(captONOFF) *(level) ) ;
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/Loop.dsp
faust
=========== DESCRITPION =========== - Record and Loop up to 20s of sound - Activate the Loop Mode : 1 = ON, 0 = OFF - When Loop Mode is active : ==> Head = Not recording/ Looping the recorded sound ==> Bottom = Recording sound ==> Swift movements around Head = scratched record effect Capture sound while pressed convert button signal from float to integer Reset capture when button is pressed Compute capture duration while button is pressed: 0..NNNN0..MMM
declare name "Loop"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; import("stdfaust.lib"); capture = *(B) : (+ : de.delay(1048576, D-1)) ~ *(1.0-B) ; level = hslider("Volume [unit:dB]", 0, -96, 4, 0.1) : ba.db2linear : si.smooth(0.999); captONOFF = hslider("Loop Mode ON/OFF",0,0,1,1); process = vgroup( "LOOP", _<:_,(_<:capture,_ : select2(B)): select2(captONOFF) *(level) ) ;
36ef2b4afe5eca544d94b8d06e14896b6949fa4f00b9a54d552f1d6b9580d5f9
afalaize/faust
tester2.dsp
declare name "tester2"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2014"; //----------------------------------------------- // Stereo Audio Tester : send a test signal (sine, // noise, pink) on a stereo channel //----------------------------------------------- import("stdfaust.lib"); pink = f : (+ ~ g) with { f(x) = 0.04957526213389*x - 0.06305581334498*x' + 0.01483220320740*x''; g(x) = 1.80116083982126*x - 0.80257737639225*x'; }; // User interface //---------------- transition(n) = \(old,new).(ba.if(old<new, min(old+1.0/n,new), max(old-1.0/n,new))) ~ _; vol = hslider("[2] volume [unit:dB]", -96, -96, 0, 1): ba.db2linear : si.smoo; freq = hslider("[1] freq [unit:Hz][scale:log]", 440, 40, 20000, 1); wave = hslider("[3] signal [style:menu{'white noise':0;'pink noise':1;'sine':2}]", 0, 0, 2, 1) : int; dest = hslider("[4] channel [style:radio{'none':0;'left':1;'right':2;'both':3}]", 0, 0, 3, 1) : int; testsignal = no.noise, pink(no.noise), os.osci(freq): select3(wave); process = vgroup("Stereo Audio Tester", testsignal*vol <: par(i, 2, *((dest & (i+1)) != 0 : transition(4410))) );
https://raw.githubusercontent.com/afalaize/faust/8f9f5fe3aa167eaeecc15a99d4da984ac2797be3/examples/misc/tester2.dsp
faust
----------------------------------------------- Stereo Audio Tester : send a test signal (sine, noise, pink) on a stereo channel ----------------------------------------------- User interface ----------------
declare name "tester2"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2014"; import("stdfaust.lib"); pink = f : (+ ~ g) with { f(x) = 0.04957526213389*x - 0.06305581334498*x' + 0.01483220320740*x''; g(x) = 1.80116083982126*x - 0.80257737639225*x'; }; transition(n) = \(old,new).(ba.if(old<new, min(old+1.0/n,new), max(old-1.0/n,new))) ~ _; vol = hslider("[2] volume [unit:dB]", -96, -96, 0, 1): ba.db2linear : si.smoo; freq = hslider("[1] freq [unit:Hz][scale:log]", 440, 40, 20000, 1); wave = hslider("[3] signal [style:menu{'white noise':0;'pink noise':1;'sine':2}]", 0, 0, 2, 1) : int; dest = hslider("[4] channel [style:radio{'none':0;'left':1;'right':2;'both':3}]", 0, 0, 3, 1) : int; testsignal = no.noise, pink(no.noise), os.osci(freq): select3(wave); process = vgroup("Stereo Audio Tester", testsignal*vol <: par(i, 2, *((dest & (i+1)) != 0 : transition(4410))) );
bdfdfb0bef7e7c9338628302818b0532acb91b48886423172cb6b18b8d9272d6
afalaize/faust
lfBoost.dsp
// WARNING: This a "legacy example based on a deprecated library". Check filters.lib // for more accurate examples of filter functions declare name "lfboost"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; //------------------------------------------------------------------ // DAFX, Digital Audio Effects (Wiley ed.) // chapter 2 : filters // section 2.3 : Equalizers // page 53 : second order shelving filter design //------------------------------------------------------------------ import("stdfaust.lib"); //----------------------low frequency boost filter ------------------------------- // lfboost(F,G) // F : frequency (in Hz) // G : gain (in dB) // //-------------------------------------------------------------------------------- lfboost(F,G) = fi.TF2((1 + sqrt(2*V)*K + V*K*K) / denom, 2 * (V*K*K - 1) / denom, (1 - sqrt(2*V)*K + V*K*K) / denom, 2 * (K*K - 1) / denom, (1 - sqrt(2)*K + K*K) / denom) with { V = ba.db2linear(G); K = tan(ma.PI*F/ma.SR); denom = 1 + sqrt(2)*K + K*K; }; //====================low frequency boost process =============================== process = vgroup("lowboost", lfboost(nentry("freq [unit:Hz][style:knob]", 100, 20, 150, 1), vslider("gain [unit:dB]", 0, -20, 20, 0.1)));
https://raw.githubusercontent.com/afalaize/faust/8f9f5fe3aa167eaeecc15a99d4da984ac2797be3/examples/filtering/lfBoost.dsp
faust
WARNING: This a "legacy example based on a deprecated library". Check filters.lib for more accurate examples of filter functions ------------------------------------------------------------------ DAFX, Digital Audio Effects (Wiley ed.) chapter 2 : filters section 2.3 : Equalizers page 53 : second order shelving filter design ------------------------------------------------------------------ ----------------------low frequency boost filter ------------------------------- lfboost(F,G) F : frequency (in Hz) G : gain (in dB) -------------------------------------------------------------------------------- ====================low frequency boost process ===============================
declare name "lfboost"; declare version "1.0"; declare author "Grame"; declare license "BSD"; declare copyright "(c)GRAME 2006"; import("stdfaust.lib"); lfboost(F,G) = fi.TF2((1 + sqrt(2*V)*K + V*K*K) / denom, 2 * (V*K*K - 1) / denom, (1 - sqrt(2*V)*K + V*K*K) / denom, 2 * (K*K - 1) / denom, (1 - sqrt(2)*K + K*K) / denom) with { V = ba.db2linear(G); K = tan(ma.PI*F/ma.SR); denom = 1 + sqrt(2)*K + K*K; }; process = vgroup("lowboost", lfboost(nentry("freq [unit:Hz][style:knob]", 100, 20, 150, 1), vslider("gain [unit:dB]", 0, -20, 20, 0.1)));
ed172e7478a9401e3b77f5e9cea6b0977cb901158d321ee4884ffb316f8039db
olegkapitonov/Kapitonov-Plugins-Pack
kpp_fuzz.dsp
/* * Copyright (C) 2018-2020 Oleg Kapitonov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * -------------------------------------------------------------------------- */ /* * This plugin is a vintage fuzz pedal emulator. * * Process chain: * * input->pre_filter->*drive_knob->fuzz->tone->*volume_knob->output * * pre-filter - lowpass, 1 order, 1720 Hz. Emulates effect * of low impedance of vintage pedal. * * distortion - 2 cascades, asymmetric quadratic distortion and clipper. * Emulates distortion of old bad class A transistor cascades. * tone - highshelf 720 Hz. */ declare name "kpp_fuzz"; declare author "Oleg Kapitonov"; declare license "GPLv3"; declare version "1.1"; import("stdfaust.lib"); process = output with { fuzz = vslider("fuzz",0,0,100,0.01); tone = vslider("tone",0,-15,0,0.1); volume = vslider("volume",0.5,0,1,0.001); clamp = min(2.0) : max(-2.0); pre_filter = fi.dcblocker : fi.lowpass(1, 1720.0); distortion = *(ba.db2linear(fuzz/10)) : +(0.5) : max(0.0) : min(1.0) : fi.highpass(1, 120) : +(0.5) <: _,_ : * : -(0.4) : *(ba.db2linear(fuzz/5)) : max(-1.0) : min(1.0) : +(0.15); filter = fi.high_shelf(tone + 7.5, 720.0); stomp = pre_filter : *(10.0) : distortion : filter : *(ba.db2linear(volume * 50.0 ) / 100.0) : /(20.0); output = _ : stomp : _; };
https://raw.githubusercontent.com/olegkapitonov/Kapitonov-Plugins-Pack/ed4541172d53ecf04bad43cd583365f278ccf176/LADSPA/kpp_fuzz/kpp_fuzz.dsp
faust
* Copyright (C) 2018-2020 Oleg Kapitonov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * -------------------------------------------------------------------------- * This plugin is a vintage fuzz pedal emulator. * * Process chain: * * input->pre_filter->*drive_knob->fuzz->tone->*volume_knob->output * * pre-filter - lowpass, 1 order, 1720 Hz. Emulates effect * of low impedance of vintage pedal. * * distortion - 2 cascades, asymmetric quadratic distortion and clipper. * Emulates distortion of old bad class A transistor cascades. * tone - highshelf 720 Hz.
declare name "kpp_fuzz"; declare author "Oleg Kapitonov"; declare license "GPLv3"; declare version "1.1"; import("stdfaust.lib"); process = output with { fuzz = vslider("fuzz",0,0,100,0.01); tone = vslider("tone",0,-15,0,0.1); volume = vslider("volume",0.5,0,1,0.001); clamp = min(2.0) : max(-2.0); pre_filter = fi.dcblocker : fi.lowpass(1, 1720.0); distortion = *(ba.db2linear(fuzz/10)) : +(0.5) : max(0.0) : min(1.0) : fi.highpass(1, 120) : +(0.5) <: _,_ : * : -(0.4) : *(ba.db2linear(fuzz/5)) : max(-1.0) : min(1.0) : +(0.15); filter = fi.high_shelf(tone + 7.5, 720.0); stomp = pre_filter : *(10.0) : distortion : filter : *(ba.db2linear(volume * 50.0 ) / 100.0) : /(20.0); output = _ : stomp : _; };
b30888878d498c59dfdd37a4d351363645c60f27919498b016b025078198a15d
madskjeldgaard/mkfaustplugins
TwoMassChain.dsp
declare name "TwoMassChain"; declare author "James Leonard"; declare date "April 2020"; /* ========= DESCRITPION ============= A logical step from a simple oscillator: a chain of two masses connected by spring-dampers, fixed at one end to a fixed point ! - inputs: force impulse on the last mass of the chain. - outputs: position of the last mass of the chain. - controls: none */ import("stdfaust.lib"); in1 = _; OutGain = 0.1; p1 = hslider("k1",0.1,0.00001,1.0,0.001); p2 = hslider("k2",0.1,0.00001,1.0,0.001); p3 = hslider("z1",0.003,0.00001,1.0,0.001); p4 = hslider("z2",0.003,0.00001,1.0,0.001); K1 = p1; Z1 = p3; K2 = p2; Z2 = p4; model = ( mi.ground(0.), mi.mass(1., 0, 0., 0.), mi.mass(1., 0, 0., 0.), par(i, nbFrcIn,_): RoutingMassToLink , par(i, nbFrcIn,_): mi.springDamper(K1, Z1, 0., 0.), mi.springDamper(K2, Z2, 0., 0.), par(i, nbOut+nbFrcIn, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ RoutingMassToLink(m0, m1, m2) = /* routed positions */ m0, m1, m1, m2, /* outputs */ m2; RoutingLinkToMass(l0_f1, l0_f2, l1_f1, l1_f2, p_out1, f_in1) = /* routed forces */ l0_f1, l0_f2 + l1_f1, f_in1 + l1_f2, /* pass-through */ p_out1; nbMass = 3; nbFrcIn = 1; nbOut = 1; }; process = in1 : model:*(OutGain); /* ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard @K1 param 0.1 @Z1 param 0.0003 @K2 param 0.1 @Z2 param 0.0003 @g ground 0. @m1 mass 1. 0. 0. @m2 mass 1. 0. 0. @s1 springDamper @g @m1 K1 Z1 @s2 springDamper @m1 @m2 K2 Z2 # Add force input to the model @in1 frcInput @m2 # Add position output from the oscillator @out1 posOutput @m2 # end of MIMS script */
https://raw.githubusercontent.com/madskjeldgaard/mkfaustplugins/fd7cf250788174b5efa6ae3294997609830875d1/plugins/TwoMassChain/TwoMassChain.dsp
faust
========= DESCRITPION ============= A logical step from a simple oscillator: a chain of two masses connected by spring-dampers, fixed at one end to a fixed point ! - inputs: force impulse on the last mass of the chain. - outputs: position of the last mass of the chain. - controls: none routed positions outputs routed forces pass-through ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard @K1 param 0.1 @Z1 param 0.0003 @K2 param 0.1 @Z2 param 0.0003 @g ground 0. @m1 mass 1. 0. 0. @m2 mass 1. 0. 0. @s1 springDamper @g @m1 K1 Z1 @s2 springDamper @m1 @m2 K2 Z2 # Add force input to the model @in1 frcInput @m2 # Add position output from the oscillator @out1 posOutput @m2 # end of MIMS script
declare name "TwoMassChain"; declare author "James Leonard"; declare date "April 2020"; import("stdfaust.lib"); in1 = _; OutGain = 0.1; p1 = hslider("k1",0.1,0.00001,1.0,0.001); p2 = hslider("k2",0.1,0.00001,1.0,0.001); p3 = hslider("z1",0.003,0.00001,1.0,0.001); p4 = hslider("z2",0.003,0.00001,1.0,0.001); K1 = p1; Z1 = p3; K2 = p2; Z2 = p4; model = ( mi.ground(0.), mi.mass(1., 0, 0., 0.), mi.mass(1., 0, 0., 0.), par(i, nbFrcIn,_): RoutingMassToLink , par(i, nbFrcIn,_): mi.springDamper(K1, Z1, 0., 0.), mi.springDamper(K2, Z2, 0., 0.), par(i, nbOut+nbFrcIn, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ nbMass = 3; nbFrcIn = 1; nbOut = 1; }; process = in1 : model:*(OutGain);
a13e58df787b5ea6746f8fac84437f12d17662b27d19120765e897338abffb46
jameslnrd/mi_introduction_workshop_2020
nlOsc.dsp
declare name "Non Linear Oscillator"; declare author "James Leonard"; declare date "April 2020"; /* ========= DESCRITPION ============= A non-linear oscillator (containing a cubic stiffness term, making pitch amplitude dependant) - inputs: force impulse - outputs: oscillator position. - controls: value of the non-linear stiffness component. Note: we are using the nlSpringDamperClipped interaction that defines an upper bound for stiffness. This can save from numerical divergence when large displacements cause very large reaction forces. */ import("stdfaust.lib"); in1 = button("Hammer Input Force"): ba.impulsify* -0.1; OutGain = 1; nlK = hslider("non-linear stiffness", 0.005, 0., 0.1, 0.0001); model = ( mi.mass(1., 0, 0., 0.), mi.ground(0.), mi.mass(0.3, 0, 1., 1.), mi.ground(1.), par(i, nbFrcIn,_): RoutingMassToLink , par(i, nbFrcIn,_): mi.nlSpringDamperClipped(0.03, nlK, 0.8, 0.0002, 0., 0.), mi.springDamper(0.0001, 0.05, 1., 1.), mi.collision(0.1, 0.001, 0, 0., 1.), par(i, nbOut+nbFrcIn, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ RoutingMassToLink(m0, m1, m2, m3) = /* routed positions */ m1, m0, m3, m2, m0, m2, /* outputs */ m0; RoutingLinkToMass(l0_f1, l0_f2, l1_f1, l1_f2, l2_f1, l2_f2, p_out1, f_in1) = /* routed forces */ l0_f2 + l2_f1, l0_f1, f_in1 + l1_f2 + l2_f2, l1_f1, /* pass-through */ p_out1; nbMass = 4; nbFrcIn = 1; nbOut = 1; }; process = in1 : model:*(OutGain); /* ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard @nlK param 0.005 # Build a non-linear harmonic oscillator @m mass 1. 0. 0. @g ground 0. @nl nlSpringDamper @g @m 0.03 nlK 0.8 0.0002 # A slow moving oscillator placed above the other # serving as a hammer @ham mass 0.3 1. 0. @g2 ground 1. @sp springDamper @g2 @ham 0.0001 0.05 # Add force input to the hammer @in1 frcInput @ham @c contact @m @ham 0.1 0.001 # Add position output from the oscillator @out1 posOutput @m # @out2 posOutput @ham # end of MIMS script */
https://raw.githubusercontent.com/jameslnrd/mi_introduction_workshop_2020/2f487dbc5b8e7cd83cbd962254e737bdb82948f6/07_NonLinearOscillator/nlOsc.dsp
faust
========= DESCRITPION ============= A non-linear oscillator (containing a cubic stiffness term, making pitch amplitude dependant) - inputs: force impulse - outputs: oscillator position. - controls: value of the non-linear stiffness component. Note: we are using the nlSpringDamperClipped interaction that defines an upper bound for stiffness. This can save from numerical divergence when large displacements cause very large reaction forces. routed positions outputs routed forces pass-through ========= MIMS SCRIPT USED FOR MODEL GENERATION ============= # MIMS script file # Script author: James Leonard @nlK param 0.005 # Build a non-linear harmonic oscillator @m mass 1. 0. 0. @g ground 0. @nl nlSpringDamper @g @m 0.03 nlK 0.8 0.0002 # A slow moving oscillator placed above the other # serving as a hammer @ham mass 0.3 1. 0. @g2 ground 1. @sp springDamper @g2 @ham 0.0001 0.05 # Add force input to the hammer @in1 frcInput @ham @c contact @m @ham 0.1 0.001 # Add position output from the oscillator @out1 posOutput @m # @out2 posOutput @ham # end of MIMS script
declare name "Non Linear Oscillator"; declare author "James Leonard"; declare date "April 2020"; import("stdfaust.lib"); in1 = button("Hammer Input Force"): ba.impulsify* -0.1; OutGain = 1; nlK = hslider("non-linear stiffness", 0.005, 0., 0.1, 0.0001); model = ( mi.mass(1., 0, 0., 0.), mi.ground(0.), mi.mass(0.3, 0, 1., 1.), mi.ground(1.), par(i, nbFrcIn,_): RoutingMassToLink , par(i, nbFrcIn,_): mi.nlSpringDamperClipped(0.03, nlK, 0.8, 0.0002, 0., 0.), mi.springDamper(0.0001, 0.05, 1., 1.), mi.collision(0.1, 0.001, 0, 0., 1.), par(i, nbOut+nbFrcIn, _): RoutingLinkToMass )~par(i, nbMass, _): par(i, nbMass, !), par(i, nbOut , _) with{ nbMass = 4; nbFrcIn = 1; nbOut = 1; }; process = in1 : model:*(OutGain);
228ad962cc828a65929e1ec38c4accd8d47b83375f86198d63896a2b13020a0d
magnetophon/DigiDrie
korg35lpf_test.dsp
declare korg35LPF author "Eric Tarr"; declare korg35LPF license "MIT-style STK-4.3 license"; import("stdfaust.lib"); korg35LPF(freq,Q) = _ <: (s1,s2,s3,y) : !,!,!,_ letrec{ 's1 = _-s1:_*(alpha*2):_+s1; 's2 = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2):_*alpha0:_-s3:_*alpha:_+s3:_*K:_-s2:_*(alpha*2):_+s2; 's3 = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2):_*alpha0:_-s3:_*(alpha*2):_+s3; 'y = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2) :_*alpha0:_-s3:_*alpha:_+s3; } with{ // freq = 2*(10^(3*normFreq+1)); K = 2.0*(Q - 0.707)/(10.0 - 0.707); // target. wd = 2*ma.PI*freq; T = 1/ma.SR; wa = (2/T)*tan(wd*T/2); g = wa*T/2; G = g/(1.0 + g); alpha = G; // target. B3 = (K - K*G)/(1 + g); // target. B2 = -1/(1 + g); // target. alpha0 = 1/(1 - K*G + K*G*G); // target. }; korg35LPF_approx(freq,Q) = _ <: (s1,s2,s3,y) : !,!,!,_ letrec{ 's1 = _-s1:_*(alpha*2):_+s1; 's2 = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2):_*alpha0:_-s3:_*alpha:_+s3:_*K:_-s2:_*(alpha*2):_+s2; 's3 = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2):_*alpha0:_-s3:_*(alpha*2):_+s3; 'y = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2) :_*alpha0:_-s3:_*alpha:_+s3; } with{ // Only valid in [0, 0.498). 0.5 is nyquist frequency. tan_halfpi_approx(x) = ( 4.189308700355015e-05 + 4.290568649086532 * x + -2.657498976290899 * x * x + -1.5163927048819992 * x * x * x ) / ( 1.3667229106607917 + -0.8644224895636948 * x + -4.828883069406347 * x * x + 2.181672945531366 * x * x * x ); // freq = 2*(10^(3*normFreq+1)); K = 2.0*(Q - 0.707)/(10.0 - 0.707); g = tan_halfpi_approx(freq / ma.SR); G = g/(1.0 + g); alpha = G; B3 = (K - K*G)/(1 + g); B2 = -1/(1 + g); alpha0 = 1/(1 - K*G + K*G*G); }; freq = hslider("normFreq", 124, -12, 124, 1e-5) : ba.pianokey2hz : min(20000); Q = hslider("Q", 0, 0, 10, 1e-5); process = _ <: korg35LPF(freq, Q), korg35LPF_approx(freq, Q);
https://raw.githubusercontent.com/magnetophon/DigiDrie/a9f79d502e1f8d522e5f47e0c460ae99e80f9441/faust/benchmark/korg35lfp/korg35lpf_test.dsp
faust
freq = 2*(10^(3*normFreq+1)); target. target. target. target. target. Only valid in [0, 0.498). 0.5 is nyquist frequency. freq = 2*(10^(3*normFreq+1));
declare korg35LPF author "Eric Tarr"; declare korg35LPF license "MIT-style STK-4.3 license"; import("stdfaust.lib"); korg35LPF(freq,Q) = _ <: (s1,s2,s3,y) : !,!,!,_ letrec{ 's1 = _-s1:_*(alpha*2):_+s1; 's2 = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2):_*alpha0:_-s3:_*alpha:_+s3:_*K:_-s2:_*(alpha*2):_+s2; 's3 = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2):_*alpha0:_-s3:_*(alpha*2):_+s3; 'y = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2) :_*alpha0:_-s3:_*alpha:_+s3; } with{ wd = 2*ma.PI*freq; T = 1/ma.SR; wa = (2/T)*tan(wd*T/2); g = wa*T/2; G = g/(1.0 + g); }; korg35LPF_approx(freq,Q) = _ <: (s1,s2,s3,y) : !,!,!,_ letrec{ 's1 = _-s1:_*(alpha*2):_+s1; 's2 = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2):_*alpha0:_-s3:_*alpha:_+s3:_*K:_-s2:_*(alpha*2):_+s2; 's3 = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2):_*alpha0:_-s3:_*(alpha*2):_+s3; 'y = _-s1:_*alpha:_+s1:_+(s3*B3):_+(s2*B2) :_*alpha0:_-s3:_*alpha:_+s3; } with{ tan_halfpi_approx(x) = ( 4.189308700355015e-05 + 4.290568649086532 * x + -2.657498976290899 * x * x + -1.5163927048819992 * x * x * x ) / ( 1.3667229106607917 + -0.8644224895636948 * x + -4.828883069406347 * x * x + 2.181672945531366 * x * x * x ); K = 2.0*(Q - 0.707)/(10.0 - 0.707); g = tan_halfpi_approx(freq / ma.SR); G = g/(1.0 + g); alpha = G; B3 = (K - K*G)/(1 + g); B2 = -1/(1 + g); alpha0 = 1/(1 - K*G + K*G*G); }; freq = hslider("normFreq", 124, -12, 124, 1e-5) : ba.pianokey2hz : min(20000); Q = hslider("Q", 0, 0, 10, 1e-5); process = _ <: korg35LPF(freq, Q), korg35LPF_approx(freq, Q);
b788d980a683521f0b3dc1287707e0d16055b7c6418bf3a12827e50504bb84e9
johannphilippe/paw2022
seq_poly_detect.dsp
declare name "polyphonic_detection"; declare version "1.0"; declare author "Johann Philippe"; declare license "MIT"; declare copyright "(c) Johann Philippe 2022"; import("stdfaust.lib"); mpulse(smps_dur, trig) = pulsation with { count = ba.countdown(smps_dur, trig > 0 ); //count = -(1)~_, smps_dur : select2(trig); pulsation = 0, 1 : select2(count > 0); }; mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig); line(time, sig) = res letrec { 'changed = (sig' != sig) | (time' != time); 'steps = ma.SR * time; 'cntup = ba.countup(steps ,changed); 'diff = ( sig - res); 'inc = diff / steps : ba.sAndH(changed); 'res = res, res + inc : select2(cntup < steps); }; /* poly_detector : A polyphonic pitch detector based on parallel bandpass filters Input Arguments : * thresh : threshold detection - when the RMS level of a band crosses the threshold, it will output the RMS of the band, else 0 * rms_avg : RMS average (duration in seconds) * sig : input signal Output : * N_BANDS parallel signals. Value of each signal is the RMS of the band if this RMS level is above threshold, else 0. Bandpass filters frequencies are MIDI notes from 20 to (20 + N_BANDS) */ // Increase N_FILTER for more accuracy, reduce it to increase processing speed N_FILTER = 3; // From midi note 20 to 20 + 105 (125) N_BANDS = 105; poly_detector(thresh, rms_avg,atq, rel, sig) = 0 : seq(n, N_BANDS, chain(20 + n)) with { // Precision of filters is 1/4 tone up and down of the center frequency //filter(note) = fi.resonbp(ba.midikey2hz(note), 1000, 0.005) ; //fi.bandpass(1, ba.midikey2hz(note - 0.5), ba.midikey2hz(note + 0.5)); filter(note) = fi.bandpass(1, ba.midikey2hz(note - 0.5), ba.midikey2hz(note + 0.5)); // Sequential butterworth bandpass filter band( note) = seq(n, N_FILTER, filter(note)); oscilo(note, amp) = (os.osc(ba.midikey2hz(note) ) + (os.osc(ba.midikey2hz(note) * 0.5) *0.5 ) ) : *(env) : *(itp_amp) with { trig = amp : mpulse_dur(atq); env = trig : en.are(atq, rel); itp_amp = amp : ba.sAndH(amp > 0) : line(0.1); }; // Filters the input signal, and calls RMS detection chain(note) = +(syn) with { syn = sig : band(note) : fi.dcblocker : detect : oscilo(note); detect(band) = 0, brms : select2(brms > thresh) with { brms = band : an.rms_envelope_rect(rms_avg); }; }; }; reverberate(mix, sig) = sig : re.mono_freeverb(0.8, 0.8, 0.4, 1) : _ * mix + sig * (1 - mix); rms_avg = hslider("rms", 0.01, 0.0001, 1, 0.00001); atq = hslider("attack", 0.1, 0.05, 1, 0.01); rel = hslider("release", 0.1, 0.01, 3, 0.01); threshold = hslider("thresh", 0.001, 0.0001, 1, 0.0001); mix = hslider("drymix", 0, 0, 1, 0.01) : si.smoo; process = _ <: poly_detector(threshold, rms_avg, atq, rel), _ : reverberate(0.4), _ * mix;
https://raw.githubusercontent.com/johannphilippe/paw2022/d9b921a44e72bab11e457a13a1b43a4eabca53df/examples/seq_poly_detect.dsp
faust
count = -(1)~_, smps_dur : select2(trig); poly_detector : A polyphonic pitch detector based on parallel bandpass filters Input Arguments : * thresh : threshold detection - when the RMS level of a band crosses the threshold, it will output the RMS of the band, else 0 * rms_avg : RMS average (duration in seconds) * sig : input signal Output : * N_BANDS parallel signals. Value of each signal is the RMS of the band if this RMS level is above threshold, else 0. Bandpass filters frequencies are MIDI notes from 20 to (20 + N_BANDS) Increase N_FILTER for more accuracy, reduce it to increase processing speed From midi note 20 to 20 + 105 (125) Precision of filters is 1/4 tone up and down of the center frequency filter(note) = fi.resonbp(ba.midikey2hz(note), 1000, 0.005) ; //fi.bandpass(1, ba.midikey2hz(note - 0.5), ba.midikey2hz(note + 0.5)); Sequential butterworth bandpass filter Filters the input signal, and calls RMS detection
declare name "polyphonic_detection"; declare version "1.0"; declare author "Johann Philippe"; declare license "MIT"; declare copyright "(c) Johann Philippe 2022"; import("stdfaust.lib"); mpulse(smps_dur, trig) = pulsation with { count = ba.countdown(smps_dur, trig > 0 ); pulsation = 0, 1 : select2(count > 0); }; mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig); line(time, sig) = res letrec { 'changed = (sig' != sig) | (time' != time); 'steps = ma.SR * time; 'cntup = ba.countup(steps ,changed); 'diff = ( sig - res); 'inc = diff / steps : ba.sAndH(changed); 'res = res, res + inc : select2(cntup < steps); }; N_FILTER = 3; N_BANDS = 105; poly_detector(thresh, rms_avg,atq, rel, sig) = 0 : seq(n, N_BANDS, chain(20 + n)) with { filter(note) = fi.bandpass(1, ba.midikey2hz(note - 0.5), ba.midikey2hz(note + 0.5)); band( note) = seq(n, N_FILTER, filter(note)); oscilo(note, amp) = (os.osc(ba.midikey2hz(note) ) + (os.osc(ba.midikey2hz(note) * 0.5) *0.5 ) ) : *(env) : *(itp_amp) with { trig = amp : mpulse_dur(atq); env = trig : en.are(atq, rel); itp_amp = amp : ba.sAndH(amp > 0) : line(0.1); }; chain(note) = +(syn) with { syn = sig : band(note) : fi.dcblocker : detect : oscilo(note); detect(band) = 0, brms : select2(brms > thresh) with { brms = band : an.rms_envelope_rect(rms_avg); }; }; }; reverberate(mix, sig) = sig : re.mono_freeverb(0.8, 0.8, 0.4, 1) : _ * mix + sig * (1 - mix); rms_avg = hslider("rms", 0.01, 0.0001, 1, 0.00001); atq = hslider("attack", 0.1, 0.05, 1, 0.01); rel = hslider("release", 0.1, 0.01, 3, 0.01); threshold = hslider("thresh", 0.001, 0.0001, 1, 0.0001); mix = hslider("drymix", 0, 0, 1, 0.01) : si.smoo; process = _ <: poly_detector(threshold, rms_avg, atq, rel), _ : reverberate(0.4), _ * mix;
0d7f50cf193eb0021c13d0137d6df1ca066277b1fb11758e4c0893a5329406b4
afalaize/faust
FFT.dsp
// Radix 2 FFT, decimation in time, real and imag parts interleaved declare name "FFT"; declare author "JOS"; declare license "STK-4.3"; import("stdfaust.lib"); N=32; // FFT size (power of 2) // Number of frequency bins (including dc and SR/2) is N/2+1 No2 = N>>1; signal = amp * cosine with { cosine = select2(k==0, select2(k==No2, 2.0*os.oscrc(f(k)), // 2x since negative-frequencies not displayed 1-1':+~*(-1) // Alternating sequence: 1, -1, 1, -1 ), 1.0); // make sure phase is zero (freq jumps around) f(k) = float(k) * ma.SR / float(N); // only test FFT bin frequencies k = hslider("[2] FFT Bin Number",N/4,0,No2,0.001) : int <: _,dpy : attach; dpy = hbargraph("[3] Measured FFT Bin Number",0,No2); amp = hslider("[4] Amplitude",0.1,0,1,0.001); }; process = signal : dm.fft_spectral_level_demo(N) <: _,_;
https://raw.githubusercontent.com/afalaize/faust/8f9f5fe3aa167eaeecc15a99d4da984ac2797be3/examples/analysis/FFT.dsp
faust
Radix 2 FFT, decimation in time, real and imag parts interleaved FFT size (power of 2) Number of frequency bins (including dc and SR/2) is N/2+1 2x since negative-frequencies not displayed Alternating sequence: 1, -1, 1, -1 make sure phase is zero (freq jumps around) only test FFT bin frequencies
declare name "FFT"; declare author "JOS"; declare license "STK-4.3"; import("stdfaust.lib"); No2 = N>>1; signal = amp * cosine with { cosine = select2(k==0, select2(k==No2, ), k = hslider("[2] FFT Bin Number",N/4,0,No2,0.001) : int <: _,dpy : attach; dpy = hbargraph("[3] Measured FFT Bin Number",0,No2); amp = hslider("[4] Amplitude",0.1,0,1,0.001); }; process = signal : dm.fft_spectral_level_demo(N) <: _,_;
0992bafc69a7a5ddadd4c77862f632dd79a0d2e88703a2fe5a0717ed1d29e13d
rottingsounds/bitDSP-faust
bitstreamAdder.dsp
// This is a simple example that tests an adder for 1-bit streams. // In this example, in particular, we will add together a stream // of 1s and a stream of 0s. Summing two opposite values results // in a zero-ed output, which consists of alternating 0s and 1s // in the delta-sigma-modulated domain. declare name "Bitstream adder"; declare author "Dario Sanfilippo"; declare reference "O'leary, P., & Maloberti, F. (1990). Bit stream adder for oversampling coded data. Electronics Letters, 26(20), 1708-1709."; import("stdfaust.lib"); bit = library("bitDSP.lib"); // plot // CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib // bitstream_adder-example.dsp // ./bitstream_adder-example -n 50 // compile // CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib // bitstream_adder-example.dsp // ./bitstream_adder-example process = bit.bitstream_adder(0, 1);
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/21cf36105c55b6e18969a867a319530a0ef1ea63/examples/bitstreamAdder.dsp
faust
This is a simple example that tests an adder for 1-bit streams. In this example, in particular, we will add together a stream of 1s and a stream of 0s. Summing two opposite values results in a zero-ed output, which consists of alternating 0s and 1s in the delta-sigma-modulated domain. plot CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib bitstream_adder-example.dsp ./bitstream_adder-example -n 50 compile CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib bitstream_adder-example.dsp ./bitstream_adder-example
declare name "Bitstream adder"; declare author "Dario Sanfilippo"; declare reference "O'leary, P., & Maloberti, F. (1990). Bit stream adder for oversampling coded data. Electronics Letters, 26(20), 1708-1709."; import("stdfaust.lib"); bit = library("bitDSP.lib"); process = bit.bitstream_adder(0, 1);
6f13e9d4f4d8083cf7821cd2af21e87137c2b0c90ab3b50ee58d1408732b61be
olegkapitonov/KPP-VST3
kpp_fuzz.dsp
/* * Copyright (C) 2018-2020 Oleg Kapitonov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * -------------------------------------------------------------------------- */ /* * This plugin is a vintage fuzz pedal emulator. * * Process chain: * * input->pre_filter->*drive_knob->fuzz->tone->*volume_knob->output * * pre-filter - lowpass, 1 order, 1720 Hz. Emulates effect * of low impedance of vintage pedal. * * distortion - 2 cascades, asymmetric distortion and clipper. * Emulates distortion of old bad class A transistor cascades. * tone - highshelf 720 Hz. */ declare name "kpp_fuzz"; declare author "Oleg Kapitonov"; declare license "GPLv3"; declare version "1.2"; import("stdfaust.lib"); process = output with { // Bypass button, 0 - pedal on, 1 -pedal off (bypass on) bypass = checkbox("99_bypass"); fuzz = vslider("fuzz",50,0,100,0.01); tone = vslider("tone",-7.5,-15,0,0.1); volume = vslider("volume",0.5,0,1,0.001); clamp = min(2.0) : max(-2.0); pre_filter = fi.dcblocker : fi.lowpass(1, 2000.0); biaser(Uin) = Uout letrec { 'Ulimited = Uin : max(-50.0 + Ubias) : -(Ubias); 'Ubias = min(Ubias + 100.0*Ulimited/ma.SR - 0.0*Ubias/ma.SR, 2000.0); 'Uout = Uin - Ubias; }; distortion = *(100.0) : *(ba.db2linear(fuzz/5.0) - 1.0) : biaser : *(ba.db2linear(fuzz/100.0*6.0)) : max(-50.0) : min(100.0) : fi.dcblocker; filter = fi.high_shelf(tone + 12.5, 720.0); stomp = pre_filter : filter : distortion : *(ba.db2linear(volume * 25.0 ) / 100.0) : /(20.0); output = _,_ : + : ba.bypass1(bypass, stomp) <: _,_; };
https://raw.githubusercontent.com/olegkapitonov/KPP-VST3/91af48938c94d5a72009e01ef139bc3de8cf8dcd/kpp_fuzz/include/kpp_fuzz.dsp
faust
* Copyright (C) 2018-2020 Oleg Kapitonov * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * -------------------------------------------------------------------------- * This plugin is a vintage fuzz pedal emulator. * * Process chain: * * input->pre_filter->*drive_knob->fuzz->tone->*volume_knob->output * * pre-filter - lowpass, 1 order, 1720 Hz. Emulates effect * of low impedance of vintage pedal. * * distortion - 2 cascades, asymmetric distortion and clipper. * Emulates distortion of old bad class A transistor cascades. * tone - highshelf 720 Hz. Bypass button, 0 - pedal on, 1 -pedal off (bypass on)
declare name "kpp_fuzz"; declare author "Oleg Kapitonov"; declare license "GPLv3"; declare version "1.2"; import("stdfaust.lib"); process = output with { bypass = checkbox("99_bypass"); fuzz = vslider("fuzz",50,0,100,0.01); tone = vslider("tone",-7.5,-15,0,0.1); volume = vslider("volume",0.5,0,1,0.001); clamp = min(2.0) : max(-2.0); pre_filter = fi.dcblocker : fi.lowpass(1, 2000.0); biaser(Uin) = Uout letrec { 'Ulimited = Uin : max(-50.0 + Ubias) : -(Ubias); 'Ubias = min(Ubias + 100.0*Ulimited/ma.SR - 0.0*Ubias/ma.SR, 2000.0); 'Uout = Uin - Ubias; }; distortion = *(100.0) : *(ba.db2linear(fuzz/5.0) - 1.0) : biaser : *(ba.db2linear(fuzz/100.0*6.0)) : max(-50.0) : min(100.0) : fi.dcblocker; filter = fi.high_shelf(tone + 12.5, 720.0); stomp = pre_filter : filter : distortion : *(ba.db2linear(volume * 25.0 ) / 100.0) : /(20.0); output = _,_ : + : ba.bypass1(bypass, stomp) <: _,_; };
bcfd494d965d9550486fbce23ccd4c1a68d8d6c0d9f8452ec0c1215220efdd1e
SpotlightKid/faustfilters
oberheim.dsp
declare name "Oberheim"; declare description "Oberheim multi-mode, state-variable filter"; declare author "Christopher Arndt"; declare license "MIT-style STK-4.3 license"; import("stdfaust.lib"); //==================================Oberheim Filters====================================== // The following filter (4 types) is an implementation of the virtual analog // model described in Section 7.2 of the Will Pirkle book, "Designing Software // Synthesizer Plug-ins in C++. It is based on the block diagram in Figure 7.5. // // The Oberheim filter is a state-variable filter with soft-clipping distortion // within the circuit. // // In many VA filters, distortion is accomplished using the "tanh" function. // For this Faust implementation, that distortion function was replaced with // the `(ef.)cubicnl` function. //======================================================================================== //------------------`oberheim`----------------- // Generic multi-outputs Oberheim filter (see description above). // // #### Usage // // ``` // _ : oberheim(normFreq,Q) : _,_,_,_ // ``` // // Where: // // * `freq`: cutoff / center frequency (20.0 - 20000.0 Hzz) // * `Q`: q (0.5 - 10.0) //--------------------------------------------------------------------- declare oberheim author "Eric Tarr"; declare oberheim license "MIT-style STK-4.3 license"; oberheim(freq, Q) = _<:(s1,s2,ybsf,ybpf,yhpf,ylpf) : !,!,_,_,_,_ letrec{ 's1 = _-s2:_-(s1*FBs1):_*alpha0:_*g<:_,(_+s1:ef.cubicnl(0.0,0)):>_; 's2 = _-s2:_-(s1*FBs1):_*alpha0:_*g:_+s1:ef.cubicnl(0.0,0):_*g*2:_+s2; // Compute the BSF, BPF, HPF, LPF outputs 'ybsf = _-s2:_-(s1*FBs1):_*alpha0<:(_*g:_+s1:ef.cubicnl(0.0,0):_*g:_+s2),_:>_; 'ybpf = _-s2:_-(s1*FBs1):_*alpha0:_*g:_+s1:ef.cubicnl(0.0,0); 'yhpf = _-s2:_-(s1*FBs1):_*alpha0; 'ylpf = _-s2:_-(s1*FBs1):_*alpha0:_*g :_+s1:ef.cubicnl(0.0,0):_*g:_+s2; } with{ // freq = 2*(10^(3*normFreq+1)); wd = 2*ma.PI*freq; T = 1/ma.SR; wa = (2/T)*tan(wd*T/2); g = wa*T/2; G = g/(1.0 + g); R = 1/(2*Q); FBs1 = (2*R+g); alpha0 = 1/(1 + 2*R*g + g*g); }; q = hslider("[1]Q[symbol: q][abbrev: q][style:knob]", 1.0, 0.5, 10.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 = oberheim(cutoff, q);
https://raw.githubusercontent.com/SpotlightKid/faustfilters/8dfb35de7b83935806abe950187e056623b6c01a/faust/oberheim.dsp
faust
==================================Oberheim Filters====================================== The following filter (4 types) is an implementation of the virtual analog model described in Section 7.2 of the Will Pirkle book, "Designing Software Synthesizer Plug-ins in C++. It is based on the block diagram in Figure 7.5. The Oberheim filter is a state-variable filter with soft-clipping distortion within the circuit. In many VA filters, distortion is accomplished using the "tanh" function. For this Faust implementation, that distortion function was replaced with the `(ef.)cubicnl` function. ======================================================================================== ------------------`oberheim`----------------- Generic multi-outputs Oberheim filter (see description above). #### Usage ``` _ : oberheim(normFreq,Q) : _,_,_,_ ``` Where: * `freq`: cutoff / center frequency (20.0 - 20000.0 Hzz) * `Q`: q (0.5 - 10.0) --------------------------------------------------------------------- Compute the BSF, BPF, HPF, LPF outputs freq = 2*(10^(3*normFreq+1));
declare name "Oberheim"; declare description "Oberheim multi-mode, state-variable filter"; declare author "Christopher Arndt"; declare license "MIT-style STK-4.3 license"; import("stdfaust.lib"); declare oberheim author "Eric Tarr"; declare oberheim license "MIT-style STK-4.3 license"; oberheim(freq, Q) = _<:(s1,s2,ybsf,ybpf,yhpf,ylpf) : !,!,_,_,_,_ letrec{ 's1 = _-s2:_-(s1*FBs1):_*alpha0:_*g<:_,(_+s1:ef.cubicnl(0.0,0)):>_; 's2 = _-s2:_-(s1*FBs1):_*alpha0:_*g:_+s1:ef.cubicnl(0.0,0):_*g*2:_+s2; 'ybsf = _-s2:_-(s1*FBs1):_*alpha0<:(_*g:_+s1:ef.cubicnl(0.0,0):_*g:_+s2),_:>_; 'ybpf = _-s2:_-(s1*FBs1):_*alpha0:_*g:_+s1:ef.cubicnl(0.0,0); 'yhpf = _-s2:_-(s1*FBs1):_*alpha0; 'ylpf = _-s2:_-(s1*FBs1):_*alpha0:_*g :_+s1:ef.cubicnl(0.0,0):_*g:_+s2; } with{ wd = 2*ma.PI*freq; T = 1/ma.SR; wa = (2/T)*tan(wd*T/2); g = wa*T/2; G = g/(1.0 + g); R = 1/(2*Q); FBs1 = (2*R+g); alpha0 = 1/(1 + 2*R*g + g*g); }; q = hslider("[1]Q[symbol: q][abbrev: q][style:knob]", 1.0, 0.5, 10.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 = oberheim(cutoff, q);
00a243daaac4fc94394d8d8e8e3d08a32bbd23e93bc8c9ee519aba3dbe7852da
mwicat/faustfx
fig8verb.dsp
/* * Synthetic reverberator simulator * * Washy and synthetic reverb, sounds gorgeous when modulated. * The core architecture is two channels of allpass filter series * terminated by delays with their feedbacks crossed as described by Keith Barr at Spin Semiconductor * (http://www.spinsemi.com/knowledge_base/effects.html#Reverberation) * * The algorithm is based on NI Reaktor Metaverb. * Metaverb is a reverb effect from the ensemble "Cha Osc" by Stephan Schmitt. */ declare name "fig8verb"; declare author "Marek Wiewiorski"; declare version "0.4"; declare license "MIT"; import("stdfaust.lib"); size_scale(0) = 0.506392; size_scale(1) = 0.803821; size_scale(2) = 1; size_scale(3) = 1.49834; fig8verb( max_dtime, size, diffusion, feedback_gain, lfo_freq, lfo_amount, hs_gain, hs_freq, ls_gain, ls_freq) = (route_in : +,+ : core) ~ feedback with { route_in = route(4, 4, (1, 3), (2, 2), (3, 1), (4, 4)); filter_hs = fi.highshelf(1, hs_gain, hs_freq); filter_ls = fi.lowshelf(1, ls_gain, ls_freq); filter = filter_hs : filter_ls; lfo_phase(i) = ma.PI/4 * i; lfo(i) = lfo_amount * os.oscp(lfo_freq, lfo_phase(i)); dtime(ch, i) = (size_scale(i) * size) * (1 + lfo(ch*i)); allpass(ch, i) = fi.allpass_fcomb(max_dtime, dtime(ch, i), diffusion); diffusor(ch) = filter : seq(i, 3, allpass(ch, i)); delay(ch) = de.fdelay(max_dtime, dtime(ch, 3)); feedback = par(i, 2, delay(i) * feedback_gain); core = par(i, 2, diffusor(i)); }; fig8verb_ui = (_,_) <: ((_, _), fig8verb( max_dtime, size, diffusion, feedback, lfo_freq, lfo_amount, hs_gain, hs_freq, ls_gain, ls_freq)) : route(4, 4, (1, 1), (2, 3), (3, 2), (4, 4)) : par(i, 2, si.interpolate(mix)) with { max_dtime = 5000; general_group(x) = hgroup("[0] General [tooltip:General controls]", x); mix = general_group(vslider("[0] Mix [unit:%] [tooltip:Mix] [style:knob]", 100, 0, 100, 0.1)) * 0.01; size = general_group(vslider("[1] Size [unit:%] [tooltip:Scale size in percents] [style:knob]", 60, 0, 100, 0.1)) * 0.01 * max_dtime : si.smooth(0.99); feedback = general_group(vslider("[2] Feedback [unit:%] [tooltip:Feedback amount] [style:knob]", 60, 0, 100, 0.1)) * 0.01; diffusion = general_group(vslider("[3] Diffusion [unit:%] [tooltip:Diffusion amount] [style:knob]", 66, 0, 100, 0.1)) * 0.01; damping_group(x) = hgroup("[1] Damping [tooltip:Damping filters in the feedback loop]", x); hs_gain = damping_group(hslider("[0] HighShelf [unit:dB] [tooltip:High shelf gain] [style:knob]", 0, -24, 24, 0.1)); hs_freq = damping_group(hslider("[1] HighFreq [unit:Hz] [style:knob] [tooltip:High shelf frequency] [scale:log]", 4000, 500, 10000, 10)); ls_gain = damping_group(hslider("[2] LowShelf [unit:dB] [tooltip:Low shelf gain] [style:knob]", 0, -24, 24, 0.1)); ls_freq = damping_group(hslider("[3] LowFreq [unit:Hz] [tooltip:Low Shelf Frequency] [style:knob] [scale:log]", 100, 100, 4000, 10)); modulation_group(x) = hgroup("[2] Modulation [tooltip:Control over modulation of delay times] [style:knob]", x); lfo_freq = modulation_group(vslider("[0] Rate [unit:Hz] [tooltip:Modulation LFO frequency] [style:knob]", 0.7, 0, 10, 0.1)); lfo_amount = modulation_group(vslider("[1] Depth [unit:%] [tooltip:Modulation LFO amount] [style:knob]", 0.3, 0, 5, 0.6)) * 0.01; }; process = fig8verb_ui;
https://raw.githubusercontent.com/mwicat/faustfx/3fded3fd42b221eccbeec4ef79a28c0faa0bb6e9/docs/fig8verb/fig8verb.dsp
faust
* Synthetic reverberator simulator * * Washy and synthetic reverb, sounds gorgeous when modulated. * The core architecture is two channels of allpass filter series * terminated by delays with their feedbacks crossed as described by Keith Barr at Spin Semiconductor * (http://www.spinsemi.com/knowledge_base/effects.html#Reverberation) * * The algorithm is based on NI Reaktor Metaverb. * Metaverb is a reverb effect from the ensemble "Cha Osc" by Stephan Schmitt.
declare name "fig8verb"; declare author "Marek Wiewiorski"; declare version "0.4"; declare license "MIT"; import("stdfaust.lib"); size_scale(0) = 0.506392; size_scale(1) = 0.803821; size_scale(2) = 1; size_scale(3) = 1.49834; fig8verb( max_dtime, size, diffusion, feedback_gain, lfo_freq, lfo_amount, hs_gain, hs_freq, ls_gain, ls_freq) = (route_in : +,+ : core) ~ feedback with { route_in = route(4, 4, (1, 3), (2, 2), (3, 1), (4, 4)); filter_hs = fi.highshelf(1, hs_gain, hs_freq); filter_ls = fi.lowshelf(1, ls_gain, ls_freq); filter = filter_hs : filter_ls; lfo_phase(i) = ma.PI/4 * i; lfo(i) = lfo_amount * os.oscp(lfo_freq, lfo_phase(i)); dtime(ch, i) = (size_scale(i) * size) * (1 + lfo(ch*i)); allpass(ch, i) = fi.allpass_fcomb(max_dtime, dtime(ch, i), diffusion); diffusor(ch) = filter : seq(i, 3, allpass(ch, i)); delay(ch) = de.fdelay(max_dtime, dtime(ch, 3)); feedback = par(i, 2, delay(i) * feedback_gain); core = par(i, 2, diffusor(i)); }; fig8verb_ui = (_,_) <: ((_, _), fig8verb( max_dtime, size, diffusion, feedback, lfo_freq, lfo_amount, hs_gain, hs_freq, ls_gain, ls_freq)) : route(4, 4, (1, 1), (2, 3), (3, 2), (4, 4)) : par(i, 2, si.interpolate(mix)) with { max_dtime = 5000; general_group(x) = hgroup("[0] General [tooltip:General controls]", x); mix = general_group(vslider("[0] Mix [unit:%] [tooltip:Mix] [style:knob]", 100, 0, 100, 0.1)) * 0.01; size = general_group(vslider("[1] Size [unit:%] [tooltip:Scale size in percents] [style:knob]", 60, 0, 100, 0.1)) * 0.01 * max_dtime : si.smooth(0.99); feedback = general_group(vslider("[2] Feedback [unit:%] [tooltip:Feedback amount] [style:knob]", 60, 0, 100, 0.1)) * 0.01; diffusion = general_group(vslider("[3] Diffusion [unit:%] [tooltip:Diffusion amount] [style:knob]", 66, 0, 100, 0.1)) * 0.01; damping_group(x) = hgroup("[1] Damping [tooltip:Damping filters in the feedback loop]", x); hs_gain = damping_group(hslider("[0] HighShelf [unit:dB] [tooltip:High shelf gain] [style:knob]", 0, -24, 24, 0.1)); hs_freq = damping_group(hslider("[1] HighFreq [unit:Hz] [style:knob] [tooltip:High shelf frequency] [scale:log]", 4000, 500, 10000, 10)); ls_gain = damping_group(hslider("[2] LowShelf [unit:dB] [tooltip:Low shelf gain] [style:knob]", 0, -24, 24, 0.1)); ls_freq = damping_group(hslider("[3] LowFreq [unit:Hz] [tooltip:Low Shelf Frequency] [style:knob] [scale:log]", 100, 100, 4000, 10)); modulation_group(x) = hgroup("[2] Modulation [tooltip:Control over modulation of delay times] [style:knob]", x); lfo_freq = modulation_group(vslider("[0] Rate [unit:Hz] [tooltip:Modulation LFO frequency] [style:knob]", 0.7, 0, 10, 0.1)); lfo_amount = modulation_group(vslider("[1] Depth [unit:%] [tooltip:Modulation LFO amount] [style:knob]", 0.3, 0, 5, 0.6)) * 0.01; }; process = fig8verb_ui;
83a829947c6fd75b30bc809219885a68ae9f76c85dea8c44ab79943d1b596781
rottingsounds/bitDSP-faust
dsm2.dsp
declare name "DSM2"; declare description "Second-order delta-sigma modulator example"; Second-order delta-sigma modulator - example declare author "Dario Sanfilippo"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); // plot // CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib dsm2.dsp // ./dsm2 -n 10 // compile // CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib dsm2.dsp // ./dsm2 // High-precision sinewave sine(f) = sin(os.phasor(2 * ma.PI, f)); // Bipolar multi-bit signal to bipolar one-bit signal // Standard test with a 1 kHz tone onebitstream = bit.dsm2(sine(1000)); // Bipolar one-bit signal to bipolar multi-bit signal // The process of low-passing corresponds to averaging // The low-pass cut-off sets the target bandwidth // The low-pass resolution of the coefficients sets the bitdepth // The low-pass order determines the accuracy in the noise removal multibitstream = fi.lowpass(4, 1000, onebitstream); // Final output process = multibitstream;
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/21cf36105c55b6e18969a867a319530a0ef1ea63/examples/dsm2.dsp
faust
plot CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib dsm2.dsp ./dsm2 -n 10 compile CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib dsm2.dsp ./dsm2 High-precision sinewave Bipolar multi-bit signal to bipolar one-bit signal Standard test with a 1 kHz tone Bipolar one-bit signal to bipolar multi-bit signal The process of low-passing corresponds to averaging The low-pass cut-off sets the target bandwidth The low-pass resolution of the coefficients sets the bitdepth The low-pass order determines the accuracy in the noise removal Final output
declare name "DSM2"; declare description "Second-order delta-sigma modulator example"; Second-order delta-sigma modulator - example declare author "Dario Sanfilippo"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); sine(f) = sin(os.phasor(2 * ma.PI, f)); onebitstream = bit.dsm2(sine(1000)); multibitstream = fi.lowpass(4, 1000, onebitstream); process = multibitstream;
278366ea7c5aec4d3aac5e18769fcd2cdf18b0d05dd2e6a26eeb445f5aadbe39
rottingsounds/bitDSP-faust
dsm1.dsp
declare name "dsm1"; declare description "First-order delta-sigma modulator - example"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); // plot // CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib dsm1-example.dsp // ./dsm1-example -n 10 // compile // CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib dsm1-example.dsp // ./dsm1-example // High-precision sinewave sine(f) = sin(os.phasor(2 * ma.PI, f)); // Bipolar multi-bit signal to bipolar one-bit signal // Standard test with a 1 kHz tone onebitstream = bit.dsm1(sine(1000)); // Bipolar one-bit signal to bipolar multi-bit signal // The process of low-passing corresponds to averaging // The low-pass cut-off sets the target bandwidth // The low-pass resolution of the coefficients sets the bitdepth // The low-pass order determines the accuracy in the noise removal multibitstream = fi.lowpass(4, 1000, onebitstream); // Final output process = multibitstream;
https://raw.githubusercontent.com/rottingsounds/bitDSP-faust/21cf36105c55b6e18969a867a319530a0ef1ea63/examples/dsm1.dsp
faust
plot CXXFLAGS="-I ../include" faust2csvplot -double -I ../lib dsm1-example.dsp ./dsm1-example -n 10 compile CXXFLAGS="-I ../../../include" faust2caqt -double -I ../lib dsm1-example.dsp ./dsm1-example High-precision sinewave Bipolar multi-bit signal to bipolar one-bit signal Standard test with a 1 kHz tone Bipolar one-bit signal to bipolar multi-bit signal The process of low-passing corresponds to averaging The low-pass cut-off sets the target bandwidth The low-pass resolution of the coefficients sets the bitdepth The low-pass order determines the accuracy in the noise removal Final output
declare name "dsm1"; declare description "First-order delta-sigma modulator - example"; declare author "Till Bovermann"; declare reference "http://rottingsounds.org"; import("stdfaust.lib"); bit = library("bitDSP.lib"); sine(f) = sin(os.phasor(2 * ma.PI, f)); onebitstream = bit.dsm1(sine(1000)); multibitstream = fi.lowpass(4, 1000, onebitstream); process = multibitstream;
810bc31712f1527a9c3a184bcb1e223bc8ed227365e422881226ff90630bd6d5
friskgit/snares
plain_snare.dsp
// -*- compile-command: "cd .. && make jack src=src/snare.dsp && cd -"; -*- declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); //---------------`Snare drum synth` -------------------------- // A take at a snare drum synth // // A single hit snare drum synth controllable with midi. Each hit is distribute over `channels` speakers. // It has its own trigger // // Where: // * midi note 67-89 // * stiffness 0-0.55 (mapped to note as in note 67 -> 0)§ // * midi velocity is mapped to pressure // // A useful parameter setting is: // // 30 Juni 2018 Henrik Frisk [email protected] //--------------------------------------------------- // Set the number of channels at compile time. channels = 16; // Main impulse for generating one hit. imp = button("gate"); // GUI posgroup(x) = vgroup("position", x); snaregroup(x) = vgroup("snare", x); // Main envelope env = en.ar(attack, rel, imp) * amp with { attack = snaregroup(hslider("attack", 0.00000001, 0, 0.1, 0.000000001) : si.smooth(0.1)); rel = snaregroup(hslider("rel", 0.1, 0.0000001, 0.5, 0.0000001) : si.smooth(0.2)); amp = snaregroup(hslider("vol", 0.5, 0, 1, 0.0001)); }; // Control the output channel pimp = imp : ba.impulsify; focus = posgroup(hslider("disperse", 1, 0, 1, 0.0001)); position = posgroup(hslider("displace", 1, 0, channels, 1)); rate = ma.SR/1000.0; rndctrl = (no.lfnoise(rate) * (channels + 1)) * focus : ma.fabs + position : int ; outputctrl = rndctrl : ba.sAndH(pimp); // Wrap channels around the array. ch_wrapped = ma.modulo(outputctrl, channels); // Noise generation and filter snare(n) = no.multinoise(8) : par(i, 8, _ * env * 0.1); filt = fi.resonbp(frq, q, gain) with { frq = snaregroup(hslider("freq", 200, 50, 5000, 0.1)); q = snaregroup(hslider("q", 1, 0.01, 10, 0.01)); gain = snaregroup(hslider("gain", 0, 0, 2, 0.00001)); }; process = vgroup("snaredrum", snare : par(i, 8, filt) :> _,_ :> ba.selectoutn(channels, ch_wrapped) );
https://raw.githubusercontent.com/friskgit/snares/bb43ea5e706a0ead6d65dd176a5c492b2f5d8f74/faust/snare/src/extras/plain_snare.dsp
faust
-*- compile-command: "cd .. && make jack src=src/snare.dsp && cd -"; -*- ---------------`Snare drum synth` -------------------------- A take at a snare drum synth A single hit snare drum synth controllable with midi. Each hit is distribute over `channels` speakers. It has its own trigger Where: * midi note 67-89 * stiffness 0-0.55 (mapped to note as in note 67 -> 0)§ * midi velocity is mapped to pressure A useful parameter setting is: 30 Juni 2018 Henrik Frisk [email protected] --------------------------------------------------- Set the number of channels at compile time. Main impulse for generating one hit. GUI Main envelope Control the output channel Wrap channels around the array. Noise generation and filter
declare version " 0.1 "; declare author " Henrik Frisk " ; declare author " henrikfr "; declare license " BSD "; declare copyright "(c) dinergy 2018 "; import("stdfaust.lib"); channels = 16; imp = button("gate"); posgroup(x) = vgroup("position", x); snaregroup(x) = vgroup("snare", x); env = en.ar(attack, rel, imp) * amp with { attack = snaregroup(hslider("attack", 0.00000001, 0, 0.1, 0.000000001) : si.smooth(0.1)); rel = snaregroup(hslider("rel", 0.1, 0.0000001, 0.5, 0.0000001) : si.smooth(0.2)); amp = snaregroup(hslider("vol", 0.5, 0, 1, 0.0001)); }; pimp = imp : ba.impulsify; focus = posgroup(hslider("disperse", 1, 0, 1, 0.0001)); position = posgroup(hslider("displace", 1, 0, channels, 1)); rate = ma.SR/1000.0; rndctrl = (no.lfnoise(rate) * (channels + 1)) * focus : ma.fabs + position : int ; outputctrl = rndctrl : ba.sAndH(pimp); ch_wrapped = ma.modulo(outputctrl, channels); snare(n) = no.multinoise(8) : par(i, 8, _ * env * 0.1); filt = fi.resonbp(frq, q, gain) with { frq = snaregroup(hslider("freq", 200, 50, 5000, 0.1)); q = snaregroup(hslider("q", 1, 0.01, 10, 0.01)); gain = snaregroup(hslider("gain", 0, 0, 2, 0.00001)); }; process = vgroup("snaredrum", snare : par(i, 8, filt) :> _,_ :> ba.selectoutn(channels, ch_wrapped) );
1bcee603cd2dbd5bc39963e1ea475e1538a582efab9a151f7130523accd1f01e
RuolunWeng/ruolunweng.github.io
SNoiseS.dsp
declare name "Noises"; declare author "ER"; declare version "1.0"; import("stdfaust.lib"); /* ============ DESCRIPTION =============: - White Noise and Pink Noise generator. - Head = silence. - Fishing rod = Volume variation. - Right = silence. - Face = pink no.noise. - Left = white no.noise. - Rocking to switch from one no.noise to another. */ // pink no.noise filter (-3dB per octave), see musicdsp.org p = f : (+ ~ g) with { f(x) = 0.04957526213389*x - 0.06305581334498*x' + 0.01483220320740*x''; g(x) = 1.80116083982126*x - 0.80257737639225*x'; }; // white no.noise generator rand = +(12345)~*(1103515245); w = rand/2147483647.0; White = w * hslider("White Noise Volume[acc:1 0 -10 0 10][style:knob]", 0.5, 0, 2, 0.01); Pink = (w : p) * (2) * hslider("Pink Noise Volume[acc:1 0 -10 0 10][tooltip:0=Mute, 1=White Noise, 2=Pink Noise][style:knob]", 0.5, 0, 2, 0.01); NoiseType = hslider("Noise Type[acc:0 0 -10 0 10]", 1,0,2,1); Ntype(n) = abs(NoiseType - n) < 0.5; Noise(0) = 0; Noise(1) = Pink; Noise(2) = White; process = par(i, 3, Noise(i) * Ntype(i)) :>_;
https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SNoiseS.dsp
faust
============ DESCRIPTION =============: - White Noise and Pink Noise generator. - Head = silence. - Fishing rod = Volume variation. - Right = silence. - Face = pink no.noise. - Left = white no.noise. - Rocking to switch from one no.noise to another. pink no.noise filter (-3dB per octave), see musicdsp.org white no.noise generator
declare name "Noises"; declare author "ER"; declare version "1.0"; import("stdfaust.lib"); p = f : (+ ~ g) with { f(x) = 0.04957526213389*x - 0.06305581334498*x' + 0.01483220320740*x''; g(x) = 1.80116083982126*x - 0.80257737639225*x'; }; rand = +(12345)~*(1103515245); w = rand/2147483647.0; White = w * hslider("White Noise Volume[acc:1 0 -10 0 10][style:knob]", 0.5, 0, 2, 0.01); Pink = (w : p) * (2) * hslider("Pink Noise Volume[acc:1 0 -10 0 10][tooltip:0=Mute, 1=White Noise, 2=Pink Noise][style:knob]", 0.5, 0, 2, 0.01); NoiseType = hslider("Noise Type[acc:0 0 -10 0 10]", 1,0,2,1); Ntype(n) = abs(NoiseType - n) < 0.5; Noise(0) = 0; Noise(1) = Pink; Noise(2) = White; process = par(i, 3, Noise(i) * Ntype(i)) :>_;
1f2d2286106107416e2fa49fbb101ccc6a0ad929762a54871fa516bf5792f13c
sonejostudios/SuperCutSequencer
SuperCutSequencer.dsp
declare name "SuperCutSequencer"; declare version "1.2"; declare author "Vincent Rateau"; declare license "GPL v3"; declare reference "www.sonejo.net"; declare description "Cut 'On/Off' Sequencer 8 steps with smooth) synced to Midi-Clock Beats and Midi-Clock Start/Stop"; //import("signals.lib"); import("stdfaust.lib"); // Cut "On/Off" Sequencer 8 steps with smooth) synced to Midi-Clock Beats and Midi-Clock Start/Stop. process = cutsequencer, cutsequencer; //GLOBAL VARIABLES /////////////////////////////////////// // midi ctrl out numbers to start iterations //steppush and stepled are used to on/off the steps (and light back the state of each step ) //seqled shows the current played step steppush = 57; // controls checkboxes step on/off stepled = 57; // controls lightning of buttons if step is on or off seqled = 41; // controls lighning of played step //CUT SEQUENCER /////////////////////////////////////// cutsequencer = _ <: (_ <: cutseq :> _), _ : drywet :> _ with{ // dry / wet knob drywet = _* drywetgui , _* (1-drywetgui) ; drywetgui = vslider("[08]Dry/Wet[style:knob][midi: ctrl 52]", 0, 0, 1, 0.001) : s ; //create par 8 with on/off checkboxes, send them sif (counter conditions) cutseq(a,b,c,d,e,f,g,h) = (par(i,8, hgroup("[4]Step On/Off", stepmute(i + steppush, i + stepled))) : sif) : hgroup("[02]",result) : s*a, s*b, s*c, s*d, s*e, s*f, s*g, s*h ; // checkboxes and bargraphs for each steps stepmute(j, k) = checkbox("%j [midi: ctrl %j]") :_*stepcolor : vbargraph("%k [style: led] [midi:ctrl %k]", 0, 127) : _/stepcolor with{ // midi out led color stepcolor = nentry("step color", 66, 0, 127, 1); }; //smooth s = si.smooth(0.999); //s = smooth(tau2pole(interpTime)); //interpTime = hslider("Interpolation Time (s)[style:knob]",0.05,0,1,0.001); // sequ is the sequencer created by the midi clock. // sif = if sequ == 0, play track 0. etc. trig (1) is activated for now with lf pulsetrain sif = par(i,8, _*(sequ==i)); //sif = _*(sequ == 0), _*(sequ == 1), _*(sequ == 2), _*(sequ == 3), _*(sequ == 4), _*(sequ == 5), _*(sequ == 6), _*(sequ == 7); // choose a sequencer between midi clock and bpl slider // bring midi clock sequence to conditions //sequ = sequence : hbargraph("[2]Sequence", 0, 7) ; sequ = seqchooser : hbargraph("[07]Sequence", 0, 7) ; //gui sequence and lightning //result = par(o,8, _); result = par(o,8, leds(o + seqled)); leds(p) = vbargraph("[09]LED %p [style: led] [midi: ctrl %p]", 0, 1); }; // SEQUENCE from BPM Slider and Sequencer Chooser //////////////////////////////////////////// seqchooser = checkbox("[01]Sequencer Source : Midi-Clock / Bpm Slider"), sequence, sequence2bpm : select2 ; sequence2bpm = os.lf_imptrain(bpmslider) : ba.pulse_countup_loop(7, 1) ; bpmslider = hslider("[05]BPM Slider",120,20,240,0.01) : _/60 : _/scale ; // scale the 8-step sequence //////////////////////////////////////////// scale = vslider("[06]Sequencer Scaling[style:menu{'faster (1/4)':-2 ; 'fast (1/2)':-1 ; 'no scaling (1)':0 ; 'slow (2)':1 ; 'slower (4)':2}]", 0, -2, 2, 1) <: ((_==-2)*0.25) , ((_==-1)*0.5) , ((_==0)*1) , ((_==1)*2), ((_==2)*4) :> _; // SEQUENCE from MIDI CLOCK //////////////////////////////////////////// sequence = clocker : midiclock : clock2beat with{ // clocker is a square signal (1/0), changing state at each received midi clock clocker = checkbox("[03]MIDI clock[midi:clock]"); // squarewave for testing only (instead of midi clock "clocker") //sqwv = lf_squarewavepos(frqslider) ; // : vbargraph("squarewave", 0, 1) ; //frqslider = hslider("send sqwave / sec * 24", 1, 0, 10, 0.1)*24; // count 24 pulse and reset midiclock = sq2pulse : counter(24*scale) // : vbargraph("counter loop 24", 0, 30); with{ // detect front, (create pulse from square wave) sq2pulse(x) = (x-x') != 0.0 ; }; // pulse once a beat and add 1 to sequence number (0 to 8) clock2beat = _ == 0 <: _-_' : _ >0 : counter(8) ; //: vbargraph("counter loop 8", 0, 10); // count and multiply by 1 as long as counter < n (last number in loop), otherwise multiply by 0 = reset seq to zero counter(n) = + ~ cond(n) with{ // condition inside the loop. play resets sequence to 0 cond(n) = _ <: _, _ : ( _ < n) * _ :> _ * play ; // Start / Stop button controlled with MIDI start/stop messages inside the loop (if stop then reset to 0) play = checkbox("[04]Sequence Start / Stop [midi:start] [midi:stop]"); }; };
https://raw.githubusercontent.com/sonejostudios/SuperCutSequencer/f5f4cdca3542c01dabde1306add6dad7ca8f940c/SuperCutSequencer.dsp
faust
import("signals.lib"); Cut "On/Off" Sequencer 8 steps with smooth) synced to Midi-Clock Beats and Midi-Clock Start/Stop. GLOBAL VARIABLES ///////////////////////////////////// midi ctrl out numbers to start iterations steppush and stepled are used to on/off the steps (and light back the state of each step ) seqled shows the current played step controls checkboxes step on/off controls lightning of buttons if step is on or off controls lighning of played step CUT SEQUENCER ///////////////////////////////////// dry / wet knob create par 8 with on/off checkboxes, send them sif (counter conditions) checkboxes and bargraphs for each steps midi out led color smooth s = smooth(tau2pole(interpTime)); interpTime = hslider("Interpolation Time (s)[style:knob]",0.05,0,1,0.001); sequ is the sequencer created by the midi clock. sif = if sequ == 0, play track 0. etc. trig (1) is activated for now with lf pulsetrain sif = _*(sequ == 0), _*(sequ == 1), _*(sequ == 2), _*(sequ == 3), _*(sequ == 4), _*(sequ == 5), _*(sequ == 6), _*(sequ == 7); choose a sequencer between midi clock and bpl slider bring midi clock sequence to conditions sequ = sequence : hbargraph("[2]Sequence", 0, 7) ; gui sequence and lightning result = par(o,8, _); SEQUENCE from BPM Slider and Sequencer Chooser ////////////////////////////////////////// scale the 8-step sequence ////////////////////////////////////////// SEQUENCE from MIDI CLOCK ////////////////////////////////////////// clocker is a square signal (1/0), changing state at each received midi clock squarewave for testing only (instead of midi clock "clocker") sqwv = lf_squarewavepos(frqslider) ; // : vbargraph("squarewave", 0, 1) ; frqslider = hslider("send sqwave / sec * 24", 1, 0, 10, 0.1)*24; count 24 pulse and reset : vbargraph("counter loop 24", 0, 30); detect front, (create pulse from square wave) pulse once a beat and add 1 to sequence number (0 to 8) : vbargraph("counter loop 8", 0, 10); count and multiply by 1 as long as counter < n (last number in loop), otherwise multiply by 0 = reset seq to zero condition inside the loop. play resets sequence to 0 Start / Stop button controlled with MIDI start/stop messages inside the loop (if stop then reset to 0)
declare name "SuperCutSequencer"; declare version "1.2"; declare author "Vincent Rateau"; declare license "GPL v3"; declare reference "www.sonejo.net"; declare description "Cut 'On/Off' Sequencer 8 steps with smooth) synced to Midi-Clock Beats and Midi-Clock Start/Stop"; import("stdfaust.lib"); process = cutsequencer, cutsequencer; cutsequencer = _ <: (_ <: cutseq :> _), _ : drywet :> _ with{ drywet = _* drywetgui , _* (1-drywetgui) ; drywetgui = vslider("[08]Dry/Wet[style:knob][midi: ctrl 52]", 0, 0, 1, 0.001) : s ; cutseq(a,b,c,d,e,f,g,h) = (par(i,8, hgroup("[4]Step On/Off", stepmute(i + steppush, i + stepled))) : sif) : hgroup("[02]",result) : s*a, s*b, s*c, s*d, s*e, s*f, s*g, s*h ; stepmute(j, k) = checkbox("%j [midi: ctrl %j]") :_*stepcolor : vbargraph("%k [style: led] [midi:ctrl %k]", 0, 127) : _/stepcolor with{ stepcolor = nentry("step color", 66, 0, 127, 1); }; s = si.smooth(0.999); sif = par(i,8, _*(sequ==i)); sequ = seqchooser : hbargraph("[07]Sequence", 0, 7) ; result = par(o,8, leds(o + seqled)); leds(p) = vbargraph("[09]LED %p [style: led] [midi: ctrl %p]", 0, 1); }; seqchooser = checkbox("[01]Sequencer Source : Midi-Clock / Bpm Slider"), sequence, sequence2bpm : select2 ; sequence2bpm = os.lf_imptrain(bpmslider) : ba.pulse_countup_loop(7, 1) ; bpmslider = hslider("[05]BPM Slider",120,20,240,0.01) : _/60 : _/scale ; scale = vslider("[06]Sequencer Scaling[style:menu{'faster (1/4)':-2 ; 'fast (1/2)':-1 ; 'no scaling (1)':0 ; 'slow (2)':1 ; 'slower (4)':2}]", 0, -2, 2, 1) <: ((_==-2)*0.25) , ((_==-1)*0.5) , ((_==0)*1) , ((_==1)*2), ((_==2)*4) :> _; sequence = clocker : midiclock : clock2beat with{ clocker = checkbox("[03]MIDI clock[midi:clock]"); with{ sq2pulse(x) = (x-x') != 0.0 ; }; counter(n) = + ~ cond(n) with{ cond(n) = _ <: _, _ : ( _ < n) * _ :> _ * play ; play = checkbox("[04]Sequence Start / Stop [midi:start] [midi:stop]"); }; };
374c07be6c433463d548ebef5417cb74e909e79a128e2576c23e0b627c939cf2
sekisushai/ambitools
hoa_converter_fuma_to_acn_n3d.dsp
declare name "HOA Converter : FuMa to ACN N3D"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2016"; import("stdfaust.lib"); import("gui.lib"); //Description : this tool converts HOA signals defined with a convention 1 to HOA signals defined with convention 2. Proposed conventions are ACN N3D, ACN SN3D, FuMa. For ACN to FuMa, the ordering change is as in [1] //[1] https://en.wikipedia.org/wiki/Ambisonic_data_exchange_formats // Input ACN: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // Output FuMa: 0 3 1 2 6 7 5 8 4 12 13 11 14 10 15 9 : W XYZ RSTUV KLMNOPQ // Input FuMa: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 : W XYZ RSTUV KLMNOPQ // Output ACN: 0 2 3 1 6 8 4 5 7 15 13 11 9 10 12 14 // Maximum required order (M = 3 for FuMa). M = 3; // Number of inputs ins = (M+1)^2; outs = ins; // FuMa Input conversion(3,1) = par(i,M+1,FuMaACN(i)); // FuMa to ACN_N3D FuMaACN(0) = _*sqrt(2); FuMaACN(1) = (ro.cross(2),_):(_,ro.cross(2)): (_*sqrt(3),_*sqrt(3),_*sqrt(3)); FuMaACN(2) = ro.cross(5):(_,ro.cross(2),_,_):(_,_,ro.cross(3)): (_*(sqrt(15)/2),_*(sqrt(15)/2),_*sqrt(5),_*(sqrt(15)/2),_*(sqrt(15)/2)); FuMaACN(3) = ro.cross(7):(_,ro.cross(2),ro.cross(2),_,_):(_,_,ro.cross(2),_,_,_):(_,_,_,ro.cross(4)): (_*sqrt(35/8),_*(sqrt(35)/3),_*sqrt(224/45),_*sqrt(7),_*sqrt(224/45),_*(sqrt(35)/3),_*sqrt(35/8)); FuMaACN(m) = par(i,2*m+1,!:0); // normally they shouldn't be FuMa components for M>3 process = si.bus(ins):hgroup("[1]FuMa",par(i,M+1,meterm(i))):conversion(3,1):hgroup("[2]ACN N3D",par(i,M+1,meterm(i)));
https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_converter_fuma_to_acn_n3d.dsp
faust
Description : this tool converts HOA signals defined with a convention 1 to HOA signals defined with convention 2. Proposed conventions are ACN N3D, ACN SN3D, FuMa. For ACN to FuMa, the ordering change is as in [1] [1] https://en.wikipedia.org/wiki/Ambisonic_data_exchange_formats Input ACN: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Output FuMa: 0 3 1 2 6 7 5 8 4 12 13 11 14 10 15 9 : W XYZ RSTUV KLMNOPQ Input FuMa: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 : W XYZ RSTUV KLMNOPQ Output ACN: 0 2 3 1 6 8 4 5 7 15 13 11 9 10 12 14 Maximum required order (M = 3 for FuMa). Number of inputs FuMa Input FuMa to ACN_N3D normally they shouldn't be FuMa components for M>3
declare name "HOA Converter : FuMa to ACN N3D"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2016"; import("stdfaust.lib"); import("gui.lib"); M = 3; ins = (M+1)^2; outs = ins; FuMaACN(0) = _*sqrt(2); FuMaACN(1) = (ro.cross(2),_):(_,ro.cross(2)): (_*sqrt(3),_*sqrt(3),_*sqrt(3)); FuMaACN(2) = ro.cross(5):(_,ro.cross(2),_,_):(_,_,ro.cross(3)): (_*(sqrt(15)/2),_*(sqrt(15)/2),_*sqrt(5),_*(sqrt(15)/2),_*(sqrt(15)/2)); FuMaACN(3) = ro.cross(7):(_,ro.cross(2),ro.cross(2),_,_):(_,_,ro.cross(2),_,_,_):(_,_,_,ro.cross(4)): (_*sqrt(35/8),_*(sqrt(35)/3),_*sqrt(224/45),_*sqrt(7),_*sqrt(224/45),_*(sqrt(35)/3),_*sqrt(35/8)); process = si.bus(ins):hgroup("[1]FuMa",par(i,M+1,meterm(i))):conversion(3,1):hgroup("[2]ACN N3D",par(i,M+1,meterm(i)));
001de413be5bd03810701f5c5a9cd5ec19619b2971c489d7d17d408ccfec23af
sekisushai/ambitools
hoa_converter_acn_sn3d_to_fuma.dsp
declare name "HOA Converter : ACN SN3D to FuMa"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2016"; import("stdfaust.lib"); import("gui.lib"); //Description : this tool converts HOA signals defined with a convention 1 to HOA signals defined with convention 2. Proposed conventions are ACN N3D, ACN SN3D, FuMa. For ACN to FuMa, the ordering change is as in [1] //[1] https://en.wikipedia.org/wiki/Ambisonic_data_exchange_formats // Input ACN: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // Output FuMa: 0 3 1 2 6 7 5 8 4 12 13 11 14 10 15 9 : W XYZ RSTUV KLMNOPQ // Input FuMa: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 : W XYZ RSTUV KLMNOPQ // Output ACN: 0 2 3 1 6 8 4 5 7 15 13 11 9 10 12 14 // Maximum required order (M = 3 for FuMa). M = 3; // Number of inputs ins = (M+1)^2; outs = ins; // ACN_SN3D Input conversion(2,3) = par(m,M+1,par(n,2*m+1,_*sqrt(2*m+1))):par(i,M+1,ACNFuMa(i)); // ACN_SN3D to FuMa : ACN_SN3D to ACN_N3D to FuMa ACNFuMa(0) = _*(1/sqrt(2)); ACNFuMa(1) = ro.cross(3):(_,ro.cross(2)): (_*(1/sqrt(3)),_*(1/sqrt(3)),_*(1/sqrt(3))); ACNFuMa(2) = (ro.cross(3),_,_):(_,ro.cross(3),_):(_,_,ro.cross(2),_):(_,_,_,ro.cross(2)): (_*(1/sqrt(5)),_*(2/sqrt(15)),_*(2/sqrt(15)),_*(2/sqrt(15)),_*(2/sqrt(15))); ACNFuMa(3) = (ro.cross(4),_,_,_):(_,ro.cross(4),_,_):(_,_,ro.cross(3),_,_):(_,_,_,ro.cross(3),_):(_,_,_,_,ro.cross(2),_):(_,_,_,_,_,ro.cross(2)): (_*(1/sqrt(7)),_*sqrt(45/224),_*sqrt(45/224),_*(3/sqrt(35)),_*(3/sqrt(35)),_*sqrt(8/35),_*sqrt(8/35)); ACNFuMa(m) = par(i,2*m+1,!:0); process = si.bus(ins):hgroup("[1]ACN SN3D",par(i,M+1,meterm(i))):conversion(2,3):hgroup("[2]FuMa",par(i,M+1,meterm(i)));
https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_converter_acn_sn3d_to_fuma.dsp
faust
Description : this tool converts HOA signals defined with a convention 1 to HOA signals defined with convention 2. Proposed conventions are ACN N3D, ACN SN3D, FuMa. For ACN to FuMa, the ordering change is as in [1] [1] https://en.wikipedia.org/wiki/Ambisonic_data_exchange_formats Input ACN: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Output FuMa: 0 3 1 2 6 7 5 8 4 12 13 11 14 10 15 9 : W XYZ RSTUV KLMNOPQ Input FuMa: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 : W XYZ RSTUV KLMNOPQ Output ACN: 0 2 3 1 6 8 4 5 7 15 13 11 9 10 12 14 Maximum required order (M = 3 for FuMa). Number of inputs ACN_SN3D Input ACN_SN3D to FuMa : ACN_SN3D to ACN_N3D to FuMa
declare name "HOA Converter : ACN SN3D to FuMa"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2016"; import("stdfaust.lib"); import("gui.lib"); M = 3; ins = (M+1)^2; outs = ins; ACNFuMa(0) = _*(1/sqrt(2)); ACNFuMa(1) = ro.cross(3):(_,ro.cross(2)): (_*(1/sqrt(3)),_*(1/sqrt(3)),_*(1/sqrt(3))); ACNFuMa(2) = (ro.cross(3),_,_):(_,ro.cross(3),_):(_,_,ro.cross(2),_):(_,_,_,ro.cross(2)): (_*(1/sqrt(5)),_*(2/sqrt(15)),_*(2/sqrt(15)),_*(2/sqrt(15)),_*(2/sqrt(15))); ACNFuMa(3) = (ro.cross(4),_,_,_):(_,ro.cross(4),_,_):(_,_,ro.cross(3),_,_):(_,_,_,ro.cross(3),_):(_,_,_,_,ro.cross(2),_):(_,_,_,_,_,ro.cross(2)): (_*(1/sqrt(7)),_*sqrt(45/224),_*sqrt(45/224),_*(3/sqrt(35)),_*(3/sqrt(35)),_*sqrt(8/35),_*sqrt(8/35)); ACNFuMa(m) = par(i,2*m+1,!:0); process = si.bus(ins):hgroup("[1]ACN SN3D",par(i,M+1,meterm(i))):conversion(2,3):hgroup("[2]FuMa",par(i,M+1,meterm(i)));
9eb0df1e7c25af00842582cb6d32dfcfeb4926690ee9e9ef3c58bcbc28a93da6
sekisushai/ambitools
hoa_beamforming_hypercardioid_to_mono.dsp
declare name "HOA-Beamformer to Mono"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2015"; // Description: This tool helps to extract a monophonic signal from the HOA scene with a beampatern. The Ambisonics components inputs are combined to produce a monophonic output as if the capture was done with a directionnal microphone. The beampatern provided are regular hypercardioid up to order 5 [1]. // References: // [1] Meyer, J., & Elko, G. (2002). A highly scalable spherical microphone array based on an orthonormal decomposition of the soundfield. 2002 IEEE International Conference on Acoustics, Speech, and Signal Processing, 2, II–1781–II–1784. // Inputs: (M+1)^2 // Outputs: 1 import("stdfaust.lib"); import("ymn.lib"); import("gui.lib"); // Maximum order of original HOA scene. M = 3; // Output gain vol = vslider("[2]Output Gain", 0, -10, 10, 0.1) : ba.db2linear : si.smooth(0.999); t = vslider("[3]Azimuth", 0, 0, 360, 0.1)*ma.PI/180; d = vslider("[4]Elevation", 0, -90, 90, 0.1)*ma.PI/180; order(s) = hslider("Order[style:knob]",0,0,M,0.0001)<:select2(s,int,_); // Order of the beampattern used for filtering, order=0 is a bypass. crossfade(i,x) = par(j,i,_*(1-abs(x-j):max(0))):>_; // linear crossfade between order. step = checkbox("Int/Float"); norm(m) = 1/sqrt(2*m+1); // ORDER 1 hypercoeff(1,0) = 0.24993; hypercoeff(1,1) = 0.433017; // ORDER 2 hypercoeff(2,0) = 0.11112; hypercoeff(2,1) = 0.19245; hypercoeff(2,2) = 0.248448; // ORDER 3 hypercoeff(3,0) = 0.0625128; hypercoeff(3,1) = 0.108241; hypercoeff(3,2) = 0.139751; hypercoeff(3,3) = 0.165365; hypercoeff(x1,x2) = 0; g(beam,m) = hypercoeff(beam,m)*norm(m); gvec(beam,M) = par(m,M+1,par(n,2*m+1,_*g(beam,m))); process = hgroup("Inputs",par(i,M+1,metermute(i)):yvec((M+1)^2,t,d)<:par(m,M,gvec(m+1,M):>_*vol):crossfade(M,order(step)-1)):hgroup("Output",hmeter);
https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_beamforming_hypercardioid_to_mono.dsp
faust
Description: This tool helps to extract a monophonic signal from the HOA scene with a beampatern. The Ambisonics components inputs are combined to produce a monophonic output as if the capture was done with a directionnal microphone. The beampatern provided are regular hypercardioid up to order 5 [1]. References: [1] Meyer, J., & Elko, G. (2002). A highly scalable spherical microphone array based on an orthonormal decomposition of the soundfield. 2002 IEEE International Conference on Acoustics, Speech, and Signal Processing, 2, II–1781–II–1784. Inputs: (M+1)^2 Outputs: 1 Maximum order of original HOA scene. Output gain Order of the beampattern used for filtering, order=0 is a bypass. linear crossfade between order. ORDER 1 ORDER 2 ORDER 3
declare name "HOA-Beamformer to Mono"; declare version "1.0"; declare author "Pierre Lecomte"; declare license "GPL"; declare copyright "(c) Pierre Lecomte 2015"; import("stdfaust.lib"); import("ymn.lib"); import("gui.lib"); M = 3; vol = vslider("[2]Output Gain", 0, -10, 10, 0.1) : ba.db2linear : si.smooth(0.999); t = vslider("[3]Azimuth", 0, 0, 360, 0.1)*ma.PI/180; d = vslider("[4]Elevation", 0, -90, 90, 0.1)*ma.PI/180; step = checkbox("Int/Float"); norm(m) = 1/sqrt(2*m+1); hypercoeff(1,0) = 0.24993; hypercoeff(1,1) = 0.433017; hypercoeff(2,0) = 0.11112; hypercoeff(2,1) = 0.19245; hypercoeff(2,2) = 0.248448; hypercoeff(3,0) = 0.0625128; hypercoeff(3,1) = 0.108241; hypercoeff(3,2) = 0.139751; hypercoeff(3,3) = 0.165365; hypercoeff(x1,x2) = 0; g(beam,m) = hypercoeff(beam,m)*norm(m); gvec(beam,M) = par(m,M+1,par(n,2*m+1,_*g(beam,m))); process = hgroup("Inputs",par(i,M+1,metermute(i)):yvec((M+1)^2,t,d)<:par(m,M,gvec(m+1,M):>_*vol):crossfade(M,order(step)-1)):hgroup("Output",hmeter);
75221fef392a77baa88ab586da44b6c498044f697fa88ba6318ebeab392d957a
ljwall/er-301-units
Andromeda.dsp
import("stdfaust.lib"); declare andromeda author "Liam Wall"; declare andromeda license "MIT-style STK-4.3 license"; andromeda(decay, low_pass, high_pass) = _,_ : + : *(0.5) : diffusion_network : (+~chain) <: chain_l, chain_r with { // allpass using delay with fixed size allpass_f(t, a) = (+ <: @(t),*(a)) ~ *(-a) : mem,_ : +; i_diff1 = 0.75; i_diff2 = 0.625; diffusion_network = allpass_f(235, i_diff1) : allpass_f(177, i_diff1) : allpass_f(627, i_diff2) : allpass_f(458, i_diff2); line = de.fdelayltv(2, 28800); taps = (0.047, 0.120, 0.134, 0.146, 0.158, 0.169, 0.180, 0.190, 0.200, 0.209, 0.217, 0.233, 0.240, 0.244, 0.225, 0.247); mod = hslider("mod", 50, 0, 100, 0); min_mod = 31, 25, 19, 11; mid_mod = 130, 63, 43, 20; max_mod = 313, 310, 251, 250; epsilon = par(i, 4, (mod <= 50)*(ba.take(i+1, min_mod) + (mod/50) * (ba.take(i+1, mid_mod) - ba.take(i+1, min_mod))) + (mod > 50)*(ba.take(i+1, mid_mod) + (mod/50 - 1) * (ba.take(i+1, max_mod) - ba.take(i+1, mid_mod))) ); e1 = ba.take(1, epsilon) / 1000000; e2 = ba.take(2, epsilon) / 1000000; e3 = ba.take(3, epsilon) / 1000000; e4 = ba.take(4, epsilon) / 1000000; mods = x,xq,-x,-xq , y,yq,-y,-yq, z,zq,-z,-zq, a,aq,-a,-aq letrec { 'xq = os.impulse + xq - e1*x; 'x = e1 * (xq - e1 *x) + x; 'yq = os.impulse + yq - e2*y; 'y = e2 * (yq - e2 *y) + y; 'zq = os.impulse + zq - e3*z; 'z = e3 * (zq - e3 *z) + z; 'aq = os.impulse + aq - e4*a; 'a = e4 * (aq - e4 *a) + a; }; limiter(x) = 2 * x / sqrt(x*x +4); depth = ba.sec2samp(0.004); chain = _ <: par(i, ba.count(taps), line(ba.sec2samp(ba.take(i+1, taps)) + depth*ba.take(1 + (i % (ba.count(mods))), mods))) :> /(ba.count(taps)) : fi.lowpass(1, low_pass) : fi.highpass(1, high_pass) : *(decay) : limiter; line_out = de.delay(24000); taps_l = (0.060, 0.137, 0.175, 0.190); taps_r = (0.077, 0.112, 0.160, 0.212); chain_l = _ <: par(i, ba.count(taps_l), line_out(ba.take(i+1, taps_l) : ba.sec2samp)) :> /(ba.count(taps_l)); chain_r = _ <: par(i, ba.count(taps_r), line_out(ba.take(i+1, taps_r) : ba.sec2samp)) :> /(ba.count(taps_r)); }; declare er301_in1 "InL"; declare er301_in2 "InR"; declare er301_out1 "OutL"; declare er301_out2 "OutR"; process = _,_ <: _,_,andromeda(decay_ctrl, low_ctrl, high_ctrl): dry_wet_mix(dry_wet_ctr) with { decay_ctrl = hslider("Decay", 0.8, 0, 5, 0.001) : si.smoo; low_ctrl = hslider("HighCut", 20000, 100, 20000, 100) : min(20000) : max(100); high_ctrl = hslider("LowCut", 20, 20, 20000, 100) : min(20000) : max(20); dry_wet_ctr = hslider("DryWet", 0.25, 0, 1, 0.001) : si.smoo; dry_wet_mix(mix, dry_l, dry_r, wet_l, wet_r) = (1-mix) * dry_l, (1-mix) * dry_r, mix * wet_l, mix * wet_r :> _,_; };
https://raw.githubusercontent.com/ljwall/er-301-units/4f59543a76e84c823d770b2101c1d6f9b3d1eb74/faustian/dsp/Andromeda.dsp
faust
allpass using delay with fixed size
import("stdfaust.lib"); declare andromeda author "Liam Wall"; declare andromeda license "MIT-style STK-4.3 license"; andromeda(decay, low_pass, high_pass) = _,_ : + : *(0.5) : diffusion_network : (+~chain) <: chain_l, chain_r with { allpass_f(t, a) = (+ <: @(t),*(a)) ~ *(-a) : mem,_ : +; i_diff1 = 0.75; i_diff2 = 0.625; diffusion_network = allpass_f(235, i_diff1) : allpass_f(177, i_diff1) : allpass_f(627, i_diff2) : allpass_f(458, i_diff2); line = de.fdelayltv(2, 28800); taps = (0.047, 0.120, 0.134, 0.146, 0.158, 0.169, 0.180, 0.190, 0.200, 0.209, 0.217, 0.233, 0.240, 0.244, 0.225, 0.247); mod = hslider("mod", 50, 0, 100, 0); min_mod = 31, 25, 19, 11; mid_mod = 130, 63, 43, 20; max_mod = 313, 310, 251, 250; epsilon = par(i, 4, (mod <= 50)*(ba.take(i+1, min_mod) + (mod/50) * (ba.take(i+1, mid_mod) - ba.take(i+1, min_mod))) + (mod > 50)*(ba.take(i+1, mid_mod) + (mod/50 - 1) * (ba.take(i+1, max_mod) - ba.take(i+1, mid_mod))) ); e1 = ba.take(1, epsilon) / 1000000; e2 = ba.take(2, epsilon) / 1000000; e3 = ba.take(3, epsilon) / 1000000; e4 = ba.take(4, epsilon) / 1000000; mods = x,xq,-x,-xq , y,yq,-y,-yq, z,zq,-z,-zq, a,aq,-a,-aq letrec { 'xq = os.impulse + xq - e1*x; 'x = e1 * (xq - e1 *x) + x; 'yq = os.impulse + yq - e2*y; 'y = e2 * (yq - e2 *y) + y; 'zq = os.impulse + zq - e3*z; 'z = e3 * (zq - e3 *z) + z; 'aq = os.impulse + aq - e4*a; 'a = e4 * (aq - e4 *a) + a; }; limiter(x) = 2 * x / sqrt(x*x +4); depth = ba.sec2samp(0.004); chain = _ <: par(i, ba.count(taps), line(ba.sec2samp(ba.take(i+1, taps)) + depth*ba.take(1 + (i % (ba.count(mods))), mods))) :> /(ba.count(taps)) : fi.lowpass(1, low_pass) : fi.highpass(1, high_pass) : *(decay) : limiter; line_out = de.delay(24000); taps_l = (0.060, 0.137, 0.175, 0.190); taps_r = (0.077, 0.112, 0.160, 0.212); chain_l = _ <: par(i, ba.count(taps_l), line_out(ba.take(i+1, taps_l) : ba.sec2samp)) :> /(ba.count(taps_l)); chain_r = _ <: par(i, ba.count(taps_r), line_out(ba.take(i+1, taps_r) : ba.sec2samp)) :> /(ba.count(taps_r)); }; declare er301_in1 "InL"; declare er301_in2 "InR"; declare er301_out1 "OutL"; declare er301_out2 "OutR"; process = _,_ <: _,_,andromeda(decay_ctrl, low_ctrl, high_ctrl): dry_wet_mix(dry_wet_ctr) with { decay_ctrl = hslider("Decay", 0.8, 0, 5, 0.001) : si.smoo; low_ctrl = hslider("HighCut", 20000, 100, 20000, 100) : min(20000) : max(100); high_ctrl = hslider("LowCut", 20, 20, 20000, 100) : min(20000) : max(20); dry_wet_ctr = hslider("DryWet", 0.25, 0, 1, 0.001) : si.smoo; dry_wet_mix(mix, dry_l, dry_r, wet_l, wet_r) = (1-mix) * dry_l, (1-mix) * dry_r, mix * wet_l, mix * wet_r :> _,_; };