_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
|
---|---|---|---|---|---|---|---|
bad0dda74a40d2eeb283d3baf328e3f0b63b67e200f9e8f70039e284078eed3d | grame-cncm/smartfaust | sfCapture.dsp | declare name "Capture";
declare version "1.4";
declare author "Christophe Lebreton";
declare license "BSD";
declare copyright "SmartFaust - GRAME(c)2013-2018";
import("stdfaust.lib");
//-------------------- MAIN -------------------------------
process =_,(fade_lin):*:wr_index:idelay_drywet:*(volume)
with {
volume = hslider("v:sfCapture parameter(s)/volume [acc:2 1 -10 -0.8 10][color:0 255 0][hidden:1]",1,-0.1,1,0.001):max(0):min(1):fi.lowpass(1,1);
};
//--------------------- INTERFACE ---------------------------
record = checkbox ("v:sfCapture/RECORD [color: 255 0 0 ]");
play = checkbox ("v:sfCapture/PLAY [color: 0 255 0 ]");
//-----------------------------------------------------------
// max size of buffer to be record
size = 441000;
// COUNTER LOOP //////////////////////////////////////////
// sah is like latch but reverse input for a expression
sah(x,c) = x * s : + ~ *(1-s) with { s = ((c'<=0)&(c>0)); };
speed = hslider ("v:sfCapture parameter(s)/speed [acc:0 0 -10 0 10][color: 0 255 0 ][hidden:1]",1,0.25,2,0.001):fi.lowpass(1,1):max(0.25):min(2);
id_count_rec = (0):+~(+(1): * ((fade_lin)>0)): min(size+1); // recording if fade > O
// this code acuumulates a large number which makes you lose precision, it is a musical choice ;)
id_count_play = (0):+~(+(speed): * (play)): fmod(_,fin_rec:int);
// this code is the correct version to solve the accumulation problem in the loop
//id_count_play = fmod(_,max(1,int(fin_rec)))~(+(speed): *(play));
fin_rec = sah(id_count_rec:mem,fade_lin==0);// end of record if fade == O
// START STOP RECORD /////////////////////////////////////////////
init_rec = select2(record,size+1,_);
// FADER IN & OUT ////////////////////////////////////////////////
// define the level of each step increase or decrease to create fade in/out
time_fade = 0.1; // sec
state = record;
// version of linear fade
base_amp = 1,(ma.SR)*(time_fade):/;
fade_lin = select2(state,(-1)*(base_amp),base_amp):+~(min((1)-base_amp):max(base_amp));
// BUFFER SEQUENCER //////////////////////////////////////////
wr_index = rwtable(size+1, 0., windex,_, rindex)
with {
rindex = id_count_play:int;
windex = id_count_rec:int;
};
//-------------------------------------------------------------
// A stereo smooth delay with a feedback control
idelay = ((+ : de.sdelay(N, interp, dtime)) ~ *(fback))
with {
N = int(2^19); // => max delay = number of sample
//interp = hslider("interpolation[unit:ms][style:knob]",75,1,100,0.1)*SR/1000.0;
interp = (75)*ma.SR*(0.001);
dtime = hslider("v:sfCapture parameter(s)/delay[unit:ms] [acc:2 1 -10 0.8 10][color:255 0 0][hidden:1]", 250, 0, 10000, 0.01)*ma.SR/1000.0;
fback = hslider("v:sfCapture parameter(s)/feedback [acc:0 0 -10 -0.5 10][color:255 255 0][hidden:1] ",50,0,100,0.1)/100.0;
};
dry_wet(x,y) = (1-c)*x + c*y
with {
c = hslider("v:sfCapture parameter(s)/dry_wet [acc:1 0 -10 0 10][color:255 255 0][hidden:1] ",0,0,100,0.01):*(0.01):si.smooth(0.998);
};
idelay_drywet = _<: _ , idelay : dry_wet;
| https://raw.githubusercontent.com/grame-cncm/smartfaust/0a9c93ea7eda9899e1401402901848f221366c99/src/sfCapture/sfCapture.dsp | faust | -------------------- MAIN -------------------------------
--------------------- INTERFACE ---------------------------
-----------------------------------------------------------
max size of buffer to be record
COUNTER LOOP //////////////////////////////////////////
sah is like latch but reverse input for a expression
recording if fade > O
this code acuumulates a large number which makes you lose precision, it is a musical choice ;)
this code is the correct version to solve the accumulation problem in the loop
id_count_play = fmod(_,max(1,int(fin_rec)))~(+(speed): *(play));
end of record if fade == O
START STOP RECORD /////////////////////////////////////////////
FADER IN & OUT ////////////////////////////////////////////////
define the level of each step increase or decrease to create fade in/out
sec
version of linear fade
BUFFER SEQUENCER //////////////////////////////////////////
-------------------------------------------------------------
A stereo smooth delay with a feedback control
=> max delay = number of sample
interp = hslider("interpolation[unit:ms][style:knob]",75,1,100,0.1)*SR/1000.0; | declare name "Capture";
declare version "1.4";
declare author "Christophe Lebreton";
declare license "BSD";
declare copyright "SmartFaust - GRAME(c)2013-2018";
import("stdfaust.lib");
process =_,(fade_lin):*:wr_index:idelay_drywet:*(volume)
with {
volume = hslider("v:sfCapture parameter(s)/volume [acc:2 1 -10 -0.8 10][color:0 255 0][hidden:1]",1,-0.1,1,0.001):max(0):min(1):fi.lowpass(1,1);
};
record = checkbox ("v:sfCapture/RECORD [color: 255 0 0 ]");
play = checkbox ("v:sfCapture/PLAY [color: 0 255 0 ]");
size = 441000;
sah(x,c) = x * s : + ~ *(1-s) with { s = ((c'<=0)&(c>0)); };
speed = hslider ("v:sfCapture parameter(s)/speed [acc:0 0 -10 0 10][color: 0 255 0 ][hidden:1]",1,0.25,2,0.001):fi.lowpass(1,1):max(0.25):min(2);
id_count_play = (0):+~(+(speed): * (play)): fmod(_,fin_rec:int);
init_rec = select2(record,size+1,_);
state = record;
base_amp = 1,(ma.SR)*(time_fade):/;
fade_lin = select2(state,(-1)*(base_amp),base_amp):+~(min((1)-base_amp):max(base_amp));
wr_index = rwtable(size+1, 0., windex,_, rindex)
with {
rindex = id_count_play:int;
windex = id_count_rec:int;
};
idelay = ((+ : de.sdelay(N, interp, dtime)) ~ *(fback))
with {
interp = (75)*ma.SR*(0.001);
dtime = hslider("v:sfCapture parameter(s)/delay[unit:ms] [acc:2 1 -10 0.8 10][color:255 0 0][hidden:1]", 250, 0, 10000, 0.01)*ma.SR/1000.0;
fback = hslider("v:sfCapture parameter(s)/feedback [acc:0 0 -10 -0.5 10][color:255 255 0][hidden:1] ",50,0,100,0.1)/100.0;
};
dry_wet(x,y) = (1-c)*x + c*y
with {
c = hslider("v:sfCapture parameter(s)/dry_wet [acc:1 0 -10 0 10][color:255 255 0][hidden:1] ",0,0,100,0.01):*(0.01):si.smooth(0.998);
};
idelay_drywet = _<: _ , idelay : dry_wet;
|
0201792d268af8cd484ccc407bb423ad0384717100a1a84c2db010f27a59dddb | sadko4u/tamgamp.lv2 | pre_6dj8_master_6v6.dsp | /*
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "pre 6DJ8/ master 6V6"; // in amp tube ba.selector
declare name "pre 6DJ8/ master 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
/****************************************************************
** Tube Preamp Emulation stage 1 - 2
*/
a = 0.75;
r(x) = x-sym_clip(a*0.88);
soft_clip(x) = x:sym_clip(a*0.75) <:+(r(x)*0.333);
hard_clip = sym_clip(0.88);
process =
stage1 :
component("amp_dist.dsp").dist(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
postgain = ampctrl.postgain * 0.06310 : si.smooth(0.999); // -24 dB correction
stage1 =
*(pregain) :
tubestage130_20(TB_6DJ8_68k,86.0,2700.0,1.863946) :
fi.lowpass(1,6531.0) :
tubestage130_20(TB_6DJ8_250k,132.0,1500.0,1.271609) :
tubestage130_20(TB_6DJ8_250k,194.0,820.0,0.797043) ;
stage2 =
pot_48db(master) :
fi.lowpass(1,6531.0) <:
(
tubestage(TB_6V6_250k,6531.0,820.0,1.130462),
tubestage(TB_6V6_68k,6531.0,820.0,1.130740)
) :>
_ ;
};
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/gxsim/pre_6dj8_master_6v6.dsp | faust |
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
in amp tube ba.selector
***************************************************************
** Tube Preamp Emulation stage 1 - 2
-24 dB correction |
declare name "pre 6DJ8/ master 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
a = 0.75;
r(x) = x-sym_clip(a*0.88);
soft_clip(x) = x:sym_clip(a*0.75) <:+(r(x)*0.333);
hard_clip = sym_clip(0.88);
process =
stage1 :
component("amp_dist.dsp").dist(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
stage1 =
*(pregain) :
tubestage130_20(TB_6DJ8_68k,86.0,2700.0,1.863946) :
fi.lowpass(1,6531.0) :
tubestage130_20(TB_6DJ8_250k,132.0,1500.0,1.271609) :
tubestage130_20(TB_6DJ8_250k,194.0,820.0,0.797043) ;
stage2 =
pot_48db(master) :
fi.lowpass(1,6531.0) <:
(
tubestage(TB_6V6_250k,6531.0,820.0,1.130462),
tubestage(TB_6V6_68k,6531.0,820.0,1.130740)
) :>
_ ;
};
|
2b78a7753fc131554a35e7d111ddaa5c9cea5a258681858ee11788b22698d79c | sadko4u/tamgamp.lv2 | pre_12ax7_pp_6v6.dsp | /*
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "pre 12ax7/ push-pull 6V6"; // in amp tube ba.selector
declare name "pre 12ax7/ push-pull 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
/****************************************************************
** Tube Preamp Emulation stage 1 - 2
* 12ax7 -> push pull 6V6
*/
peak1 = fi.allpassn(4,(-0.2, 0.3, 0.4, 0.5));
process =
stage1 :
component("amp_dist.dsp").dist2(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
postgain = ampctrl.postgain * 0.06310 : si.smooth(0.999); // -24 dB correction
atten = 0.6;
stage1 =
ef.speakerbp(310.0, 12000.0) :
*(pregain) :
(
tubestage(TB_12AX7_68k,86.0,2700.0,1.581656) :
+ ~ (atten*tubestage(TB_12AX7_250k,132.0,1500.0,1.204285))
) :
fi.lowpass(1,6531.0) :
(
tubestage(TB_12AX7_250k,132.0,1500.0,1.204285) :
+ ~ (atten*tubestage(TB_12AX7_250k,194.0,820.0,0.840703))
) :
tubestage(TB_12AX7_250k,194.0,820.0,0.840703) ;
stage2 =
fi.lowpass(1,6531.0) :
pot_48db(master) <:
(
(min(0.7,tubestage(TB_6V6_250k,6531.0,410.0,0.659761))),
(max(-0.75,tubestage(TB_6V6_68k,6531.0,410.0,0.664541)))
) :>
peak1 ;
};
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/gxsim/pre_12ax7_pp_6v6.dsp | faust |
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
in amp tube ba.selector
***************************************************************
** Tube Preamp Emulation stage 1 - 2
* 12ax7 -> push pull 6V6
-24 dB correction |
declare name "pre 12ax7/ push-pull 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
peak1 = fi.allpassn(4,(-0.2, 0.3, 0.4, 0.5));
process =
stage1 :
component("amp_dist.dsp").dist2(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
atten = 0.6;
stage1 =
ef.speakerbp(310.0, 12000.0) :
*(pregain) :
(
tubestage(TB_12AX7_68k,86.0,2700.0,1.581656) :
+ ~ (atten*tubestage(TB_12AX7_250k,132.0,1500.0,1.204285))
) :
fi.lowpass(1,6531.0) :
(
tubestage(TB_12AX7_250k,132.0,1500.0,1.204285) :
+ ~ (atten*tubestage(TB_12AX7_250k,194.0,820.0,0.840703))
) :
tubestage(TB_12AX7_250k,194.0,820.0,0.840703) ;
stage2 =
fi.lowpass(1,6531.0) :
pot_48db(master) <:
(
(min(0.7,tubestage(TB_6V6_250k,6531.0,410.0,0.659761))),
(max(-0.75,tubestage(TB_6V6_68k,6531.0,410.0,0.664541)))
) :>
peak1 ;
};
|
ffb7953ad9a707130f8c8d3f0d86ff98a71e4589fc03b9f2af108b038e439036 | sadko4u/tamgamp.lv2 | 12at7_feed.dsp | /*
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "12AT7 feedback"; // in amp tube ba.selector
declare name "12AT7 feedback";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
/****************************************************************
** Tube Preamp Emulation stage 1 - 2
* 12AT7 feedback
*/
val(x) =
valve.vt(dist, q(x), x)
with {
dist = 40.1;
q(x) = lp1tm1(x) * 1 - lp2tm1(x) * 1.02 - 1.0 : clip(-1,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
tubeax(pregain) =
stage1 :
stage2
with
{
atten = 0.6;
stage1 =
tubestage(TB_12AT7_68k,86.0,2700.0,2.617753) :
- ~(atten * tubestage(TB_12AT7_250k,132.0,1500.0,1.887332)) :
*(pregain) :
fi.lowpass(1, 6531.0) :
tubestage(TB_12AT7_250k,132.0,1500.0,1.887332) :
+ ~(atten * tubestage(TB_12AT7_250k,194.0,820.0,1.256962)) ;
stage2 =
fi.lowpass(1,6531.0) :
tubestage(TB_12AT7_250k,194.0,820.0,1.256962) ;
} ;
process =
val :
component("amp_dist.dsp").dist1(gain) :
tubeax(pregain) :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
postgain = ampctrl.postgain * 0.06310 : si.smooth(0.999); // -24 dB correction
};
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/gxsim/12at7_feed.dsp | faust |
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
in amp tube ba.selector
***************************************************************
** Tube Preamp Emulation stage 1 - 2
* 12AT7 feedback
-24 dB correction |
declare name "12AT7 feedback";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
val(x) =
valve.vt(dist, q(x), x)
with {
dist = 40.1;
q(x) = lp1tm1(x) * 1 - lp2tm1(x) * 1.02 - 1.0 : clip(-1,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
tubeax(pregain) =
stage1 :
stage2
with
{
atten = 0.6;
stage1 =
tubestage(TB_12AT7_68k,86.0,2700.0,2.617753) :
- ~(atten * tubestage(TB_12AT7_250k,132.0,1500.0,1.887332)) :
*(pregain) :
fi.lowpass(1, 6531.0) :
tubestage(TB_12AT7_250k,132.0,1500.0,1.887332) :
+ ~(atten * tubestage(TB_12AT7_250k,194.0,820.0,1.256962)) ;
stage2 =
fi.lowpass(1,6531.0) :
tubestage(TB_12AT7_250k,194.0,820.0,1.256962) ;
} ;
process =
val :
component("amp_dist.dsp").dist1(gain) :
tubeax(pregain) :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
};
|
c07046230c50123b784ace467ae1ae0db9c58fe42f346482aeb7480471cc7c2c | sadko4u/tamgamp.lv2 | 6dj8_feed.dsp | /*
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "6DJ8 feedback"; // in amp tube ba.selector
declare name "6DJ8 feedback";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
/****************************************************************
** Tube Preamp Emulation stage 1 - 2
*/
val(x) = valve.vt(dist, q(x), x)
with
{
dist = 40.1;
q(x) = lp1tm1(x) * 1 - lp2tm1(x) * 1.02 - 1.0 : clip(-1,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
tubeax(pregain) =
stage1 :
stage2
with {
atten = 0.6;
stage1 =
tubestage130_20(TB_6DJ8_68k,86.0,2700.0,1.863946) :
- ~(atten*tubestage130_20(TB_6DJ8_250k,132.0,1500.0,1.271609)) :
*(pregain) :
fi.lowpass(1,6531.0) :
tubestage130_20(TB_6DJ8_250k,132.0,1500.0,1.271609) :
+ ~(atten*tubestage130_20(TB_6DJ8_250k,194.0,820.0,0.797043)) ;
stage2 =
fi.lowpass(1,6531.0) :
tubestage130_20(TB_6DJ8_250k,194.0,820.0,0.797043) ;
};
process =
val :
component("amp_dist.dsp").dist1(gain) :
tubeax(pregain) :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
postgain = ampctrl.postgain * 0.06310 : si.smooth(0.999); // -24 dB correction
};
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/gxsim/6dj8_feed.dsp | faust |
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
in amp tube ba.selector
***************************************************************
** Tube Preamp Emulation stage 1 - 2
-24 dB correction |
declare name "6DJ8 feedback";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
val(x) = valve.vt(dist, q(x), x)
with
{
dist = 40.1;
q(x) = lp1tm1(x) * 1 - lp2tm1(x) * 1.02 - 1.0 : clip(-1,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
tubeax(pregain) =
stage1 :
stage2
with {
atten = 0.6;
stage1 =
tubestage130_20(TB_6DJ8_68k,86.0,2700.0,1.863946) :
- ~(atten*tubestage130_20(TB_6DJ8_250k,132.0,1500.0,1.271609)) :
*(pregain) :
fi.lowpass(1,6531.0) :
tubestage130_20(TB_6DJ8_250k,132.0,1500.0,1.271609) :
+ ~(atten*tubestage130_20(TB_6DJ8_250k,194.0,820.0,0.797043)) ;
stage2 =
fi.lowpass(1,6531.0) :
tubestage130_20(TB_6DJ8_250k,194.0,820.0,0.797043) ;
};
process =
val :
component("amp_dist.dsp").dist1(gain) :
tubeax(pregain) :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
};
|
d71d2c8e875b8ddacc2edea390fc5fabb826d872f5845ada29773cd0a054aca4 | sadko4u/tamgamp.lv2 | pre_12at7_master_6v6.dsp | /*
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "pre 12AT7/ master 6V6"; // in amp tube ba.selector
declare name "pre 12AT7/ master 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
/****************************************************************
** Tube amp Emulation stage 1 - 2 - 3
* 12AT7 -> master 6V6
*/
a = 0.75;
r(x) = x-sym_clip(a*0.88);
soft_clip(x) = x:sym_clip(a*0.75) <:+(r(x)*0.333);
hard_clip = sym_clip(0.88);
process =
stage1 :
component("amp_dist.dsp").dist(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
postgain = ampctrl.postgain * 0.06310 : si.smooth(0.999); // -24 dB correction
stage1 =
*(pregain) :
tubestage(TB_12AT7_68k,86.0,2700.0,2.617753) :
fi.lowpass(1,6531.0) :
tubestage(TB_12AT7_250k,132.0,1500.0,1.887332) :
tubestage(TB_12AT7_250k,194.0,820.0,1.256962) ;
stage2 =
pot_48db(master) :
fi.lowpass(1,6531.0) <:
(
tubestage(TB_6V6_250k,6531.0,820.0,1.130462),
tubestage(TB_6V6_68k,6531.0,820.0,1.130740)
) :>
_ ;
};
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/gxsim/pre_12at7_master_6v6.dsp | faust |
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
in amp tube ba.selector
***************************************************************
** Tube amp Emulation stage 1 - 2 - 3
* 12AT7 -> master 6V6
-24 dB correction |
declare name "pre 12AT7/ master 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
a = 0.75;
r(x) = x-sym_clip(a*0.88);
soft_clip(x) = x:sym_clip(a*0.75) <:+(r(x)*0.333);
hard_clip = sym_clip(0.88);
process =
stage1 :
component("amp_dist.dsp").dist(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
stage1 =
*(pregain) :
tubestage(TB_12AT7_68k,86.0,2700.0,2.617753) :
fi.lowpass(1,6531.0) :
tubestage(TB_12AT7_250k,132.0,1500.0,1.887332) :
tubestage(TB_12AT7_250k,194.0,820.0,1.256962) ;
stage2 =
pot_48db(master) :
fi.lowpass(1,6531.0) <:
(
tubestage(TB_6V6_250k,6531.0,820.0,1.130462),
tubestage(TB_6V6_68k,6531.0,820.0,1.130740)
) :>
_ ;
};
|
9a2efc8c03882024547e804f8171b5d4072cbcf50d736299e92a351102203ce2 | sadko4u/tamgamp.lv2 | pre_12at7_pp_6v6.dsp | /*
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "pre 12AT7/ push pull 6V6"; // in amp tube ba.selector
declare name "pre 12AT7/ push pull 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
/****************************************************************
** Tube amp Emulation stage 1 - 2 - 3
* 12AT7 -> push pull 6V6
*/
peak1 = fi.allpassn(4,(-0.2, 0.3, 0.4, 0.5));
process =
stage1 :
component("amp_dist.dsp").dist2(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
postgain = ampctrl.postgain * 0.06310 : si.smooth(0.999); // -24 dB correction
atten = 0.6;
stage1 =
ef.speakerbp(310.0, 12000.0) :
*(pregain) :
(
tubestage(TB_12AT7_68k,86.0,2700.0,2.617753) :
+ ~ (atten*tubestage(TB_12AT7_250k,132.0,1500.0,1.887333))
) :
fi.lowpass(1,6531.0) :
(
tubestage(TB_12AT7_250k,132.0,1500.0,1.887333) :
+ ~ (atten*tubestage(TB_12AT7_250k,194.0,820.0,1.256962))
) :
tubestage(TB_12AT7_250k,194.0,820.0,1.256962) ;
stage2 =
fi.lowpass(1,6531.0) :
pot_48db(master) <:
(
(min(0.7,tubestage(TB_6V6_250k,6531.0,410.0,0.659761))),
(max(-0.75,tubestage(TB_6V6_68k,6531.0,410.0,0.664541)))
) :>
peak1 ;
};
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/gxsim/pre_12at7_pp_6v6.dsp | faust |
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
in amp tube ba.selector
***************************************************************
** Tube amp Emulation stage 1 - 2 - 3
* 12AT7 -> push pull 6V6
-24 dB correction |
declare name "pre 12AT7/ push pull 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
peak1 = fi.allpassn(4,(-0.2, 0.3, 0.4, 0.5));
process =
stage1 :
component("amp_dist.dsp").dist2(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
atten = 0.6;
stage1 =
ef.speakerbp(310.0, 12000.0) :
*(pregain) :
(
tubestage(TB_12AT7_68k,86.0,2700.0,2.617753) :
+ ~ (atten*tubestage(TB_12AT7_250k,132.0,1500.0,1.887333))
) :
fi.lowpass(1,6531.0) :
(
tubestage(TB_12AT7_250k,132.0,1500.0,1.887333) :
+ ~ (atten*tubestage(TB_12AT7_250k,194.0,820.0,1.256962))
) :
tubestage(TB_12AT7_250k,194.0,820.0,1.256962) ;
stage2 =
fi.lowpass(1,6531.0) :
pot_48db(master) <:
(
(min(0.7,tubestage(TB_6V6_250k,6531.0,410.0,0.659761))),
(max(-0.75,tubestage(TB_6V6_68k,6531.0,410.0,0.664541)))
) :>
peak1 ;
};
|
38f1523e5707e3d0c3523ea769630108929c578b657713056437d2a5909ac936 | sadko4u/tamgamp.lv2 | 12au7_feed.dsp | /*
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "12AU7 feedback"; // in amp tube ba.selector
declare name "12AU7 feedback";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
/****************************************************************
** Tube Preamp Emulation stage 1 - 2
* 12AU7 feedback
*/
val(x) =
valve.vt(dist, q(x), x)
with {
dist = 40.1;
q(x) = lp1tm1(x) * 1 - lp2tm1(x) * 1.02 - 1.0 : clip(-1,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
tubeax(pregain) =
stage1 :
stage2
with {
stage1 =
tubestage130_10(TB_12AU7_68k,86.0,2700.0,1.257240) :
- ~ tubestage130_10(TB_12AU7_250k,132.0,1500.0,0.776162) :
*(pregain) :
fi.lowpass(1,6531.0) :
tubestage130_10(TB_12AU7_250k,132.0,1500.0,0.776162) :
+ ~ tubestage130_10(TB_12AU7_250k,194.0,820.0,0.445487) ;
stage2 =
fi.lowpass(1,6531.0) :
tubestage130_10(TB_12AU7_250k,194.0,820.0,0.445487) ;
} ;
process =
val :
component("amp_dist.dsp").dist1(gain) :
tubeax(pregain) :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
postgain = ampctrl.postgain * 0.06310 : si.smooth(0.999); // -24 dB correction
};
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/gxsim/12au7_feed.dsp | faust |
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
in amp tube ba.selector
***************************************************************
** Tube Preamp Emulation stage 1 - 2
* 12AU7 feedback
-24 dB correction |
declare name "12AU7 feedback";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
val(x) =
valve.vt(dist, q(x), x)
with {
dist = 40.1;
q(x) = lp1tm1(x) * 1 - lp2tm1(x) * 1.02 - 1.0 : clip(-1,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
tubeax(pregain) =
stage1 :
stage2
with {
stage1 =
tubestage130_10(TB_12AU7_68k,86.0,2700.0,1.257240) :
- ~ tubestage130_10(TB_12AU7_250k,132.0,1500.0,0.776162) :
*(pregain) :
fi.lowpass(1,6531.0) :
tubestage130_10(TB_12AU7_250k,132.0,1500.0,0.776162) :
+ ~ tubestage130_10(TB_12AU7_250k,194.0,820.0,0.445487) ;
stage2 =
fi.lowpass(1,6531.0) :
tubestage130_10(TB_12AU7_250k,194.0,820.0,0.445487) ;
} ;
process =
val :
component("amp_dist.dsp").dist1(gain) :
tubeax(pregain) :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
};
|
957a22fcef8d7254cf92dbd82cc00dc8b0f677382bcc58f9d2da915d4d43f40e | sadko4u/tamgamp.lv2 | 12ax7_feed.dsp | /*
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "12ax7 feedback"; // in amp tube ba.selector
declare name "12ax7 feedback";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
/****************************************************************
** Tube Preamp Emulation stage 1 - 2
* 12ax7 feedback
*/
val(x) =
valve.vt(dist, q(x), x)
with {
dist = 40.1;
q(x) = lp1tm1(x) * 1 - lp2tm1(x) * 1.02 - 1.0 : clip(-1,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
tubeax(pregain) =
stage1 :
stage2
with {
atten = 0.6;
stage1 =
tubestage(TB_12AX7_68k,86.0,2700.0,1.581656) :
- ~ (atten*tubestage(TB_12AX7_250k,132.0,1500.0,1.204285)) :
*(pregain) :
fi.lowpass(1,6531.0) :
tubestage(TB_12AX7_250k,132.0,1500.0,1.204285) :
+ ~ (atten*tubestage(TB_12AX7_250k,194.0,820.0,0.840702)) ;
stage2 =
fi.lowpass(1,6531.0) :
tubestage(TB_12AX7_250k,194.0,820.0,0.840702) ;
} ;
process =
val :
component("amp_dist.dsp").dist1(gain) :
tubeax(pregain) :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
postgain = ampctrl.postgain * 0.06310 : si.smooth(0.999); // -24 dB correction
};
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/gxsim/12ax7_feed.dsp | faust |
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
in amp tube ba.selector
***************************************************************
** Tube Preamp Emulation stage 1 - 2
* 12ax7 feedback
-24 dB correction |
declare name "12ax7 feedback";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
val(x) =
valve.vt(dist, q(x), x)
with {
dist = 40.1;
q(x) = lp1tm1(x) * 1 - lp2tm1(x) * 1.02 - 1.0 : clip(-1,-0.01);
lp(a) = *(1 - a) : + ~ *(a);
lp1tm1 = abs <: lp(0.9999), _ : max;
avgs = lp1tm1 : avg;
avg_size = ma.SR/9;
avg(x) = x - de.delay1s(avg_size,x) : + ~ _ : /(avg_size);
lp2tm1 = avgs : lp(0.999);
};
tubeax(pregain) =
stage1 :
stage2
with {
atten = 0.6;
stage1 =
tubestage(TB_12AX7_68k,86.0,2700.0,1.581656) :
- ~ (atten*tubestage(TB_12AX7_250k,132.0,1500.0,1.204285)) :
*(pregain) :
fi.lowpass(1,6531.0) :
tubestage(TB_12AX7_250k,132.0,1500.0,1.204285) :
+ ~ (atten*tubestage(TB_12AX7_250k,194.0,820.0,0.840702)) ;
stage2 =
fi.lowpass(1,6531.0) :
tubestage(TB_12AX7_250k,194.0,820.0,0.840702) ;
} ;
process =
val :
component("amp_dist.dsp").dist1(gain) :
tubeax(pregain) :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
};
|
4c43d1279bc7f47c826379f370ba19a98b36298f1ebd8b7a50e09f59c051bde2 | sadko4u/tamgamp.lv2 | pre_6dj8_pp_6v6.dsp | /*
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "pre 6DJ8/ push-pull 6V6"; // in amp tube ba.selector
declare name "pre 6DJ8/ push-pull 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
/****************************************************************
** Tube Preamp Emulation stage 1 - 2
*/
peak1 = fi.allpassn(4,(-0.2, 0.3, 0.4, 0.5));
process =
stage1 :
component("amp_dist.dsp").dist2(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
postgain = ampctrl.postgain * 0.06310 : si.smooth(0.999); // -24 dB correction
atten = 0.6;
stage1 =
ef.speakerbp(310.0, 12000.0) :
*(pregain) :
(
tubestage130_20(TB_6DJ8_68k,86.0,2700.0,1.863946) :
+ ~ (atten*tubestage130_20(TB_6DJ8_250k,132.0,1500.0,1.271609))
) :
fi.lowpass(1,6531.0) :
(
tubestage130_20(TB_6DJ8_250k,132.0,1500.0,1.271609) :
+ ~ (atten*tubestage130_20(TB_6DJ8_250k,194.0,820.0,0.797043))
) :
tubestage130_20(TB_6DJ8_250k,194.0,820.0,0.797043) ;
stage2 =
fi.lowpass(1,6531.0) :
pot_48db(master) <:
(
(min(0.7,tubestage(TB_6V6_250k,6531.0,410.0,0.659761))),
(max(-0.75,tubestage(TB_6V6_68k,6531.0,410.0,0.664541)))
) :>
peak1 ;
};
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/gxsim/pre_6dj8_pp_6v6.dsp | faust |
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
in amp tube ba.selector
***************************************************************
** Tube Preamp Emulation stage 1 - 2
-24 dB correction |
declare name "pre 6DJ8/ push-pull 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
peak1 = fi.allpassn(4,(-0.2, 0.3, 0.4, 0.5));
process =
stage1 :
component("amp_dist.dsp").dist2(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
atten = 0.6;
stage1 =
ef.speakerbp(310.0, 12000.0) :
*(pregain) :
(
tubestage130_20(TB_6DJ8_68k,86.0,2700.0,1.863946) :
+ ~ (atten*tubestage130_20(TB_6DJ8_250k,132.0,1500.0,1.271609))
) :
fi.lowpass(1,6531.0) :
(
tubestage130_20(TB_6DJ8_250k,132.0,1500.0,1.271609) :
+ ~ (atten*tubestage130_20(TB_6DJ8_250k,194.0,820.0,0.797043))
) :
tubestage130_20(TB_6DJ8_250k,194.0,820.0,0.797043) ;
stage2 =
fi.lowpass(1,6531.0) :
pot_48db(master) <:
(
(min(0.7,tubestage(TB_6V6_250k,6531.0,410.0,0.659761))),
(max(-0.75,tubestage(TB_6V6_68k,6531.0,410.0,0.664541)))
) :>
peak1 ;
};
|
56776cbcb7b0e2ccb01b2f7a2e86b05e37d76fc8c9d0ab13cd732ee3ad824222 | sadko4u/tamgamp.lv2 | pre_12au7_pp_6v6.dsp | /*
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "pre 12AU7/ push-pull 6V6"; // in amp tube ba.selector
declare name "pre 12AU7/ push-pull 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
/****************************************************************
** Tube Preamp Emulation stage 1 - 2
* 12AU7 -> pusch pull 6V6
*/
peak1 = fi.allpassn(4,(-0.2, 0.3, 0.4, 0.5));
process =
stage1 :
component("amp_dist.dsp").dist2(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
postgain = ampctrl.postgain * 0.06310 : si.smooth(0.999); // -24 dB correction
atten = 0.6;
stage1 =
ef.speakerbp(310.0, 12000.0) :
*(pregain * 2.0) :
(
tubestage130_10(TB_12AU7_68k,86.0,2700.0,1.257240) :
+ ~ (atten*tubestage130_10(TB_12AU7_250k,132.0,1500.0,0.776162))
) :
fi.lowpass(1,6531.0) :
(
tubestage130_10(TB_12AU7_250k,132.0,1500.0,0.776162) :
+ ~ (atten*tubestage130_10(TB_12AU7_250k,194.0,820.0,0.445487))
) :
tubestage130_10(TB_12AU7_250k,194.0,820.0,0.445487) ;
stage2 =
fi.lowpass(1,6531.0) :
pot_48db(master) <:
(
(min(0.7,tubestage(TB_6V6_250k,6531.0,410.0,0.659761))),
(max(-0.75,tubestage(TB_6V6_68k,6531.0,410.0,0.664541)))
) :>
peak1 ;
};
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/gxsim/pre_12au7_pp_6v6.dsp | faust |
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
in amp tube ba.selector
***************************************************************
** Tube Preamp Emulation stage 1 - 2
* 12AU7 -> pusch pull 6V6
-24 dB correction |
declare name "pre 12AU7/ push-pull 6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
peak1 = fi.allpassn(4,(-0.2, 0.3, 0.4, 0.5));
process =
stage1 :
component("amp_dist.dsp").dist2(gain) :
stage2 :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
atten = 0.6;
stage1 =
ef.speakerbp(310.0, 12000.0) :
*(pregain * 2.0) :
(
tubestage130_10(TB_12AU7_68k,86.0,2700.0,1.257240) :
+ ~ (atten*tubestage130_10(TB_12AU7_250k,132.0,1500.0,0.776162))
) :
fi.lowpass(1,6531.0) :
(
tubestage130_10(TB_12AU7_250k,132.0,1500.0,0.776162) :
+ ~ (atten*tubestage130_10(TB_12AU7_250k,194.0,820.0,0.445487))
) :
tubestage130_10(TB_12AU7_250k,194.0,820.0,0.445487) ;
stage2 =
fi.lowpass(1,6531.0) :
pot_48db(master) <:
(
(min(0.7,tubestage(TB_6V6_250k,6531.0,410.0,0.659761))),
(max(-0.75,tubestage(TB_6V6_68k,6531.0,410.0,0.664541)))
) :>
peak1 ;
};
|
7ad7d7d7095e6b1fec193e9aa3f182037d5b3174c3126502998270d50ad7aadc | levinericzimmermann/cdd | sfformantModelBP.dsp | declare name "sfformantModel";
declare version "1.0";
declare author "Levin Eric Zimmermann";
declare options "[midi:on][nvoices:12]";
import("stdfaust.lib");
gate = button("gate");
baseFreq = hslider("freq",200,20,20000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.0001)) : si.polySmooth(gate,0.999,1);
extra_bend = ba.semi2ratio(hslider("extra_bend",0,-2,2,0.0001));
voice_type = hslider("voice_type",0,0,4,0.001);
vowel = hslider("vowel",0,0,4,0.001);
extype_slider = hslider("extype",0,0,1,0.001);
freq = baseFreq * bend * extra_bend;
minimalGain = 0.1;
gain = hslider("gain", 0.25, 0, 1, 0.001);
filter_envelope_duration = hslider("filter_envelope_duration",4.95,0.5,6,0.001);
tremolo_envelope_duration = hslider("tremolo_envelope_duration",2,0.25,3,0.001);
extype_envelope_duration = hslider("z_extype_envelope_duration",2,0.05,4,0.001);
envelope = en.adsr(2, 1.5, 0.8, 4, gate);
filter_envelope = en.adsre(filter_envelope_duration, 1.5, 0.8, filter_envelope_duration + 1.05, gate) + 0.01;
tremolo_envelope = en.asr(tremolo_envelope_duration * 2, 1, tremolo_envelope_duration, gate);
tremolo_frequency = ((os.lf_triangle(0.2) + 1) / 2) + 0.85;
tremolo = (((os.lf_triangle(tremolo_frequency) + 1) / 2) * abs(tremolo_envelope - 1)) + tremolo_envelope;
extype_envelope = abs(en.asr(extype_envelope_duration, 1, extype_envelope_duration, gate) - 1);
extype = extype_envelope + extype_slider;
// formant_synthesis = pm.SFFormantModelBP(voice_type, vowel, extype, freq, gain);
// formant_synthesis = pm.SFFormantModelFofCycle(voice_type, vowel, freq, gain);
// formant_filter = pm.formantFilterFofCycle;
// formant_filterbank = pm.formantFilterbank(voice_type, vowel, formant_filter, freq);
lowfrequency_osc_modulator0_frequency = hslider("lowfrequency_osc_modulator0_frequency",0.18,0.05,0.25,0.000001);
lowfrequency_osc_modulator1_frequency = hslider("lowfrequency_osc_modulator1_frequency",0.15,0.05,0.25,0.000001);
lowfrequency_osc_modulator2_frequency = hslider("lowfrequency_osc_modulator2_frequency",0.2,0.05,0.25,0.000001);
lowfrequency_osc_modulator0 = (((no.lfnoise(lowfrequency_osc_modulator0_frequency) + 1) / 2) * 0.65) + 0.09 : si.smoo;
lowfrequency_osc_modulator1 = (((no.lfnoise(lowfrequency_osc_modulator1_frequency) + 1) / 2) * 0.5) + 0.12 : si.smoo;
lowfrequency_osc_modulator2 = (((no.lfnoise(lowfrequency_osc_modulator2_frequency) + 1) / 2) * 0.4) + 0.1 : si.smoo;
source_selector = (os.lf_triangle(lowfrequency_osc_modulator1) + 1) / 2 : _;
source_selector_2 = (os.lf_triangle(lowfrequency_osc_modulator0) + 1) / 2 : _;
source_selector_big = (os.lf_triangle(lowfrequency_osc_modulator2) + 1) / 2 : _;
saw_wave_amp_oscilator = (os.lf_triangle(2) + 1) / 2 : _;
saw_wave = os.sawtooth(freq) * (saw_wave_deep * 0.1 * saw_wave_amp_oscilator);
saw_wave_deep = os.sawtooth(freq * 0.5);
square_wave = (os.imptrain(freq) * 0.75) + (saw_wave_deep * 0.25) + (saw_wave * 0.25);
sine_wave_pure = os.oscsin(freq);
sine_wave = (sine_wave_pure * 0.35) + (saw_wave * 0.7);
sine_wave_deep = os.oscsin(freq * 0.5);
formant_synthesis_source_0 = saw_wave, sine_wave : si.interpolate(source_selector);
formant_synthesis_source = formant_synthesis_source_0, square_wave: si.interpolate(source_selector_2);
formant_synthesis_complex = pm.SFFormantModel(
voice_type, vowel, extype, freq, gain, formant_synthesis_source, pm.formantFilterbankBP, 0
);
formant_synthesis_basic = (pm.SFFormantModelFofSmooth(
voice_type, vowel, freq, gain
) * 12) + (formant_synthesis_complex * 0.2) + (sine_wave_deep * 0.1);
formant_synthesis = formant_synthesis_complex, formant_synthesis_basic: si.interpolate(source_selector_big);
filter_partial = (((no.lfnoise(3) + 1) / 2) * 22) + 35;
filtered_formant_synthesis = formant_synthesis : fi.lowpass6e(freq * filter_partial * filter_envelope) : fi.highpass3e(freq * 0.75);
process = filtered_formant_synthesis * envelope * tremolo;
| https://raw.githubusercontent.com/levinericzimmermann/cdd/93ba9234a6a30f6eb478a974ca9f2b688497d61b/etc/faust/sfformantModelBP.dsp | faust | formant_synthesis = pm.SFFormantModelBP(voice_type, vowel, extype, freq, gain);
formant_synthesis = pm.SFFormantModelFofCycle(voice_type, vowel, freq, gain);
formant_filter = pm.formantFilterFofCycle;
formant_filterbank = pm.formantFilterbank(voice_type, vowel, formant_filter, freq); | declare name "sfformantModel";
declare version "1.0";
declare author "Levin Eric Zimmermann";
declare options "[midi:on][nvoices:12]";
import("stdfaust.lib");
gate = button("gate");
baseFreq = hslider("freq",200,20,20000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.0001)) : si.polySmooth(gate,0.999,1);
extra_bend = ba.semi2ratio(hslider("extra_bend",0,-2,2,0.0001));
voice_type = hslider("voice_type",0,0,4,0.001);
vowel = hslider("vowel",0,0,4,0.001);
extype_slider = hslider("extype",0,0,1,0.001);
freq = baseFreq * bend * extra_bend;
minimalGain = 0.1;
gain = hslider("gain", 0.25, 0, 1, 0.001);
filter_envelope_duration = hslider("filter_envelope_duration",4.95,0.5,6,0.001);
tremolo_envelope_duration = hslider("tremolo_envelope_duration",2,0.25,3,0.001);
extype_envelope_duration = hslider("z_extype_envelope_duration",2,0.05,4,0.001);
envelope = en.adsr(2, 1.5, 0.8, 4, gate);
filter_envelope = en.adsre(filter_envelope_duration, 1.5, 0.8, filter_envelope_duration + 1.05, gate) + 0.01;
tremolo_envelope = en.asr(tremolo_envelope_duration * 2, 1, tremolo_envelope_duration, gate);
tremolo_frequency = ((os.lf_triangle(0.2) + 1) / 2) + 0.85;
tremolo = (((os.lf_triangle(tremolo_frequency) + 1) / 2) * abs(tremolo_envelope - 1)) + tremolo_envelope;
extype_envelope = abs(en.asr(extype_envelope_duration, 1, extype_envelope_duration, gate) - 1);
extype = extype_envelope + extype_slider;
lowfrequency_osc_modulator0_frequency = hslider("lowfrequency_osc_modulator0_frequency",0.18,0.05,0.25,0.000001);
lowfrequency_osc_modulator1_frequency = hslider("lowfrequency_osc_modulator1_frequency",0.15,0.05,0.25,0.000001);
lowfrequency_osc_modulator2_frequency = hslider("lowfrequency_osc_modulator2_frequency",0.2,0.05,0.25,0.000001);
lowfrequency_osc_modulator0 = (((no.lfnoise(lowfrequency_osc_modulator0_frequency) + 1) / 2) * 0.65) + 0.09 : si.smoo;
lowfrequency_osc_modulator1 = (((no.lfnoise(lowfrequency_osc_modulator1_frequency) + 1) / 2) * 0.5) + 0.12 : si.smoo;
lowfrequency_osc_modulator2 = (((no.lfnoise(lowfrequency_osc_modulator2_frequency) + 1) / 2) * 0.4) + 0.1 : si.smoo;
source_selector = (os.lf_triangle(lowfrequency_osc_modulator1) + 1) / 2 : _;
source_selector_2 = (os.lf_triangle(lowfrequency_osc_modulator0) + 1) / 2 : _;
source_selector_big = (os.lf_triangle(lowfrequency_osc_modulator2) + 1) / 2 : _;
saw_wave_amp_oscilator = (os.lf_triangle(2) + 1) / 2 : _;
saw_wave = os.sawtooth(freq) * (saw_wave_deep * 0.1 * saw_wave_amp_oscilator);
saw_wave_deep = os.sawtooth(freq * 0.5);
square_wave = (os.imptrain(freq) * 0.75) + (saw_wave_deep * 0.25) + (saw_wave * 0.25);
sine_wave_pure = os.oscsin(freq);
sine_wave = (sine_wave_pure * 0.35) + (saw_wave * 0.7);
sine_wave_deep = os.oscsin(freq * 0.5);
formant_synthesis_source_0 = saw_wave, sine_wave : si.interpolate(source_selector);
formant_synthesis_source = formant_synthesis_source_0, square_wave: si.interpolate(source_selector_2);
formant_synthesis_complex = pm.SFFormantModel(
voice_type, vowel, extype, freq, gain, formant_synthesis_source, pm.formantFilterbankBP, 0
);
formant_synthesis_basic = (pm.SFFormantModelFofSmooth(
voice_type, vowel, freq, gain
) * 12) + (formant_synthesis_complex * 0.2) + (sine_wave_deep * 0.1);
formant_synthesis = formant_synthesis_complex, formant_synthesis_basic: si.interpolate(source_selector_big);
filter_partial = (((no.lfnoise(3) + 1) / 2) * 22) + 35;
filtered_formant_synthesis = formant_synthesis : fi.lowpass6e(freq * filter_partial * filter_envelope) : fi.highpass3e(freq * 0.75);
process = filtered_formant_synthesis * envelope * tremolo;
|
cf4bc9a81735affda2bb21386e4b479bfe5e78995e18e6901d20c8e11fdaaa22 | rmichon/multiKeyboard | fm.dsp | //###################################### fm.dsp ##########################################
// A simple smart phone percussion abstract sound toy based on an FM synth.
//
// ## `SmartKeyboard` Use Strategy
//
// The idea here is to use the `SmartKeyboard` interface as an X/Y control pad by just
// creating one keyboard with on key and by retrieving the X and Y position on that single
// key using the `x` and `y` standard parameters. Keyboard mode is deactivated so that
// the color of the pad doesn't change when it is pressed.
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with `faust2smartkeyb`. For best results,
// we recommend to use the following parameters to compile it:
//
// ```
// faust2smartkeyb [-ios/-android] crazyGuiro.dsp
// ```
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
declare name "fm";
import("stdfaust.lib");
//========================= Smart Keyboard Configuration =================================
// (1 keyboards with 1 key configured as a pad.
//========================================================================================
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Keyboard 0 - Number of Keys':'1',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 0 - Static Mode':'1'
}";
//================================ Instrument Parameters =================================
// Creates the connection between the synth and the mobile device
//========================================================================================
// SmartKeyboard X parameter
x = hslider("x",0,0,1,0.01);
// SmartKeyboard Y parameter
y = hslider("y",0,0,1,0.01);
// SmartKeyboard gate parameter
gate = button("gate") ;
// mode resonance duration is controlled with the x axis of the accelerometer
modFreqRatio = hslider("res[acc: 0 0 -10 0 10]",1,0,2,0.01) : si.smoo;
//=================================== Parameters Mapping =================================
//========================================================================================
// carrier frequency
minFreq = 80;
maxFreq = 500;
cFreq = x*(maxFreq-minFreq) + minFreq : si.polySmooth(gate,0.999,1);
// modulator frequency
modFreq = cFreq*modFreqRatio;
// modulation index
modIndex = y*1000 : si.smoo;
//============================================ DSP =======================================
//========================================================================================
// since the generated sound is pretty chaotic, there is no need for an envelope generator
fmSynth = sy.fm((cFreq,modFreq),(modIndex))*(gate : si.smoo)*0.5;
process = fmSynth;
| https://raw.githubusercontent.com/rmichon/multiKeyboard/7d04f591fac974a91e4b322c3cb757b8cbb50443/faust/examples/fm.dsp | faust | ###################################### fm.dsp ##########################################
A simple smart phone percussion abstract sound toy based on an FM synth.
## `SmartKeyboard` Use Strategy
The idea here is to use the `SmartKeyboard` interface as an X/Y control pad by just
creating one keyboard with on key and by retrieving the X and Y position on that single
key using the `x` and `y` standard parameters. Keyboard mode is deactivated so that
the color of the pad doesn't change when it is pressed.
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with `faust2smartkeyb`. For best results,
we recommend to use the following parameters to compile it:
```
faust2smartkeyb [-ios/-android] crazyGuiro.dsp
```
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
========================= Smart Keyboard Configuration =================================
(1 keyboards with 1 key configured as a pad.
========================================================================================
================================ Instrument Parameters =================================
Creates the connection between the synth and the mobile device
========================================================================================
SmartKeyboard X parameter
SmartKeyboard Y parameter
SmartKeyboard gate parameter
mode resonance duration is controlled with the x axis of the accelerometer
=================================== Parameters Mapping =================================
========================================================================================
carrier frequency
modulator frequency
modulation index
============================================ DSP =======================================
========================================================================================
since the generated sound is pretty chaotic, there is no need for an envelope generator |
declare name "fm";
import("stdfaust.lib");
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Keyboard 0 - Number of Keys':'1',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 0 - Static Mode':'1'
}";
x = hslider("x",0,0,1,0.01);
y = hslider("y",0,0,1,0.01);
gate = button("gate") ;
modFreqRatio = hslider("res[acc: 0 0 -10 0 10]",1,0,2,0.01) : si.smoo;
minFreq = 80;
maxFreq = 500;
cFreq = x*(maxFreq-minFreq) + minFreq : si.polySmooth(gate,0.999,1);
modFreq = cFreq*modFreqRatio;
modIndex = y*1000 : si.smoo;
fmSynth = sy.fm((cFreq,modFreq),(modIndex))*(gate : si.smoo)*0.5;
process = fmSynth;
|
1b9e6f305450dd03cf67c063cdd0747147df33a20a0d66fb3728742d17f94ca7 | s-e-a-m/fc1969lais | 1969lais_WXYZ.dsp | declare name "ALVIN LUCIER - I am SITTING IN A ROOM (1969) - AMBISONIC VERSION";
declare version "010";
declare author "Giuseppe Silvi";
declare license "GNU-GPL-v3";
declare copyright "(c)SEAM 2019";
declare description "Alvin Lucier, I am sitting in a room - live electronic ambisonic model";
declare options "[midi:on] [httpd:on]";
import("stdfaust.lib");
import("../faust-libraries/seam.lib");
ctrlgroup(x) = hgroup("[02]", x);
main = vgroup("[01] Check both boxes to start",
*(L) : de.delay(maxdel, D-1))
with{
maxdel = ma.SR *(180);
I = int(checkbox("[01] Uncheck me after the incipit"));
// Clear
R = (I-I') <= 0;
// Compute the delay time during Incipit
D = (+(I):*(R))~_;
L = int(checkbox("[02] I am Sitting... Uncheck me at the end"));
};
fader = *(g88), *(g88), *(g88), *(g88);
meters = svmeter, svmeter, svmeter, svmeter;
process = ctrlgroup(wxyzrip) : main, main, main, main : ctrlgroup(hgroup("[03] ", fader : meters));
| https://raw.githubusercontent.com/s-e-a-m/fc1969lais/27bd20a1b8d0657d3d3f3c68459a791e083595f3/sources/1969lais_WXYZ.dsp | faust | Clear
Compute the delay time during Incipit | declare name "ALVIN LUCIER - I am SITTING IN A ROOM (1969) - AMBISONIC VERSION";
declare version "010";
declare author "Giuseppe Silvi";
declare license "GNU-GPL-v3";
declare copyright "(c)SEAM 2019";
declare description "Alvin Lucier, I am sitting in a room - live electronic ambisonic model";
declare options "[midi:on] [httpd:on]";
import("stdfaust.lib");
import("../faust-libraries/seam.lib");
ctrlgroup(x) = hgroup("[02]", x);
main = vgroup("[01] Check both boxes to start",
*(L) : de.delay(maxdel, D-1))
with{
maxdel = ma.SR *(180);
I = int(checkbox("[01] Uncheck me after the incipit"));
R = (I-I') <= 0;
D = (+(I):*(R))~_;
L = int(checkbox("[02] I am Sitting... Uncheck me at the end"));
};
fader = *(g88), *(g88), *(g88), *(g88);
meters = svmeter, svmeter, svmeter, svmeter;
process = ctrlgroup(wxyzrip) : main, main, main, main : ctrlgroup(hgroup("[03] ", fader : meters));
|
c47a124622c3d52e611a701d9450b602741a048321a706b2b59e993c07d720db | sekisushai/ambitools | hoa_panning_lebedev06.dsp | declare name "NFC-HOA with 06 nodes Lebedev grid up to order 1";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
// Description: This tool computes the driving signal of loudspeakers arranged on a 26-node Lebedev grid with equivalent panning law for an HOA scene with N sources [1]. Source types are plane or spherical waves.
// References:
//[1] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
//[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
// Inputs: N
// Outputs: 26
import("stdfaust.lib");
import("nfc.lib");
import("ymn.lib");
import("lebedev.lib");
import("gui.lib");
// maximum order for Ambisonics components
M = 1;
// number of inputs (number of sources to encode)
N = 1;
ins = N;
outs = 6;
g(i) = hslider("[%i+1][osc:/gain_%i -20 20][style:knob]Gain %2i",0,-30,20,0.1): ba.db2linear : si.smooth(0.999); // gain
r(i) = hslider("[%i+2][osc:/radius_%i 0.5 50][style:knob]Radius %2i", 2, 0.5, 50, 0.01); // radius
t(i) = hslider("[%i+3][osc:/azimuth_%i 0 360][style:knob]Azimuth %2i", 0, 0, 360, 0.1)*ma.PI/180; // azimuth
d(i) = hslider("[%i+4][osc:/elevation_%i -90 90][style:knob]Elevation %2i", 0, -90, 90, 0.1)*ma.PI/180; // elevation
mute = par(i,M+1,_*vgroup("[2]Mute Order",1-checkbox("%i")));
spherical(i) = hgroup("[%i+5]Spherical Wave",checkbox("Yes"));
// Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [1]
r2 = nentry("[~]Speaker Radius", 1.07, 0.5, 10, 0.01); // louspeaker radius
// For plane wave, gain multiplication by 4*PI*r2; for spherical wave, gain multiplication by (4*PI*r2)/(4*PI*r(i)) [2].
selecteur(i) = _*(g(i))<:(*(spherical(i)),*(1-spherical(i)))<:(*(r2/r(i))<:par(m,M+1,nf(m,r(i),r2))),(*(r2)<:par(m,M+1,nfc(m,r2))):>par(m,M+1,*(2*m+1)):mute;
signal(source,speaker) = hgroup("",selecteur(source):par(m,M+1,_*(legendre(m,gamma))):>_*(weight1(speaker)))
with {
gamma=angle(t(source),d(source),azimuth(speaker),elevation(speaker));
};
process=si.bus(N)<:par(speaker,outs,par(source,N,signal(source,speaker)):>_):hgroup("[~]Outputs",par(i,outs,id2(i,0)));
| https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_panning_lebedev06.dsp | faust | Description: This tool computes the driving signal of loudspeakers arranged on a 26-node Lebedev grid with equivalent panning law for an HOA scene with N sources [1]. Source types are plane or spherical waves.
References:
[1] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
Inputs: N
Outputs: 26
maximum order for Ambisonics components
number of inputs (number of sources to encode)
gain
radius
azimuth
elevation
Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [1]
louspeaker radius
For plane wave, gain multiplication by 4*PI*r2; for spherical wave, gain multiplication by (4*PI*r2)/(4*PI*r(i)) [2]. | declare name "NFC-HOA with 06 nodes Lebedev grid up to order 1";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
import("stdfaust.lib");
import("nfc.lib");
import("ymn.lib");
import("lebedev.lib");
import("gui.lib");
M = 1;
N = 1;
ins = N;
outs = 6;
mute = par(i,M+1,_*vgroup("[2]Mute Order",1-checkbox("%i")));
spherical(i) = hgroup("[%i+5]Spherical Wave",checkbox("Yes"));
selecteur(i) = _*(g(i))<:(*(spherical(i)),*(1-spherical(i)))<:(*(r2/r(i))<:par(m,M+1,nf(m,r(i),r2))),(*(r2)<:par(m,M+1,nfc(m,r2))):>par(m,M+1,*(2*m+1)):mute;
signal(source,speaker) = hgroup("",selecteur(source):par(m,M+1,_*(legendre(m,gamma))):>_*(weight1(speaker)))
with {
gamma=angle(t(source),d(source),azimuth(speaker),elevation(speaker));
};
process=si.bus(N)<:par(speaker,outs,par(source,N,signal(source,speaker)):>_):hgroup("[~]Outputs",par(i,outs,id2(i,0)));
|
31cabc954bd3338c539fc17b9f445f4b9722244ee844bf1d7c1ce39ec86599c0 | sekisushai/ambitools | hoa_decoder_lebedev26.dsp | declare name "HOA Decoder up to order 3 for 26 nodes Lebedev grid";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
// Description: Basic decoder (mode-matching) for Lebedev grid with 26 nodes, working up to order 3 [1].
// Possibility to choose with or without near-field compensation [2].
// References:
//[1] Lecomte, P., Gauthier, P.-A., Langrenne, C., Garcia, A., & Berry, A. (2015). On the use of a Lebedev grid for Ambisonics. In Audio Engineering Society Convention outs/29. New York.
//[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
// Inputs: (M+1)^2
// Outputs: 26
import("stdfaust.lib");
import("ymn.lib");
import("nfc.lib");
import("lebedev.lib");
import("gui.lib");
// Maximum order 3 to have no aliasing in the sweet spot.
M = 3;
ins = (M+1)^2;
outs = 26;
near = vgroup("[3]NFC",checkbox("Yes"));
// Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [2]
r2 = nentry("[4]Speakers Radius", 1.07, 0.5, 10, 0.01);
// Gains: CAUTION with maximal value (60 dB!) it's to compensate the attenuation of the microphone radial filters.
volin = vslider("[1]Inputs Gain[unit:dB][osc:/levelin -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
volout = vslider("[2]Outputs Gain[unit:dB][osc:/levelout -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
matrix(n,m) = hgroup("B-Format",si.bus(ins):par(i,M+1,metermute(i)))<:par(i,m,buswg(row(i)):>_*(volout));
// When near-field compensation is activated, multiplication by 4*PI*r2 to have the correct gain, see [2]
selecteur = si.bus(ins)<:((par(i,ins,*(near*volin*r2)):par(m,M+1,par(i,2*m+1,nfc(m,r2)))),par(i,ins,*((1-near)*volin))):>si.bus(ins);
// Analytic decoder matrix Wlebedev.YLebedev [1]
// Vector of weighted spherical harmonics : spherical harmonics times the speaker weight for weighet quadrature rules [1]
row(i) = par(j,ins,yacn(j,azimuth(i),elevation(i))*weight3(i));
process = hgroup("Inputs",selecteur:matrix(ins,outs)):(hgroup("Outputs 1-outs/2",par(i,outs/2,id2(i,0))),hgroup("Outputs 14-26",par(i,outs/2,id2(i,outs/2)))); | https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_decoder_lebedev26.dsp | faust | Description: Basic decoder (mode-matching) for Lebedev grid with 26 nodes, working up to order 3 [1].
Possibility to choose with or without near-field compensation [2].
References:
[1] Lecomte, P., Gauthier, P.-A., Langrenne, C., Garcia, A., & Berry, A. (2015). On the use of a Lebedev grid for Ambisonics. In Audio Engineering Society Convention outs/29. New York.
[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
Inputs: (M+1)^2
Outputs: 26
Maximum order 3 to have no aliasing in the sweet spot.
Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [2]
Gains: CAUTION with maximal value (60 dB!) it's to compensate the attenuation of the microphone radial filters.
When near-field compensation is activated, multiplication by 4*PI*r2 to have the correct gain, see [2]
Analytic decoder matrix Wlebedev.YLebedev [1]
Vector of weighted spherical harmonics : spherical harmonics times the speaker weight for weighet quadrature rules [1] | declare name "HOA Decoder up to order 3 for 26 nodes Lebedev grid";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
import("stdfaust.lib");
import("ymn.lib");
import("nfc.lib");
import("lebedev.lib");
import("gui.lib");
M = 3;
ins = (M+1)^2;
outs = 26;
near = vgroup("[3]NFC",checkbox("Yes"));
r2 = nentry("[4]Speakers Radius", 1.07, 0.5, 10, 0.01);
volin = vslider("[1]Inputs Gain[unit:dB][osc:/levelin -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
volout = vslider("[2]Outputs Gain[unit:dB][osc:/levelout -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
matrix(n,m) = hgroup("B-Format",si.bus(ins):par(i,M+1,metermute(i)))<:par(i,m,buswg(row(i)):>_*(volout));
selecteur = si.bus(ins)<:((par(i,ins,*(near*volin*r2)):par(m,M+1,par(i,2*m+1,nfc(m,r2)))),par(i,ins,*((1-near)*volin))):>si.bus(ins);
row(i) = par(j,ins,yacn(j,azimuth(i),elevation(i))*weight3(i));
process = hgroup("Inputs",selecteur:matrix(ins,outs)):(hgroup("Outputs 1-outs/2",par(i,outs/2,id2(i,0))),hgroup("Outputs 14-26",par(i,outs/2,id2(i,outs/2)))); |
6bdf1078e5e90886ccc3c3d0b8887ca94d65f7756983ef0f8e60d9d5c259aa4e | sekisushai/ambitools | hoa_decoder_lebedev50.dsp | declare name "HOA Decoder up to order 5 for 50 nodes Lebedev grid";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
// Description: Basic decoder (mode-matching) for Lebedev grid with 50 nodes, working up to order 5 [1].
// Possibility to choose with or without near-field compensation [2].
// References:
//[1] Lecomte, P., Gauthier, P.-A., Langrenne, C., Garcia, A., & Berry, A. (2015). On the use of a Lebedev grid for Ambisonics. In Audio Engineering Society Convention 139. New York.
//[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
// Inputs: (M+1)^2
// Outputs: 50
import("stdfaust.lib");
import("ymn.lib");
import("nfc.lib");
import("lebedev.lib");
import("gui.lib");
// Maximum order 5 to have no aliasing in the sweet spot.
M = 5;
ins = (M+1)^2;
outs = 50;
near = vgroup("[3]NFC",checkbox("Yes"));
// Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [2]
r2 = nentry("[4]Speakers Radius", 1.07, 0.5, 10, 0.01);
// Gains: CAUTION with maximal value (60 dB!) it's to compensate the attenuation of the microphone radial filters.
volin = vslider("[1]Inputs Gain[unit:dB][osc:/levelin -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
volout = vslider("[2]Outputs Gain[unit:dB][osc:/levelout -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
matrix(n,m) = hgroup("B-Format",si.bus(ins):par(i,M+1,metermute(i)))<:par(i,m,buswg(row(i)):>_*(volout));
// When near-field compensation is activated, multiplication by 4*PI*r2 to have the correct gain, see [2]
selecteur = si.bus(ins)<:((par(i,ins,*(near*volin*r2)):par(m,M+1,par(i,2*m+1,nfc(m,r2)))),par(i,ins,*((1-near)*volin))):>si.bus(ins);
// Analytic decoder matrix Wlebedev.YLebedev [1]
// Vector of weighted spherical harmonics : spherical harmonics times the speaker weight for weighed quadrature rules [1]
row(i) = par(j,ins,yacn(j,azimuth(i),elevation(i))*weight5(i));
process = hgroup("Inputs",selecteur:matrix(ins,outs)):(hgroup("Outputs 1-25",par(i,outs/2,id2(i,0))),hgroup("Outputs 26-50",par(i,outs/2,id2(i,outs/2)))); | https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_decoder_lebedev50.dsp | faust | Description: Basic decoder (mode-matching) for Lebedev grid with 50 nodes, working up to order 5 [1].
Possibility to choose with or without near-field compensation [2].
References:
[1] Lecomte, P., Gauthier, P.-A., Langrenne, C., Garcia, A., & Berry, A. (2015). On the use of a Lebedev grid for Ambisonics. In Audio Engineering Society Convention 139. New York.
[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
Inputs: (M+1)^2
Outputs: 50
Maximum order 5 to have no aliasing in the sweet spot.
Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [2]
Gains: CAUTION with maximal value (60 dB!) it's to compensate the attenuation of the microphone radial filters.
When near-field compensation is activated, multiplication by 4*PI*r2 to have the correct gain, see [2]
Analytic decoder matrix Wlebedev.YLebedev [1]
Vector of weighted spherical harmonics : spherical harmonics times the speaker weight for weighed quadrature rules [1] | declare name "HOA Decoder up to order 5 for 50 nodes Lebedev grid";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
import("stdfaust.lib");
import("ymn.lib");
import("nfc.lib");
import("lebedev.lib");
import("gui.lib");
M = 5;
ins = (M+1)^2;
outs = 50;
near = vgroup("[3]NFC",checkbox("Yes"));
r2 = nentry("[4]Speakers Radius", 1.07, 0.5, 10, 0.01);
volin = vslider("[1]Inputs Gain[unit:dB][osc:/levelin -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
volout = vslider("[2]Outputs Gain[unit:dB][osc:/levelout -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
matrix(n,m) = hgroup("B-Format",si.bus(ins):par(i,M+1,metermute(i)))<:par(i,m,buswg(row(i)):>_*(volout));
selecteur = si.bus(ins)<:((par(i,ins,*(near*volin*r2)):par(m,M+1,par(i,2*m+1,nfc(m,r2)))),par(i,ins,*((1-near)*volin))):>si.bus(ins);
row(i) = par(j,ins,yacn(j,azimuth(i),elevation(i))*weight5(i));
process = hgroup("Inputs",selecteur:matrix(ins,outs)):(hgroup("Outputs 1-25",par(i,outs/2,id2(i,0))),hgroup("Outputs 26-50",par(i,outs/2,id2(i,outs/2)))); |
73fcaa5bdf5b28b36974070f4f7d08bf8c48c9a5a04bf72ecf419f9f7c440e78 | sekisushai/ambitools | hoa_decoder_lebedev06.dsp | declare name "HOA Decoder up to order 1 for 6 nodes Lebedev grid";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
// Description: Basic decoder (mode-matching) for Lebedev grid with 26 nodes, working up to order 3 [1].
// Possibility to choose with or without near-field compensation [2].
// References:
//[1] Lecomte, P., Gauthier, P.-A., Langrenne, C., Garcia, A., & Berry, A. (2015). On the use of a Lebedev grid for Ambisonics. In Audio Engineering Society Convention outs/29. New York.
//[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
// Inputs: (M+1)^2
// Outputs: 26
import("stdfaust.lib");
import("ymn.lib");
import("nfc.lib");
import("lebedev.lib");
import("gui.lib");
// Maximum order 3 to have no aliasing in the sweet spot.
M = 1;
ins = (M+1)^2;
outs = 6;
near = vgroup("[3]NFC",checkbox("Yes"));
// Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [2]
r2 = nentry("[4]Speakers Radius", 1.07, 0.5, 10, 0.01);
// Gains: CAUTION with maximal value (60 dB!) it's to compensate the attenuation of the microphone radial filters.
volin = vslider("[1]Inputs Gain[unit:dB][osc:/levelin -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
volout = vslider("[2]Outputs Gain[unit:dB][osc:/levelout -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
matrix(n,m) = hgroup("B-Format",si.bus(ins):par(i,M+1,metermute(i)))<:par(i,m,buswg(row(i)):>_*(volout));
// When near-field compensation is activated, multiplication by 4*PI*r2 to have the correct gain, see [2]
selecteur = si.bus(ins)<:((par(i,ins,*(near*volin*r2)):par(m,M+1,par(i,2*m+1,nfc(m,r2)))),par(i,ins,*((1-near)*volin))):>si.bus(ins);
// Analytic decoder matrix Wlebedev.YLebedev [1]
// Vector of weighted spherical harmonics : spherical harmonics times the speaker weight for weighet quadrature rules [1]
row(i) = par(j,ins,yacn(j,azimuth(i),elevation(i))*weight1(i));
process = hgroup("Inputs",selecteur:matrix(ins,outs)):hgroup("Outputs 1-6",par(i,outs,id2(i,0))); | https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_decoder_lebedev06.dsp | faust | Description: Basic decoder (mode-matching) for Lebedev grid with 26 nodes, working up to order 3 [1].
Possibility to choose with or without near-field compensation [2].
References:
[1] Lecomte, P., Gauthier, P.-A., Langrenne, C., Garcia, A., & Berry, A. (2015). On the use of a Lebedev grid for Ambisonics. In Audio Engineering Society Convention outs/29. New York.
[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
Inputs: (M+1)^2
Outputs: 26
Maximum order 3 to have no aliasing in the sweet spot.
Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [2]
Gains: CAUTION with maximal value (60 dB!) it's to compensate the attenuation of the microphone radial filters.
When near-field compensation is activated, multiplication by 4*PI*r2 to have the correct gain, see [2]
Analytic decoder matrix Wlebedev.YLebedev [1]
Vector of weighted spherical harmonics : spherical harmonics times the speaker weight for weighet quadrature rules [1] | declare name "HOA Decoder up to order 1 for 6 nodes Lebedev grid";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
import("stdfaust.lib");
import("ymn.lib");
import("nfc.lib");
import("lebedev.lib");
import("gui.lib");
M = 1;
ins = (M+1)^2;
outs = 6;
near = vgroup("[3]NFC",checkbox("Yes"));
r2 = nentry("[4]Speakers Radius", 1.07, 0.5, 10, 0.01);
volin = vslider("[1]Inputs Gain[unit:dB][osc:/levelin -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
volout = vslider("[2]Outputs Gain[unit:dB][osc:/levelout -10 60]", 0, -10, 60, 0.1) : ba.db2linear : si.smooth(0.999);
matrix(n,m) = hgroup("B-Format",si.bus(ins):par(i,M+1,metermute(i)))<:par(i,m,buswg(row(i)):>_*(volout));
selecteur = si.bus(ins)<:((par(i,ins,*(near*volin*r2)):par(m,M+1,par(i,2*m+1,nfc(m,r2)))),par(i,ins,*((1-near)*volin))):>si.bus(ins);
row(i) = par(j,ins,yacn(j,azimuth(i),elevation(i))*weight1(i));
process = hgroup("Inputs",selecteur:matrix(ins,outs)):hgroup("Outputs 1-6",par(i,outs,id2(i,0))); |
46f24359d789e25546ba1bb4807f52da16ac32abaed5b3c63503e633cf44cb3e | olegkapitonov/KPP-VST3 | kpp_distruction.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 distortion pedal emulator with equalizer.
*
* Process chain:
*
* input->pre_filter->*drive_knob->distortion->equalizer->post-filter->*volume_knob->output
*
* pre-filter - highpass, 1 order, 720 Hz,
* lowpass, 1 order, 1200 Hz
*
* Voice knob disables pre-filter in left position.
*
* distortion - nonlinear element, hard clipper.
*
* equalizer - tonestack, bass-middle-treble.
*
* post-filter - lowpass, 1 order, 1220 Hz,
* highpass, 1 order, 70 Hz
*/
declare name "kpp_distruction";
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");
drive = vslider("drive",63,0,100,0.01);
volume = vslider("volume",0.5,0,1,0.001);
voice = vslider("voice",0.5,0,1,0.001);
tonestack_low = vslider("bass",0,-15,15,0.1);
tonestack_middle = vslider("middle",0,-15,15,0.1);
tonestack_high = vslider("treble",0,-15,15,0.1);
tonestack_low_freq = 100;
tonestack_middle_freq = 700;
tonestack_high_freq = 3300;
tonestack_low_band = 200;
tonestack_middle_band = 700;
tonestack_high_band = 2000;
clamp = min(2.0) : max(-2.0);
// Distortion threshold, bigger signal is cutting
Upor = 0.2;
// Bias of each half-wave so that they better match
bias = 0.2;
pre_filter = fi.lowpass(1, 3000) <:
fi.highpass(1, 3300);
post_filter = fi.lowpass(1, 3000) : fi.highpass(1,30) :
fi.peak_eq(-6, 550, 500) : fi.high_shelf(-20 + voice*20, 550);
// Softness of distortion
Kreg = 1.0;
tube(Kreg,Upor,bias,cut) = main : +(bias) : max(cut) with {
Ks(x) = 1/(max((x-Upor)*(Kreg),0)+1);
Ksplus(x) = Upor - x*Upor;
main(Uin) = (Uin * Ks(Uin) + Ksplus(Ks(Uin)));
};
stage_stomp = pre_filter : _<:
_,*(-1.0) : tube(Kreg,Upor,bias,0), tube(Kreg,Upor,bias,0) : - :
fi.peak_eq(tonestack_low,tonestack_low_freq,tonestack_low_band) :
fi.peak_eq(tonestack_middle,tonestack_middle_freq,tonestack_middle_band) :
fi.peak_eq(tonestack_high,tonestack_high_freq,tonestack_high_band) :
post_filter :
clamp;
stomp = fi.dcblocker : clamp : *(ba.db2linear(drive * 70.0 / 100.0)-1) :
*(5) : stage_stomp : *((ba.db2linear(volume * 25.0)-1) / 100.0) : fi.dcblocker;
output = _,_ : + : ba.bypass1(bypass, stomp) <: _,_;
};
| https://raw.githubusercontent.com/olegkapitonov/KPP-VST3/91af48938c94d5a72009e01ef139bc3de8cf8dcd/kpp_distruction/include/kpp_distruction.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 distortion pedal emulator with equalizer.
*
* Process chain:
*
* input->pre_filter->*drive_knob->distortion->equalizer->post-filter->*volume_knob->output
*
* pre-filter - highpass, 1 order, 720 Hz,
* lowpass, 1 order, 1200 Hz
*
* Voice knob disables pre-filter in left position.
*
* distortion - nonlinear element, hard clipper.
*
* equalizer - tonestack, bass-middle-treble.
*
* post-filter - lowpass, 1 order, 1220 Hz,
* highpass, 1 order, 70 Hz
Bypass button, 0 - pedal on, 1 -pedal off (bypass on)
Distortion threshold, bigger signal is cutting
Bias of each half-wave so that they better match
Softness of distortion |
declare name "kpp_distruction";
declare author "Oleg Kapitonov";
declare license "GPLv3";
declare version "1.2";
import("stdfaust.lib");
process = output with {
bypass = checkbox("99_bypass");
drive = vslider("drive",63,0,100,0.01);
volume = vslider("volume",0.5,0,1,0.001);
voice = vslider("voice",0.5,0,1,0.001);
tonestack_low = vslider("bass",0,-15,15,0.1);
tonestack_middle = vslider("middle",0,-15,15,0.1);
tonestack_high = vslider("treble",0,-15,15,0.1);
tonestack_low_freq = 100;
tonestack_middle_freq = 700;
tonestack_high_freq = 3300;
tonestack_low_band = 200;
tonestack_middle_band = 700;
tonestack_high_band = 2000;
clamp = min(2.0) : max(-2.0);
Upor = 0.2;
bias = 0.2;
pre_filter = fi.lowpass(1, 3000) <:
fi.highpass(1, 3300);
post_filter = fi.lowpass(1, 3000) : fi.highpass(1,30) :
fi.peak_eq(-6, 550, 500) : fi.high_shelf(-20 + voice*20, 550);
Kreg = 1.0;
tube(Kreg,Upor,bias,cut) = main : +(bias) : max(cut) with {
Ks(x) = 1/(max((x-Upor)*(Kreg),0)+1);
Ksplus(x) = Upor - x*Upor;
main(Uin) = (Uin * Ks(Uin) + Ksplus(Ks(Uin)));
};
stage_stomp = pre_filter : _<:
_,*(-1.0) : tube(Kreg,Upor,bias,0), tube(Kreg,Upor,bias,0) : - :
fi.peak_eq(tonestack_low,tonestack_low_freq,tonestack_low_band) :
fi.peak_eq(tonestack_middle,tonestack_middle_freq,tonestack_middle_band) :
fi.peak_eq(tonestack_high,tonestack_high_freq,tonestack_high_band) :
post_filter :
clamp;
stomp = fi.dcblocker : clamp : *(ba.db2linear(drive * 70.0 / 100.0)-1) :
*(5) : stage_stomp : *((ba.db2linear(volume * 25.0)-1) / 100.0) : fi.dcblocker;
output = _,_ : + : ba.bypass1(bypass, stomp) <: _,_;
};
|
0608028ccf23fa1953c2b13e9d93f573699b1be5b3a5543a949c53efc22b7c32 | Msc-program/Jacklink | compressor2dsp.dsp | declare name "compressor2"; // more modern feedback-compressor with release-to-threshold
declare version "0.0";
declare author "Julius Smith";
declare license "MIT Style STK-4.2"; // but using GPLv3
declare description "adapted from ./compressordsp.dsp adding use of co.FBFFcompressor_N_chan";
declare documentation "https://faustlibraries.grame.fr/libs/compressors/#cofffbcompressor_n_chan";
import("stdfaust.lib");
// #### Usage
//
// ```
// _ : compressor2_mono_demo : _;
// ```
//------------------------------------------------------------
compressor2_demo = ba.bypass1(cbp,compressor2_mono_demo)
with {
comp_group(x) = vgroup("COMPRESSOR2 [tooltip: Reference:
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 compressor2
has no effect]"));
// API: co.FBFFcompressor_N_chan(strength,thresh,att,rel,knee,prePost,link,FBFF,meter,N)
// strength = min(ratio-1.0,5)/5.0; // crude hack - will be wrong
knee = 5; // dB window about threshold for knee
prePost = 1; // level detector location: 0 for input, 1 for output (for feedback compressor)
link = 0; // linkage between channels (irrelevant for mono)
FBFF = 1; // cross-fade between feedforward (0) and feedback (1) compression
maxGR = -50; // dB - Max Gain Reduction (only affects display)
meter = _<:(_, (ba.linear2db:max(maxGR):meter_group((hbargraph("[1] Compressor Gain [unit:dB][tooltip: Compressor gain in dB]", maxGR, 10))))):attach;
//meter = _; // use gainview below instead to look more like compressordsp.dsp
NChans = 1;
// compressordsp.dsp: gainview = co.compression_gain_mono(strength,threshold,attack,release)
// threshold gets doubled for the feedback case, but not for feedforward (see compressors.lib):
gainview = co.peak_compression_gain_N_chan(strength,2*threshold,attack,release,knee,prePost,link,NChans)
: ba.linear2db : max(maxGR) :
meter_group(hbargraph("[1] Compressor2 Gain [unit:dB] [tooltip: Current gain of
the compressor2 in dB]",maxGR,+10));
// use built-in gain display:
displaygain = _;
// not the same: displaygain = _ <: _,abs : _,gainview : attach;
compressor2_mono_demo =
displaygain(co.FBFFcompressor_N_chan(strength,threshold,attack,release,knee,prePost,link,FBFF,meter,NChans)) :
*(makeupgain);
ctl_group(x) = knob_group(hgroup("[3] Compression Control", x));
strength = ctl_group(hslider("[0] Strength [style:knob]
[tooltip: A compression Strength of 0 means no compression, while 1 yields infinit compression (hard limiting)]",
0.1, 0, 1, 0.01)); // 0.1 seems to be pretty close to ratio == 2, based on watching the gain displays
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 Strength]",
-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 = _ : compressor2_demo : _;
| https://raw.githubusercontent.com/Msc-program/Jacklink/70b8634173e66d89884bb77b70b7b3ed01f71f79/faust-src/tests/compressor2dsp.dsp | faust | more modern feedback-compressor with release-to-threshold
but using GPLv3
#### Usage
```
_ : compressor2_mono_demo : _;
```
------------------------------------------------------------
en.wikipedia.org/wiki/Dynamic_range_compression]", x);
API: co.FBFFcompressor_N_chan(strength,thresh,att,rel,knee,prePost,link,FBFF,meter,N)
strength = min(ratio-1.0,5)/5.0; // crude hack - will be wrong
dB window about threshold for knee
level detector location: 0 for input, 1 for output (for feedback compressor)
linkage between channels (irrelevant for mono)
cross-fade between feedforward (0) and feedback (1) compression
dB - Max Gain Reduction (only affects display)
meter = _; // use gainview below instead to look more like compressordsp.dsp
compressordsp.dsp: gainview = co.compression_gain_mono(strength,threshold,attack,release)
threshold gets doubled for the feedback case, but not for feedforward (see compressors.lib):
use built-in gain display:
not the same: displaygain = _ <: _,abs : _,gainview : attach;
0.1 seems to be pretty close to ratio == 2, based on watching the gain displays | declare version "0.0";
declare author "Julius Smith";
declare description "adapted from ./compressordsp.dsp adding use of co.FBFFcompressor_N_chan";
declare documentation "https://faustlibraries.grame.fr/libs/compressors/#cofffbcompressor_n_chan";
import("stdfaust.lib");
compressor2_demo = ba.bypass1(cbp,compressor2_mono_demo)
with {
comp_group(x) = vgroup("COMPRESSOR2 [tooltip: Reference:
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 compressor2
has no effect]"));
meter = _<:(_, (ba.linear2db:max(maxGR):meter_group((hbargraph("[1] Compressor Gain [unit:dB][tooltip: Compressor gain in dB]", maxGR, 10))))):attach;
NChans = 1;
gainview = co.peak_compression_gain_N_chan(strength,2*threshold,attack,release,knee,prePost,link,NChans)
: ba.linear2db : max(maxGR) :
meter_group(hbargraph("[1] Compressor2 Gain [unit:dB] [tooltip: Current gain of
the compressor2 in dB]",maxGR,+10));
displaygain = _;
compressor2_mono_demo =
displaygain(co.FBFFcompressor_N_chan(strength,threshold,attack,release,knee,prePost,link,FBFF,meter,NChans)) :
*(makeupgain);
ctl_group(x) = knob_group(hgroup("[3] Compression Control", x));
strength = ctl_group(hslider("[0] Strength [style:knob]
[tooltip: A compression Strength of 0 means no compression, while 1 yields infinit compression (hard limiting)]",
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 Strength]",
-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 = _ : compressor2_demo : _;
|
68b094f3f1f2764d8f8222858c4cd706a0ba7d1f3dda28dd0a37c8b55b32e36f | reverbrick/contour | FMSynth.dsp | //###################################### fm.dsp ##########################################
// A simple smart phone percussion abstract sound toy based on an FM synth.
//
// ## `SmartKeyboard` Use Strategy
//
// The idea here is to use the `SmartKeyboard` interface as an X/Y control pad by just
// creating one keyboard with on key and by retrieving the X and Y position on that single
// key using the `x` and `y` standard parameters. Keyboard mode is deactivated so that
// the color of the pad doesn't change when it is pressed.
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with `faust2smartkeyb`. For best results,
// we recommend to use the following parameters to compile it:
//
// ```
// faust2smartkeyb [-ios/-android] crazyGuiro.dsp
// ```
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
declare name "fm";
import("stdfaust.lib");
//========================= Smart Keyboard Configuration =================================
// (1 keyboards with 1 key configured as a pad.
//========================================================================================
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Keyboard 0 - Number of Keys':'1',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 0 - Static Mode':'1',
'Keyboard 0 - Send X':'1',
'Keyboard 0 - Send Y':'1'
}";
//================================ Instrument Parameters =================================
// Creates the connection between the synth and the mobile device
//========================================================================================
// SmartKeyboard X parameter
x = hslider("x",0,0,1,0.01);
// SmartKeyboard Y parameter
y = hslider("y",0,0,1,0.01);
// SmartKeyboard gate parameter
gate = button("gate") ;
// mode resonance duration is controlled with the x axis of the accelerometer
modFreqRatio = hslider("res[acc: 0 0 -10 0 10]",1,0,2,0.01) : si.smoo;
//=================================== Parameters Mapping =================================
//========================================================================================
// carrier frequency
minFreq = 80;
maxFreq = 500;
cFreq = x*(maxFreq-minFreq) + minFreq : si.polySmooth(gate,0.999,1);
// modulator frequency
modFreq = cFreq*modFreqRatio;
// modulation index
modIndex = y*1000 : si.smoo;
//============================================ DSP =======================================
//========================================================================================
// since the generated sound is pretty chaotic, there is no need for an envelope generator
fmSynth = sy.fm((cFreq,modFreq),(modIndex))*(gate : si.smoo)*0.5;
process = fmSynth;
| https://raw.githubusercontent.com/reverbrick/contour/7f7926311cbe0bbcefe16a7641ad70bf6f10c945/FAUST/FMSynth.dsp | faust | ###################################### fm.dsp ##########################################
A simple smart phone percussion abstract sound toy based on an FM synth.
## `SmartKeyboard` Use Strategy
The idea here is to use the `SmartKeyboard` interface as an X/Y control pad by just
creating one keyboard with on key and by retrieving the X and Y position on that single
key using the `x` and `y` standard parameters. Keyboard mode is deactivated so that
the color of the pad doesn't change when it is pressed.
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with `faust2smartkeyb`. For best results,
we recommend to use the following parameters to compile it:
```
faust2smartkeyb [-ios/-android] crazyGuiro.dsp
```
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
========================= Smart Keyboard Configuration =================================
(1 keyboards with 1 key configured as a pad.
========================================================================================
================================ Instrument Parameters =================================
Creates the connection between the synth and the mobile device
========================================================================================
SmartKeyboard X parameter
SmartKeyboard Y parameter
SmartKeyboard gate parameter
mode resonance duration is controlled with the x axis of the accelerometer
=================================== Parameters Mapping =================================
========================================================================================
carrier frequency
modulator frequency
modulation index
============================================ DSP =======================================
========================================================================================
since the generated sound is pretty chaotic, there is no need for an envelope generator |
declare name "fm";
import("stdfaust.lib");
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Keyboard 0 - Number of Keys':'1',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 0 - Static Mode':'1',
'Keyboard 0 - Send X':'1',
'Keyboard 0 - Send Y':'1'
}";
x = hslider("x",0,0,1,0.01);
y = hslider("y",0,0,1,0.01);
gate = button("gate") ;
modFreqRatio = hslider("res[acc: 0 0 -10 0 10]",1,0,2,0.01) : si.smoo;
minFreq = 80;
maxFreq = 500;
cFreq = x*(maxFreq-minFreq) + minFreq : si.polySmooth(gate,0.999,1);
modFreq = cFreq*modFreqRatio;
modIndex = y*1000 : si.smoo;
fmSynth = sy.fm((cFreq,modFreq),(modIndex))*(gate : si.smoo)*0.5;
process = fmSynth;
|
b002e30e1e2c8e667448a0ab79008f3fa67d440494673ec6df3aa763eb99280b | scottericpetersen/OMI-Faust-Workshop | pulsee.dsp | declare name " Pulsee ";
declare author " Scott E. Petersen " ;
declare copyright " (c) SEP 2023 ";
declare version " 0.02 ";
declare license " BSD ";
/* -- 1. LIBRARIES ------------------------------------------------------------------- */
// -- Import the standard library so we can use preexisting objects
import("stdfaust.lib");
/* -- 2. CONSTANTS AND QUANTITIES ---------------------------------------------------- */
d_max = 0.1; // maximum value for wet/dry mix knob
mdel = 8092; // maximym delay amount in samples for the comb filter
/* -- 3. GUI SECTION ----------------------------------------------------------------- */
// -- overall amplitude scaler
amp = oscGroup(hslider("[1]amp[style:knob]",0.2,0.0,1.0,0.01)) : si.smoo; // overall amplitude
// -- impulse frequency
pfreq = oscGroup(hslider("[2]freq[style:knob]",1.0,0.0,30.0,0.1)) : si.smoo; // pulse train frequency in number of pulses per second
// -- random number amount
drift = oscGroup(hslider("[3]drift[style:knob]",0.0,0.0,10.0,0.1)) : si.smoo; // random amount to add to pulse train frequency if desired
// -- filter order
order = filtGroup(hslider("[1]order[style:menu{'2nd':0;'4th':1}]",0,0,1,1)); // selector menu for filter order, selects from two output options
// -- filter cutoff
cutoff = filtGroup(hslider("cut[style:knob]",500,10,2800,10)) : si.smoo; // lowpass filter cutoff frequency.
// -- delay amount (miliseconds)
delay = combGroup(hslider("delay[style:knob]",mdel/2, 0, mdel, 1)) : si.smoo; // delay time control for comb filter
// -- feedback
fdbk = combGroup(hslider("fdbk[style:knob]",0.2,0.0,1.0,0.01)) : si.smoo; // feedback control for comb filter
// -- reverb wet/dry mix
mix = verbGroup(hslider("wet amnt[style:knob]",0.01,0.0,d_max,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);
/* -- 4. OSCILLATOR SECTION ----------------------------------------------------------- */
lfn = (no.lfnoiseN(3, 48000/100) + 1.001) * drift; // random low frequency noise to add to pulse train frequency parameter if desired.
src = os.lf_imptrain(pfreq + lfn)*amp; // pulse train oscillator - the sound generator in this program
/* -- 5. FILTER SECTION --------------------------------------------------------------- */
// -- low passes
filter2 = src : fi.lowpass(2, cutoff); // The order number (2) is a compile time argument and cannot be changed post-compile.
filter4 = src : fi.lowpass(4, cutoff); // So here we create two filters of different orders and use select2 at the output to change which we hear.
// -- comb filter
comb = fi.fb_comb(mdel, delay, delay, fdbk); // comb filter
/* -- 6. EFFECTS SECTION -------------------------------------------------------------- */
// panning
pan = sp.panner(0.5); // pan mono signal to center
// reverb
verb = re.stereo_freeverb(0.91521,0.9459,0.495, 7); // freeverb reverberator
/* -- 7. MIXING ------------------------------------------------------------------------ */
// -- signal with no reverb, panned
dry = select2(order, filter2, filter4) : comb : pan : _*(d_max-mix), _*(d_max-mix); // inverse of mix for wet/dry
// -- dry signal processed through reverb
wet = dry : _*mix, _*mix : verb ;
/* -- 8. 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.dsp | faust | -- 1. LIBRARIES -------------------------------------------------------------------
-- Import the standard library so we can use preexisting objects
-- 2. CONSTANTS AND QUANTITIES ----------------------------------------------------
maximum value for wet/dry mix knob
maximym delay amount in samples for the comb filter
-- 3. GUI SECTION -----------------------------------------------------------------
-- overall amplitude scaler
overall amplitude
-- impulse frequency
pulse train frequency in number of pulses per second
-- random number amount
random amount to add to pulse train frequency if desired
-- filter order
selector menu for filter order, selects from two output options
-- filter cutoff
lowpass filter cutoff frequency.
-- delay amount (miliseconds)
delay time control for comb filter
-- feedback
feedback control for comb filter
-- reverb wet/dry mix
-- groups for GUI elements listed above
-- 4. OSCILLATOR SECTION -----------------------------------------------------------
random low frequency noise to add to pulse train frequency parameter if desired.
pulse train oscillator - the sound generator in this program
-- 5. FILTER SECTION ---------------------------------------------------------------
-- low passes
The order number (2) is a compile time argument and cannot be changed post-compile.
So here we create two filters of different orders and use select2 at the output to change which we hear.
-- comb filter
comb filter
-- 6. EFFECTS SECTION --------------------------------------------------------------
panning
pan mono signal to center
reverb
freeverb reverberator
-- 7. MIXING ------------------------------------------------------------------------
-- signal with no reverb, panned
inverse of mix for wet/dry
-- dry signal processed through reverb
-- 8. 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.02 ";
declare license " BSD ";
import("stdfaust.lib");
mix = verbGroup(hslider("wet amnt[style:knob]",0.01,0.0,d_max,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);
wet = dry : _*mix, _*mix : verb ;
|
7f7040cfb00f75805bad3781bbf043a9b982e1f472148413c209c7a4a892e7d4 | amstramgrame/amstramgrame | exfaust7.dsp |
declare name "Sun";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
/*
Shiny as the sun, modulated sawtooth with a big echo
*/
import("stdfaust.lib");
mpulse(smps_dur, trig) = pulsation
with {
count = ba.countdown( smps_dur, trig);
pulsation = 0, 1 : select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
on_click(x) = (x > x');
// Controls
btn = button("trig[switch:1]");
freq = hslider("freq[acc: 0 0 -10 0 10]", 100, 50, 400, 1)
: ba.sAndH(on_click(btn) + initial);
lf_freq = hslider("lf_freq[acc: 1 0 -10 0 10]", 1, 0.1, 5, 0.1);
amp = hslider("amp", 0.1, 0, 1, 0.01)
: si.smoo;
// DSP
initial = os.impulse;
N_OSC = 4;
lfo(n) = os.lf_squarewave(lf_freq * n);
saw_gen(n) = os.sawtooth(freq * n ) : /(n * 0.5) : *(lfo(n));
env = btn : mpulse_dur(0.05) : en.are(0.05, 8);
echo(sig) = sig : ef.echo(1, 0.1, 0.95) : _*0.3 + sig * 0.7;
synt = sum(n, N_OSC, saw_gen(n + 1))
: pf.flanger_mono(10, abs(lfo(1)) * 2 + 5, 0.9, 0.9, 0)
: *(env)
: echo;
process = synt * amp;
| https://raw.githubusercontent.com/amstramgrame/amstramgrame/4df99bfbae994fc9dcb4012190335e29255b411e/docs/gramophone/programs/exfaust7/exfaust7.dsp | faust |
Shiny as the sun, modulated sawtooth with a big echo
Controls
DSP |
declare name "Sun";
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);
pulsation = 0, 1 : select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
on_click(x) = (x > x');
btn = button("trig[switch:1]");
freq = hslider("freq[acc: 0 0 -10 0 10]", 100, 50, 400, 1)
: ba.sAndH(on_click(btn) + initial);
lf_freq = hslider("lf_freq[acc: 1 0 -10 0 10]", 1, 0.1, 5, 0.1);
amp = hslider("amp", 0.1, 0, 1, 0.01)
: si.smoo;
initial = os.impulse;
N_OSC = 4;
lfo(n) = os.lf_squarewave(lf_freq * n);
saw_gen(n) = os.sawtooth(freq * n ) : /(n * 0.5) : *(lfo(n));
env = btn : mpulse_dur(0.05) : en.are(0.05, 8);
echo(sig) = sig : ef.echo(1, 0.1, 0.95) : _*0.3 + sig * 0.7;
synt = sum(n, N_OSC, saw_gen(n + 1))
: pf.flanger_mono(10, abs(lfo(1)) * 2 + 5, 0.9, 0.9, 0)
: *(env)
: echo;
process = synt * amp;
|
da46dcb8bb53d50d26f0ef24c2d771829f41ae2c01136655d48549607afbf41a | amstramgrame/amstramgrame | exfaust5.dsp |
declare name "Strange Echo";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
/*
Kick based echo generator
*/
import("stdfaust.lib");
on_click(x) = (x > x');
MAX_DLY = 3000;
MIN_DLY = 1000;
// Controls
trig = button("trig[switch:1]");
dly_mult = hslider("mult[acc: 1 0 -10 0 10]", MIN_DLY, MIN_DLY, MAX_DLY, 1)
: ba.sAndH(os.impulse + imp);
amp = hslider("amp", 0.8, 0, 1, 0.01) : si.smoo;
imp = on_click(trig);
env = imp
: en.adsre(0, 0.05, 0.8, 0.05);
recdel(max_smps, smps, fb) = +~de.delay(max_smps,smps) * fb;
kick(pitch, click, attack, decay, drive, gate) = out
with {
env = en.adsr(attack, decay, 0.0, 0.1, gate);
pitchenv = en.adsr(0.005, click, 0.0, 0.1, gate);
clean = env * os.osc((1 + pitchenv * 4) * pitch);
out = ma.tanh(clean * drive);
};
kik = kick(20, 0.005, 0.005, 0.1, 10, trig);
sig = sum(n, 4, kik : recdel(MAX_DLY, dly_mult / (n + 1) , 0.99)) /4;
process = sig
: fi.dcblocker
: fi.highpass(4, 100)
: *(amp);
| https://raw.githubusercontent.com/amstramgrame/amstramgrame/4df99bfbae994fc9dcb4012190335e29255b411e/docs/gramophone/programs/exfaust5/exfaust5.dsp | faust |
Kick based echo generator
Controls |
declare name "Strange Echo";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
import("stdfaust.lib");
on_click(x) = (x > x');
MAX_DLY = 3000;
MIN_DLY = 1000;
trig = button("trig[switch:1]");
dly_mult = hslider("mult[acc: 1 0 -10 0 10]", MIN_DLY, MIN_DLY, MAX_DLY, 1)
: ba.sAndH(os.impulse + imp);
amp = hslider("amp", 0.8, 0, 1, 0.01) : si.smoo;
imp = on_click(trig);
env = imp
: en.adsre(0, 0.05, 0.8, 0.05);
recdel(max_smps, smps, fb) = +~de.delay(max_smps,smps) * fb;
kick(pitch, click, attack, decay, drive, gate) = out
with {
env = en.adsr(attack, decay, 0.0, 0.1, gate);
pitchenv = en.adsr(0.005, click, 0.0, 0.1, gate);
clean = env * os.osc((1 + pitchenv * 4) * pitch);
out = ma.tanh(clean * drive);
};
kik = kick(20, 0.005, 0.005, 0.1, 10, trig);
sig = sum(n, 4, kik : recdel(MAX_DLY, dly_mult / (n + 1) , 0.99)) /4;
process = sig
: fi.dcblocker
: fi.highpass(4, 100)
: *(amp);
|
ffb68e55a1fe71265c07b023f4efdd66525ea7911d1a37e850423817dd9d3da9 | s-e-a-m/fc1991lmml | 1991mobile.dsp | declare name "Michelangelo Lupone. Mobile Locale - 1991";
declare version "020";
declare author "Giuseppe Silvi";
declare license "GNU-GPL-v3";
declare copyright "(c)SEAM 2019";
declare description "Michelangelo Lupone, Mobile Locale - FLY30 Porting";
declare options "[midi:on]";
import("stdfaust.lib");
import("../faust-libraries/hardware.lib");
import("../faust-libraries/measurement.lib");
import("../faust-libraries/mixer.lib");
//----------------------------------------------------------------------- GROUPS
maingroup(x) = hgroup("[01] MAIN", x);
qaqfgroup(x) = maingroup(hgroup("[01] QA and QF", x));
oscgroup(x) = qaqfgroup(hgroup("[01] OSCILLATOR", x));
delgroup(x) = qaqfgroup(hgroup("[02] DELAY", x));
ergroup(x) = maingroup(hgroup("[02] EARLY REFLECTIONS", x));
fdelgroup(x) = maingroup(hgroup("[03] FEEDBACK DELAY", x));
//-------------------------------------------------- UNIPOLAR POITIVE OSCILLATOR
poscil = oscgroup(os.oscsin(freq) : *(amp) : +(amp) <: attach(_, vbargraph("[03] INDEX",0.,1.)))
with{
posctrl(x) = vgroup("[01] OSC", x);
//freq = posctrl(vslider("[01] QF FRQ [style:knob] [midi:ctrl 1]", 0.1,0.1,320,0.01)) : si.smoo;
freq = posctrl(nentry("[01] QF [midi:ctrl 1]
[style:radio{
'320Hz':320;
'22Hz':22;
'8Hz':8;
'0.1Hz':0.1}]", 320, 0, 320, 1)) : si.smoo;
amp = posctrl(vslider("[02] QA [midi:ctrl 81]", 1.0,0.0,1.0,0.01)) : *(0.5) : si.smoo;
};
//process = poscil;
//------------------------------------------------------------------------ QA&QF
qaqf(x) = de.fdelayltv(1,writesize, readindex, x) : *(gain) <: _,*(0),_,*(0)
with{
writesize = ba.sec2samp(0.046);
readindex = poscil*(writesize);
gain = delgroup(vslider("[03] QA [midi:ctrl 82]", 0, 0, 1, 0.01) : si.smoo);
};
//process = qaqf;
//------------------------------------------------------------ EARLY REFLECTIONS
// da mettere in libreria filtri
comb(t,g) = (+ : @(min(max(t-1,0),ma.SR)))~*(g) : mem;
combN(N)= ro.interleave(N,3) : par(i,N,comb);
// tempi
er1 = ba.sec2samp(0.087);
er2 = ba.sec2samp(0.026);
er3 = ba.sec2samp(0.032);
er4 = ba.sec2samp(0.053);
er5 = ba.sec2samp(0.074);
er6 = ba.sec2samp(0.047);
er7 = ba.sec2samp(0.059);
er8 = ba.sec2samp(0.022);
// feedback
g8 = par(i,8,0);
er8comb = combN(8,(er1,er2,er3,er4,er5,er6,er7,er8),g8):par(i,4,+*(0.5));
//------------------------------------------------------------------------ WA&ZA
waza = _ <: wa, za <: _,_,_,_
with{
tableSize = 96000; // 0.5 ma.SR at 192000
delsize1 = ba.sec2samp(0.46) : int;
// WA
recIndex1 = (+(1) : %(delsize1)) ~ *(1);
readIndex1 = 1.02246093/float(delsize1) : (+ : ma.decimal) ~ _ : *(float(delsize1)) : int;
fdel1 = rwtable(tableSize,0.0,recIndex1,_,readIndex1);
wa = *(wag) : ( ro.cross(2) : - : fdel1) ~ *(waf);
// ZA
delsize2 = ba.sec2samp(0.23) : int;
recIndex2 = (+(1) : %(delsize2)) ~ *(1);
readIndex2 = 0.99699327/float(delsize2) : (+ : ma.decimal) ~ _ : *(float(delsize2)) : int;
fdel2 = rwtable(tableSize,0.0,recIndex2,_,readIndex2);
za = *(zag) : ( ro.cross(2) : - : fdel2) ~ *(zaf);
// WA&ZA INTERFACE
wgroup(x) = fdelgroup(vgroup("[01] WA", x));
waf = wgroup(vslider("[01] WAFB [style:knob] [midi:ctrl 7]", 0.,0.,0.9,0.01)) : si.smoo;
wag = wgroup(vslider("[02] WAG [midi:ctrl 87]", 0.,0.,1.0,0.01)) : si.smoo;
zgroup(x) = fdelgroup(vgroup("[02] ZA", x));
zaf = zgroup(vslider("[01] ZAFB [style:knob] [midi:ctrl 8]", 0.,0.,0.9,0.01)) : si.smoo;
zag = zgroup(vslider("[02] ZAG [midi:ctrl 88]", 0.,0.,1.0,0.01)) : si.smoo;
};
//------------------------------------------------------------------------------
//------------------------------------------------------------------------- MAIN
//------------------------------------- here only the objects described in score
main = _ <: qaqf, (er8comb <: si.bus(4), (ermix : waza)) :> _,_,_,_;
//---------------------------------------------- INPUT MICROPHONES AND INPUT MIX
amic = hgroup("[01] MIC A", chstrip : *(ingain) : inmeter);
bmic = hgroup("[02] MIC B", chstrip : *(ingain) : inmeter);
cmic = hgroup("[03] MIC C", chstrip : *(ingain) : inmeter);
dmic = hgroup("[04] MIC D", chstrip : *(ingain) : inmeter);
emic = hgroup("[05] MIC E", chstrip : *(ingain) : inmeter);
fmic = hgroup("[06] MIC F", chstrip : *(ingain) : inmeter);
gmic = hgroup("[07] MIC G", chstrip : *(ingain) : inmeter);
hmic = hgroup("[07] MIC H", chstrip : *(ingain) : inmeter);
input = hgroup("[01] INPUT MIX", pvmeter);
ingain = vslider("[02] GAIN", 0, -70, +12, 0.1) : ba.db2linear : si.smoo;
inmeter(x) = attach(x, an.amp_follower(0.150, x) : ba.linear2db : vbargraph("[03] METER [unit:dB]", -70, +5));
// using Fireface 800 chstrip - 18 ch
microphones = si.bus(20) <: hgroup("[01] MIC A B C D", amic, bmic, cmic, dmic), hgroup("[02] MIC E F G H", emic, fmic, gmic, hmic);
outs = par(i, 4, out(i));
//----------------------------------------------------------------------- LR-MIX
lrmix = _,_; // only for monitoring, not for live
process = tgroup("PANELS", microphones :> hgroup("[03] MAIN", input : main : outs));// :> lrmix ;
| https://raw.githubusercontent.com/s-e-a-m/fc1991lmml/7b4c8c5a21085c35ed477c1c9ac18a37c1d1f39a/src/1991mobile.dsp | faust | ----------------------------------------------------------------------- GROUPS
-------------------------------------------------- UNIPOLAR POITIVE OSCILLATOR
freq = posctrl(vslider("[01] QF FRQ [style:knob] [midi:ctrl 1]", 0.1,0.1,320,0.01)) : si.smoo;
process = poscil;
------------------------------------------------------------------------ QA&QF
process = qaqf;
------------------------------------------------------------ EARLY REFLECTIONS
da mettere in libreria filtri
tempi
feedback
------------------------------------------------------------------------ WA&ZA
0.5 ma.SR at 192000
WA
ZA
WA&ZA INTERFACE
------------------------------------------------------------------------------
------------------------------------------------------------------------- MAIN
------------------------------------- here only the objects described in score
---------------------------------------------- INPUT MICROPHONES AND INPUT MIX
using Fireface 800 chstrip - 18 ch
----------------------------------------------------------------------- LR-MIX
only for monitoring, not for live
:> lrmix ; | declare name "Michelangelo Lupone. Mobile Locale - 1991";
declare version "020";
declare author "Giuseppe Silvi";
declare license "GNU-GPL-v3";
declare copyright "(c)SEAM 2019";
declare description "Michelangelo Lupone, Mobile Locale - FLY30 Porting";
declare options "[midi:on]";
import("stdfaust.lib");
import("../faust-libraries/hardware.lib");
import("../faust-libraries/measurement.lib");
import("../faust-libraries/mixer.lib");
maingroup(x) = hgroup("[01] MAIN", x);
qaqfgroup(x) = maingroup(hgroup("[01] QA and QF", x));
oscgroup(x) = qaqfgroup(hgroup("[01] OSCILLATOR", x));
delgroup(x) = qaqfgroup(hgroup("[02] DELAY", x));
ergroup(x) = maingroup(hgroup("[02] EARLY REFLECTIONS", x));
fdelgroup(x) = maingroup(hgroup("[03] FEEDBACK DELAY", x));
poscil = oscgroup(os.oscsin(freq) : *(amp) : +(amp) <: attach(_, vbargraph("[03] INDEX",0.,1.)))
with{
posctrl(x) = vgroup("[01] OSC", x);
freq = posctrl(nentry("[01] QF [midi:ctrl 1]
[style:radio{
'320Hz':320;
'22Hz':22;
'8Hz':8;
'0.1Hz':0.1}]", 320, 0, 320, 1)) : si.smoo;
amp = posctrl(vslider("[02] QA [midi:ctrl 81]", 1.0,0.0,1.0,0.01)) : *(0.5) : si.smoo;
};
qaqf(x) = de.fdelayltv(1,writesize, readindex, x) : *(gain) <: _,*(0),_,*(0)
with{
writesize = ba.sec2samp(0.046);
readindex = poscil*(writesize);
gain = delgroup(vslider("[03] QA [midi:ctrl 82]", 0, 0, 1, 0.01) : si.smoo);
};
comb(t,g) = (+ : @(min(max(t-1,0),ma.SR)))~*(g) : mem;
combN(N)= ro.interleave(N,3) : par(i,N,comb);
er1 = ba.sec2samp(0.087);
er2 = ba.sec2samp(0.026);
er3 = ba.sec2samp(0.032);
er4 = ba.sec2samp(0.053);
er5 = ba.sec2samp(0.074);
er6 = ba.sec2samp(0.047);
er7 = ba.sec2samp(0.059);
er8 = ba.sec2samp(0.022);
g8 = par(i,8,0);
er8comb = combN(8,(er1,er2,er3,er4,er5,er6,er7,er8),g8):par(i,4,+*(0.5));
waza = _ <: wa, za <: _,_,_,_
with{
delsize1 = ba.sec2samp(0.46) : int;
recIndex1 = (+(1) : %(delsize1)) ~ *(1);
readIndex1 = 1.02246093/float(delsize1) : (+ : ma.decimal) ~ _ : *(float(delsize1)) : int;
fdel1 = rwtable(tableSize,0.0,recIndex1,_,readIndex1);
wa = *(wag) : ( ro.cross(2) : - : fdel1) ~ *(waf);
delsize2 = ba.sec2samp(0.23) : int;
recIndex2 = (+(1) : %(delsize2)) ~ *(1);
readIndex2 = 0.99699327/float(delsize2) : (+ : ma.decimal) ~ _ : *(float(delsize2)) : int;
fdel2 = rwtable(tableSize,0.0,recIndex2,_,readIndex2);
za = *(zag) : ( ro.cross(2) : - : fdel2) ~ *(zaf);
wgroup(x) = fdelgroup(vgroup("[01] WA", x));
waf = wgroup(vslider("[01] WAFB [style:knob] [midi:ctrl 7]", 0.,0.,0.9,0.01)) : si.smoo;
wag = wgroup(vslider("[02] WAG [midi:ctrl 87]", 0.,0.,1.0,0.01)) : si.smoo;
zgroup(x) = fdelgroup(vgroup("[02] ZA", x));
zaf = zgroup(vslider("[01] ZAFB [style:knob] [midi:ctrl 8]", 0.,0.,0.9,0.01)) : si.smoo;
zag = zgroup(vslider("[02] ZAG [midi:ctrl 88]", 0.,0.,1.0,0.01)) : si.smoo;
};
main = _ <: qaqf, (er8comb <: si.bus(4), (ermix : waza)) :> _,_,_,_;
amic = hgroup("[01] MIC A", chstrip : *(ingain) : inmeter);
bmic = hgroup("[02] MIC B", chstrip : *(ingain) : inmeter);
cmic = hgroup("[03] MIC C", chstrip : *(ingain) : inmeter);
dmic = hgroup("[04] MIC D", chstrip : *(ingain) : inmeter);
emic = hgroup("[05] MIC E", chstrip : *(ingain) : inmeter);
fmic = hgroup("[06] MIC F", chstrip : *(ingain) : inmeter);
gmic = hgroup("[07] MIC G", chstrip : *(ingain) : inmeter);
hmic = hgroup("[07] MIC H", chstrip : *(ingain) : inmeter);
input = hgroup("[01] INPUT MIX", pvmeter);
ingain = vslider("[02] GAIN", 0, -70, +12, 0.1) : ba.db2linear : si.smoo;
inmeter(x) = attach(x, an.amp_follower(0.150, x) : ba.linear2db : vbargraph("[03] METER [unit:dB]", -70, +5));
microphones = si.bus(20) <: hgroup("[01] MIC A B C D", amic, bmic, cmic, dmic), hgroup("[02] MIC E F G H", emic, fmic, gmic, hmic);
outs = par(i, 4, out(i));
|
b8215f7f8653549859c218309b0837d4a62ef75f08f556730cd410d37e341df3 | Kutalia/react-webaudio-5150 | kpp_distruction.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 distortion pedal emulator with equalizer.
*
* Process chain:
*
* input->pre_filter->*drive_knob->distortion->equalizer->post-filter->*volume_knob->output
*
* pre-filter - highpass, 1 order, 720 Hz,
* lowpass, 1 order, 1200 Hz
*
* Voice knob disables pre-filter in left position.
*
* distortion - nonlinear element, hard clipper.
*
* equalizer - tonestack, bass-middle-treble.
*
* post-filter - lowpass, 1 order, 1220 Hz,
* highpass, 1 order, 70 Hz
*/
declare name "kpp_distruction";
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");
drive = vslider("drive",63,0,100,0.01);
volume = vslider("volume",0.5,0,2,0.001);
voice = vslider("voice",0.5,0,1,0.001);
tonestack_low = vslider("bass",0,-15,15,0.1);
tonestack_middle = vslider("middle",0,-15,15,0.1);
tonestack_high = vslider("treble",0,-15,15,0.1);
tonestack_low_freq = 100;
tonestack_middle_freq = 700;
tonestack_high_freq = 3300;
tonestack_low_band = 200;
tonestack_middle_band = 700;
tonestack_high_band = 2000;
clamp = min(2.0) : max(-2.0);
// Distortion threshold, bigger signal is cutting
Upor = 0.2;
// Bias of each half-wave so that they better match
bias = 0.2;
pre_filter = fi.lowpass(1, 3000) <:
fi.highpass(1, 3300);
post_filter = fi.lowpass(1, 3000) : fi.highpass(1,30) :
fi.peak_eq(-6, 550, 500) : fi.high_shelf(-20 + voice*20, 550);
// Softness of distortion
Kreg = 1.0;
tube(Kreg,Upor,bias,cut) = main : +(bias) : max(cut) with {
Ks(x) = 1/(max((x-Upor)*(Kreg),0)+1);
Ksplus(x) = Upor - x*Upor;
main(Uin) = (Uin * Ks(Uin) + Ksplus(Ks(Uin)));
};
stage_stomp = pre_filter : _<:
_,*(-1.0) : tube(Kreg,Upor,bias,0), tube(Kreg,Upor,bias,0) : - :
fi.peak_eq(tonestack_low,tonestack_low_freq,tonestack_low_band) :
fi.peak_eq(tonestack_middle,tonestack_middle_freq,tonestack_middle_band) :
fi.peak_eq(tonestack_high,tonestack_high_freq,tonestack_high_band) :
post_filter :
clamp;
stomp = fi.dcblocker : clamp : *(ba.db2linear(drive * 70.0 / 100.0)-1) :
*(5) : stage_stomp : *((ba.db2linear(volume * 25.0)-1) / 100.0) : fi.dcblocker;
output = _,_ : + : ba.bypass1(bypass, stomp) <: _,_;
};
| https://raw.githubusercontent.com/Kutalia/react-webaudio-5150/7c29cb18668a02911897c4ec001d369bbe8db10e/public/kpp_distruction.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 distortion pedal emulator with equalizer.
*
* Process chain:
*
* input->pre_filter->*drive_knob->distortion->equalizer->post-filter->*volume_knob->output
*
* pre-filter - highpass, 1 order, 720 Hz,
* lowpass, 1 order, 1200 Hz
*
* Voice knob disables pre-filter in left position.
*
* distortion - nonlinear element, hard clipper.
*
* equalizer - tonestack, bass-middle-treble.
*
* post-filter - lowpass, 1 order, 1220 Hz,
* highpass, 1 order, 70 Hz
Bypass button, 0 - pedal on, 1 -pedal off (bypass on)
Distortion threshold, bigger signal is cutting
Bias of each half-wave so that they better match
Softness of distortion |
declare name "kpp_distruction";
declare author "Oleg Kapitonov";
declare license "GPLv3";
declare version "1.2";
import("stdfaust.lib");
process = output with {
bypass = checkbox("99_bypass");
drive = vslider("drive",63,0,100,0.01);
volume = vslider("volume",0.5,0,2,0.001);
voice = vslider("voice",0.5,0,1,0.001);
tonestack_low = vslider("bass",0,-15,15,0.1);
tonestack_middle = vslider("middle",0,-15,15,0.1);
tonestack_high = vslider("treble",0,-15,15,0.1);
tonestack_low_freq = 100;
tonestack_middle_freq = 700;
tonestack_high_freq = 3300;
tonestack_low_band = 200;
tonestack_middle_band = 700;
tonestack_high_band = 2000;
clamp = min(2.0) : max(-2.0);
Upor = 0.2;
bias = 0.2;
pre_filter = fi.lowpass(1, 3000) <:
fi.highpass(1, 3300);
post_filter = fi.lowpass(1, 3000) : fi.highpass(1,30) :
fi.peak_eq(-6, 550, 500) : fi.high_shelf(-20 + voice*20, 550);
Kreg = 1.0;
tube(Kreg,Upor,bias,cut) = main : +(bias) : max(cut) with {
Ks(x) = 1/(max((x-Upor)*(Kreg),0)+1);
Ksplus(x) = Upor - x*Upor;
main(Uin) = (Uin * Ks(Uin) + Ksplus(Ks(Uin)));
};
stage_stomp = pre_filter : _<:
_,*(-1.0) : tube(Kreg,Upor,bias,0), tube(Kreg,Upor,bias,0) : - :
fi.peak_eq(tonestack_low,tonestack_low_freq,tonestack_low_band) :
fi.peak_eq(tonestack_middle,tonestack_middle_freq,tonestack_middle_band) :
fi.peak_eq(tonestack_high,tonestack_high_freq,tonestack_high_band) :
post_filter :
clamp;
stomp = fi.dcblocker : clamp : *(ba.db2linear(drive * 70.0 / 100.0)-1) :
*(5) : stage_stomp : *((ba.db2linear(volume * 25.0)-1) / 100.0) : fi.dcblocker;
output = _,_ : + : ba.bypass1(bypass, stomp) <: _,_;
};
|
e5c34654f02be6f069ea490d662d66b2751260bf3fb72112b19aabb127304c3d | amstramgrame/amstramgrame | exfaust8.dsp |
declare name "Uranus";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
/*
Gravitational additive synthesis.
*/
import("stdfaust.lib");
// Controls
btn = button("trig[switch:1]");
freq = hslider("freq[knob:2]", 80, 50, 150, 1);
speed_mult = hslider("lf_freq[acc: 0 0 -10 0 10]", 1, 0.1, 5, 0.1);
amp = hslider("amp", 0.8, 0, 1, 0.01) : si.smoo;
// DSP
tog = btn : ba.toggle;
tog_amp = tog : line(0.1);
w1 = waveform{0.5, 1, 3, 8, 16};
amp1 = waveform{0.1, 0.2, 0.1, 0.05, 0.003};
N_OSC = 5;
a1(n) = amp1, n : rdtable;
s1(n) = w1, n : rdtable : *(freq) : os.osc : *(a1(n));
generic(base_fq, n) = w1, n : rdtable : *(base_fq) : os.osc : *(a1(n));
synt = sum(n, N_OSC, generic(freq, n))
+ sum(n, N_OSC, generic(freq * 1.001, n))
+ sum(n, N_OSC, generic(freq * 1.01, n))
+ sum(n, N_OSC, generic(freq * 1.00001, n))
: fi.highpass(4, 150)
;
ATQ = 0.01;
REL = 1;
remove_neg(x) = x, 0 : select2(x < 0);
env = os.lf_squarewave(speed_mult) : remove_neg
: si.smoo;
iter = (sum(n, N_OSC, generic(freq * 6, n)) * env * 0.1 )
: ef.echo(0.1, 0.1, 0.75) ;
sommation = (synt * 0.5) + iter
: *(2);
process = sommation * amp * tog ;
| https://raw.githubusercontent.com/amstramgrame/amstramgrame/4df99bfbae994fc9dcb4012190335e29255b411e/web/mkdocs/docs/gramophone/programs/exfaust8/exfaust8.dsp | faust |
Gravitational additive synthesis.
Controls
DSP |
declare name "Uranus";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
import("stdfaust.lib");
btn = button("trig[switch:1]");
freq = hslider("freq[knob:2]", 80, 50, 150, 1);
speed_mult = hslider("lf_freq[acc: 0 0 -10 0 10]", 1, 0.1, 5, 0.1);
amp = hslider("amp", 0.8, 0, 1, 0.01) : si.smoo;
tog = btn : ba.toggle;
tog_amp = tog : line(0.1);
w1 = waveform{0.5, 1, 3, 8, 16};
amp1 = waveform{0.1, 0.2, 0.1, 0.05, 0.003};
N_OSC = 5;
a1(n) = amp1, n : rdtable;
s1(n) = w1, n : rdtable : *(freq) : os.osc : *(a1(n));
generic(base_fq, n) = w1, n : rdtable : *(base_fq) : os.osc : *(a1(n));
synt = sum(n, N_OSC, generic(freq, n))
+ sum(n, N_OSC, generic(freq * 1.001, n))
+ sum(n, N_OSC, generic(freq * 1.01, n))
+ sum(n, N_OSC, generic(freq * 1.00001, n))
: fi.highpass(4, 150)
;
ATQ = 0.01;
REL = 1;
remove_neg(x) = x, 0 : select2(x < 0);
env = os.lf_squarewave(speed_mult) : remove_neg
: si.smoo;
iter = (sum(n, N_OSC, generic(freq * 6, n)) * env * 0.1 )
: ef.echo(0.1, 0.1, 0.75) ;
sommation = (synt * 0.5) + iter
: *(2);
process = sommation * amp * tog ;
|
e4d8a89b430014b30d4d18c933f50cbeaba2bbde1ae5e6b2ddd36cd7eaac25ce | rmichon/multiKeyboard | harp.dsp | //######################################## harp.dsp ######################################
// A simple smart phone based harp (if we dare to call it like that).
//
// ## `SmartKeyboard` Use Strategy
//
// Since the sounds generated by this synth are very short, the strategy here is to take
// advantage of the polyphony capabilities of the iOSKeyboard architecture by creating
// a new voice every time a new key is pressed. Since the `SmartKeyboard` interface has a
// large number of keys here (128), lots of sounds are generated when sliding a
// finger across the keyboard.
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with `faust2smartkeyb`. For best results,
// we recommend to use the following parameters to compile it:
//
// ```
// faust2smartkeyb [-ios/-android] harp.dsp
// ```
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
declare name "harp";
import("stdfaust.lib");
//========================= Smart Keyboard Configuration =================================
// (8 keyboards with 16 keys configured as a pitch matrix.
//========================================================================================
declare interface "SmartKeyboard{
'Number of Keyboards':'8',
'Keyboard 0 - Number of Keys':'16',
'Keyboard 1 - Number of Keys':'16',
'Keyboard 2 - Number of Keys':'16',
'Keyboard 3 - Number of Keys':'16',
'Keyboard 4 - Number of Keys':'16',
'Keyboard 5 - Number of Keys':'16',
'Keyboard 6 - Number of Keys':'16',
'Keyboard 7 - Number of Keys':'16',
'Keyboard 0 - Lowest Key':'40',
'Keyboard 1 - Lowest Key':'45',
'Keyboard 2 - Lowest Key':'50',
'Keyboard 3 - Lowest Key':'55',
'Keyboard 4 - Lowest Key':'60',
'Keyboard 5 - Lowest Key':'65',
'Keyboard 6 - Lowest Key':'70',
'Keyboard 7 - Lowest Key':'75',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 1 - Piano Keyboard':'0',
'Keyboard 2 - Piano Keyboard':'0',
'Keyboard 3 - Piano Keyboard':'0',
'Keyboard 4 - Piano Keyboard':'0',
'Keyboard 5 - Piano Keyboard':'0',
'Keyboard 6 - Piano Keyboard':'0',
'Keyboard 7 - Piano Keyboard':'0'
}";
//================================ Instrument Parameters =================================
// Creates the connection between the synth and the mobile device
//========================================================================================
// the string resonance in second is controlled by the x axis of the accelerometer
res = hslider("res[acc: 0 0 -10 0 10]",2,0.1,4,0.01);
// Smart Keyboard frequency parameter
freq = hslider("freq",400,50,2000,0.01);
// Smart Keyboard gate parameter
gate = button("gate");
//=================================== Parameters Mapping =================================
//========================================================================================
stringFreq = freq;
//============================================ DSP =======================================
//========================================================================================
process = sy.combString(freq,res,gate);
| https://raw.githubusercontent.com/rmichon/multiKeyboard/7d04f591fac974a91e4b322c3cb757b8cbb50443/faust/examples/harp.dsp | faust | ######################################## harp.dsp ######################################
A simple smart phone based harp (if we dare to call it like that).
## `SmartKeyboard` Use Strategy
Since the sounds generated by this synth are very short, the strategy here is to take
advantage of the polyphony capabilities of the iOSKeyboard architecture by creating
a new voice every time a new key is pressed. Since the `SmartKeyboard` interface has a
large number of keys here (128), lots of sounds are generated when sliding a
finger across the keyboard.
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with `faust2smartkeyb`. For best results,
we recommend to use the following parameters to compile it:
```
faust2smartkeyb [-ios/-android] harp.dsp
```
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
========================= Smart Keyboard Configuration =================================
(8 keyboards with 16 keys configured as a pitch matrix.
========================================================================================
================================ Instrument Parameters =================================
Creates the connection between the synth and the mobile device
========================================================================================
the string resonance in second is controlled by the x axis of the accelerometer
Smart Keyboard frequency parameter
Smart Keyboard gate parameter
=================================== Parameters Mapping =================================
========================================================================================
============================================ DSP =======================================
======================================================================================== |
declare name "harp";
import("stdfaust.lib");
declare interface "SmartKeyboard{
'Number of Keyboards':'8',
'Keyboard 0 - Number of Keys':'16',
'Keyboard 1 - Number of Keys':'16',
'Keyboard 2 - Number of Keys':'16',
'Keyboard 3 - Number of Keys':'16',
'Keyboard 4 - Number of Keys':'16',
'Keyboard 5 - Number of Keys':'16',
'Keyboard 6 - Number of Keys':'16',
'Keyboard 7 - Number of Keys':'16',
'Keyboard 0 - Lowest Key':'40',
'Keyboard 1 - Lowest Key':'45',
'Keyboard 2 - Lowest Key':'50',
'Keyboard 3 - Lowest Key':'55',
'Keyboard 4 - Lowest Key':'60',
'Keyboard 5 - Lowest Key':'65',
'Keyboard 6 - Lowest Key':'70',
'Keyboard 7 - Lowest Key':'75',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 1 - Piano Keyboard':'0',
'Keyboard 2 - Piano Keyboard':'0',
'Keyboard 3 - Piano Keyboard':'0',
'Keyboard 4 - Piano Keyboard':'0',
'Keyboard 5 - Piano Keyboard':'0',
'Keyboard 6 - Piano Keyboard':'0',
'Keyboard 7 - Piano Keyboard':'0'
}";
res = hslider("res[acc: 0 0 -10 0 10]",2,0.1,4,0.01);
freq = hslider("freq",400,50,2000,0.01);
gate = button("gate");
stringFreq = freq;
process = sy.combString(freq,res,gate);
|
bcfe8aee014629dc8cb740c54a475da2a5df8783fc0edfe3cf23f3c54e524b7a | rmichon/multiKeyboard | dubDub.dsp | //################################### dubDub.dsp #####################################
// A simple smartphone abstract instrument than can be controlled using the touch
// screen and the accelerometers of the device.
//
// ## `SmartKeyboard` Use Strategy
//
// The idea here is to use the `SmartKeyboard` interface as an X/Y control pad by just
// creating one keyboard with on key and by retrieving the X and Y position on that single
// key using the `x` and `y` standard parameters. Keyboard mode is deactivated so that
// the color of the pad doesn't change when it is pressed.
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with `faust2smartkeyb`. For best results,
// we recommend to use the following parameters to compile it:
//
// ```
// faust2smartkeyb [-ios/-android] dubDub.dsp
// ```
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
declare name "dubDub";
import("stdfaust.lib");
//========================= Smart Keyboard Configuration =================================
// (1 keyboards with 1 key configured as a pad.
//========================================================================================
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Keyboard 0 - Number of Keys':'1',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 0 - Static Mode':'1'
}";
//================================ Instrument Parameters =================================
// Creates the connection between the synth and the mobile device
//========================================================================================
// SmartKeyboard X parameter
x = hslider("x",0,0,1,0.01);
// SmartKeyboard Y parameter
y = hslider("y",0,0,1,0.01);
// SmartKeyboard gate parameter
gate = button("gate");
// modulation frequency is controlled with the x axis of the accelerometer
modFreq = hslider("modFeq[acc: 0 0 -10 0 10]",9,0.5,18,0.01);
// general gain is controlled with the y axis of the accelerometer
gain = hslider("gain[acc: 1 0 -10 0 10]",0.5,0,1,0.01);
//=================================== Parameters Mapping =================================
//========================================================================================
// sawtooth frequency
minFreq = 80;
maxFreq = 500;
freq = x*(maxFreq-minFreq) + minFreq : si.polySmooth(gate,0.999,2);
// filter q
q = 8;
// filter cutoff frequency is modulate with a triangle wave
minFilterCutoff = 50;
maxFilterCutoff = 5000;
filterModFreq = modFreq : si.smoo;
filterCutoff = (1-os.lf_trianglepos(modFreq)*(1-y))*(maxFilterCutoff-minFilterCutoff)+minFilterCutoff;
// general gain of the synth
generalGain = gain : ba.lin2LogGain : si.smoo;
//============================================ DSP =======================================
//========================================================================================
process = sy.dubDub(freq,filterCutoff,q,gate)*generalGain;
| https://raw.githubusercontent.com/rmichon/multiKeyboard/7d04f591fac974a91e4b322c3cb757b8cbb50443/faust/examples/dubDub.dsp | faust | ################################### dubDub.dsp #####################################
A simple smartphone abstract instrument than can be controlled using the touch
screen and the accelerometers of the device.
## `SmartKeyboard` Use Strategy
The idea here is to use the `SmartKeyboard` interface as an X/Y control pad by just
creating one keyboard with on key and by retrieving the X and Y position on that single
key using the `x` and `y` standard parameters. Keyboard mode is deactivated so that
the color of the pad doesn't change when it is pressed.
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with `faust2smartkeyb`. For best results,
we recommend to use the following parameters to compile it:
```
faust2smartkeyb [-ios/-android] dubDub.dsp
```
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
========================= Smart Keyboard Configuration =================================
(1 keyboards with 1 key configured as a pad.
========================================================================================
================================ Instrument Parameters =================================
Creates the connection between the synth and the mobile device
========================================================================================
SmartKeyboard X parameter
SmartKeyboard Y parameter
SmartKeyboard gate parameter
modulation frequency is controlled with the x axis of the accelerometer
general gain is controlled with the y axis of the accelerometer
=================================== Parameters Mapping =================================
========================================================================================
sawtooth frequency
filter q
filter cutoff frequency is modulate with a triangle wave
general gain of the synth
============================================ DSP =======================================
======================================================================================== |
declare name "dubDub";
import("stdfaust.lib");
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Keyboard 0 - Number of Keys':'1',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 0 - Static Mode':'1'
}";
x = hslider("x",0,0,1,0.01);
y = hslider("y",0,0,1,0.01);
gate = button("gate");
modFreq = hslider("modFeq[acc: 0 0 -10 0 10]",9,0.5,18,0.01);
gain = hslider("gain[acc: 1 0 -10 0 10]",0.5,0,1,0.01);
minFreq = 80;
maxFreq = 500;
freq = x*(maxFreq-minFreq) + minFreq : si.polySmooth(gate,0.999,2);
q = 8;
minFilterCutoff = 50;
maxFilterCutoff = 5000;
filterModFreq = modFreq : si.smoo;
filterCutoff = (1-os.lf_trianglepos(modFreq)*(1-y))*(maxFilterCutoff-minFilterCutoff)+minFilterCutoff;
generalGain = gain : ba.lin2LogGain : si.smoo;
process = sy.dubDub(freq,filterCutoff,q,gate)*generalGain;
|
090ac1e55b23f98897d5aeafeac2fdcd2c44453829bc62bde15e05717dfaed0a | sadko4u/tamgamp.lv2 | master_6v6.dsp | /*
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "6V6"; // in amp tube ba.selector
declare name "6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
/****************************************************************
** Tube Preamp Emulation stage 1 - 2
*/
bifilter = fi.tf2(b0,b1,b2,a1,a2) with
{
c = 1.059;
R = 0.9221;
lc0 = 0.00506158;
lc1 = 0.06446806;
lc2 = 0.27547621;
lc3 = 0.43359433;
lc4 = 1.31282248;
lc5 = 0.07238887;
fc = 1200 : *(2*ma.PI/ma.SR) : log;
p = lc0*pow(fc,5) + lc1*pow(fc,4) + lc2*pow(fc,3) + lc3*pow(fc,2) + lc4*fc + lc5 : exp;
//b0 = 1;
//b1 = -1.01;
//b2 = 0;
//a1 = -1.84;
//a2 = 0.846416;
b0 = 1;
b1 = -c;
b2 = 0;
a1 = -2*R*cos(p);
a2 = R*R;
};
tubeax(pregain, master) =
stage1 :
stage2
with {
stage1 =
*(pregain) :
tubestage(TB_6V6_68k,86.0,2700.0,2.296150) :
*(0.77) :
fi.lowpass(1,6531.0) :
*(pregain) :
tubestage(TB_6V6_250k,132.0,1500.0,1.675587) :
*(0.77) ;
stage2 =
fi.lowpass(1,6531.0) :
pot_48db(master) :
bifilter :
tubestage(TB_6V6_250k,194.0,820.0,1.130462) :
*(0.77) ;
} ;
process =
component("amp_dist.dsp").dist(gain) :
tubeax(pregain, master) :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
postgain = ampctrl.postgain * 0.06310 : si.smooth(0.999); // -24 dB correction
};
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/gxsim/master_6v6.dsp | faust |
* Simulation of Guitarix preamplifier chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
in amp tube ba.selector
***************************************************************
** Tube Preamp Emulation stage 1 - 2
b0 = 1;
b1 = -1.01;
b2 = 0;
a1 = -1.84;
a2 = 0.846416;
-24 dB correction |
declare name "6V6";
declare samplerate "96000";
import("stdfaust.lib");
import("amp_sim.lib");
bifilter = fi.tf2(b0,b1,b2,a1,a2) with
{
c = 1.059;
R = 0.9221;
lc0 = 0.00506158;
lc1 = 0.06446806;
lc2 = 0.27547621;
lc3 = 0.43359433;
lc4 = 1.31282248;
lc5 = 0.07238887;
fc = 1200 : *(2*ma.PI/ma.SR) : log;
p = lc0*pow(fc,5) + lc1*pow(fc,4) + lc2*pow(fc,3) + lc3*pow(fc,2) + lc4*fc + lc5 : exp;
b0 = 1;
b1 = -c;
b2 = 0;
a1 = -2*R*cos(p);
a2 = R*R;
};
tubeax(pregain, master) =
stage1 :
stage2
with {
stage1 =
*(pregain) :
tubestage(TB_6V6_68k,86.0,2700.0,2.296150) :
*(0.77) :
fi.lowpass(1,6531.0) :
*(pregain) :
tubestage(TB_6V6_250k,132.0,1500.0,1.675587) :
*(0.77) ;
stage2 =
fi.lowpass(1,6531.0) :
pot_48db(master) :
bifilter :
tubestage(TB_6V6_250k,194.0,820.0,1.130462) :
*(0.77) ;
} ;
process =
component("amp_dist.dsp").dist(gain) :
tubeax(pregain, master) :
*(postgain)
with {
gain = ampctrl.gain : si.smooth(0.999);
master = ampctrl.master : si.smooth(0.999);
pregain = ampctrl.pregain : si.smooth(0.999);
};
|
84ccc994c6fdb6373fdf94c5e72ff96d9c71513974ed62e5e9125f4dde0c3382 | CesarChaussinand/GramoCollection | souffleChantant.dsp | declare name "Souffle chantant";
declare version "1.0";
declare author "César Chaussinand";
declare license "MIT";
declare copyright "(c) César Chaussinand 2022";
import("stdfaust.lib");
process = singing + wind : _*gate : ef.echo(0.2,0.2,0.5):ef.cubicnl(0,0);
singing = (os.osc(freq)+os.osc(@(freq*1.01,10000)))*vol;
wind = no.noise<:fi.resonbp(50+450*woosh,2,woosh),fi.resonbp(200+1050*woosh,6,woosh*highs):>_;
woosh = hslider("souffle[acc:0 0 -9 0 9]",0.3,0.1,1,0.01):si.smooth(0.9999)+vib;
vib = 0.2*os.osc(0.6);
highs = hslider("sifflement[acc:1 0 -9 0 9]",0.5,0,1,0.01):si.smooth(0.9999);
freq = hslider("fréquence[acc: 1 0 -9 0 9]",300,200,400,1):qu.quantize(220,qu.eolian):si.smoo;
vol = hslider("volume[knob:2]",0.3,0,0.4,0.01);
gate = button("gate[switch:1]"):en.asr(0.5,1,1);
| https://raw.githubusercontent.com/CesarChaussinand/GramoCollection/58f63f2fdb1fe4d01b4e0416d3a0c14639a347f2/souffleChantant.dsp | faust | declare name "Souffle chantant";
declare version "1.0";
declare author "César Chaussinand";
declare license "MIT";
declare copyright "(c) César Chaussinand 2022";
import("stdfaust.lib");
process = singing + wind : _*gate : ef.echo(0.2,0.2,0.5):ef.cubicnl(0,0);
singing = (os.osc(freq)+os.osc(@(freq*1.01,10000)))*vol;
wind = no.noise<:fi.resonbp(50+450*woosh,2,woosh),fi.resonbp(200+1050*woosh,6,woosh*highs):>_;
woosh = hslider("souffle[acc:0 0 -9 0 9]",0.3,0.1,1,0.01):si.smooth(0.9999)+vib;
vib = 0.2*os.osc(0.6);
highs = hslider("sifflement[acc:1 0 -9 0 9]",0.5,0,1,0.01):si.smooth(0.9999);
freq = hslider("fréquence[acc: 1 0 -9 0 9]",300,200,400,1):qu.quantize(220,qu.eolian):si.smoo;
vol = hslider("volume[knob:2]",0.3,0,0.4,0.01);
gate = button("gate[switch:1]"):en.asr(0.5,1,1);
|
|
fe923ee9a03d3fa6c0365da0edb7d124d4ea82cf4d4513e4dca1cef348529b05 | CesarChaussinand/GramoCollection | craquementsAleatoires.dsp | declare name "Craquements aléatoires";
declare version "1.0";
declare author "César Chaussinand";
declare license "MIT";
declare copyright "(c) César Chaussinand 2022";
import("stdfaust.lib");
process = rPulse(rate):en.ar(0.001,0.005)*no.noise:pm.marimbaModel(freq,0)*gate:fx;
rPulse(r) = ba.pulse((no.noise:ba.latch(ba.pulse(3000))*0.5+1.1)*(1-r)*40000+1500);
fx = _<:_*(1-mix)+bitReducer(2)*(mix);
bitReducer(bits) = _*(pow(2,bits)):int(_)/pow(2,bits);
rate = hslider("rate[acc:0 0 -10 0 10]",0,0,1,0.01):sqrt;
freq = hslider("fréquence[acc:1 0 -10 0 10]",50,50,200,1):qu.quantize(110,qu.eolian);
gate = button("gate[switch:1]"):en.asr(0.1,1,0.1);
mix = hslider("fx mix[knob:2]",0.5,0,1,0.01);
| https://raw.githubusercontent.com/CesarChaussinand/GramoCollection/58f63f2fdb1fe4d01b4e0416d3a0c14639a347f2/craquementsAleatoires.dsp | faust | declare name "Craquements aléatoires";
declare version "1.0";
declare author "César Chaussinand";
declare license "MIT";
declare copyright "(c) César Chaussinand 2022";
import("stdfaust.lib");
process = rPulse(rate):en.ar(0.001,0.005)*no.noise:pm.marimbaModel(freq,0)*gate:fx;
rPulse(r) = ba.pulse((no.noise:ba.latch(ba.pulse(3000))*0.5+1.1)*(1-r)*40000+1500);
fx = _<:_*(1-mix)+bitReducer(2)*(mix);
bitReducer(bits) = _*(pow(2,bits)):int(_)/pow(2,bits);
rate = hslider("rate[acc:0 0 -10 0 10]",0,0,1,0.01):sqrt;
freq = hslider("fréquence[acc:1 0 -10 0 10]",50,50,200,1):qu.quantize(110,qu.eolian);
gate = button("gate[switch:1]"):en.asr(0.1,1,0.1);
mix = hslider("fx mix[knob:2]",0.5,0,1,0.01);
|
|
bbfdd097486946d3dcabee657a69ff300e5779661a83e2eda749a546a5bd4ebf | amstramgrame/amstramgrame | exfaust2.dsp |
declare name "Whale";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
/*
A simple gliding filtered sawtooth synthesizer with different echoes
*/
import("stdfaust.lib");
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);
};
mpulse(smps_dur, trig) = pulsation
with {
count = ba.countdown(smps_dur, trig);
pulsation = 0, 1
: select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
// Controls
freq = hslider("freq[acc: 1 0 -10 0 10]", 1000, 400, 2000, 1)
: si.smoo;
rel = hslider("release[acc: 0 0 -10 0 10]", 0.5, 0.5, 3, 0.01);
trig = button("trig[switch:1]");
amp = hslider("amp", 0.05, 0, 1, 0.01)
: si.smoo;
ATQ = 0.5;
env = trig
: mpulse_dur(ATQ)
: en.are(ATQ, rel);
synt = os.sawtooth(freq)
: fi.resonbp(freq, 10, 0.5)
: fi.fbcombfilter(64, 32, 0.5)
: fi.bandstop(2, 1100, 1600) *(env);
echoed = synt
: ef.echo(1, 0.12, 0.75);
process = (synt + echoed * 0.6) * amp;
| https://raw.githubusercontent.com/amstramgrame/amstramgrame/4df99bfbae994fc9dcb4012190335e29255b411e/web/mkdocs/docs/gramophone/programs/exfaust2/exfaust2.dsp | faust |
A simple gliding filtered sawtooth synthesizer with different echoes
Controls |
declare name "Whale";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
import("stdfaust.lib");
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);
};
mpulse(smps_dur, trig) = pulsation
with {
count = ba.countdown(smps_dur, trig);
pulsation = 0, 1
: select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
freq = hslider("freq[acc: 1 0 -10 0 10]", 1000, 400, 2000, 1)
: si.smoo;
rel = hslider("release[acc: 0 0 -10 0 10]", 0.5, 0.5, 3, 0.01);
trig = button("trig[switch:1]");
amp = hslider("amp", 0.05, 0, 1, 0.01)
: si.smoo;
ATQ = 0.5;
env = trig
: mpulse_dur(ATQ)
: en.are(ATQ, rel);
synt = os.sawtooth(freq)
: fi.resonbp(freq, 10, 0.5)
: fi.fbcombfilter(64, 32, 0.5)
: fi.bandstop(2, 1100, 1600) *(env);
echoed = synt
: ef.echo(1, 0.12, 0.75);
process = (synt + echoed * 0.6) * amp;
|
f55666346ce0947d47298f6fa1f8986f5e5a7bc6b515f33d6971fa849688676e | Josemiguelfernandez/antescollider | encoder.dsp | declare name "Ambisonic EncoderV2 order7 in1";
declare version "1.1";
declare author "Pierre Lecomte";
declare license "CC-BY-NC-SA-4.0";
declare copyright "(c) Pierre Lecomte";
declare options "[osc:on]";
// Changelog
// (2022-09) v1.1
// - Doppler effect
// - Cartesian / Spherical coordinate choice at compilation
// - No more clicks when fast position change
// (2021-04-24)
// - Revert to azimuth-elevation spherical coordinate system $(\theta, \phi)$.
//###Encoder###
// This tool encodes $S$ sources as point sources in an Ambisonic sound scene up to a maximal degree $L$.
//
// ## Point source
// The $i$-th source, with $i \in \\{1, \cdots, S\\}$ carries a signal denoted $s(z)$ in the discrete domain. Encoded as a point source, its position is $(r_s, \theta_s, \phi_s)$ from origin and it emits a spherical wave.
// The near field filters $F_l(k_rs)$ are included to encode the radial distance $r_s$ information. (see [radial.lib]({% link docs/radial.md %}#near-field-filters)).
// In the current implementation, these filters are stabilized with near field compensation filter $\frac{1}{F_l(1,z)}$ at radius $r_\text{spk}=1$ m (see [radial.lib]({% link docs/radial.md %}#stabilization-of-nf-filters-with-nfc-filters)).
// In addition, a delay $\frac{r_s}{c}$ due to the propagation time can be included. When the source moves, this produces a Doppler effect, which can be activated or not at runtime.
// The resulting Ambisonic components are given by:
//
// $$\begin{equation}
// b_{l,m}(z) = s(z) z^{- \lfloor \frac{r_s}{c} \rfloor} \frac{F_l(r_s, z)}{F_l(1, z)} Y_{l,m}(\theta_s, \phi_s)
// \label{eq:point_source}
// \end{equation}$$
//
// Note that to avoid exessing gain for small radius $r_s < 1$ m, the minimum $r_s$ radius is limited at $r_s = 0.75$ m.
// {:.info}
//
// ### Plane wave case
// If the source radius $r_s$ is set to $r_\text{spk} = 1$ m, the source is encoded as a plane wave with direction $(\theta_s, \phi_s)$. In fact the radial term in Eq. \eqref{eq:point_source} is equal to unity.
// The Ambisonic components become:
//
// $$\begin{equation}
// b_{l,m}(z) = s(z) Y_{l,m}(\theta_s, \phi_s)
// \end{equation}$$
//
// ## Compilation parameters
// - `L`: maximal Spherical Harmonics degree (i.e., Ambisonics order), $L > 0$,
// - `S`: number of source to encode, $S > 0$,
// - `coord` : Choice of coordinate system : `0` => Spherical, `1` => Cartesian,
// - `doppler` : Possibility of Doppler effect : `0` => No, `1` => Yes.
//
// ## Inputs / Outputs
// - Inputs: $S$
// - Outputs: $(L+1)^2$
//
// ## User Interface
// For the $i$-th source:
//
// | Element | OSC | Min value | Max value |
// |:-----------------------------------------:|:--------------:|:---------:|:---------:|
// | Gain (dB) | `gain_i` | -20 | 20 |
// | Doppler | `doppler_i` | 0 | 1 |
// | Radius $r$) (m) (`coord = 0`) | `radius_i` | 0.75 | 50 |
// | Azimuth $\theta$ ($^\circ$) (`coord = 0`) | `azimuth_i` | -180 | 180 |
// | Elevation $\phi$ ($^\circ$) (`coord = 0`) | `elevation_i` | -90 | 90 |
// | $x$ (m) (`coord = 1`) | `x_i` | -50 | 50 |
// | $y$ (m) (`coord = 1`) | `y_i` | -50 | 50 |
// | $z$ (m) (`coord = 1`) | `z_i` | -50 | 50 |
//
//######
import("stdfaust.lib");
import("ylm.lib");
import("radial.lib");
import("grids.lib");
// COMPILATION PARAMETERS
L = 7; // maximal SH degree
S = 1; // number of inputs
coord = 0; // Choice of coordinate system : 0 => Spherical, 1 => Cartesian
doppler = 0; // Activate the possibility of Doppler effect : 0 => No, 1 => Yes
// DO NOT EDIT BELOW HERE
rspk = 1; // speaker radius (for near-field filters stabilization)
rmax = 50; // maximum radius
rmin = 0.75;
// User interface
g(i) = hslider("[%i+1][unit:dB][osc:/gain_%i -20 20][style:knob]Gain %2i",0,-20,20,0.1): ba.db2linear : si.smoo; // gain
d(i) = checkbox("[%i+5][osc:/doppler_%i 0 1]Doppler"); // Doppler effect
// User interface Cartesian
x(i) = vslider("[%i+2][unit:m][osc:/x_%i -%rmax %rmax]x %2i", 1, -rmax, rmax, 0.01);
y(i) = vslider("[%i+3][unit:m][osc:/y_%i -%rmax %rmax]y %2i", 0, -rmax, rmax, 0.01);
z(i) = vslider("[%i+4][unit:m][osc:/z_%i -%rmax %rmax]z %2i", 0, -rmax, rmax, 0.01);
rtp(i) = (x(i), y(i), z(i)) : cart2spher : (max(_, rmin), _, _); // ensures to never go below rmin.
r1(i) = rtp(i) : _, !, ! ;
t1(i) = rtp(i) : !, _, ! ;
p1(i) = rtp(i) : !, !, _ ;
// User interface Spherical
r0(i) = hslider("[%i+2][unit:m][osc:/radius_%i %rmin %rmax][style:knob]Radius %2i", 1, rmin, rmax, 0.01);// radius
t0(i) = hslider("[%i+3][unit:°][osc:/azimuth_%i -180 180][style:knob]Azimuth %2i", 0, -180, 180, 0.1)*ma.PI/180; // azimuth
p0(i) = hslider("[%i+4][unit:°][osc:/elevation_%i -90 90][style:knob]Elevation %2i", 0, -90, 90, 0.1)*ma.PI/180; // elevation
// Resulting Spherical coordinate system
r(i) = case{
(0) => r0(i);
(1) => r1(i);
}(coord) : si.smoo;
t(i) = case{
(0) => t0(i);
(1) => t1(i);
}(coord); // no smoothing because of audible click when passing from -180° to 180°, handled with syvec function.
p(i) = case{
(0) => p0(i);
(1) => p1(i);
}(coord) : si.smoo;
// Doppler delay or not
dd(i) = case{
(0) => _;
(1) => ddelay(sqrt(3) * rmax, r(i) * d(i));
}(doppler);
source(i) = hgroup("Source %2i",_*g(i) : dd(i) <:par(l, L+1, nf(l,r(i),rspk)<:par(i,2*l+1,_)) :> syvec((L+1)^2, t(i), p(i)));
// source(i) = hgroup("Source %2i",_*g(i)*sqrt(r(i)) : dd(i) <:par(l, L+1, nf(l,r(i),rspk)<:par(i,2*l+1,_)) :> syvec((L+1)^2, t(i), p(i)));
process = par(i, S, source(i)) :> si.bus((L+1)^2);
| https://raw.githubusercontent.com/Josemiguelfernandez/antescollider/bbbc18b123c1994ea953f5d3dfbaa5e4a8be1bf8/SuperCollider_add/SC_Ambitools/ambitools/dsp/encoder.dsp | faust | Changelog
(2022-09) v1.1
- Doppler effect
- Cartesian / Spherical coordinate choice at compilation
- No more clicks when fast position change
(2021-04-24)
- Revert to azimuth-elevation spherical coordinate system $(\theta, \phi)$.
###Encoder###
This tool encodes $S$ sources as point sources in an Ambisonic sound scene up to a maximal degree $L$.
## Point source
The $i$-th source, with $i \in \\{1, \cdots, S\\}$ carries a signal denoted $s(z)$ in the discrete domain. Encoded as a point source, its position is $(r_s, \theta_s, \phi_s)$ from origin and it emits a spherical wave.
The near field filters $F_l(k_rs)$ are included to encode the radial distance $r_s$ information. (see [radial.lib]({% link docs/radial.md %}#near-field-filters)).
In the current implementation, these filters are stabilized with near field compensation filter $\frac{1}{F_l(1,z)}$ at radius $r_\text{spk}=1$ m (see [radial.lib]({% link docs/radial.md %}#stabilization-of-nf-filters-with-nfc-filters)).
In addition, a delay $\frac{r_s}{c}$ due to the propagation time can be included. When the source moves, this produces a Doppler effect, which can be activated or not at runtime.
The resulting Ambisonic components are given by:
$$\begin{equation}
b_{l,m}(z) = s(z) z^{- \lfloor \frac{r_s}{c} \rfloor} \frac{F_l(r_s, z)}{F_l(1, z)} Y_{l,m}(\theta_s, \phi_s)
\label{eq:point_source}
\end{equation}$$
Note that to avoid exessing gain for small radius $r_s < 1$ m, the minimum $r_s$ radius is limited at $r_s = 0.75$ m.
{:.info}
### Plane wave case
If the source radius $r_s$ is set to $r_\text{spk} = 1$ m, the source is encoded as a plane wave with direction $(\theta_s, \phi_s)$. In fact the radial term in Eq. \eqref{eq:point_source} is equal to unity.
The Ambisonic components become:
$$\begin{equation}
b_{l,m}(z) = s(z) Y_{l,m}(\theta_s, \phi_s)
\end{equation}$$
## Compilation parameters
- `L`: maximal Spherical Harmonics degree (i.e., Ambisonics order), $L > 0$,
- `S`: number of source to encode, $S > 0$,
- `coord` : Choice of coordinate system : `0` => Spherical, `1` => Cartesian,
- `doppler` : Possibility of Doppler effect : `0` => No, `1` => Yes.
## Inputs / Outputs
- Inputs: $S$
- Outputs: $(L+1)^2$
## User Interface
For the $i$-th source:
| Element | OSC | Min value | Max value |
|:-----------------------------------------:|:--------------:|:---------:|:---------:|
| Gain (dB) | `gain_i` | -20 | 20 |
| Doppler | `doppler_i` | 0 | 1 |
| Radius $r$) (m) (`coord = 0`) | `radius_i` | 0.75 | 50 |
| Azimuth $\theta$ ($^\circ$) (`coord = 0`) | `azimuth_i` | -180 | 180 |
| Elevation $\phi$ ($^\circ$) (`coord = 0`) | `elevation_i` | -90 | 90 |
| $x$ (m) (`coord = 1`) | `x_i` | -50 | 50 |
| $y$ (m) (`coord = 1`) | `y_i` | -50 | 50 |
| $z$ (m) (`coord = 1`) | `z_i` | -50 | 50 |
######
COMPILATION PARAMETERS
maximal SH degree
number of inputs
Choice of coordinate system : 0 => Spherical, 1 => Cartesian
Activate the possibility of Doppler effect : 0 => No, 1 => Yes
DO NOT EDIT BELOW HERE
speaker radius (for near-field filters stabilization)
maximum radius
User interface
gain
Doppler effect
User interface Cartesian
ensures to never go below rmin.
User interface Spherical
radius
azimuth
elevation
Resulting Spherical coordinate system
no smoothing because of audible click when passing from -180° to 180°, handled with syvec function.
Doppler delay or not
source(i) = hgroup("Source %2i",_*g(i)*sqrt(r(i)) : dd(i) <:par(l, L+1, nf(l,r(i),rspk)<:par(i,2*l+1,_)) :> syvec((L+1)^2, t(i), p(i))); | declare name "Ambisonic EncoderV2 order7 in1";
declare version "1.1";
declare author "Pierre Lecomte";
declare license "CC-BY-NC-SA-4.0";
declare copyright "(c) Pierre Lecomte";
declare options "[osc:on]";
import("stdfaust.lib");
import("ylm.lib");
import("radial.lib");
import("grids.lib");
rmin = 0.75;
x(i) = vslider("[%i+2][unit:m][osc:/x_%i -%rmax %rmax]x %2i", 1, -rmax, rmax, 0.01);
y(i) = vslider("[%i+3][unit:m][osc:/y_%i -%rmax %rmax]y %2i", 0, -rmax, rmax, 0.01);
z(i) = vslider("[%i+4][unit:m][osc:/z_%i -%rmax %rmax]z %2i", 0, -rmax, rmax, 0.01);
r1(i) = rtp(i) : _, !, ! ;
t1(i) = rtp(i) : !, _, ! ;
p1(i) = rtp(i) : !, !, _ ;
r(i) = case{
(0) => r0(i);
(1) => r1(i);
}(coord) : si.smoo;
t(i) = case{
(0) => t0(i);
(1) => t1(i);
p(i) = case{
(0) => p0(i);
(1) => p1(i);
}(coord) : si.smoo;
dd(i) = case{
(0) => _;
(1) => ddelay(sqrt(3) * rmax, r(i) * d(i));
}(doppler);
source(i) = hgroup("Source %2i",_*g(i) : dd(i) <:par(l, L+1, nf(l,r(i),rspk)<:par(i,2*l+1,_)) :> syvec((L+1)^2, t(i), p(i)));
process = par(i, S, source(i)) :> si.bus((L+1)^2);
|
6a78c52403cf238ffee4692f8b314424f10e3ff0820dcd887fffb26867b95e9e | jcelerier/guitarixlib | expander.dsp |
/* Expander unit. */
/* This is pretty much the same as compressor.dsp, but here the given ratio is
applied to *attenuate* levels *below* the threshold. */
declare name "Expander";
declare category "Guitar Effects";
declare description "expander unit";
declare author "Albert Graef";
declare version "1.0";
import("stdfaust.lib");
rd = library("reducemaps.lib");
/* Controls. */
ratio = nentry("ratio", 2, 1, 20, 0.1);
threshold = nentry("threshold", -40, -96, 10, 0.1);
knee = nentry("knee", 3, 0, 20, 0.1);
attack = hslider("attack", 0.001, 0, 1, 0.001) : max(1/ma.SR);
release = hslider("release", 0.1, 0, 10, 0.01) : max(1/ma.SR);
t = 0.1;
g = exp(-1/(ma.SR*t));
env = abs : *(1-g) : + ~ *(g);
rms = sqr : *(1-g) : + ~ *(g) : sqrt;
sqr(x) = x*x;
env2(x) = max(env(x));
expand(env) = level*(1-r)
with {
level = env : h ~ _ : ba.linear2db : (threshold+knee-_) : max(0)
with {
h(x,y) = f*x+(1-f)*y with { f = (x<y)*ga+(x>=y)*gr; };
ga = exp(-1/(ma.SR*attack));
gr = exp(-1/(ma.SR*release));
};
p = level/(knee+eps) : max(0) : min(1) with { eps = 0.001; };
r = 1-p+p*ratio;
};
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi][log]", -70, +5));
envelop = abs : max ~ (1.0/ma.SR) : rd.mean(2048); // : max(ba.db2linear(-70)) : ba.linear2db;
process(x) = (g(x)*x)
with {
g = env2(x) : expand : vmeter1 : ba.db2linear;
};
| https://raw.githubusercontent.com/jcelerier/guitarixlib/9c2947507cd13b82554020e669a85244e867d584/guitarix/expander.dsp | faust | Expander unit.
This is pretty much the same as compressor.dsp, but here the given ratio is
applied to *attenuate* levels *below* the threshold.
Controls.
: max(ba.db2linear(-70)) : ba.linear2db; |
declare name "Expander";
declare category "Guitar Effects";
declare description "expander unit";
declare author "Albert Graef";
declare version "1.0";
import("stdfaust.lib");
rd = library("reducemaps.lib");
ratio = nentry("ratio", 2, 1, 20, 0.1);
threshold = nentry("threshold", -40, -96, 10, 0.1);
knee = nentry("knee", 3, 0, 20, 0.1);
attack = hslider("attack", 0.001, 0, 1, 0.001) : max(1/ma.SR);
release = hslider("release", 0.1, 0, 10, 0.01) : max(1/ma.SR);
t = 0.1;
g = exp(-1/(ma.SR*t));
env = abs : *(1-g) : + ~ *(g);
rms = sqr : *(1-g) : + ~ *(g) : sqrt;
sqr(x) = x*x;
env2(x) = max(env(x));
expand(env) = level*(1-r)
with {
level = env : h ~ _ : ba.linear2db : (threshold+knee-_) : max(0)
with {
h(x,y) = f*x+(1-f)*y with { f = (x<y)*ga+(x>=y)*gr; };
ga = exp(-1/(ma.SR*attack));
gr = exp(-1/(ma.SR*release));
};
p = level/(knee+eps) : max(0) : min(1) with { eps = 0.001; };
r = 1-p+p*ratio;
};
vmeter1(x) = attach(x, envelop(x) : vbargraph("v1[nomidi][log]", -70, +5));
process(x) = (g(x)*x)
with {
g = env2(x) : expand : vmeter1 : ba.db2linear;
};
|
9837cee1ec5f454cba4790b77829a654d663805842eb04f9a183353584f638dc | tomara-x/magi | gaiagirl.dsp | //trans rights
declare name "gaiagirl";
declare author "amy universe";
declare version "0.04";
declare license "WTFPL";
declare options "[midi:on][nvoices:8]";
import("stdfaust.lib");
//this is supposed to be a wave-terrain synth with a superformula scanning shape
//tables
N = 1 << 16;
wave = float(ba.time)*(2.0*ma.PI)/float(N) <: sin,cos,tan;
W = outputs(wave);
// rotation (i think)
xp = os.hsp_phasor(1,frq,0,0);
yp = os.hsp_phasor(1,frq,0,0.5);
//formula shape
superf(sig) = (abs(cos((m1*sig)/4)/a)^n2 + abs(sin((m2*sig)/4)/b)^n3)^-1/n1 : %(N) //this doesn't keep it in range (cus offset)
with {
m1 = vslider("h:[1]superformula/[0]m1 [style:knob]",4,-64,64,0.001);
m2 = vslider("h:[1]superformula/[1]m2 [style:knob]",4,-64,64,0.001);
n1 = vslider("h:[1]superformula/[2]n1 [style:knob]",10,0.001,64,0.001);
n2 = vslider("h:[1]superformula/[3]n2 [style:knob]",6,1,64,0.001);
n3 = vslider("h:[1]superformula/[4]n3 [style:knob]",6,1,8,0.001);
a = vslider("h:[1]superformula/[5]a [style:knob]",6,0.01,64,0.001);
b = vslider("h:[1]superformula/[6]b [style:knob]",6,0.01,64,0.001);
};
//rotate the formula and scan the wave-tables
x = par(i,W,rdtable(N,wave : ba.selector(i,W), superf(xp)*g + o*N)) //this feels wrong (the read range)
with {
g = vslider("h:[0]hehe/h:[1]rotor/[0]x gain [style:knob]",0.1,0,1,0.001);
o = vslider("h:[0]hehe/h:[1]rotor/[2]x pose [style:knob]",0.5,0,1,0.001);
};
y = par(i,W,rdtable(N,wave : ba.selector(i,W), superf(yp)*g + o*N))
with {
g = vslider("h:[0]hehe/h:[1]rotor/[1]y gain [style:knob]",0.1,0,1,0.001);
o = vslider("h:[0]hehe/h:[1]rotor/[3]y pose [style:knob]",0.5,0,1,0.001);
};
//selection of which wave-table we scanning
process = (x : ba.selectn(W,wx)) * (y : ba.selectn(W,wy)) * env * vel <: _,_
with {
wx = vslider("h:[0]hehe/h:[0]waveform/x [style:knob]",0,0,W-1,1);
wy = vslider("h:[0]hehe/h:[2]waveform/y [style:knob]",0,0,W-1,1);
};
//midi and envelope biz
frq = nentry("h:hidden/freq",0,0,2e4,1) * bend;
gate = button("h:hidden/gate");
vel = nentry("h:hidden/gain",0.5,0,1,0.01);
bend = ba.semi2ratio(hslider("h:hidden/bend [midi:pitchwheel] [style:knob]",0,-2,2,0.01)) : si.polySmooth(gate,0.999,1);
env = gate : en.adsr(a,d,s,r)
with {
a = vslider("h:[2]env/[0]attack [style:knob]",0.01,0,4,0.0001);
d = vslider("h:[2]env/[1]decay [style:knob]",0,0,4,0.0001);
s = vslider("h:[2]env/[2]sustain [style:knob]",1,0,1,0.0001);
r = vslider("h:[2]env/[3]release [style:knob]",0.01,0,4,0.0001);
};
| https://raw.githubusercontent.com/tomara-x/magi/d1575b61d02c9a968ca71f082c655514ebd100cb/source/gaiagirl.dsp | faust | trans rights
this is supposed to be a wave-terrain synth with a superformula scanning shape
tables
rotation (i think)
formula shape
this doesn't keep it in range (cus offset)
rotate the formula and scan the wave-tables
this feels wrong (the read range)
selection of which wave-table we scanning
midi and envelope biz |
declare name "gaiagirl";
declare author "amy universe";
declare version "0.04";
declare license "WTFPL";
declare options "[midi:on][nvoices:8]";
import("stdfaust.lib");
N = 1 << 16;
wave = float(ba.time)*(2.0*ma.PI)/float(N) <: sin,cos,tan;
W = outputs(wave);
xp = os.hsp_phasor(1,frq,0,0);
yp = os.hsp_phasor(1,frq,0,0.5);
with {
m1 = vslider("h:[1]superformula/[0]m1 [style:knob]",4,-64,64,0.001);
m2 = vslider("h:[1]superformula/[1]m2 [style:knob]",4,-64,64,0.001);
n1 = vslider("h:[1]superformula/[2]n1 [style:knob]",10,0.001,64,0.001);
n2 = vslider("h:[1]superformula/[3]n2 [style:knob]",6,1,64,0.001);
n3 = vslider("h:[1]superformula/[4]n3 [style:knob]",6,1,8,0.001);
a = vslider("h:[1]superformula/[5]a [style:knob]",6,0.01,64,0.001);
b = vslider("h:[1]superformula/[6]b [style:knob]",6,0.01,64,0.001);
};
with {
g = vslider("h:[0]hehe/h:[1]rotor/[0]x gain [style:knob]",0.1,0,1,0.001);
o = vslider("h:[0]hehe/h:[1]rotor/[2]x pose [style:knob]",0.5,0,1,0.001);
};
y = par(i,W,rdtable(N,wave : ba.selector(i,W), superf(yp)*g + o*N))
with {
g = vslider("h:[0]hehe/h:[1]rotor/[1]y gain [style:knob]",0.1,0,1,0.001);
o = vslider("h:[0]hehe/h:[1]rotor/[3]y pose [style:knob]",0.5,0,1,0.001);
};
process = (x : ba.selectn(W,wx)) * (y : ba.selectn(W,wy)) * env * vel <: _,_
with {
wx = vslider("h:[0]hehe/h:[0]waveform/x [style:knob]",0,0,W-1,1);
wy = vslider("h:[0]hehe/h:[2]waveform/y [style:knob]",0,0,W-1,1);
};
frq = nentry("h:hidden/freq",0,0,2e4,1) * bend;
gate = button("h:hidden/gate");
vel = nentry("h:hidden/gain",0.5,0,1,0.01);
bend = ba.semi2ratio(hslider("h:hidden/bend [midi:pitchwheel] [style:knob]",0,-2,2,0.01)) : si.polySmooth(gate,0.999,1);
env = gate : en.adsr(a,d,s,r)
with {
a = vslider("h:[2]env/[0]attack [style:knob]",0.01,0,4,0.0001);
d = vslider("h:[2]env/[1]decay [style:knob]",0,0,4,0.0001);
s = vslider("h:[2]env/[2]sustain [style:knob]",1,0,1,0.0001);
r = vslider("h:[2]env/[3]release [style:knob]",0.01,0,4,0.0001);
};
|
aeba5f6c056669f3643ec078dcb089e81f8958c9bff21d60872123e5e870c0df | s-e-a-m/faust-libraries | vcs3_bandlimited.dsp | declare name "EMS VCS3 Eploration";
declare version "001";
declare author "Giuseppe Silvi";
declare license "GNU-GPL-v3";
declare copyright "(c)SEAM 2019";
declare description "EMS VCS3 Eploration";
import("stdfaust.lib");
//import("../../seam.lib");
osc1_g(x) = hgroup("[001]OSCILLATOR 1", x);
freq = osc1_g(vslider("[001]FREQUENCY[style:knob]", 100,1,10000,0.01) : si.smoo);
shape = osc1_g(vslider("[002]SHAPE[style:knob]", 5,0,10,0.1)/10 : si.smoo);
samp = osc1_g(vslider("[003]SINE[style:knob]",0,0,10,0.001)/10:si.smoo);
pamp = osc1_g(vslider("[004]SAW[style:knob]",0,0,10,00.1)/10:si.smoo);
MAX_SAW_ORDER = 4; MAX_SAW_ORDER_NEXTPOW2 = 8;
vcs3osc1(N,f,s,sl,pl) = (shaped(f,s,sl) : poly(Nc) : D(Nc-1) : gate(Nc-1)), saw(f,pl)
with{
phasor(f) = os.lf_sawpos(f);
sine(f,s) = sin(phasor(f)*2*ma.PI) : *(0.5*sin(s*(ma.PI)));
wsine(f,s) = sin(phasor(f)*(-1)*ma.PI) : +(0.637) : *(cos(s*(ma.PI)));
shaped(f,s,sl) = (sine(f,s)+wsine(f,s))*sl;
saw(f,pl) = (phasor(f)-(0.5))*pl;
Nc = max(1,min(N,MAX_SAW_ORDER));
clippedFreq = max(20.0,abs(freq)); // use lf_sawpos(freq) for LFOs (freq < 20 Hz)
saw1l = 2*lf_sawpos(clippedFreq) - 1; // zero-mean, amplitude +/- 1
// Also note the availability of lf_sawpos_phase above.
poly(1,x) = x;
poly(2,x) = x*x;
poly(3,x) = x*x*x - x;
poly(4,x) = x*x*(x*x - 2.0);
poly(5,x) = x*(7.0/3 + x*x*(-10.0/3.0 + x*x));
poly(6,x) = x*x*(7.0 + x*x*(-5.0 + x*x));
p0n = float(ma.SR)/clippedFreq; // period in samples
diff1(x) = (x - x')/(2.0/p0n);
diff(N) = seq(n,N,diff1); // N diff1s in series
factorial(0) = 1;
factorial(i) = i * factorial(i-1);
D(0) = _;
D(i) = diff(i)/factorial(i+1);
gate(N) = *(1@(N)); // delayed step for blanking startup glitch
};
process = vcs3osc1(3,freq,shape,samp,pamp);
| https://raw.githubusercontent.com/s-e-a-m/faust-libraries/9120cccb9335f42407062eb4bf149188d8018b07/examples/app/vcs3_bandlimited.dsp | faust | import("../../seam.lib");
use lf_sawpos(freq) for LFOs (freq < 20 Hz)
zero-mean, amplitude +/- 1
Also note the availability of lf_sawpos_phase above.
period in samples
N diff1s in series
delayed step for blanking startup glitch | declare name "EMS VCS3 Eploration";
declare version "001";
declare author "Giuseppe Silvi";
declare license "GNU-GPL-v3";
declare copyright "(c)SEAM 2019";
declare description "EMS VCS3 Eploration";
import("stdfaust.lib");
osc1_g(x) = hgroup("[001]OSCILLATOR 1", x);
freq = osc1_g(vslider("[001]FREQUENCY[style:knob]", 100,1,10000,0.01) : si.smoo);
shape = osc1_g(vslider("[002]SHAPE[style:knob]", 5,0,10,0.1)/10 : si.smoo);
samp = osc1_g(vslider("[003]SINE[style:knob]",0,0,10,0.001)/10:si.smoo);
pamp = osc1_g(vslider("[004]SAW[style:knob]",0,0,10,00.1)/10:si.smoo);
MAX_SAW_ORDER = 4; MAX_SAW_ORDER_NEXTPOW2 = 8;
vcs3osc1(N,f,s,sl,pl) = (shaped(f,s,sl) : poly(Nc) : D(Nc-1) : gate(Nc-1)), saw(f,pl)
with{
phasor(f) = os.lf_sawpos(f);
sine(f,s) = sin(phasor(f)*2*ma.PI) : *(0.5*sin(s*(ma.PI)));
wsine(f,s) = sin(phasor(f)*(-1)*ma.PI) : +(0.637) : *(cos(s*(ma.PI)));
shaped(f,s,sl) = (sine(f,s)+wsine(f,s))*sl;
saw(f,pl) = (phasor(f)-(0.5))*pl;
Nc = max(1,min(N,MAX_SAW_ORDER));
poly(1,x) = x;
poly(2,x) = x*x;
poly(3,x) = x*x*x - x;
poly(4,x) = x*x*(x*x - 2.0);
poly(5,x) = x*(7.0/3 + x*x*(-10.0/3.0 + x*x));
poly(6,x) = x*x*(7.0 + x*x*(-5.0 + x*x));
diff1(x) = (x - x')/(2.0/p0n);
factorial(0) = 1;
factorial(i) = i * factorial(i-1);
D(0) = _;
D(i) = diff(i)/factorial(i+1);
};
process = vcs3osc1(3,freq,shape,samp,pamp);
|
afdb449963c7a8fe33087c59b7abda01853992492c8f1009a0bf261aac6edbf8 | sekisushai/ambitools | hoa_panning_lebedev50.dsp | declare name "NFC-HOA with 50-node Lebedev grid up to order 5";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
// Description: This tool computes the driving signal of loudspeakers arranged on a 50-node Lebedev grid with equivalent panning law for an HOA scene with N sources [1]. Source types are plane or spherical waves.
// References:
//[1] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
//[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
// Inputs: N
// Outputs: 50
import("stdfaust.lib");
import("nfc.lib");
import("ymn.lib");
import("lebedev.lib");
import("gui.lib");
// maximum order for Ambisonics components
M = 5;
// number of inputs (number of sources to encode)
N = 1;
ins = N;
outs = 50;
g(i) = hslider("[%i+1][osc:/gain_%i -20 20][style:knob]Gain %2i",0,-30,20,0.1): ba.db2linear : si.smooth(0.999); // gain
r(i) = hslider("[%i+2][osc:/radius_%i 0.5 50][style:knob]Radius %2i", 2, 0.5, 50, 0.01); // radius
t(i) = hslider("[%i+3][osc:/azimuth_%i 0 360][style:knob]Azimuth %2i", 0, 0, 360, 0.1)*ma.PI/180; // azimuth
d(i) = hslider("[%i+4][osc:/elevation_%i -90 90][style:knob]Elevation %2i", 0, -90, 90, 0.1)*ma.PI/180; // elevation
mute = par(i,M+1,_*vgroup("[2]Mute Order",1-checkbox("%i")));
spherical(i) = hgroup("[%i+5]Spherical Wave",checkbox("Yes"));
// Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [1]
r2 = nentry("[~]Speaker Radius", 1.07, 0.5, 10, 0.01); // louspeaker radius
// For plane wave, gain multiplication by 4*PI*r2; for spherical wave, gain multiplication by (4*PI*r2)/(4*PI*r(i)) [2].
selecteur(i) = _*(g(i))<:(*(spherical(i)),*(1-spherical(i)))<:(*(r2/r(i))<:par(m,M+1,nf(m,r(i),r2))),(*(r2)<:par(m,M+1,nfc(m,r2))):>par(m,M+1,*(2*m+1)):mute;
signal(source,speaker) = hgroup("",selecteur(source):par(m,M+1,_*(legendre(m,gamma))):>_*(weight5(speaker)))
with {
gamma=angle(t(source),d(source),azimuth(speaker),elevation(speaker));
};
process=si.bus(N)<:par(speaker,outs,par(source,N,signal(source,speaker)):>_):vgroup("[~]Outputs",hgroup("[~]1-25",par(i,outs/2,id2(i,0))),hgroup("[~]26-50",par(i,outs/2,id2(i,25))));
| https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_panning_lebedev50.dsp | faust | Description: This tool computes the driving signal of loudspeakers arranged on a 50-node Lebedev grid with equivalent panning law for an HOA scene with N sources [1]. Source types are plane or spherical waves.
References:
[1] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
Inputs: N
Outputs: 50
maximum order for Ambisonics components
number of inputs (number of sources to encode)
gain
radius
azimuth
elevation
Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [1]
louspeaker radius
For plane wave, gain multiplication by 4*PI*r2; for spherical wave, gain multiplication by (4*PI*r2)/(4*PI*r(i)) [2]. | declare name "NFC-HOA with 50-node Lebedev grid up to order 5";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
import("stdfaust.lib");
import("nfc.lib");
import("ymn.lib");
import("lebedev.lib");
import("gui.lib");
M = 5;
N = 1;
ins = N;
outs = 50;
mute = par(i,M+1,_*vgroup("[2]Mute Order",1-checkbox("%i")));
spherical(i) = hgroup("[%i+5]Spherical Wave",checkbox("Yes"));
selecteur(i) = _*(g(i))<:(*(spherical(i)),*(1-spherical(i)))<:(*(r2/r(i))<:par(m,M+1,nf(m,r(i),r2))),(*(r2)<:par(m,M+1,nfc(m,r2))):>par(m,M+1,*(2*m+1)):mute;
signal(source,speaker) = hgroup("",selecteur(source):par(m,M+1,_*(legendre(m,gamma))):>_*(weight5(speaker)))
with {
gamma=angle(t(source),d(source),azimuth(speaker),elevation(speaker));
};
process=si.bus(N)<:par(speaker,outs,par(source,N,signal(source,speaker)):>_):vgroup("[~]Outputs",hgroup("[~]1-25",par(i,outs/2,id2(i,0))),hgroup("[~]26-50",par(i,outs/2,id2(i,25))));
|
6b1b6cf59f28259d6d6aeff2369086dda248d707f736d76c5ec569650d340f9c | sekisushai/ambitools | hoa_panning_lebedev26.dsp | declare name "NFC-HOA with 26 nodes Lebedev grid up to order 3";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
// Description: This tool computes the driving signal of loudspeakers arranged on a 26-node Lebedev grid with equivalent panning law for an HOA scene with N sources [1]. Source types are plane or spherical waves.
// References:
//[1] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
//[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
// Inputs: N
// Outputs: 26
import("stdfaust.lib");
import("nfc.lib");
import("ymn.lib");
import("lebedev.lib");
import("gui.lib");
// maximum order for Ambisonics components
M = 3;
// number of inputs (number of sources to encode)
N = 1;
ins = N;
outs = 26;
g(i) = hslider("[%i+1][osc:/gain_%i -20 20][style:knob]Gain %2i",0,-30,20,0.1): ba.db2linear : si.smooth(0.999); // gain
r(i) = hslider("[%i+2][osc:/radius_%i 0.5 50][style:knob]Radius %2i", 2, 0.5, 50, 0.01); // radius
t(i) = hslider("[%i+3][osc:/azimuth_%i 0 360][style:knob]Azimuth %2i", 0, 0, 360, 0.1)*ma.PI/180; // azimuth
d(i) = hslider("[%i+4][osc:/elevation_%i -90 90][style:knob]Elevation %2i", 0, -90, 90, 0.1)*ma.PI/180; // elevation
mute = par(i,M+1,_*vgroup("[2]Mute Order",1-checkbox("%i")));
spherical(i) = hgroup("[%i+5]Spherical Wave",checkbox("Yes"));
// Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [1]
r2 = nentry("[~]Speaker Radius", 1.07, 0.5, 10, 0.01); // louspeaker radius
// For plane wave, gain multiplication by 4*PI*r2; for spherical wave, gain multiplication by (4*PI*r2)/(4*PI*r(i)) [2].
selecteur(i) = _*(g(i))<:(*(spherical(i)),*(1-spherical(i)))<:(*(r2/r(i))<:par(m,M+1,nf(m,r(i),r2))),(*(r2)<:par(m,M+1,nfc(m,r2))):>par(m,M+1,*(2*m+1)):mute;
signal(source,speaker) = hgroup("",selecteur(source):par(m,M+1,_*(legendre(m,gamma))):>_*(weight3(speaker)))
with {
gamma=angle(t(source),d(source),azimuth(speaker),elevation(speaker));
};
process=si.bus(N)<:par(speaker,outs,par(source,N,signal(source,speaker)):>_):hgroup("[~]Outputs",par(i,outs,id2(i,0)));
| https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_panning_lebedev26.dsp | faust | Description: This tool computes the driving signal of loudspeakers arranged on a 26-node Lebedev grid with equivalent panning law for an HOA scene with N sources [1]. Source types are plane or spherical waves.
References:
[1] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
[2] Lecomte, P., & Gauthier, P.-A. (2015). Real-Time 3D Ambisonics using Faust, Processing, Pure Data, And OSC. In 15th International Conference on Digital Audio Effects (DAFx-15). Trondheim, Norway.
Inputs: N
Outputs: 26
maximum order for Ambisonics components
number of inputs (number of sources to encode)
gain
radius
azimuth
elevation
Spherical restitution speaker layout radius r2 is needeed to stabilize near-field filters, see [1]
louspeaker radius
For plane wave, gain multiplication by 4*PI*r2; for spherical wave, gain multiplication by (4*PI*r2)/(4*PI*r(i)) [2]. | declare name "NFC-HOA with 26 nodes Lebedev grid up to order 3";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2014";
import("stdfaust.lib");
import("nfc.lib");
import("ymn.lib");
import("lebedev.lib");
import("gui.lib");
M = 3;
N = 1;
ins = N;
outs = 26;
mute = par(i,M+1,_*vgroup("[2]Mute Order",1-checkbox("%i")));
spherical(i) = hgroup("[%i+5]Spherical Wave",checkbox("Yes"));
selecteur(i) = _*(g(i))<:(*(spherical(i)),*(1-spherical(i)))<:(*(r2/r(i))<:par(m,M+1,nf(m,r(i),r2))),(*(r2)<:par(m,M+1,nfc(m,r2))):>par(m,M+1,*(2*m+1)):mute;
signal(source,speaker) = hgroup("",selecteur(source):par(m,M+1,_*(legendre(m,gamma))):>_*(weight3(speaker)))
with {
gamma=angle(t(source),d(source),azimuth(speaker),elevation(speaker));
};
process=si.bus(N)<:par(speaker,outs,par(source,N,signal(source,speaker)):>_):hgroup("[~]Outputs",par(i,outs,id2(i,0)));
|
9cb671d79921cf492a00558e34192589cab4fc6d409da48ba2d8ca0ac3d419c5 | sekisushai/ambitools | hoa_azimuth_rotator.dsp | declare name "HOA Azimuth Rotator";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2015";
// Description: This tool rotates the HOA scene around the z-axis. Driven with OSC from head-tracking, (for example with andOSC application for Android with andOSC.pd patch provided with ambitools), this tool can compensate the head rotation around z-axis when the rendering is made over headphones. See [2] for the matrix definition.
// References:
// [1] M. Kronlachner, “Spatial Transformations for the Alteration of Ambisonic Recordings,” Graz University Of Technology, Austria, 2014.
// Inputs: (M+1)^2
// Outputs: (M+1)^2
import("stdfaust.lib");
import("ymn.lib");
// Maximum required order
M = 10;
ins=(M+1)^2; // Number of inputs (= number of outputs).
t=hslider("Azimuth[osc:/azimuth 0 360]", 0, 0, 360, 0.01)*ma.PI/180; // Slider with azimuth rotation angle
// SUB-MATRIX TERM, AT EACH ORDER
// diagonal terms, anti-diagonal terms, extra diagonal terms
rot(m,i,j) = case{
(1,1) => 1; // (i,j) is on the extra-diagonal AND on the diagonal.
(0,1) => cos((m-i)*t); // (i,j) is NOT on the extra-diaognal AND on the diagonal.
(1,0) => sin((m-i)*t); // (i,j) is on the extra diagonal AND not on the diagonal. sinus is anti-symmetric which correspond to the anti-symetric matrix
(0,0) => 0; // (i,j) is NOT on the extra-diagonal AND NOT on the diagonal
}(i+1+j+1==2*m+1+1,i==j); //test: ((i,j) is on the extra diagonal, (i,j) is on the diagonal)
// MAIN-MATRIX ROW
row(M,i) = par(m,M+1,
par(j,2*m+1,term
with{term = ba.if((i >= m^2) & (i< (m+1)^2),rot(m,int(i-m^2),j),0);}
)
);
// Matrix multiplication
// n = number of inputs
// m = number of outputs
matrix(n,m) = par(i,n,_) <: par(i,m,buswg(row(M,i)):>_);
process = matrix(ins,ins);
// EXAMPLE OF A MATRIX AT ORDER 5
// a(0)=(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
//
// a(1)=(0, cos(t), 0, sin(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(2)=(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(3)=(0, -1*sin(t), 0, cos(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
//
// a(4)=(0, 0, 0, 0, cos(2*t), 0, 0, 0, sin(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(5)=(0, 0, 0, 0, 0, cos(t), 0, sin(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(6)=(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(7)=(0, 0, 0, 0, 0, -1*sin(t), 0, cos(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(8)=(0, 0, 0, 0, sin(2*t), 0, 0, 0, cos(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
//
// a(9)=(0, 0, 0, 0, 0, 0, 0, 0, 0, cos(3*t), 0, 0, 0, 0, 0, sin(3*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(10)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(2*t), 0, 0, 0, sin(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(11)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(t), 0, sin(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(12)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(13)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(t), 0, cos(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(14)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(2*t), 0, 0, 0, cos(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(15)=(0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(3*t), 0, 0, 0, 0, 0, cos(3*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
//
// a(16)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(4*t), 0, 0, 0, 0, 0, 0, 0, sin(4*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(17)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(3*t), 0, 0, 0, 0, 0, sin(3*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(18)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(2*t), 0, 0, 0, sin(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(19)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(t), 0, sin(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(20)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(21)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(t), 0, cos(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(22)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(2*t), 0, 0, 0, cos(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(23)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(3*t), 0, 0, 0, 0, 0, cos(3*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
// a(24)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(4*t), 0, 0, 0, 0, 0, 0, 0, cos(4*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
//
// a(25)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(5*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, sin(5*t));
// a(26)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(4*t), 0, 0, 0, 0, 0, 0, 0, sin(4*t), 0);
// a(27)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(3*t), 0, 0, 0, 0, 0, sin(3*t), 0, 0);
// a(28)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(2*t), 0, 0, 0, sin(2*t), 0, 0, 0);
// a(29)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(t), 0, sin(t), 0, 0, 0, 0);
// a(30)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0);
// a(31)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(t), 0, cos(t), 0, 0, 0, 0);
// a(32)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(2*t), 0, 0, 0, cos(2*t), 0, 0, 0);
// a(33)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(3*t), 0, 0, 0, 0, 0, cos(3*t), 0, 0);
// a(34)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(4*t), 0, 0, 0, 0, 0, 0, 0, cos(4*t), 0);
// a(35)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(5*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(5*t));
| https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_azimuth_rotator.dsp | faust | Description: This tool rotates the HOA scene around the z-axis. Driven with OSC from head-tracking, (for example with andOSC application for Android with andOSC.pd patch provided with ambitools), this tool can compensate the head rotation around z-axis when the rendering is made over headphones. See [2] for the matrix definition.
References:
[1] M. Kronlachner, “Spatial Transformations for the Alteration of Ambisonic Recordings,” Graz University Of Technology, Austria, 2014.
Inputs: (M+1)^2
Outputs: (M+1)^2
Maximum required order
Number of inputs (= number of outputs).
Slider with azimuth rotation angle
SUB-MATRIX TERM, AT EACH ORDER
diagonal terms, anti-diagonal terms, extra diagonal terms
(i,j) is on the extra-diagonal AND on the diagonal.
(i,j) is NOT on the extra-diaognal AND on the diagonal.
(i,j) is on the extra diagonal AND not on the diagonal. sinus is anti-symmetric which correspond to the anti-symetric matrix
(i,j) is NOT on the extra-diagonal AND NOT on the diagonal
test: ((i,j) is on the extra diagonal, (i,j) is on the diagonal)
MAIN-MATRIX ROW
Matrix multiplication
n = number of inputs
m = number of outputs
EXAMPLE OF A MATRIX AT ORDER 5
a(0)=(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(1)=(0, cos(t), 0, sin(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(2)=(0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(3)=(0, -1*sin(t), 0, cos(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(4)=(0, 0, 0, 0, cos(2*t), 0, 0, 0, sin(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(5)=(0, 0, 0, 0, 0, cos(t), 0, sin(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(6)=(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(7)=(0, 0, 0, 0, 0, -1*sin(t), 0, cos(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(8)=(0, 0, 0, 0, sin(2*t), 0, 0, 0, cos(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(9)=(0, 0, 0, 0, 0, 0, 0, 0, 0, cos(3*t), 0, 0, 0, 0, 0, sin(3*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(10)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(2*t), 0, 0, 0, sin(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(11)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(t), 0, sin(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(12)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(13)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(t), 0, cos(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(14)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(2*t), 0, 0, 0, cos(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(15)=(0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(3*t), 0, 0, 0, 0, 0, cos(3*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(16)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(4*t), 0, 0, 0, 0, 0, 0, 0, sin(4*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(17)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(3*t), 0, 0, 0, 0, 0, sin(3*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(18)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(2*t), 0, 0, 0, sin(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(19)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(t), 0, sin(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(20)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(21)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(t), 0, cos(t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(22)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(2*t), 0, 0, 0, cos(2*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(23)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(3*t), 0, 0, 0, 0, 0, cos(3*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(24)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(4*t), 0, 0, 0, 0, 0, 0, 0, cos(4*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
a(25)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(5*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, sin(5*t));
a(26)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(4*t), 0, 0, 0, 0, 0, 0, 0, sin(4*t), 0);
a(27)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(3*t), 0, 0, 0, 0, 0, sin(3*t), 0, 0);
a(28)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(2*t), 0, 0, 0, sin(2*t), 0, 0, 0);
a(29)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(t), 0, sin(t), 0, 0, 0, 0);
a(30)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0);
a(31)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(t), 0, cos(t), 0, 0, 0, 0);
a(32)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(2*t), 0, 0, 0, cos(2*t), 0, 0, 0);
a(33)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(3*t), 0, 0, 0, 0, 0, cos(3*t), 0, 0);
a(34)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(4*t), 0, 0, 0, 0, 0, 0, 0, cos(4*t), 0);
a(35)=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1*sin(5*t), 0, 0, 0, 0, 0, 0, 0, 0, 0, cos(5*t)); | declare name "HOA Azimuth Rotator";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2015";
import("stdfaust.lib");
import("ymn.lib");
M = 10;
rot(m,i,j) = case{
row(M,i) = par(m,M+1,
par(j,2*m+1,term
with{term = ba.if((i >= m^2) & (i< (m+1)^2),rot(m,int(i-m^2),j),0);}
)
);
matrix(n,m) = par(i,n,_) <: par(i,m,buswg(row(M,i)):>_);
process = matrix(ins,ins);
|
5651730e288e0dcd2a9a939c89bb1cbddaace098fc6df55027e7da20a4f82ea7 | rmichon/multiKeyboard | mySynth.dsp | //#################################### mySynth.dsp #######################################
// Simple Faust instruments specifically designed for `faust2smartkeyb` where 2
// parallel keyboards are used to control a simple synth based on a sawtooth
// oscillator.
//
// ## `SmartKeyboard` Use Strategy
//
// `SmartKeyboard` is used in a very simple way here simply to control the pitch
// the gain and the note-off/on events of the synth. Continuous pitch control is
// enabled and a sustain pedal can be used if a MIDI keyboard is connected to
// the device.
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with `faust2smartkeyb`. For best results,
// we recommend to use the following parameters to compile it:
//
// ```
// faust2smartkeyb [-ios/-android] -effect myEffect.dsp mySynth.dsp
// ```
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017:
// https://ccrma.stanford.edu/~rmichon
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
// 2 polyphonic keyboards of one octave in parallel
declare interface "SmartKeyboard{
'Number of Keyboards':'2',
'Rounding Mode':'2',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'72',
'Keyboard 1 - Lowest Key':'60'
}";
import("stdfaust.lib");
// parameters
f = nentry("freq",200,40,2000,0.01);
bend = nentry("bend[midi:pitchwheel]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
s = nentry("sustain[midi:ctrl 64]",0,0,1,1);
g = nentry("gain",1,0,1,0.01);
t = button("gate");
y = nentry("y",0.5,0,1,0.01);
// trigger signal is a mix of the sustain pedal and note-on/off
gate = t+s : min(1);
// freq is continuous thanks to bend
freq = f*bend;
// MIDI gain and y position of the finger on the keyboard
gain = y*g;
// exponential envelope
envelope = gate*gain : si.smoo;
// synth...
process = os.sawtooth(freq)*envelope <: _,_; | https://raw.githubusercontent.com/rmichon/multiKeyboard/7d04f591fac974a91e4b322c3cb757b8cbb50443/faust/examples/mySynth.dsp | faust | #################################### mySynth.dsp #######################################
Simple Faust instruments specifically designed for `faust2smartkeyb` where 2
parallel keyboards are used to control a simple synth based on a sawtooth
oscillator.
## `SmartKeyboard` Use Strategy
`SmartKeyboard` is used in a very simple way here simply to control the pitch
the gain and the note-off/on events of the synth. Continuous pitch control is
enabled and a sustain pedal can be used if a MIDI keyboard is connected to
the device.
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with `faust2smartkeyb`. For best results,
we recommend to use the following parameters to compile it:
```
faust2smartkeyb [-ios/-android] -effect myEffect.dsp mySynth.dsp
```
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017:
https://ccrma.stanford.edu/~rmichon
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
2 polyphonic keyboards of one octave in parallel
parameters
trigger signal is a mix of the sustain pedal and note-on/off
freq is continuous thanks to bend
MIDI gain and y position of the finger on the keyboard
exponential envelope
synth... |
declare interface "SmartKeyboard{
'Number of Keyboards':'2',
'Rounding Mode':'2',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'72',
'Keyboard 1 - Lowest Key':'60'
}";
import("stdfaust.lib");
f = nentry("freq",200,40,2000,0.01);
bend = nentry("bend[midi:pitchwheel]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
s = nentry("sustain[midi:ctrl 64]",0,0,1,1);
g = nentry("gain",1,0,1,0.01);
t = button("gate");
y = nentry("y",0.5,0,1,0.01);
gate = t+s : min(1);
freq = f*bend;
gain = y*g;
envelope = gate*gain : si.smoo;
process = os.sawtooth(freq)*envelope <: _,_; |
3a125e6ddca3f4e4d802b01cfca78f86c47fe3f3a723b9d58ac23638bab01b06 | friskgit/snares | poly_snare.dsp | // -*- compile-command: "cd .. && make jack src=src/poly_snare.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");
//---------------`Snare drum synth` --------------------------
// A snare drum synth that plays a given poly rhythm.
//
// 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
//
// 30 Juni 2018 Henrik Frisk [email protected]
//---------------------------------------------------
// GUI
posgroup(x) = vgroup("[2]position", x);
snaregroup(x) = vgroup("[0]snare", x);
polygroup(x) = vgroup("[3]poly", x);
filtergroup(x) = vgroup("[1]filter", x);
// Set the number of channels at compile time.
//channels = posgroup(hslider("channels", 2, 1, 64, 1));
channels = 2;
steps = 16;
integ(x) = x - ma.frac(x);
tmp = snaregroup(hslider("tempo", 300, 50, 10000, 1)) : si.bsmooth;
imp = ba.pulse(tmp);
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));
// Nominator beat
env = en.ar(attack, rel, p) * amp
with {
p = imp : ba.resetCtr(nom, 1);
nom = polygroup(hslider("nominator", 1, 1, steps, 1));
amp = polygroup(hslider("vol a", 0.5, 0, 1, 0.0001));
};
// Denominator beat
envb = en.ar(attack, rel, p) * amp
with {
// p = imp : ba.resetCtr(steps / div, 1);
p = imp : ba.resetCtr(denom, 1);
denom = polygroup(hslider("denominator", 1, 1, steps, 1));
amp = polygroup(hslider("vol b", 0.5, 0, 1, 0.0001));
};
// Control the output channel
// Define 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 = rndctrl : ba.sAndH(imp);
// Wrap channels around the array.
ch_wrapped = ma.modulo(outputctrl, channels);
// Noise generation and filter
n = no.multinoise(8) : par(i, 8, _ * env * 0.1 * (gate : si.smooth(0.1)));
m = no.multinoise(8) : par(i, 8, _ * envb * 0.1 * (gate : si.smooth(0.1)));
filt = fi.resonbp(frq, q, gain)
with {
frq = filtergroup(hslider("[0]freq", 200, 50, 5000, 0.1));
q = filtergroup(hslider("[1]q", 1, 0.01, 10, 0.01));
gain = filtergroup(hslider("[2]gain", 0, 0, 2, 0.00001));
};
// Main gate
gate = button("play");
process = n,m : par(i, 8, filt), par(i, 8, filt) :> _,_ :> ba.selectoutn(channels, ch_wrapped);
| https://raw.githubusercontent.com/friskgit/snares/bb43ea5e706a0ead6d65dd176a5c492b2f5d8f74/faust/snare/src/poly_snare.dsp | faust | -*- compile-command: "cd .. && make jack src=src/poly_snare.dsp && cd -"; -*-&& cd -"; -*-
---------------`Snare drum synth` --------------------------
A snare drum synth that plays a given poly rhythm.
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
30 Juni 2018 Henrik Frisk [email protected]
---------------------------------------------------
GUI
Set the number of channels at compile time.
channels = posgroup(hslider("channels", 2, 1, 64, 1));
Nominator beat
Denominator beat
p = imp : ba.resetCtr(steps / div, 1);
Control the output channel
Define the output channel
Wrap channels around the array.
Noise generation and filter
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("[2]position", x);
snaregroup(x) = vgroup("[0]snare", x);
polygroup(x) = vgroup("[3]poly", x);
filtergroup(x) = vgroup("[1]filter", x);
channels = 2;
steps = 16;
integ(x) = x - ma.frac(x);
tmp = snaregroup(hslider("tempo", 300, 50, 10000, 1)) : si.bsmooth;
imp = ba.pulse(tmp);
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));
env = en.ar(attack, rel, p) * amp
with {
p = imp : ba.resetCtr(nom, 1);
nom = polygroup(hslider("nominator", 1, 1, steps, 1));
amp = polygroup(hslider("vol a", 0.5, 0, 1, 0.0001));
};
envb = en.ar(attack, rel, p) * amp
with {
p = imp : ba.resetCtr(denom, 1);
denom = polygroup(hslider("denominator", 1, 1, steps, 1));
amp = polygroup(hslider("vol b", 0.5, 0, 1, 0.0001));
};
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 = rndctrl : ba.sAndH(imp);
ch_wrapped = ma.modulo(outputctrl, channels);
n = no.multinoise(8) : par(i, 8, _ * env * 0.1 * (gate : si.smooth(0.1)));
m = no.multinoise(8) : par(i, 8, _ * envb * 0.1 * (gate : si.smooth(0.1)));
filt = fi.resonbp(frq, q, gain)
with {
frq = filtergroup(hslider("[0]freq", 200, 50, 5000, 0.1));
q = filtergroup(hslider("[1]q", 1, 0.01, 10, 0.01));
gain = filtergroup(hslider("[2]gain", 0, 0, 2, 0.00001));
};
gate = button("play");
process = n,m : par(i, 8, filt), par(i, 8, filt) :> _,_ :> ba.selectoutn(channels, ch_wrapped);
|
4445b6f61ff0dd7314bb0a45955f127ac53fa554b803aa609eff3d55eb1560c6 | alexcoy257/lr-mixhost | faustTest.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;
};
group_gain = *(vslider("[0] Group Gain [unit:dB]",0, -96, 10, 0.1) : ba.db2linear);
process = _ : compressor_demo : group_gain :_;
| https://raw.githubusercontent.com/alexcoy257/lr-mixhost/0e19114381443f57aff6feacdd2867f688573536/faustTest.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;
};
group_gain = *(vslider("[0] Group Gain [unit:dB]",0, -96, 10, 0.1) : ba.db2linear);
process = _ : compressor_demo : group_gain :_;
|
d564b525382d2225dc1770cd3551fc03b6043e2719a685644a37762de0f8dba1 | gabrielsanchez/faust-guitarix-sc37 | multifilter.dsp | declare id "MultiBandFilter";
declare version "1.0";
declare author "Grame";
declare license "BSD";
declare copyright "(c)GRAME 2006";
import("stdfaust.lib");
import("guitarix.lib");
//------------------------- Process --------------------------------
process = ifilter(vslider("Q31_25", 50, 1, 100, 1), 31.25, vslider("f31_25[tooltip:gain (dB) at 31.25 Hz]", 0, -50, 10, 0.1))
: ifilter(vslider("Q62_5", 50, 1, 100, 1), 62.5, vslider("f62_5 [tooltip:gain (dB) at 62.5 Hz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q125", 50, 1, 100, 1), 125, vslider("f125 [tooltip:gain (dB) at 125 Hz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q250", 50, 1, 100, 1), 250, vslider("f250 [tooltip:gain (dB) at 250 Hz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q500", 50, 1, 100, 1), 500, vslider("f500 [tooltip:gain (dB) at 500 Hz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q1k", 50, 1, 100, 1), 1000, vslider("f1k [tooltip:gain (dB) at 1 kHz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q2k", 50, 1, 100, 1), 2000, vslider("f2k [tooltip:gain (dB) at 2 kHz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q4k", 50, 1, 100, 1), 4000, vslider("f4k [tooltip:gain (dB) at 4 kHz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q8k", 50, 1, 100, 1), 8000, vslider("f8k [tooltip:gain (dB) at 8 kHz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q16k", 50, 1, 100, 1),16000, vslider("f16k [tooltip:gain (dB) at 16 kHz] ", 0, -50, 10, 0.1))
;
| https://raw.githubusercontent.com/gabrielsanchez/faust-guitarix-sc37/c0608695e24870abb56f7f0d1355cbf2f563ed30/Faust/multifilter.dsp | faust | ------------------------- Process -------------------------------- | declare id "MultiBandFilter";
declare version "1.0";
declare author "Grame";
declare license "BSD";
declare copyright "(c)GRAME 2006";
import("stdfaust.lib");
import("guitarix.lib");
process = ifilter(vslider("Q31_25", 50, 1, 100, 1), 31.25, vslider("f31_25[tooltip:gain (dB) at 31.25 Hz]", 0, -50, 10, 0.1))
: ifilter(vslider("Q62_5", 50, 1, 100, 1), 62.5, vslider("f62_5 [tooltip:gain (dB) at 62.5 Hz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q125", 50, 1, 100, 1), 125, vslider("f125 [tooltip:gain (dB) at 125 Hz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q250", 50, 1, 100, 1), 250, vslider("f250 [tooltip:gain (dB) at 250 Hz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q500", 50, 1, 100, 1), 500, vslider("f500 [tooltip:gain (dB) at 500 Hz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q1k", 50, 1, 100, 1), 1000, vslider("f1k [tooltip:gain (dB) at 1 kHz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q2k", 50, 1, 100, 1), 2000, vslider("f2k [tooltip:gain (dB) at 2 kHz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q4k", 50, 1, 100, 1), 4000, vslider("f4k [tooltip:gain (dB) at 4 kHz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q8k", 50, 1, 100, 1), 8000, vslider("f8k [tooltip:gain (dB) at 8 kHz] ", 0, -50, 10, 0.1))
: ifilter(vslider("Q16k", 50, 1, 100, 1),16000, vslider("f16k [tooltip:gain (dB) at 16 kHz] ", 0, -50, 10, 0.1))
;
|
5929f36d59dafc6fa738c64aabf920bef2ff8510e02e83114872a6064c8853db | amstramgrame/amstramgrame | exfaust9.dsp |
declare name "Wah Synthesizer";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
import("stdfaust.lib");
on_click(x) = 0, 1 : select2( x > x');
/*
Impulsion with a specified duration. Can be retriggered.
*/
mpulse(smps_dur, trig) = pulsation
with {
count = ba.countdown(smps_dur, trig);
pulsation = 0, 1 : select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
trig = button("trig[switch:1]");
noise_amount = hslider("noise[acc: 0 0 -10 0 10]", 0, 0, 300, 1);
freq = hslider("freq[acc: 1 0 -10 0 10]", 80, 70, 250, 1)
: +(nz)
: ba.sAndH( on_click(trig) + os.impulse);
amp = hslider("amp", 0.8, 0, 1, 0.01) : si.smoo;
MAX_ECHO = 0.5;
echo_dur = hslider("dur[acc: 2 0 -10 0 10]", 0.1, 0.1, MAX_ECHO, 0.01)
: ba.sAndH(on_click(trig) + os.impulse);
nz = no.noise
: abs
: *(noise_amount);
sig_gen(n) = os.sawtooth(freq * n);
N_OSC = 4;
sig = sum(n, N_OSC, sig_gen(n + 1)) / N_OSC;
ATQ = 0.05;
env = trig
: mpulse_dur(ATQ)
: en.adsre(ATQ, 0.1, 0.3, 0.4);
echo(mix, sig) = sig : ef.echo(2, echo_dur, 0.55)
: _*mix + (1-mix) * sig;
process = sig * env
: ve.crybaby(env)
: ef.echo(MAX_ECHO, echo_dur, 0.55) : *(amp);
| https://raw.githubusercontent.com/amstramgrame/amstramgrame/4df99bfbae994fc9dcb4012190335e29255b411e/web/mkdocs/docs/gramophone/programs/exfaust9/exfaust9.dsp | faust |
Impulsion with a specified duration. Can be retriggered.
|
declare name "Wah Synthesizer";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
import("stdfaust.lib");
on_click(x) = 0, 1 : select2( x > x');
mpulse(smps_dur, trig) = pulsation
with {
count = ba.countdown(smps_dur, trig);
pulsation = 0, 1 : select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
trig = button("trig[switch:1]");
noise_amount = hslider("noise[acc: 0 0 -10 0 10]", 0, 0, 300, 1);
freq = hslider("freq[acc: 1 0 -10 0 10]", 80, 70, 250, 1)
: +(nz)
: ba.sAndH( on_click(trig) + os.impulse);
amp = hslider("amp", 0.8, 0, 1, 0.01) : si.smoo;
MAX_ECHO = 0.5;
echo_dur = hslider("dur[acc: 2 0 -10 0 10]", 0.1, 0.1, MAX_ECHO, 0.01)
: ba.sAndH(on_click(trig) + os.impulse);
nz = no.noise
: abs
: *(noise_amount);
sig_gen(n) = os.sawtooth(freq * n);
N_OSC = 4;
sig = sum(n, N_OSC, sig_gen(n + 1)) / N_OSC;
ATQ = 0.05;
env = trig
: mpulse_dur(ATQ)
: en.adsre(ATQ, 0.1, 0.3, 0.4);
echo(mix, sig) = sig : ef.echo(2, echo_dur, 0.55)
: _*mix + (1-mix) * sig;
process = sig * env
: ve.crybaby(env)
: ef.echo(MAX_ECHO, echo_dur, 0.55) : *(amp);
|
b3d8fbd02d357db75a30f8b709b5829b7fe75db39a392ecb07fc9fcc5d3d1c6b | romain-pattyn/FAUST-FrequencyResponseTracer | frequency_response_tracer.dsp | declare filename "frequency_response_tracer.dsp";
declare name "frequency_response_tracer";
declare author "Romain Pattyn";
declare version "1.00";
declare license "BSD";
import("stdfaust.lib");
//--------------------`frequencyResponse`----------------
// Produces data representing the frequency response of a filter.
//
// #### Usage
//
// ```
// _ : frequencyResponse(filter) : _
// ```
// Where:
//
// * `filter`: A function having one input signal and one output signal ( _ : filter : _ )
//
// How it works :
//
// It is a direct application of the what the frequency response represents.
// Signals of increasing frequencies are passed through the filter.
// The RMS of the filtered signal is divided by the RMS of the initial signal so as to obtain the gain ratio for each frequency.
// Because the data is average by evaluating the result over a sliding window, there will be a delay of 200 samples in the output.
// This is why in the python script, the graph starts at the 200th sample.
//-------------------------------------------------------------------------
frequencyResponse(filter) = ratio : ba.slidingMeanp(200, 256)
with{
fmin = 0;
fmax = ma.SR;
time = 1;
// li := Function generating increasing numbers between fmin and fmax in time*SR samples.
// Ther function is used in its general form with the two cases : f1>f2 and f1<f2.
// Eventough in our case it could be simplified since we know that f1<f2.
li(f1, f2, time) = (line<:_,_*(-1):select2(f1>f2)+f1),f1:select2(f1==f2)
with{
step = abs(f2-f1)/(time*ma.SR);
line = _~+(step):%(abs(f2-f1));
};
ratio = os.osc(li(fmin, fmax, time)) <: (filter : ba.slidingRMSp(20, 32)), ba.slidingRMSp(20, 32) : /;
};
//--------------------`Example of Use`----------------
//
// The frequency response tracer is applied to various filters available in the FAUST library.
//
//-------------------------------------------------------------------------------------------
// High shelf with bit of resonance in the low frequencies
highShelf(f) = fi.highshelf(5, -6, f);
// Simple peakEQ
peakEQ(f) = fi.peak_eq(2, f, 500);
// Also in highpass an bandpass: resonhp and resonbp (Remark : the bandpass version is like a peakEQ with the gain at zero for ther frequencies that the one wanted. So it's not possible to actually produce a band between two frequencies. See fi.bandpass)
resonanceLowPass(f) = fi.resonlp(f, 1, 1);
lowPassSimple(f) = fi.lowpass(5, f); // A little bit more vertical than lowpass3e but the frequency parameter isn't at the top of the curve, it is at -3dB.
lowPassAdvanced(f) = fi.lowpass6e(f); // Also highpass : highpass6e (Both available in 3th order which make the cut less vertical)
// Also available in bandstop
butterworthBandpass(nH, fl, fu) = fi.bandpass(nH, fl, fu); // Increasing nH makes the cut more vertical.
ellipticBandPass(fl, fu) = fi.bandpass12e(fl, fu);
process = frequencyResponse(highShelf(1000)),
frequencyResponse(peakEQ(2000)),
frequencyResponse(resonanceLowPass(3000)),
frequencyResponse(lowPassSimple(6000)),
frequencyResponse(lowPassAdvanced(7500)),
frequencyResponse(butterworthBandpass(2, 10000, 13000)),
frequencyResponse(butterworthBandpass(6, 10000, 13000)),
frequencyResponse(ellipticBandPass(10000, 13000));
| https://raw.githubusercontent.com/romain-pattyn/FAUST-FrequencyResponseTracer/2c8d249c1a697e54c4a93d5e14b105c7492ef4ff/frequency_response_tracer.dsp | faust | --------------------`frequencyResponse`----------------
Produces data representing the frequency response of a filter.
#### Usage
```
_ : frequencyResponse(filter) : _
```
Where:
* `filter`: A function having one input signal and one output signal ( _ : filter : _ )
How it works :
It is a direct application of the what the frequency response represents.
Signals of increasing frequencies are passed through the filter.
The RMS of the filtered signal is divided by the RMS of the initial signal so as to obtain the gain ratio for each frequency.
Because the data is average by evaluating the result over a sliding window, there will be a delay of 200 samples in the output.
This is why in the python script, the graph starts at the 200th sample.
-------------------------------------------------------------------------
li := Function generating increasing numbers between fmin and fmax in time*SR samples.
Ther function is used in its general form with the two cases : f1>f2 and f1<f2.
Eventough in our case it could be simplified since we know that f1<f2.
--------------------`Example of Use`----------------
The frequency response tracer is applied to various filters available in the FAUST library.
-------------------------------------------------------------------------------------------
High shelf with bit of resonance in the low frequencies
Simple peakEQ
Also in highpass an bandpass: resonhp and resonbp (Remark : the bandpass version is like a peakEQ with the gain at zero for ther frequencies that the one wanted. So it's not possible to actually produce a band between two frequencies. See fi.bandpass)
A little bit more vertical than lowpass3e but the frequency parameter isn't at the top of the curve, it is at -3dB.
Also highpass : highpass6e (Both available in 3th order which make the cut less vertical)
Also available in bandstop
Increasing nH makes the cut more vertical. | declare filename "frequency_response_tracer.dsp";
declare name "frequency_response_tracer";
declare author "Romain Pattyn";
declare version "1.00";
declare license "BSD";
import("stdfaust.lib");
frequencyResponse(filter) = ratio : ba.slidingMeanp(200, 256)
with{
fmin = 0;
fmax = ma.SR;
time = 1;
li(f1, f2, time) = (line<:_,_*(-1):select2(f1>f2)+f1),f1:select2(f1==f2)
with{
step = abs(f2-f1)/(time*ma.SR);
line = _~+(step):%(abs(f2-f1));
};
ratio = os.osc(li(fmin, fmax, time)) <: (filter : ba.slidingRMSp(20, 32)), ba.slidingRMSp(20, 32) : /;
};
highShelf(f) = fi.highshelf(5, -6, f);
peakEQ(f) = fi.peak_eq(2, f, 500);
resonanceLowPass(f) = fi.resonlp(f, 1, 1);
ellipticBandPass(fl, fu) = fi.bandpass12e(fl, fu);
process = frequencyResponse(highShelf(1000)),
frequencyResponse(peakEQ(2000)),
frequencyResponse(resonanceLowPass(3000)),
frequencyResponse(lowPassSimple(6000)),
frequencyResponse(lowPassAdvanced(7500)),
frequencyResponse(butterworthBandpass(2, 10000, 13000)),
frequencyResponse(butterworthBandpass(6, 10000, 13000)),
frequencyResponse(ellipticBandPass(10000, 13000));
|
10f9330a123e01a4ed22ec95f93b468e3c26b4d408ba97740ea4493a1475acb9 | CesarChaussinand/GramoCollection | harmoniesDereglees.dsp | declare name "Harmonies déréglées";
declare version "1.0";
declare author "César Chaussinand";
declare license "MIT";
declare copyright "(c) César Chaussinand 2022";
import("stdfaust.lib");
process = par(i,4,os.osc(noteSelector(selAccord,i))+os.osc(noteSelector(selAccord,i)*2)):>_/4:effet*gate:ef.cubicnl(drive,0);
noteSelector(accord,note) = 54,57,61,68,
51,54,59,63,
51,56,63,64 :
ba.selectn(12,int(accord*4)+int(note)):ba.midikey2hz;
effet = _*lfo<:_*ringMod*depth,_*(1-depth):>_*(1+depth)/2;
lfo = os.sawtooth(4):fi.lowpass3e(100)*depth+(1-depth);
ringMod = os.osc(depth*200+100);
selAccord = nentry("accord[acc:0 0 -9 0 9]",1,0,2,1);
depth = hslider("lfo[acc:1 0 -9 0 9]",0.5,0,1,0.01);
gate = button("gate[switch:1]"):en.asr(0.2,1,0.2);
drive = hslider("drive[knob:2]",0,-0.2,0.2,0.01);
| https://raw.githubusercontent.com/CesarChaussinand/GramoCollection/58f63f2fdb1fe4d01b4e0416d3a0c14639a347f2/harmoniesDereglees.dsp | faust | declare name "Harmonies déréglées";
declare version "1.0";
declare author "César Chaussinand";
declare license "MIT";
declare copyright "(c) César Chaussinand 2022";
import("stdfaust.lib");
process = par(i,4,os.osc(noteSelector(selAccord,i))+os.osc(noteSelector(selAccord,i)*2)):>_/4:effet*gate:ef.cubicnl(drive,0);
noteSelector(accord,note) = 54,57,61,68,
51,54,59,63,
51,56,63,64 :
ba.selectn(12,int(accord*4)+int(note)):ba.midikey2hz;
effet = _*lfo<:_*ringMod*depth,_*(1-depth):>_*(1+depth)/2;
lfo = os.sawtooth(4):fi.lowpass3e(100)*depth+(1-depth);
ringMod = os.osc(depth*200+100);
selAccord = nentry("accord[acc:0 0 -9 0 9]",1,0,2,1);
depth = hslider("lfo[acc:1 0 -9 0 9]",0.5,0,1,0.01);
gate = button("gate[switch:1]"):en.asr(0.2,1,0.2);
drive = hslider("drive[knob:2]",0,-0.2,0.2,0.01);
|
|
e1c42db4f5d9435cf33790516d9899d338d927805ef27e70a22d9d06eb2ad772 | tomara-x/magi | twinrotorgirl.dsp | //trans rights
declare name "twinrotorgirl";
declare author "amy universe";
declare version "0.10";
declare license "WTFPL";
import("stdfaust.lib");
bi2uni = _ : +(1) : /(2) : _;
N = 16; //max overlap
noise(i) = no.multinoise(N*3) : ba.selector(i,N*3);
/*
trigs = par(i,N, ba.beat(frq(i)*60) * (i<cnt) )
with {
frq(x) = f + fr * (noise(x) : ba.downSample(nr) : fi.svf.lp(nf,1))
with {
f = vslider("v:[0]freq/[0]frq [style:knob]",10,0.1,1000,0.001);
fr = vslider("v:[0]freq/[1]frq rnd [style:knob]",0,0,100,0.01);
nr = vslider("v:[0]freq/[2]noise rate [style:knob]",10,0.1,100,0.01);
nf = vslider("v:[0]freq/[3]noise filter [style:knob]",10,0.1,100,0.01);
};
};
*/
cnt = vslider("v:[0]main/[2]overlap [style:knob]",N,1,N,1);
trigs = ba.beat(f) : ba.cycle(N) : par(i,N,*(i<cnt))
with {
f = vslider("v:[0]main/[0]frq [style:knob]",10,0.1,1000,0.001) * 60;
};
gates = par(i,N,ba.peakholder(t(i)) : en.asr(ba.samp2sec(t(i))*env, 1, ba.samp2sec(t(i))*env))
with {
t(x) = ba.sec2samp(l + lr * (noise(x+N) : ba.downSample(nr) : ba.sAndH(trigs : ba.selector(x,N)) :
fi.svf.lp(nf,1)) : max(0))
with {
l = vslider("v:[1]gate/[0]length [style:knob]",0.001,0.001,4,0.001);
lr = vslider("v:[1]gate/[2]len rnd [style:knob]",0,0,2,0.01);
nr = vslider("v:[1]gate/[3]noise rate [style:knob]",10,0.1,100,0.01);
nf = vslider("v:[1]gate/[4]noise filter [style:knob]",10,0.1,100,0.01);
};
env = vslider("v:[0]main/[3]env [style:knob]",0.25,0,0.5,0.001);
};
f(x) = trigs : gates : par(i,N,*(x@del(i)) : sp.panner(pan(i)))
with {
del(x) = ba.sec2samp(d(x) + dr * (noise(x+2*N) : ba.downSample(nr) :
ba.sAndH(trigs : ba.selector(x,N)) : fi.svf.lp(nf,1) : min(1) : max(0)))
with {
d(x) = vslider("v:[2]delay/[0]shift [style:knob]",0.1,0,1,0.001) * x;
dr = vslider("v:[2]delay/[1]del rnd [style:knob]",0,0,1,0.001);
nr = vslider("v:[2]delay/[2]noise rate [style:knob]",10,0.1,100,0.01);
nf = vslider("v:[2]delay/[3]noise filter [style:knob]",10,0.1,100,0.01);
};
pan(x) = s * noise(x) : ba.downSample(s*50+1) : fi.svf.lp(s*50+1,1) : ba.sAndH(trigs : ba.selector(x,N)) : bi2uni
with {
s = vslider("v:[0]main/[1]pan [style:knob]",0,0,1,0.001);
};
};
gain = ba.db2linear(vslider("v:[3]out/[0]gain",-6,-69,3,1));
process = hgroup("twinrotorgirl",(f :> _*gain,_*gain),(f :> _*gain,_*gain) :> _,_);
//grayhole
| https://raw.githubusercontent.com/tomara-x/magi/0915a940f4c515e779533ae8cd7a8546654b9ab8/effect/twinrotorgirl.dsp | faust | trans rights
max overlap
trigs = par(i,N, ba.beat(frq(i)*60) * (i<cnt) )
with {
frq(x) = f + fr * (noise(x) : ba.downSample(nr) : fi.svf.lp(nf,1))
with {
f = vslider("v:[0]freq/[0]frq [style:knob]",10,0.1,1000,0.001);
fr = vslider("v:[0]freq/[1]frq rnd [style:knob]",0,0,100,0.01);
nr = vslider("v:[0]freq/[2]noise rate [style:knob]",10,0.1,100,0.01);
nf = vslider("v:[0]freq/[3]noise filter [style:knob]",10,0.1,100,0.01);
};
};
grayhole |
declare name "twinrotorgirl";
declare author "amy universe";
declare version "0.10";
declare license "WTFPL";
import("stdfaust.lib");
bi2uni = _ : +(1) : /(2) : _;
noise(i) = no.multinoise(N*3) : ba.selector(i,N*3);
cnt = vslider("v:[0]main/[2]overlap [style:knob]",N,1,N,1);
trigs = ba.beat(f) : ba.cycle(N) : par(i,N,*(i<cnt))
with {
f = vslider("v:[0]main/[0]frq [style:knob]",10,0.1,1000,0.001) * 60;
};
gates = par(i,N,ba.peakholder(t(i)) : en.asr(ba.samp2sec(t(i))*env, 1, ba.samp2sec(t(i))*env))
with {
t(x) = ba.sec2samp(l + lr * (noise(x+N) : ba.downSample(nr) : ba.sAndH(trigs : ba.selector(x,N)) :
fi.svf.lp(nf,1)) : max(0))
with {
l = vslider("v:[1]gate/[0]length [style:knob]",0.001,0.001,4,0.001);
lr = vslider("v:[1]gate/[2]len rnd [style:knob]",0,0,2,0.01);
nr = vslider("v:[1]gate/[3]noise rate [style:knob]",10,0.1,100,0.01);
nf = vslider("v:[1]gate/[4]noise filter [style:knob]",10,0.1,100,0.01);
};
env = vslider("v:[0]main/[3]env [style:knob]",0.25,0,0.5,0.001);
};
f(x) = trigs : gates : par(i,N,*(x@del(i)) : sp.panner(pan(i)))
with {
del(x) = ba.sec2samp(d(x) + dr * (noise(x+2*N) : ba.downSample(nr) :
ba.sAndH(trigs : ba.selector(x,N)) : fi.svf.lp(nf,1) : min(1) : max(0)))
with {
d(x) = vslider("v:[2]delay/[0]shift [style:knob]",0.1,0,1,0.001) * x;
dr = vslider("v:[2]delay/[1]del rnd [style:knob]",0,0,1,0.001);
nr = vslider("v:[2]delay/[2]noise rate [style:knob]",10,0.1,100,0.01);
nf = vslider("v:[2]delay/[3]noise filter [style:knob]",10,0.1,100,0.01);
};
pan(x) = s * noise(x) : ba.downSample(s*50+1) : fi.svf.lp(s*50+1,1) : ba.sAndH(trigs : ba.selector(x,N)) : bi2uni
with {
s = vslider("v:[0]main/[1]pan [style:knob]",0,0,1,0.001);
};
};
gain = ba.db2linear(vslider("v:[3]out/[0]gain",-6,-69,3,1));
process = hgroup("twinrotorgirl",(f :> _*gain,_*gain),(f :> _*gain,_*gain) :> _,_);
|
5ec5168baa555b7d3fd5cd9d2263ebb982dc89e8382d5f50b9e562e223b3557b | RuolunWeng/faust2smartphone | soloDemo2.dsp | declare name "SoloDemo2";
declare version "2.0";
declare author "Grame";
process = rainGen :>_,_ ;
// declare connection UI
volume = hslider("volume[motion:brasG_front]",0,0,1,0.01);
param = hslider("param[motion:brasG_front]",0,0,1,0.01);
//----------------------`rain`--------------------------
// A very simple rain simulator
//
// #### Usage
//
// ```
// rain(d,l) : _,_
// ```
//
// Where:
//
// * `d`: is the density of the rain: between 0 and 1
// * `l`: is the level (volume) of the rain: between 0 and 1
//
//----------------------------------------------------------
import("stdfaust.lib");
rain(density,level) = no.multinoise(2) : par(i, 2, drop) : par(i, 2, *(level))
with {
drop = _ <: @(1), (abs < density) : *;
};
rainGen = rain (
param,
volume
//hslider("v:rain/density", 300, 0, 1000, 1) / 1000,
//hslider("v:rain/volume", 0.5, 0, 1, 0.01)
);
| https://raw.githubusercontent.com/RuolunWeng/faust2smartphone/78f502aeb42af3d8fa48b0cbfef01d3b267dc038/examples/2_Motion_Mode/soloDemo2.dsp | faust | declare connection UI
----------------------`rain`--------------------------
A very simple rain simulator
#### Usage
```
rain(d,l) : _,_
```
Where:
* `d`: is the density of the rain: between 0 and 1
* `l`: is the level (volume) of the rain: between 0 and 1
----------------------------------------------------------
hslider("v:rain/density", 300, 0, 1000, 1) / 1000,
hslider("v:rain/volume", 0.5, 0, 1, 0.01) | declare name "SoloDemo2";
declare version "2.0";
declare author "Grame";
process = rainGen :>_,_ ;
volume = hslider("volume[motion:brasG_front]",0,0,1,0.01);
param = hslider("param[motion:brasG_front]",0,0,1,0.01);
import("stdfaust.lib");
rain(density,level) = no.multinoise(2) : par(i, 2, drop) : par(i, 2, *(level))
with {
drop = _ <: @(1), (abs < density) : *;
};
rainGen = rain (
param,
volume
);
|
f4cbe46663054cdd5eda8ce4186027243e0713fcdce415bbf87110c31c47a1cc | rmichon/multiKeyboard | multiSynth.dsp | //################################### multiSynth.dsp ######################################
// Faust instrument specifically designed for `faust2smartkeyb` where 4 keyboards
// are used to control 4 independent synths.
//
// ## `SmartKeyboard` Use Strategy
//
// The `SmartKeyboard` configuration is relatively simple for this example and
// only consists in four polyphonic keyboards in parallel. The `keyboard` standard
// parameter is used to activate specific elements of the synthesizer.
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with `faust2smartkeyb`. For best results,
// we recommend to use the following parameters to compile it:
//
// ```
// faust2smartkeyb [-ios/-android] -effect reverb.dsp multiSynth.dsp
// ```
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
// Interface with 4 polyphnic keyboards of 13 keys with the same config
declare interface "SmartKeyboard{
'Number of Keyboards':'4',
'Rounding Mode':'2',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'60',
'Keyboard 1 - Lowest Key':'60',
'Keyboard 2 - Lowest Key':'60',
'Keyboard 3 - Lowest Key':'60'
}";
import("stdfaust.lib");
// standard parameters
f = hslider("freq",300,50,2000,0.01);
bend = hslider("bend[midi:pitchwheel]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
s = hslider("sustain[midi:ctrl 64]",0,0,1,1); // for sustain pedal
t = button("gate");
y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo;
keyboard = hslider("keyboard",0,0,3,1) : int;
// fomating parameters
gate = t+s : min(1);
freq = f*bend;
cutoff = y*4000+50;
// oscillators
oscilators(0) = os.sawtooth(freq);
oscilators(1) = os.triangle(freq);
oscilators(2) = os.square(freq);
oscilators(3) = os.osc(freq);
// oscs are selected in function of the current keyboard
synths = par(i,4,select2(keyboard == i,0,oscilators(i))) :> fi.lowpass(3,cutoff) : *(envelope)
with{
envelope = gate*gain : si.smoo;
};
process = synths <: _,_; | https://raw.githubusercontent.com/rmichon/multiKeyboard/7d04f591fac974a91e4b322c3cb757b8cbb50443/faust/examples/multiSynth.dsp | faust | ################################### multiSynth.dsp ######################################
Faust instrument specifically designed for `faust2smartkeyb` where 4 keyboards
are used to control 4 independent synths.
## `SmartKeyboard` Use Strategy
The `SmartKeyboard` configuration is relatively simple for this example and
only consists in four polyphonic keyboards in parallel. The `keyboard` standard
parameter is used to activate specific elements of the synthesizer.
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with `faust2smartkeyb`. For best results,
we recommend to use the following parameters to compile it:
```
faust2smartkeyb [-ios/-android] -effect reverb.dsp multiSynth.dsp
```
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
Interface with 4 polyphnic keyboards of 13 keys with the same config
standard parameters
for sustain pedal
fomating parameters
oscillators
oscs are selected in function of the current keyboard |
declare interface "SmartKeyboard{
'Number of Keyboards':'4',
'Rounding Mode':'2',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'60',
'Keyboard 1 - Lowest Key':'60',
'Keyboard 2 - Lowest Key':'60',
'Keyboard 3 - Lowest Key':'60'
}";
import("stdfaust.lib");
f = hslider("freq",300,50,2000,0.01);
bend = hslider("bend[midi:pitchwheel]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
t = button("gate");
y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo;
keyboard = hslider("keyboard",0,0,3,1) : int;
gate = t+s : min(1);
freq = f*bend;
cutoff = y*4000+50;
oscilators(0) = os.sawtooth(freq);
oscilators(1) = os.triangle(freq);
oscilators(2) = os.square(freq);
oscilators(3) = os.osc(freq);
synths = par(i,4,select2(keyboard == i,0,oscilators(i))) :> fi.lowpass(3,cutoff) : *(envelope)
with{
envelope = gate*gain : si.smoo;
};
process = synths <: _,_; |
f3b42a276ab9bcd5d3b96dd86160ad96f02b40430812e4031b160eab16e828b5 | olegkapitonov/KPP-VST3 | kpp_bluedream.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 booster/overdrive pedal emulator with equalizer.
* When the _voice_ knob is in the left position the pedal works as a booster
* When the _voice_ knob is in the right position the pedal works as a "tube screamer"
*
* Process chain:
*
* input->pre_filter->*drive_knob->overdrive->equalizer->post-filter->*volume_knob->output
* ->---voice---> ->---voice---->
*
*
* pre-filter - highpass, 1 order, 720 Hz. Bypassed when _voice_ is in right position.
* overdrive - nonlinear element, emulation of the push-pull tube amplifier.
* equalizer - tonestack, bass-middle-treble.
* post-filter - lowpass, 1 order, 720 Hz. Bypassed when _voice_ is in right position.
*/
declare name "kpp_bluedream";
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");
drive = vslider("drive",63,0,100,0.01);
volume = vslider("volume",0.5,0,1,0.001);
voice = vslider("voice",0.5,0,1,0.001);
tonestack_low = vslider("bass",0,-15,15,0.1);
tonestack_middle = vslider("middle",0,-15,15,0.1);
tonestack_high = vslider("treble",0,-15,15,0.1);
tonestack_low_freq = 70;
tonestack_middle_freq = 500;
tonestack_high_freq = 10000;
tonestack_low_band = 200;
tonestack_middle_band = 700;
tonestack_high_band = 18000;
clamp = min(2.0) : max(-2.0);
// Bias of each half-wave so that they better match
bias = 0.2;
// Distortion threshold, if the signal is bigger
// it starts to get distorted
Upor = 0.2;
// Softness of distortion
Kreg = 1.0;
tube(Kreg,Upor,bias,cut) = main : +(bias) : max(cut) with {
Ks(x) = 1/(max((x-Upor)*(Kreg),0)+1);
Ksplus(x) = Upor - x*Upor;
main(Uin) = (Uin * Ks(Uin) + Ksplus(Ks(Uin)));
};
/*--------Processing chain-----------------*/
// Used 2 tubes - for positive and negative half-waves (push-pull).
// Stereo input and output, but during processing the signal is
// converted to mono.
pre_filter = _ <: fi.highpass(1, 720) * min((1 - voice + 0.75 * drive / 100), 1),
*(max((voice - 0.75 * drive / 100), 0)) : + ;
post_filter = _ <: fi.lowpass(1, 720) * min((1 - voice + 0.75 * drive / 100), 1),
*(max((voice - 0.75 * drive / 100), 0)) : + ;
stage_stomp = pre_filter : fi.lowpass(1,9000) : _<:
_,*(-1.0) : tube(Kreg,Upor,bias,0), tube(Kreg,Upor,bias,0) : - :
*(ba.db2linear(volume * 50.0 * (1 - voice * 0.25) ) / 100.0) :
fi.peak_eq(tonestack_low,tonestack_low_freq,tonestack_low_band) :
fi.peak_eq(tonestack_middle,tonestack_middle_freq,tonestack_middle_band) :
fi.peak_eq(tonestack_high,tonestack_high_freq,tonestack_high_band) :
clamp :
post_filter ;
stomp = fi.dcblocker : clamp : *(ba.db2linear(drive * 0.4 * (1 - voice * 0.5))-1) :
stage_stomp : fi.dcblocker;
output = _,_ : + : ba.bypass1(bypass, stomp) <: _,_;
};
| https://raw.githubusercontent.com/olegkapitonov/KPP-VST3/91af48938c94d5a72009e01ef139bc3de8cf8dcd/kpp_bluedream/include/kpp_bluedream.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 booster/overdrive pedal emulator with equalizer.
* When the _voice_ knob is in the left position the pedal works as a booster
* When the _voice_ knob is in the right position the pedal works as a "tube screamer"
*
* Process chain:
*
* input->pre_filter->*drive_knob->overdrive->equalizer->post-filter->*volume_knob->output
* ->---voice---> ->---voice---->
*
*
* pre-filter - highpass, 1 order, 720 Hz. Bypassed when _voice_ is in right position.
* overdrive - nonlinear element, emulation of the push-pull tube amplifier.
* equalizer - tonestack, bass-middle-treble.
* post-filter - lowpass, 1 order, 720 Hz. Bypassed when _voice_ is in right position.
Bypass button, 0 - pedal on, 1 -pedal off (bypass on)
Bias of each half-wave so that they better match
Distortion threshold, if the signal is bigger
it starts to get distorted
Softness of distortion
--------Processing chain-----------------
Used 2 tubes - for positive and negative half-waves (push-pull).
Stereo input and output, but during processing the signal is
converted to mono. |
declare name "kpp_bluedream";
declare author "Oleg Kapitonov";
declare license "GPLv3";
declare version "1.2";
import("stdfaust.lib");
process = output with {
bypass = checkbox("99_bypass");
drive = vslider("drive",63,0,100,0.01);
volume = vslider("volume",0.5,0,1,0.001);
voice = vslider("voice",0.5,0,1,0.001);
tonestack_low = vslider("bass",0,-15,15,0.1);
tonestack_middle = vslider("middle",0,-15,15,0.1);
tonestack_high = vslider("treble",0,-15,15,0.1);
tonestack_low_freq = 70;
tonestack_middle_freq = 500;
tonestack_high_freq = 10000;
tonestack_low_band = 200;
tonestack_middle_band = 700;
tonestack_high_band = 18000;
clamp = min(2.0) : max(-2.0);
bias = 0.2;
Upor = 0.2;
Kreg = 1.0;
tube(Kreg,Upor,bias,cut) = main : +(bias) : max(cut) with {
Ks(x) = 1/(max((x-Upor)*(Kreg),0)+1);
Ksplus(x) = Upor - x*Upor;
main(Uin) = (Uin * Ks(Uin) + Ksplus(Ks(Uin)));
};
pre_filter = _ <: fi.highpass(1, 720) * min((1 - voice + 0.75 * drive / 100), 1),
*(max((voice - 0.75 * drive / 100), 0)) : + ;
post_filter = _ <: fi.lowpass(1, 720) * min((1 - voice + 0.75 * drive / 100), 1),
*(max((voice - 0.75 * drive / 100), 0)) : + ;
stage_stomp = pre_filter : fi.lowpass(1,9000) : _<:
_,*(-1.0) : tube(Kreg,Upor,bias,0), tube(Kreg,Upor,bias,0) : - :
*(ba.db2linear(volume * 50.0 * (1 - voice * 0.25) ) / 100.0) :
fi.peak_eq(tonestack_low,tonestack_low_freq,tonestack_low_band) :
fi.peak_eq(tonestack_middle,tonestack_middle_freq,tonestack_middle_band) :
fi.peak_eq(tonestack_high,tonestack_high_freq,tonestack_high_band) :
clamp :
post_filter ;
stomp = fi.dcblocker : clamp : *(ba.db2linear(drive * 0.4 * (1 - voice * 0.5))-1) :
stage_stomp : fi.dcblocker;
output = _,_ : + : ba.bypass1(bypass, stomp) <: _,_;
};
|
45eb6563d2ed2c6e510b754d2ae1ced6d41e4dfed1a3e05ab3f5801515470a16 | amstramgrame/amstramgrame | exfaust4.dsp |
declare name "Lightning in the dark";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
/*
A recursive short delay based iterator (produces shiny and rich sounds)
*/
import("stdfaust.lib");
on_click(x) = (x > x');
trig = button("trig[switch:1]");
speed = hslider("speed[knob:2]", 60, 30, 500, 1);
div = hslider("div[acc: 1 0 -10 0 10]", 10, 1, 100,0.1);
ffq = hslider("filter_fq[acc: 0 0 -10 0 10]", 0.5, 0, 0.99, 0.01);
amp = hslider("amp", 0.5, 0, 1, 0.01) : si.smoo;
imp = on_click(trig);
env = imp : en.adsre(0, 0.05, 0.8, 0.05);
recdel(max_smps, smps, fb) = +~de.delay(max_smps,smps) * fb;
kick(pitch, click, attack, decay, drive, gate) = out
with {
env = en.adsr(attack, decay, 0.0, 0.1, gate);
pitchenv = en.adsr(0.005, click, 0.0, 0.1, gate);
clean = env * os.osc((1 + pitchenv * 4) * pitch);
out = ma.tanh(clean * drive);
};
mpulse(smps_dur, trig) = pulsation
with {
count = ba.countdown(smps_dur, trig);
pulsation = 0, 1 : select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
kik = ba.beat(speed)
: mpulse(abs(no.noise) * (speed / div) )
: *(no.noise);
MAX_DLY = 6000;
MIN_DLY = 500;
dly_mult = MIN_DLY ;
sig = sum(n, 4, kik : recdel(MAX_DLY, dly_mult / (n + 1) , 0.99)
: recdel(MAX_DLY * 2, dly_mult / (n + 1) * 2, 0.9))
: ve.oberheimHPF(ffq, 1)
: fi.dcblocker;
process = sig * amp;
| https://raw.githubusercontent.com/amstramgrame/amstramgrame/4df99bfbae994fc9dcb4012190335e29255b411e/docs/gramophone/programs/exfaust4/exfaust4.dsp | faust |
A recursive short delay based iterator (produces shiny and rich sounds)
|
declare name "Lightning in the dark";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
import("stdfaust.lib");
on_click(x) = (x > x');
trig = button("trig[switch:1]");
speed = hslider("speed[knob:2]", 60, 30, 500, 1);
div = hslider("div[acc: 1 0 -10 0 10]", 10, 1, 100,0.1);
ffq = hslider("filter_fq[acc: 0 0 -10 0 10]", 0.5, 0, 0.99, 0.01);
amp = hslider("amp", 0.5, 0, 1, 0.01) : si.smoo;
imp = on_click(trig);
env = imp : en.adsre(0, 0.05, 0.8, 0.05);
recdel(max_smps, smps, fb) = +~de.delay(max_smps,smps) * fb;
kick(pitch, click, attack, decay, drive, gate) = out
with {
env = en.adsr(attack, decay, 0.0, 0.1, gate);
pitchenv = en.adsr(0.005, click, 0.0, 0.1, gate);
clean = env * os.osc((1 + pitchenv * 4) * pitch);
out = ma.tanh(clean * drive);
};
mpulse(smps_dur, trig) = pulsation
with {
count = ba.countdown(smps_dur, trig);
pulsation = 0, 1 : select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
kik = ba.beat(speed)
: mpulse(abs(no.noise) * (speed / div) )
: *(no.noise);
MAX_DLY = 6000;
MIN_DLY = 500;
dly_mult = MIN_DLY ;
sig = sum(n, 4, kik : recdel(MAX_DLY, dly_mult / (n + 1) , 0.99)
: recdel(MAX_DLY * 2, dly_mult / (n + 1) * 2, 0.9))
: ve.oberheimHPF(ffq, 1)
: fi.dcblocker;
process = sig * amp;
|
6c5cf27083b8bae8c509c64c472e888afce66df38a55a5b51df628e46561616f | amstramgrame/amstramgrame | exfaust1.dsp |
declare name "Canon";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
import("stdfaust.lib");
on_click(x) = 0, 1 : select2( x > x');
/*
Impulsion with a specified duration. Can be retriggered.
*/
mpulse(smps_dur, trig) = pulsation
with {
count = ba.countdown(smps_dur, trig);
//count = -(1)~_, smps_dur : select2(trig);
pulsation = 0, 1 : select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
// A recursive delay
recdel(max_smps, smps, fb) = +~de.delay(max_smps,smps) * fb;
// Can be mixed with dry signal
mix_recdel(mix, max_smps, smps, fb, sig) = sig : recdel(max_smps, smps, fb) :
_*mix + sig * (1 - mix);
// Controls
btn = button("trig[switch:1]");
noise_amount = hslider("noise", 0, 0, 100, 1);
freq = hslider("freq[acc: 1 0 -10 0 10]", 80, 70, 200, 1)
: +(nz)
: ba.sAndH( on_click(btn) + os.impulse);
del = hslider("del_fq[acc: 0 0 -10 0 10]", 100, 100, 1000, 1)
: ba.sAndH(os.impulse | on_click(btn));
amp = hslider("amp", 1.5, 0, 2, 0.01) : si.smoo;
// Signal processing
nz = no.noise : abs : *(noise_amount);
// Sawtooth with sine subharmonic
sig = os.sawtooth(freq) + (os.osc(freq /2) / 2);
// Exponential ADSR envelope
env = btn : en.adsre(0.001, 0.1, 0.5, 1);
process = sig
: *(0.5)
: fi.resonlp(env * freq * 2 + 100, 1, 1)
: mix_recdel(0.4, 1000, del, 0.99)
: mix_recdel(0.3, 10000, 10000, 0.8)
: *(amp)
: *(env);
| https://raw.githubusercontent.com/amstramgrame/amstramgrame/4df99bfbae994fc9dcb4012190335e29255b411e/docs/gramophone/programs/exfaust1/exfaust1.dsp | faust |
Impulsion with a specified duration. Can be retriggered.
count = -(1)~_, smps_dur : select2(trig);
A recursive delay
Can be mixed with dry signal
Controls
Signal processing
Sawtooth with sine subharmonic
Exponential ADSR envelope |
declare name "Canon";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
import("stdfaust.lib");
on_click(x) = 0, 1 : select2( x > x');
mpulse(smps_dur, trig) = pulsation
with {
count = ba.countdown(smps_dur, trig);
pulsation = 0, 1 : select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
recdel(max_smps, smps, fb) = +~de.delay(max_smps,smps) * fb;
mix_recdel(mix, max_smps, smps, fb, sig) = sig : recdel(max_smps, smps, fb) :
_*mix + sig * (1 - mix);
btn = button("trig[switch:1]");
noise_amount = hslider("noise", 0, 0, 100, 1);
freq = hslider("freq[acc: 1 0 -10 0 10]", 80, 70, 200, 1)
: +(nz)
: ba.sAndH( on_click(btn) + os.impulse);
del = hslider("del_fq[acc: 0 0 -10 0 10]", 100, 100, 1000, 1)
: ba.sAndH(os.impulse | on_click(btn));
amp = hslider("amp", 1.5, 0, 2, 0.01) : si.smoo;
nz = no.noise : abs : *(noise_amount);
sig = os.sawtooth(freq) + (os.osc(freq /2) / 2);
env = btn : en.adsre(0.001, 0.1, 0.5, 1);
process = sig
: *(0.5)
: fi.resonlp(env * freq * 2 + 100, 1, 1)
: mix_recdel(0.4, 1000, del, 0.99)
: mix_recdel(0.3, 10000, 10000, 0.8)
: *(amp)
: *(env);
|
7fa6efd92b36095b47717b72d883f66669f9c6b09e386fb1f09c3fe40980a231 | tomara-x/magi | quadrotorgirl.dsp | //trans rights
declare name "quadrotorgirl";
declare author "amy universe";
declare version "0.07";
declare license "WTFPL";
declare options "[midi:on][nvoices:8]";
import("stdfaust.lib");
//TODO: delay randomization, mod wheel
bi2uni = _ : +(1) : /(2) : _;
rain(x,in) = env * g1 * g2 : en.adsr(a,d,s,r) * in * vel
with {
rnd = no.noise : ba.sAndH(ba.beat(rate*60)) : fi.lowpass(1,cf)
with {
rate = vslider("h:%2x/h:[2]grain noise (rnd)/rate [style:knob]",2e4,1,2e4,1);
cf = vslider("h:%2x/h:[2]grain noise (rnd)/filter [style:knob]",2e4,1,2e4,1);
};
g1 = os.lf_pulsetrain(frq+fr,width+wr) : bi2uni
with {
frq = vslider("h:%2x/h:[0]g1/[0]frq [style:knob]",0,0,2000,0.1);
width = vslider("h:%2x/h:[0]g1/[2]pw [style:knob]",0,0,1,0.001);
fr = vslider("h:%2x/h:[0]g1/[1]frq rnd [style:knob]",0,0,1,0.001) * rnd * 1000; //scale
wr = vslider("h:%2x/h:[0]g1/[3]pw rnd [style:knob]",0,0,1,0.001) * abs(rnd);
};
g2 = os.lf_pulsetrain(frq+fr,width+wr) : bi2uni
with {
frq = vslider("h:%2x/h:[1]g2/[0]frq [style:knob]",0,0,2000,0.1);
width = vslider("h:%2x/h:[1]g2/[2]pw [style:knob]",0,0,1,0.001);
fr = vslider("h:%2x/h:[1]g2/[1]frq rnd [style:knob]",0,0,1,0.001) * rnd * 1000;
wr = vslider("h:%2x/h:[1]g2/[3]pw rnd [style:knob]",0,0,1,0.001) * abs(rnd);
};
a = vslider("h:%2x/h:[3]grain env/[0]attack [style:knob]",0,0,0.01,0.0001);
d = vslider("h:%2x/h:[3]grain env/[1]decay [style:knob]",0,0,0.01,0.0001);
s = vslider("h:%2x/h:[3]grain env/[2]sustain [style:knob]",0,0,1,0.0001);
r = vslider("h:%2x/h:[3]grain env/[3]release [style:knob]",0.01,0,1,0.0001);
};
op(amp,frq,fb) = (_+_ : *(ma.PI) : os.oscp(frq)*amp) ~ *(fb); //pm operator
gate = button("h:hidden (nothing to see here!)/gate"); //midi gate
env = gate : en.adsr(a,d,s,r)
with {
a = vslider("h:global/h:[1]env/[0]attack [style:knob]",0,0,4,0.0001);
d = vslider("h:global/h:[1]env/[1]decay [style:knob]",0,0,4,0.0001);
s = vslider("h:global/h:[1]env/[2]sustain [style:knob]",1,0,1,0.0001);
r = vslider("h:global/h:[1]env/[3]release [style:knob]",0,0,4,0.0001);
};
vel = nentry("h:hidden (nothing to see here!)/gain",0.5,0,1,0.01); //midi velocity
frq = nentry("h:hidden (nothing to see here!)/freq",0,0,2e4,1); //midi frequency
bend = ba.semi2ratio(hslider("h:hidden (nothing to see here!)/bend[midi:pitchwheel]",0,-2,2,0.01)) : si.polySmooth(gate,0.999,1);
fb = vslider("h:global/[0]feedback [style:knob]",0,0,1,0.001); //carrier feedback
process = par(s,2, op(1,frq*bend,fb) <: par(i,4,rain(i)/4) :> _ );
//greyhole?
| https://raw.githubusercontent.com/tomara-x/magi/a144ba5130e816a194a178c77b8b76ee733ae2de/source/quadrotorgirl.dsp | faust | trans rights
TODO: delay randomization, mod wheel
scale
pm operator
midi gate
midi velocity
midi frequency
carrier feedback
greyhole? |
declare name "quadrotorgirl";
declare author "amy universe";
declare version "0.07";
declare license "WTFPL";
declare options "[midi:on][nvoices:8]";
import("stdfaust.lib");
bi2uni = _ : +(1) : /(2) : _;
rain(x,in) = env * g1 * g2 : en.adsr(a,d,s,r) * in * vel
with {
rnd = no.noise : ba.sAndH(ba.beat(rate*60)) : fi.lowpass(1,cf)
with {
rate = vslider("h:%2x/h:[2]grain noise (rnd)/rate [style:knob]",2e4,1,2e4,1);
cf = vslider("h:%2x/h:[2]grain noise (rnd)/filter [style:knob]",2e4,1,2e4,1);
};
g1 = os.lf_pulsetrain(frq+fr,width+wr) : bi2uni
with {
frq = vslider("h:%2x/h:[0]g1/[0]frq [style:knob]",0,0,2000,0.1);
width = vslider("h:%2x/h:[0]g1/[2]pw [style:knob]",0,0,1,0.001);
wr = vslider("h:%2x/h:[0]g1/[3]pw rnd [style:knob]",0,0,1,0.001) * abs(rnd);
};
g2 = os.lf_pulsetrain(frq+fr,width+wr) : bi2uni
with {
frq = vslider("h:%2x/h:[1]g2/[0]frq [style:knob]",0,0,2000,0.1);
width = vslider("h:%2x/h:[1]g2/[2]pw [style:knob]",0,0,1,0.001);
fr = vslider("h:%2x/h:[1]g2/[1]frq rnd [style:knob]",0,0,1,0.001) * rnd * 1000;
wr = vslider("h:%2x/h:[1]g2/[3]pw rnd [style:knob]",0,0,1,0.001) * abs(rnd);
};
a = vslider("h:%2x/h:[3]grain env/[0]attack [style:knob]",0,0,0.01,0.0001);
d = vslider("h:%2x/h:[3]grain env/[1]decay [style:knob]",0,0,0.01,0.0001);
s = vslider("h:%2x/h:[3]grain env/[2]sustain [style:knob]",0,0,1,0.0001);
r = vslider("h:%2x/h:[3]grain env/[3]release [style:knob]",0.01,0,1,0.0001);
};
env = gate : en.adsr(a,d,s,r)
with {
a = vslider("h:global/h:[1]env/[0]attack [style:knob]",0,0,4,0.0001);
d = vslider("h:global/h:[1]env/[1]decay [style:knob]",0,0,4,0.0001);
s = vslider("h:global/h:[1]env/[2]sustain [style:knob]",1,0,1,0.0001);
r = vslider("h:global/h:[1]env/[3]release [style:knob]",0,0,4,0.0001);
};
bend = ba.semi2ratio(hslider("h:hidden (nothing to see here!)/bend[midi:pitchwheel]",0,-2,2,0.01)) : si.polySmooth(gate,0.999,1);
process = par(s,2, op(1,frq*bend,fb) <: par(i,4,rain(i)/4) :> _ );
|
2a7618dbd399dea7838857ed1ab44dff90d633294d3b4c01d3c64a79f643eb7a | LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust | 1.02_Classic_Looper.dsp | // -----------------------------------------------------------------------------
// Declarations
declare name "Classic Looper";
declare version "0.1";
declare author "Luca Spanedda";
/*
BASICS OF WRITING AND READING:
A CLASSIC LOOPER IMPLEMENTED WITH THE RWTABLE
*/
// import Standard Faust library
// https://github.com/grame-cncm/faustlibraries/
import("stdfaust.lib");
/*
The rwtable function recalls a space in the memory
to access the writing and reading operations of an audio file in faust.
In this implementation we will use it for a looped write and read on a table.
The rwtable is followed and defined by 5 arguments,
which determine its functioning:
rwtable(1,2,3,4,5)
1 - Table Size: size of the memory space in samples we will write
2 - Value of the initial table content
3 - The write index (an int between 0 and n-1): Write the signal
4 - _ : the 4th argument of rwtable corresponds to the input of the table
5 - The read index (an int between 0 and n-1): Read the signal = Output
*/
// classiclooper function:
//
// readspeed :
// define the speed of reading the table
// 1 = unaltered pitch, 2 = double speed, 0.5 = half speed.
//
// dimension :
// Dimension is the size of the memory space to be recorded in samples
//
// recvalue:
// 1 = start recording, 0 = stop recording.
//
classiclooper(recstart,dimension,readspeed) = rwtable(dimension,0.0,indexwrite,_,indexread)
// the function contains:
with{
// The record function when it is at 0 does not record,
// When it is at 1 it starts recording.
// (start count on indexwrite)
// Int forces the number to come up with an integer.
record = recstart : int;
// Indexwrite writes into the memory space.
// Counting begins when the record equals 1.
// Indexwrite counts until the dimention value is reached,
// After which the count stops and restarts from the beginning, in loop.
indexwrite = (+(1) : %(dimension)) ~ *(record);
// speed of the phasor = 1Hz / dimension of the memory in samples
// (the memory dimension become long 1Hz for the readspeed)
speeddivsamplerate = readspeed/dimension;
// subtraction : rescale when reach 1 (1 = int. number)
decimale(x)= x-int(x);
// accomulation of the value: speeddivsamplerate, at each sample
// (and rescale when is an integer number: 1)
phasor = speeddivsamplerate : (+ : decimale) ~ _;
// phasor * the dimension of the memory
// (read in a defined time all the memory stored)
indexread = phasor : *(float(dimension)) : int;
};
// signal out (process)
// classiclooper(record: 0-OFF, 1-ON, Size in samples, Read speed: 1-Standard)
process = classiclooper(1,48000,1) <: _, _;
// -----------------------------------------------------------------------------
| https://raw.githubusercontent.com/LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust/bb01eff05a51424c16420a00b383441d8973d85e/0_work-in-progress/1.02_Classic_Looper.dsp | faust | -----------------------------------------------------------------------------
Declarations
BASICS OF WRITING AND READING:
A CLASSIC LOOPER IMPLEMENTED WITH THE RWTABLE
import Standard Faust library
https://github.com/grame-cncm/faustlibraries/
The rwtable function recalls a space in the memory
to access the writing and reading operations of an audio file in faust.
In this implementation we will use it for a looped write and read on a table.
The rwtable is followed and defined by 5 arguments,
which determine its functioning:
rwtable(1,2,3,4,5)
1 - Table Size: size of the memory space in samples we will write
2 - Value of the initial table content
3 - The write index (an int between 0 and n-1): Write the signal
4 - _ : the 4th argument of rwtable corresponds to the input of the table
5 - The read index (an int between 0 and n-1): Read the signal = Output
classiclooper function:
readspeed :
define the speed of reading the table
1 = unaltered pitch, 2 = double speed, 0.5 = half speed.
dimension :
Dimension is the size of the memory space to be recorded in samples
recvalue:
1 = start recording, 0 = stop recording.
the function contains:
The record function when it is at 0 does not record,
When it is at 1 it starts recording.
(start count on indexwrite)
Int forces the number to come up with an integer.
Indexwrite writes into the memory space.
Counting begins when the record equals 1.
Indexwrite counts until the dimention value is reached,
After which the count stops and restarts from the beginning, in loop.
speed of the phasor = 1Hz / dimension of the memory in samples
(the memory dimension become long 1Hz for the readspeed)
subtraction : rescale when reach 1 (1 = int. number)
accomulation of the value: speeddivsamplerate, at each sample
(and rescale when is an integer number: 1)
phasor * the dimension of the memory
(read in a defined time all the memory stored)
signal out (process)
classiclooper(record: 0-OFF, 1-ON, Size in samples, Read speed: 1-Standard)
-----------------------------------------------------------------------------
|
declare name "Classic Looper";
declare version "0.1";
declare author "Luca Spanedda";
import("stdfaust.lib");
classiclooper(recstart,dimension,readspeed) = rwtable(dimension,0.0,indexwrite,_,indexread)
with{
record = recstart : int;
indexwrite = (+(1) : %(dimension)) ~ *(record);
speeddivsamplerate = readspeed/dimension;
decimale(x)= x-int(x);
phasor = speeddivsamplerate : (+ : decimale) ~ _;
indexread = phasor : *(float(dimension)) : int;
};
process = classiclooper(1,48000,1) <: _, _;
|
1e4fcc89bd7ebc18317dbcf032bf333bbf8856c25598b039e8f7b4d725837949 | plule/theremotion | instrument.dsp | declare name "theremotion";
declare version "1.0";
declare author "Pierre Lulé";
declare license "BSD";
import("stdfaust.lib");
// Precompute midi note to frequency
// Clamped to the midi range since the dsp is not strict on that
// It could be checked with the latest -ct 1 Faust option instead, but let's keep the dsp "correct".
midikey2hz(mk) = ba.tabulate(1, ba.midikey2hz, 2048, 0, 127, mk).val;
// Filter used in each voice
filter(res, note, cutoffNote) = ve.moog_vcf_2b(res, cutoffFreq)
with {
cutoffFreq = note + cutoffNote : midikey2hz : si.smoo;
};
// Lead oscillator
lead(pitchBend, res, cutoffNote) = os.sawtooth(f) * v : filter(res, note, cutoffNote)
with {
v = hslider("[1]volume", 0.0, 0, 1, 0.001) : si.smoo;
note = hslider("[0]note", 60, 0, 127, 0.001) + pitchBend;
f = note : midikey2hz : si.smoo;
cutoffFreq = note + cutoffNote : midikey2hz : si.smoo;
};
leadChord(pitchBend, res, cutoffNote) = (pitchBend, res, cutoffNote) <: par(i, 4, vgroup("[3]%i", lead)) :> _ * v
with {
v = hslider("[0]volume", 0.0, 0, 1, 0.001) : si.smoo;
};
feedback(signal)= signal * 0.005;
// Guitar
elecGuitar(stringLength,pluckPosition,mute,gain,trigger) =
(pm.elecGuitarModel(stringLength,pluckPosition,mute) : co.compressor_mono(20,-10,0,0.1)) * 1.5 ~
(_ : ef.gate_mono(-20, 0.0001, 0.1, 0.02)) * 0.005 + pm.pluckString(stringLength,1,1,1,gain,trigger);
guitarStrumNote(mute, pitchBend, res, cutoffNote) = elecGuitar(length,0.5,mute,0.5,gate)
: filter(res, note, cutoffNote)
with {
f = note + pitchBend : midikey2hz : si.smoo;
length = f : pm.f2l;
gate = button("[0]gate");
note = hslider("[1]note", 80, 0, 127, 0.001);
};
guitarStrum(mute, pitchBend, res, cutoffNote) = (mute, pitchBend, res, cutoffNote) <: par(i, 5, vgroup("[3]%i", guitarStrumNote)) :> _;
guitar(pitchBend, res, cutoffNote) = guitarStrum(mute, pitchBend, res, cutoffNote)
with {
mute = hslider("[2]mute", 1, 0.90, 1, 0.001);
};
// Drone
droneNote(detune) = osc(note) + osc(note+detune) + osc(note-detune) : _ * volume
with {
volume = hslider("[0]volume", 0, 0, 1, 0.001) : si.smoo;
note = hslider("[1]note", 60, 0, 127, 0.001);
osc(note) = note : midikey2hz : si.smoo : os.triangle : _ / 3;
};
drone = detune <: par(i, 4, vgroup("[1]%i", droneNote)) :> _ : ef.cubicnl(drive, offset)
with {
detune = hslider("[0]detune", 0.1, 0, 0.3, 0.001);
trumpet = hslider("[1]trumpet", 0, 0, 1, 0.001) : si.smoo;
drive = trumpet / 3;
offset = trumpet;
};
echo(s) = s <: ef.echo(10.0, duration, feedback) * mix, s * (1-mix) :> _
with {
mix = hslider("[0]mix", 1.0, 0, 1, 0.001) : si.smoo;
duration = hslider("[0]duration[scale:log]", 0.3, 0.01, 3.0, 0.001) : si.smoo;
feedback = hslider("[1]feedback", 0.3, 0, 1, 0.001);
};
reverb(s) = s <: re.jpverb(t60, damp, size, earlyDiff, modDepth, modFreq, 1, 1, 1, 440, 8000) :> _ <: _ * mix, s * (1-mix) :> _
with {
mix = hslider("[0]mix", 0.11, 0, 1, 0.001);
t60 = hslider("[1]time", 3.5, 0.1, 60, 0.001);
damp = hslider("[2]damp", 0.88, 0, 1, 0.001);
size = hslider("[3]size", 5.0, 0.5, 5, 0.001);
earlyDiff = hslider("[4]early_diff", 0.75, 0, 1, 0.001);
modDepth = hslider("[5]mod_depth", 0.98, 0, 1, 0.001);
modFreq = hslider("[6]mod_freq", 0.6, 0, 10, 0.001);
};
fx = vgroup("[0]echo", echo) : vgroup("[1]reverb", reverb);
// Mix
process = hgroup("[2]drone", drone) * drone_volume
+ vgroup("[0]lead", leadChord)(pitchBend, res, cutoffNote) * lead_volume
+ hgroup("[1]pluck", guitar)(pitchBend, res, cutoffNote) * pluck_volume
: hgroup("[2]fx", fx)
: _ * master_volume
<: _, _
with {
mixGroup(x) = vgroup("[3]mix", x);
master_volume = mixGroup(hslider("[0]master", 1, 0, 1, 0.001)) : si.smoo;
drone_volume = mixGroup(hslider("[1]drone", 1, 0, 1, 0.001)) : si.smoo;
lead_volume = mixGroup(hslider("[2]lead", 1, 0, 1, 0.001)) : si.smoo;
pluck_volume = mixGroup(hslider("[3]pluck", 1, 0, 1, 0.001)) : si.smoo;
filterGroup(x) = vgroup("[4]filter", x);
cutoffNote = filterGroup(hslider("[1]cutoffNote", 0, -20, 50, 0.001)) : si.smoo;
res = filterGroup(hslider("[2]res", 0, 0, 0.99, 0.001)) : si.smoo;
pitchBend = hslider("[5]pitchBend", 0, -1, 1, 0.001) : si.smoo;
}; | https://raw.githubusercontent.com/plule/theremotion/287453c5372cd7bddbf8e6e9676a40e2e3096474/dsp/instrument.dsp | faust | Precompute midi note to frequency
Clamped to the midi range since the dsp is not strict on that
It could be checked with the latest -ct 1 Faust option instead, but let's keep the dsp "correct".
Filter used in each voice
Lead oscillator
Guitar
Drone
Mix
| declare name "theremotion";
declare version "1.0";
declare author "Pierre Lulé";
declare license "BSD";
import("stdfaust.lib");
midikey2hz(mk) = ba.tabulate(1, ba.midikey2hz, 2048, 0, 127, mk).val;
filter(res, note, cutoffNote) = ve.moog_vcf_2b(res, cutoffFreq)
with {
cutoffFreq = note + cutoffNote : midikey2hz : si.smoo;
};
lead(pitchBend, res, cutoffNote) = os.sawtooth(f) * v : filter(res, note, cutoffNote)
with {
v = hslider("[1]volume", 0.0, 0, 1, 0.001) : si.smoo;
note = hslider("[0]note", 60, 0, 127, 0.001) + pitchBend;
f = note : midikey2hz : si.smoo;
cutoffFreq = note + cutoffNote : midikey2hz : si.smoo;
};
leadChord(pitchBend, res, cutoffNote) = (pitchBend, res, cutoffNote) <: par(i, 4, vgroup("[3]%i", lead)) :> _ * v
with {
v = hslider("[0]volume", 0.0, 0, 1, 0.001) : si.smoo;
};
feedback(signal)= signal * 0.005;
elecGuitar(stringLength,pluckPosition,mute,gain,trigger) =
(pm.elecGuitarModel(stringLength,pluckPosition,mute) : co.compressor_mono(20,-10,0,0.1)) * 1.5 ~
(_ : ef.gate_mono(-20, 0.0001, 0.1, 0.02)) * 0.005 + pm.pluckString(stringLength,1,1,1,gain,trigger);
guitarStrumNote(mute, pitchBend, res, cutoffNote) = elecGuitar(length,0.5,mute,0.5,gate)
: filter(res, note, cutoffNote)
with {
f = note + pitchBend : midikey2hz : si.smoo;
length = f : pm.f2l;
gate = button("[0]gate");
note = hslider("[1]note", 80, 0, 127, 0.001);
};
guitarStrum(mute, pitchBend, res, cutoffNote) = (mute, pitchBend, res, cutoffNote) <: par(i, 5, vgroup("[3]%i", guitarStrumNote)) :> _;
guitar(pitchBend, res, cutoffNote) = guitarStrum(mute, pitchBend, res, cutoffNote)
with {
mute = hslider("[2]mute", 1, 0.90, 1, 0.001);
};
droneNote(detune) = osc(note) + osc(note+detune) + osc(note-detune) : _ * volume
with {
volume = hslider("[0]volume", 0, 0, 1, 0.001) : si.smoo;
note = hslider("[1]note", 60, 0, 127, 0.001);
osc(note) = note : midikey2hz : si.smoo : os.triangle : _ / 3;
};
drone = detune <: par(i, 4, vgroup("[1]%i", droneNote)) :> _ : ef.cubicnl(drive, offset)
with {
detune = hslider("[0]detune", 0.1, 0, 0.3, 0.001);
trumpet = hslider("[1]trumpet", 0, 0, 1, 0.001) : si.smoo;
drive = trumpet / 3;
offset = trumpet;
};
echo(s) = s <: ef.echo(10.0, duration, feedback) * mix, s * (1-mix) :> _
with {
mix = hslider("[0]mix", 1.0, 0, 1, 0.001) : si.smoo;
duration = hslider("[0]duration[scale:log]", 0.3, 0.01, 3.0, 0.001) : si.smoo;
feedback = hslider("[1]feedback", 0.3, 0, 1, 0.001);
};
reverb(s) = s <: re.jpverb(t60, damp, size, earlyDiff, modDepth, modFreq, 1, 1, 1, 440, 8000) :> _ <: _ * mix, s * (1-mix) :> _
with {
mix = hslider("[0]mix", 0.11, 0, 1, 0.001);
t60 = hslider("[1]time", 3.5, 0.1, 60, 0.001);
damp = hslider("[2]damp", 0.88, 0, 1, 0.001);
size = hslider("[3]size", 5.0, 0.5, 5, 0.001);
earlyDiff = hslider("[4]early_diff", 0.75, 0, 1, 0.001);
modDepth = hslider("[5]mod_depth", 0.98, 0, 1, 0.001);
modFreq = hslider("[6]mod_freq", 0.6, 0, 10, 0.001);
};
fx = vgroup("[0]echo", echo) : vgroup("[1]reverb", reverb);
process = hgroup("[2]drone", drone) * drone_volume
+ vgroup("[0]lead", leadChord)(pitchBend, res, cutoffNote) * lead_volume
+ hgroup("[1]pluck", guitar)(pitchBend, res, cutoffNote) * pluck_volume
: hgroup("[2]fx", fx)
: _ * master_volume
<: _, _
with {
mixGroup(x) = vgroup("[3]mix", x);
master_volume = mixGroup(hslider("[0]master", 1, 0, 1, 0.001)) : si.smoo;
drone_volume = mixGroup(hslider("[1]drone", 1, 0, 1, 0.001)) : si.smoo;
lead_volume = mixGroup(hslider("[2]lead", 1, 0, 1, 0.001)) : si.smoo;
pluck_volume = mixGroup(hslider("[3]pluck", 1, 0, 1, 0.001)) : si.smoo;
filterGroup(x) = vgroup("[4]filter", x);
cutoffNote = filterGroup(hslider("[1]cutoffNote", 0, -20, 50, 0.001)) : si.smoo;
res = filterGroup(hslider("[2]res", 0, 0, 0.99, 0.001)) : si.smoo;
pitchBend = hslider("[5]pitchBend", 0, -1, 1, 0.001) : si.smoo;
}; |
a614dbf7c3ecc4fab5ec49cee4d585ca110f84ecb229b79bd625004ef8e25cc2 | maximalexanian/guitarix-vst | expander.dsp |
/* Expander unit. */
/* This is pretty much the same as compressor.dsp, but here the given ratio is
applied to *attenuate* levels *below* the threshold. */
declare name "Expander";
declare category "Guitar Effects";
declare description "expander unit";
declare author "Albert Graef";
declare version "1.0";
import("stdfaust.lib");
/* Controls. */
ratio = nentry("ratio", 2, 1, 20, 0.1);
threshold = nentry("threshold", -40, -96, 10, 0.1);
knee = nentry("knee", 3, 0, 20, 0.1);
attack = hslider("attack", 0.001, 0, 1, 0.001) : max(1/ma.SR);
release = hslider("release", 0.1, 0, 10, 0.01) : max(1/ma.SR);
t = 0.1;
g = exp(-1/(ma.SR*t));
env = abs : *(1-g) : + ~ *(g);
rms = sqr : *(1-g) : + ~ *(g) : sqrt;
sqr(x) = x*x;
env2(x) = max(env(x));
expand(env) = level*(1-r)
with {
level = env : h ~ _ : ba.linear2db : (threshold+knee-_) : max(0)
with {
h(x,y) = f*x+(1-f)*y with { f = (x<y)*ga+(x>=y)*gr; };
ga = exp(-1/(ma.SR*attack));
gr = exp(-1/(ma.SR*release));
};
p = level/(knee+eps) : max(0) : min(1) with { eps = 0.001; };
r = 1-p+p*ratio;
};
process(x) = (g(x)*x)
with {
g = env2(x) : expand : ba.db2linear;
};
| https://raw.githubusercontent.com/maximalexanian/guitarix-vst/83fd0cbec9588fb2ef47d80f7c6cb0775bfb9f89/guitarix/src/LV2/faust/expander.dsp | faust | Expander unit.
This is pretty much the same as compressor.dsp, but here the given ratio is
applied to *attenuate* levels *below* the threshold.
Controls. |
declare name "Expander";
declare category "Guitar Effects";
declare description "expander unit";
declare author "Albert Graef";
declare version "1.0";
import("stdfaust.lib");
ratio = nentry("ratio", 2, 1, 20, 0.1);
threshold = nentry("threshold", -40, -96, 10, 0.1);
knee = nentry("knee", 3, 0, 20, 0.1);
attack = hslider("attack", 0.001, 0, 1, 0.001) : max(1/ma.SR);
release = hslider("release", 0.1, 0, 10, 0.01) : max(1/ma.SR);
t = 0.1;
g = exp(-1/(ma.SR*t));
env = abs : *(1-g) : + ~ *(g);
rms = sqr : *(1-g) : + ~ *(g) : sqrt;
sqr(x) = x*x;
env2(x) = max(env(x));
expand(env) = level*(1-r)
with {
level = env : h ~ _ : ba.linear2db : (threshold+knee-_) : max(0)
with {
h(x,y) = f*x+(1-f)*y with { f = (x<y)*ga+(x>=y)*gr; };
ga = exp(-1/(ma.SR*attack));
gr = exp(-1/(ma.SR*release));
};
p = level/(knee+eps) : max(0) : min(1) with { eps = 0.001; };
r = 1-p+p*ratio;
};
process(x) = (g(x)*x)
with {
g = env2(x) : expand : ba.db2linear;
};
|
163b99239ed45fa3de09d471e8a0612eda695b5a5d14b2ffb2825fcbd32d6bfb | sekisushai/ambitools | hoa_beamforming_dirac_to_hoa.dsp | declare name "Beamforming Dirac on HOA";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2016";
// Description: This tool helps to explore the HOA scene with a "flashlight". It applies a directionnal filter (Dirac function) to the HOA scene to just leave the sound from the chosen direction [1].
// References:
// [1] P. Lecomte, P.-A. Gauthier, C. Langrenne, A. Berry, and A. Garcia, “Filtrage directionnel dans un scène sonore 3D par une utilisation conjointe de Beamforming et d’Ambisonie d’ordre elevés,” in CFA / VISHNO 2016, 2016, pp. 169–175.
// Inputs: (M+1)^2
// Outputs: (M1+1)^2
import("stdfaust.lib");
import("lebedev.lib");
import("ymn.lib");
import("nfc.lib");
import("gui.lib");
// Order of the input HOA scene.
M = 10;
// Order of the ouptut HOA scene. For the moment, as to be equal to M because of the Bypass..
M1 = M;
ins = (M+1)^2;
outs = ins;
// VU-Meters activation (choose between vumeteron or off)
insvumeter = insvumeteroff;
outsvumeter = outsvumeteroff;
insvumeteron = par(i,M+1,meterm(i));
insvumeteroff = par(i,ins,_);
outsvumeteron = par(i,M+1,meterm(i));
outsvumeteroff = par(i,outs,_);
// Steering angles
theta0 = vslider("[5]Azimuth", 0, 0, 360, 0.1)*ma.PI/180;
delta0 = vslider("[6]Elevation", 0, -90, 90, 0.1)*ma.PI/180;
// Output gain
vol = vslider("[4]Gain[unit:dB]", 0, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
// Bypass with timed crossfader
trig = vgroup("[2]On/Off",checkbox("On"));
duree = nentry("[3]Crossfade[unit:s]",1,0.1,10,0.1);
compteurhaut1 = ba.countup(duree*ma.SR,1-trig)/(duree*ma.SR);
compteurbas1 = ba.countdown(duree*ma.SR,trig)/(duree*ma.SR);
compteurhaut2 = ba.countup(duree*ma.SR,trig)/(duree*ma.SR);
compteurbas2 = ba.countdown(duree*ma.SR,1-trig)/(duree*ma.SR);
// Bypass with manual crossfade
focus = vslider("[8]Focus", 0, 0, 1, 0.0001);
sufoc = 1 - focus;
// swith between the 2 crossfade options
switch = checkbox("[7]Timer/Manual");
crossfade1(s) = _<:select2(s,_<:select2(trig,*(vol*compteurbas1),*(vol*compteurhaut1)),_*(vol*focus));
crossfade2(s) = _<:select2(s,_<:select2(trig,*(compteurhaut2),*(compteurbas2)),_*(sufoc));
// ALTERNATIVE VERSION to duplicate first component (pressure), i.e. for demo without ambisonics decoding playback
// updownsig1=par(i,36,_<:select2(trig,*(vol*compteurbas1),*(vol*compteurhaut1))):ytot(theta0,delta0):>_<:ytot(theta0,delta0):((_<:(_,_)),bus(35));
// updownsig2=par(i,36,_<:select2(trig,*(compteurhaut2),*(compteurbas2))):((_<:(_,_)),bus(35));
// selecteur=hgroup("Parameters",vgroup("[1]Inputs",bus(36):(hgroup("0-3",meterm(0),meterm(1),meterm(2),meterm(3)),hgroup("4-5",meterm(4),meterm(5))))<:((updownsig2),(updownsig1)):>bus(37));
// process=selecteur:(_,vgroup("Outputs",(hgroup("0-3",meterm(0),meterm(1),meterm(2),meterm(3)),hgroup("4-5",meterm(4),meterm(5)))));
updownsig1 = par(i,ins,crossfade1(switch)):yvec(ins,theta0,delta0):>_*(1/(4*ma.PI))<:yvec(outs,theta0,delta0):si.bus(outs);
updownsig2 = par(i,ins,crossfade2(switch)):si.bus(outs);
selecteur = hgroup("Parameters",hgroup("[1]Inputs",insvumeter)<:((updownsig2),(updownsig1)):>si.bus(outs));
matrix(n,m) = par(i,m,buswg(row(i)):>_);
process = selecteur:hgroup("Outputs",outsvumeter); | https://raw.githubusercontent.com/sekisushai/ambitools/2d21b7cc7cfe9bc35d91d51ec05bf9250372f0ce/Faust/src/hoa_beamforming_dirac_to_hoa.dsp | faust | Description: This tool helps to explore the HOA scene with a "flashlight". It applies a directionnal filter (Dirac function) to the HOA scene to just leave the sound from the chosen direction [1].
References:
[1] P. Lecomte, P.-A. Gauthier, C. Langrenne, A. Berry, and A. Garcia, “Filtrage directionnel dans un scène sonore 3D par une utilisation conjointe de Beamforming et d’Ambisonie d’ordre elevés,” in CFA / VISHNO 2016, 2016, pp. 169–175.
Inputs: (M+1)^2
Outputs: (M1+1)^2
Order of the input HOA scene.
Order of the ouptut HOA scene. For the moment, as to be equal to M because of the Bypass..
VU-Meters activation (choose between vumeteron or off)
Steering angles
Output gain
Bypass with timed crossfader
Bypass with manual crossfade
swith between the 2 crossfade options
ALTERNATIVE VERSION to duplicate first component (pressure), i.e. for demo without ambisonics decoding playback
updownsig1=par(i,36,_<:select2(trig,*(vol*compteurbas1),*(vol*compteurhaut1))):ytot(theta0,delta0):>_<:ytot(theta0,delta0):((_<:(_,_)),bus(35));
updownsig2=par(i,36,_<:select2(trig,*(compteurhaut2),*(compteurbas2))):((_<:(_,_)),bus(35));
selecteur=hgroup("Parameters",vgroup("[1]Inputs",bus(36):(hgroup("0-3",meterm(0),meterm(1),meterm(2),meterm(3)),hgroup("4-5",meterm(4),meterm(5))))<:((updownsig2),(updownsig1)):>bus(37));
process=selecteur:(_,vgroup("Outputs",(hgroup("0-3",meterm(0),meterm(1),meterm(2),meterm(3)),hgroup("4-5",meterm(4),meterm(5))))); | declare name "Beamforming Dirac on HOA";
declare version "1.0";
declare author "Pierre Lecomte";
declare license "GPL";
declare copyright "(c) Pierre Lecomte 2016";
import("stdfaust.lib");
import("lebedev.lib");
import("ymn.lib");
import("nfc.lib");
import("gui.lib");
M = 10;
M1 = M;
ins = (M+1)^2;
outs = ins;
insvumeter = insvumeteroff;
outsvumeter = outsvumeteroff;
insvumeteron = par(i,M+1,meterm(i));
insvumeteroff = par(i,ins,_);
outsvumeteron = par(i,M+1,meterm(i));
outsvumeteroff = par(i,outs,_);
theta0 = vslider("[5]Azimuth", 0, 0, 360, 0.1)*ma.PI/180;
delta0 = vslider("[6]Elevation", 0, -90, 90, 0.1)*ma.PI/180;
vol = vslider("[4]Gain[unit:dB]", 0, -20, 20, 0.1) : ba.db2linear : si.smooth(0.999);
trig = vgroup("[2]On/Off",checkbox("On"));
duree = nentry("[3]Crossfade[unit:s]",1,0.1,10,0.1);
compteurhaut1 = ba.countup(duree*ma.SR,1-trig)/(duree*ma.SR);
compteurbas1 = ba.countdown(duree*ma.SR,trig)/(duree*ma.SR);
compteurhaut2 = ba.countup(duree*ma.SR,trig)/(duree*ma.SR);
compteurbas2 = ba.countdown(duree*ma.SR,1-trig)/(duree*ma.SR);
focus = vslider("[8]Focus", 0, 0, 1, 0.0001);
sufoc = 1 - focus;
switch = checkbox("[7]Timer/Manual");
crossfade1(s) = _<:select2(s,_<:select2(trig,*(vol*compteurbas1),*(vol*compteurhaut1)),_*(vol*focus));
crossfade2(s) = _<:select2(s,_<:select2(trig,*(compteurhaut2),*(compteurbas2)),_*(sufoc));
updownsig1 = par(i,ins,crossfade1(switch)):yvec(ins,theta0,delta0):>_*(1/(4*ma.PI))<:yvec(outs,theta0,delta0):si.bus(outs);
updownsig2 = par(i,ins,crossfade2(switch)):si.bus(outs);
selecteur = hgroup("Parameters",hgroup("[1]Inputs",insvumeter)<:((updownsig2),(updownsig1)):>si.bus(outs));
matrix(n,m) = par(i,m,buswg(row(i)):>_);
process = selecteur:hgroup("Outputs",outsvumeter); |
06a92ac7b93512a39a684099a2d8187ea664c4aae6c66de6f83783dffa91c61c | grame-cncm/GeekBagatelles | Part_Gpublic.dsp | declare name "Part_Gpublic";
declare version "0.2";
declare author "Christophe Lebreton";
declare license "BSD";
import("stdfaust.lib");
nb_soundfile = 4;
// PROCESS
process = play:(@(ramp*ma.SR): select_sound),(rampa(ramp):1,_:-):*:*(temporisation:si.smooth(0.998)):*(gain)
with {
play = ((1-Trig_Accel)<:sh(1),_:*),Trig_Accel;
sh(x,t) = select2(t,x,_) ~ _;
select_sound = _<:select_a_sound,par(i,nb_soundfile,linplayer(sound(i))):multiselect(nb_soundfile):>_;
//-----------------------------------------------------------------------------------
/// Random Selection ID /////////////////////////////////////////////////////////////
random_ID = no.noise:+(1):*(0.5):*(nb_soundfile):int;
//-----------------------------------------------------------------------------------
/// Selection Random Audio file with accelerometer trigger /////////////////////////
select_a_sound(x) = sh(random_ID,x):int;
ramp = 0.001;
gain = hslider("gain_dB [acc:2 0 -8 -3 -0.5] [hidden:1]",0.5,0,1,0.001):fi.lowpass(1,1.5);
temporisation = time_count(1) > 13000; // 13sec
};
//---------------------------------------------------------------------------------------
// Soundfiles
import("vocalise_01_waveform.dsp");
import("vocalise_02_waveform.dsp");
import("vocalise_03_waveform.dsp");
import("freunde_vocalise_waveform.dsp");
sound(0) = vocalise_01_0;
sound(1) = vocalise_02_0;
sound(2) = vocalise_03_0;
sound(3) = freunde_vocalise_0;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////// ANALYSE INPUT FROM ACCELEROMETER //////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////// Acellerometer ////////////////////////////////////////
accel_x = hslider("acc_x [acc:0 0 -30 0 30][hidden:1]",0,-1,1,0.001);
accel_y = hslider("acc_y [acc:1 0 -30 0 30][hidden:1]",0,-1,1,0.001);
accel_z = hslider("acc_z [acc:2 0 -30 0 30][hidden:1]",0,-1,1,0.001);
Accel(x,y,z) = (x*x),(y*y),(z*z):> sqrt;
range_utile = - (offest:*(0.01)):max(0)
with {
offest = hslider("offset [hidden:1]",9,0,100,0.1);
};
//////////////////////////////// Bonk ////////////////////////////////////////
bonk(c) = (c-c@t)>a
with {
t = hslider("winsdow_size [unit:ms][hidden:1]",1,1,7000,1);
a = hslider("threshold [hidden:1]",30,0,30,0.01)*0.01;
};
//////////////////////////////// Antirebond ////////////////////////////////////////
// usage: _:antirebond:_
// input signal will be binary type... int this way it was created
// logical need to don't listen input during "time_count"
choix = select2(_,1,_);
logic_selector = _,(0): ==;
// time count in ms
time_base = 1/ma.SR;
time_count (reset) = +(0)~(+(time_base): * (reset)):*(1000);
decount =_<:time_count<(fin),_:*
with {
fin = hslider("antirebond [unit:ms][hidden:1]", 250,0,500,1);
};
antirebond = (choix : decount <: logic_selector,_) ~_:!,_;
////////////////////////////////////////////////////////////////////////////////////
// usage: Trig_Accel:_
Trig_Accel = Accel(accel_x,accel_y,accel_z):range_utile:bonk:antirebond<:(_>mem);
// VUMETER ////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------------
hmeter(x) = attach(x, envelop(x) : hbargraph("h:Part G/vumeter[2][unit:dB]", -70, +0));
envelop = abs : max ~ -(1.0/ma.SR) : max(ba.db2linear(-70)) : ba.linear2db;
//-----------------------------------------------------------------------------------
// SAMPLE & HOLD ////////////////////////////////////////////////////////////////////
sh(x,t) = select2(t,_,x) ~ _;
// MUTLISWITCH ////////////////////////////////////////////////////////////////////
//multiswitch(n,s) = _<:par(i,n, *(i==int(s)));
multiswitch(n,select,trig) = par(i,n, trig*(i==int(select))) ;
// MULTISELECT ////////////////////////////////////////////////////////////////////
multiselect(n,s) = par(i,n, *(i==int(s))) :> _;
//-----------------------------------------------------------------------------------
/// special phasor start by a trig down and stop after 1 cycle…----------------------
rampa(time,trig) = delta : (+ : select2(trig,_,0) : max(0)) ~ _ : raz
with {
raz(x) = select2 (x > 1, x, 0);
f = 1/(time:max(0.001));
delta = sh(f/ma.SR,trig);
};
//-----------------------------------------------------------------------------------
/// Random Selection ID /////////////////////////////////////////////////////////////
random_ID = no.noise:+(1):*(0.5):*(nb_soundfile):int;
//-----------------------------------------------------------------------------------
/// Selection Random Audio file with accelerometer trigger /////////////////////////
select_a_sound(x) = sh(random_ID,x):int;
//---------------------------------------------------------------------------------------
// read table with linear interpolation
// wf : waveform to read
// x : position to read (0 <= x < size(wf))
lintable(wf,pos) = linterpolation(y0,y1,d)
with {
size = wf : _,!; // size of the waveform
wave = wf : !,_; // content of the waveform
x = fmod(pos+size,size); // make sure we don't read beyond boundaries
x0 = int(x); //
x1 = int(x+1); //
d = x-x0;
y0 = rdtable(size+3,wave,x0); //
y1 = rdtable(size+3,wave,x1); //
linterpolation(v0,v1,c) = v0*(1-c)+v1*c;
};
//---------------------------------------------------------------------------------------
// player(wf, play) : play a waveform while play is 1
// (automatically disable itself when it doesn't have to play)
// wf : the waveform to play
// play : control signal 1-play, 0-stop
linplayer(wf, play) = index : lintable(wf)
with {
index = play : (* : max(-size) : min(size-0.000001)) ~ +(speed); // grow index while playing, 0 otherwise
size = wf : _,!;
speed = hslider("speed [hidden:1]",1,-2,2,0.0001);
};
| https://raw.githubusercontent.com/grame-cncm/GeekBagatelles/d66ba1e022e0ca2386008f30971cd860a97256cb/Part_Gpublic.dsp | faust | PROCESS
-----------------------------------------------------------------------------------
/ Random Selection ID /////////////////////////////////////////////////////////////
-----------------------------------------------------------------------------------
/ Selection Random Audio file with accelerometer trigger /////////////////////////
13sec
---------------------------------------------------------------------------------------
Soundfiles
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////// ANALYSE INPUT FROM ACCELEROMETER //////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////// Acellerometer ////////////////////////////////////////
////////////////////////////// Bonk ////////////////////////////////////////
////////////////////////////// Antirebond ////////////////////////////////////////
usage: _:antirebond:_
input signal will be binary type... int this way it was created
logical need to don't listen input during "time_count"
time count in ms
//////////////////////////////////////////////////////////////////////////////////
usage: Trig_Accel:_
VUMETER ////////////////////////////////////////////////////////////////////
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
SAMPLE & HOLD ////////////////////////////////////////////////////////////////////
MUTLISWITCH ////////////////////////////////////////////////////////////////////
multiswitch(n,s) = _<:par(i,n, *(i==int(s)));
MULTISELECT ////////////////////////////////////////////////////////////////////
-----------------------------------------------------------------------------------
/ special phasor start by a trig down and stop after 1 cycle…----------------------
-----------------------------------------------------------------------------------
/ Random Selection ID /////////////////////////////////////////////////////////////
-----------------------------------------------------------------------------------
/ Selection Random Audio file with accelerometer trigger /////////////////////////
---------------------------------------------------------------------------------------
read table with linear interpolation
wf : waveform to read
x : position to read (0 <= x < size(wf))
size of the waveform
content of the waveform
make sure we don't read beyond boundaries
---------------------------------------------------------------------------------------
player(wf, play) : play a waveform while play is 1
(automatically disable itself when it doesn't have to play)
wf : the waveform to play
play : control signal 1-play, 0-stop
grow index while playing, 0 otherwise | declare name "Part_Gpublic";
declare version "0.2";
declare author "Christophe Lebreton";
declare license "BSD";
import("stdfaust.lib");
nb_soundfile = 4;
process = play:(@(ramp*ma.SR): select_sound),(rampa(ramp):1,_:-):*:*(temporisation:si.smooth(0.998)):*(gain)
with {
play = ((1-Trig_Accel)<:sh(1),_:*),Trig_Accel;
sh(x,t) = select2(t,x,_) ~ _;
select_sound = _<:select_a_sound,par(i,nb_soundfile,linplayer(sound(i))):multiselect(nb_soundfile):>_;
random_ID = no.noise:+(1):*(0.5):*(nb_soundfile):int;
select_a_sound(x) = sh(random_ID,x):int;
ramp = 0.001;
gain = hslider("gain_dB [acc:2 0 -8 -3 -0.5] [hidden:1]",0.5,0,1,0.001):fi.lowpass(1,1.5);
};
import("vocalise_01_waveform.dsp");
import("vocalise_02_waveform.dsp");
import("vocalise_03_waveform.dsp");
import("freunde_vocalise_waveform.dsp");
sound(0) = vocalise_01_0;
sound(1) = vocalise_02_0;
sound(2) = vocalise_03_0;
sound(3) = freunde_vocalise_0;
accel_x = hslider("acc_x [acc:0 0 -30 0 30][hidden:1]",0,-1,1,0.001);
accel_y = hslider("acc_y [acc:1 0 -30 0 30][hidden:1]",0,-1,1,0.001);
accel_z = hslider("acc_z [acc:2 0 -30 0 30][hidden:1]",0,-1,1,0.001);
Accel(x,y,z) = (x*x),(y*y),(z*z):> sqrt;
range_utile = - (offest:*(0.01)):max(0)
with {
offest = hslider("offset [hidden:1]",9,0,100,0.1);
};
bonk(c) = (c-c@t)>a
with {
t = hslider("winsdow_size [unit:ms][hidden:1]",1,1,7000,1);
a = hslider("threshold [hidden:1]",30,0,30,0.01)*0.01;
};
choix = select2(_,1,_);
logic_selector = _,(0): ==;
time_base = 1/ma.SR;
time_count (reset) = +(0)~(+(time_base): * (reset)):*(1000);
decount =_<:time_count<(fin),_:*
with {
fin = hslider("antirebond [unit:ms][hidden:1]", 250,0,500,1);
};
antirebond = (choix : decount <: logic_selector,_) ~_:!,_;
Trig_Accel = Accel(accel_x,accel_y,accel_z):range_utile:bonk:antirebond<:(_>mem);
hmeter(x) = attach(x, envelop(x) : hbargraph("h:Part G/vumeter[2][unit:dB]", -70, +0));
envelop = abs : max ~ -(1.0/ma.SR) : max(ba.db2linear(-70)) : ba.linear2db;
sh(x,t) = select2(t,_,x) ~ _;
multiswitch(n,select,trig) = par(i,n, trig*(i==int(select))) ;
multiselect(n,s) = par(i,n, *(i==int(s))) :> _;
rampa(time,trig) = delta : (+ : select2(trig,_,0) : max(0)) ~ _ : raz
with {
raz(x) = select2 (x > 1, x, 0);
f = 1/(time:max(0.001));
delta = sh(f/ma.SR,trig);
};
random_ID = no.noise:+(1):*(0.5):*(nb_soundfile):int;
select_a_sound(x) = sh(random_ID,x):int;
lintable(wf,pos) = linterpolation(y0,y1,d)
with {
d = x-x0;
linterpolation(v0,v1,c) = v0*(1-c)+v1*c;
};
linplayer(wf, play) = index : lintable(wf)
with {
size = wf : _,!;
speed = hslider("speed [hidden:1]",1,-2,2,0.0001);
};
|
39eebfd6428ebbdef04d4579dc2eea40c905984015910bcc36f0e20c2d7e0a9e | RuolunWeng/ruolunweng.github.io | SBrass.dsp | declare name "Brass";
declare description "WaveGuide Brass instrument from STK";
declare author "Romain Michon ([email protected])";
declare copyright "Romain Michon";
declare version "1.0";
declare licence "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license);
//declare description "A simple brass instrument waveguide model, a la Cook (TBone, HosePlayer).";
declare reference "https://ccrma.stanford.edu/~jos/pasp/Brasses.html";
//Modification GRAME July 2015
/* =============== DESCRIPTION ================= :
- Brass instrument
- Turn ON brass (0=OFF, 1=ON)
- Head = Silence
- Upward = Higher frequency
- Downward = Lower frequency
*/
import("stdfaust.lib");
instrument=library("instruments.lib");
//==================== INSTRUMENT =======================
process = (borePressure <: deltaPressure,_ :
(lipFilter <: *(mouthPressure),(1-_)),_ : _, * :> + :
fi.dcblocker) ~ (boreDelay) :
*(gain)*(2);
//==================== GUI SPECIFICATION ================
freq = hslider("h:[1]Instrument/Frequency[1][unit:Hz] [tooltip:Tone frequency][acc:1 1 -10 0 10]", 300,170,700,1):si.smooth(0.999);
gain = 0.8;
gate = hslider("h:[1]Instrument/ ON/OFF",0,0,1,1);
lipTension = 0.780;
pressure = 1;
slideLength = 0.041;
vibratoFreq = hslider("v:[3]Parameters/h:/Vibrato Frequency (Vibrato Envelope)[unit:Hz][style:knob][unit:Hz][acc:0 1 -10 0 10]", 5,1,10,0.01);
vibratoGain = 0.05;
vibratoBegin = 0.05;
vibratoAttack = 0.5;
vibratoRelease = 0.1;
envelopeDecay = 0.001;
envelopeAttack = 0.005;
envelopeRelease = 0.07;
//==================== SIGNAL PROCESSING ================
//----------------------- Synthesis parameters computing and functions declaration ----------------------------
//lips are simulated by a biquad filter whose output is squared and hard-clipped, bandPassH and saturationPos are declared in instrument.lib
lipFilterFrequency = freq*pow(4,(2*lipTension)-1);
lipFilter = *(0.03) : instrument.bandPassH(lipFilterFrequency,0.997) <: * : instrument.saturationPos;
//delay times in number of samples
slideTarget = ((ma.SR/freq)*2 + 3)*(0.5 + slideLength);
boreDelay = de.fdelay(4096,slideTarget);
//----------------------- Algorithm implementation ----------------------------
//vibrato
vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate);
//envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato
breathPressure = pressure*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato;
mouthPressure = 0.3*breathPressure;
//scale the delay feedback
borePressure = *(0.85);
//differencial presure
deltaPressure = mouthPressure - _;
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SBrass.dsp | faust | Synthesis Tool Kit 4.3 (MIT style license);
declare description "A simple brass instrument waveguide model, a la Cook (TBone, HosePlayer).";
Modification GRAME July 2015
=============== DESCRIPTION ================= :
- Brass instrument
- Turn ON brass (0=OFF, 1=ON)
- Head = Silence
- Upward = Higher frequency
- Downward = Lower frequency
==================== INSTRUMENT =======================
==================== GUI SPECIFICATION ================
==================== SIGNAL PROCESSING ================
----------------------- Synthesis parameters computing and functions declaration ----------------------------
lips are simulated by a biquad filter whose output is squared and hard-clipped, bandPassH and saturationPos are declared in instrument.lib
delay times in number of samples
----------------------- Algorithm implementation ----------------------------
vibrato
envelope (Attack / Decay / Sustain / Release), breath pressure and vibrato
scale the delay feedback
differencial presure | declare name "Brass";
declare description "WaveGuide Brass instrument from STK";
declare author "Romain Michon ([email protected])";
declare copyright "Romain Michon";
declare version "1.0";
declare reference "https://ccrma.stanford.edu/~jos/pasp/Brasses.html";
import("stdfaust.lib");
instrument=library("instruments.lib");
process = (borePressure <: deltaPressure,_ :
(lipFilter <: *(mouthPressure),(1-_)),_ : _, * :> + :
fi.dcblocker) ~ (boreDelay) :
*(gain)*(2);
freq = hslider("h:[1]Instrument/Frequency[1][unit:Hz] [tooltip:Tone frequency][acc:1 1 -10 0 10]", 300,170,700,1):si.smooth(0.999);
gain = 0.8;
gate = hslider("h:[1]Instrument/ ON/OFF",0,0,1,1);
lipTension = 0.780;
pressure = 1;
slideLength = 0.041;
vibratoFreq = hslider("v:[3]Parameters/h:/Vibrato Frequency (Vibrato Envelope)[unit:Hz][style:knob][unit:Hz][acc:0 1 -10 0 10]", 5,1,10,0.01);
vibratoGain = 0.05;
vibratoBegin = 0.05;
vibratoAttack = 0.5;
vibratoRelease = 0.1;
envelopeDecay = 0.001;
envelopeAttack = 0.005;
envelopeRelease = 0.07;
lipFilterFrequency = freq*pow(4,(2*lipTension)-1);
lipFilter = *(0.03) : instrument.bandPassH(lipFilterFrequency,0.997) <: * : instrument.saturationPos;
slideTarget = ((ma.SR/freq)*2 + 3)*(0.5 + slideLength);
boreDelay = de.fdelay(4096,slideTarget);
vibrato = vibratoGain*os.osc(vibratoFreq)*instrument.envVibrato(vibratoBegin,vibratoAttack,100,vibratoRelease,gate);
breathPressure = pressure*en.adsr(envelopeAttack,envelopeDecay,1,envelopeRelease,gate) + vibrato;
mouthPressure = 0.3*breathPressure;
borePressure = *(0.85);
deltaPressure = mouthPressure - _;
|
753e289e8a55ff7636e3352f8b46f509faf55545433c5328bcc22a2f5ca95db8 | rmichon/multiKeyboard | midiOnly.dsp | //################################### midiOnly.dsp ######################################
// Faust instrument specifically designed for `faust2smartkeyb` implementing a MIDI
// controllable app where the mobile device's touch screen is used to control
// specific parameters of the synth continuously using two separate X/Y control surfaces.
//
// ## `SmartKeyboard` Use Strategy
//
// The `SmartKeyboard` configuration for this instrument consists in a single keyboard
// with two keys. Each key implements a control surface. `Piano Keyboard` mode is
// disabled so that key names are not displayed and that keys don't change color when
// touched. Finally, `Send Freq` is set to 0 so that new voices are not allocated by
// the touch screen and that the `freq` and `bend` parameters are not computed.
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with `faust2smartkeyb`. For best results,
// we recommend to use the following parameters to compile it:
//
// ```
// faust2smartkeyb [-ios/-android] -effect reverb.dsp midiOnly.dsp
// ```
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
// Interface with 4 polyphnic keyboards of 13 keys with the same config
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Keyboard 0 - Number of Keys':'2',
'Keyboard 0 - Send Freq':'0',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 0 - Key 0 - Label':'Mod Index',
'Keyboard 0 - Key 1 - Label':'Mod Freq'
}";
import("stdfaust.lib");
f = hslider("freq",300,50,2000,0.01);
bend = hslider("bend[midi:pitchwheel]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
key = hslider("key",0,0,1,1) : int;
x = hslider("x[midi:ctrl 1]",0.5,0,1,0.01) : si.smoo;
s = hslider("sustain[midi:ctrl 64]",0,0,1,1);
t = button("gate");
// fomating parameters
gate = t+s : min(1);
freq = f*bend;
index = (x : ba.sAndH(key == 0))*1000;
modFreqRatio = x : ba.sAndH(key == 1);
envelope = gain*gate : si.smoo;
process = sy.fm((freq,freq + freq*modFreqRatio),index*envelope)*envelope <: _,_; | https://raw.githubusercontent.com/rmichon/multiKeyboard/7d04f591fac974a91e4b322c3cb757b8cbb50443/faust/examples/midiOnly.dsp | faust | ################################### midiOnly.dsp ######################################
Faust instrument specifically designed for `faust2smartkeyb` implementing a MIDI
controllable app where the mobile device's touch screen is used to control
specific parameters of the synth continuously using two separate X/Y control surfaces.
## `SmartKeyboard` Use Strategy
The `SmartKeyboard` configuration for this instrument consists in a single keyboard
with two keys. Each key implements a control surface. `Piano Keyboard` mode is
disabled so that key names are not displayed and that keys don't change color when
touched. Finally, `Send Freq` is set to 0 so that new voices are not allocated by
the touch screen and that the `freq` and `bend` parameters are not computed.
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with `faust2smartkeyb`. For best results,
we recommend to use the following parameters to compile it:
```
faust2smartkeyb [-ios/-android] -effect reverb.dsp midiOnly.dsp
```
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
Interface with 4 polyphnic keyboards of 13 keys with the same config
fomating parameters |
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Keyboard 0 - Number of Keys':'2',
'Keyboard 0 - Send Freq':'0',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 0 - Key 0 - Label':'Mod Index',
'Keyboard 0 - Key 1 - Label':'Mod Freq'
}";
import("stdfaust.lib");
f = hslider("freq",300,50,2000,0.01);
bend = hslider("bend[midi:pitchwheel]",1,0,10,0.01) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
key = hslider("key",0,0,1,1) : int;
x = hslider("x[midi:ctrl 1]",0.5,0,1,0.01) : si.smoo;
s = hslider("sustain[midi:ctrl 64]",0,0,1,1);
t = button("gate");
gate = t+s : min(1);
freq = f*bend;
index = (x : ba.sAndH(key == 0))*1000;
modFreqRatio = x : ba.sAndH(key == 1);
envelope = gain*gate : si.smoo;
process = sy.fm((freq,freq + freq*modFreqRatio),index*envelope)*envelope <: _,_; |
3ef2e3501e36b2b7d49fcb68a3d3a8740ecd0845830461f683559debb94d38d1 | olegkapitonov/Kapitonov-Plugins-Pack | kpp_bluedream.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 booster/overdrive pedal emulator with equalizer.
* When the _voice_ knob is in the left position the pedal works as a booster
* When the _voice_ knob is in the right position the pedal works as a "tube screamer"
*
* Process chain:
*
* input->pre_filter->*drive_knob->overdrive->equalizer->post-filter->*volume_knob->output
* ->---voice---> ->---voice---->
*
*
* pre-filter - highpass, 1 order, 720 Hz. Bypassed when _voice_ is in right position.
* overdrive - nonlinear element, emulation of the push-pull tube amplifier.
* equalizer - tonestack, bass-middle-treble.
* post-filter - lowpass, 1 order, 720 Hz. Bypassed when _voice_ is in right position.
*/
declare name "kpp_bluedream";
declare author "Oleg Kapitonov";
declare license "GPLv3";
declare version "1.1";
import("stdfaust.lib");
process = output with {
// Bypass button, 0 - pedal on, 1 -pedal off (bypass on)
bypass = checkbox("99_bypass");
drive = vslider("drive",63,0,100,0.01);
volume = vslider("volume",0.5,0,1,0.001);
voice = vslider("voice",0.5,0,1,0.001);
tonestack_low = vslider("bass",-6.9,-15,15,0.1);
tonestack_middle = vslider("middle",-3.9,-15,15,0.1);
tonestack_high = vslider("treble",0.6,-15,15,0.1);
tonestack_low_freq = 70;
tonestack_middle_freq = 500;
tonestack_high_freq = 10000;
tonestack_low_band = 200;
tonestack_middle_band = 700;
tonestack_high_band = 18000;
clamp = min(2.0) : max(-2.0);
// Bias of each half-wave so that they better match
bias = 0.2;
// Distortion threshold, if the signal is bigger
// it starts to get distorted
Upor = 0.2;
// Softness of distortion
Kreg = 1.0;
tube(Kreg,Upor,bias,cut) = main : +(bias) : max(cut) with {
Ks(x) = 1/(max((x-Upor)*(Kreg),0)+1);
Ksplus(x) = Upor - x*Upor;
main(Uin) = (Uin * Ks(Uin) + Ksplus(Ks(Uin)));
};
/*--------Processing chain-----------------*/
// Used 2 tubes - for positive and negative half-waves (push-pull).
// Stereo input and output, but during processing the signal is
// converted to mono.
pre_filter = _ <: fi.highpass(1, 720) * min((1 - voice + 0.75 * drive / 100), 1),
*(max((voice - 0.75 * drive / 100), 0)) : + ;
post_filter = _ <: fi.lowpass(1, 720) * min((1 - voice + 0.75 * drive / 100), 1),
*(max((voice - 0.75 * drive / 100), 0)) : + ;
stage_stomp = pre_filter : fi.lowpass(1,9000) : _<:
_,*(-1.0) : tube(Kreg,Upor,bias,0), tube(Kreg,Upor,bias,0) : - :
*(ba.db2linear(volume * 50.0 * (1 - voice * 0.25) ) / 100.0) :
fi.peak_eq(tonestack_low,tonestack_low_freq,tonestack_low_band) :
fi.peak_eq(tonestack_middle,tonestack_middle_freq,tonestack_middle_band) :
fi.peak_eq(tonestack_high,tonestack_high_freq,tonestack_high_band) :
clamp :
post_filter ;
stomp = fi.dcblocker : clamp : *(ba.db2linear(drive * 0.4 * (1 - voice * 0.5))-1) :
stage_stomp : fi.dcblocker;
output = _ : stomp : _;
};
| https://raw.githubusercontent.com/olegkapitonov/Kapitonov-Plugins-Pack/ed4541172d53ecf04bad43cd583365f278ccf176/LADSPA/kpp_bluedream/kpp_bluedream.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 booster/overdrive pedal emulator with equalizer.
* When the _voice_ knob is in the left position the pedal works as a booster
* When the _voice_ knob is in the right position the pedal works as a "tube screamer"
*
* Process chain:
*
* input->pre_filter->*drive_knob->overdrive->equalizer->post-filter->*volume_knob->output
* ->---voice---> ->---voice---->
*
*
* pre-filter - highpass, 1 order, 720 Hz. Bypassed when _voice_ is in right position.
* overdrive - nonlinear element, emulation of the push-pull tube amplifier.
* equalizer - tonestack, bass-middle-treble.
* post-filter - lowpass, 1 order, 720 Hz. Bypassed when _voice_ is in right position.
Bypass button, 0 - pedal on, 1 -pedal off (bypass on)
Bias of each half-wave so that they better match
Distortion threshold, if the signal is bigger
it starts to get distorted
Softness of distortion
--------Processing chain-----------------
Used 2 tubes - for positive and negative half-waves (push-pull).
Stereo input and output, but during processing the signal is
converted to mono. |
declare name "kpp_bluedream";
declare author "Oleg Kapitonov";
declare license "GPLv3";
declare version "1.1";
import("stdfaust.lib");
process = output with {
bypass = checkbox("99_bypass");
drive = vslider("drive",63,0,100,0.01);
volume = vslider("volume",0.5,0,1,0.001);
voice = vslider("voice",0.5,0,1,0.001);
tonestack_low = vslider("bass",-6.9,-15,15,0.1);
tonestack_middle = vslider("middle",-3.9,-15,15,0.1);
tonestack_high = vslider("treble",0.6,-15,15,0.1);
tonestack_low_freq = 70;
tonestack_middle_freq = 500;
tonestack_high_freq = 10000;
tonestack_low_band = 200;
tonestack_middle_band = 700;
tonestack_high_band = 18000;
clamp = min(2.0) : max(-2.0);
bias = 0.2;
Upor = 0.2;
Kreg = 1.0;
tube(Kreg,Upor,bias,cut) = main : +(bias) : max(cut) with {
Ks(x) = 1/(max((x-Upor)*(Kreg),0)+1);
Ksplus(x) = Upor - x*Upor;
main(Uin) = (Uin * Ks(Uin) + Ksplus(Ks(Uin)));
};
pre_filter = _ <: fi.highpass(1, 720) * min((1 - voice + 0.75 * drive / 100), 1),
*(max((voice - 0.75 * drive / 100), 0)) : + ;
post_filter = _ <: fi.lowpass(1, 720) * min((1 - voice + 0.75 * drive / 100), 1),
*(max((voice - 0.75 * drive / 100), 0)) : + ;
stage_stomp = pre_filter : fi.lowpass(1,9000) : _<:
_,*(-1.0) : tube(Kreg,Upor,bias,0), tube(Kreg,Upor,bias,0) : - :
*(ba.db2linear(volume * 50.0 * (1 - voice * 0.25) ) / 100.0) :
fi.peak_eq(tonestack_low,tonestack_low_freq,tonestack_low_band) :
fi.peak_eq(tonestack_middle,tonestack_middle_freq,tonestack_middle_band) :
fi.peak_eq(tonestack_high,tonestack_high_freq,tonestack_high_band) :
clamp :
post_filter ;
stomp = fi.dcblocker : clamp : *(ba.db2linear(drive * 0.4 * (1 - voice * 0.5))-1) :
stage_stomp : fi.dcblocker;
output = _ : stomp : _;
};
|
a6d6a5bf715886c855ac588ce51ee7cd124c3b9f967c875341409b49f52e636f | sadko4u/tamgamp.lv2 | tone.dsp | /*
* Simulation of Guitarix tonestack chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
declare id "tone";
declare version "0.01";
declare author "Hermann Meyer";
declare license "BSD";
declare copyright "(C) Hermann Meyer 2008";
import("stdfaust.lib");
import("amp_sim.lib");
/**-----------------------------------------------
The default tone control
Low and high shelf filters, from Robert Bristow-Johnson's "Audio
EQ Cookbook", see http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt.
-----------------------------------------------*/
filter(b0,b1,b2,a0,a1,a2) = f : (+ ~ g)
with {
f(x) = (b0/a0)*x+(b1/a0)*x'+(b2/a0)*x'';
g(y) = 0-(a1/a0)*y-(a2/a0)*y';
};
gxlow_shelf(f0,g) = filter(b0,b1,b2,a0,a1,a2)
with {
S = 1;
A = pow(10,g/40);
w0 = 2*ma.PI*f0/ma.SR;
alpha = sin(w0)/2 * sqrt( (A + 1/A)*(1/S - 1) + 2 );
b0 = A*( (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha );
b1 = 2*A*( (A-1) - (A+1)*cos(w0) );
b2 = A*( (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha );
a0 = (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha;
a1 = -2*( (A-1) + (A+1)*cos(w0) );
a2 = (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha;
};
gxhigh_shelf(f0,g) = filter(b0,b1,b2,a0,a1,a2)
with {
S = 1;
A = pow(10,g/40);
w0 = 2*ma.PI*f0/ma.SR;
alpha = sin(w0)/2 * sqrt( (A + 1/A)*(1/S - 1) + 2 );
b0 = A*( (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha );
b1 = -2*A*( (A-1) + (A+1)*cos(w0) );
b2 = A*( (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha );
a0 = (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha;
a1 = 2*( (A-1) - (A+1)*cos(w0) );
a2 = (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha;
};
/* Fixed bass and treble frequencies.*/
bass_freq = 600;
treble_freq = 2400;
bass_gain = vslider("bass", 0, -20, 20, 0.1);
mid_gain = vslider("middle", 0, -20, 20, 0.1)/2;
treble_gain = vslider("treble", 0, -20, 20, 0.1);
tone(b,m,t) = gxlow_shelf(bass_freq,b-m) :
gxlow_shelf(treble_freq,m):
gxhigh_shelf(bass_freq,m) :
gxhigh_shelf(treble_freq,t-m);
process = add_dc :
gxlow_shelf(bass_freq,bass_gain-mid_gain) :
gxlow_shelf(treble_freq,mid_gain):
gxhigh_shelf(bass_freq,mid_gain) :
gxhigh_shelf(treble_freq,treble_gain-mid_gain);
| https://raw.githubusercontent.com/sadko4u/tamgamp.lv2/426da74142fcb6b7687a35b2b1dda3392e171b92/src/faust/tone.dsp | faust |
* Simulation of Guitarix tonestack chain
*
* Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
* Copyright (C) 2011 Pete Shorthose <http://guitarix.org/>
* This file is part of tamgamp.lv2 <https://github.com/sadko4u/tamgamp.lv2>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*-----------------------------------------------
The default tone control
Low and high shelf filters, from Robert Bristow-Johnson's "Audio
EQ Cookbook", see http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt.
-----------------------------------------------
Fixed bass and treble frequencies. |
declare id "tone";
declare version "0.01";
declare author "Hermann Meyer";
declare license "BSD";
declare copyright "(C) Hermann Meyer 2008";
import("stdfaust.lib");
import("amp_sim.lib");
filter(b0,b1,b2,a0,a1,a2) = f : (+ ~ g)
with {
f(x) = (b0/a0)*x+(b1/a0)*x'+(b2/a0)*x'';
g(y) = 0-(a1/a0)*y-(a2/a0)*y';
};
gxlow_shelf(f0,g) = filter(b0,b1,b2,a0,a1,a2)
with {
S = 1;
A = pow(10,g/40);
w0 = 2*ma.PI*f0/ma.SR;
alpha = sin(w0)/2 * sqrt( (A + 1/A)*(1/S - 1) + 2 );
b0 = A*( (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha );
b1 = 2*A*( (A-1) - (A+1)*cos(w0) );
b2 = A*( (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha );
a0 = (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha;
a1 = -2*( (A-1) + (A+1)*cos(w0) );
a2 = (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha;
};
gxhigh_shelf(f0,g) = filter(b0,b1,b2,a0,a1,a2)
with {
S = 1;
A = pow(10,g/40);
w0 = 2*ma.PI*f0/ma.SR;
alpha = sin(w0)/2 * sqrt( (A + 1/A)*(1/S - 1) + 2 );
b0 = A*( (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha );
b1 = -2*A*( (A-1) + (A+1)*cos(w0) );
b2 = A*( (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha );
a0 = (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha;
a1 = 2*( (A-1) - (A+1)*cos(w0) );
a2 = (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha;
};
bass_freq = 600;
treble_freq = 2400;
bass_gain = vslider("bass", 0, -20, 20, 0.1);
mid_gain = vslider("middle", 0, -20, 20, 0.1)/2;
treble_gain = vslider("treble", 0, -20, 20, 0.1);
tone(b,m,t) = gxlow_shelf(bass_freq,b-m) :
gxlow_shelf(treble_freq,m):
gxhigh_shelf(bass_freq,m) :
gxhigh_shelf(treble_freq,t-m);
process = add_dc :
gxlow_shelf(bass_freq,bass_gain-mid_gain) :
gxlow_shelf(treble_freq,mid_gain):
gxhigh_shelf(bass_freq,mid_gain) :
gxhigh_shelf(treble_freq,treble_gain-mid_gain);
|
11eaf02be52ba01ad298b9ec1fd68dc84a52680e88cd9b0a1865c8b3dba32cbd | amstramgrame/amstramgrame | exfaust0.dsp |
declare name "AcidSea";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
/*
A filtered noise with flanger and comb filter
*/
import("stdfaust.lib");
// Linear interpolation when value changes
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);
};
// Controls
freq = hslider("freq[acc: 1 0 -10 0 10]", 2, 1.5, 10, 0.01);
mixer = hslider("mix[knob:2]", 0, 0, 1, 0.01) : si.smoo;
comb_ctl = hslider("comb[acc: 0 0 -10 0 10]", 512, 256, 2048, 1);
filter_fq = hslider("f_freq[acc: 1 0 -10 0 10]", 0.001, 0.001,0.999, 0.0001 ) : line(2);
lfo_add = hslider("lfo[acc: 0 0 -10 0 10]", 0, 0, 4, 0.01);
delay = os.osc( hslider("flanger_freq[acc: 2 0 -10 0 10]", 0.1, 0.01, 1, 0.001) /(2) ) :
abs : *(9);
btn = button("change[switch:1]");
depth = 0.7;
fb = 0.7;
synth = no.noise
: pf.flanger_mono(10, freq + (os.osc(freq / 8)) , 1, 0.9, 0);
cmb = synth
: fi.fbcombfilter(2048, comb_ctl, 0.5);
get_base_fq(trig) = abs(no.noise) * 100 + 100
: ba.sAndH(trig);
base_fq = get_base_fq(btn + os.impulse)
: line(mult);
get_mult(trig) = abs(no.noise) * 8 + 1
: ba.sAndH(trig);
mult = get_mult(btn + os.impulse);
saw = sum(n, 4, os.sawtooth(base_fq + (n * (base_fq / 2))) / (n + 1) *
os.lf_pulsetrain((n +1) / 2 + lfo_add, 0.5));
sg = synth + (cmb * mixer);
process = sg
: *(0.35)
: ve.korg35LPF(filter_fq, 1);
| https://raw.githubusercontent.com/amstramgrame/amstramgrame/4df99bfbae994fc9dcb4012190335e29255b411e/web/mkdocs/docs/gramophone/programs/exfaust0/exfaust0.dsp | faust |
A filtered noise with flanger and comb filter
Linear interpolation when value changes
Controls |
declare name "AcidSea";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
import("stdfaust.lib");
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);
};
freq = hslider("freq[acc: 1 0 -10 0 10]", 2, 1.5, 10, 0.01);
mixer = hslider("mix[knob:2]", 0, 0, 1, 0.01) : si.smoo;
comb_ctl = hslider("comb[acc: 0 0 -10 0 10]", 512, 256, 2048, 1);
filter_fq = hslider("f_freq[acc: 1 0 -10 0 10]", 0.001, 0.001,0.999, 0.0001 ) : line(2);
lfo_add = hslider("lfo[acc: 0 0 -10 0 10]", 0, 0, 4, 0.01);
delay = os.osc( hslider("flanger_freq[acc: 2 0 -10 0 10]", 0.1, 0.01, 1, 0.001) /(2) ) :
abs : *(9);
btn = button("change[switch:1]");
depth = 0.7;
fb = 0.7;
synth = no.noise
: pf.flanger_mono(10, freq + (os.osc(freq / 8)) , 1, 0.9, 0);
cmb = synth
: fi.fbcombfilter(2048, comb_ctl, 0.5);
get_base_fq(trig) = abs(no.noise) * 100 + 100
: ba.sAndH(trig);
base_fq = get_base_fq(btn + os.impulse)
: line(mult);
get_mult(trig) = abs(no.noise) * 8 + 1
: ba.sAndH(trig);
mult = get_mult(btn + os.impulse);
saw = sum(n, 4, os.sawtooth(base_fq + (n * (base_fq / 2))) / (n + 1) *
os.lf_pulsetrain((n +1) / 2 + lfo_add, 0.5));
sg = synth + (cmb * mixer);
process = sg
: *(0.35)
: ve.korg35LPF(filter_fq, 1);
|
e427e6a1f6781b1a88c7cd07220074fff7200b7af05e685450532ec1bde9a1d6 | moforte/sam-faust | freeverb.dsp | import("stdfaust.lib");
import("layout2.dsp");
declare name "freeverb";
declare version "1.0";
declare author "Grame";
declare license "BSD";
declare copyright "(c) GRAME 2006 and MoForte Inc. 2017";
declare reference "https://ccrma.stanford.edu/~jos/pasp/Freeverb.html";
//======================================================
//
// Freeverb
// Faster version using fixed delays (20% gain)
//
//======================================================
// Constant Parameters
//--------------------
fixedgain = 0.015; //value of the gain of fxctrl
scalewet = 3.0;
scaledry = 2.0;
scaledamp = 0.4;
scaleroom = 0.28;
offsetroom = 0.7;
initialroom = 0.5;
initialdamp = 0.5;
initialwet = 1.0/scalewet;
initialdry = 0;
initialwidth= 1.0;
initialmode = 0.0;
freezemode = 0.5;
stereospread= 23;
allpassfeed = 0.5; //feedback of the delays used in allpass filters
// Filter Parameters
//------------------
combtuningL1 = 1116;
combtuningL2 = 1188;
combtuningL3 = 1277;
combtuningL4 = 1356;
combtuningL5 = 1422;
combtuningL6 = 1491;
combtuningL7 = 1557;
combtuningL8 = 1617;
allpasstuningL1 = 556;
allpasstuningL2 = 441;
allpasstuningL3 = 341;
allpasstuningL4 = 225;
// Control Sliders
//--------------------
// Damp : filters the high frequencies of the echoes (especially active for great values of RoomSize)
// RoomSize : size of the reverberation room
// Dry : original signal
// Wet : reverberated signal
dampSlider = rkg(vslider("Damp [midi:ctrl 4] [style:knob]",0.5, 0, 1, 0.025))*scaledamp;
roomsizeSlider = rkg(vslider("RoomSize [midi:ctrl 3] [style:knob]", 0.5, 0, 1, 0.025))*scaleroom + offsetroom;
wetSlider = rkg(vslider("Wet [midi:ctrl 2] [style:knob]", 0.3333, 0, 1, 0.025));
combfeed = roomsizeSlider;
// Comb and Allpass filters
//-------------------------
allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_);
comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb));
// Reverb components
//------------------
monoReverb(fb1, fb2, damp, spread)
= _ <: comb(combtuningL1+spread, fb1, damp),
comb(combtuningL2+spread, fb1, damp),
comb(combtuningL3+spread, fb1, damp),
comb(combtuningL4+spread, fb1, damp),
comb(combtuningL5+spread, fb1, damp),
comb(combtuningL6+spread, fb1, damp),
comb(combtuningL7+spread, fb1, damp),
comb(combtuningL8+spread, fb1, damp)
+>
allpass (allpasstuningL1+spread, fb2)
: allpass (allpasstuningL2+spread, fb2)
: allpass (allpasstuningL3+spread, fb2)
: allpass (allpasstuningL4+spread, fb2)
;
monoReverbToStereo(fb1, fb2, damp, spread)
= + <: monoReverb(fb1, fb2, damp, 0) <: _,_;
stereoReverb(fb1, fb2, damp, spread)
= + <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread);
monoToStereoReverb(fb1, fb2, damp, spread)
= _ <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread);
// fxctrl : add an input gain and a wet-dry control to a stereo FX
//----------------------------------------------------------------
fxctrl(g,w,Fx) = _,_ <: (*(g),*(g) : Fx : *(w),*(w)), *(1-w), *(1-w) +> _,_;
rbp = 1-int(rsg(vslider("[0] Enable [midi:ctrl 102][style:knob]",0,0,1,1)));
// Freeverb
//---------
//JOS:freeverb = fxctrl(fixedgain, wetSlider, stereoReverb(combfeed, allpassfeed, dampSlider, stereospread));
freeverb = fxctrl(fixedgain, wetSlider, monoReverbToStereo(combfeed, allpassfeed, dampSlider, stereospread));
process = ba.bypass2(rbp,freeverb);
| https://raw.githubusercontent.com/moforte/sam-faust/85be03f262e384c1befa9eaac237e052040b2cc1/faust-examples/freeverb/freeverb.dsp | faust | ======================================================
Freeverb
Faster version using fixed delays (20% gain)
======================================================
Constant Parameters
--------------------
value of the gain of fxctrl
feedback of the delays used in allpass filters
Filter Parameters
------------------
Control Sliders
--------------------
Damp : filters the high frequencies of the echoes (especially active for great values of RoomSize)
RoomSize : size of the reverberation room
Dry : original signal
Wet : reverberated signal
Comb and Allpass filters
-------------------------
Reverb components
------------------
fxctrl : add an input gain and a wet-dry control to a stereo FX
----------------------------------------------------------------
Freeverb
---------
JOS:freeverb = fxctrl(fixedgain, wetSlider, stereoReverb(combfeed, allpassfeed, dampSlider, stereospread)); | import("stdfaust.lib");
import("layout2.dsp");
declare name "freeverb";
declare version "1.0";
declare author "Grame";
declare license "BSD";
declare copyright "(c) GRAME 2006 and MoForte Inc. 2017";
declare reference "https://ccrma.stanford.edu/~jos/pasp/Freeverb.html";
scalewet = 3.0;
scaledry = 2.0;
scaledamp = 0.4;
scaleroom = 0.28;
offsetroom = 0.7;
initialroom = 0.5;
initialdamp = 0.5;
initialwet = 1.0/scalewet;
initialdry = 0;
initialwidth= 1.0;
initialmode = 0.0;
freezemode = 0.5;
stereospread= 23;
combtuningL1 = 1116;
combtuningL2 = 1188;
combtuningL3 = 1277;
combtuningL4 = 1356;
combtuningL5 = 1422;
combtuningL6 = 1491;
combtuningL7 = 1557;
combtuningL8 = 1617;
allpasstuningL1 = 556;
allpasstuningL2 = 441;
allpasstuningL3 = 341;
allpasstuningL4 = 225;
dampSlider = rkg(vslider("Damp [midi:ctrl 4] [style:knob]",0.5, 0, 1, 0.025))*scaledamp;
roomsizeSlider = rkg(vslider("RoomSize [midi:ctrl 3] [style:knob]", 0.5, 0, 1, 0.025))*scaleroom + offsetroom;
wetSlider = rkg(vslider("Wet [midi:ctrl 2] [style:knob]", 0.3333, 0, 1, 0.025));
combfeed = roomsizeSlider;
allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_);
comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb));
monoReverb(fb1, fb2, damp, spread)
= _ <: comb(combtuningL1+spread, fb1, damp),
comb(combtuningL2+spread, fb1, damp),
comb(combtuningL3+spread, fb1, damp),
comb(combtuningL4+spread, fb1, damp),
comb(combtuningL5+spread, fb1, damp),
comb(combtuningL6+spread, fb1, damp),
comb(combtuningL7+spread, fb1, damp),
comb(combtuningL8+spread, fb1, damp)
+>
allpass (allpasstuningL1+spread, fb2)
: allpass (allpasstuningL2+spread, fb2)
: allpass (allpasstuningL3+spread, fb2)
: allpass (allpasstuningL4+spread, fb2)
;
monoReverbToStereo(fb1, fb2, damp, spread)
= + <: monoReverb(fb1, fb2, damp, 0) <: _,_;
stereoReverb(fb1, fb2, damp, spread)
= + <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread);
monoToStereoReverb(fb1, fb2, damp, spread)
= _ <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread);
fxctrl(g,w,Fx) = _,_ <: (*(g),*(g) : Fx : *(w),*(w)), *(1-w), *(1-w) +> _,_;
rbp = 1-int(rsg(vslider("[0] Enable [midi:ctrl 102][style:knob]",0,0,1,1)));
freeverb = fxctrl(fixedgain, wetSlider, monoReverbToStereo(combfeed, allpassfeed, dampSlider, stereospread));
process = ba.bypass2(rbp,freeverb);
|
e85cd150e0e38d8ebba064a5490694616b3eb3deb975948143e45dc00d67f877 | afalaize/faust | vocal.dsp | //######################################## vocal.dsp #####################################
// A funny vocal synth app...
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with `faust2smartkeyb`. For best results,
// we recommend to use the following parameters to compile it:
//
// ```
// faust2smartkeyb [-ios/-android] vocal.dsp
// ```
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
import("stdfaust.lib");
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Max Keyboard Polyphony':'0',
'Keyboard 0 - Number of Keys':'1',
'Keyboard 0 - Send Freq':'0',
'Keyboard 0 - Static Mode':'1',
'Keyboard 0 - Send X':'1',
'Keyboard 0 - Piano Keyboard':'0'
}";
// standard parameters
vowel = hslider("vowel[acc: 0 0 -10 0 10]",2,0,4,0.01) : si.smoo;
x = hslider("x",0.5,0,1,0.01) : si.smoo;
vibrato = hslider("vibrato[acc: 1 0 -10 0 10]",0.05,0,0.1,0.01);
gain = hslider("gain",0.25,0,1,0.01);
// fomating parameters
freq = x*200 + 50;
voiceFreq = freq*(os.osc(6)*vibrato+1);
process = pm.SFFormantModelBP(1,vowel,0,voiceFreq,gain) <: _,_;
| https://raw.githubusercontent.com/afalaize/faust/8f9f5fe3aa167eaeecc15a99d4da984ac2797be3/examples/smartKeyboard/vocal.dsp | faust | ######################################## vocal.dsp #####################################
A funny vocal synth app...
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with `faust2smartkeyb`. For best results,
we recommend to use the following parameters to compile it:
```
faust2smartkeyb [-ios/-android] vocal.dsp
```
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
standard parameters
fomating parameters |
import("stdfaust.lib");
declare interface "SmartKeyboard{
'Number of Keyboards':'1',
'Max Keyboard Polyphony':'0',
'Keyboard 0 - Number of Keys':'1',
'Keyboard 0 - Send Freq':'0',
'Keyboard 0 - Static Mode':'1',
'Keyboard 0 - Send X':'1',
'Keyboard 0 - Piano Keyboard':'0'
}";
vowel = hslider("vowel[acc: 0 0 -10 0 10]",2,0,4,0.01) : si.smoo;
x = hslider("x",0.5,0,1,0.01) : si.smoo;
vibrato = hslider("vibrato[acc: 1 0 -10 0 10]",0.05,0,0.1,0.01);
gain = hslider("gain",0.25,0,1,0.01);
freq = x*200 + 50;
voiceFreq = freq*(os.osc(6)*vibrato+1);
process = pm.SFFormantModelBP(1,vowel,0,voiceFreq,gain) <: _,_;
|
1e2c55eac7d19a7a8ff5e33cfc1bfe3c85a8472f4c3e685a78916fe9b4e5d9e2 | RuolunWeng/ruolunweng.github.io | Freeverb.dsp | declare name "freeverb";
declare version "1.0";
declare author "Grame";
declare license "BSD";
declare copyright "(c) GRAME 2006";
declare reference "https://ccrma.stanford.edu/~jos/pasp/Freeverb.html";
import("stdfaust.lib");
/* Description :
- Reverberation processor.
- Head = maximum reverberation.
*/
freeverb = vgroup("Freeverb", fxctrl(fixedgain, wetSlider, stereoReverb(combfeed, allpassfeed, dampSlider, stereospread)));
process = _<: freeverb :>_;
//======================================================
//
// Freeverb
// Faster version using fixed delays (20% gain)
//
//======================================================
// Constant Parameters
//--------------------
fixedgain = 0.015; //value of the gain of fxctrl
scalewet = 3.0;
scaledry = 2.0;
scaledamp = 0.4;
scaleroom = 0.28;
offsetroom = 0.7;
initialroom = 0.5;
initialdamp = 0.5;
initialwet = 1.0/scalewet;
initialdry = 0;
initialwidth= 1.0;
initialmode = 0.0;
freezemode = 0.5;
stereospread= 23;
allpassfeed = 0.5; //feedback of the delays used in allpass filters
// Filter Parameters
//------------------
combtuningL1 = 1116;
combtuningL2 = 1188;
combtuningL3 = 1277;
combtuningL4 = 1356;
combtuningL5 = 1422;
combtuningL6 = 1491;
combtuningL7 = 1557;
combtuningL8 = 1617;
allpasstuningL1 = 556;
allpasstuningL2 = 441;
allpasstuningL3 = 341;
allpasstuningL4 = 225;
// Control Sliders
//--------------------
// Damp : filters the high frequencies of the echoes (especially active for great values of RoomSize)
// RoomSize : size of the reverberation room
// Dry : original signal
// Wet : reverberated signal
//dampSlider = hslider("Damp",0.5, 0, 1, 0.025)*scaledamp;
dampSlider = 0.7*scaledamp;
roomsizeSlider = hslider("Reverberation Room Size[acc:1 1 -10 0 10]", 0.5, 0.1, 0.9, 0.025) : si.smooth(0.999) : min(0.9) :max(0.1) *scaleroom + offsetroom;
wetSlider = hslider("Reverberation Intensity[acc:1 1 -10 0 10]", 0.3333, 0.1, 0.9, 0.025) : si.smooth(0.999) : min(0.9) :max(0.1);
combfeed = roomsizeSlider;
// Comb and Allpass filters
//-------------------------
allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_);
comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb));
// Reverb components
//------------------
monoReverb(fb1, fb2, damp, spread)
= _ <: comb(combtuningL1+spread, fb1, damp),
comb(combtuningL2+spread, fb1, damp),
comb(combtuningL3+spread, fb1, damp),
comb(combtuningL4+spread, fb1, damp),
comb(combtuningL5+spread, fb1, damp),
comb(combtuningL6+spread, fb1, damp),
comb(combtuningL7+spread, fb1, damp),
comb(combtuningL8+spread, fb1, damp)
+>
allpass (allpasstuningL1+spread, fb2)
: allpass (allpasstuningL2+spread, fb2)
: allpass (allpasstuningL3+spread, fb2)
: allpass (allpasstuningL4+spread, fb2)
;
stereoReverb(fb1, fb2, damp, spread)
= + <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread);
// fxctrl : add an input gain and a wet-dry control to a stereo FX
//----------------------------------------------------------------
fxctrl(g,w,Fx) = _,_ <: (*(g),*(g) : Fx : *(w),*(w)), *(1-w), *(1-w) +> _,_;
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/Freeverb.dsp | faust | Description :
- Reverberation processor.
- Head = maximum reverberation.
======================================================
Freeverb
Faster version using fixed delays (20% gain)
======================================================
Constant Parameters
--------------------
value of the gain of fxctrl
feedback of the delays used in allpass filters
Filter Parameters
------------------
Control Sliders
--------------------
Damp : filters the high frequencies of the echoes (especially active for great values of RoomSize)
RoomSize : size of the reverberation room
Dry : original signal
Wet : reverberated signal
dampSlider = hslider("Damp",0.5, 0, 1, 0.025)*scaledamp;
Comb and Allpass filters
-------------------------
Reverb components
------------------
fxctrl : add an input gain and a wet-dry control to a stereo FX
---------------------------------------------------------------- | declare name "freeverb";
declare version "1.0";
declare author "Grame";
declare license "BSD";
declare copyright "(c) GRAME 2006";
declare reference "https://ccrma.stanford.edu/~jos/pasp/Freeverb.html";
import("stdfaust.lib");
freeverb = vgroup("Freeverb", fxctrl(fixedgain, wetSlider, stereoReverb(combfeed, allpassfeed, dampSlider, stereospread)));
process = _<: freeverb :>_;
scalewet = 3.0;
scaledry = 2.0;
scaledamp = 0.4;
scaleroom = 0.28;
offsetroom = 0.7;
initialroom = 0.5;
initialdamp = 0.5;
initialwet = 1.0/scalewet;
initialdry = 0;
initialwidth= 1.0;
initialmode = 0.0;
freezemode = 0.5;
stereospread= 23;
combtuningL1 = 1116;
combtuningL2 = 1188;
combtuningL3 = 1277;
combtuningL4 = 1356;
combtuningL5 = 1422;
combtuningL6 = 1491;
combtuningL7 = 1557;
combtuningL8 = 1617;
allpasstuningL1 = 556;
allpasstuningL2 = 441;
allpasstuningL3 = 341;
allpasstuningL4 = 225;
dampSlider = 0.7*scaledamp;
roomsizeSlider = hslider("Reverberation Room Size[acc:1 1 -10 0 10]", 0.5, 0.1, 0.9, 0.025) : si.smooth(0.999) : min(0.9) :max(0.1) *scaleroom + offsetroom;
wetSlider = hslider("Reverberation Intensity[acc:1 1 -10 0 10]", 0.3333, 0.1, 0.9, 0.025) : si.smooth(0.999) : min(0.9) :max(0.1);
combfeed = roomsizeSlider;
allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_);
comb(dt, fb, damp) = (+:@(dt)) ~ (*(1-damp) : (+ ~ *(damp)) : *(fb));
monoReverb(fb1, fb2, damp, spread)
= _ <: comb(combtuningL1+spread, fb1, damp),
comb(combtuningL2+spread, fb1, damp),
comb(combtuningL3+spread, fb1, damp),
comb(combtuningL4+spread, fb1, damp),
comb(combtuningL5+spread, fb1, damp),
comb(combtuningL6+spread, fb1, damp),
comb(combtuningL7+spread, fb1, damp),
comb(combtuningL8+spread, fb1, damp)
+>
allpass (allpasstuningL1+spread, fb2)
: allpass (allpasstuningL2+spread, fb2)
: allpass (allpasstuningL3+spread, fb2)
: allpass (allpasstuningL4+spread, fb2)
;
stereoReverb(fb1, fb2, damp, spread)
= + <: monoReverb(fb1, fb2, damp, 0), monoReverb(fb1, fb2, damp, spread);
fxctrl(g,w,Fx) = _,_ <: (*(g),*(g) : Fx : *(w),*(w)), *(1-w), *(1-w) +> _,_;
|
a2f28a95f5b84a39b806be2cc34439354e7ea98f7bba6d7c1527cb9f621c638a | micahvdm/profiler | profiler.dsp | /*
* Copyright (C) 2018-2020 Oleg Kapitonov and 2022 Micah John
*
* 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 the universal tube amplifier emulator
* with tonestack, gain and volume(mastergain) knobs.
*
* Process chain:
*
* IN->preamp_convolver->*drive_knob->preamp->tonestack->
* <-----------------------------<----------------<---
* -->*volume_knob->power_amp->cabsym_convolver->OUT
*
* Distortion and tonestack parameters loaded
* from *.tapf profile file.
* Convolvers work outside this FAUST module.
* Cabsym convolver may be bypassed.
*/
declare name "profiler";
declare author "Micah John";
declare license "GPLv3";
declare version "2.0";
import("stdfaust.lib");
process = preamp_amp with {
// Link parameters from *.tapf profile file
// and knob values with FAUST code.
drive = fvariable(float DRIVE_CTRL, <math.h>);
volume = fvariable(float VOLUME_CTRL, <math.h>);
mastergain = fvariable(float MASTERGAIN_CTRL, <math.h>);
// Bias signal before distortion
amp_bias = fvariable(float AMP_BIAS_CTRL, <math.h>);
// Threshold of distortion
amp_Upor = fvariable(float AMP_UPOR_CTRL, <math.h>);
// Severity/softness of distortion
amp_Kreg = fvariable(float AMP_KREG_CTRL, <math.h>);
// The same parameters for preamp
preamp_bias = fvariable(float PREAMP_BIAS_CTRL, <math.h>);
preamp_Upor = fvariable(float PREAMP_UPOR_CTRL, <math.h>);
preamp_Kreg = fvariable(float PREAMP_KREG_CTRL, <math.h>);
tonestack_low = fvariable(float LOW_CTRL, <math.h>);
tonestack_middle = fvariable(float MIDDLE_CTRL, <math.h>);
tonestack_high = fvariable(float HIGH_CTRL, <math.h>);
tonestack_low_freq = fvariable(float LOW_FREQ_CTRL, <math.h>);
tonestack_middle_freq = fvariable(float MIDDLE_FREQ_CTRL, <math.h>);
tonestack_high_freq = fvariable(float HIGH_FREQ_CTRL, <math.h>);
tonestack_low_band = fvariable(float LOW_BAND_CTRL, <math.h>);
tonestack_middle_band = fvariable(float MIDDLE_BAND_CTRL, <math.h>);
tonestack_high_band = fvariable(float HIGH_BAND_CTRL, <math.h>);
// Gain before preamp
preamp_level = fvariable(float PREAMP_LEVEL, <math.h>);
// Gain before amp
amp_level = fvariable(float AMP_LEVEL, <math.h>);
// Voltage Sag parameters
sag_time = fvariable(float SAG_TIME, <math.h>);
sag_coeff = fvariable(float SAG_COEFF, <math.h>);
// Output gain
output_level = fvariable(float OUTPUT_LEVEL, <math.h>);
// Model of tube nonlinear distortion
tube(Kreg,Upor,bias,cut) = main : +(bias) : max(cut) with {
Ks(x) = 1/(max((x-Upor)*(Kreg),0)+1);
Ksplus(x) = Upor - x*Upor;
main(Uin) = (Uin * Ks(Uin) + Ksplus(Ks(Uin)));
};
// Preamp - has 1 class A tube distortion (non symmetric)
stage_preamp = fi.lowpass(1,12000) :
tube(preamp_Kreg,preamp_Upor,preamp_bias,-preamp_Upor);
stage_tonestack = fi.peak_eq(tonestack_low,tonestack_low_freq,tonestack_low_band) :
fi.peak_eq(tonestack_middle,tonestack_middle_freq,tonestack_middle_band) :
fi.peak_eq(tonestack_high,tonestack_high_freq,tonestack_high_band): fi.lowpass(1,12000);
// Power Amp - has 1 class B tube distortion (symmetric)
stage_amp = _<: _,*(-1.0) :
tube(amp_Kreg,amp_Upor,amp_bias,0),
tube(amp_Kreg,amp_Upor,amp_bias,0) :
- :
fi.lowpass(1, 12000);
// Part of the chain before Voltage Sag in power amp
pre_sag = _,_ : + : fi.dcblocker : *(ba.db2linear(drive * 0.4) - 1) :
*(preamp_level) : stage_preamp : fi.dcblocker :*(amp_level) :
*(ba.db2linear(mastergain * 0.4) - 1) : stage_tonestack;
// All chain, pre-sag + power amp with Voltage Sag
preamp_amp = pre_sag :
(_,_ : (_<: (1.0/_),_),_ : _,* : _,stage_amp : *)
~ (_ <: _,_: * : fi.lowpass(1,sag_time) : *(sag_coeff) :
max(1.0) : min(2.5)) : *(volume) :
*(output_level) : fi.dcblocker <: _,_;
};
| https://raw.githubusercontent.com/micahvdm/profiler/f5cd88d8d897fd37b70c8ccfa8e9f5dcfcf3ef0a/LV2/profiler/profiler.dsp | faust |
* Copyright (C) 2018-2020 Oleg Kapitonov and 2022 Micah John
*
* 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 the universal tube amplifier emulator
* with tonestack, gain and volume(mastergain) knobs.
*
* Process chain:
*
* IN->preamp_convolver->*drive_knob->preamp->tonestack->
* <-----------------------------<----------------<---
* -->*volume_knob->power_amp->cabsym_convolver->OUT
*
* Distortion and tonestack parameters loaded
* from *.tapf profile file.
* Convolvers work outside this FAUST module.
* Cabsym convolver may be bypassed.
Link parameters from *.tapf profile file
and knob values with FAUST code.
Bias signal before distortion
Threshold of distortion
Severity/softness of distortion
The same parameters for preamp
Gain before preamp
Gain before amp
Voltage Sag parameters
Output gain
Model of tube nonlinear distortion
Preamp - has 1 class A tube distortion (non symmetric)
Power Amp - has 1 class B tube distortion (symmetric)
Part of the chain before Voltage Sag in power amp
All chain, pre-sag + power amp with Voltage Sag |
declare name "profiler";
declare author "Micah John";
declare license "GPLv3";
declare version "2.0";
import("stdfaust.lib");
process = preamp_amp with {
drive = fvariable(float DRIVE_CTRL, <math.h>);
volume = fvariable(float VOLUME_CTRL, <math.h>);
mastergain = fvariable(float MASTERGAIN_CTRL, <math.h>);
amp_bias = fvariable(float AMP_BIAS_CTRL, <math.h>);
amp_Upor = fvariable(float AMP_UPOR_CTRL, <math.h>);
amp_Kreg = fvariable(float AMP_KREG_CTRL, <math.h>);
preamp_bias = fvariable(float PREAMP_BIAS_CTRL, <math.h>);
preamp_Upor = fvariable(float PREAMP_UPOR_CTRL, <math.h>);
preamp_Kreg = fvariable(float PREAMP_KREG_CTRL, <math.h>);
tonestack_low = fvariable(float LOW_CTRL, <math.h>);
tonestack_middle = fvariable(float MIDDLE_CTRL, <math.h>);
tonestack_high = fvariable(float HIGH_CTRL, <math.h>);
tonestack_low_freq = fvariable(float LOW_FREQ_CTRL, <math.h>);
tonestack_middle_freq = fvariable(float MIDDLE_FREQ_CTRL, <math.h>);
tonestack_high_freq = fvariable(float HIGH_FREQ_CTRL, <math.h>);
tonestack_low_band = fvariable(float LOW_BAND_CTRL, <math.h>);
tonestack_middle_band = fvariable(float MIDDLE_BAND_CTRL, <math.h>);
tonestack_high_band = fvariable(float HIGH_BAND_CTRL, <math.h>);
preamp_level = fvariable(float PREAMP_LEVEL, <math.h>);
amp_level = fvariable(float AMP_LEVEL, <math.h>);
sag_time = fvariable(float SAG_TIME, <math.h>);
sag_coeff = fvariable(float SAG_COEFF, <math.h>);
output_level = fvariable(float OUTPUT_LEVEL, <math.h>);
tube(Kreg,Upor,bias,cut) = main : +(bias) : max(cut) with {
Ks(x) = 1/(max((x-Upor)*(Kreg),0)+1);
Ksplus(x) = Upor - x*Upor;
main(Uin) = (Uin * Ks(Uin) + Ksplus(Ks(Uin)));
};
stage_preamp = fi.lowpass(1,12000) :
tube(preamp_Kreg,preamp_Upor,preamp_bias,-preamp_Upor);
stage_tonestack = fi.peak_eq(tonestack_low,tonestack_low_freq,tonestack_low_band) :
fi.peak_eq(tonestack_middle,tonestack_middle_freq,tonestack_middle_band) :
fi.peak_eq(tonestack_high,tonestack_high_freq,tonestack_high_band): fi.lowpass(1,12000);
stage_amp = _<: _,*(-1.0) :
tube(amp_Kreg,amp_Upor,amp_bias,0),
tube(amp_Kreg,amp_Upor,amp_bias,0) :
- :
fi.lowpass(1, 12000);
pre_sag = _,_ : + : fi.dcblocker : *(ba.db2linear(drive * 0.4) - 1) :
*(preamp_level) : stage_preamp : fi.dcblocker :*(amp_level) :
*(ba.db2linear(mastergain * 0.4) - 1) : stage_tonestack;
preamp_amp = pre_sag :
(_,_ : (_<: (1.0/_),_),_ : _,* : _,stage_amp : *)
~ (_ <: _,_: * : fi.lowpass(1,sag_time) : *(sag_coeff) :
max(1.0) : min(2.5)) : *(volume) :
*(output_level) : fi.dcblocker <: _,_;
};
|
cee1573a342515ee1c4525338c27c119a32ea00e652dd5efdd06239e8cf159ea | nick8325/faustilogue | fm.dsp | import("stdfaust.lib");
declare version "1.0";
// carrierFreq, modulatorFreq and index definitions go here
carrierFreq=hslider("freq", 2000, 20, 20000, 1);
modulatorFreq=hslider("shape", 1, 0, 200, 20);
index=hslider("param1 [tooltip:Mod index]", 2, 0, 100, 1);
lfo=hslider("lfo", 1, -1, 1, 0.0001);
process =
os.osc(carrierFreq + (lfo + os.osc(modulatorFreq))*index);
| https://raw.githubusercontent.com/nick8325/faustilogue/f0a849a6670884f5e2717cbcb1d851f30a84a583/examples/fm.dsp | faust | carrierFreq, modulatorFreq and index definitions go here | import("stdfaust.lib");
declare version "1.0";
carrierFreq=hslider("freq", 2000, 20, 20000, 1);
modulatorFreq=hslider("shape", 1, 0, 200, 20);
index=hslider("param1 [tooltip:Mod index]", 2, 0, 100, 1);
lfo=hslider("lfo", 1, -1, 1, 0.0001);
process =
os.osc(carrierFreq + (lfo + os.osc(modulatorFreq))*index);
|
33d6fd2a6f69f1b6614544b62bc6c12c1ef10117de6349f1b192751fa1417ed4 | Brotherta/wam-bank | CompressorGuitarix.dsp | declare name "Compressor";
declare category "Guitar Effects";
/* Compressor unit. */
//declare name "compressor -- compressor/limiter unit";
declare author "Albert Graef";
declare version "1.0";
import("stdfaust.lib");
import("music.lib");
//import("guitarix.lib");
/* Controls. */
// partition the controls into these three groups
comp_group(x) = hgroup("1-compression", x);
env_group(x) = vgroup("2-envelop", x);
gain_group(x) = vgroup("3-gain", x);
// compressor controls: ratio, threshold and knee size
ratio = hslider("Ratio[OWL:PARAMETER_A] [style:knob]", 2, 1, 20, 0.1);
threshold = hslider("Threshold[OWL:PARAMETER_B] [style:knob]", -20, -96, 10, 0.1);
knee = hslider("Knee [style:knob]", 3, 0, 20, 0.1);
// attack and release controls; clamped to a minimum of 1 sample
attack = hslider("Attack[OWL:PARAMETER_C] [style:knob]", 0.002, 0, 1, 0.001) : max(1/SR);
release = hslider("Release [style:knob]", 0.5, 0, 10, 0.01) : max(1/SR);
// gain controls: make-up gain, compression gain meter
//makeup_gain = hslider("Makeup Gain[OWL:PARAMETER_D]", 0, -96, 96, 0.1);
makeup_gain = gain_group(hslider("Makeup Gain[OWL:PARAMETER_D] [style:knob]", 0, -96, 96, 0.1));
// gain(x) = attach(x, x : gain_group(hbargraph("gain", -96, 0)));
t = 0.1;
g = exp(-1/(SR*t));
env = abs : *(1-g) : + ~ *(g);
rms = sqr : *(1-g) : + ~ *(g) : sqrt;
sqr(x) = x*x;
/* Compute the envelop of a stereo signal. Replace env with rms if you want to
use the RMS value instead. */
//env2(x,y) = max(env(x),env(y));
env2(x) = max(env(x));
/* Compute the compression factor for the current input level. The gain is
always 0 dB if we're below the reduced threshold, threshold-knee. Beyond
the real threshold value the level is scaled by 1/ratio. Between these two
extremes we return a convex combination of those factors. This is also
known as "soft-knee" compression: the compression kicks in gradually at
threshold-knee and reaches its full value at threshold. For special
effects, you can also achieve old-school "hard-knee" compression by setting
the knee value to zero. Also note that, before computing the gain, the
input level is first smoothed out using a 1 pole IIR to prevent clicks when
the input level changes abruptly. The attack and release times of this
filter are configured with the corresponding envelop controls of the
compressor. */
compress(env) = level*(1-r)/r
with {
// the (filtered) input level above the threshold
level = env : h ~ _ : linear2db : (_-threshold+knee) : max(0)
with {
h(x,y) = f*x+(1-f)*y with { f = (x<y)*ga+(x>=y)*gr; };
ga = exp(-1/(SR*attack));
gr = exp(-1/(SR*release));
};
// the knee factor, clamped to 0..1; we add a small perturbation in
// the denominator to prevent infinities and nan when knee<<1
p = level/(knee+eps) : max(0) : min(1) with { eps = 0.001; };
// the actual compression ratio
r = 1-p+p*ratio;
};
process1(x) = g(x)*x
with {
g = env2(x) : compress : +(makeup_gain) : db2linear ;
//g = add_dc : env : compress : gain : +(makeup_gain) : db2linear ;
//g = add_dc : env : compress : db2linear ;
};
process = ba.bypass_fade(ma.SR/10, checkbox("bypass"), process1);
| https://raw.githubusercontent.com/Brotherta/wam-bank/d52ad0b59df95c7a402afdafb140880b595c8950/plugins/CompressorGuitarix/CompressorGuitarix.dsp | faust | Compressor unit.
declare name "compressor -- compressor/limiter unit";
import("guitarix.lib");
Controls.
partition the controls into these three groups
compressor controls: ratio, threshold and knee size
attack and release controls; clamped to a minimum of 1 sample
gain controls: make-up gain, compression gain meter
makeup_gain = hslider("Makeup Gain[OWL:PARAMETER_D]", 0, -96, 96, 0.1);
gain(x) = attach(x, x : gain_group(hbargraph("gain", -96, 0)));
Compute the envelop of a stereo signal. Replace env with rms if you want to
use the RMS value instead.
env2(x,y) = max(env(x),env(y));
Compute the compression factor for the current input level. The gain is
always 0 dB if we're below the reduced threshold, threshold-knee. Beyond
the real threshold value the level is scaled by 1/ratio. Between these two
extremes we return a convex combination of those factors. This is also
known as "soft-knee" compression: the compression kicks in gradually at
threshold-knee and reaches its full value at threshold. For special
effects, you can also achieve old-school "hard-knee" compression by setting
the knee value to zero. Also note that, before computing the gain, the
input level is first smoothed out using a 1 pole IIR to prevent clicks when
the input level changes abruptly. The attack and release times of this
filter are configured with the corresponding envelop controls of the
compressor.
the (filtered) input level above the threshold
the knee factor, clamped to 0..1; we add a small perturbation in
the denominator to prevent infinities and nan when knee<<1
the actual compression ratio
g = add_dc : env : compress : gain : +(makeup_gain) : db2linear ;
g = add_dc : env : compress : db2linear ; | declare name "Compressor";
declare category "Guitar Effects";
declare author "Albert Graef";
declare version "1.0";
import("stdfaust.lib");
import("music.lib");
comp_group(x) = hgroup("1-compression", x);
env_group(x) = vgroup("2-envelop", x);
gain_group(x) = vgroup("3-gain", x);
ratio = hslider("Ratio[OWL:PARAMETER_A] [style:knob]", 2, 1, 20, 0.1);
threshold = hslider("Threshold[OWL:PARAMETER_B] [style:knob]", -20, -96, 10, 0.1);
knee = hslider("Knee [style:knob]", 3, 0, 20, 0.1);
attack = hslider("Attack[OWL:PARAMETER_C] [style:knob]", 0.002, 0, 1, 0.001) : max(1/SR);
release = hslider("Release [style:knob]", 0.5, 0, 10, 0.01) : max(1/SR);
makeup_gain = gain_group(hslider("Makeup Gain[OWL:PARAMETER_D] [style:knob]", 0, -96, 96, 0.1));
t = 0.1;
g = exp(-1/(SR*t));
env = abs : *(1-g) : + ~ *(g);
rms = sqr : *(1-g) : + ~ *(g) : sqrt;
sqr(x) = x*x;
env2(x) = max(env(x));
compress(env) = level*(1-r)/r
with {
level = env : h ~ _ : linear2db : (_-threshold+knee) : max(0)
with {
h(x,y) = f*x+(1-f)*y with { f = (x<y)*ga+(x>=y)*gr; };
ga = exp(-1/(SR*attack));
gr = exp(-1/(SR*release));
};
p = level/(knee+eps) : max(0) : min(1) with { eps = 0.001; };
r = 1-p+p*ratio;
};
process1(x) = g(x)*x
with {
g = env2(x) : compress : +(makeup_gain) : db2linear ;
};
process = ba.bypass_fade(ma.SR/10, checkbox("bypass"), process1);
|
b25a24084d6d0170905315faae83afe8c68acf62b239211bb28b8c869d91e03c | grame-cncm/faust | statespace.dsp | declare name "statespace";
declare version "1.0";
declare author "JOS";
declare license "MIT";
declare copyright "(c) Julius O. Smith III, 2020";
//-----------------------------------------------
// General Linear State-Space Model Example
//-----------------------------------------------
import("stdfaust.lib");
p = 2; // number of inputs
q = 3; // number of outputs
N = 5; // number of states
A = matrix(N,N); // state transition matrix
B = matrix(N,p); // input-to-states matrix
C = matrix(q,N); // states-to-output matrix
D = matrix(q,p); // direct-term matrix, bypassing state
// ./matrix.dsp with M and N transposed to follow convention:
matrix(M,N) = tgroup("Matrix: %M x %N", par(in, N, _)
<: par(out, M, mixer(N, out))) with {
fader(in) = ba.db2linear(vslider("Input %in", -10, -96, 4, 0.1));
mixer(N,out) = hgroup("Output %out", par(in, N, *(fader(in)) ) :> _ );
};
Bd = par(i,p,mem) : B; // input delay needed for conventional definition
vsum(N) = si.bus(2*N) :> si.bus(N); // vector sum of two N-vectors
// Illustrate nonzero initial state, following conventional definition:
impulse = 1-1'; // For zero initial state, set impulse = 0 or simplify code
x0 = par(i,N,i*impulse); // initial state = (0,1,2,3,...,N-1)
system = si.bus(p) <: D, (Bd : vsum(N)~(A), x0 : vsum(N) : C) :> si.bus(q);
process = system;
| https://raw.githubusercontent.com/grame-cncm/faust/66cdb528642fdf3d607fec1b7ea7f386d7b709a4/examples/misc/statespace.dsp | faust | -----------------------------------------------
General Linear State-Space Model Example
-----------------------------------------------
number of inputs
number of outputs
number of states
state transition matrix
input-to-states matrix
states-to-output matrix
direct-term matrix, bypassing state
./matrix.dsp with M and N transposed to follow convention:
input delay needed for conventional definition
vector sum of two N-vectors
Illustrate nonzero initial state, following conventional definition:
For zero initial state, set impulse = 0 or simplify code
initial state = (0,1,2,3,...,N-1) | declare name "statespace";
declare version "1.0";
declare author "JOS";
declare license "MIT";
declare copyright "(c) Julius O. Smith III, 2020";
import("stdfaust.lib");
matrix(M,N) = tgroup("Matrix: %M x %N", par(in, N, _)
<: par(out, M, mixer(N, out))) with {
fader(in) = ba.db2linear(vslider("Input %in", -10, -96, 4, 0.1));
mixer(N,out) = hgroup("Output %out", par(in, N, *(fader(in)) ) :> _ );
};
system = si.bus(p) <: D, (Bd : vsum(N)~(A), x0 : vsum(N) : C) :> si.bus(q);
process = system;
|
350494086e79e5726e90d33a031818284150d443452392ba733b0ae361577909 | amstramgrame/amstramgrame | exfaust10.dsp |
declare name "Jungle Euclidian Rhythm";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
import("stdfaust.lib");
on_click(x) = 0, 1 : select2( x > x');
/*
Impulsion with a specified duration. Can be retriggered.
*/
mpulse(smps_dur, trig) = pulsation
with {
count = ba.countdown(smps_dur, trig);
//count = -(1)~_, smps_dur : select2(trig);
pulsation = 0, 1 : select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
/*
Euclidian function. Generates an euclidian rythm with 0;1 triggers
*/
euclidian(onset, div, pulses, rotation, phasor) = res
with {
kph = int( ((phasor * div) % 1) * pulses);
eucval = int((onset / pulses) * kph);
cond = 0, 1 : select2(eucval' != eucval);
trig = 0, 1 : select2(kph' != kph);
res = (trig & cond);
};
// Frequency of euclidian rhythm
BPM = 60;
EUC_FQ = BPM / 60;
speed_mult = hslider("mult[knob:2]", 0.5, 0.5, 1.5, 0.01);
noise_amount = hslider("noise[acc: 0 0 -10 0 10]", 0, 0, 300, 1);
amp = hslider("amp", 1.5, 0, 2, 0.01)
: si.smoo;
trig = button("trig[switch:1]")
: ba.toggle
: si.smoo;
metro = euclidian(
2.567,
2 * speed_mult,
64,
0,
os.phasor(1, EUC_FQ)
);
nz = no.noise : abs : *(noise_amount);
freq = hslider("freq[acc: 1 0 -10 0 10]", 80, 70, 250, 1)
: +(nz)
: ba.sAndH( metro + os.impulse);
noise_gen = no.noise : *(0.8) : ve.korg35LPF(0.8, 1);
// Audio signal
sig = os.sawtooth(freq) + (os.osc(freq /2) / 2) + noise_gen;
ATQ = 0.05;
env = metro : mpulse_dur(ATQ) : en.adsre(ATQ, 0.1, 0.3, 0.4);
// Filter audio signal
flt = sig
: *(0.5)
: fi.resonbp(env * freq * 2 + 100, 5, 1)
: fi.resonbp(env * freq * 4 + 100, 0.5, 1);
process = sig
: *(0.5)
: fi.resonbp(env * freq * 2 + 100, 5, 1)
: fi.resonbp(env * freq * 4 + 100, 0.5, 1)
: *(amp)
: *(env)
: *(trig);
| https://raw.githubusercontent.com/amstramgrame/amstramgrame/4df99bfbae994fc9dcb4012190335e29255b411e/docs/gramophone/programs/exfaust10/exfaust10.dsp | faust |
Impulsion with a specified duration. Can be retriggered.
count = -(1)~_, smps_dur : select2(trig);
Euclidian function. Generates an euclidian rythm with 0;1 triggers
Frequency of euclidian rhythm
Audio signal
Filter audio signal |
declare name "Jungle Euclidian Rhythm";
declare version "1.0";
declare author "Johann Philippe";
declare license "MIT";
declare copyright "(c) Johann Philippe 2022";
import("stdfaust.lib");
on_click(x) = 0, 1 : select2( x > x');
mpulse(smps_dur, trig) = pulsation
with {
count = ba.countdown(smps_dur, trig);
pulsation = 0, 1 : select2(count > 0);
};
mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig);
euclidian(onset, div, pulses, rotation, phasor) = res
with {
kph = int( ((phasor * div) % 1) * pulses);
eucval = int((onset / pulses) * kph);
cond = 0, 1 : select2(eucval' != eucval);
trig = 0, 1 : select2(kph' != kph);
res = (trig & cond);
};
BPM = 60;
EUC_FQ = BPM / 60;
speed_mult = hslider("mult[knob:2]", 0.5, 0.5, 1.5, 0.01);
noise_amount = hslider("noise[acc: 0 0 -10 0 10]", 0, 0, 300, 1);
amp = hslider("amp", 1.5, 0, 2, 0.01)
: si.smoo;
trig = button("trig[switch:1]")
: ba.toggle
: si.smoo;
metro = euclidian(
2.567,
2 * speed_mult,
64,
0,
os.phasor(1, EUC_FQ)
);
nz = no.noise : abs : *(noise_amount);
freq = hslider("freq[acc: 1 0 -10 0 10]", 80, 70, 250, 1)
: +(nz)
: ba.sAndH( metro + os.impulse);
noise_gen = no.noise : *(0.8) : ve.korg35LPF(0.8, 1);
sig = os.sawtooth(freq) + (os.osc(freq /2) / 2) + noise_gen;
ATQ = 0.05;
env = metro : mpulse_dur(ATQ) : en.adsre(ATQ, 0.1, 0.3, 0.4);
flt = sig
: *(0.5)
: fi.resonbp(env * freq * 2 + 100, 5, 1)
: fi.resonbp(env * freq * 4 + 100, 0.5, 1);
process = sig
: *(0.5)
: fi.resonbp(env * freq * 2 + 100, 5, 1)
: fi.resonbp(env * freq * 4 + 100, 0.5, 1)
: *(amp)
: *(env)
: *(trig);
|
af71c322d88678f63bde3f1b98e4000e7b796074a2625bbd939d9b5d822d2f79 | RuolunWeng/ruolunweng.github.io | OnOff.dsp | import("stdfaust.lib");
process = * (button("On Off"):ba.toggle:si.smooth(0.998)); | https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/OnOff.dsp | faust | import("stdfaust.lib");
process = * (button("On Off"):ba.toggle:si.smooth(0.998)); |
|
e91cd0a862101bb3ca9d4763c823b08a198ef9465dbfedc287fa8e58017827e1 | RuolunWeng/ruolunweng.github.io | HighPassFilter.dsp | declare name "High Pass Filter";
import("stdfaust.lib");
/* ========= DESCRITPION ===========
- A high pass filter blocks all the frequencies inferior to the designated CUT-OFF FREQUENCY
- Front = no filter
- Back = maximum filtering
- Rocking = Increase/Decrease of the filtering
*/
process = _:fi.highpass(2,fc):_
with {
fc = hslider("Cut-off Frequency[acc:2 0 -10 0 10][scale:log]", 1300, 10, 20000, 0.01):si.smooth(0.999):min(20000):max(10);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/HighPassFilter.dsp | faust | ========= DESCRITPION ===========
- A high pass filter blocks all the frequencies inferior to the designated CUT-OFF FREQUENCY
- Front = no filter
- Back = maximum filtering
- Rocking = Increase/Decrease of the filtering
| declare name "High Pass Filter";
import("stdfaust.lib");
process = _:fi.highpass(2,fc):_
with {
fc = hslider("Cut-off Frequency[acc:2 0 -10 0 10][scale:log]", 1300, 10, 20000, 0.01):si.smooth(0.999):min(20000):max(10);
};
|
e9065514e252551efd6c851ae7a0d78ca5abd5918102a454ba98624fe6ce49ce | RuolunWeng/ruolunweng.github.io | LowPassFilter.dsp | declare name "Low Pass Filter";
import("stdfaust.lib");
/* ========= DESCRITPION ===========
- A low pass filter blocks all the frequencies superior to the designated CUT-OFF FREQUENCY
- Front = no filter
- Back = maximum filtering
- Rocking = Increase/Decrease of the filtering
*/
process = _:fi.lowpass(2,fc):_
with{
fc = hslider("Cut-off Frequency[acc:2 1 -10 0 10][scale:log]", 800, 10, 20000, 0.01):si.smooth(0.999):min(20000):max(10);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/LowPassFilter.dsp | faust | ========= DESCRITPION ===========
- A low pass filter blocks all the frequencies superior to the designated CUT-OFF FREQUENCY
- Front = no filter
- Back = maximum filtering
- Rocking = Increase/Decrease of the filtering
| declare name "Low Pass Filter";
import("stdfaust.lib");
process = _:fi.lowpass(2,fc):_
with{
fc = hslider("Cut-off Frequency[acc:2 1 -10 0 10][scale:log]", 800, 10, 20000, 0.01):si.smooth(0.999):min(20000):max(10);
};
|
ae5cf4d80e896e9cbb7e7b5fea0bac08dda848c1ee5aefc7c1af6aff5555606c | RuolunWeng/ruolunweng.github.io | RingModulation.dsp | declare name "Ring Modulation";
/* ======== DESCRIPTION ==========
- Ring modulation consists in modulating a sound by multiplying it with a sine wave
- Head = no modulation
- Downward = modulation, varying the modulating frequency
*/
import("stdfaust.lib");
process = ringmod;
ringmod = _<:_,*(os.oscs(freq)):drywet
with {
freq = hslider ( "[1]Modulation Frequency[acc:1 0 -10 0 10][scale:log]", 2,0.001,100,0.001):si.smooth(0.999);
drywet(x,y) = (1-c)*x + c*y;
c = hslider("[2]Modulation intensity[style:knob][unit:%][acc:1 0 -10 0 10]", 60,0,100,0.01)*(0.01):si.smooth(0.999);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/RingModulation.dsp | faust | ======== DESCRIPTION ==========
- Ring modulation consists in modulating a sound by multiplying it with a sine wave
- Head = no modulation
- Downward = modulation, varying the modulating frequency
| declare name "Ring Modulation";
import("stdfaust.lib");
process = ringmod;
ringmod = _<:_,*(os.oscs(freq)):drywet
with {
freq = hslider ( "[1]Modulation Frequency[acc:1 0 -10 0 10][scale:log]", 2,0.001,100,0.001):si.smooth(0.999);
drywet(x,y) = (1-c)*x + c*y;
c = hslider("[2]Modulation intensity[style:knob][unit:%][acc:1 0 -10 0 10]", 60,0,100,0.01)*(0.01):si.smooth(0.999);
};
|
a0ae90302e6adc898af64d19c10992bf182d8e484843797113b312642795c9f5 | RuolunWeng/ruolunweng.github.io | Echo.dsp | declare name "Echo";
import("stdfaust.lib");
/* ============ DESCRIPTION =============
- Variable de.delay echo
- Echo Delay = Pick manually which amount of time in seconds must be repeated by the echo
- Rocking = To vary the intensity of the echo
*/
process = echo;
echo = +~ @(echoDelay)*(feedback);
echoDelay = hslider("Echo Delay[unit:s]", 0.5, 0.01, 1, 0.001):min(1):max(0.01)*(44100):int;
feedback = hslider("Echo Intensity (Feedback)[style:knob][acc:0 1 -10 0 10]", 0.001, 0.001, 0.65, 0.001):si.smooth(0.999);
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/Echo.dsp | faust | ============ DESCRIPTION =============
- Variable de.delay echo
- Echo Delay = Pick manually which amount of time in seconds must be repeated by the echo
- Rocking = To vary the intensity of the echo
| declare name "Echo";
import("stdfaust.lib");
process = echo;
echo = +~ @(echoDelay)*(feedback);
echoDelay = hslider("Echo Delay[unit:s]", 0.5, 0.01, 1, 0.001):min(1):max(0.01)*(44100):int;
feedback = hslider("Echo Intensity (Feedback)[style:knob][acc:0 1 -10 0 10]", 0.001, 0.001, 0.65, 0.001):si.smooth(0.999);
|
1e44e88d0a74312975efbbd6cc361247fde5dfea231f2afaa63b5cd57a3d9038 | RuolunWeng/ruolunweng.github.io | CombFilter.dsp | declare name "Comb Filter";
/* =========== DESCRIPTION ==============
- A comb filter creates interferences in a sound
- Rocking = to change the filtering frequency
- Head = no filter
- Bottom = maximum filtering
*/
import("stdfaust.lib");
process = fi.fb_fcomb(maxdel,del,b0,aN)
with {
maxdel = 1<<16;
freq = 1/(hslider("Frequency[acc:0 1 -10 0 10]", 2500,100,20000,0.001)):si.smooth(0.99);
del = freq *(ma.SR) : si.smooth(0.99);
b0 = 1;
aN = hslider("Intensity[acc:1 0 -10 0 10]", 80,0,100,0.01)*(0.01):si.smooth(0.99):min(0.999):max(0);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/CombFilter.dsp | faust | =========== DESCRIPTION ==============
- A comb filter creates interferences in a sound
- Rocking = to change the filtering frequency
- Head = no filter
- Bottom = maximum filtering
| declare name "Comb Filter";
import("stdfaust.lib");
process = fi.fb_fcomb(maxdel,del,b0,aN)
with {
maxdel = 1<<16;
freq = 1/(hslider("Frequency[acc:0 1 -10 0 10]", 2500,100,20000,0.001)):si.smooth(0.99);
del = freq *(ma.SR) : si.smooth(0.99);
b0 = 1;
aN = hslider("Intensity[acc:1 0 -10 0 10]", 80,0,100,0.01)*(0.01):si.smooth(0.99):min(0.999):max(0);
};
|
9efce7d477ae932b4c4a97a623eee7626e486aad030bf8493031091cd21e3dd3 | RuolunWeng/ruolunweng.github.io | WahWah.dsp | declare name "WahWah";
/* ========== DESCRIPTION ===========
- Wahwah effect
- Head = no effect
- Bottom = Maximum wahwah intensity
- Rocking = varying the Wahwah effect
*/
import("stdfaust.lib");
process = _<:_,ve.crybaby(wah):drywet
with {
wah = hslider("[1]Wah Wah[acc:0 1 -10 0 10]", 0.6,0,1,0.01) : ba.automat(bps, 15, 0.0);
bps = hslider("[2]Speed[acc:0 1 -10 0 10]", 540, 360, 780, 0.1):si.smooth(0.999):min(780):max(360):int;
drywet(x,y) = (1-c)*x + c*y;
c = hslider("[3]Wah wah intensity[style:knob][unit:%][acc:1 0 -10 0 10]", 60,0,100,0.01)*(0.01):si.smooth(0.999):min(1):max(0);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/WahWah.dsp | faust | ========== DESCRIPTION ===========
- Wahwah effect
- Head = no effect
- Bottom = Maximum wahwah intensity
- Rocking = varying the Wahwah effect
| declare name "WahWah";
import("stdfaust.lib");
process = _<:_,ve.crybaby(wah):drywet
with {
wah = hslider("[1]Wah Wah[acc:0 1 -10 0 10]", 0.6,0,1,0.01) : ba.automat(bps, 15, 0.0);
bps = hslider("[2]Speed[acc:0 1 -10 0 10]", 540, 360, 780, 0.1):si.smooth(0.999):min(780):max(360):int;
drywet(x,y) = (1-c)*x + c*y;
c = hslider("[3]Wah wah intensity[style:knob][unit:%][acc:1 0 -10 0 10]", 60,0,100,0.01)*(0.01):si.smooth(0.999):min(1):max(0);
};
|
155179fc5ad0062129a2754ac2ad40530e66fa88dbc19027b77e3703b5674f5d | RuolunWeng/ruolunweng.github.io | Notch.dsp | import("stdfaust.lib");
/* =========== Description ===========:
- A Notch creates a "hole" in the sound at the indicated frequency
- The slider Q - FILTER BANDWIDTH indicates the width of the band in Hz around the center frequency.
- Rocking : to chose the frequency to be cut-off.
- Back : Maximum Q.
- Front : Minimum Q.
- Note : The smaller Q is, the larger the notch.
*/
G = -3;
F = hslider("Frequency[scale:log][acc:0 1 -10 0 15]", 440, 80, 10000, 1):min(10000):max(80);
Q = hslider("Q - Filter Bandwidth[scale:log][acc:2 0 -10 0 10]", 20, 0.01, 50, 0.01):min(50):max(0.01);
process(x) = library("maxmsp.lib").notch(x,F,G,Q);
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/Notch.dsp | faust | =========== Description ===========:
- A Notch creates a "hole" in the sound at the indicated frequency
- The slider Q - FILTER BANDWIDTH indicates the width of the band in Hz around the center frequency.
- Rocking : to chose the frequency to be cut-off.
- Back : Maximum Q.
- Front : Minimum Q.
- Note : The smaller Q is, the larger the notch.
| import("stdfaust.lib");
G = -3;
F = hslider("Frequency[scale:log][acc:0 1 -10 0 15]", 440, 80, 10000, 1):min(10000):max(80);
Q = hslider("Q - Filter Bandwidth[scale:log][acc:2 0 -10 0 10]", 20, 0.01, 50, 0.01):min(50):max(0.01);
process(x) = library("maxmsp.lib").notch(x,F,G,Q);
|
188663437e5da0e844431097aa601a51da5178e41f5002e6d91bde8276a8b009 | RuolunWeng/ruolunweng.github.io | InstrReverb.dsp | declare name "InstrReverb"; //instrument.lib
import("stdfaust.lib");
/* =========== DESCRIPTION =============
- Reverberation
- Head = Maximum Reverberation
- Bottom = No reverberation
*/
process = _<: instrReverb:>_;
instrReverb = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) :
re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+
with {
reverbGain = hslider("v:Reverb/Reverberation Volume[acc:1 1 -10 0 10]",0.1,0.05,1,0.01) : si.smooth(0.999) : min(1) : max(0.05);
roomSize = hslider("v:Reverb/Reverberation Room Size[acc:1 1 -10 0 10]", 0.1,0.05,2,0.01) : min(2) : max(0.05);
rdel = 20;
f1 = 200;
f2 = 6000;
t60dc = roomSize*3;
t60m = roomSize*2;
fsmax = 48000;
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/InstrReverb.dsp | faust | instrument.lib
=========== DESCRIPTION =============
- Reverberation
- Head = Maximum Reverberation
- Bottom = No reverberation
| import("stdfaust.lib");
process = _<: instrReverb:>_;
instrReverb = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) :
re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+
with {
reverbGain = hslider("v:Reverb/Reverberation Volume[acc:1 1 -10 0 10]",0.1,0.05,1,0.01) : si.smooth(0.999) : min(1) : max(0.05);
roomSize = hslider("v:Reverb/Reverberation Room Size[acc:1 1 -10 0 10]", 0.1,0.05,2,0.01) : min(2) : max(0.05);
rdel = 20;
f1 = 200;
f2 = 6000;
t60dc = roomSize*3;
t60m = roomSize*2;
fsmax = 48000;
};
|
1388eb0dcf83d6c67c4ec31550c037cb38dd9ca42d4c1b8236656b3c7f832085 | RuolunWeng/ruolunweng.github.io | VibratoEnvelope.dsp | declare name "Vibrato Envelope"; //instrument.lib
import("stdfaust.lib");
instrument = library("instruments.lib");
/* =========== DESCRIPTION ============
- Vibrato generator
- Head = no vibrato
- Bottom = Maximum virato intensity
- Rocking = From slow to fast vibrato
*/
process = vgroup("Vibrato",vibrato);
vibrato = _*((vibratoGain*os.osc(vibratoFreq)+(1-vibratoGain))*vibratoEnv);
vibratoGain = hslider("Vibrato Intensity[style:knob][acc:1 0 -10 0 10]", 0.1, 0.05, 0.4, 0.01) : si.smooth(0.999):min(0.5):max(0.05);
vibratoFreq = hslider("Vibrato Frequency[unit:Hz][acc:0 1 -10 0 10]", 5, 0, 10, 0.001) : si.smooth(0.999);
vibratoEnv = _ : *(instrument.envVibrato(b,a,s,r,t)) : _
with {
b = 0.25;
a = 1;
s = 100;
r = 2;
t = hslider("h:/ON/OFF Slider[acc:1 0 -10 0 10]", 0, 0, 1, 1);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/VibratoEnvelope.dsp | faust | instrument.lib
=========== DESCRIPTION ============
- Vibrato generator
- Head = no vibrato
- Bottom = Maximum virato intensity
- Rocking = From slow to fast vibrato
| import("stdfaust.lib");
instrument = library("instruments.lib");
process = vgroup("Vibrato",vibrato);
vibrato = _*((vibratoGain*os.osc(vibratoFreq)+(1-vibratoGain))*vibratoEnv);
vibratoGain = hslider("Vibrato Intensity[style:knob][acc:1 0 -10 0 10]", 0.1, 0.05, 0.4, 0.01) : si.smooth(0.999):min(0.5):max(0.05);
vibratoFreq = hslider("Vibrato Frequency[unit:Hz][acc:0 1 -10 0 10]", 5, 0, 10, 0.001) : si.smooth(0.999);
vibratoEnv = _ : *(instrument.envVibrato(b,a,s,r,t)) : _
with {
b = 0.25;
a = 1;
s = 100;
r = 2;
t = hslider("h:/ON/OFF Slider[acc:1 0 -10 0 10]", 0, 0, 1, 1);
};
|
b7eafb646bad273ceed4f5e37eca65540f1ce5a9a985d2c80f382a8f9c8ac167 | RuolunWeng/ruolunweng.github.io | BandPassFilter.dsp | declare name "Band Pass Filter";
/* ============ DESCRITPION ============
- A band pass filter blocks all the frequencies but the designated frequency band
- The slider CENTER FREQUENCY corresponds to the center frequency of the band
- The slider Q - FILTER BANDWIDTH indicates the width of the band in Hz around the center frequency.
- Head = High center frequency
- Bottom = Low center frequency
- Left = narrow band
- Right = wide band
*/
import("stdfaust.lib");
process = _:fi.bandpass(1, Lowf, Highf):_
with {
freq = hslider("[1]Center Frequency[unit:Hz][style:log][acc:1 1 -10 0 10]", 200, 50, 10000, 0.01):si.smooth(0.999);
Lowf = freq - Q;
Highf = freq + Q;
Q = hslider("Q - Filter Bandwidth[style:knob][unit:Hz][acc:0 1 -10 0 10]", 20,2,200,0.0001)*(0.5):si.smooth(0.999);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/BandPassFilter.dsp | faust | ============ DESCRITPION ============
- A band pass filter blocks all the frequencies but the designated frequency band
- The slider CENTER FREQUENCY corresponds to the center frequency of the band
- The slider Q - FILTER BANDWIDTH indicates the width of the band in Hz around the center frequency.
- Head = High center frequency
- Bottom = Low center frequency
- Left = narrow band
- Right = wide band
| declare name "Band Pass Filter";
import("stdfaust.lib");
process = _:fi.bandpass(1, Lowf, Highf):_
with {
freq = hslider("[1]Center Frequency[unit:Hz][style:log][acc:1 1 -10 0 10]", 200, 50, 10000, 0.01):si.smooth(0.999);
Lowf = freq - Q;
Highf = freq + Q;
Q = hslider("Q - Filter Bandwidth[style:knob][unit:Hz][acc:0 1 -10 0 10]", 20,2,200,0.0001)*(0.5):si.smooth(0.999);
};
|
71b81bf078acc7daa301da5be80dfa61c752285def96baa730b3bc12e7ffb3e4 | RuolunWeng/ruolunweng.github.io | PeakEqualizer.dsp | declare name "Peak Equalizer";
import("stdfaust.lib");
/* =========== DESCRITPION ==============
- An Equalizer - or EQ - is used to cut or boost a designated peak frequency from a sound
- The Q - FILTER BANDWIDTH indicates in Hz the width of the frequency band around the peak frequency impacted by the cut or boost
- Front = Boosting effect/ Narrow band
- Back = Cutting effect/ Wide band
- Left = Low peak frequency
- Right = High peak frequency
*/
process = vgroup("Peak EQ",fi.peak_eq(level,freq,Q))
with {
level = hslider("[2]Level[unit:dB][style:knob][acc:2 1 -10 0 10][tooltip: boost Level>0 or cut Level<0)", 0, -40, 32, 0.01):min(32):max(-40);
freq = hslider("[1]Peak Frequency[unit:Hz][acc:0 1 -10 0 10][scale:log]", 440, 50, 11000, 0.01):si.smooth(0.999);
Q = hslider("Q - Filter Bandwidth [unit:Hz][acc:2 0 -10 0 10]", 50, 20, 200, 1):si.smooth(0.999):min(200):max(20);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/PeakEqualizer.dsp | faust | =========== DESCRITPION ==============
- An Equalizer - or EQ - is used to cut or boost a designated peak frequency from a sound
- The Q - FILTER BANDWIDTH indicates in Hz the width of the frequency band around the peak frequency impacted by the cut or boost
- Front = Boosting effect/ Narrow band
- Back = Cutting effect/ Wide band
- Left = Low peak frequency
- Right = High peak frequency
| declare name "Peak Equalizer";
import("stdfaust.lib");
process = vgroup("Peak EQ",fi.peak_eq(level,freq,Q))
with {
level = hslider("[2]Level[unit:dB][style:knob][acc:2 1 -10 0 10][tooltip: boost Level>0 or cut Level<0)", 0, -40, 32, 0.01):min(32):max(-40);
freq = hslider("[1]Peak Frequency[unit:Hz][acc:0 1 -10 0 10][scale:log]", 440, 50, 11000, 0.01):si.smooth(0.999);
Q = hslider("Q - Filter Bandwidth [unit:Hz][acc:2 0 -10 0 10]", 50, 20, 200, 1):si.smooth(0.999):min(200):max(20);
};
|
0fa82f31645b23ea17d4fc49eeda58e7379568c855af47402596dbcbf5e42679 | RuolunWeng/ruolunweng.github.io | Flanger.dsp | declare name "Flanger";
import("stdfaust.lib");
/* =========== DESCRIPTION ==========
- Flanger effect
- Head = No effect
- Bottom = Maximum Intensity and Amplitude
- Left = Slow Flanging
- Right = Maximum Speed
*/
process = _<:_,(_<:FlangerDemo:>*(0.1)):drywet;
FlangerDemo = flanger_stereo_demo with {
flanger_group(x) =
vgroup("FLANGER [tooltip: Reference: https://ccrma.stanford.edu/~jos/pasp/Flanging.html]", x);
ctl_group(x) = flanger_group(hgroup("[1]", x));
invert = 0;// meter_group(checkbox("[1] Invert Flange Sum"));
flanger_stereo_demo(x,y) = x,y : pf.flanger_stereo(dmax,curdel1,curdel2,depth,fb,invert);
lfol = os.oscrs; // sine for left channel
lfor = os.oscrc; // cosine for right channel
dmax = 2048;
dflange = 0.001 * ma.SR * 10;
odflange = 0.001 * ma.SR * 1;
freq = ctl_group(hslider("[1] Speed [acc:0 1 -10 0 10][unit:Hz] [style:knob]", 3, 0, 10, 0.01));
depth = 1;
fb = 0.99;
curdel1 = odflange+dflange*(1 + lfol(freq))/2;
curdel2 = odflange+dflange*(1 + lfor(freq))/2;
};
drywet(x,y) = (1-c)*x + c*y
with {
c = hslider("[3] Flanger Intensity [unit:%][acc:1 0 -10 0 10]", 10,0,100,0.01)*(0.01):si.smooth(0.999);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/Flanger.dsp | faust | =========== DESCRIPTION ==========
- Flanger effect
- Head = No effect
- Bottom = Maximum Intensity and Amplitude
- Left = Slow Flanging
- Right = Maximum Speed
meter_group(checkbox("[1] Invert Flange Sum"));
sine for left channel
cosine for right channel | declare name "Flanger";
import("stdfaust.lib");
process = _<:_,(_<:FlangerDemo:>*(0.1)):drywet;
FlangerDemo = flanger_stereo_demo with {
flanger_group(x) =
vgroup("FLANGER [tooltip: Reference: https://ccrma.stanford.edu/~jos/pasp/Flanging.html]", x);
ctl_group(x) = flanger_group(hgroup("[1]", x));
flanger_stereo_demo(x,y) = x,y : pf.flanger_stereo(dmax,curdel1,curdel2,depth,fb,invert);
dmax = 2048;
dflange = 0.001 * ma.SR * 10;
odflange = 0.001 * ma.SR * 1;
freq = ctl_group(hslider("[1] Speed [acc:0 1 -10 0 10][unit:Hz] [style:knob]", 3, 0, 10, 0.01));
depth = 1;
fb = 0.99;
curdel1 = odflange+dflange*(1 + lfol(freq))/2;
curdel2 = odflange+dflange*(1 + lfor(freq))/2;
};
drywet(x,y) = (1-c)*x + c*y
with {
c = hslider("[3] Flanger Intensity [unit:%][acc:1 0 -10 0 10]", 10,0,100,0.01)*(0.01):si.smooth(0.999);
};
|
4e107a6c9f52e21fafe43ee131be843af7399e1b3a14a4029f814e3f1fb9f88e | RuolunWeng/ruolunweng.github.io | Modulations.dsp | declare name "Modulations";
/* =========== DESCRITPION ===========
- Non Linear modulation processor
- There are 5 different types of modulations available :
==> 0, 1, 2 use the incoming signal to perform the modulation
==> 3 uses the modulating frequency to modulate the sound
==> 4 uses the default 220Hz frequency to modulate the sound
- Pick a modulation type
- Left/Right/Back = modulated sound
- Front = No modulation
- Head = minimum modulation intensity/ High modulating frequency
- Bottom = maximum modulation intensity/ Low modulating frequency
- Swing = change modulation intensity and modulating frequency
*/
import("stdfaust.lib");
instrument=library("instruments.lib");
NLFM = _ : instrument.nonLinearModulator(nonlinearity,env,freq,typeMod,freqMod,order) : _;
process = NLFM;
gate = hslider("[1]ON/OFF (ASR Envelope)[acc:2 0 -10 0 10]", 1,0,1,1);
ASR =(en.asr(a,s,r,t))
with {
a = 1;
s = 1;
r = 1;
t = gate;
};
nonlinearity = hslider("[4]Modulation Intensity[acc:1 0 -10 0 10][style:knob]", 0.1, 0, 1, 0.001);
env = ASR;
freq = 220;
typeMod = hslider("[2]Modulation Type[style:radio{'0':0;'1':1;'2':2;'3':3;'4':4}]", 0, 0, 4, 1);
freqMod = hslider("[3]Modulating Frequency[acc:1 1 -10 0 10][style:knob][unit:Hz]", 204.8, 50, 1700, 0.1):si.smooth(0.999);
order = nlfOrder;
nlfOrder = 6;
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/Modulations.dsp | faust | =========== DESCRITPION ===========
- Non Linear modulation processor
- There are 5 different types of modulations available :
==> 0, 1, 2 use the incoming signal to perform the modulation
==> 3 uses the modulating frequency to modulate the sound
==> 4 uses the default 220Hz frequency to modulate the sound
- Pick a modulation type
- Left/Right/Back = modulated sound
- Front = No modulation
- Head = minimum modulation intensity/ High modulating frequency
- Bottom = maximum modulation intensity/ Low modulating frequency
- Swing = change modulation intensity and modulating frequency
| declare name "Modulations";
import("stdfaust.lib");
instrument=library("instruments.lib");
NLFM = _ : instrument.nonLinearModulator(nonlinearity,env,freq,typeMod,freqMod,order) : _;
process = NLFM;
gate = hslider("[1]ON/OFF (ASR Envelope)[acc:2 0 -10 0 10]", 1,0,1,1);
ASR =(en.asr(a,s,r,t))
with {
a = 1;
s = 1;
r = 1;
t = gate;
};
nonlinearity = hslider("[4]Modulation Intensity[acc:1 0 -10 0 10][style:knob]", 0.1, 0, 1, 0.001);
env = ASR;
freq = 220;
typeMod = hslider("[2]Modulation Type[style:radio{'0':0;'1':1;'2':2;'3':3;'4':4}]", 0, 0, 4, 1);
freqMod = hslider("[3]Modulating Frequency[acc:1 1 -10 0 10][style:knob][unit:Hz]", 204.8, 50, 1700, 0.1):si.smooth(0.999);
order = nlfOrder;
nlfOrder = 6;
|
8ef577459064731fbcf404ff9b318d32badc97288e82f9ed946c9d41627029de | RuolunWeng/ruolunweng.github.io | Phaser.dsp | declare name "Phaser";
import("stdfaust.lib");
/* =========== DESCRIPTION ==========
- Flanger effect
- Head = No effect
- Bottom = Maximum Intensity and Amplitude
- Left = Slow Flanging
- Right = Maximum Speed
*/
process = _<:_,(_<:phaser2Demo:>*(0.2)):drywet;
phaser2Demo = phaser2_stereo_demo with {
phaser2_group(x) =
vgroup("PHASER2 [tooltip: Reference: https://ccrma.stanford.edu/~jos/pasp/Flanging.html]", x);
meter_group(x) = phaser2_group(hgroup("[0]", x));
ctl_group(x) = phaser2_group(hgroup("[1]", x));
nch_group(x) = phaser2_group(hgroup("[2]", x));
lvl_group(x) = phaser2_group(hgroup("[3]", x));
invert = 0;
// FIXME: This should be an amplitude-response display:
//flangeview = phaser2_amp_resp : meter_group(hspectrumview("[2] Phaser Amplitude Response", 0,1));
//phaser2_stereo_demo(x,y) = attach(x,flangeview),y : ...
phaser2_stereo_demo =
pf.phaser2_stereo(Notches,width,frqmin,fratio,frqmax,speed,depth,fb,invert);
Notches = 4; // Compile-time parameter: 2 is typical for analog phaser stomp-boxes
// FIXME: Add tooltips
speed = ctl_group(hslider("[1]Speed[acc:0 1 -10 0 10] [unit:Hz] [style:knob]", 3, 0, 10, 0.001));
depth = 1;
fb = 0.8;
width = 150;
frqmin = 100;
frqmax = 800;
fratio = 1.5;
};
drywet(x,y) = (1-c)*x + c*y
with {
c = hslider("[2]Phaser Intensity[style:knob][unit:%][acc:1 0 -10 0 10]", 10,0,100,0.01)*(0.01):si.smooth(0.999);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/Phaser.dsp | faust | =========== DESCRIPTION ==========
- Flanger effect
- Head = No effect
- Bottom = Maximum Intensity and Amplitude
- Left = Slow Flanging
- Right = Maximum Speed
FIXME: This should be an amplitude-response display:
flangeview = phaser2_amp_resp : meter_group(hspectrumview("[2] Phaser Amplitude Response", 0,1));
phaser2_stereo_demo(x,y) = attach(x,flangeview),y : ...
Compile-time parameter: 2 is typical for analog phaser stomp-boxes
FIXME: Add tooltips | declare name "Phaser";
import("stdfaust.lib");
process = _<:_,(_<:phaser2Demo:>*(0.2)):drywet;
phaser2Demo = phaser2_stereo_demo with {
phaser2_group(x) =
vgroup("PHASER2 [tooltip: Reference: https://ccrma.stanford.edu/~jos/pasp/Flanging.html]", x);
meter_group(x) = phaser2_group(hgroup("[0]", x));
ctl_group(x) = phaser2_group(hgroup("[1]", x));
nch_group(x) = phaser2_group(hgroup("[2]", x));
lvl_group(x) = phaser2_group(hgroup("[3]", x));
invert = 0;
phaser2_stereo_demo =
pf.phaser2_stereo(Notches,width,frqmin,fratio,frqmax,speed,depth,fb,invert);
speed = ctl_group(hslider("[1]Speed[acc:0 1 -10 0 10] [unit:Hz] [style:knob]", 3, 0, 10, 0.001));
depth = 1;
fb = 0.8;
width = 150;
frqmin = 100;
frqmax = 800;
fratio = 1.5;
};
drywet(x,y) = (1-c)*x + c*y
with {
c = hslider("[2]Phaser Intensity[style:knob][unit:%][acc:1 0 -10 0 10]", 10,0,100,0.01)*(0.01):si.smooth(0.999);
};
|
f05b7ff78d0a4edf80c8b96142fe0f5ab66aa60a3b895eef0a96bb040f79a6ef | RuolunWeng/ruolunweng.github.io | ASREnvelope.dsp | declare name "ASR Envelope";
import("stdfaust.lib");
instrument = library("instruments.lib");
/* =========== DESCRITPTION ============
- An Attack, Sustain, Release envelope is used to "shape" a sound :
==> The ATTACK defines how long it takes to start : it is also called a "fade in"
==> The RELEASE defines how long it takes to end : it is also called a "fade out"
==> The ON/OFF slider is also called GATE or TRIGGER : it is used to trigger the envelope
==> The 'S' in ASR stands for SUSTAIN : it is the sound level in % reached at the end of the attack.
- When the slider is ON, the trigger = 1 and the attack starts.
- When the slider is OFF, the trigger = 0 and the release starts.
- Head = Silence
- Left = Short attack and release (0.01s)
- Front/Back = medium attack and release (1s)
- Right = Long attack (2s) and release (5s)
*/
process = *(en.asr(a,s,r,t)):_
with {
a = hslider("[2]Envelope Attack[unit:s][acc:0 1 -10 0 10][style:knob]", 0.1, 0.01, 2, 0.01) : si.smooth(0.999);
s = 1;
r = hslider("[3]Envelope Release[unit:s][style:knob][acc:0 1 -10 0 10]", 1, 0.01, 5, 0.01) : si.smooth(0.999);
//g = checkbox("[1]ON/OFF");
t = hslider("[1]ON/OFF[acc:1 0 -12 0 5]", 0, 0, 1, 1);
//t = (g>0)|(sl>0);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/ASREnvelope.dsp | faust | =========== DESCRITPTION ============
- An Attack, Sustain, Release envelope is used to "shape" a sound :
==> The ATTACK defines how long it takes to start : it is also called a "fade in"
==> The RELEASE defines how long it takes to end : it is also called a "fade out"
==> The ON/OFF slider is also called GATE or TRIGGER : it is used to trigger the envelope
==> The 'S' in ASR stands for SUSTAIN : it is the sound level in % reached at the end of the attack.
- When the slider is ON, the trigger = 1 and the attack starts.
- When the slider is OFF, the trigger = 0 and the release starts.
- Head = Silence
- Left = Short attack and release (0.01s)
- Front/Back = medium attack and release (1s)
- Right = Long attack (2s) and release (5s)
g = checkbox("[1]ON/OFF");
t = (g>0)|(sl>0); | declare name "ASR Envelope";
import("stdfaust.lib");
instrument = library("instruments.lib");
process = *(en.asr(a,s,r,t)):_
with {
a = hslider("[2]Envelope Attack[unit:s][acc:0 1 -10 0 10][style:knob]", 0.1, 0.01, 2, 0.01) : si.smooth(0.999);
s = 1;
r = hslider("[3]Envelope Release[unit:s][style:knob][acc:0 1 -10 0 10]", 1, 0.01, 5, 0.01) : si.smooth(0.999);
t = hslider("[1]ON/OFF[acc:1 0 -12 0 5]", 0, 0, 1, 1);
};
|
58e8c0ff3b837f0a2078ad4c67f45d980ad169b1b5dda8549952398b1b91ead3 | RuolunWeng/ruolunweng.github.io | RandomRingModulation.dsp | declare name "Random Ring Modulator";
/* ========== DESCRITPION ===========
- Ring Modulator which randomly changes the modulation frequency
- Left = Irregular and rare changes
- Right = Regular and frequent changes
- Front = Low ranging modulating frequencies
- Back = High ranging modulating frequencies
*/
import("stdfaust.lib");
process = *(ringmod);
ringmod = os.oscs(rfreq);
ringSpeed = hslider("[1]Ring Modulation Speed Range[scale:log][acc:2 0 -10 0 10]", 20, 10, 10000, 1) : si.smooth(0.99) : min(10000) : max(1);
//--------------------------- Random Frequency ---------------------------
rfreq = pulsaring.gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000);
randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(ringSpeed)
with{
sampleAndhold(t) = select2(t) ~_;
sahgate(g) = g : upfront : counter -(3) <=(0);
upfront(x) = abs(x-x')>0.5;
counter(g) = (+(1):*(1-g))~_;
};
//----------------------- Pulsar --------------------------------------
pulsaring = environment {
gate = phasor_bin(1) :-(0.001):pulsar;
ratio_env = (0.5);
fade = (0.5); // min > 0 pour eviter division par 0
speed = hslider ("[2]Occurrence Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 4,0.001,10,0.0001):fi.lowpass(1,1);
proba = hslider ("[3]Probability(Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 88,75,100,1) *(0.01):fi.lowpass(1,1);
phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init);
pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch));
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/RandomRingModulation.dsp | faust | ========== DESCRITPION ===========
- Ring Modulator which randomly changes the modulation frequency
- Left = Irregular and rare changes
- Right = Regular and frequent changes
- Front = Low ranging modulating frequencies
- Back = High ranging modulating frequencies
--------------------------- Random Frequency ---------------------------
----------------------- Pulsar --------------------------------------
min > 0 pour eviter division par 0 | declare name "Random Ring Modulator";
import("stdfaust.lib");
process = *(ringmod);
ringmod = os.oscs(rfreq);
ringSpeed = hslider("[1]Ring Modulation Speed Range[scale:log][acc:2 0 -10 0 10]", 20, 10, 10000, 1) : si.smooth(0.99) : min(10000) : max(1);
rfreq = pulsaring.gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000);
randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(ringSpeed)
with{
sampleAndhold(t) = select2(t) ~_;
sahgate(g) = g : upfront : counter -(3) <=(0);
upfront(x) = abs(x-x')>0.5;
counter(g) = (+(1):*(1-g))~_;
};
pulsaring = environment {
gate = phasor_bin(1) :-(0.001):pulsar;
ratio_env = (0.5);
speed = hslider ("[2]Occurrence Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 4,0.001,10,0.0001):fi.lowpass(1,1);
proba = hslider ("[3]Probability(Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 88,75,100,1) *(0.01):fi.lowpass(1,1);
phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init);
pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch));
};
|
6b5a1629630797d027e99e7c8aa9d0dfe70a2dc0223242c2726b757910212d2f | RuolunWeng/ruolunweng.github.io | Seaside.dsp | declare name "Seaside";
declare autho "ER";
/* =========== DESCRIPTION ============
- Pink no.noise filtering which emulates the sound of waves, of the sea
- Rocking = waves coming back and forth
- Head = Slight reverberation
*/
import("stdfaust.lib");
instrument = library("instruments.lib");
process = Pink : fi.bandpass(1, Lowf, Highf) <: instrReverbSea :> _
// ----------------------- Band Pass Filter --------------------------
with {
freq = 200;
Lowf = freq - Q;
Highf = freq + Q;
Q = hslider("[1]Q - Filter Bandwidth (Bandpass)[style:knob][unit:Hz][acc:0 1 -10 0 10]", 30,10,150,0.0001):si.smooth(0.999);
};
// ----------------------- Pink Noise --------------------------------
Pink = (w : p) * (3);
// 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;
// ----------------------- InstrReverb --------------------------------
instrReverbSea = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) :
re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+
with {
reverbGain = hslider("[2]Reverberation Volume (InstrReverb)[acc:1 1 -10 0 10]",0.1,0.05,1,0.01) : si.smooth(0.999) : min(1) : max(0.05);
roomSize = hslider("[3]Reverberation Room Size (InstrReverb)[acc:1 1 -10 0 10]", 0.1,0.05,2,0.01) : min(2) : max(0.05);
rdel = 20;
f1 = 200;
f2 = 6000;
t60dc = roomSize*3;
t60m = roomSize*2;
fsmax = 48000;
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/Seaside.dsp | faust | =========== DESCRIPTION ============
- Pink no.noise filtering which emulates the sound of waves, of the sea
- Rocking = waves coming back and forth
- Head = Slight reverberation
----------------------- Band Pass Filter --------------------------
----------------------- Pink Noise --------------------------------
pink no.noise filter (-3dB per octave), see musicdsp.org
white no.noise generator
----------------------- InstrReverb -------------------------------- | declare name "Seaside";
declare autho "ER";
import("stdfaust.lib");
instrument = library("instruments.lib");
process = Pink : fi.bandpass(1, Lowf, Highf) <: instrReverbSea :> _
with {
freq = 200;
Lowf = freq - Q;
Highf = freq + Q;
Q = hslider("[1]Q - Filter Bandwidth (Bandpass)[style:knob][unit:Hz][acc:0 1 -10 0 10]", 30,10,150,0.0001):si.smooth(0.999);
};
Pink = (w : p) * (3);
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;
instrReverbSea = _,_ <: *(reverbGain),*(reverbGain),*(1 - reverbGain),*(1 - reverbGain) :
re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax),_,_ <: _,!,_,!,!,_,!,_ : +,+
with {
reverbGain = hslider("[2]Reverberation Volume (InstrReverb)[acc:1 1 -10 0 10]",0.1,0.05,1,0.01) : si.smooth(0.999) : min(1) : max(0.05);
roomSize = hslider("[3]Reverberation Room Size (InstrReverb)[acc:1 1 -10 0 10]", 0.1,0.05,2,0.01) : min(2) : max(0.05);
rdel = 20;
f1 = 200;
f2 = 6000;
t60dc = roomSize*3;
t60m = roomSize*2;
fsmax = 48000;
};
|
d18c0f6a42621f838bdd84cd1f0c19a8604edc4f09bdbfcc67307472a7c8fbb1 | RuolunWeng/ruolunweng.github.io | SNoiseburst.dsp | declare name "Noiseburst";
declare author "Adapted frome sfIter by Christophe Lebreton";
import("stdfaust.lib");
/* =========== DESCRITPTION =============
- Noise outbursts generator
- Front = Medium size bursts
- Back = short bursts
- Left Slow rhythm
- Right = Fast rhythm
- Bottom = Regular occurrences
- Head = Irregular occurrences
*/
process = noiseburst *(0.1);
//----------------------- NOISEBURST -------------------------
noiseburst = 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
Pmax = 4096; // maximum P (for delay-line allocation)
gate = phasor(1) :-(0.001):pulsar;
gain = 1;
freq = hslider("[1]Grain Size[style:knob][acc:2 0 -10 0 10]", 200,5,2205,1);
// la frequence donne la largeur de bande extraite du bruit blanc
// PHASOR //////////////////////////////
phasor(init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init);
// PULSAR //////////////////////////////
//Le pulsar permet de creer une 'pulsation' plus ou moins aleatoire (proba).
pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch));
speed = hslider ("[2]Speed[unit:Hz][style:knob][acc:0 1 -10 0 10]", 10,1,20,0.0001):fi.lowpass(1,1);
ratio_env = 0.5;
fade = (0.5); // min > 0 pour eviter division par 0
proba = hslider ("[3]Probability[unit:%][style:knob][acc:1 0 -10 0 10]", 70,50,100,1) * (0.01):fi.lowpass(1,1);
duree_env = 1/(speed: / (ratio_env*(0.25)*fade));
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SNoiseburst.dsp | faust | =========== DESCRITPTION =============
- Noise outbursts generator
- Front = Medium size bursts
- Back = short bursts
- Left Slow rhythm
- Right = Fast rhythm
- Bottom = Regular occurrences
- Head = Irregular occurrences
----------------------- NOISEBURST -------------------------
fundamental period in samples
maximum P (for delay-line allocation)
la frequence donne la largeur de bande extraite du bruit blanc
PHASOR //////////////////////////////
PULSAR //////////////////////////////
Le pulsar permet de creer une 'pulsation' plus ou moins aleatoire (proba).
min > 0 pour eviter division par 0 | declare name "Noiseburst";
declare author "Adapted frome sfIter by Christophe Lebreton";
import("stdfaust.lib");
process = noiseburst *(0.1);
noiseburst = 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);
};
gate = phasor(1) :-(0.001):pulsar;
gain = 1;
freq = hslider("[1]Grain Size[style:knob][acc:2 0 -10 0 10]", 200,5,2205,1);
phasor(init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init);
pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch));
speed = hslider ("[2]Speed[unit:Hz][style:knob][acc:0 1 -10 0 10]", 10,1,20,0.0001):fi.lowpass(1,1);
ratio_env = 0.5;
proba = hslider ("[3]Probability[unit:%][style:knob][acc:1 0 -10 0 10]", 70,50,100,1) * (0.01):fi.lowpass(1,1);
duree_env = 1/(speed: / (ratio_env*(0.25)*fade));
|
f57a2667496d33e805830edc69fc90a577dce6fb5216124e2ada1b55a7ae23e0 | RuolunWeng/ruolunweng.github.io | RandomVibrato.dsp | declare name "Random Vibrato";
/* ========== DESCRITPION ===========
- Vibrato processor which randomly changes the vibrato frequency
- Left = Irregular and rare changes
- Right = Regular and frequent changes
- Front = Low ranging vibrato frequencies
- Back = High ranging vibrato frequencies
*/
import("stdfaust.lib");
//Random Vibrato:
process = *(vibrato);
//----------------- VIBRATO --------------------//
vibrato = vibratoGain * os.osc(vibratoFreq) + (1-vibratoGain);
vibratoGain = hslider("[2]Vibrato Intensity[style:knob][acc:1 0 -10 0 10]", 0.1, 0.05, 0.4, 0.01) : si.smooth(0.999);
vibratoFreq = vfreq;
vibratoSpeed = hslider("[1]Vibrato Speed Range[scale:log][acc:2 0 -10 0 10]", 10, 5, 40, 1) : si.smooth(0.99) : min(40) : max(1);
//--------------------------- Random Frequency ---------------------------
vfreq = pulsawhistle.gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000);
randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(vibratoSpeed)
with{
sampleAndhold(t) = select2(t) ~_;
sahgate(g) = g : upfront : counter -(3) <=(0);
upfront(x) = abs(x-x')>0.5;
counter(g) = (+(1):*(1-g))~_;
};
//----------------------- Pulsar --------------------------------------
pulsawhistle = environment {
gate = phasor_bin(1) :-(0.001):pulsar;
ratio_env = (0.5);
fade = (0.5); // min > 0 pour eviter division par 0
speed = hslider ("[3]Occurrence Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 4,0.001,10,0.0001):fi.lowpass(1,1);
proba = hslider ("[4]Probability (Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 88,75,100,1) *(0.01):fi.lowpass(1,1);
phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init);
pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch));
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/RandomVibrato.dsp | faust | ========== DESCRITPION ===========
- Vibrato processor which randomly changes the vibrato frequency
- Left = Irregular and rare changes
- Right = Regular and frequent changes
- Front = Low ranging vibrato frequencies
- Back = High ranging vibrato frequencies
Random Vibrato:
----------------- VIBRATO --------------------//
--------------------------- Random Frequency ---------------------------
----------------------- Pulsar --------------------------------------
min > 0 pour eviter division par 0 | declare name "Random Vibrato";
import("stdfaust.lib");
process = *(vibrato);
vibrato = vibratoGain * os.osc(vibratoFreq) + (1-vibratoGain);
vibratoGain = hslider("[2]Vibrato Intensity[style:knob][acc:1 0 -10 0 10]", 0.1, 0.05, 0.4, 0.01) : si.smooth(0.999);
vibratoFreq = vfreq;
vibratoSpeed = hslider("[1]Vibrato Speed Range[scale:log][acc:2 0 -10 0 10]", 10, 5, 40, 1) : si.smooth(0.99) : min(40) : max(1);
vfreq = pulsawhistle.gate : randfreq : si.smooth(0.99) : fi.lowpass (1, 3000);
randfreq(g) = no.noise : sampleAndhold(sahgate(g))*(vibratoSpeed)
with{
sampleAndhold(t) = select2(t) ~_;
sahgate(g) = g : upfront : counter -(3) <=(0);
upfront(x) = abs(x-x')>0.5;
counter(g) = (+(1):*(1-g))~_;
};
pulsawhistle = environment {
gate = phasor_bin(1) :-(0.001):pulsar;
ratio_env = (0.5);
speed = hslider ("[3]Occurrence Speed (Granulator)[unit:Hz][style:knob][acc:0 1 -10 0 10]", 4,0.001,10,0.0001):fi.lowpass(1,1);
proba = hslider ("[4]Probability (Granulator)[unit:%][style:knob][acc:0 1 -10 0 10]", 88,75,100,1) *(0.01):fi.lowpass(1,1);
phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init);
pulsar = _<:(((_)<(ratio_env)):@(100))*((proba)>((_),(no.noise:abs):ba.latch));
};
|
d59eaa24153993e1431ab06bc78685ba25a3fb509450bf211a1753139e5bdaf0 | RuolunWeng/ruolunweng.github.io | Granulator.dsp | declare name "Granulator";
declare author "Adapted from sfIter by Christophe Lebreton";
/* =========== DESCRITPTION =============
- 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
Pmax = 4096; // maximum P (for de.delay-line allocation)
gate = phasor_bin(1) :-(0.001):pulsar;
gain = 1;
freq = hslider("[1]Grain Size[style:knob][acc:2 0 -10 0 10]", 200,5,2205,1);
// la frequence donne la largeur de bande extraite du bruit blanc
// PHASOR_BIN //////////////////////////////
phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init);
// PULSAR //////////////////////////////
//Le pulsar permet de creer une 'pulsation' plus ou moins aleatoire (proba).
pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch));
speed = hslider ("[2]Speed[unit:Hz][style:knob][acc:0 1 -10 0 10]", 10,1,20,0.0001):fi.lowpass(1,1);
ratio_env = 0.5;
fade = (0.5); // min > 0 pour eviter division par 0
proba = hslider ("[3]Probability[unit:%][style:knob][acc:1 0 -10 0 10]", 70,50,100,1) * (0.01):fi.lowpass(1,1);
duree_env = 1/(speed: / (ratio_env*(0.25)*fade));
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/effects/Granulator.dsp | faust | =========== DESCRITPTION =============
- 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
maximum P (for de.delay-line allocation)
la frequence donne la largeur de bande extraite du bruit blanc
PHASOR_BIN //////////////////////////////
PULSAR //////////////////////////////
Le pulsar permet de creer une 'pulsation' plus ou moins aleatoire (proba).
min > 0 pour eviter division par 0 | 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);
};
gate = phasor_bin(1) :-(0.001):pulsar;
gain = 1;
freq = hslider("[1]Grain Size[style:knob][acc:2 0 -10 0 10]", 200,5,2205,1);
phasor_bin (init) = (+(float(speed)/float(ma.SR)) : fmod(_,1.0)) ~ *(init);
pulsar = _<:((_<(ratio_env)):@(100))*(proba>(_,abs(no.noise):ba.latch));
speed = hslider ("[2]Speed[unit:Hz][style:knob][acc:0 1 -10 0 10]", 10,1,20,0.0001):fi.lowpass(1,1);
ratio_env = 0.5;
proba = hslider ("[3]Probability[unit:%][style:knob][acc:1 0 -10 0 10]", 70,50,100,1) * (0.01):fi.lowpass(1,1);
duree_env = 1/(speed: / (ratio_env*(0.25)*fade));
|
14a4b55d6945d52f7df87795a1f0278b5d9b98d7adce04eb79d06ccb3cd63735 | RuolunWeng/ruolunweng.github.io | WoodenKeyboard.dsp | declare name "Wooden Keyboard";
declare author "ER";
import("stdfaust.lib");
instrument = library("instruments.lib");
//d'apres les enveloppes de John Chowning utilisees dans Turenas
/* =============== DESCRIPTION ================= :
- Wooden keyboard
- Head = Echo/Silence
- Rocking = striking across the keyboard from low frequencies (Left) to high frequencies (Right)
- Back + Rotation = long notes
- Front + Rotation = short notes
*/
//--------------------------------- INSTRUMENT ---------------------------------
marimkey(n) = os.osc(octave(n)) * (0.1)
*(trigger(n+1) : enveloppe : fi.lowpass(1,500));
process = hand <: par(i, 10, marimkey(i)) :> echo *(3);
//---------------------------------- UI ----------------------------------------
hand = hslider("[1]Instrument Hand[acc:1 0 -10 0 10]", 5, 0, 10, 1);
hight = hslider("[2]Hight[acc:0 1 -10 0 30]", 5, 1, 10, 0.3) : si.smooth(0.99):min(12):max(1);
envsize = hslider("[3]Note Duration (BPF Envelope) [unit:s][acc:2 0 -10 0 10]", 0.2, 0.1, 0.5, 0.01) * (ma.SR) : si.smooth(0.999): min(44100) : max(4410) : int;
feedback = hslider("[4]Echo Intensity[acc:1 1 -10 0 15]", 0.1, 0.01, 0.9, 0.01):si.smooth(0.999):min(0.9):max(0.01);
//---------------------------------- FREQUENCY TABLE ---------------------------
freq(0) = 164.81;
freq(1) = 174.61;
freq(d) = freq(d-2);
octave(d) = freq(d)* hight;
//------------------------------------ TRIGGER ---------------------------------
upfront(x) = x>x';
counter(g)= (+(1):*(1-g))~_;
position(a,x) = abs(x - a) < 0.5;
trigger(p) = position(p) : upfront : counter;
//------------------------------------ ECHO ------------------------------------
echo = +~(@(echoDelay)*(feedback));
echoDelay = 8096;
//----------------------------------- ENVELOPPES ------------------------------
/* envelope */
enveloppe = tabchowning.f9;
/* Tables Chowning */
tabchowning = environment
{
corres(x) = int(x*envsize/1024);
// f9 0 1024 7 1 248 0.25 259 0.1 259 0.05 258 0
f9 = ba.bpf.start(0, 0):
ba.bpf.point(corres(2), 0.25):
ba.bpf.point(corres(4), 0.5):
ba.bpf.point(corres(10), 0.9):
ba.bpf.point(corres(248), 0.25):
ba.bpf.point(corres(507), 0.1):
ba.bpf.point(corres(766), 0.05):
ba.bpf.end(corres(1024), 0);
};
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/combined/WoodenKeyboard.dsp | faust | d'apres les enveloppes de John Chowning utilisees dans Turenas
=============== DESCRIPTION ================= :
- Wooden keyboard
- Head = Echo/Silence
- Rocking = striking across the keyboard from low frequencies (Left) to high frequencies (Right)
- Back + Rotation = long notes
- Front + Rotation = short notes
--------------------------------- INSTRUMENT ---------------------------------
---------------------------------- UI ----------------------------------------
---------------------------------- FREQUENCY TABLE ---------------------------
------------------------------------ TRIGGER ---------------------------------
------------------------------------ ECHO ------------------------------------
----------------------------------- ENVELOPPES ------------------------------
envelope
Tables Chowning
f9 0 1024 7 1 248 0.25 259 0.1 259 0.05 258 0 | declare name "Wooden Keyboard";
declare author "ER";
import("stdfaust.lib");
instrument = library("instruments.lib");
marimkey(n) = os.osc(octave(n)) * (0.1)
*(trigger(n+1) : enveloppe : fi.lowpass(1,500));
process = hand <: par(i, 10, marimkey(i)) :> echo *(3);
hand = hslider("[1]Instrument Hand[acc:1 0 -10 0 10]", 5, 0, 10, 1);
hight = hslider("[2]Hight[acc:0 1 -10 0 30]", 5, 1, 10, 0.3) : si.smooth(0.99):min(12):max(1);
envsize = hslider("[3]Note Duration (BPF Envelope) [unit:s][acc:2 0 -10 0 10]", 0.2, 0.1, 0.5, 0.01) * (ma.SR) : si.smooth(0.999): min(44100) : max(4410) : int;
feedback = hslider("[4]Echo Intensity[acc:1 1 -10 0 15]", 0.1, 0.01, 0.9, 0.01):si.smooth(0.999):min(0.9):max(0.01);
freq(0) = 164.81;
freq(1) = 174.61;
freq(d) = freq(d-2);
octave(d) = freq(d)* hight;
upfront(x) = x>x';
counter(g)= (+(1):*(1-g))~_;
position(a,x) = abs(x - a) < 0.5;
trigger(p) = position(p) : upfront : counter;
echo = +~(@(echoDelay)*(feedback));
echoDelay = 8096;
enveloppe = tabchowning.f9;
tabchowning = environment
{
corres(x) = int(x*envsize/1024);
f9 = ba.bpf.start(0, 0):
ba.bpf.point(corres(2), 0.25):
ba.bpf.point(corres(4), 0.5):
ba.bpf.point(corres(10), 0.9):
ba.bpf.point(corres(248), 0.25):
ba.bpf.point(corres(507), 0.1):
ba.bpf.point(corres(766), 0.05):
ba.bpf.end(corres(1024), 0);
};
|
960fabe0b6733a09c882b9c8d01e6dc8941228526973788be5e6b340d254c0df | RuolunWeng/ruolunweng.github.io | SBouncyHarp.dsp | declare name "Bouncy Harp";
declare author "ER"; //From Nonlinear EKS by Julius Smith and Romain Michon;
/* =============== DESCRIPTION ================= :
Do not hesitate to make swift and abrupt gestures.
- Head : Silence
- Swing : To pluck the strings of the harp.
- Fishing rod with abrupt stop in Head position : bouncing string effect.
- Frying Pan and Tennis Racket : to pluck a single bouncing string.
*/
import("stdfaust.lib");
//==================== INSTRUMENT =======================
process = par(i, N, NLFeks(i)):>_;
NLFeks(n) = filtered_excitation(n,P(octave(n)),octave(n)) : stringloop(octave(n));
//==================== GUI SPECIFICATION ================
N = 15;
hand = hslider("[1]Instrument Hand [acc:1 0 -8 0 11]", 0, 0, N, 1);// => gate
gain = 1;
reverse = select2(_, 1, 0);
pickangle = 0.9 * hslider("[3]Dry/Soft Strings[acc:2 1 -10 0 10]", 0.45,0,0.9,0.1);
beta = hslider("[4]Picking Position [acc:2 1 -10 0 10]", 0.13, 0.02, 0.5, 0.01);
t60 = hslider("[5]Resonance (InstrReverb)[acc:1 1 -10 0 10]", 5, 0.5, 10, 0.01); // -60db decay time (sec)
B = 0.5;
L = -10 : ba.db2linear;
//---------------------------------- FREQUENCY TABLE ---------------------------
freq(0) = 115;
freq(1) = 130;
freq(2) = 145;
freq(3) = 160;
freq(4) = 175;
freq(d) = freq(d-5)*(2);
octave(d) = freq(d) * hslider("Hight[acc:2 1 -10 0 10]", 3, 1, 6, 0.1) : si.smooth(0.999);
//==================== SIGNAL PROCESSING ================
//----------------------- noiseburst -------------------------
// White no.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));// : NLFM(f));
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SBouncyHarp.dsp | faust | From Nonlinear EKS by Julius Smith and Romain Michon;
=============== DESCRIPTION ================= :
Do not hesitate to make swift and abrupt gestures.
- Head : Silence
- Swing : To pluck the strings of the harp.
- Fishing rod with abrupt stop in Head position : bouncing string effect.
- Frying Pan and Tennis Racket : to pluck a single bouncing string.
==================== INSTRUMENT =======================
==================== GUI SPECIFICATION ================
=> gate
-60db decay time (sec)
---------------------------------- FREQUENCY TABLE ---------------------------
==================== SIGNAL PROCESSING ================
----------------------- noiseburst -------------------------
White no.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
: NLFM(f)); | declare name "Bouncy Harp";
import("stdfaust.lib");
process = par(i, N, NLFeks(i)):>_;
NLFeks(n) = filtered_excitation(n,P(octave(n)),octave(n)) : stringloop(octave(n));
N = 15;
gain = 1;
reverse = select2(_, 1, 0);
pickangle = 0.9 * hslider("[3]Dry/Soft Strings[acc:2 1 -10 0 10]", 0.45,0,0.9,0.1);
beta = hslider("[4]Picking Position [acc:2 1 -10 0 10]", 0.13, 0.02, 0.5, 0.01);
B = 0.5;
L = -10 : ba.db2linear;
freq(0) = 115;
freq(1) = 130;
freq(2) = 145;
freq(3) = 160;
freq(4) = 175;
freq(d) = freq(d-5)*(2);
octave(d) = freq(d) * hslider("Hight[acc:2 1 -10 0 10]", 3, 1, 6, 0.1) : si.smooth(0.999);
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)
|
517a315b6451ad25399ece01e832972b8401000585141f74807d9ae7fdfe4351 | RuolunWeng/ruolunweng.github.io | SPentatonicSoftHarp.dsp | declare name "Pentatonic Soft Harp";
declare author "ER";//Adapted from "Nonlinear EKS" by Julius Smith and Romain Michon;
import("stdfaust.lib");
instrument = library("instruments.lib");
/* =============== DESCRIPTION =================
- Reverberated pentatonic soft harp
- Left = Lower frequencies/Silence when still
- Front = Resonance
- Back = No resonance
- Right = Higher frequencies/Fast rhythm
- Head = Reverberation
- Rocking = plucking all strings one by one
*/
//==================== 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("[1]Instrument Hand[acc:0 1 -10 0 10]", 10, 0, N, 1) : ba.automat(bps, 15, 0.0)// => gate
with{
bps = hslider("[2]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.81;
beta = 0.5;
t60 = hslider("[3]Resonance[unit:s][acc:2 1 -10 0 10]", 5, 0.5, 10, 0.01); // -60db decay time (sec)
B = 0;
L = -10 : ba.db2linear;
//---------------------------------- FREQUENCY TABLE ---------------------------
freq(0) = 184.99;
freq(1) = 207.65;
freq(2) = 233.08;
freq(3) = 277.18;
freq(4) = 311.12;
freq(d) = freq(d-5)*2;
//==================== SIGNAL PROCESSING ================
//----------------------- noiseburst -------------------------
// White no.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));// : NLFM(f));
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SPentatonicSoftHarp.dsp | faust | Adapted from "Nonlinear EKS" by Julius Smith and Romain Michon;
=============== DESCRIPTION =================
- Reverberated pentatonic soft harp
- Left = Lower frequencies/Silence when still
- Front = Resonance
- Back = No resonance
- Right = Higher frequencies/Fast rhythm
- Head = Reverberation
- Rocking = plucking all strings one by one
==================== INSTRUMENT =======================
==================== GUI SPECIFICATION ================
=> gate
-60db decay time (sec)
---------------------------------- FREQUENCY TABLE ---------------------------
==================== SIGNAL PROCESSING ================
----------------------- noiseburst -------------------------
White no.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
: NLFM(f)); | declare name "Pentatonic Soft Harp";
import("stdfaust.lib");
instrument = library("instruments.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("[2]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.81;
beta = 0.5;
B = 0;
L = -10 : ba.db2linear;
freq(0) = 184.99;
freq(1) = 207.65;
freq(2) = 233.08;
freq(3) = 277.18;
freq(4) = 311.12;
freq(d) = freq(d-5)*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)
|
9f8a86b84e3fdf3bf350e74bae572bc109568fd2ebd2c0094796695edd473dcb | RuolunWeng/ruolunweng.github.io | SAtonalSoftHarp.dsp | 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]/Instrument 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));
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SAtonalSoftHarp.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 | 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));
|
7e65e120d5c76d9705155c0c706b7293d079c7ee1760b4ab6cdbd6779d46a9f1 | RuolunWeng/ruolunweng.github.io | SChromaticSoftHarp.dsp | declare name "Chromatic Soft Harp";
declare author "ER";//Adapted from Nonlinear EKS by Julius Smith and Romain Michon;
declare reference "http://ccrma.stanford.edu/~jos/pasp/vegf.html";
import("stdfaust.lib");
/* =============== DESCRIPTION =================
- Soft chromatic harp
- Left = Lower frequencies/Silence when still
- Front = Resonance
- Back = No resonance
- Right = Higher frequencies/Fast rhythm
- Rocking = plucking all strings one by one
*/
//==================== INSTRUMENT =======================
process = par(i, N, NFLeks(i)):>_;
NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n));
//==================== GUI SPECIFICATION ================
N = 24;
hand = hslider("h:[1]/Instrument Hand[acc:0 1 -10 0 10]", 12, 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;
vol = 2;
pickangle = 0.9;
beta = 0.5;
// String decay time in seconds:
t60 = hslider("[2]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) = 130.81;
freq(1) = 138.59;
freq(2) = 146.83;
freq(3) = 155.56;
freq(4) = 164.81;
freq(5) = 174.61;
freq(6) = 184.99;
freq(7) = 195.99;
freq(8) = 207.65;
freq(9) = 220.00;
freq(10) = 233.08;
freq(11) = 246.94;
freq(d) = freq(d-12)*(2);
//==================== SIGNAL PROCESSING ================
//----------------------- noiseburst -------------------------
// White no.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);
};
//nlfOrder = 6;
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));
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SChromaticSoftHarp.dsp | faust | Adapted from Nonlinear EKS by Julius Smith and Romain Michon;
=============== DESCRIPTION =================
- Soft chromatic harp
- Left = Lower frequencies/Silence when still
- Front = Resonance
- Back = No resonance
- Right = Higher frequencies/Fast rhythm
- Rocking = plucking all strings one by one
==================== INSTRUMENT =======================
==================== GUI SPECIFICATION ================
=> gate
String decay time in seconds:
-60db decay time (sec)
---------------------------------- FREQUENCY TABLE ---------------------------
==================== SIGNAL PROCESSING ================
----------------------- noiseburst -------------------------
White no.noise burst (adapted from Faust's karplus.dsp example)
Requires music.lib (for no.noise)
nlfOrder = 6;
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 | declare name "Chromatic Soft Harp";
declare reference "http://ccrma.stanford.edu/~jos/pasp/vegf.html";
import("stdfaust.lib");
process = par(i, N, NFLeks(i)):>_;
NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n));
N = 24;
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;
vol = 2;
pickangle = 0.9;
beta = 0.5;
B = 0;
L = -10 : ba.db2linear;
freq(0) = 130.81;
freq(1) = 138.59;
freq(2) = 146.83;
freq(3) = 155.56;
freq(4) = 164.81;
freq(5) = 174.61;
freq(6) = 184.99;
freq(7) = 195.99;
freq(8) = 207.65;
freq(9) = 220.00;
freq(10) = 233.08;
freq(11) = 246.94;
freq(d) = freq(d-12)*(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));
|
cf4309c12ca2a7f5ab9f6440f29a14a27e03c99c5f93b1f8080afa199525079e | RuolunWeng/ruolunweng.github.io | SCMajSoftHarp.dsp | declare name "C Major Soft Harp";
declare author "ER";//Adapted from Nonlinear EKS by Julius Smith and Romain Michon;
declare reference "http://ccrma.stanford.edu/~jos/pasp/vegf.html";
import("stdfaust.lib");
/* =============== DESCRIPTION ================= :
- C Major soft harp
- Left = Lower frequencies/Silence when still
- Front = Resonance
- Back = No resonance
- Right = Higher frequencies/Fast rhythm
- Rocking = plucking all strings one by one
*/
//==================== INSTRUMENT =======================
process = vgroup("Soft Harp - C Major",par(i, N, NFLeks(i)):>_);
NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n));
//==================== GUI SPECIFICATION ================
N = 24;
hand = hslider("h:[1]/Instrument Hand[acc:0 1 -10 0 10]", 12, 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.81;
beta = 0.5;
t60 = hslider("[2]Resonance (InstrReverb)[unit:s][acc:0 0 -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) = 130.81;
freq(1) = 146.83;
freq(2) = 164.81;
freq(3) = 174.61;
freq(4) = 195.99;
freq(5) = 220.00;
freq(6) = 246.94;
freq(d) = freq(d-7)*(2);
//==================== SIGNAL PROCESSING ================
//----------------------- noiseburst -------------------------
// White no.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));// : NLFM(f));
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/SCMajSoftHarp.dsp | faust | Adapted from Nonlinear EKS by Julius Smith and Romain Michon;
=============== DESCRIPTION ================= :
- C Major soft harp
- Left = Lower frequencies/Silence when still
- Front = Resonance
- Back = No resonance
- Right = Higher frequencies/Fast rhythm
- Rocking = plucking all strings one by one
==================== INSTRUMENT =======================
==================== GUI SPECIFICATION ================
=> gate
-60db decay time (sec)
---------------------------------- FREQUENCY TABLE ---------------------------
==================== SIGNAL PROCESSING ================
----------------------- noiseburst -------------------------
White no.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
: NLFM(f)); | declare name "C Major Soft Harp";
declare reference "http://ccrma.stanford.edu/~jos/pasp/vegf.html";
import("stdfaust.lib");
process = vgroup("Soft Harp - C Major",par(i, N, NFLeks(i)):>_);
NFLeks(n) = filtered_excitation(n,P(freq(n)),freq(n)) : stringloop(freq(n));
N = 24;
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.81;
beta = 0.5;
B = 0;
L = -10 : ba.db2linear;
freq(0) = 130.81;
freq(1) = 146.83;
freq(2) = 164.81;
freq(3) = 174.61;
freq(4) = 195.99;
freq(5) = 220.00;
freq(6) = 246.94;
freq(d) = freq(d-7)*(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)
|
d8d95e1dd9bb940fd276f984b130d78733fefdcb61bcdeb9c77d2ca47d9cce42 | RuolunWeng/ruolunweng.github.io | STunedBar.dsp | declare name "Tuned Bars";
declare author "ER";//From "Tuned Bar" by Romain Michon ([email protected]);
import("stdfaust.lib");
instrument = library("instruments.lib");
/* =============== DESCRIPTION ================= :
- Cascading tuned bars
- Head = Silence
- Bottom = Chime
- Left = Low frequencies + slow rhythm
- Right = High frequencies + fast rhythm
- Geiger counter = Chime
*/
//==================== INSTRUMENT =======================
process = par(i, N, tunedBar(i)):>_;
tunedBar(n) =
((select-1)*-1) <:
//nModes resonances with nModes feedbacks for bow table look-up
par(i,nModes,(resonance(i,octave(n),gate(n))~_)):> + :
//Signal Scaling and stereo
*(15);
//==================== GUI SPECIFICATION ================
N = 10;
gain = 1;
gate(n) = position(n) : upfront;
hand = hslider("[1]Instrument Hand[acc:1 0 -10 0 10]", 5, 0, N, 1):si.smooth(0.999):min(N):max(0):int:ba.automat(B, 15, 0.0);
B = hslider("[3]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 60): si.smooth(0.99) : min(720) : max(180) : int;
hight = hslider("[2]Hight[acc:0 1 -10 0 10]", 4, 0.5, 8, 0.1);//:si.smooth(0.999);
octave(d) = freq(d)*(hight);
position(n) = abs(hand - n) < 0.5;
upfront(x) = abs(x-x') > 0;
select = 1;
//----------------------- Frequency Table --------------------
freq(0) = 130.81;
freq(1) = 146.83;
freq(2) = 164.81;
freq(3) = 184.99;
freq(4) = 207.65;
freq(5) = 233.08;
freq(d) = freq(d-6)*2;
//==================== MODAL PARAMETERS ================
preset = 2;
nMode(2) = 4;
modes(2,0) = 1;
basegains(2,0) = pow(0.999,1);
excitation(2,0,g) = 1*gain*g/nMode(2);
modes(2,1) = 4.0198391420;
basegains(2,1) = pow(0.999,2);
excitation(2,1,g) = 1*gain*g/nMode(2);
modes(2,2) = 10.7184986595;
basegains(2,2) = pow(0.999,3);
excitation(2,2,g) = 1*gain*g/nMode(2);
modes(2,3) = 18.0697050938;
basegains(2,3) = pow(0.999,4);
excitation(2,3,g) = 1*gain*g/nMode(2);
//==================== SIGNAL PROCESSING ================
//----------------------- Synthesis parameters computing and functions declaration ----------------------------
//the number of modes depends on the preset being used
nModes = nMode(preset);
delayLengthBase(f) = ma.SR/f;
//delay lengths in number of samples
delayLength(x,f) = delayLengthBase(f)/modes(preset,x);
//delay lines
delayLine(x,f) = de.delay(4096,delayLength(x,f));
//Filter bank: fi.bandpass filters (declared in instrument.lib)
radius = 1 - ma.PI*32/ma.SR;
bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius);
//----------------------- Algorithm implementation ----------------------------
//One resonance
resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f);
| https://raw.githubusercontent.com/RuolunWeng/ruolunweng.github.io/035564bb7e36eb4e810ca80077ffa8a9d3e5130b/faustplayground/faust-modules/generators/STunedBar.dsp | faust | From "Tuned Bar" by Romain Michon ([email protected]);
=============== DESCRIPTION ================= :
- Cascading tuned bars
- Head = Silence
- Bottom = Chime
- Left = Low frequencies + slow rhythm
- Right = High frequencies + fast rhythm
- Geiger counter = Chime
==================== INSTRUMENT =======================
nModes resonances with nModes feedbacks for bow table look-up
Signal Scaling and stereo
==================== GUI SPECIFICATION ================
:si.smooth(0.999);
----------------------- Frequency Table --------------------
==================== MODAL PARAMETERS ================
==================== SIGNAL PROCESSING ================
----------------------- Synthesis parameters computing and functions declaration ----------------------------
the number of modes depends on the preset being used
delay lengths in number of samples
delay lines
Filter bank: fi.bandpass filters (declared in instrument.lib)
----------------------- Algorithm implementation ----------------------------
One resonance | declare name "Tuned Bars";
import("stdfaust.lib");
instrument = library("instruments.lib");
process = par(i, N, tunedBar(i)):>_;
tunedBar(n) =
((select-1)*-1) <:
par(i,nModes,(resonance(i,octave(n),gate(n))~_)):> + :
*(15);
N = 10;
gain = 1;
gate(n) = position(n) : upfront;
hand = hslider("[1]Instrument Hand[acc:1 0 -10 0 10]", 5, 0, N, 1):si.smooth(0.999):min(N):max(0):int:ba.automat(B, 15, 0.0);
B = hslider("[3]Speed[style:knob][acc:0 1 -10 0 10]", 480, 180, 720, 60): si.smooth(0.99) : min(720) : max(180) : int;
octave(d) = freq(d)*(hight);
position(n) = abs(hand - n) < 0.5;
upfront(x) = abs(x-x') > 0;
select = 1;
freq(0) = 130.81;
freq(1) = 146.83;
freq(2) = 164.81;
freq(3) = 184.99;
freq(4) = 207.65;
freq(5) = 233.08;
freq(d) = freq(d-6)*2;
preset = 2;
nMode(2) = 4;
modes(2,0) = 1;
basegains(2,0) = pow(0.999,1);
excitation(2,0,g) = 1*gain*g/nMode(2);
modes(2,1) = 4.0198391420;
basegains(2,1) = pow(0.999,2);
excitation(2,1,g) = 1*gain*g/nMode(2);
modes(2,2) = 10.7184986595;
basegains(2,2) = pow(0.999,3);
excitation(2,2,g) = 1*gain*g/nMode(2);
modes(2,3) = 18.0697050938;
basegains(2,3) = pow(0.999,4);
excitation(2,3,g) = 1*gain*g/nMode(2);
nModes = nMode(preset);
delayLengthBase(f) = ma.SR/f;
delayLength(x,f) = delayLengthBase(f)/modes(preset,x);
delayLine(x,f) = de.delay(4096,delayLength(x,f));
radius = 1 - ma.PI*32/ma.SR;
bandPassFilter(x,f) = instrument.bandPass(f*modes(preset,x),radius);
resonance(x,f,g) = + : + (excitation(preset,x,g)*select) : delayLine(x,f) : *(basegains(preset,x)) : bandPassFilter(x,f);
|
Subsets and Splits