_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
|
---|---|---|---|---|---|---|---|
44e32c216c0072f1cfcad44282f0d82b8e2f3b574fce5033936870bcdf1e1bb3 | anwaldt/sound_synthesis_faust | exponential.dsp | // exponential.dsp
//
// Additive synthesizer with controllable
// exponential spectral decay.
//
// - continuous
// - stereo output
//
// Henrik von Coler
// 2020-05-05
import("stdfaust.lib");
// define a fundamental frequency
f0 = 100;
// define the number of partials
n_partial = 50;
slope = hslider("s", 1, 0.1, 7, 0.01);
// partial function
partial(partCNT,s) = os.oscrs(f) * volume
// arguments
with {
f = f0 * (partCNT+1);
volume = 0.3 * exp(s * -partCNT);
};
// the processing function,
// running 50 partials parallel
// summing them up and applying a global gain
process = par(i, n_partial, partial(i,slope)) :>_ * hslider("Master Gain",0,0,1, 0.1) <: _,_; | https://raw.githubusercontent.com/anwaldt/sound_synthesis_faust/05d4f55b2d064f63cfc0c04403c9f9cb688ba023/faust/Additive/exponential/exponential.dsp | faust | exponential.dsp
Additive synthesizer with controllable
exponential spectral decay.
- continuous
- stereo output
Henrik von Coler
2020-05-05
define a fundamental frequency
define the number of partials
partial function
arguments
the processing function,
running 50 partials parallel
summing them up and applying a global gain |
import("stdfaust.lib");
f0 = 100;
n_partial = 50;
slope = hslider("s", 1, 0.1, 7, 0.01);
partial(partCNT,s) = os.oscrs(f) * volume
with {
f = f0 * (partCNT+1);
volume = 0.3 * exp(s * -partCNT);
};
process = par(i, n_partial, partial(i,slope)) :>_ * hslider("Master Gain",0,0,1, 0.1) <: _,_; |
57827a6cccaefd9003998e5d1a483430a0603cdbb13bf48f1f8cf9e9c2d3e6a7 | anwaldt/sound_synthesis_faust | granular_synth.dsp | ///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Grain Generator.
// Another granular synthesis example.
// This one is not finished, but ready for more features and improvements...
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// ANALOG IN:
// ANALOG 0 : Population: 0=almost nothing. 1=Full grain
// ANALOG 1 : Depth of each grin, in ms.
// ANALOG 2 : Position in the table = delay
// ANALOG 3 : Speed = pitch change of the grains
// ANALOG 4 : Feedback
//
///////////////////////////////////////////////////////////////////////////////////////////////////
import("all.lib");
// FOR 4 grains - MONO
// read a set of wav files
s = soundfile("label[url:{'kick.wav'; 'cowbell.wav'; 'my_model.wav'}]", 1);
sample = so.sound(s, 2);
// UI //////////////////////////////////////////
popul = 1 - hslider("population", 1, 0, 1, 0.001); // Coef 1= maximum; 0 = almost nothing (0.95)
taille = hslider("taille", 100, 4, 200, 0.001 ); // Size in millisecondes
decal = 1 - hslider("decal",0,0,1,0.001); // read position compared to table srite position
speed = hslider("speed", 1, 0.125, 4, 0.001);
feedback = hslider("feedback",0,0,2,0.001);
freq = 1000/taille;
tmpTaille = taille*ma.SR/ 1000;
clocSize = int(tmpTaille + (tmpTaille*popul*10)); // duration between 2 clicks
// CLK GENERAL /////////////////////////////////
// 4 clicks vers 4 generateurs de grains.
// (idem clk freq/4 et un compteur...)
detect1(x) = select2 (x < 10, 0, 1);
detect2(x) = select2 (x > clocSize*1/3, 0, 1) : select2 (x < (clocSize*1/3)+10, 0, _);
detect3(x) = select2 (x > clocSize*2/3, 0, 1) : select2 (x < (clocSize*2/3)+10, 0, _);
detect4(x) = select2 (x > clocSize-10, 0, 1);
cloc = (%(_,clocSize))~(+(1)) <: (detect1: trig),(detect2: trig),(detect3: trig),(detect4: trig);
// SIGNAUX Ctrls Player ////////////////////////
trig = _<:_,mem: >;
envelop = *(2*PI):+(PI):cos:*(0.5):+(0.5);
rampe(f, t) = delta : (+ : select2(t,_,delta<0) : max(0)) ~ _ : raz
with {
raz(x) = select2 (x > 1, x, 0);
delta = sh(f,t)/ma.SR;
sh(x,t) = ba.sAndH(t,x);
};
rampe2(speed, t) = delta : (+ : select2(t,_,delta<0) : max(0)) ~ _
with {
delta = sh(speed,t);
sh(x,t) = ba.sAndH(t,x);
};
// RWTable //////////////////////////////////////
unGrain(input, clk) = (linrwtable( wf , rindex) : *(0.2 * EnvGrain))
with {
SR = 44100;
buffer_sec = 1;
size = int(SR * buffer_sec);
init = 0.;
EnvGrain = clk : (rampe(freq) : envelop);
windex = (%(_,size) ) ~ ( +(1) );
posTabl = int(ba.sAndH(clk, windex));
rindex = %(int(rampe2(speed, clk)) + posTabl + int(size * decal), size);
wf = size, init, int(windex), input;
};
// LINEAR_INTERPOLATION_RWTABLE //////////////////////////////////
// read rwtable with linear interpolation
// wf : waveform to read ( wf is defined by (size_buffer,init, windex, input ))
// x : position to read (0 <= x < size(wf)) and float
// nota: rwtable(size, init, windex, input, rindex)
linrwtable(wf,x) = linterpolation(y0,y1,d)
with {
x0 = int(x); //
x1 = int(x+1); //
d = x-x0;
y0 = rwtable(wf,x0); //
y1 = rwtable(wf,x1); //
linterpolation(v0,v1,c) = v0*(1-c)+v1*c;
};
// FINALISATION /////////////////////////////////////////////////////////////////////////////////////
routeur (a, b, c, d, e) = a, b, a, c, a, d, a, e;
processus = _ , cloc : routeur : (unGrain, unGrain, unGrain, unGrain) :> fi.dcblockerat(20);
process = _,_: ((+(_,_) :processus) ~(*(feedback))),((+(_,_) :processus) ~(*(feedback))); | https://raw.githubusercontent.com/anwaldt/sound_synthesis_faust/05d4f55b2d064f63cfc0c04403c9f9cb688ba023/faust/Granular/granular_synth.dsp | faust | /////////////////////////////////////////////////////////////////////////////////////////////////
Grain Generator.
Another granular synthesis example.
This one is not finished, but ready for more features and improvements...
/////////////////////////////////////////////////////////////////////////////////////////////////
ANALOG IN:
ANALOG 0 : Population: 0=almost nothing. 1=Full grain
ANALOG 1 : Depth of each grin, in ms.
ANALOG 2 : Position in the table = delay
ANALOG 3 : Speed = pitch change of the grains
ANALOG 4 : Feedback
/////////////////////////////////////////////////////////////////////////////////////////////////
FOR 4 grains - MONO
read a set of wav files
UI //////////////////////////////////////////
Coef 1= maximum; 0 = almost nothing (0.95)
Size in millisecondes
read position compared to table srite position
duration between 2 clicks
CLK GENERAL /////////////////////////////////
4 clicks vers 4 generateurs de grains.
(idem clk freq/4 et un compteur...)
SIGNAUX Ctrls Player ////////////////////////
RWTable //////////////////////////////////////
LINEAR_INTERPOLATION_RWTABLE //////////////////////////////////
read rwtable with linear interpolation
wf : waveform to read ( wf is defined by (size_buffer,init, windex, input ))
x : position to read (0 <= x < size(wf)) and float
nota: rwtable(size, init, windex, input, rindex)
FINALISATION ///////////////////////////////////////////////////////////////////////////////////// |
import("all.lib");
s = soundfile("label[url:{'kick.wav'; 'cowbell.wav'; 'my_model.wav'}]", 1);
sample = so.sound(s, 2);
speed = hslider("speed", 1, 0.125, 4, 0.001);
feedback = hslider("feedback",0,0,2,0.001);
freq = 1000/taille;
tmpTaille = taille*ma.SR/ 1000;
detect1(x) = select2 (x < 10, 0, 1);
detect2(x) = select2 (x > clocSize*1/3, 0, 1) : select2 (x < (clocSize*1/3)+10, 0, _);
detect3(x) = select2 (x > clocSize*2/3, 0, 1) : select2 (x < (clocSize*2/3)+10, 0, _);
detect4(x) = select2 (x > clocSize-10, 0, 1);
cloc = (%(_,clocSize))~(+(1)) <: (detect1: trig),(detect2: trig),(detect3: trig),(detect4: trig);
trig = _<:_,mem: >;
envelop = *(2*PI):+(PI):cos:*(0.5):+(0.5);
rampe(f, t) = delta : (+ : select2(t,_,delta<0) : max(0)) ~ _ : raz
with {
raz(x) = select2 (x > 1, x, 0);
delta = sh(f,t)/ma.SR;
sh(x,t) = ba.sAndH(t,x);
};
rampe2(speed, t) = delta : (+ : select2(t,_,delta<0) : max(0)) ~ _
with {
delta = sh(speed,t);
sh(x,t) = ba.sAndH(t,x);
};
unGrain(input, clk) = (linrwtable( wf , rindex) : *(0.2 * EnvGrain))
with {
SR = 44100;
buffer_sec = 1;
size = int(SR * buffer_sec);
init = 0.;
EnvGrain = clk : (rampe(freq) : envelop);
windex = (%(_,size) ) ~ ( +(1) );
posTabl = int(ba.sAndH(clk, windex));
rindex = %(int(rampe2(speed, clk)) + posTabl + int(size * decal), size);
wf = size, init, int(windex), input;
};
linrwtable(wf,x) = linterpolation(y0,y1,d)
with {
d = x-x0;
linterpolation(v0,v1,c) = v0*(1-c)+v1*c;
};
routeur (a, b, c, d, e) = a, b, a, c, a, d, a, e;
processus = _ , cloc : routeur : (unGrain, unGrain, unGrain, unGrain) :> fi.dcblockerat(20);
process = _,_: ((+(_,_) :processus) ~(*(feedback))),((+(_,_) :processus) ~(*(feedback))); |
24edf2318281d3940753208055b62fd15586ac4da3821c6d8b8b8fe1354952bf | anwaldt/sound_synthesis_faust | waveguide_string.dsp | // waveguide_string.dsp
//
// waveguide model of a string
//
// - one-pole lowpass termination
//
// Henrik von Coler
// 2020-06-09
import("all.lib");
// use '(pm.)l2s' to calculate number of samples
// from length in meters:
segment(maxLength,length) = waveguide(nMax,n)
with{
nMax = maxLength : l2s;
n = length : l2s/2;
};
// one lowpass terminator
fc = hslider("lowpass",1000,10,10000,1);
rt = rTermination(basicBlock,*(-1) : si.smooth(1.0-2*(fc/ma.SR)));
// one gain terminator with control
gain = hslider("gain",0.99,0,1,0.01);
lt = lTermination(*(-1)* gain,basicBlock);
idString(length,pos,excite) = endChain(wg)
with{
nUp = length*pos;
nDown = length*(1-pos);
wg = chain(lt : segment(6,nUp) : in(excite) : out : segment(6,nDown) : rt); // waveguide chain
};
exc = select2(gain>0.9,1,0);
length = hslider("length",1,0.1,10,0.01):si.smoo;
process = idString(length,0.15, button("trigger")) <: _,_; | https://raw.githubusercontent.com/anwaldt/sound_synthesis_faust/05d4f55b2d064f63cfc0c04403c9f9cb688ba023/faust/Physical/waveguide/waveguide_string.dsp | faust | waveguide_string.dsp
waveguide model of a string
- one-pole lowpass termination
Henrik von Coler
2020-06-09
use '(pm.)l2s' to calculate number of samples
from length in meters:
one lowpass terminator
one gain terminator with control
waveguide chain |
import("all.lib");
segment(maxLength,length) = waveguide(nMax,n)
with{
nMax = maxLength : l2s;
n = length : l2s/2;
};
fc = hslider("lowpass",1000,10,10000,1);
rt = rTermination(basicBlock,*(-1) : si.smooth(1.0-2*(fc/ma.SR)));
gain = hslider("gain",0.99,0,1,0.01);
lt = lTermination(*(-1)* gain,basicBlock);
idString(length,pos,excite) = endChain(wg)
with{
nUp = length*pos;
nDown = length*(1-pos);
};
exc = select2(gain>0.9,1,0);
length = hslider("length",1,0.1,10,0.01):si.smoo;
process = idString(length,0.15, button("trigger")) <: _,_; |
1a6410c6627b6d80dff24a7113ca5322e05baef62c1f7f8bab9719835971f0c4 | anwaldt/sound_synthesis_faust | sample_trigger.dsp | // sample_trigger.dsp
//
// Read files and make them playable with a trigger.
//
// - makes use of the
//
// Henrik von Coler
// 2020-05-28
import("stdfaust.lib");
// read a set of wav files
s = soundfile("label[url:{'../WAV/kick.wav'; '../WAV/cowbell.wav'; '../WAV/my_model.wav'}]", 1);
// a slider for controlling the level of all samples:
level = hslider("level",1,0,2,0.01);
// sample objects
kick = so.sound(s, 0);
bell = so.sound(s, 1);
process = kick.play( level, button("kick") ), bell.play( level, button("bell")) :> _ <: _,_ ;
| https://raw.githubusercontent.com/anwaldt/sound_synthesis_faust/05d4f55b2d064f63cfc0c04403c9f9cb688ba023/faust/Sampling/sample_trigger.dsp | faust | sample_trigger.dsp
Read files and make them playable with a trigger.
- makes use of the
Henrik von Coler
2020-05-28
read a set of wav files
a slider for controlling the level of all samples:
sample objects |
import("stdfaust.lib");
s = soundfile("label[url:{'../WAV/kick.wav'; '../WAV/cowbell.wav'; '../WAV/my_model.wav'}]", 1);
level = hslider("level",1,0,2,0.01);
kick = so.sound(s, 0);
bell = so.sound(s, 1);
process = kick.play( level, button("kick") ), bell.play( level, button("bell")) :> _ <: _,_ ;
|
9bb06c491ddb400e4537bfd99b74d55b9147fccfc1ed3c1e083a1ee2b21c9d7c | anwaldt/sound_synthesis_faust | guitar.dsp | import("all.lib");
//process = nylonGuitar_ui_MIDI : _;
process = nylonGuitarModel(3,1,button("trigger")) : _; | https://raw.githubusercontent.com/anwaldt/sound_synthesis_faust/05d4f55b2d064f63cfc0c04403c9f9cb688ba023/faust/Physical/guitar/guitar.dsp | faust | process = nylonGuitar_ui_MIDI : _; | import("all.lib");
process = nylonGuitarModel(3,1,button("trigger")) : _; |
137c816f2a808dd98f639eba7791addbf67141e6008b6d7013f89a4ae9a84ca9 | anwaldt/sound_synthesis_faust | grain_player.dsp | // grain_player.dsp
//
// Play a wave file in grains.
//
// - four grains
// - glitches when changing grain position
//
// Henrik von Coler
// 2020-05-28
import("stdfaust.lib");
// read a set of wav files
s = soundfile("label[url:{'../WAV/chips.wav'; '../WAV/my_model.wav'; '../WAV/sine.wav'}]", 1);
// a slider for selecting a sound file:
file_idx = hslider("file_idx",0,0,2,1);
// a slider for controlling the playback speed of the grains:
speed = hslider("speed",1,-10,10,0.01);
// start point for grain playback
start = hslider("start",0,0,1,0.01);
// a slider for the grain length:
length = hslider("length",1000,1000,40000,1): si.smoo;
// control the sample density (or the clock speed)
density = hslider("density", 0.1,0.01,20,0.01);
// the ramp is used for scrolling through the indices
ramp(f, t) = delta : (+ : select2(t,_,delta<0) : max(0)) ~ _ : raz
with {
// keep below 1:
raz(x) = select2 (x > 1, x, 0);
delta = sh(f,t)/ma.SR;
// sample and hold
sh(x,t) = ba.sAndH(t,x);
};
// 4 impulse trains with 1/4 period phase shifts
quad_clock(d) = os.lf_imptrain(d) <: _ , ( _ : @(0.25*(1/d) * ma.SR)) , ( _ : @(0.5*(1/d) * ma.SR)), ( _ : @(0.75*(1/d) * ma.SR)) ;
// function for a single grain
grain(s, part, start, l,tt) = (part, pos) : outs(s) : _* win_gain
with {
// ramp from 0 to 1
r = ramp(speed,tt);
// the playback position derived from the ramp
pos = r*l + (start*length(s));
// a simple sine window
win_gain = sin(r*3.14159);
// get recent file's properties
length(s) = part,0 : s : _,si.block(outputs(s)-1);
srate(s) = part,0 : s : !,_,si.block(outputs(s)-2);
// play sample
outs(s) = s : si.block(2), si.bus(outputs(s)-2);
};
// four parallel grain players triggered by the quad-clock
process = quad_clock(density) : par(i,4,grain(s, file_idx, start, length)) :> _,_;// :> _ <: _,_;
| https://raw.githubusercontent.com/anwaldt/sound_synthesis_faust/05d4f55b2d064f63cfc0c04403c9f9cb688ba023/faust/Granular/grain_player.dsp | faust | grain_player.dsp
Play a wave file in grains.
- four grains
- glitches when changing grain position
Henrik von Coler
2020-05-28
read a set of wav files
a slider for selecting a sound file:
a slider for controlling the playback speed of the grains:
start point for grain playback
a slider for the grain length:
control the sample density (or the clock speed)
the ramp is used for scrolling through the indices
keep below 1:
sample and hold
4 impulse trains with 1/4 period phase shifts
function for a single grain
ramp from 0 to 1
the playback position derived from the ramp
a simple sine window
get recent file's properties
play sample
four parallel grain players triggered by the quad-clock
:> _ <: _,_; |
import("stdfaust.lib");
s = soundfile("label[url:{'../WAV/chips.wav'; '../WAV/my_model.wav'; '../WAV/sine.wav'}]", 1);
file_idx = hslider("file_idx",0,0,2,1);
speed = hslider("speed",1,-10,10,0.01);
start = hslider("start",0,0,1,0.01);
length = hslider("length",1000,1000,40000,1): si.smoo;
density = hslider("density", 0.1,0.01,20,0.01);
ramp(f, t) = delta : (+ : select2(t,_,delta<0) : max(0)) ~ _ : raz
with {
raz(x) = select2 (x > 1, x, 0);
delta = sh(f,t)/ma.SR;
sh(x,t) = ba.sAndH(t,x);
};
quad_clock(d) = os.lf_imptrain(d) <: _ , ( _ : @(0.25*(1/d) * ma.SR)) , ( _ : @(0.5*(1/d) * ma.SR)), ( _ : @(0.75*(1/d) * ma.SR)) ;
grain(s, part, start, l,tt) = (part, pos) : outs(s) : _* win_gain
with {
r = ramp(speed,tt);
pos = r*l + (start*length(s));
win_gain = sin(r*3.14159);
length(s) = part,0 : s : _,si.block(outputs(s)-1);
srate(s) = part,0 : s : !,_,si.block(outputs(s)-2);
outs(s) = s : si.block(2), si.bus(outputs(s)-2);
};
|
9766da149fa0fea837a59ec4b0859a369c068fdc382f11d32ada516dfe82ea82 | anwaldt/sound_synthesis_faust | switch_example.dsp | // switch_example.dsp
//
//
// Henrik von Coler
// 2020-05-28
import("all.lib");
// outputs 0 if x is greater 1
// and 1 if x is below 0
// 'l' is used as an implicit argument
sel(l,x) = select2((x>=0), 0, 1);
process = -0.1 : sel(2); | https://raw.githubusercontent.com/anwaldt/sound_synthesis_faust/05d4f55b2d064f63cfc0c04403c9f9cb688ba023/faust/Basics/switch_example.dsp | faust | switch_example.dsp
Henrik von Coler
2020-05-28
outputs 0 if x is greater 1
and 1 if x is below 0
'l' is used as an implicit argument |
import("all.lib");
sel(l,x) = select2((x>=0), 0, 1);
process = -0.1 : sel(2); |
4ff885223750b64302e35afe668b10dc86897fda50d919de5ff0fb65ae81e916 | anwaldt/sound_synthesis_faust | sample_looper.dsp | // sample_looper.dsp
//
// Read a set of samples from wav files
//
// - loop sample with slider for speed
// - select active sample
//
// Henrik von Coler
// 2020-05-28
import("stdfaust.lib");
// read a set of wav files
s = soundfile("label[url:{'../WAV/kick.wav'; '../WAV/cowbell.wav'; '../WAV/my_model.wav'}]", 1);
// a slider for selecting a sound file:
file_idx = hslider("file_idx",0,0,2,1);
// a slider for controlling the playback speed:
speed = hslider("speed",1,-100,100,0.01);
// a logic for reverse loops (wrap to positive indices)
wrap(l,x) = select2((x>=0),l-abs(x),x);
// the loop function
loop(s, idx) = (idx, reader(s)) : outs(s)
with {
// get recent file's properties
length(s) = idx,0 : s : _,si.block(outputs(s)-1);
srate(s) = idx,0 : s : !,_,si.block(outputs(s)-2);
// the playback position (a recursive counter)
reader(s) = (speed * float(srate(s)))/ma.SR : (+,length(s):fmod)~ _ : wrap(length(s)) : int;
// read from sample
outs(s) = s : si.block(2), si.bus(outputs(s)-2);
};
process = loop(s,file_idx) <: _,_ ; | https://raw.githubusercontent.com/anwaldt/sound_synthesis_faust/05d4f55b2d064f63cfc0c04403c9f9cb688ba023/faust/Sampling/sample_looper.dsp | faust | sample_looper.dsp
Read a set of samples from wav files
- loop sample with slider for speed
- select active sample
Henrik von Coler
2020-05-28
read a set of wav files
a slider for selecting a sound file:
a slider for controlling the playback speed:
a logic for reverse loops (wrap to positive indices)
the loop function
get recent file's properties
the playback position (a recursive counter)
read from sample |
import("stdfaust.lib");
s = soundfile("label[url:{'../WAV/kick.wav'; '../WAV/cowbell.wav'; '../WAV/my_model.wav'}]", 1);
file_idx = hslider("file_idx",0,0,2,1);
speed = hslider("speed",1,-100,100,0.01);
wrap(l,x) = select2((x>=0),l-abs(x),x);
loop(s, idx) = (idx, reader(s)) : outs(s)
with {
length(s) = idx,0 : s : _,si.block(outputs(s)-1);
srate(s) = idx,0 : s : !,_,si.block(outputs(s)-2);
reader(s) = (speed * float(srate(s)))/ma.SR : (+,length(s):fmod)~ _ : wrap(length(s)) : int;
outs(s) = s : si.block(2), si.bus(outputs(s)-2);
};
process = loop(s,file_idx) <: _,_ ; |
ffe4be1f04017e0feb1c16c4b387f89d391558f4af5297c7b70acdbf02f40a93 | s-e-a-m/fc2003dsaae2 | signalflow1b.dsp | import("seam.lib");
//-----------------------signal flow 1b-----------------------
//Role of the signal flow block: generation of control signals based on mic1 and mic2 input, plus internal signal generators
//--------------------Four variables are to be initialized prior to performance:
//VAR1
//distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
var1 = 23;
//VAR2
//rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
//to evaluate at rehearsal time, in a situation of "silence".
var2 = 1000;
//VAR3
//subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
var3 = 0.2;
//VAR4
//distance (in meters) between the two farthest removed loudspeakers on the front-rear axis.
var4 = 11;
signal_flow_1b(
var1,
var3,
grainOut1,
grainOut2,
mic1,
mic2,
memWriteLev,
cntrlMain
) =
(
mic1, mic2 : sfi.hp1a(50), sfi.hp1a(50) : sfi.lp1pa(6000), sfi.lp1pa(6000) : sds.integrator(0.01), sds.integrator(0.01) : sds.delayfb(0.01,0.999), sds.delayfb(0.01,0.999) : fi.lowpass(5, 0.5), fi.lowpass(5, 0.5)
),
(
grainOut1, grainOut2: + : sds.integrator(0.01) : sds.delayfb(0.01, 0.97) : fi.lowpass(5,0.5) <: _+sds.delayfb(var1*(2), (1-var3)*(0.5)) : sds.mapsub(_,1,0.5)
),
(
(timeIndex(var1)<: sds.mapmul(_,-2,0.5),sds.mapmul(_,1,0.5)), triangle1(var1, memWriteLev)*memWriteLev,triangle2(var1, cntrlMain), triangle3(var1)
)
with{
timeIndex(var1) = sds.osctri(1/(var1*(2)));
triangle1(var1, memWriteLev) = sds.osctri(1/(var1*(6)))*memWriteLev;
triangle2(var1, cntrlMain) = sds.osctri(var1*(1-cntrlMain));
triangle3(var1) = sds.osctri(1/var1);
} :
vgroup("Signal Flow 1b",
(max(0, min(1)) : hbargraph("[01]cntrlMic1",0,1)),
(max(0, min(1)) : hbargraph("[02]cntrlMic2", 0,1)),
(max(0, min(1)) : hbargraph("[03]DirectLevel",0,1)),
(max(-1, min(1)) : hbargraph("[04]timeIndex1", -1,1)),
(max(-1, min(1)) : hbargraph("[05]timeIndex2",-1,1)),
(max(0, min(1)) : hbargraph("[06]triangle1",0,1)),
(max(0, min(1)) : hbargraph("[07]triangle2",0,1)),
(max(0, min(1)) : hbargraph("[08]triangle3",0,1))
);
process = no.multinoise(6) : par(i,6,*(0.1)) : signal_flow_1b(var1,var3);
fakeosc(N) = par(i,N,os.osc(i+0.001)*(ba.db2linear(-18)));
//process = fakeosc(6) : signal_flow_1b(var1,var3);
| https://raw.githubusercontent.com/s-e-a-m/fc2003dsaae2/139f19bbc245f6afe31d708d9731404c8fc2bd1e/src/signalflow1b.dsp | faust | -----------------------signal flow 1b-----------------------
Role of the signal flow block: generation of control signals based on mic1 and mic2 input, plus internal signal generators
--------------------Four variables are to be initialized prior to performance:
VAR1
distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
VAR2
rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
to evaluate at rehearsal time, in a situation of "silence".
VAR3
subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
VAR4
distance (in meters) between the two farthest removed loudspeakers on the front-rear axis.
process = fakeosc(6) : signal_flow_1b(var1,var3); | import("seam.lib");
var1 = 23;
var2 = 1000;
var3 = 0.2;
var4 = 11;
signal_flow_1b(
var1,
var3,
grainOut1,
grainOut2,
mic1,
mic2,
memWriteLev,
cntrlMain
) =
(
mic1, mic2 : sfi.hp1a(50), sfi.hp1a(50) : sfi.lp1pa(6000), sfi.lp1pa(6000) : sds.integrator(0.01), sds.integrator(0.01) : sds.delayfb(0.01,0.999), sds.delayfb(0.01,0.999) : fi.lowpass(5, 0.5), fi.lowpass(5, 0.5)
),
(
grainOut1, grainOut2: + : sds.integrator(0.01) : sds.delayfb(0.01, 0.97) : fi.lowpass(5,0.5) <: _+sds.delayfb(var1*(2), (1-var3)*(0.5)) : sds.mapsub(_,1,0.5)
),
(
(timeIndex(var1)<: sds.mapmul(_,-2,0.5),sds.mapmul(_,1,0.5)), triangle1(var1, memWriteLev)*memWriteLev,triangle2(var1, cntrlMain), triangle3(var1)
)
with{
timeIndex(var1) = sds.osctri(1/(var1*(2)));
triangle1(var1, memWriteLev) = sds.osctri(1/(var1*(6)))*memWriteLev;
triangle2(var1, cntrlMain) = sds.osctri(var1*(1-cntrlMain));
triangle3(var1) = sds.osctri(1/var1);
} :
vgroup("Signal Flow 1b",
(max(0, min(1)) : hbargraph("[01]cntrlMic1",0,1)),
(max(0, min(1)) : hbargraph("[02]cntrlMic2", 0,1)),
(max(0, min(1)) : hbargraph("[03]DirectLevel",0,1)),
(max(-1, min(1)) : hbargraph("[04]timeIndex1", -1,1)),
(max(-1, min(1)) : hbargraph("[05]timeIndex2",-1,1)),
(max(0, min(1)) : hbargraph("[06]triangle1",0,1)),
(max(0, min(1)) : hbargraph("[07]triangle2",0,1)),
(max(0, min(1)) : hbargraph("[08]triangle3",0,1))
);
process = no.multinoise(6) : par(i,6,*(0.1)) : signal_flow_1b(var1,var3);
fakeosc(N) = par(i,N,os.osc(i+0.001)*(ba.db2linear(-18)));
|
04da270d070426daf2dda48d32e58d606455bfd11e55bb9b89b78c1059044a33 | s-e-a-m/fc2003dsaae2 | signalflow3.dsp | import("seam.lib");
//-----------------------signal flow 3-----------------------
//Role of the signal flow block: dispatching of audio signals to output channels
//--------------------Four variables are to be initialized prior to performance:
//VAR1
//distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
var1 = 23;
//VAR2
//rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
//to evaluate at rehearsal time, in a situation of "silence".
var2 = 1000;
//VAR3
//subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
var3 = 0.2;
//VAR4
//distance (in meters) between the two farthest removed loudspeakers on the front-rear axis.
var4 = 11;
signal_flow_3(var4) = _,_ <:
_,_,
de.delay(sds.delMax, (var4/2/344)),
de.delay(sds.delMax, (var4/2/344)),
de.delay(sds.delMax, (var4/344)),
de.delay(sds.delMax, (var4/344))
:
vgroup("Signal Flow 3",
(max(-1, min(1)) : hbargraph("[01]out1",-1,1)),
(max(-1, min(1)) : hbargraph("[02]out2",-1,1)),
(max(-1, min(1)) : hbargraph("[03]out3",-1,1)),
(max(-1, min(1)) : hbargraph("[04]out4",-1,1)),
(max(-1, min(1)) : hbargraph("[05]out5",-1,1)),
(max(-1, min(1)) : hbargraph("[06]out6",-1,1))
);
process = signal_flow_3;
| https://raw.githubusercontent.com/s-e-a-m/fc2003dsaae2/139f19bbc245f6afe31d708d9731404c8fc2bd1e/src/signalflow3.dsp | faust | -----------------------signal flow 3-----------------------
Role of the signal flow block: dispatching of audio signals to output channels
--------------------Four variables are to be initialized prior to performance:
VAR1
distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
VAR2
rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
to evaluate at rehearsal time, in a situation of "silence".
VAR3
subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
VAR4
distance (in meters) between the two farthest removed loudspeakers on the front-rear axis. | import("seam.lib");
var1 = 23;
var2 = 1000;
var3 = 0.2;
var4 = 11;
signal_flow_3(var4) = _,_ <:
_,_,
de.delay(sds.delMax, (var4/2/344)),
de.delay(sds.delMax, (var4/2/344)),
de.delay(sds.delMax, (var4/344)),
de.delay(sds.delMax, (var4/344))
:
vgroup("Signal Flow 3",
(max(-1, min(1)) : hbargraph("[01]out1",-1,1)),
(max(-1, min(1)) : hbargraph("[02]out2",-1,1)),
(max(-1, min(1)) : hbargraph("[03]out3",-1,1)),
(max(-1, min(1)) : hbargraph("[04]out4",-1,1)),
(max(-1, min(1)) : hbargraph("[05]out5",-1,1)),
(max(-1, min(1)) : hbargraph("[06]out6",-1,1))
);
process = signal_flow_3;
|
46ff8db03d68926a9a81f1313f1575801f3524ecc619d8bac961df926dbd98b6 | s-e-a-m/fc2003dsaae2 | signalflow2b.dsp | import("seam.lib");
//-----------------------signal flow 2b-----------------------
//Role of the signal flow block: signal processing of audio input from mic1 and mic2, and mixing of all audio signals
//--------------------Four variables are to be initialized prior to performance:
//VAR1
//distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
var1 = 23;
//VAR2
//rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
//to evaluate at rehearsal time, in a situation of "silence".
var2 = 1000;
//VAR3
//subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
var3 = 0.2;
//VAR4
//distance (in meters) between the two farthest removed loudspeakers on the front-rear axis.
var4 = 11;
signal_flow_2b(
//variabili
var1,
//from 2a
sig1,
sig2,
sig3,
sig4,
sig5,
sig6,
sig7,
//FEEDBACK da 2a
graIN,
//from 1b
timeIndex1,
timeIndex2,
//from 1a
memWriteDel1,
memWriteDel2,
memWriteLev,
cntrlLev1,
cntrlLev2,
//from 1b
triangle3
) =
sig1,sig2,sig2,sig3,sig4,sig7,(
(
( var1,timeIndex1,memWriteDel1,cntrlLev1,21,graIN :
sds.granular_sampling( 2 ) ),
( var1,timeIndex2,memWriteDel2,cntrlLev2,20,graIN :
sds.granular_sampling( 2 ) ) <:
_,_, *(1-(memWriteLev)),*(1-(memWriteLev)),*(memWriteLev),*(memWriteLev)
) :
_,_,_,_,ro.cross(2)
),
(sig5 <: _,de.delay(sds.delMax, ba.sec2samp(0.05)) <:
_*(triangle3),_*(triangle3), _*(1-triangle3),_*(1-triangle3)),
(
(sig6 <: _,de.delay(sds.delMax, ba.sec2samp(0.036)) <:
_*(1-triangle3),_*(1-triangle3),_*(triangle3),_*(triangle3)) :
ro.cross(2),ro.cross(2)
)
: ro.crossNM(6,2),si.bus(12)
:
_,_,(si.bus(18):> _,_)
:
vgroup("Signal Flow 2b",
(max(-1, min(1)) : hbargraph("[01]grainOut1",-1,1)),
(max(-1, min(1)) : hbargraph("[02]grainOut2",-1,1)),
(max(-1, min(1)) : hbargraph("[03]out1",-1,1)),
(max(-1, min(1)) : hbargraph("[04]out2",-1,1))
);
process = no.multinoise(17) : par(i,17,*(0.1)) : signal_flow_2b;
| https://raw.githubusercontent.com/s-e-a-m/fc2003dsaae2/139f19bbc245f6afe31d708d9731404c8fc2bd1e/src/signalflow2b.dsp | faust | -----------------------signal flow 2b-----------------------
Role of the signal flow block: signal processing of audio input from mic1 and mic2, and mixing of all audio signals
--------------------Four variables are to be initialized prior to performance:
VAR1
distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
VAR2
rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
to evaluate at rehearsal time, in a situation of "silence".
VAR3
subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
VAR4
distance (in meters) between the two farthest removed loudspeakers on the front-rear axis.
variabili
from 2a
FEEDBACK da 2a
from 1b
from 1a
from 1b | import("seam.lib");
var1 = 23;
var2 = 1000;
var3 = 0.2;
var4 = 11;
signal_flow_2b(
var1,
sig1,
sig2,
sig3,
sig4,
sig5,
sig6,
sig7,
graIN,
timeIndex1,
timeIndex2,
memWriteDel1,
memWriteDel2,
memWriteLev,
cntrlLev1,
cntrlLev2,
triangle3
) =
sig1,sig2,sig2,sig3,sig4,sig7,(
(
( var1,timeIndex1,memWriteDel1,cntrlLev1,21,graIN :
sds.granular_sampling( 2 ) ),
( var1,timeIndex2,memWriteDel2,cntrlLev2,20,graIN :
sds.granular_sampling( 2 ) ) <:
_,_, *(1-(memWriteLev)),*(1-(memWriteLev)),*(memWriteLev),*(memWriteLev)
) :
_,_,_,_,ro.cross(2)
),
(sig5 <: _,de.delay(sds.delMax, ba.sec2samp(0.05)) <:
_*(triangle3),_*(triangle3), _*(1-triangle3),_*(1-triangle3)),
(
(sig6 <: _,de.delay(sds.delMax, ba.sec2samp(0.036)) <:
_*(1-triangle3),_*(1-triangle3),_*(triangle3),_*(triangle3)) :
ro.cross(2),ro.cross(2)
)
: ro.crossNM(6,2),si.bus(12)
:
_,_,(si.bus(18):> _,_)
:
vgroup("Signal Flow 2b",
(max(-1, min(1)) : hbargraph("[01]grainOut1",-1,1)),
(max(-1, min(1)) : hbargraph("[02]grainOut2",-1,1)),
(max(-1, min(1)) : hbargraph("[03]out1",-1,1)),
(max(-1, min(1)) : hbargraph("[04]out2",-1,1))
);
process = no.multinoise(17) : par(i,17,*(0.1)) : signal_flow_2b;
|
5b41c279b1ff1d115e6fae1d0d66596257a736a9a78b780872b79dac5807413c | s-e-a-m/fc2003dsaae2 | signalflow1a.dsp | import("seam.lib");
//-----------------------signal flow 1a-----------------------
//Role of the signal flow block: generation of control signals based on mic3 and mic4 input
//--------------------Four variables are to be initialized prior to performance:
//VAR1
//distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
var1 = 23;
//VAR2
//rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
//to evaluate at rehearsal time, in a situation of "silence".
var2 = 1000;
//VAR3
//subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
var3 = 0.2;
//VAR4
//distance (in meters) between the two farthest removed loudspeakers on the front-rear axis.
var4 = 11;
signal_flow_1a(
var1,
var2,
//mic1,
//mic2,
mic3,
mic4
) =
//mic1, mic2,
(mic3, mic4 <:
+,(
_,_,(sds.integrator(0.01), sds.integrator(0.01) :
sds.delayfb(0.01,0.95),sds.delayfb(0.01,0.95) :
+ :
sds.mapsum(_,6,6) <:
_,_,_) :
_,ro.cross(2),_,_ :
sds.localmax, sds.localmax,_ :
-,_ :
sds.localmax <:
de.delay(ba.sec2samp(12), ba.sec2samp(12)),_ :
+ :
sds.mapsum(_,0,0.5) :
scy.onepole(0.5) ) :
_ ,(_<: _,_) :
ro.cross(2),_ :
_, (_<: _,_,_,_),_ :
_,_,_,_,* :
sds.mapsub(_,1,1),
(fi.highpass(3,var2) : sds.integrator(0.05)),
(fi.lowpass(3,var2) : sds.integrator(0.1)),
sds.integrator(0.1),
sds.integrator(0.01) :
_,- ,_,_ :
* ,_,_:
sds.delayfb(0.01,0.995),
sds.delayfb(0.01,0.9),
sds.delayfb(0.01,0.995) :
par(i,3,fi.lowpass(5,25)):
sds.mapsum(_,0.5,0.5), (( sds.mapsub(_^2,1,1)) <:
de.delay(sma.imt2samp(var1/2),sma.imt2samp(var1/2)),
de.delay(sma.imt2samp(var1/3),sma.imt2samp(var1/3)),_), (_<:
de.delay(sma.imt2samp(var1/3),sma.imt2samp(var1/3)),
de.delay(sma.imt2samp(var1/2),sma.imt2samp(var1/2)), sds.mapcond,_)) :
vgroup("Signal Flow 1a",
(max(0, min(1)) : hbargraph("[01]diffHL",0,1)),
(max(0, min(1)) : hbargraph("[02]memWriteDel1", 0,1)),
(max(0, min(1)) : hbargraph("[03]memWriteDel2",0,1)),
(max(0, min(1)) : hbargraph("[04]memWriteLev", 0,1)),
(max(0, min(1)) : hbargraph("[05]CntrlLev1",0,1)),
(max(0, min(1)) : hbargraph("[06]CntrlLev2",0,1)),
(max(0, min(1)) : hbargraph("[07]CntrlFeed",0,1)),
(max(0, min(1)) : hbargraph("[08]CntrlMain",0,1))
)
;
//process = no.multinoise(2) : par(i,2,si.smooth(0.7)*(0.1)) : signal_flow_1a(var1,var2);
fakeosc(N) = par(i,N,os.osc(i+0.001)*(ba.db2linear(-42)));
process = _,_@(ma.SR) : signal_flow_1a(var1,var2);
//debugging
//generic test
mmeter(N) = par(i, N, hbargraph("%i",-1, 1));
| https://raw.githubusercontent.com/s-e-a-m/fc2003dsaae2/139f19bbc245f6afe31d708d9731404c8fc2bd1e/src/signalflow1a.dsp | faust | -----------------------signal flow 1a-----------------------
Role of the signal flow block: generation of control signals based on mic3 and mic4 input
--------------------Four variables are to be initialized prior to performance:
VAR1
distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
VAR2
rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
to evaluate at rehearsal time, in a situation of "silence".
VAR3
subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
VAR4
distance (in meters) between the two farthest removed loudspeakers on the front-rear axis.
mic1,
mic2,
mic1, mic2,
process = no.multinoise(2) : par(i,2,si.smooth(0.7)*(0.1)) : signal_flow_1a(var1,var2);
debugging
generic test | import("seam.lib");
var1 = 23;
var2 = 1000;
var3 = 0.2;
var4 = 11;
signal_flow_1a(
var1,
var2,
mic3,
mic4
) =
(mic3, mic4 <:
+,(
_,_,(sds.integrator(0.01), sds.integrator(0.01) :
sds.delayfb(0.01,0.95),sds.delayfb(0.01,0.95) :
+ :
sds.mapsum(_,6,6) <:
_,_,_) :
_,ro.cross(2),_,_ :
sds.localmax, sds.localmax,_ :
-,_ :
sds.localmax <:
de.delay(ba.sec2samp(12), ba.sec2samp(12)),_ :
+ :
sds.mapsum(_,0,0.5) :
scy.onepole(0.5) ) :
_ ,(_<: _,_) :
ro.cross(2),_ :
_, (_<: _,_,_,_),_ :
_,_,_,_,* :
sds.mapsub(_,1,1),
(fi.highpass(3,var2) : sds.integrator(0.05)),
(fi.lowpass(3,var2) : sds.integrator(0.1)),
sds.integrator(0.1),
sds.integrator(0.01) :
_,- ,_,_ :
* ,_,_:
sds.delayfb(0.01,0.995),
sds.delayfb(0.01,0.9),
sds.delayfb(0.01,0.995) :
par(i,3,fi.lowpass(5,25)):
sds.mapsum(_,0.5,0.5), (( sds.mapsub(_^2,1,1)) <:
de.delay(sma.imt2samp(var1/2),sma.imt2samp(var1/2)),
de.delay(sma.imt2samp(var1/3),sma.imt2samp(var1/3)),_), (_<:
de.delay(sma.imt2samp(var1/3),sma.imt2samp(var1/3)),
de.delay(sma.imt2samp(var1/2),sma.imt2samp(var1/2)), sds.mapcond,_)) :
vgroup("Signal Flow 1a",
(max(0, min(1)) : hbargraph("[01]diffHL",0,1)),
(max(0, min(1)) : hbargraph("[02]memWriteDel1", 0,1)),
(max(0, min(1)) : hbargraph("[03]memWriteDel2",0,1)),
(max(0, min(1)) : hbargraph("[04]memWriteLev", 0,1)),
(max(0, min(1)) : hbargraph("[05]CntrlLev1",0,1)),
(max(0, min(1)) : hbargraph("[06]CntrlLev2",0,1)),
(max(0, min(1)) : hbargraph("[07]CntrlFeed",0,1)),
(max(0, min(1)) : hbargraph("[08]CntrlMain",0,1))
)
;
fakeosc(N) = par(i,N,os.osc(i+0.001)*(ba.db2linear(-42)));
process = _,_@(ma.SR) : signal_flow_1a(var1,var2);
mmeter(N) = par(i, N, hbargraph("%i",-1, 1));
|
5e5f387f333c9c3d8d19c5c5f876bd67a45bfdec9af3be09364bc75660777515 | s-e-a-m/fc2003dsaae2 | signalflow2a.dsp | import("seam.lib");
//-----------------------signal flow 2a-----------------------
//Role of the signal flow block: signal processing of audio input from mic1 and mic2, and mixing of all audio signals
//--------------------Four variables are to be initialized prior to performance:
//VAR1
//distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
var1 = 23;
//VAR2
//rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
//to evaluate at rehearsal time, in a situation of "silence".
var2 = 1000;
//VAR3
//subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
var3 = 0.2;
//VAR4
//distance (in meters) between the two farthest removed loudspeakers on the front-rear axis.
var4 = 11;
signal_flow_2a(
//variabili
var1,
var2,
//microfoni
mic1,
mic2,
//signal flow 1b
cntrlMic1,
cntrlMic2,
directLevel,
triangle1,
triangle2,
// signal flow 1a
diffHL,
memWriteDel1,
memWriteDel2,
memWriteLev,
cntrlFeed,
cntrlMain
) =
(_ <:
(
sds.sampleRead(var1, (var2+(diffHL*1000)/261), (1-memWriteDel2)),
sds.sampleRead(var1, ((290-(diffHL*90))/261), ((memWriteLev+memWriteDel1)/2)),
sds.sampleRead(var1, (((var2*2)-(diffHL*1000))/261), (1-memWriteDel1)) :
par(i,3,fi.highpass(4,50)) :
si.bus(2), (_<: _,_):
de.delay(sds.delMax,pm.l2s(var1)/2),
de.delay(sds.delMax,pm.l2s(var1)),
(_<: sfi.bpbw(((var2/2)*memWriteDel2),diffHL*(400)), sfi.bpbw((var2*(1-memWriteDel1)),1-diffHL*(800))),
de.delay(sds.delMax, pm.l2s(var1)/1.5) :> (si.bus(4) :>
_*(cntrlFeed)*(memWriteLev) <:
_,_ : (_,(mic1 : sfi.hp1a(50) : sfi.lp1pa(6000) *(1-cntrlMic1)),(mic2 : sfi.hp1a(50) : sfi.lp1pa(6000) *(1-cntrlMic2)) <:
_,_,_,_,_,_ : (_,_,_ :> *(triangle1)), !,*(directLevel),*(directLevel)) ,(*(memWriteLev) <:
(de.delay(sds.delMax,(0.05*ba.sec2samp(cntrlMain))) *(triangle2)*(directLevel)),
*(1-triangle2)*(directLevel))),_),
(
sds.sampleRead(var1, ((250+(diffHL*20))/261), 1)
: fi.highpass(4,50) : de.delay(sds.delMax,pm.l2s(var1)/3)),
(
sds.sampleRead(var1, 0.766283, memWriteLev)
: fi.highpass(4,50) : de.delay(sds.delMax,pm.l2s(var1)/2.5)))~_ :
_,si.bus(7) : si.bus(5),ro.crossNM(1,2)
:
vgroup("Signal Flow 2a",
(max(-1, min(1)) : hbargraph("[01]sampleWrite",-1,1)),
(max(-1, min(1)) : hbargraph("[02]sig1",-1,1)),
(max(-1, min(1)) : hbargraph("[03]sig2",-1,1)),
(max(-1, min(1)) : hbargraph("[04]sig3",-1,1)),
(max(-1, min(1)) : hbargraph("[05]sig4",-1,1)),
(max(-1, min(1)) : hbargraph("[06]sig5",-1,1)),
(max(-1, min(1)) : hbargraph("[07]sig6",-1,1)),
(max(-1, min(1)) : hbargraph("[08]sig7",-1,1))
);
fakeosc(N) = par(i,N,os.osc(i+0.001) : abs : *(ba.db2linear(-22))) ;
//process = no.multinoise(13) : par(i,13,*(0.1)) : signal_flow_2a(var1,var2);
process = fakeosc(13): signal_flow_2a(var1,var2);
| https://raw.githubusercontent.com/s-e-a-m/fc2003dsaae2/139f19bbc245f6afe31d708d9731404c8fc2bd1e/src/signalflow2a.dsp | faust | -----------------------signal flow 2a-----------------------
Role of the signal flow block: signal processing of audio input from mic1 and mic2, and mixing of all audio signals
--------------------Four variables are to be initialized prior to performance:
VAR1
distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
VAR2
rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
to evaluate at rehearsal time, in a situation of "silence".
VAR3
subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
VAR4
distance (in meters) between the two farthest removed loudspeakers on the front-rear axis.
variabili
microfoni
signal flow 1b
signal flow 1a
process = no.multinoise(13) : par(i,13,*(0.1)) : signal_flow_2a(var1,var2); | import("seam.lib");
var1 = 23;
var2 = 1000;
var3 = 0.2;
var4 = 11;
signal_flow_2a(
var1,
var2,
mic1,
mic2,
cntrlMic1,
cntrlMic2,
directLevel,
triangle1,
triangle2,
diffHL,
memWriteDel1,
memWriteDel2,
memWriteLev,
cntrlFeed,
cntrlMain
) =
(_ <:
(
sds.sampleRead(var1, (var2+(diffHL*1000)/261), (1-memWriteDel2)),
sds.sampleRead(var1, ((290-(diffHL*90))/261), ((memWriteLev+memWriteDel1)/2)),
sds.sampleRead(var1, (((var2*2)-(diffHL*1000))/261), (1-memWriteDel1)) :
par(i,3,fi.highpass(4,50)) :
si.bus(2), (_<: _,_):
de.delay(sds.delMax,pm.l2s(var1)/2),
de.delay(sds.delMax,pm.l2s(var1)),
(_<: sfi.bpbw(((var2/2)*memWriteDel2),diffHL*(400)), sfi.bpbw((var2*(1-memWriteDel1)),1-diffHL*(800))),
de.delay(sds.delMax, pm.l2s(var1)/1.5) :> (si.bus(4) :>
_*(cntrlFeed)*(memWriteLev) <:
_,_ : (_,(mic1 : sfi.hp1a(50) : sfi.lp1pa(6000) *(1-cntrlMic1)),(mic2 : sfi.hp1a(50) : sfi.lp1pa(6000) *(1-cntrlMic2)) <:
_,_,_,_,_,_ : (_,_,_ :> *(triangle1)), !,*(directLevel),*(directLevel)) ,(*(memWriteLev) <:
(de.delay(sds.delMax,(0.05*ba.sec2samp(cntrlMain))) *(triangle2)*(directLevel)),
*(1-triangle2)*(directLevel))),_),
(
sds.sampleRead(var1, ((250+(diffHL*20))/261), 1)
: fi.highpass(4,50) : de.delay(sds.delMax,pm.l2s(var1)/3)),
(
sds.sampleRead(var1, 0.766283, memWriteLev)
: fi.highpass(4,50) : de.delay(sds.delMax,pm.l2s(var1)/2.5)))~_ :
_,si.bus(7) : si.bus(5),ro.crossNM(1,2)
:
vgroup("Signal Flow 2a",
(max(-1, min(1)) : hbargraph("[01]sampleWrite",-1,1)),
(max(-1, min(1)) : hbargraph("[02]sig1",-1,1)),
(max(-1, min(1)) : hbargraph("[03]sig2",-1,1)),
(max(-1, min(1)) : hbargraph("[04]sig3",-1,1)),
(max(-1, min(1)) : hbargraph("[05]sig4",-1,1)),
(max(-1, min(1)) : hbargraph("[06]sig5",-1,1)),
(max(-1, min(1)) : hbargraph("[07]sig6",-1,1)),
(max(-1, min(1)) : hbargraph("[08]sig7",-1,1))
);
fakeosc(N) = par(i,N,os.osc(i+0.001) : abs : *(ba.db2linear(-22))) ;
process = fakeosc(13): signal_flow_2a(var1,var2);
|
99a79275114dc31be6013230d698b835cfeeb8c9fa7486e22516c296f69caee4 | s-e-a-m/fc2003dsaae2 | ae2.dsp |
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2";
declare version "xxx";
declare author "Giuseppe Silvi";
declare author "Luca Spanedda";
declare author "Davide Tedesco";
declare author "Giovanni Michelangelo D'urso";
declare author "Alessandro Malcangi";
declare license "GNU-GPL-v3";
declare copyright "(c)SEAM 2022";
declare description "Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy";
//declare options "[midi:on]";
import("seam.lib");
//--------------------Four variables are to be initialized prior to performance:
//VAR1
//distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
var1 = 12;
//VAR2
//rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
//to evaluate at rehearsal time, in a situation of "silence".
var2 = 150;
//VAR3
//subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
var3 = 0.2;
//VAR4
//distance (in meters) between the two farthest removed loudspeakers on the front-rear axis.
var4 = 11;
//------------------------------------------- signal flow 1a
signal_flow_1a = component("signalflow1a.dsp").signal_flow_1a;
//------------------------------------------- signal flow 1b
signal_flow_1b = component("signalflow1b.dsp").signal_flow_1b;
//------------------------------------------- signal flow 2a
signal_flow_2a = component("signalflow2a.dsp").signal_flow_2a;
//------------------------------------------- signal flow 2b
signal_flow_2b = component("signalflow2b.dsp").signal_flow_2b;
//------------------------------------------- signal flow 3
signal_flow_3 = component("signalflow3.dsp").signal_flow_3;
//------------------------------------------- ae2 signal flow
/*process = //fakesig : _,_,
signal_flow_1a(var1,var2) <: si.bus(24) :
( !,!,!,_,!,!,!,_,
_,_,_,_,!,!,_,_,
!,_,_,_,_,_,!,! :
(signal_flow_1b(var1,var3) <:
si.bus(16)) , _,_,_,_,_,!,!,!,_,_,_,_,_:
//!,!,!,_,_,!,!,_,
!,!,!,_,_,!,!,_,
_,_,_,!,!,_,_,!,
//signal_flow_2a(var1, var2),_,_,_,_,_ :
signal_flow_2a(var1, var2),_,_ :
signal_flow_2b(var1))~si.bus(2) :
!,!,_,_ :
signal_flow_3(var4);
*/
ae2 = (_,_ <: si.bus(4)),
(_,_: signal_flow_1a(var1,var2)<: si.bus(24) :
//to 1b
!,!,!,_,!,!,!,_,
//to 2a
_,_,_,_,!,!,_,_,
//to 2b
!,_,_,_,_,_,!,!
) : ro.crossNM(2,4), si.bus(11) :
((signal_flow_1b(var1,var3) <:
//to 2a
_,_,_,!,!,_,_,!,
//to 2b
!,!,!,_,_,!,!,_
), si.bus(13)
: ro.crossNM(8,2), si.bus(11)
: si.bus(7), ro.crossNM(3,6), si.bus(5)
: signal_flow_2a(var1,var2), si.bus(8)
: si.bus(10),ro.crossNM(1,5)
: signal_flow_2b(var1)
)~ si.bus(2)//feedback 1b
: si.block(2),si.bus(2)
: signal_flow_3(var4);
fakeosc(N) = par(i,N,os.osc(i+0.001)*(ba.db2linear(-42)));
//process = fakeosc(4) : ae2;
process = _,os.osc(0.01),[email protected],os.osc(0.02) : ae2;
//process = fakesig(4) : ae2;
fakesig(N) = no.multinoise(N) : par(i,N,*(ba.db2linear(-18)));
//process = fakesig : signal_flow_1a(var1,var2) : (_,_,ae2gui);
//------------------------------------------- ae2 GUI
ae2gui = tgroup("AE2GUI", sfg1);
sfg1 =
vgroup("[10]Signal Flow 1a",
hbargraph("[00]diffHL",0,1),
hbargraph("[01]memWriteDel1", 0,1),
hbargraph("[02]memWriteDel2", 0,1),
hbargraph("[03]memWriteLev", 0,1),
hbargraph("[04]cntrlLev1", 0,1),
hbargraph("[05]cntrlLev2", 0,1),
hbargraph("[06]cntrlFeed", 0,1),
hbargraph("[07]cntrlMain", 0,1));
sfg2 =
vgroup("[20]Signal Flow 1b",
hbargraph("[00]cntrlMic1",0,1),
hbargraph("[01]cntrlMic2", 0,1),
hbargraph("[02]directLevel", 0,1),
hbargraph("[03]timeIndex1", 0,1),
hbargraph("[04]timeIndex2", 0,1),
hbargraph("[05]triangle1", 0,1),
hbargraph("[06]triangle2", 0,1),
hbargraph("[07]triangle3", 0,1));
| https://raw.githubusercontent.com/s-e-a-m/fc2003dsaae2/a919f4791038c681866216e19087606726453f72/src/ae2.dsp | faust | declare options "[midi:on]";
--------------------Four variables are to be initialized prior to performance:
VAR1
distance (in meters) between the two farthest removed loudspeakers on the left-right axis.
VAR2
rough estimate of the center frequency in the spectrum of the room’s background noise (spectral centroid):
to evaluate at rehearsal time, in a situation of "silence".
VAR3
subjective estimate of how the room revereberance, valued between 0 ("no reverb") and 1 (“very long reverb”).
VAR4
distance (in meters) between the two farthest removed loudspeakers on the front-rear axis.
------------------------------------------- signal flow 1a
------------------------------------------- signal flow 1b
------------------------------------------- signal flow 2a
------------------------------------------- signal flow 2b
------------------------------------------- signal flow 3
------------------------------------------- ae2 signal flow
process = //fakesig : _,_,
signal_flow_1a(var1,var2) <: si.bus(24) :
( !,!,!,_,!,!,!,_,
_,_,_,_,!,!,_,_,
!,_,_,_,_,_,!,! :
(signal_flow_1b(var1,var3) <:
si.bus(16)) , _,_,_,_,_,!,!,!,_,_,_,_,_:
//!,!,!,_,_,!,!,_,
!,!,!,_,_,!,!,_,
_,_,_,!,!,_,_,!,
//signal_flow_2a(var1, var2),_,_,_,_,_ :
signal_flow_2a(var1, var2),_,_ :
signal_flow_2b(var1))~si.bus(2) :
!,!,_,_ :
signal_flow_3(var4);
to 1b
to 2a
to 2b
to 2a
to 2b
feedback 1b
process = fakeosc(4) : ae2;
process = fakesig(4) : ae2;
process = fakesig : signal_flow_1a(var1,var2) : (_,_,ae2gui);
------------------------------------------- ae2 GUI |
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2";
declare version "xxx";
declare author "Giuseppe Silvi";
declare author "Luca Spanedda";
declare author "Davide Tedesco";
declare author "Giovanni Michelangelo D'urso";
declare author "Alessandro Malcangi";
declare license "GNU-GPL-v3";
declare copyright "(c)SEAM 2022";
declare description "Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy";
import("seam.lib");
var1 = 12;
var2 = 150;
var3 = 0.2;
var4 = 11;
signal_flow_1a = component("signalflow1a.dsp").signal_flow_1a;
signal_flow_1b = component("signalflow1b.dsp").signal_flow_1b;
signal_flow_2a = component("signalflow2a.dsp").signal_flow_2a;
signal_flow_2b = component("signalflow2b.dsp").signal_flow_2b;
signal_flow_3 = component("signalflow3.dsp").signal_flow_3;
ae2 = (_,_ <: si.bus(4)),
(_,_: signal_flow_1a(var1,var2)<: si.bus(24) :
!,!,!,_,!,!,!,_,
_,_,_,_,!,!,_,_,
!,_,_,_,_,_,!,!
) : ro.crossNM(2,4), si.bus(11) :
((signal_flow_1b(var1,var3) <:
_,_,_,!,!,_,_,!,
!,!,!,_,_,!,!,_
), si.bus(13)
: ro.crossNM(8,2), si.bus(11)
: si.bus(7), ro.crossNM(3,6), si.bus(5)
: signal_flow_2a(var1,var2), si.bus(8)
: si.bus(10),ro.crossNM(1,5)
: signal_flow_2b(var1)
: si.block(2),si.bus(2)
: signal_flow_3(var4);
fakeosc(N) = par(i,N,os.osc(i+0.001)*(ba.db2linear(-42)));
process = _,os.osc(0.01),[email protected],os.osc(0.02) : ae2;
fakesig(N) = no.multinoise(N) : par(i,N,*(ba.db2linear(-18)));
ae2gui = tgroup("AE2GUI", sfg1);
sfg1 =
vgroup("[10]Signal Flow 1a",
hbargraph("[00]diffHL",0,1),
hbargraph("[01]memWriteDel1", 0,1),
hbargraph("[02]memWriteDel2", 0,1),
hbargraph("[03]memWriteLev", 0,1),
hbargraph("[04]cntrlLev1", 0,1),
hbargraph("[05]cntrlLev2", 0,1),
hbargraph("[06]cntrlFeed", 0,1),
hbargraph("[07]cntrlMain", 0,1));
sfg2 =
vgroup("[20]Signal Flow 1b",
hbargraph("[00]cntrlMic1",0,1),
hbargraph("[01]cntrlMic2", 0,1),
hbargraph("[02]directLevel", 0,1),
hbargraph("[03]timeIndex1", 0,1),
hbargraph("[04]timeIndex2", 0,1),
hbargraph("[05]triangle1", 0,1),
hbargraph("[06]triangle2", 0,1),
hbargraph("[07]triangle3", 0,1));
|
db7352dba435a4e41428be469fc17d8fca4286ce25306e27f9a8542f83904915 | SputnikStan5/LV2-Prototyper | bank-filter_gain.dsp | // SPDX-FileCopyrightText: Hanspeter Portner <[email protected]>
// SPDX-License-Identifier: CC0-1.0
import("stdfaust.lib");
gain_l = hslider("gain left[0]", 0, 0, 1, 0.01);
gain_r = hslider("gain right[1]", 0, 0, 1, 0.01);
process = _ * gain_l, _ * gain_r;
// vim: set syntax=faust:
| https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/mephisto.lv2/dsp/bank-filter_gain.dsp | faust | SPDX-FileCopyrightText: Hanspeter Portner <[email protected]>
SPDX-License-Identifier: CC0-1.0
vim: set syntax=faust: |
import("stdfaust.lib");
gain_l = hslider("gain left[0]", 0, 0, 1, 0.01);
gain_r = hslider("gain right[1]", 0, 0, 1, 0.01);
process = _ * gain_l, _ * gain_r;
|
550f1996b2ac614a0e1b88946c22f6ed98420b1fc35b9cca25c5f6bdf05c23de | SputnikStan5/LV2-Prototyper | bank-analyzer_vu-meter.dsp | // SPDX-FileCopyrightText: Hanspeter Portner <[email protected]>
// SPDX-License-Identifier: CC0-1.0
import("stdfaust.lib");
process = _ <: attach(_,abs : ba.linear2db : hbargraph("Level [0]", -60, 0));
// vim: set syntax=faust:
| https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/mephisto.lv2/dsp/bank-analyzer_vu-meter.dsp | faust | SPDX-FileCopyrightText: Hanspeter Portner <[email protected]>
SPDX-License-Identifier: CC0-1.0
vim: set syntax=faust: |
import("stdfaust.lib");
process = _ <: attach(_,abs : ba.linear2db : hbargraph("Level [0]", -60, 0));
|
e8d2c4839ada9abc325f3d87bd0fc440c41e3753629ae3d5b1461c35aceffada | SputnikStan5/LV2-Prototyper | bank-filter_through.dsp | // SPDX-FileCopyrightText: Hanspeter Portner <[email protected]>
// SPDX-License-Identifier: CC0-1.0
import("stdfaust.lib");
process = _, _;
// vim: set syntax=faust:
| https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/mephisto.lv2/dsp/bank-filter_through.dsp | faust | SPDX-FileCopyrightText: Hanspeter Portner <[email protected]>
SPDX-License-Identifier: CC0-1.0
vim: set syntax=faust: |
import("stdfaust.lib");
process = _, _;
|
1b18d8d6ceee4e4f3b421fe0b96264dce7219654d974b85f4c2e96bbd9aed072 | SputnikStan5/LV2-Prototyper | bank-instrument_osc.dsp | // SPDX-FileCopyrightText: Hanspeter Portner <[email protected]>
// SPDX-License-Identifier: CC0-1.0
declare options "[nvoices:16][midi:on]";
import("stdfaust.lib");
freq = hslider("freq", 20, 20, 20000, 1);
gain = hslider("gain", 0, 0, 1, 0.01);
gate = button("gate");
lfo_f = hslider("LFO frequency[0]", 0, 0, 100, 1);
lfo_a = hslider("LFO amplitude[1]", 0, 0, 1, 0.01);
env = en.adsr(0.01, 1.0, 0.8, 0.1, gate) * gain;
lfo = 1 + os.lf_triangle(lfo_f) * lfo_a;
inst = os.triangle(freq * lfo) * env / 4;
process = inst, inst;
// vim: set syntax=faust:
| https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/mephisto.lv2/dsp/bank-instrument_osc.dsp | faust | SPDX-FileCopyrightText: Hanspeter Portner <[email protected]>
SPDX-License-Identifier: CC0-1.0
vim: set syntax=faust: |
declare options "[nvoices:16][midi:on]";
import("stdfaust.lib");
freq = hslider("freq", 20, 20, 20000, 1);
gain = hslider("gain", 0, 0, 1, 0.01);
gate = button("gate");
lfo_f = hslider("LFO frequency[0]", 0, 0, 100, 1);
lfo_a = hslider("LFO amplitude[1]", 0, 0, 1, 0.01);
env = en.adsr(0.01, 1.0, 0.8, 0.1, gate) * gain;
lfo = 1 + os.lf_triangle(lfo_f) * lfo_a;
inst = os.triangle(freq * lfo) * env / 4;
process = inst, inst;
|
6a2b29d769ec2e995468914a53c44cb89f97b7a80370af38d4a182267f6c4402 | SputnikStan5/LV2-Prototyper | bank-time_lfo.dsp | // SPDX-FileCopyrightText: Hanspeter Portner <[email protected]>
// SPDX-License-Identifier: CC0-1.0
declare options "[time:on]";
import("stdfaust.lib");
barBeat = hslider("bar beat[time:barBeat]", 0, 0, 32, 1);
beatsPerBar = hslider("beats per bar[time:beatsPerBar]", 1, 1, 32, 1);
gate = button("speed[time:speed]");
mul = hslider("mul[0]", 0, 0, 1000, 1);
add = hslider("add[1]", 0, 0, 1000, 1);
frac = barBeat / beatsPerBar
: hbargraph("bar pos %[2]", 0, 1);
freq = sin(frac * ma.PI) * mul + add;
env = en.adsr(0.01, 1.0, 0.8, 0.1, gate);
instr = os.triangle(freq) * env;
process = instr, instr;
// vim: set syntax=faust:
| https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/mephisto.lv2/dsp/bank-time_lfo.dsp | faust | SPDX-FileCopyrightText: Hanspeter Portner <[email protected]>
SPDX-License-Identifier: CC0-1.0
vim: set syntax=faust: |
declare options "[time:on]";
import("stdfaust.lib");
barBeat = hslider("bar beat[time:barBeat]", 0, 0, 32, 1);
beatsPerBar = hslider("beats per bar[time:beatsPerBar]", 1, 1, 32, 1);
gate = button("speed[time:speed]");
mul = hslider("mul[0]", 0, 0, 1000, 1);
add = hslider("add[1]", 0, 0, 1000, 1);
frac = barBeat / beatsPerBar
: hbargraph("bar pos %[2]", 0, 1);
freq = sin(frac * ma.PI) * mul + add;
env = en.adsr(0.01, 1.0, 0.8, 0.1, gate);
instr = os.triangle(freq) * env;
process = instr, instr;
|
d1845663a876daa58e0f19772ddd460cf16170e6d846c9a56905580780b6d3a6 | SputnikStan5/LV2-Prototyper | guitar.dsp | import("stdfaust.lib");
// *** COMPRESSOR ***
compressorParam = hslider("compressorParam", 6, 1, 20, 0.01) : si.smoo;
compressorDepth = hslider("compressorDepth", 0, 0, 1, 0.01) : si.smoo;
compressor = _*(1+compressorDepth) <: _*(1-compressorDepth), compressorDepth*co.compressor_mono(compressorParam,-20,0.08,0.3) :> _ ;
// *** FUZZ ***
fuzzDepth = hslider("fuzzDepth", 0.75, 0.75, 30, 0.01) : si.smoo;
fuzzParam = hslider("fuzzParam", 0.4, 0.03, 0.7, 0.01) : si.smoo;
divide(input) = ((((input*fuzzDepth-1)/(input+(0.5/fuzzDepth + fuzzParam) : max(0.0001)) : ef.cubicnl(0,1)))/2 + (0 : ef.cubicnl(2,-1))*0.1);
fuzz = (divide+0.15)/(3+0.25*fuzzDepth);
// *** PHASER ***
phaserParam = hslider("phaserParam", 0.4, 0, 7, 0.001) : si.smoo;
phaserDepth = hslider("phaserDepth", 1, 0, 1, 0.01) : si.smoo;
phaser = _ : pf.phaser2_mono(2, 0, 1000, 50, 1.25, 1000, phaserParam, phaserDepth, .3, 0);
// *** REVERB ***
reverbParam = hslider("reverbParam", 15, 1, 40, 0.01) : si.smoo;
reverbDepth = hslider("reverbDepth", 0.4, 0, 1, 0.01) : si.smoo;
zita_rev_fdn(f1,f2,t60dc,t60m,fsmax) =
((si.bus(2*N) :> allpass_combs(N) : feedbackmatrix(N)) ~
(delayfilters(N,freqs,durs) : fbdelaylines(N)))
with {
N = 4;
// Delay-line lengths in seconds:
apdelays = (0.020346, 0.024421, 0.031604, 0.027333); // feedforward delays in seconds
tdelays = ( 0.153129, 0.210389, 0.127837, 0.256891); // total delays in seconds
tdelay(i) = floor(0.5 + ma.SR*ba.take(i+1,tdelays)); // samples
apdelay(i) = floor(0.5 + ma.SR*ba.take(i+1,apdelays));
fbdelay(i) = tdelay(i) - apdelay(i);
// NOTE: Since SR is not bounded at compile time, we can't use it to
// allocate delay lines; hence, the fsmax parameter:
tdelaymaxfs(i) = floor(0.5 + fsmax*ba.take(i+1,tdelays));
apdelaymaxfs(i) = floor(0.5 + fsmax*ba.take(i+1,apdelays));
fbdelaymaxfs(i) = tdelaymaxfs(i) - apdelaymaxfs(i);
nextpow2(x) = ceil(log(x)/log(2.0));
maxapdelay(i) = int(2.0^max(1.0,nextpow2(apdelaymaxfs(i))));
maxfbdelay(i) = int(2.0^max(1.0,nextpow2(fbdelaymaxfs(i))));
apcoeff(i) = select2(i&1,0.6,-0.6); // allpass comb-filter coefficient
allpass_combs(N) =
par(i,N,(fi.allpass_comb(maxapdelay(i),apdelay(i),apcoeff(i)))); // filters.lib
fbdelaylines(N) = par(i,N,(de.delay(1024,(fbdelay(i)))));
freqs = (f1,f2); durs = (t60dc,t60m);
delayfilters(N,freqs,durs) = par(i,N,filter(i,freqs,durs));
feedbackmatrix(N) = ro.hadamard(N);
staynormal = 10.0^(-20); // let signals decay well below LSB, but not to zero
special_lowpass(g,f) = si.smooth(p) with {
// unity-dc-gain lowpass needs gain g at frequency f => quadratic formula:
p = mbo2 - sqrt(max(0,mbo2*mbo2 - 1.0)); // other solution is unstable
mbo2 = (1.0 - gs*c)/(1.0 - gs); // NOTE: must ensure |g|<1 (t60m finite)
gs = g*g;
c = cos(2.0*ma.PI*f/float(ma.SR));
};
filter(i,freqs,durs) = lowshelf_lowpass(i)/sqrt(float(N))+staynormal
with {
lowshelf_lowpass(i) = gM*low_shelf1_l(g0/gM,f(1)):special_lowpass(gM,f(2));
low_shelf1_l(G0,fx,x) = x + (G0-1)*fi.lowpass(1,fx,x); // filters.lib
g0 = g(0,i);
gM = g(1,i);
f(k) = ba.take(k,freqs);
dur(j) = ba.take(j+1,durs);
n60(j) = dur(j)*ma.SR; // decay time in samples
g(j,i) = exp(-3.0*log(10.0)*tdelay(i)/n60(j));
};
};
// Stereo input delay used by zita_rev1 in both stereo and ambisonics mode:
zita_in_delay(rdel) = zita_delay_mono(rdel), zita_delay_mono(rdel) with {
zita_delay_mono(rdel) = de.delay(50,ma.SR*rdel*0.001) * 0.3;
};
// Stereo input mapping used by zita_rev1 in both stereo and ambisonics mode:
zita_distrib2(N) = _,_ <: fanflip(N) with {
fanflip(4) = _,_,*(-1),*(-1);
fanflip(N) = fanflip(N/2),fanflip(N/2);
};
zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax) =
zita_in_delay(rdel)
: zita_distrib2(N)
: zita_rev_fdn(f1,f2,t60dc,t60m,fsmax)
: output2(N)
with {
N = 4;
output2(N) = outmix(N) : *(t1),*(t1);
t1 = 0.37; // zita-rev1 linearly ramps from 0 to t1 over one buffer
outmix(4) = !,ro.butterfly(2),!; // probably the result of some experimenting!
outmix(N) = outmix(N/2),par(i,N/2,!);
};
reverb = _ <: (_,_ <: zita_rev1_stereo(50,200,6000,reverbParam*1.2,reverbParam,44100),_,_ :
out_eq,_,_ : dry_wet) :> _
with{
out_eq = pareq_stereo(eq1f,eq1l,eq1q) : pareq_stereo(eq2f,eq2l,eq2q);
pareq_stereo(eqf,eql,Q) = fi.peak_eq_rm(eql,eqf,tpbt), fi.peak_eq_rm(eql,eqf,tpbt)
with {
tpbt = wcT/sqrt(max(0,g)); // tan(PI*B/SR), B bw in Hz (Q^2 ~ g/4)
wcT = 2*ma.PI*eqf/ma.SR; // peak frequency in rad/sample
g = ba.db2linear(eql); // peak gain
};
eq1f = 315;
eq1l = 0;
eq1q = 3;
eq2f = 1500;
eq2l = 0;
eq2q = 3;
dry_wet(x,y) = *(wet) + dry*x, *(wet) + dry*y
with {
wet = 0.5*(drywet+1.0);
dry = 1.0-wet;
};
drywet = 1-reverbDepth;
};
process = compressor; | https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/Library/DSP/guitar.dsp | faust | *** COMPRESSOR ***
*** FUZZ ***
*** PHASER ***
*** REVERB ***
Delay-line lengths in seconds:
feedforward delays in seconds
total delays in seconds
samples
NOTE: Since SR is not bounded at compile time, we can't use it to
allocate delay lines; hence, the fsmax parameter:
allpass comb-filter coefficient
filters.lib
let signals decay well below LSB, but not to zero
unity-dc-gain lowpass needs gain g at frequency f => quadratic formula:
other solution is unstable
NOTE: must ensure |g|<1 (t60m finite)
filters.lib
decay time in samples
Stereo input delay used by zita_rev1 in both stereo and ambisonics mode:
Stereo input mapping used by zita_rev1 in both stereo and ambisonics mode:
zita-rev1 linearly ramps from 0 to t1 over one buffer
probably the result of some experimenting!
tan(PI*B/SR), B bw in Hz (Q^2 ~ g/4)
peak frequency in rad/sample
peak gain | import("stdfaust.lib");
compressorParam = hslider("compressorParam", 6, 1, 20, 0.01) : si.smoo;
compressorDepth = hslider("compressorDepth", 0, 0, 1, 0.01) : si.smoo;
compressor = _*(1+compressorDepth) <: _*(1-compressorDepth), compressorDepth*co.compressor_mono(compressorParam,-20,0.08,0.3) :> _ ;
fuzzDepth = hslider("fuzzDepth", 0.75, 0.75, 30, 0.01) : si.smoo;
fuzzParam = hslider("fuzzParam", 0.4, 0.03, 0.7, 0.01) : si.smoo;
divide(input) = ((((input*fuzzDepth-1)/(input+(0.5/fuzzDepth + fuzzParam) : max(0.0001)) : ef.cubicnl(0,1)))/2 + (0 : ef.cubicnl(2,-1))*0.1);
fuzz = (divide+0.15)/(3+0.25*fuzzDepth);
phaserParam = hslider("phaserParam", 0.4, 0, 7, 0.001) : si.smoo;
phaserDepth = hslider("phaserDepth", 1, 0, 1, 0.01) : si.smoo;
phaser = _ : pf.phaser2_mono(2, 0, 1000, 50, 1.25, 1000, phaserParam, phaserDepth, .3, 0);
reverbParam = hslider("reverbParam", 15, 1, 40, 0.01) : si.smoo;
reverbDepth = hslider("reverbDepth", 0.4, 0, 1, 0.01) : si.smoo;
zita_rev_fdn(f1,f2,t60dc,t60m,fsmax) =
((si.bus(2*N) :> allpass_combs(N) : feedbackmatrix(N)) ~
(delayfilters(N,freqs,durs) : fbdelaylines(N)))
with {
N = 4;
apdelay(i) = floor(0.5 + ma.SR*ba.take(i+1,apdelays));
fbdelay(i) = tdelay(i) - apdelay(i);
tdelaymaxfs(i) = floor(0.5 + fsmax*ba.take(i+1,tdelays));
apdelaymaxfs(i) = floor(0.5 + fsmax*ba.take(i+1,apdelays));
fbdelaymaxfs(i) = tdelaymaxfs(i) - apdelaymaxfs(i);
nextpow2(x) = ceil(log(x)/log(2.0));
maxapdelay(i) = int(2.0^max(1.0,nextpow2(apdelaymaxfs(i))));
maxfbdelay(i) = int(2.0^max(1.0,nextpow2(fbdelaymaxfs(i))));
allpass_combs(N) =
fbdelaylines(N) = par(i,N,(de.delay(1024,(fbdelay(i)))));
freqs = (f1,f2); durs = (t60dc,t60m);
delayfilters(N,freqs,durs) = par(i,N,filter(i,freqs,durs));
feedbackmatrix(N) = ro.hadamard(N);
special_lowpass(g,f) = si.smooth(p) with {
gs = g*g;
c = cos(2.0*ma.PI*f/float(ma.SR));
};
filter(i,freqs,durs) = lowshelf_lowpass(i)/sqrt(float(N))+staynormal
with {
lowshelf_lowpass(i) = gM*low_shelf1_l(g0/gM,f(1)):special_lowpass(gM,f(2));
g0 = g(0,i);
gM = g(1,i);
f(k) = ba.take(k,freqs);
dur(j) = ba.take(j+1,durs);
g(j,i) = exp(-3.0*log(10.0)*tdelay(i)/n60(j));
};
};
zita_in_delay(rdel) = zita_delay_mono(rdel), zita_delay_mono(rdel) with {
zita_delay_mono(rdel) = de.delay(50,ma.SR*rdel*0.001) * 0.3;
};
zita_distrib2(N) = _,_ <: fanflip(N) with {
fanflip(4) = _,_,*(-1),*(-1);
fanflip(N) = fanflip(N/2),fanflip(N/2);
};
zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax) =
zita_in_delay(rdel)
: zita_distrib2(N)
: zita_rev_fdn(f1,f2,t60dc,t60m,fsmax)
: output2(N)
with {
N = 4;
output2(N) = outmix(N) : *(t1),*(t1);
outmix(N) = outmix(N/2),par(i,N/2,!);
};
reverb = _ <: (_,_ <: zita_rev1_stereo(50,200,6000,reverbParam*1.2,reverbParam,44100),_,_ :
out_eq,_,_ : dry_wet) :> _
with{
out_eq = pareq_stereo(eq1f,eq1l,eq1q) : pareq_stereo(eq2f,eq2l,eq2q);
pareq_stereo(eqf,eql,Q) = fi.peak_eq_rm(eql,eqf,tpbt), fi.peak_eq_rm(eql,eqf,tpbt)
with {
};
eq1f = 315;
eq1l = 0;
eq1q = 3;
eq2f = 1500;
eq2l = 0;
eq2q = 3;
dry_wet(x,y) = *(wet) + dry*x, *(wet) + dry*y
with {
wet = 0.5*(drywet+1.0);
dry = 1.0-wet;
};
drywet = 1-reverbDepth;
};
process = compressor; |
07a5988fb1365525da998e8925d34832d28f3799159a6946cdb2f9629b2895ed | SputnikStan5/LV2-Prototyper | weatherorgan.dsp | declare name "Weather Organ";
declare author "Mykle James Hansen";
declare copyright "(c) Mykle James Hansen 2018";
declare version "0.5";
declare license "This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.";
import("stdfaust.lib");
/////////////////////////
// User interface:
//
// (Note: [scale:log] sliders with min or max 0 are unuseable in some Faust UI implementations.
// Many of the log-scale sliders below use a hack to get around this, where an integer
// is subtracted from the slider value, to make zero values possible.
// See https://github.com/grame-cncm/faust/issues/164 for more details.
//
/////////
// Weather section:
//
// Flux (coefficient of overall flutter & drift):
flux_adj = vslider("v:[-1]Weather/h:[0]/v:[1]/[0]Flux[unit:%]", 100, 0, 200, 1) / 100;
//
// Turbulence, in average changes per second
turbulence_adj = vslider("v:[-1]Weather/h:[0]/v:[4]/[0]Turbulence[scale:log][unit:Hz]", 0.5, 0.001, 10, 0.001);
//
// Observe flutter & drift:
flutter_dbg = vbargraph("v:[-1]Weather/h:[0]/v:[1]/[1]Flutter", -1.5, 1.5);
drift_dbg = vbargraph("v:[-1]Weather/h:[0]/v:[4]/[1]Drift", -1.5, 1.5);
//
/////////
// Noise section:
//
// Noise source: White or brown noise, or gate an input signal?
noise_source_radio = hslider("v:[0]Noise/h:[0]/Source:[style:radio{'White':0;'Brown':1;'Line in':2}]", 0, 0, 2, 1);
//
// Density of noise events (inverse of "sparseness") -- from white noise to geiger counter. Takes drift.
//density_adj = vslider("v:[0]Noise/h:[1]/v:[0]/[0]Density[unit:Hz][scale:log][midi:ctrl 18]", 44, 0.1, 96000, 0.1) - 0.1 : min(ma.SR);
// NOTE: some web implementations of Faust crash when density goes below 1.0. Also, log sliders are finicky
// If compiling for the web, use this line instead:
density_adj = vslider("v:[0]Noise/h:[1]/v:[0]/[0]Density[unit:Hz][scale:log][midi:ctrl 18]", 44, 1, 10000, 0.1) : min(ma.SR); // web-save bounds
density_drift_adj = vslider("v:[0]Noise/h:[1]/v:[0]/[2]D drift[style:knob]",0,-1,1,0.001);
//
// Width: samples per noise event. Takes flutter and drift.
width_adj = vslider("v:[0]Noise/h:[1]/v:[2]/[0]Width[unit:%][scale:log]", 1, 1, 101, .01) : -(1) : /(100);
width_flutter_adj = vslider("v:[0]Noise/h:[1]/v:[2]/[1]W flutter[style:knob]",0,0,1,0.001);
width_drift_adj = vslider("v:[0]Noise/h:[1]/v:[2]/[2]W drift[style:knob]",0,-1,1,0.001);
//
// Rhythm: coefficient of periodicity for sparse_periodic_trigger. Takes drift.
rhythm_adj = vslider("v:[0]Noise/h:[1]/v:[3]/[0]Rhythm[scale:exp]", 0, 0, 1, 0.01);
rhythm_drift_adj = vslider("v:[0]Noise/h:[1]/v:[3]/[1]R drift[style:knob]",0,-1,1,0.001);
//
// "Grit" (exponent of noise) from -1 to 1
grit_adj = vslider("v:[0]Noise/h:[1]/v:[3]/[2]Grit[midi:ctrl 19]", 0, -1, 1, 0.01);
//
/////////
// Filter section
//
// Bypass filters entirely?
filter_bypass = checkbox("v:[1]Filter/h:[0]/Bypass");
//
// Low shelf (Beware of glitches when cutoff below 10hz)
low_shelf_adj = vslider("v:[1]Filter/h:[1]/[-1]Low shelf[unit:Hz][scale:log][midi:ctrl 71]", 20, 10, 22050, 1) : si.smoo;
//
// Base frequency of fundamental filter (filter 0). Takes flutter & drift.
base_center_freq = vslider("v:[1]Filter/h:[1]/v:[0]/[0]Freq[unit:Hz][scale:log]", 3520, 20, filter_upper_bound, 1) / 2;
base_flutter_adj = vslider("v:[1]Filter/h:[1]/v:[0]/[1]F flutter[style:knob]",0,0,1,0.001);
base_drift_adj = vslider("v:[1]Filter/h:[1]/v:[0]/[2]F drift[style:knob]",0,-1,1,0.001);
//
// Q of filter. Takes flutter & drift.
Q_adj = vslider("v:[1]Filter/h:[1]/v:[2]/[0]Q[scale:exp][midi:ctrl 71]", 0.8, 0, 1, 0.0005);
Q_flutter_adj = vslider("v:[1]Filter/h:[1]/v:[2]/[1]Q flutter[style:knob]",0,0,1,0.001);
Q_drift_adj = vslider("v:[1]Filter/h:[1]/v:[2]/[2]Q drift[style:knob]",0,-1,1,0.001);
//
// Additional harmonic components (filters 1..N):
// Harmonic power of component (relative to base_center_freq):
filter_h_adj(N) = vslider("v:[1]Filter/h:[1]/h:[3]Overtones/v:[%M]/[0]O%NN ratio[style:knob]", O, 1, 15, 0.01) with {NN = N + 1; M = N + 3; O = 2*(N+1) + 1;};
// Relative amplitude of component
filter_h_level(N) = vslider("v:[1]Filter/h:[1]/h:[3]Overtones/v:[%M]/[1]O%NN level[style:knob]", 0, 0, 1, 0.001) with {NN = N + 1; M = N + 3;};
// Flutter and drift of component:
filter_h_flutter(N) = vslider("v:[1]Filter/h:[1]/h:[3]Overtones/v:[%M]/[2]O%NN flutter[style:knob]", 0, 0, 1, 0.001) with {NN = N + 1; M = N + 3;};
filter_h_drift_adj(N) = vslider("v:[1]Filter/h:[1]/h:[3]Overtones/v:[%M]/[3]O%NN drift[style:knob]", 0,-1,1,0.001) with {NN = N + 1; M = N + 3;};
//
/////////
// Output section:
//
// Output on/off:
outgate= checkbox("v:[99]Output/[0]Gate");
//
// End stage level adjustment:
outgain = vslider("v:[99]Output/[1]Gain[scale:log][midi:ctrl 7]", 1, 0.1, 10.1, 0.1) - 0.1;
//
// Optional limiter
limit_on = checkbox("v:[99]Output/[99]Limit");
//
//////////////////////////
////////////////////////
// Normalizing coefficients for noise generators:
//
// The various noise generators here and in noises.lib
// have ideal properties relative to their own theories,
// but vary widely in absolute output level.
normal = environment {
no = environment { // noises.lib
noise = 1;
gnoise = 0.625;
pink_noise = 12.5;
};
noise_pink = 0.312;
};
//
//////////////////////////
////////////////////////
// Utility functions for generation various types of sparse noise
//
//-------------`(sparse_periodic_trigger)`-----------------
// Emits +1 impulses ("trigger events") at an average frequency,
// with the distribution adjustable from purely periodic to purely random.
//
// ### Usage
// ```
// sparse_periodic_trigger(f0, periodicity, pnoise) : _
// ```
//
// Where:
//
// * `f0`: average number of triggers per second.
// * `periodicity`: coefficient of distribution noise. 0 <= periodicity <= 1. 0 = random distribution, 1 = regularly spaced pulses.
// * `pnoise`: random source of probability. Pure white noise is good.
//----------------------------
sparse_periodic_trigger(f0, periodicity, noise) =
(
+(rate) // add the rate;
<: _, >=(1) // if greater than 1 ...
: _, *(1+w*noise) : - // ... subtract 1+(w*noise)
) ~ _
<: _, _' : < // emit 1 if the value decreased, 0 otherwise.
with {
w = max(0, min(1, 1 - periodicity));
rate = f0/ma.SR;
};
//
//
//-------------`(wide_gate)`-----------------
//-------------`(wide_hold_gate)`-----------------
// wide_gate() is a gate that opens when triggered,
// and stays open for an adjustable duration after the trigger
//
// wide_hold_gate() is similar, but instead of closing by going
// to zero, it holds the last input sample using ba.sAndH().
//
// ### Usage
//
// ```
// _ : wide_gate(trigger, width) : _
// _ : wide_hold_gate(trigger, width) : _
// ```
//
// Where:
//
// * `trigger`: The gate opens when this goes nonzero, and starts counting down when this goes to zero.
// * `width`: duration (in seconds) of the countdown before gate is closed.
//
// #### See Also
// ba.sAndH
//-------------------------------------
wide_gate(trigger, seconds, signal) = ba.if(clock > 0, signal, 0)
with {
width = seconds * ma.SR;
clock = max(width * (trigger != 0)) ~ (-(1) : max(0));
};
//
wide_hold_gate(trigger, seconds, signal) = ba.if(clock > 0, signal, signal:ba.sAndH(clock > 0) )
with {
width = seconds * ma.SR;
clock = max(width * trigger) ~ (-(1) : max(0));
};
//
//
//------------`noise_half`---------------
// Produce randomly-spaced half-impulses, at an average frequency.
// Each half-impulse is a single-sided sparse noise that doesn't return to zero;
// between events, a constant DC offset is held.
// Each event is a single change to a new amplitude.
//
// ### Usage
// ```
// noise_half(f0, pnoise, anoise) : _
// no.noise, no.gnoise(5) : noise_half(f0) : _
// no.noise <: noise_half(f0) : _
// ```
// Where:
//
// * `f0`: average number of impulses per second.
// * `pnoise`: random source of probability. Pure white noise is good.
// * `anoise`: source of amplitude. Pure white noise, gaussian, or any signal.
//-----------------
noise_half(f0, pnoise, anoise) = anoise : ba.sAndH(sparse_periodic_trigger(f0, 0, pnoise));
//
//
//-------------`noise_pink_sparse`-----------------
//-------------`noise_pink_sparse_n`-----------------
// Sparse "pink" noise generator.
//
// Not sure what to call this anymore, really. The spectrum approaches pink (1/f) as
// f0 approaches the sample rate; at that point, it's using noise_half()
// to implement Trammel's "Stochastic Voss/McCartney" algorithm.
// However, at lower frequencies, the spectrum tilts toward brown (1/f^2).
//
// So it's cryptic and irregular. As a pink noise generator it may offer some tiny
// (inadible?) amount of improved linearity over no.pink_noise, but only at great cost
// of complexity & CPU. It was fun and educational to write, but I have replaced it almost
// everywhere with no.pink_noise . However, as the perturbing force that acts on Drift,
// it resembles (to my ear) the real behavior of wind better than anything else I've tried so far.
// It's the right ratio of smaller movements more often and larger movements less often.
// That's all it's used for here.
//
//
// ### Usage
//
// ```
// no.noise : noise_pink_sparse(f0) : _
// no.noise : noise_pink_sparse_n(N, f0) : _
// ```
//
// Where:
//
// * `f0`: average number of fluctuations per second.
// Set this below 20 for sparse noise (individually perceptable noise events).
// Set this to the highest value allowed by sample rate to produce general-purpose pink noise.
//
// * `N`: number of generators. (Integer, must be known at compile time.)
// Per the Voss McCartney algorithm, full pink noise wants one generator per audible octave in the frequencies below f0.
// noise_pink_sparse defaults to 10 generators, corresponding to 10 octaves within the frequencies of 20-20000hz.
// Lower values of N may be acceptable when f0 is low, or the output is to be lowpass-filtered.
// Higher values of N, f0 and ma.SR may be appropriate for UHF listeners (bats, dolphins, audiophiles, et cetera).
//
// ### See Also:
// no.sparse_noise
// no.pink_noise_vm
//
// #### Reference:
// <http://www.ridgerat-tech.us/tech/pinkalg.htm>
//-------------------------------------
noise_pink_sparse_n(N, f0, noise) = noise, noise@N <: par(i, N,
@(i), @(i) : noise_half(F(i))
) :> _
with {
// Generator frequencies distributed exponentially between 0hz -> SR
F(i) = ((2*f0) / (2^i)) ; // freq decreases with i.
};
noise_pink_sparse(f0, noise) = noise_pink_sparse_n(10, f0, noise);
////////////////////////
// Sources of randomness:
//
// We use random values in various ways, and some of them sound better decorrelated.
//
// White noise sources for signal & probability should be decorrelated from each other:
s_noise = no.multinoise(2) : !, _;
p_noise = no.multinoise(2) : _, !;
//
// The drift generator and the sparse noise generator can share a random source, because they
// work at such different frequencies & do such different things ... but I still want to
// be sure they never get the same value in the same cycle.
p_drift_noise = p_noise; // for triggering drift
p_sparse_noise = p_noise'; // for gating sparse noise
//
// Gaussian noise source for sound & flutter should be decorrelated & each normalized to +-1.0:
s_gnoise = no.gnoise(5) : *(normal.no.gnoise); // sound
f_gnoise = no.gnoise(6) : *(normal.no.gnoise); // flutter values
//
// New random values chosen at the moment of a flutter event should be decorrelated from each other:
f_gnoise_base = f_gnoise; // Base filter frequency
f_gnoise_base_Q = f_gnoise'; // Base filter Q
f_gnoise_width = f_gnoise''; // Noise width
f_gnoise_pan = f_gnoise'''; // Stereo position
//
// NOTE: the flutter on harmonic components are not decorrelated from f_gnoise.
// In theory I should do this, but it may change the asesthetic character of the sound,
// so it will need careful listening.
////////////////////////
////////////////////////
// Flux signals: flutter and drift
// (generated from the above noise sources.)
//
//////////
// "Flutter" is a coefficient centered around 1.0, flucutating with each noise event
// triggered by sparse_trigger.
// (It holds still between events, so the resonant filter can ring at a constant pitch.)
//
// Q_flutter: an offset centered around 0.0, +1 to -1 with a (clipped) gaussian distribution.
Q_flutter = f_gnoise_base_Q : ba.sAndH(sparse_trigger) : min(1) : max(-1)
: flutter_dbg //DEBUG
;
//
// width_flutter: same, but decorrelated from Q_flutter
width_flutter = f_gnoise_width : ba.sAndH(sparse_trigger) : min(1) : max(-1) ;
//
// Utility: convert flutter exponentially, so that +1 flutter raises pitch by the same interval that -1 flutter lowers it.
flutter2exponent(noise, range) = pow(2, ( noise : ba.sAndH(sparse_trigger) : *(range) ));
//
/////////
// "Drift" is low-frequency fluctuation intended to mimic the period of
// ocean waves, gusts of wind, etc. It ranges from 0 to +1. The rates of positive
// movement and negative movement are controlled independently, to model natural
// phenomena in which energy is delivered rapidly into a system by a particularl event,
// then leaves the system more slowly via diffusion.
//
// The rise & decay rates of drift are a slope, not a time-bounded envelope. Higher values of drift
// will take longer to approach and retreat. Slope is proportionate to the overall drift rate.
// The adjusters give coefficients between 0 & 2.
// If wave goes from 0 to 1 in df seconds, the slope is (1/df) / ma.SR. == 1 / (df * ma.SR);
// i.e. 1/samples to get there. If wave goes from 0 to 1 instantly (gets there in one sample)
// the slope is 1.0, i.e. 1/1 . The spread scross the two is 1 / (max(df * ma.SR * drift_adj, 1));
drift_slope = (2/ma.SR) * turbulence_adj;
//
// This drift signal can be thought of as a sparse brown noise wave with all negative values truncated to zero,
// passed through a lowpass-esque filter, with the rise & fall slopes determining the lowpass characteristics.
drift = flux_adj * soft_wave
: drift_dbg //DEBUG
with {
// hard_wave is a sparse brown noise wave, constrained to +-1
hard_wave = p_drift_noise : noise_pink_sparse_n(5, turbulence_adj) : *(normal.noise_pink) : min(1) : max(-1) ;
// soft_wave slides toward the value of hard_wave at a rate determined by drift_slope
soft_wave = (_ <: _, slope : +) ~ _;
slope(sig) = ba.if((sig <= hard_wave), drift_slope, -drift_slope);
};
//
// Utility: drift2exponent is like flutter2exponent, minus the sample & hold.
// coefficient from 1/2 to 2 as d_m from -1 to 1
drift2exponent(range) = pow(2, (drift * range));
//
/////////////////////////
/////////////////////////
// Audible noise generation:
//
// Density of noise events, with drift & flutter
// As drift varies -1/+1, vary density freq by (up to) 1/8 - 8
density = density_adj * d_drift(8 * density_drift_adj)
with {
d_drift(range) = pow(2, (drift * range)); // coefficient from 1/2 to 2 as d_m from -1 to 1
};
//
// Adjustable sparse trigger controlled by that density. Each trigger event sparks some sound.
sparse_trigger = sparse_periodic_trigger(density, rhythm_adj, p_sparse_noise );
//
// "Width": Adjustable gate open time (in secs) as a function of density. Minimum 1 sample.
width = max(sw, 1/ma.SR)
with {
// width_adj is log from 0 to 1, but scale to double-log from 0 to 1.5
w_adj = pow(width_adj, 2) : *(1.5);
// adjusted width: similar range.
aw = w_adj
+ (width_flutter * flux_adj * width_flutter_adj / 8)
+ (drift * flux_adj * width_drift_adj / 8)
: max(0);
// scaled width: divide by density
sw = aw / density;
};
//
// Input signal sources (choose one of 3):
//
// 1) Sparse Gaussian white noise:
gwhite_noise_source = s_gnoise : wide_gate(sparse_trigger, width);
//
// 2) "Sparse brown noise" (brown to pink, really; see footnote 1 in the paper for details):
brown_noise_source = no.pink_noise : *(normal.no.pink_noise) : wide_hold_gate(sparse_trigger, width) ;
//
// 3) Any old noise/signal from line in:
external_source = _ : wide_hold_gate(sparse_trigger, width);
//
// Choose one
noise_source = gwhite_noise_source, brown_noise_source, external_source: ba.selectn(3, noise_source_radio);
//
//////////////////
/////////////////
// Timbre section -- adding character to noise events
//
///////
// "Grit": Use exponentation to push around the average levels of the random values in noise.
// a "grit" of 1.0 means noise is just noise, equally distributed & the average value would be +-.5.
// Grit is an exponent by which each sample is raised. Numbers below 1.0 get smaller when raised to powers above 1.
// Therefore:
// exponent below 1 == compression of signal, louder output
// exponent at 0 == max volume (all clicks are +1 or -1)
// exponent above 1 == expansion of signal, quieter output ... but this doesn't end up very useful IMO.
//
grit(noiseIn) = abspow(noiseIn, 1 - grit_adj)
with {
// Samples are between [-1, 1]. We can't raise a negative number to a fractional power without imaginary numbers.
// Instead, we raise the absolute value by the exponent, then multiply by the value's sign.
abspow(val, power) = (abs(val) ^ power) * sign(val) ;
sign(val) = (0 < val) - (val < 0); // -1, 0 or 1
};
//
//////////
// Fundamental (base_) Filter:
//
// The Moog VCF in vaeffects.lib creates a nice tuned resonance when the Q is set high.
// (The three different Moog VCF implementations in vaeffects.lib really behave
// differently in the high notes here ... moog_vcf_2bn sounds best to me.)
resonant_filter = ve.moog_vcf_2bn;
//
// However, moog_vcf_2bn requires some rubber bumpers:
//
// 1) There are glitch areas in this moog vcf model; some combinations of Q and freq cause obnoxious alilased noise.
// Artifacts begin to arise as F passes 22000 hz with q=0.
// TODO: investigate: is this artifact a function of ma.SR or not? If so, reference that.
// (Anyway, a lopass filter that starts to roll off at 22000hz is the same as a wire to human ears.)
filter_upper_bound = 22000;
//
// 2) Negative values of Q can also produce painful dubstep,
// and values above 1 seem to behave as compressed harmonics of the values between 0 and 1.
//
// Also, the filter bypass switch is implemented here.
filter(f, q, signal) = ba.if((filter_bypass | (f>filter_upper_bound)) ,
signal,
resonant_filter(min(1, max(0, q)), f))
;
//
// Frequency of fundamental filter, with flutter & drift
base_filter_freq = base_center_freq * flutter2exponent(f_gnoise_base, flux_adj * base_flutter_adj) * drift2exponent(base_drift_adj);
//
// Q of the fundamental filter, with flutter & drift
base_filter_Q = Q_flux(exp_Q, drift, Q_drift_adj, Q_flutter, Q_flutter_adj)
with {
exp_Q = pow(Q_adj, 0.5); // scale is exponential, but the action is at the tip-top, so convert to double-exponential)
};
/////////////
// Overtone filters:
// 2 seems plenty, but more can easily be added here:
num_overtones = 2;
//
// Same filter as the fundamental, with parameters computed like so:
overtone_filter(N) = filter(overtone_freq(N), overtone_Q(N)) * overtone_level(N)
with {
// Overtone freq = multiple of base freq + flutter & drift
overtone_freq(N) = base_filter_freq
* (1+filter_h_adj(N))
* overtone_f_flutter(N)
* overtone_drift(N);
// Overtone Q = same as base Q, plus flutter and drift
overtone_Q(N) = Q_flux(base_filter_Q, drift, filter_h_drift_adj(N), Q_flutter, filter_h_flutter(N));
// Overtone level = user control + flutter & drift
overtone_level(N) = filter_h_level(N)
* overtone_drift(N)
* overtone_f_level(N);
// Flutter & drift for overtones:
c_flutter(N) = Q_flutter * flux_adj * filter_h_flutter(N); // avg 0.0
overtone_drift(N) = drift2exponent(flux_adj * filter_h_drift_adj(N));
overtone_f_flutter(N) = flutter2exponent(f_gnoise, flux_adj * filter_h_flutter(N)); // TODO: DECORRELATE?
overtone_f_level(N) = flutter2exponent(f_gnoise, c_flutter(N)); // TODO: DECORRELATE?
};
//
// Utility: Algorithm for applying drift and flutter to the Q of a filter,
// while dealing with boundry conditions in a nice-sounding way.
// (TODO: use this more generally for flux on coefficients?)
//
// TODO: Clicks occur when frequency flutters too low ... since this
// filter doesn't have much effect below 40hz anyway, I'd like to cut that out.
// But rather than attenuate at the bottom, it'd be better if the flutter window
// would keep its bottom at the cutoff (40hz or whatever) and keep its set
// width for all center frequencies below (cutoff+(width/2)). Then
// behavior near that range would better match behavior in the rest of the
// audible range. (I think.) (I hope.)
Q_flux(Q, drift, drift_adj, flutter_wave, flutter_adj) = Qdf : max(0) : min(1)
with {
drift_gap = min(Q, 1 - Q) : max(0.2); // size of the gap between the Q slider and its nearest border; minimum 20%
// Q plus drift:
Qd = Q + (drift * drift_adj * flux_adj * drift_gap);
flutter_gap = min(Qd, 1 - Qd): max(0.1); // size of the flutter zone after drift is applied; minimum 10%
// Q plus drift plus flutter:
Qdf = Qd + (flutter_wave * flutter_adj * flux_adj * flutter_gap);
};
//
//////////////////
/////////////////
// Stereo position
//
pan_adj = vslider("v:[99]Output/[3]Pan[style:knob]", 0, -0.5, 0.5, .001);
pan_flutter_adj = vslider("v:[99]Output/[4]P flutter[style:knob]",0,0,1,0.001);
//
// pan_flutter: decorrelated from Q_flutter
pan_flutter = f_gnoise_pan : *(pan_flutter_adj) : ba.sAndH(sparse_trigger) : min(1) : max(-1) ;
pan = pan_adj + pan_flutter : min(1) : max(-1);
/////////////////
// All together now:
//
process = hgroup("[1]",
// Take our chosen noise source:
noise_source
//
// Delay it by 1 sample, to give the filters a head start changing parameters, to prevent a bit of crunch:
: _'
//
// Apply grit:
: grit
//
// Normalize levels (somewhat) between different noise sources:
: *( (8, 1, 1) : ba.selectn(3, noise_source_radio))
//
// Apply low shelf :
<: _, fi.low_shelf(-40, low_shelf_adj) : ba.if(filter_bypass)
//
// Split into filter bank (fundamental plus N overtones), recombine
<: filter(base_filter_freq, base_filter_Q), par(N, num_overtones, overtone_filter(N)) :> _
//
// Recombine, apply output gate
: *(outgate)
//
// Apply output gain
: *(outgain)
//
// Apply limiter
<: _, co.limiter_1176_R4_mono : select2(limit_on)
// Pan stereo (normazed from +1-1 to 0-1
: sp.panner((pan + 1)/2)
);
| https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/Library/weather_organ/weatherorgan.dsp | faust | ///////////////////////
User interface:
(Note: [scale:log] sliders with min or max 0 are unuseable in some Faust UI implementations.
Many of the log-scale sliders below use a hack to get around this, where an integer
is subtracted from the slider value, to make zero values possible.
See https://github.com/grame-cncm/faust/issues/164 for more details.
///////
Weather section:
Flux (coefficient of overall flutter & drift):
Turbulence, in average changes per second
Observe flutter & drift:
///////
Noise section:
Noise source: White or brown noise, or gate an input signal?
Density of noise events (inverse of "sparseness") -- from white noise to geiger counter. Takes drift.
density_adj = vslider("v:[0]Noise/h:[1]/v:[0]/[0]Density[unit:Hz][scale:log][midi:ctrl 18]", 44, 0.1, 96000, 0.1) - 0.1 : min(ma.SR);
NOTE: some web implementations of Faust crash when density goes below 1.0. Also, log sliders are finicky
If compiling for the web, use this line instead:
web-save bounds
Width: samples per noise event. Takes flutter and drift.
Rhythm: coefficient of periodicity for sparse_periodic_trigger. Takes drift.
"Grit" (exponent of noise) from -1 to 1
///////
Filter section
Bypass filters entirely?
Low shelf (Beware of glitches when cutoff below 10hz)
Base frequency of fundamental filter (filter 0). Takes flutter & drift.
Q of filter. Takes flutter & drift.
Additional harmonic components (filters 1..N):
Harmonic power of component (relative to base_center_freq):
Relative amplitude of component
Flutter and drift of component:
///////
Output section:
Output on/off:
End stage level adjustment:
Optional limiter
////////////////////////
//////////////////////
Normalizing coefficients for noise generators:
The various noise generators here and in noises.lib
have ideal properties relative to their own theories,
but vary widely in absolute output level.
noises.lib
////////////////////////
//////////////////////
Utility functions for generation various types of sparse noise
-------------`(sparse_periodic_trigger)`-----------------
Emits +1 impulses ("trigger events") at an average frequency,
with the distribution adjustable from purely periodic to purely random.
### Usage
```
sparse_periodic_trigger(f0, periodicity, pnoise) : _
```
Where:
* `f0`: average number of triggers per second.
* `periodicity`: coefficient of distribution noise. 0 <= periodicity <= 1. 0 = random distribution, 1 = regularly spaced pulses.
* `pnoise`: random source of probability. Pure white noise is good.
----------------------------
add the rate;
if greater than 1 ...
... subtract 1+(w*noise)
emit 1 if the value decreased, 0 otherwise.
-------------`(wide_gate)`-----------------
-------------`(wide_hold_gate)`-----------------
wide_gate() is a gate that opens when triggered,
and stays open for an adjustable duration after the trigger
wide_hold_gate() is similar, but instead of closing by going
to zero, it holds the last input sample using ba.sAndH().
### Usage
```
_ : wide_gate(trigger, width) : _
_ : wide_hold_gate(trigger, width) : _
```
Where:
* `trigger`: The gate opens when this goes nonzero, and starts counting down when this goes to zero.
* `width`: duration (in seconds) of the countdown before gate is closed.
#### See Also
ba.sAndH
-------------------------------------
------------`noise_half`---------------
Produce randomly-spaced half-impulses, at an average frequency.
Each half-impulse is a single-sided sparse noise that doesn't return to zero;
between events, a constant DC offset is held.
Each event is a single change to a new amplitude.
### Usage
```
noise_half(f0, pnoise, anoise) : _
no.noise, no.gnoise(5) : noise_half(f0) : _
no.noise <: noise_half(f0) : _
```
Where:
* `f0`: average number of impulses per second.
* `pnoise`: random source of probability. Pure white noise is good.
* `anoise`: source of amplitude. Pure white noise, gaussian, or any signal.
-----------------
-------------`noise_pink_sparse`-----------------
-------------`noise_pink_sparse_n`-----------------
Sparse "pink" noise generator.
Not sure what to call this anymore, really. The spectrum approaches pink (1/f) as
f0 approaches the sample rate; at that point, it's using noise_half()
to implement Trammel's "Stochastic Voss/McCartney" algorithm.
However, at lower frequencies, the spectrum tilts toward brown (1/f^2).
So it's cryptic and irregular. As a pink noise generator it may offer some tiny
(inadible?) amount of improved linearity over no.pink_noise, but only at great cost
of complexity & CPU. It was fun and educational to write, but I have replaced it almost
everywhere with no.pink_noise . However, as the perturbing force that acts on Drift,
it resembles (to my ear) the real behavior of wind better than anything else I've tried so far.
It's the right ratio of smaller movements more often and larger movements less often.
That's all it's used for here.
### Usage
```
no.noise : noise_pink_sparse(f0) : _
no.noise : noise_pink_sparse_n(N, f0) : _
```
Where:
* `f0`: average number of fluctuations per second.
Set this below 20 for sparse noise (individually perceptable noise events).
Set this to the highest value allowed by sample rate to produce general-purpose pink noise.
* `N`: number of generators. (Integer, must be known at compile time.)
Per the Voss McCartney algorithm, full pink noise wants one generator per audible octave in the frequencies below f0.
noise_pink_sparse defaults to 10 generators, corresponding to 10 octaves within the frequencies of 20-20000hz.
Lower values of N may be acceptable when f0 is low, or the output is to be lowpass-filtered.
Higher values of N, f0 and ma.SR may be appropriate for UHF listeners (bats, dolphins, audiophiles, et cetera).
### See Also:
no.sparse_noise
no.pink_noise_vm
#### Reference:
<http://www.ridgerat-tech.us/tech/pinkalg.htm>
-------------------------------------
Generator frequencies distributed exponentially between 0hz -> SR
freq decreases with i.
//////////////////////
Sources of randomness:
We use random values in various ways, and some of them sound better decorrelated.
White noise sources for signal & probability should be decorrelated from each other:
The drift generator and the sparse noise generator can share a random source, because they
work at such different frequencies & do such different things ... but I still want to
be sure they never get the same value in the same cycle.
for triggering drift
for gating sparse noise
Gaussian noise source for sound & flutter should be decorrelated & each normalized to +-1.0:
sound
flutter values
New random values chosen at the moment of a flutter event should be decorrelated from each other:
Base filter frequency
Base filter Q
Noise width
Stereo position
NOTE: the flutter on harmonic components are not decorrelated from f_gnoise.
In theory I should do this, but it may change the asesthetic character of the sound,
so it will need careful listening.
//////////////////////
//////////////////////
Flux signals: flutter and drift
(generated from the above noise sources.)
////////
"Flutter" is a coefficient centered around 1.0, flucutating with each noise event
triggered by sparse_trigger.
(It holds still between events, so the resonant filter can ring at a constant pitch.)
Q_flutter: an offset centered around 0.0, +1 to -1 with a (clipped) gaussian distribution.
DEBUG
width_flutter: same, but decorrelated from Q_flutter
Utility: convert flutter exponentially, so that +1 flutter raises pitch by the same interval that -1 flutter lowers it.
///////
"Drift" is low-frequency fluctuation intended to mimic the period of
ocean waves, gusts of wind, etc. It ranges from 0 to +1. The rates of positive
movement and negative movement are controlled independently, to model natural
phenomena in which energy is delivered rapidly into a system by a particularl event,
then leaves the system more slowly via diffusion.
The rise & decay rates of drift are a slope, not a time-bounded envelope. Higher values of drift
will take longer to approach and retreat. Slope is proportionate to the overall drift rate.
The adjusters give coefficients between 0 & 2.
If wave goes from 0 to 1 in df seconds, the slope is (1/df) / ma.SR. == 1 / (df * ma.SR);
i.e. 1/samples to get there. If wave goes from 0 to 1 instantly (gets there in one sample)
the slope is 1.0, i.e. 1/1 . The spread scross the two is 1 / (max(df * ma.SR * drift_adj, 1));
This drift signal can be thought of as a sparse brown noise wave with all negative values truncated to zero,
passed through a lowpass-esque filter, with the rise & fall slopes determining the lowpass characteristics.
DEBUG
hard_wave is a sparse brown noise wave, constrained to +-1
soft_wave slides toward the value of hard_wave at a rate determined by drift_slope
Utility: drift2exponent is like flutter2exponent, minus the sample & hold.
coefficient from 1/2 to 2 as d_m from -1 to 1
///////////////////////
///////////////////////
Audible noise generation:
Density of noise events, with drift & flutter
As drift varies -1/+1, vary density freq by (up to) 1/8 - 8
coefficient from 1/2 to 2 as d_m from -1 to 1
Adjustable sparse trigger controlled by that density. Each trigger event sparks some sound.
"Width": Adjustable gate open time (in secs) as a function of density. Minimum 1 sample.
width_adj is log from 0 to 1, but scale to double-log from 0 to 1.5
adjusted width: similar range.
scaled width: divide by density
Input signal sources (choose one of 3):
1) Sparse Gaussian white noise:
2) "Sparse brown noise" (brown to pink, really; see footnote 1 in the paper for details):
3) Any old noise/signal from line in:
Choose one
////////////////
///////////////
Timbre section -- adding character to noise events
/////
"Grit": Use exponentation to push around the average levels of the random values in noise.
a "grit" of 1.0 means noise is just noise, equally distributed & the average value would be +-.5.
Grit is an exponent by which each sample is raised. Numbers below 1.0 get smaller when raised to powers above 1.
Therefore:
exponent below 1 == compression of signal, louder output
exponent at 0 == max volume (all clicks are +1 or -1)
exponent above 1 == expansion of signal, quieter output ... but this doesn't end up very useful IMO.
Samples are between [-1, 1]. We can't raise a negative number to a fractional power without imaginary numbers.
Instead, we raise the absolute value by the exponent, then multiply by the value's sign.
-1, 0 or 1
////////
Fundamental (base_) Filter:
The Moog VCF in vaeffects.lib creates a nice tuned resonance when the Q is set high.
(The three different Moog VCF implementations in vaeffects.lib really behave
differently in the high notes here ... moog_vcf_2bn sounds best to me.)
However, moog_vcf_2bn requires some rubber bumpers:
1) There are glitch areas in this moog vcf model; some combinations of Q and freq cause obnoxious alilased noise.
Artifacts begin to arise as F passes 22000 hz with q=0.
TODO: investigate: is this artifact a function of ma.SR or not? If so, reference that.
(Anyway, a lopass filter that starts to roll off at 22000hz is the same as a wire to human ears.)
2) Negative values of Q can also produce painful dubstep,
and values above 1 seem to behave as compressed harmonics of the values between 0 and 1.
Also, the filter bypass switch is implemented here.
Frequency of fundamental filter, with flutter & drift
Q of the fundamental filter, with flutter & drift
scale is exponential, but the action is at the tip-top, so convert to double-exponential)
///////////
Overtone filters:
2 seems plenty, but more can easily be added here:
Same filter as the fundamental, with parameters computed like so:
Overtone freq = multiple of base freq + flutter & drift
Overtone Q = same as base Q, plus flutter and drift
Overtone level = user control + flutter & drift
Flutter & drift for overtones:
avg 0.0
TODO: DECORRELATE?
TODO: DECORRELATE?
Utility: Algorithm for applying drift and flutter to the Q of a filter,
while dealing with boundry conditions in a nice-sounding way.
(TODO: use this more generally for flux on coefficients?)
TODO: Clicks occur when frequency flutters too low ... since this
filter doesn't have much effect below 40hz anyway, I'd like to cut that out.
But rather than attenuate at the bottom, it'd be better if the flutter window
would keep its bottom at the cutoff (40hz or whatever) and keep its set
width for all center frequencies below (cutoff+(width/2)). Then
behavior near that range would better match behavior in the rest of the
audible range. (I think.) (I hope.)
size of the gap between the Q slider and its nearest border; minimum 20%
Q plus drift:
size of the flutter zone after drift is applied; minimum 10%
Q plus drift plus flutter:
////////////////
///////////////
Stereo position
pan_flutter: decorrelated from Q_flutter
///////////////
All together now:
Take our chosen noise source:
Delay it by 1 sample, to give the filters a head start changing parameters, to prevent a bit of crunch:
Apply grit:
Normalize levels (somewhat) between different noise sources:
Apply low shelf :
Split into filter bank (fundamental plus N overtones), recombine
Recombine, apply output gate
Apply output gain
Apply limiter
Pan stereo (normazed from +1-1 to 0-1 | declare name "Weather Organ";
declare author "Mykle James Hansen";
declare copyright "(c) Mykle James Hansen 2018";
declare version "0.5";
declare license "This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.";
import("stdfaust.lib");
flux_adj = vslider("v:[-1]Weather/h:[0]/v:[1]/[0]Flux[unit:%]", 100, 0, 200, 1) / 100;
turbulence_adj = vslider("v:[-1]Weather/h:[0]/v:[4]/[0]Turbulence[scale:log][unit:Hz]", 0.5, 0.001, 10, 0.001);
flutter_dbg = vbargraph("v:[-1]Weather/h:[0]/v:[1]/[1]Flutter", -1.5, 1.5);
drift_dbg = vbargraph("v:[-1]Weather/h:[0]/v:[4]/[1]Drift", -1.5, 1.5);
noise_source_radio = hslider("v:[0]Noise/h:[0]/Source:[style:radio{'White':0;'Brown':1;'Line in':2}]", 0, 0, 2, 1);
density_drift_adj = vslider("v:[0]Noise/h:[1]/v:[0]/[2]D drift[style:knob]",0,-1,1,0.001);
width_adj = vslider("v:[0]Noise/h:[1]/v:[2]/[0]Width[unit:%][scale:log]", 1, 1, 101, .01) : -(1) : /(100);
width_flutter_adj = vslider("v:[0]Noise/h:[1]/v:[2]/[1]W flutter[style:knob]",0,0,1,0.001);
width_drift_adj = vslider("v:[0]Noise/h:[1]/v:[2]/[2]W drift[style:knob]",0,-1,1,0.001);
rhythm_adj = vslider("v:[0]Noise/h:[1]/v:[3]/[0]Rhythm[scale:exp]", 0, 0, 1, 0.01);
rhythm_drift_adj = vslider("v:[0]Noise/h:[1]/v:[3]/[1]R drift[style:knob]",0,-1,1,0.001);
grit_adj = vslider("v:[0]Noise/h:[1]/v:[3]/[2]Grit[midi:ctrl 19]", 0, -1, 1, 0.01);
filter_bypass = checkbox("v:[1]Filter/h:[0]/Bypass");
low_shelf_adj = vslider("v:[1]Filter/h:[1]/[-1]Low shelf[unit:Hz][scale:log][midi:ctrl 71]", 20, 10, 22050, 1) : si.smoo;
base_center_freq = vslider("v:[1]Filter/h:[1]/v:[0]/[0]Freq[unit:Hz][scale:log]", 3520, 20, filter_upper_bound, 1) / 2;
base_flutter_adj = vslider("v:[1]Filter/h:[1]/v:[0]/[1]F flutter[style:knob]",0,0,1,0.001);
base_drift_adj = vslider("v:[1]Filter/h:[1]/v:[0]/[2]F drift[style:knob]",0,-1,1,0.001);
Q_adj = vslider("v:[1]Filter/h:[1]/v:[2]/[0]Q[scale:exp][midi:ctrl 71]", 0.8, 0, 1, 0.0005);
Q_flutter_adj = vslider("v:[1]Filter/h:[1]/v:[2]/[1]Q flutter[style:knob]",0,0,1,0.001);
Q_drift_adj = vslider("v:[1]Filter/h:[1]/v:[2]/[2]Q drift[style:knob]",0,-1,1,0.001);
filter_h_adj(N) = vslider("v:[1]Filter/h:[1]/h:[3]Overtones/v:[%M]/[0]O%NN ratio[style:knob]", O, 1, 15, 0.01) with {NN = N + 1; M = N + 3; O = 2*(N+1) + 1;};
filter_h_level(N) = vslider("v:[1]Filter/h:[1]/h:[3]Overtones/v:[%M]/[1]O%NN level[style:knob]", 0, 0, 1, 0.001) with {NN = N + 1; M = N + 3;};
filter_h_flutter(N) = vslider("v:[1]Filter/h:[1]/h:[3]Overtones/v:[%M]/[2]O%NN flutter[style:knob]", 0, 0, 1, 0.001) with {NN = N + 1; M = N + 3;};
filter_h_drift_adj(N) = vslider("v:[1]Filter/h:[1]/h:[3]Overtones/v:[%M]/[3]O%NN drift[style:knob]", 0,-1,1,0.001) with {NN = N + 1; M = N + 3;};
outgate= checkbox("v:[99]Output/[0]Gate");
outgain = vslider("v:[99]Output/[1]Gain[scale:log][midi:ctrl 7]", 1, 0.1, 10.1, 0.1) - 0.1;
limit_on = checkbox("v:[99]Output/[99]Limit");
normal = environment {
noise = 1;
gnoise = 0.625;
pink_noise = 12.5;
};
noise_pink = 0.312;
};
sparse_periodic_trigger(f0, periodicity, noise) =
(
) ~ _
with {
w = max(0, min(1, 1 - periodicity));
rate = f0/ma.SR;
};
wide_gate(trigger, seconds, signal) = ba.if(clock > 0, signal, 0)
with {
width = seconds * ma.SR;
clock = max(width * (trigger != 0)) ~ (-(1) : max(0));
};
wide_hold_gate(trigger, seconds, signal) = ba.if(clock > 0, signal, signal:ba.sAndH(clock > 0) )
with {
width = seconds * ma.SR;
clock = max(width * trigger) ~ (-(1) : max(0));
};
noise_half(f0, pnoise, anoise) = anoise : ba.sAndH(sparse_periodic_trigger(f0, 0, pnoise));
noise_pink_sparse_n(N, f0, noise) = noise, noise@N <: par(i, N,
@(i), @(i) : noise_half(F(i))
) :> _
with {
};
noise_pink_sparse(f0, noise) = noise_pink_sparse_n(10, f0, noise);
s_noise = no.multinoise(2) : !, _;
p_noise = no.multinoise(2) : _, !;
Q_flutter = f_gnoise_base_Q : ba.sAndH(sparse_trigger) : min(1) : max(-1)
;
width_flutter = f_gnoise_width : ba.sAndH(sparse_trigger) : min(1) : max(-1) ;
flutter2exponent(noise, range) = pow(2, ( noise : ba.sAndH(sparse_trigger) : *(range) ));
drift_slope = (2/ma.SR) * turbulence_adj;
drift = flux_adj * soft_wave
with {
hard_wave = p_drift_noise : noise_pink_sparse_n(5, turbulence_adj) : *(normal.noise_pink) : min(1) : max(-1) ;
soft_wave = (_ <: _, slope : +) ~ _;
slope(sig) = ba.if((sig <= hard_wave), drift_slope, -drift_slope);
};
drift2exponent(range) = pow(2, (drift * range));
density = density_adj * d_drift(8 * density_drift_adj)
with {
};
sparse_trigger = sparse_periodic_trigger(density, rhythm_adj, p_sparse_noise );
width = max(sw, 1/ma.SR)
with {
w_adj = pow(width_adj, 2) : *(1.5);
aw = w_adj
+ (width_flutter * flux_adj * width_flutter_adj / 8)
+ (drift * flux_adj * width_drift_adj / 8)
: max(0);
sw = aw / density;
};
gwhite_noise_source = s_gnoise : wide_gate(sparse_trigger, width);
brown_noise_source = no.pink_noise : *(normal.no.pink_noise) : wide_hold_gate(sparse_trigger, width) ;
external_source = _ : wide_hold_gate(sparse_trigger, width);
noise_source = gwhite_noise_source, brown_noise_source, external_source: ba.selectn(3, noise_source_radio);
grit(noiseIn) = abspow(noiseIn, 1 - grit_adj)
with {
abspow(val, power) = (abs(val) ^ power) * sign(val) ;
};
resonant_filter = ve.moog_vcf_2bn;
filter_upper_bound = 22000;
filter(f, q, signal) = ba.if((filter_bypass | (f>filter_upper_bound)) ,
signal,
resonant_filter(min(1, max(0, q)), f))
;
base_filter_freq = base_center_freq * flutter2exponent(f_gnoise_base, flux_adj * base_flutter_adj) * drift2exponent(base_drift_adj);
base_filter_Q = Q_flux(exp_Q, drift, Q_drift_adj, Q_flutter, Q_flutter_adj)
with {
};
num_overtones = 2;
overtone_filter(N) = filter(overtone_freq(N), overtone_Q(N)) * overtone_level(N)
with {
overtone_freq(N) = base_filter_freq
* (1+filter_h_adj(N))
* overtone_f_flutter(N)
* overtone_drift(N);
overtone_Q(N) = Q_flux(base_filter_Q, drift, filter_h_drift_adj(N), Q_flutter, filter_h_flutter(N));
overtone_level(N) = filter_h_level(N)
* overtone_drift(N)
* overtone_f_level(N);
overtone_drift(N) = drift2exponent(flux_adj * filter_h_drift_adj(N));
};
Q_flux(Q, drift, drift_adj, flutter_wave, flutter_adj) = Qdf : max(0) : min(1)
with {
Qd = Q + (drift * drift_adj * flux_adj * drift_gap);
Qdf = Qd + (flutter_wave * flutter_adj * flux_adj * flutter_gap);
};
pan_adj = vslider("v:[99]Output/[3]Pan[style:knob]", 0, -0.5, 0.5, .001);
pan_flutter_adj = vslider("v:[99]Output/[4]P flutter[style:knob]",0,0,1,0.001);
pan_flutter = f_gnoise_pan : *(pan_flutter_adj) : ba.sAndH(sparse_trigger) : min(1) : max(-1) ;
pan = pan_adj + pan_flutter : min(1) : max(-1);
process = hgroup("[1]",
noise_source
: _'
: grit
: *( (8, 1, 1) : ba.selectn(3, noise_source_radio))
<: _, fi.low_shelf(-40, low_shelf_adj) : ba.if(filter_bypass)
<: filter(base_filter_freq, base_filter_Q), par(N, num_overtones, overtone_filter(N)) :> _
: *(outgate)
: *(outgain)
<: _, co.limiter_1176_R4_mono : select2(limit_on)
: sp.panner((pan + 1)/2)
);
|
5c96d54304fa8bce2a26351704df51cafe631be4a266e68b53c95930b8243152 | SputnikStan5/LV2-Prototyper | dx7.dsp | //#################################### dx7.lib #########################################
// Yamaha DX7 emulation library. Its official prefix is `dx`.
//########################################################################################
// Yamaha DX7 emulation library. The various functions available in this library
// are used by the libraries generated from `.syx` DX7 preset files. This
// toolkit was greatly inspired by the CSOUND DX7 emulation package:
// <http://www.parnasse.com/dx72csnd.shtml>.
//
// This library and its related tools are under development. Use it at your
// own risk!
//##############################################################################
// FAUST library file, GRAME section
// Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
// Centre National de Creation Musicale.
// ----------------------------------------------------------------------
// GRAME LICENSE
// 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 2.1 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 the GNU C Library; if not, write to the Free
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
// 02111-1307 USA.
// EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
// larger FAUST program which directly or indirectly imports this library
// file and still distribute the compiled code generated by the FAUST
// compiler, or a modified version of this compiled code, under your own
// copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
// grants you the right to freely choose the license for the resulting
// compiled code. In particular the resulting compiled code has no obligation
// to be LGPL or GPL. For example you are free to choose a commercial or
// closed source license or any other license if you decide so.
declare name "dx7";
declare options "[nvoices:8]"; // FaustProcessor has a property which will override this.
import("stdfaust.lib");
import("dx7.lib");
ALGORITHM=7;
dx7_widget =
dx.dx7_algo(ALGORITHM,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) :> _
with{
feedback = hslider("global/feedback",0,0,99,1) : dx.dx7_fdbkscalef/(2*ma.PI);
lfoDelay = hslider("global/lfoDelay",0,0,99,1);
lfoDepth = hslider("global/lfoDepth",0,0,99,1);
lfoSpeed = hslider("global/lfoSpeed",0,0,99,1);
freq = hslider("freq",400,50,1000,0.01);
gain = hslider("gain",0.8,0,1,0.01);
gate = button("gate");
egR1UI = par(i,6,hslider("op%i/egR1",90,0,99,1));
egR1(n) = ba.take(n+1,egR1UI);
egR2UI = par(i,6,hslider("op%i/egR2",90,0,99,1));
egR2(n) = ba.take(n+1,egR2UI);
egR3UI = par(i,6,hslider("op%i/egR3",90,0,99,1));
egR3(n) = ba.take(n+1,egR3UI);
egR4UI = par(i,6,hslider("op%i/egR4",90,0,99,1));
egR4(n) = ba.take(n+1,egR4UI);
egL1UI = par(i,6,hslider("op%i/egL1",0,0,99,1));
egL1(n) = ba.take(n+1,egL1UI);
egL2UI = par(i,6,hslider("op%i/egL2",90,0,99,1));
egL2(n) = ba.take(n+1,egL2UI);
egL3UI = par(i,6,hslider("op%i/egL3",90,0,99,1));
egL3(n) = ba.take(n+1,egL3UI);
egL4UI = par(i,6,hslider("op%i/egL4",0,0,99,1));
egL4(n) = ba.take(n+1,egL4UI);
outLevelUI = par(i,6,hslider("op%i/level",95,0,99,1));
outLevel(n) = ba.take(n+1,outLevelUI);
keyVelSensUI = par(i,6,nentry("op%i/keyVelSens",1,0,8,1));
keyVelSens(n) = ba.take(n+1,keyVelSensUI);
ampModSensUI = par(i,6,hslider("op%i/ampModSens",0,0,99,1));
ampModSens(n) = ba.take(n+1,ampModSensUI);
opModeUI = par(i,6,nentry("op%i/opMode",0,0,1,1));
opMode(n) = ba.take(n+1,opModeUI);
opFreqUI = par(i,6,hslider("op%i/opFreq",1.0,0.0,2.0,0.01));
opFreq(n) = ba.take(n+1,opFreqUI);
opDetuneUI = par(i,6,hslider("op%i/opDetune",1,-10,10,1));
opDetune(n) = ba.take(n+1,opDetuneUI);
opRateScaleUI = par(i,6,hslider("op%i/opRateScale",0,0,10,1));
opRateScale(n) = ba.take(n+1,opRateScaleUI);
};
process = dx7_widget <: _, _;
| https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/Library/dx7.dsp | faust | #################################### dx7.lib #########################################
Yamaha DX7 emulation library. Its official prefix is `dx`.
########################################################################################
Yamaha DX7 emulation library. The various functions available in this library
are used by the libraries generated from `.syx` DX7 preset files. This
toolkit was greatly inspired by the CSOUND DX7 emulation package:
<http://www.parnasse.com/dx72csnd.shtml>.
This library and its related tools are under development. Use it at your
own risk!
##############################################################################
FAUST library file, GRAME section
Except where noted otherwise, Copyright (C) 2003-2017 by GRAME,
Centre National de Creation Musicale.
----------------------------------------------------------------------
GRAME LICENSE
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 2.1 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 the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.
EXCEPTION TO THE LGPL LICENSE : As a special exception, you may create a
larger FAUST program which directly or indirectly imports this library
file and still distribute the compiled code generated by the FAUST
compiler, or a modified version of this compiled code, under your own
copyright and license. This EXCEPTION TO THE LGPL LICENSE explicitly
grants you the right to freely choose the license for the resulting
compiled code. In particular the resulting compiled code has no obligation
to be LGPL or GPL. For example you are free to choose a commercial or
closed source license or any other license if you decide so.
FaustProcessor has a property which will override this. |
declare name "dx7";
import("stdfaust.lib");
import("dx7.lib");
ALGORITHM=7;
dx7_widget =
dx.dx7_algo(ALGORITHM,egR1,egR2,egR3,egR4,egL1,egL2,egL3,egL4,outLevel,keyVelSens,ampModSens,opMode,opFreq,opDetune,opRateScale,feedback,lfoDelay,lfoDepth,lfoSpeed,freq,gain,gate) :> _
with{
feedback = hslider("global/feedback",0,0,99,1) : dx.dx7_fdbkscalef/(2*ma.PI);
lfoDelay = hslider("global/lfoDelay",0,0,99,1);
lfoDepth = hslider("global/lfoDepth",0,0,99,1);
lfoSpeed = hslider("global/lfoSpeed",0,0,99,1);
freq = hslider("freq",400,50,1000,0.01);
gain = hslider("gain",0.8,0,1,0.01);
gate = button("gate");
egR1UI = par(i,6,hslider("op%i/egR1",90,0,99,1));
egR1(n) = ba.take(n+1,egR1UI);
egR2UI = par(i,6,hslider("op%i/egR2",90,0,99,1));
egR2(n) = ba.take(n+1,egR2UI);
egR3UI = par(i,6,hslider("op%i/egR3",90,0,99,1));
egR3(n) = ba.take(n+1,egR3UI);
egR4UI = par(i,6,hslider("op%i/egR4",90,0,99,1));
egR4(n) = ba.take(n+1,egR4UI);
egL1UI = par(i,6,hslider("op%i/egL1",0,0,99,1));
egL1(n) = ba.take(n+1,egL1UI);
egL2UI = par(i,6,hslider("op%i/egL2",90,0,99,1));
egL2(n) = ba.take(n+1,egL2UI);
egL3UI = par(i,6,hslider("op%i/egL3",90,0,99,1));
egL3(n) = ba.take(n+1,egL3UI);
egL4UI = par(i,6,hslider("op%i/egL4",0,0,99,1));
egL4(n) = ba.take(n+1,egL4UI);
outLevelUI = par(i,6,hslider("op%i/level",95,0,99,1));
outLevel(n) = ba.take(n+1,outLevelUI);
keyVelSensUI = par(i,6,nentry("op%i/keyVelSens",1,0,8,1));
keyVelSens(n) = ba.take(n+1,keyVelSensUI);
ampModSensUI = par(i,6,hslider("op%i/ampModSens",0,0,99,1));
ampModSens(n) = ba.take(n+1,ampModSensUI);
opModeUI = par(i,6,nentry("op%i/opMode",0,0,1,1));
opMode(n) = ba.take(n+1,opModeUI);
opFreqUI = par(i,6,hslider("op%i/opFreq",1.0,0.0,2.0,0.01));
opFreq(n) = ba.take(n+1,opFreqUI);
opDetuneUI = par(i,6,hslider("op%i/opDetune",1,-10,10,1));
opDetune(n) = ba.take(n+1,opDetuneUI);
opRateScaleUI = par(i,6,hslider("op%i/opRateScale",0,0,10,1));
opRateScale(n) = ba.take(n+1,opRateScaleUI);
};
process = dx7_widget <: _, _;
|
d87199fa278f29ef6c278641174bffcaaee9997bd80216b08575972bdf462845 | SputnikStan5/LV2-Prototyper | mooSpace.dsp | declare name "mooSpace";
declare description "variable space reverberation audio effect";
declare author "Arev Imer ([email protected])";
declare copyright "Arev";
declare version "0.1";
import("stdfaust.lib");
MAX_DIFF = 9.5;
MAX_LATE = 5;
MAX_MOD = 150;
MAX_LAG = 2^14-2;
diff_mult = hslider("smear", 0.5, 0, 1, 0.001) * MAX_DIFF : si.smoo;
late_diff = hslider("drag", 0.5, 0, 1, 0.001) * MAX_LATE : si.smoo;
mod = hslider("modulate", 0.02, 0, 1, 0.001) * MAX_MOD : si.smoo * rand
with {
rand = (0.5 * (1 + no.lfnoiseN(3,5)));
sine = (2*os.lf_sawpos(2)) * ma.PI : (sin + 1)*0.5;
};
decay = hslider("decay", 0.3, 0, 1., 0.001) : sqrt;
predelay = hslider("lag", 0, 0, 1, 0.001) * (MAX_LAG - 1) : si.smoo;
damp = hslider("colour", 0.1, 0, 1, 0.01) : si.smoo;
//dtime = hslider("reverse", 200, 0, 1000, 0.1) : si.smoo : _ * 88.2 ;
ducktime = 0.2 * (dtime / 2);
dist_amt = hslider("push", 0, 0, 1, 0.01) : si.smoo;
highcut = hslider("High Cut", 1, 0, 1, 0.01) <: * : _ * 14980 : _ + 20 : si.smoo;
lowcut = hslider("Low Cut", 0, 0, 1, 0.01) <: * : _ * 4980 : _ + 20 : si.smoo;
rev_mix = hslider("mix", 0.5, 0, 1, 0.01) : si.smoo;
reverse = checkbox("reverse");
// Parameters
i_diff_1 = 0.75;
i_diff_2 = 0.625;
d_diff_1 = 0.7;
d_diff_2 = 0.5;
dt_idl_1 = 142;
dt_idl_2 = 107;
dt_idl_3 = 379;
dt_idl_4 = 277;
dt_fbd_l1 = 151;
dt_fbd_l2 = 101;
dt_fbd_l3 = 367;
dt_fbd_l4 = 281;
dt_fbd_r1 = 149;
dt_fbd_r2 = 113;
dt_fbd_r3 = 397;
dt_fbd_r4 = 283;
dt_late_l1 = 672;
dt_late_l2 = 1800;
dt_late_r1 = 908;
dt_late_r2 = 2656;
rev_dt_1 = 4453;
rev_dt_2 = 3720;
rev_dt_3 = 4217;
rev_dt_4 = 3163;
// Functions
swap = _,_ <: !,_,_,!;
clip(lower, upper, x) = min(upper,max(x,lower));
mixer(mix, dry_l, wet_l, dry_r, wet_r) = sel(mix, dry_l, wet_l), sel(mix, dry_r, wet_r)
with {
sel(mix, dry, wet) = (1-mix) * dry + mix * wet;
};
allpass(dmax, dt, coeff) =
(+ <: de.fdelay5(dmax, dt-1),*(coeff)) ~ *(-coeff) : mem,_ : + ;
bandwidth(x) = _ * x : + ~ (mem * (1 - x));
damping(x) = _ * (1 - x) : + ~ (mem * x);
input_diff =
allpass(MAX_DIFF * dt_idl_1, diff_mult * dt_idl_1+mod, i_diff_1) :
allpass(MAX_DIFF * dt_idl_2, diff_mult * dt_idl_2+mod, i_diff_1) :
allpass(MAX_DIFF * dt_idl_3, diff_mult * dt_idl_3+mod, i_diff_2) :
allpass(MAX_DIFF * dt_idl_4, diff_mult * dt_idl_4+mod, i_diff_2) :
_;
feedback_diff_l =
allpass(MAX_DIFF * dt_fbd_l1, diff_mult * dt_fbd_l1+mod, i_diff_1) :
allpass(MAX_DIFF * dt_fbd_l2, diff_mult * dt_fbd_l2+mod, i_diff_1) :
allpass(MAX_DIFF * dt_fbd_l3, diff_mult * dt_fbd_l3+mod, i_diff_2) :
allpass(MAX_DIFF * dt_fbd_l4, diff_mult * dt_fbd_l4+mod, i_diff_2) :
_;
feedback_diff_r =
allpass(MAX_DIFF * dt_fbd_r1, diff_mult * dt_fbd_r1+mod, i_diff_1) :
allpass(MAX_DIFF * dt_fbd_r2, diff_mult * dt_fbd_r2+mod, i_diff_1) :
allpass(MAX_DIFF * dt_fbd_r3, diff_mult * dt_fbd_r3+mod, i_diff_2) :
allpass(MAX_DIFF * dt_fbd_r4, diff_mult * dt_fbd_r4+mod, i_diff_2) :
_;
multi_tap_allpass_l(dt, coeff) =
(+ <: de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff * dt - 1 + mod), * (coeff), de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff*(dt/9.63)),de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff*(dt/1.46)))
~(* (-coeff), !, !, !) : mem, _, _, _ : +(_, _), _, _;
multi_tap_allpass_r(dt, coeff) =
(+ <: de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff * dt - 1 + mod), * (coeff), de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff*(dt/7.93)),de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff*(dt/1.39)))
~(* (-coeff), !, !, !) : mem, _, _, _ : +(_, _), _, _;
left_side =
_ * (decay), _ : + : co.compressor_mono(5, -6, 0.5, 1) :
allpass(MAX_LATE * dt_late_l1 + MAX_MOD, late_diff * dt_late_l1 + mod, -d_diff_1)
<: de.fdelay5(rev_dt_1, rev_dt_1),
de.fdelay(rev_dt_1, (rev_dt_1/2.23)), // node24_30[1990] -> L-
de.fdelay(rev_dt_1, late_diff * (rev_dt_1/12.61)), // node24_30[353] -> R+
de.fdelay(rev_dt_1, (rev_dt_1/1.23)) : // node24_30[3627] -> R+
damping(damp), _, _+_ :
decay * _, _, _ :
(multi_tap_allpass_l(dt_late_l2, d_diff_2), _, _) <: // node31_33[187] -> L-, node31_33[1228] -> R-
de.fdelay(rev_dt_2, rev_dt_2), _, _, _, _,
de.fdelay(rev_dt_2, (rev_dt_2/1.39)), !, !, !, !, // node33_39[2673] -> R+
de.fdelay(rev_dt_2, (rev_dt_2/3.49)), !, !, !, ! : // node33_39[1066] -> L-
_ * decay , _/*Lmult-*/,/*Rmult-*/ swap/*Lprev-*/, _/*Rsum+*/, _/*R+*/, _/*L-*/ :
_, _, _, 0.6*((-1* _) + _ + _), _ :
_, _, _, swap :
_, 0.6*((-1* _) - _ - _), _; // 2nd GOING TO LEFT OUT / 3rd GOING TO RIGHT OUT
right_side =
_ * (decay), _ : + : co.compressor_mono(5, -6, 0.5, 1) :
allpass(MAX_LATE * dt_late_r1 + MAX_MOD, late_diff * dt_late_r1 + mod, -d_diff_1)
<: de.fdelay(rev_dt_3, rev_dt_3),
de.fdelay(rev_dt_3, (rev_dt_3/2.0)), // node48_54[2111] -> R-
de.fdelay(rev_dt_3, late_diff * (rev_dt_3/15.85)), // node48_54[266] -> L+
de.fdelay(rev_dt_3, (rev_dt_3/1.42)) : // node48_54[2974]-> L+
damping(damp), _, _ + _ :
decay * _, _, _ :
(multi_tap_allpass_r(dt_late_r2, d_diff_2), _, _) <: // node55_59[335] -> R-, node55_59[1913] -> L-
de.fdelay(rev_dt_4, rev_dt_4), _, _, _, _,
de.fdelay(rev_dt_4, late_diff * (rev_dt_4/26.14)), !, !, !, !, // node59_63[121] -> L-
de.fdelay(rev_dt_4, (rev_dt_4 / 1.58)), !, !, !, !: // node59_63[1996] -> R+
_ * decay , _/*Rmult-*/,/*Lmult-*/swap/*Rprev-*/, _/*Lsum*/, _/*L-*/, _/*R+*/ :
_, _, _, 0.6*((-1* _) + _ - _), _ :
_, _, _, swap :
_, 0.6*((-1* _) - _ + _), _ : // 2nd GOING TO RIGHT OUT / 3rd GOING TO LEFT OUT
_, swap; // 2nd GOING TO LEFT OUT / 3rd GOING TO RIGHT OUT
// reversedelay(delMax,phase,speed) = grooveduck * de.fdelay5(88200, del) with {
// sin_window = (del/delMax) * ma.PI : sin;
// grooveduck = del > (dtime - ducktime) : 1 - _ : ba.ramp(ducktime) ;
// delOffset = delMax * max(0,min(0.999999,phase)); // starting point in delay line
// del = ((speed * os.lf_rawsaw(delMax/speed)) + delOffset) % (delMax-1);
// };
// input_proc = 0.5 * _, 0.5 * _ :> _ :
// ef.cubicnl(dist_amt,0) :
// de.fdelay(MAX_LAG, predelay) :
// fi.lowpass(3,highcut) :
// fi.highpass(3,lowcut) :
// input_diff <: _,_;
input_proc = + : _ * 0.5 :
de.fdelay(MAX_LAG, predelay) :
fi.lowpass(3,highcut) :
fi.highpass(3,lowcut) : input_diff <: _,_;
//(_ + _) * 0.5 : ef.cubicnl(dist_amt,0) : de.fdelay(8820, dt*44.1) : bandwidth(bw) : _;
process = _ ,_ : par(i,2,ef.cubicnl(dist_amt,0))
<: // split L/R to dry and wet
(_, // left ch dry
(input_proc) // left/right to 2 ch
, _) : // right ch dry
(_, // left ch dry
(_, // 1st in left_side
swap, // swap 3 & 2 that feedback goes to 1st in on right_side
_ : // 2nd in right_side
(left_side, right_side):
_, _, swap, _, _ : _, swap, _, _, _) ~ (swap : feedback_diff_l, feedback_diff_r /*: co.compressor_stereo(5, -6, 0.5, 1)*/)),
_ : // right ch dry
_, !, !, _, swap, _, _ :
_, (_ ,_ :> _), (_, _ :> _), _ : _, _, swap :mixer(rev_mix): co.limiter_1176_R4_stereo; | https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/Library/mooSpace.dsp | faust | dtime = hslider("reverse", 200, 0, 1000, 0.1) : si.smoo : _ * 88.2 ;
Parameters
Functions
node24_30[1990] -> L-
node24_30[353] -> R+
node24_30[3627] -> R+
node31_33[187] -> L-, node31_33[1228] -> R-
node33_39[2673] -> R+
node33_39[1066] -> L-
Lmult-
Rmult-
Lprev-
Rsum+
R+
L-
2nd GOING TO LEFT OUT / 3rd GOING TO RIGHT OUT
node48_54[2111] -> R-
node48_54[266] -> L+
node48_54[2974]-> L+
node55_59[335] -> R-, node55_59[1913] -> L-
node59_63[121] -> L-
node59_63[1996] -> R+
Rmult-
Lmult-
Rprev-
Lsum
L-
R+
2nd GOING TO RIGHT OUT / 3rd GOING TO LEFT OUT
2nd GOING TO LEFT OUT / 3rd GOING TO RIGHT OUT
reversedelay(delMax,phase,speed) = grooveduck * de.fdelay5(88200, del) with {
sin_window = (del/delMax) * ma.PI : sin;
grooveduck = del > (dtime - ducktime) : 1 - _ : ba.ramp(ducktime) ;
delOffset = delMax * max(0,min(0.999999,phase)); // starting point in delay line
del = ((speed * os.lf_rawsaw(delMax/speed)) + delOffset) % (delMax-1);
};
input_proc = 0.5 * _, 0.5 * _ :> _ :
ef.cubicnl(dist_amt,0) :
de.fdelay(MAX_LAG, predelay) :
fi.lowpass(3,highcut) :
fi.highpass(3,lowcut) :
input_diff <: _,_;
(_ + _) * 0.5 : ef.cubicnl(dist_amt,0) : de.fdelay(8820, dt*44.1) : bandwidth(bw) : _;
split L/R to dry and wet
left ch dry
left/right to 2 ch
right ch dry
left ch dry
1st in left_side
swap 3 & 2 that feedback goes to 1st in on right_side
2nd in right_side
: co.compressor_stereo(5, -6, 0.5, 1)
right ch dry | declare name "mooSpace";
declare description "variable space reverberation audio effect";
declare author "Arev Imer ([email protected])";
declare copyright "Arev";
declare version "0.1";
import("stdfaust.lib");
MAX_DIFF = 9.5;
MAX_LATE = 5;
MAX_MOD = 150;
MAX_LAG = 2^14-2;
diff_mult = hslider("smear", 0.5, 0, 1, 0.001) * MAX_DIFF : si.smoo;
late_diff = hslider("drag", 0.5, 0, 1, 0.001) * MAX_LATE : si.smoo;
mod = hslider("modulate", 0.02, 0, 1, 0.001) * MAX_MOD : si.smoo * rand
with {
rand = (0.5 * (1 + no.lfnoiseN(3,5)));
sine = (2*os.lf_sawpos(2)) * ma.PI : (sin + 1)*0.5;
};
decay = hslider("decay", 0.3, 0, 1., 0.001) : sqrt;
predelay = hslider("lag", 0, 0, 1, 0.001) * (MAX_LAG - 1) : si.smoo;
damp = hslider("colour", 0.1, 0, 1, 0.01) : si.smoo;
ducktime = 0.2 * (dtime / 2);
dist_amt = hslider("push", 0, 0, 1, 0.01) : si.smoo;
highcut = hslider("High Cut", 1, 0, 1, 0.01) <: * : _ * 14980 : _ + 20 : si.smoo;
lowcut = hslider("Low Cut", 0, 0, 1, 0.01) <: * : _ * 4980 : _ + 20 : si.smoo;
rev_mix = hslider("mix", 0.5, 0, 1, 0.01) : si.smoo;
reverse = checkbox("reverse");
i_diff_1 = 0.75;
i_diff_2 = 0.625;
d_diff_1 = 0.7;
d_diff_2 = 0.5;
dt_idl_1 = 142;
dt_idl_2 = 107;
dt_idl_3 = 379;
dt_idl_4 = 277;
dt_fbd_l1 = 151;
dt_fbd_l2 = 101;
dt_fbd_l3 = 367;
dt_fbd_l4 = 281;
dt_fbd_r1 = 149;
dt_fbd_r2 = 113;
dt_fbd_r3 = 397;
dt_fbd_r4 = 283;
dt_late_l1 = 672;
dt_late_l2 = 1800;
dt_late_r1 = 908;
dt_late_r2 = 2656;
rev_dt_1 = 4453;
rev_dt_2 = 3720;
rev_dt_3 = 4217;
rev_dt_4 = 3163;
swap = _,_ <: !,_,_,!;
clip(lower, upper, x) = min(upper,max(x,lower));
mixer(mix, dry_l, wet_l, dry_r, wet_r) = sel(mix, dry_l, wet_l), sel(mix, dry_r, wet_r)
with {
sel(mix, dry, wet) = (1-mix) * dry + mix * wet;
};
allpass(dmax, dt, coeff) =
(+ <: de.fdelay5(dmax, dt-1),*(coeff)) ~ *(-coeff) : mem,_ : + ;
bandwidth(x) = _ * x : + ~ (mem * (1 - x));
damping(x) = _ * (1 - x) : + ~ (mem * x);
input_diff =
allpass(MAX_DIFF * dt_idl_1, diff_mult * dt_idl_1+mod, i_diff_1) :
allpass(MAX_DIFF * dt_idl_2, diff_mult * dt_idl_2+mod, i_diff_1) :
allpass(MAX_DIFF * dt_idl_3, diff_mult * dt_idl_3+mod, i_diff_2) :
allpass(MAX_DIFF * dt_idl_4, diff_mult * dt_idl_4+mod, i_diff_2) :
_;
feedback_diff_l =
allpass(MAX_DIFF * dt_fbd_l1, diff_mult * dt_fbd_l1+mod, i_diff_1) :
allpass(MAX_DIFF * dt_fbd_l2, diff_mult * dt_fbd_l2+mod, i_diff_1) :
allpass(MAX_DIFF * dt_fbd_l3, diff_mult * dt_fbd_l3+mod, i_diff_2) :
allpass(MAX_DIFF * dt_fbd_l4, diff_mult * dt_fbd_l4+mod, i_diff_2) :
_;
feedback_diff_r =
allpass(MAX_DIFF * dt_fbd_r1, diff_mult * dt_fbd_r1+mod, i_diff_1) :
allpass(MAX_DIFF * dt_fbd_r2, diff_mult * dt_fbd_r2+mod, i_diff_1) :
allpass(MAX_DIFF * dt_fbd_r3, diff_mult * dt_fbd_r3+mod, i_diff_2) :
allpass(MAX_DIFF * dt_fbd_r4, diff_mult * dt_fbd_r4+mod, i_diff_2) :
_;
multi_tap_allpass_l(dt, coeff) =
(+ <: de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff * dt - 1 + mod), * (coeff), de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff*(dt/9.63)),de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff*(dt/1.46)))
~(* (-coeff), !, !, !) : mem, _, _, _ : +(_, _), _, _;
multi_tap_allpass_r(dt, coeff) =
(+ <: de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff * dt - 1 + mod), * (coeff), de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff*(dt/7.93)),de.fdelay5(MAX_LATE * dt + MAX_MOD, late_diff*(dt/1.39)))
~(* (-coeff), !, !, !) : mem, _, _, _ : +(_, _), _, _;
left_side =
_ * (decay), _ : + : co.compressor_mono(5, -6, 0.5, 1) :
allpass(MAX_LATE * dt_late_l1 + MAX_MOD, late_diff * dt_late_l1 + mod, -d_diff_1)
<: de.fdelay5(rev_dt_1, rev_dt_1),
damping(damp), _, _+_ :
decay * _, _, _ :
de.fdelay(rev_dt_2, rev_dt_2), _, _, _, _,
_, _, _, 0.6*((-1* _) + _ + _), _ :
_, _, _, swap :
right_side =
_ * (decay), _ : + : co.compressor_mono(5, -6, 0.5, 1) :
allpass(MAX_LATE * dt_late_r1 + MAX_MOD, late_diff * dt_late_r1 + mod, -d_diff_1)
<: de.fdelay(rev_dt_3, rev_dt_3),
damping(damp), _, _ + _ :
decay * _, _, _ :
de.fdelay(rev_dt_4, rev_dt_4), _, _, _, _,
_, _, _, 0.6*((-1* _) + _ - _), _ :
_, _, _, swap :
input_proc = + : _ * 0.5 :
de.fdelay(MAX_LAG, predelay) :
fi.lowpass(3,highcut) :
fi.highpass(3,lowcut) : input_diff <: _,_;
process = _ ,_ : par(i,2,ef.cubicnl(dist_amt,0))
(left_side, right_side):
_, !, !, _, swap, _, _ :
_, (_ ,_ :> _), (_, _ :> _), _ : _, _, swap :mixer(rev_mix): co.limiter_1176_R4_stereo; |
49021eb201571a3e49036e5e9758d9636ce0a3c4ac81388b3a88e04ee80fe47a | SputnikStan5/LV2-Prototyper | polysampler.dsp | declare name "MyInstrument";
declare options "[nvoices:8]"; // FaustProcessor has a property which will override this.
import("stdfaust.lib");
// This example demonstrates a "sampler" in Faust, and it happens to use
// Lagrange interpolation. The interpolation probably only matters
// when the sampler is played at a MIDI note other than the "center_note".
// The following variables are excluded from this file because they come
// from substitution with Python.
// LAGRANGE_ORDER = 4; // lagrange order. [2-4] are good choices.
// SAMPLE_L_SEQ = waveform{0.0, 0.0} : !, _;
// SAMPLE_R_SEQ = waveform{0.0, 0.0} : !, _;
// SAMPLE_LENGTH = 4; // the length of SAMPLE_L_SEQ and SAMPLE_R_SEQ
// The following functions (lagrange_h, lagrangeN, frdtable)
// were written by Dario Sanfilippo and were merged into Faust here:
// https://github.com/grame-cncm/faustlibraries/pull/74
// They are reproduced here because the latest distribution of Faust
// still doesn't include them.
declare frdtable author "Dario Sanfilippo";
declare frdtable copyright "Copyright (C) 2021 Dario Sanfilippo
<[email protected]>";
declare frdtable license "LGPL v3.0 license";
lagrange_h(N, idx) = par(n, N + 1, prod(k, N + 1, f(n, k)))
with {
f(n, k) = ((idx - k) * (n != k) + (n == k)) / ((n - k) + (n == k));
};
lagrangeN(N, idx) = lagrange_h(N, idx) ,
si.bus(N + 1) : ro.interleave(N + 1, 2) : par(i, N + 1, *) :> _;
frdtable(N, S, init, idx) =
lagrangeN(N, f_idx, par(i, N+1, table(i_idx - int(N / 2) + i)))
with {
table(j) = rdtable(S, init, int(ma.modulo(j, S)));
f_idx = ma.frac(idx) + int(N / 2);
i_idx = int(idx);
};
// variation of hs_phasor that doesn't loop. It's like a one-shot trigger.
my_phasor(tablesize,freq,c) = inc*on_memory : + ~ (_*(1-start_pulse)) : min(1.) *(tablesize)
with {
is_on = c>0;
start_pulse = is_on & (1-is_on');
on_memory = is_on : max ~ (_*(1-start_pulse));
inc = freq/float(ma.SR);
};
gain = hslider("gain",0.1,0,1,0.01); // note velocity
gate = button("gate"); // note on/off
key = hslider("freq", 60, 1, 127, 1) : ba.hz2midikey;
root_midi = hslider("center_note", 60., 1., 128., 0.01);
semitones = key - root_midi;
ratio = semitones : ba.semi2ratio;
length_sec = SAMPLE_LENGTH / ma.SR;
freq = ratio / length_sec;
envVol = en.adsr(.002, 0.1, 0.9, .1, gate);
ridx = my_phasor(SAMPLE_LENGTH, freq, gate);
process = frdtable(LAGRANGE_ORDER, SAMPLE_LENGTH, SAMPLE_L_SEQ, ridx)*gain*envVol*0.5,
frdtable(LAGRANGE_ORDER, SAMPLE_LENGTH, SAMPLE_R_SEQ, ridx)*gain*envVol*0.5;
// polyphonic DSP code must declare a stereo effect
effect = _, _; | https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/Library/polysampler.dsp | faust | FaustProcessor has a property which will override this.
This example demonstrates a "sampler" in Faust, and it happens to use
Lagrange interpolation. The interpolation probably only matters
when the sampler is played at a MIDI note other than the "center_note".
The following variables are excluded from this file because they come
from substitution with Python.
LAGRANGE_ORDER = 4; // lagrange order. [2-4] are good choices.
SAMPLE_L_SEQ = waveform{0.0, 0.0} : !, _;
SAMPLE_R_SEQ = waveform{0.0, 0.0} : !, _;
SAMPLE_LENGTH = 4; // the length of SAMPLE_L_SEQ and SAMPLE_R_SEQ
The following functions (lagrange_h, lagrangeN, frdtable)
were written by Dario Sanfilippo and were merged into Faust here:
https://github.com/grame-cncm/faustlibraries/pull/74
They are reproduced here because the latest distribution of Faust
still doesn't include them.
variation of hs_phasor that doesn't loop. It's like a one-shot trigger.
note velocity
note on/off
polyphonic DSP code must declare a stereo effect | declare name "MyInstrument";
import("stdfaust.lib");
declare frdtable author "Dario Sanfilippo";
declare frdtable copyright "Copyright (C) 2021 Dario Sanfilippo
<[email protected]>";
declare frdtable license "LGPL v3.0 license";
lagrange_h(N, idx) = par(n, N + 1, prod(k, N + 1, f(n, k)))
with {
f(n, k) = ((idx - k) * (n != k) + (n == k)) / ((n - k) + (n == k));
};
lagrangeN(N, idx) = lagrange_h(N, idx) ,
si.bus(N + 1) : ro.interleave(N + 1, 2) : par(i, N + 1, *) :> _;
frdtable(N, S, init, idx) =
lagrangeN(N, f_idx, par(i, N+1, table(i_idx - int(N / 2) + i)))
with {
table(j) = rdtable(S, init, int(ma.modulo(j, S)));
f_idx = ma.frac(idx) + int(N / 2);
i_idx = int(idx);
};
my_phasor(tablesize,freq,c) = inc*on_memory : + ~ (_*(1-start_pulse)) : min(1.) *(tablesize)
with {
is_on = c>0;
start_pulse = is_on & (1-is_on');
on_memory = is_on : max ~ (_*(1-start_pulse));
inc = freq/float(ma.SR);
};
key = hslider("freq", 60, 1, 127, 1) : ba.hz2midikey;
root_midi = hslider("center_note", 60., 1., 128., 0.01);
semitones = key - root_midi;
ratio = semitones : ba.semi2ratio;
length_sec = SAMPLE_LENGTH / ma.SR;
freq = ratio / length_sec;
envVol = en.adsr(.002, 0.1, 0.9, .1, gate);
ridx = my_phasor(SAMPLE_LENGTH, freq, gate);
process = frdtable(LAGRANGE_ORDER, SAMPLE_LENGTH, SAMPLE_L_SEQ, ridx)*gain*envVol*0.5,
frdtable(LAGRANGE_ORDER, SAMPLE_LENGTH, SAMPLE_R_SEQ, ridx)*gain*envVol*0.5;
effect = _, _; |
f2be816494dc07fbd66eb95c2064b099fe90219d3a0441b4340410b5d672c426 | SputnikStan5/LV2-Prototyper | temper.dsp | import("stdfaust.lib");
// Pre-filter parameters
pfilterfc = hslider("Cutoff", 20000, 100, 20000, 1.0);
pfilterq = hslider("Resonance", 1.0, 1.0, 8, 0.001) : si.smooth(0.995);
// Distortion parameters
pdrive = hslider("Drive", 4.0, -10.0, 10.0, 0.001) : si.smooth(0.995);
psat = hslider("Saturation", 1.0, 0.0, 1.0, 0.001) : si.smooth(0.995);
pcurve = hslider("Curve", 1.0, 0.1, 4.0, 0.001) : si.smooth(0.995);
// Output parameters
pfeedback = hslider("Feedback", -60, -60, -24, 1) : ba.db2linear : si.smooth(0.995);
plevel = hslider("Level", -3, -24, 24, 1) : ba.db2linear : si.smooth(0.995);
// A fairly standard wave shaping curve; we use this to shape the input signal
// before modulating the filter coefficients by this signal. Which shaping curve
// we use here is pretty unimportant; as long as we can introduce higher harmonics,
// the coefficient modulation will react. Which harmonics we introduce here seems
// to affect the resulting sound pretty minimally.
//
// Also note here that we use an approximation of the `tanh` function for computational
// improvement. See `http://www.musicdsp.org/showone.php?id=238`.
tanh(x) = x * (27 + x * x) / (27 + 9 * x * x);
transfer(x) = tanh(pcurve * x) / tanh(pcurve);
// The allpass filter is stable for `|m(x)| <= 1`, but should not linger
// near +/-1.0 for very long. We therefore clamp the driven signal with a tanh
// function to ensure smooth coefficient calculation. We also here introduce
// a modulated DC offset in the signal before the curve.
drive(x) = x : *(pdrive) : +(fol(x)) : max(-3) : min(3) with {
fol = an.amp_follower(0.04);
};
// Our modulated filter is an allpass with coefficients governed by the input
// signal applied through our wave shaper. Before the filter, we mix the dry
// input signal with the raw waveshaper output according to the `psat` parameter.
// Note the constant gain coefficient on the waveshaper; that number is to offset
// the global gain from the waveshaper to make sure the shaping process stays
// under unity gain. The maximum differential gain of the waveshaper can be found
// by evaluating the derivative of the transfer function at x0 where x0 is the
// steepest part of the slope. Here that number is ~4, so we multiply by ~1/4.
modfilter(x) = x <: _, tap(x) : *(1.0 - psat), *(psat) : + : fi.tf1(b0(x), b1(x), a1(x)) with {
b0(x) = m(x);
b1(x) = 1.0;
a1(x) = m(x);
m(x) = drive(x) : transfer : *(0.24);
tap(x) = m(x);
};
// A fork of the `tf2s` function from the standard filter library which uses a
// smoothing function after the `tan` computation to move that expensive call
// outside of the inner loop of the filter function.
tf2s(b2,b1,b0,a1,a0,w1) = fi.tf2(b0d,b1d,b2d,a1d,a2d)
with {
c = 1/tan(w1*0.5/ma.SR) : si.smooth(0.995); // bilinear-transform scale-factor
csq = c*c;
d = a0 + a1 * c + csq;
b0d = (b0 + b1 * c + b2 * csq)/d;
b1d = 2 * (b0 - b2 * csq)/d;
b2d = (b0 - b1 * c + b2 * csq)/d;
a1d = 2 * (a0 - csq)/d;
a2d = (a0 - a1*c + csq)/d;
};
// A fork of the `resonlp` function from the standard filter library which uses
// a local `tf2s` implementation.
resonlp(fc,Q,gain) = tf2s(b2,b1,b0,a1,a0,wc)
with {
wc = 2*ma.PI*fc;
a1 = 1/Q;
a0 = 1;
b2 = 0;
b1 = 0;
b0 = gain;
};
// We have a resonant lowpass filter at the beginning of our signal chain
// to control what part of the input signal becomes the modulating signal.
filter = resonlp(pfilterfc, pfilterq, 1.0);
// Our main processing block.
main = (+ : modfilter : fi.dcblocker) ~ *(pfeedback) : gain with {
// This explicit gain multiplier of 4.0 accounts for the loss of gain that
// occurs from oversampling by a factor of 2, and for the loss of gain that
// occurs from the prefilter and modulation step. Then we apply the output
// level parameter.
gain = *(4.0) : *(plevel);
};
// And the overall process declaration.
process = filter : main; | https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/Library/DSP/temper.dsp | faust | Pre-filter parameters
Distortion parameters
Output parameters
A fairly standard wave shaping curve; we use this to shape the input signal
before modulating the filter coefficients by this signal. Which shaping curve
we use here is pretty unimportant; as long as we can introduce higher harmonics,
the coefficient modulation will react. Which harmonics we introduce here seems
to affect the resulting sound pretty minimally.
Also note here that we use an approximation of the `tanh` function for computational
improvement. See `http://www.musicdsp.org/showone.php?id=238`.
The allpass filter is stable for `|m(x)| <= 1`, but should not linger
near +/-1.0 for very long. We therefore clamp the driven signal with a tanh
function to ensure smooth coefficient calculation. We also here introduce
a modulated DC offset in the signal before the curve.
Our modulated filter is an allpass with coefficients governed by the input
signal applied through our wave shaper. Before the filter, we mix the dry
input signal with the raw waveshaper output according to the `psat` parameter.
Note the constant gain coefficient on the waveshaper; that number is to offset
the global gain from the waveshaper to make sure the shaping process stays
under unity gain. The maximum differential gain of the waveshaper can be found
by evaluating the derivative of the transfer function at x0 where x0 is the
steepest part of the slope. Here that number is ~4, so we multiply by ~1/4.
A fork of the `tf2s` function from the standard filter library which uses a
smoothing function after the `tan` computation to move that expensive call
outside of the inner loop of the filter function.
bilinear-transform scale-factor
A fork of the `resonlp` function from the standard filter library which uses
a local `tf2s` implementation.
We have a resonant lowpass filter at the beginning of our signal chain
to control what part of the input signal becomes the modulating signal.
Our main processing block.
This explicit gain multiplier of 4.0 accounts for the loss of gain that
occurs from oversampling by a factor of 2, and for the loss of gain that
occurs from the prefilter and modulation step. Then we apply the output
level parameter.
And the overall process declaration. | import("stdfaust.lib");
pfilterfc = hslider("Cutoff", 20000, 100, 20000, 1.0);
pfilterq = hslider("Resonance", 1.0, 1.0, 8, 0.001) : si.smooth(0.995);
pdrive = hslider("Drive", 4.0, -10.0, 10.0, 0.001) : si.smooth(0.995);
psat = hslider("Saturation", 1.0, 0.0, 1.0, 0.001) : si.smooth(0.995);
pcurve = hslider("Curve", 1.0, 0.1, 4.0, 0.001) : si.smooth(0.995);
pfeedback = hslider("Feedback", -60, -60, -24, 1) : ba.db2linear : si.smooth(0.995);
plevel = hslider("Level", -3, -24, 24, 1) : ba.db2linear : si.smooth(0.995);
tanh(x) = x * (27 + x * x) / (27 + 9 * x * x);
transfer(x) = tanh(pcurve * x) / tanh(pcurve);
drive(x) = x : *(pdrive) : +(fol(x)) : max(-3) : min(3) with {
fol = an.amp_follower(0.04);
};
modfilter(x) = x <: _, tap(x) : *(1.0 - psat), *(psat) : + : fi.tf1(b0(x), b1(x), a1(x)) with {
b0(x) = m(x);
b1(x) = 1.0;
a1(x) = m(x);
m(x) = drive(x) : transfer : *(0.24);
tap(x) = m(x);
};
tf2s(b2,b1,b0,a1,a0,w1) = fi.tf2(b0d,b1d,b2d,a1d,a2d)
with {
csq = c*c;
d = a0 + a1 * c + csq;
b0d = (b0 + b1 * c + b2 * csq)/d;
b1d = 2 * (b0 - b2 * csq)/d;
b2d = (b0 - b1 * c + b2 * csq)/d;
a1d = 2 * (a0 - csq)/d;
a2d = (a0 - a1*c + csq)/d;
};
resonlp(fc,Q,gain) = tf2s(b2,b1,b0,a1,a0,wc)
with {
wc = 2*ma.PI*fc;
a1 = 1/Q;
a0 = 1;
b2 = 0;
b1 = 0;
b0 = gain;
};
filter = resonlp(pfilterfc, pfilterq, 1.0);
main = (+ : modfilter : fi.dcblocker) ~ *(pfeedback) : gain with {
gain = *(4.0) : *(plevel);
};
process = filter : main; |
6d616881578ca49b8fb75c9b52f950fbd3fbda6aff709421176468bdb70076d8 | SputnikStan5/LV2-Prototyper | polywavetable.dsp | declare name "MyInstrument";
declare options "[nvoices:8]"; // FaustProcessor has a property which will override this.
import("stdfaust.lib");
// This example demonstrates using lagrange interpolation to improve
// the sampling of a short waveform.
// Specifically, we simulate only having 4 samples of a sine wave,
// so the values are {0, 1, 0, -1}.
// However, with Lagrange interpolation, we can turn these into a smooth sine wave!
// The following variables are excluded from this file because they come
// from substitution with Python.
// LAGRANGE_ORDER = 4; // lagrange order. [2-4] are good choices.
// CYCLE_SEQ = waveform{0.0, 1.0, 0.0, -1.0} : !, _;
// CYCLE_LENGTH = 4; // the length of CYCLE_SEQ
// The following functions (lagrange_h, lagrangeN, frdtable)
// were written by Dario Sanfilippo and were merged into Faust here:
// https://github.com/grame-cncm/faustlibraries/pull/74
// They are reproduced here because the latest distribution of Faust
// still doesn't include them.
declare frdtable author "Dario Sanfilippo";
declare frdtable copyright "Copyright (C) 2021 Dario Sanfilippo
<[email protected]>";
declare frdtable license "LGPL v3.0 license";
lagrange_h(N, idx) = par(n, N + 1, prod(k, N + 1, f(n, k)))
with {
f(n, k) = ((idx - k) * (n != k) + (n == k)) / ((n - k) + (n == k));
};
lagrangeN(N, idx) = lagrange_h(N, idx) ,
si.bus(N + 1) : ro.interleave(N + 1, 2) : par(i, N + 1, *) :> _;
frdtable(N, S, init, idx) =
lagrangeN(N, f_idx, par(i, N+1, table(i_idx - int(N / 2) + i)))
with {
table(j) = rdtable(S, init, int(ma.modulo(j, S)));
f_idx = ma.frac(idx) + int(N / 2);
i_idx = int(idx);
};
freq = hslider("freq",200,50,1000,0.01); // note pitch
gain = hslider("gain",0.1,0,1,0.01); // note velocity
gate = button("gate"); // note on/off
envVol = en.adsr(.002, 0.1, 0.9, .1, gate);
ridx = os.hs_phasor(CYCLE_LENGTH, freq, envVol == 0.); // or (abs(envVol) < 1e-4)
process = frdtable(LAGRANGE_ORDER, CYCLE_LENGTH, CYCLE_SEQ, ridx)*gain*envVol*0.5 <: _, _;
// polyphonic DSP code must declare a stereo effect
effect = _, _;
Footer
| https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/Library/polywavetable.dsp | faust | FaustProcessor has a property which will override this.
This example demonstrates using lagrange interpolation to improve
the sampling of a short waveform.
Specifically, we simulate only having 4 samples of a sine wave,
so the values are {0, 1, 0, -1}.
However, with Lagrange interpolation, we can turn these into a smooth sine wave!
The following variables are excluded from this file because they come
from substitution with Python.
LAGRANGE_ORDER = 4; // lagrange order. [2-4] are good choices.
CYCLE_SEQ = waveform{0.0, 1.0, 0.0, -1.0} : !, _;
CYCLE_LENGTH = 4; // the length of CYCLE_SEQ
The following functions (lagrange_h, lagrangeN, frdtable)
were written by Dario Sanfilippo and were merged into Faust here:
https://github.com/grame-cncm/faustlibraries/pull/74
They are reproduced here because the latest distribution of Faust
still doesn't include them.
note pitch
note velocity
note on/off
or (abs(envVol) < 1e-4)
polyphonic DSP code must declare a stereo effect | declare name "MyInstrument";
import("stdfaust.lib");
declare frdtable author "Dario Sanfilippo";
declare frdtable copyright "Copyright (C) 2021 Dario Sanfilippo
<[email protected]>";
declare frdtable license "LGPL v3.0 license";
lagrange_h(N, idx) = par(n, N + 1, prod(k, N + 1, f(n, k)))
with {
f(n, k) = ((idx - k) * (n != k) + (n == k)) / ((n - k) + (n == k));
};
lagrangeN(N, idx) = lagrange_h(N, idx) ,
si.bus(N + 1) : ro.interleave(N + 1, 2) : par(i, N + 1, *) :> _;
frdtable(N, S, init, idx) =
lagrangeN(N, f_idx, par(i, N+1, table(i_idx - int(N / 2) + i)))
with {
table(j) = rdtable(S, init, int(ma.modulo(j, S)));
f_idx = ma.frac(idx) + int(N / 2);
i_idx = int(idx);
};
envVol = en.adsr(.002, 0.1, 0.9, .1, gate);
process = frdtable(LAGRANGE_ORDER, CYCLE_LENGTH, CYCLE_SEQ, ridx)*gain*envVol*0.5 <: _, _;
effect = _, _;
Footer
|
5156878cca7393b59e5dd6c0eaf59bd7a311f569ee385486118746cf04969797 | SputnikStan5/LV2-Prototyper | reverb.dsp | import("stdfaust.lib");
metaverb(maxdel,
sz, dffs, fb_gain, lfo_freq, lfo_amount, hi_level, hi_freq, lo_level, lo_freq) =
(route_in : +,+ : core) ~ fb with {
route_in = route(4, 4, (1, 3), (2, 2), (3, 1), (4, 4));
sz_scale(0) = 0.506392;
sz_scale(1) = 0.803821;
sz_scale(2) = 1;
sz_scale(3) = 1.49834;
filter_hs = fi.highshelf(1, hi_level, hi_freq);
filter_ls = fi.lowshelf(1, lo_level, lo_freq);
filter = filter_hs : filter_ls;
lfo_phase(i) = ma.PI/4 * i;
lfo(i) = lfo_amount * os.oscp(lfo_freq, lfo_phase(i));
dtime(ch, i) = sz_scale(i) * sz; // + lfo(ch*i);
allpass(ch, i) = fi.allpass_fcomb(maxdel, dtime(ch, i), dffs);
diffusor(ch) = filter : seq(i, 3, allpass(ch, i));
delay(ch) = de.fdelay(maxdel, dtime(ch, 3));
fb = par(i, 2, delay(i) * fb_gain);
core = par(i, 2, diffusor(i));
};
hi_level = 0;
hi_freq = 4000;
lo_level = 0;
lo_freq = 100;
//sz = hslider("Size", 476.8, 476.8, 2400, 0.01);
sz = 2000;
maxdel = 5000;
dffs = 0.54;
lfo_freq = 0.3;
lfo_amount = 0;
fb = 0.74;
reverb = metaverb(
maxdel, sz, dffs, fb,
lfo_freq, lfo_amount, hi_level, hi_freq, lo_level, lo_freq);
freq = vslider("Freq", 200, 200, 1000, 1);
process = reverb; | https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/Library/DSP/reverb.dsp | faust | + lfo(ch*i);
sz = hslider("Size", 476.8, 476.8, 2400, 0.01); | import("stdfaust.lib");
metaverb(maxdel,
sz, dffs, fb_gain, lfo_freq, lfo_amount, hi_level, hi_freq, lo_level, lo_freq) =
(route_in : +,+ : core) ~ fb with {
route_in = route(4, 4, (1, 3), (2, 2), (3, 1), (4, 4));
sz_scale(0) = 0.506392;
sz_scale(1) = 0.803821;
sz_scale(2) = 1;
sz_scale(3) = 1.49834;
filter_hs = fi.highshelf(1, hi_level, hi_freq);
filter_ls = fi.lowshelf(1, lo_level, lo_freq);
filter = filter_hs : filter_ls;
lfo_phase(i) = ma.PI/4 * i;
lfo(i) = lfo_amount * os.oscp(lfo_freq, lfo_phase(i));
allpass(ch, i) = fi.allpass_fcomb(maxdel, dtime(ch, i), dffs);
diffusor(ch) = filter : seq(i, 3, allpass(ch, i));
delay(ch) = de.fdelay(maxdel, dtime(ch, 3));
fb = par(i, 2, delay(i) * fb_gain);
core = par(i, 2, diffusor(i));
};
hi_level = 0;
hi_freq = 4000;
lo_level = 0;
lo_freq = 100;
sz = 2000;
maxdel = 5000;
dffs = 0.54;
lfo_freq = 0.3;
lfo_amount = 0;
fb = 0.74;
reverb = metaverb(
maxdel, sz, dffs, fb,
lfo_freq, lfo_amount, hi_level, hi_freq, lo_level, lo_freq);
freq = vslider("Freq", 200, 200, 1000, 1);
process = reverb; |
842c3239bdd68eb65a8320405979e714f23463a2cdb8b44dea1e394b8930bc77 | SputnikStan5/LV2-Prototyper | tubescreamer.dsp | import("stdfaust.lib");
declare name "TrueScreamer";
declare version "0.1";
declare author "ChekPuk";
declare description "Tebubescreamerish pedal, closest to my dreams of right pedal";
declare license "GPL 3.0+";
bias = hslider("t:[2]/v:advanced/[0]Bias voltage",0,-4.5,4.5,0.001);
boost = hslider("t:[2]/v:advanced/[1]pre Boost",10,1,10,0.001);
trig = hslider("t:[2]/v:advanced/[2]Diode voltage",1,0,2,0.001);
loopback_c = hslider("t:[2]/v:advanced/[3]Loopback correction",0,-0.5,0.5,0.001);
l_const = 0.232;
gain = vslider("t:[0]/h:main/[1]Gain",1,1,100,0.001);
tone = vslider("t:[0]/h:main/[2]Tone",1,0,1,0.001);
volume= vslider("t:[0]/h:main/[3]Volume",1,0,1,0.001);
bpc = checkbox("On/Off");
hpass(a,b) = fi.highpass(a,b);
lopass(a,b) = fi.lowpass(a,b);
amp= (negative,positive:opamp) ~*(loopback)
with{
loopback = l_const + l_const*loopback_c;
negative = hpass(1,720):lopass(1,6000);
positive = +(1*bias): *(boost);
diodes = atan: max(trig*-1):min(trig);
acfilter = fi.peak_eq(10*(db),freq,bw);
opamp(x,y)= y-x:gainsag(x):diodes: fi.dcblocker;
gainsag(x) = *(gain*(1+abs(x)*gain));
};
filter = lopass(1,723*(1+tone)): _<: lowtone*(2-tone),hitone*tone:>_
with{
lowtone = lopass(1,breakfreq);
hitone = lopass(2,5000*(1+tone)):hpass(1,breakfreq);
breakfreq = 100*(1+tone);
};
post = /(boost):*(volume);
process = _<: select2(bpc,_): _<: _,(amp:filter:post): select2(bpc,_);
Footer
| https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/Library/DSP/tubescreamer.dsp | faust | import("stdfaust.lib");
declare name "TrueScreamer";
declare version "0.1";
declare author "ChekPuk";
declare description "Tebubescreamerish pedal, closest to my dreams of right pedal";
declare license "GPL 3.0+";
bias = hslider("t:[2]/v:advanced/[0]Bias voltage",0,-4.5,4.5,0.001);
boost = hslider("t:[2]/v:advanced/[1]pre Boost",10,1,10,0.001);
trig = hslider("t:[2]/v:advanced/[2]Diode voltage",1,0,2,0.001);
loopback_c = hslider("t:[2]/v:advanced/[3]Loopback correction",0,-0.5,0.5,0.001);
l_const = 0.232;
gain = vslider("t:[0]/h:main/[1]Gain",1,1,100,0.001);
tone = vslider("t:[0]/h:main/[2]Tone",1,0,1,0.001);
volume= vslider("t:[0]/h:main/[3]Volume",1,0,1,0.001);
bpc = checkbox("On/Off");
hpass(a,b) = fi.highpass(a,b);
lopass(a,b) = fi.lowpass(a,b);
amp= (negative,positive:opamp) ~*(loopback)
with{
loopback = l_const + l_const*loopback_c;
negative = hpass(1,720):lopass(1,6000);
positive = +(1*bias): *(boost);
diodes = atan: max(trig*-1):min(trig);
acfilter = fi.peak_eq(10*(db),freq,bw);
opamp(x,y)= y-x:gainsag(x):diodes: fi.dcblocker;
gainsag(x) = *(gain*(1+abs(x)*gain));
};
filter = lopass(1,723*(1+tone)): _<: lowtone*(2-tone),hitone*tone:>_
with{
lowtone = lopass(1,breakfreq);
hitone = lopass(2,5000*(1+tone)):hpass(1,breakfreq);
breakfreq = 100*(1+tone);
};
post = /(boost):*(volume);
process = _<: select2(bpc,_): _<: _,(amp:filter:post): select2(bpc,_);
Footer
|
|
bb3f70ddb92f6e49c513786999c4f0e8698d654ea955c4ffd2ae4cd9cc47855b | SputnikStan5/LV2-Prototyper | 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.1";
import("stdfaust.lib");
process = output with {
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, 1200) <:
fi.highpass(1, 720),_ :
*(voice),*(1 - voice) : +;
post_filter = fi.lowpass(1, 1220) : fi.highpass(1,70);
// 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 - 6,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 * 60.0 / 100.0)-1) :
*(5) : stage_stomp : *((ba.db2linear(volume * 15.0)-1) / 100.0) : fi.dcblocker;
output = _ : stomp : _;
};
| https://raw.githubusercontent.com/SputnikStan5/LV2-Prototyper/14965bd2c5f042d3f11e9a11f9614b5089b99184/Plugins/Faust/Library/Kapitonov-Plugins-Pack/LADSPA/kpp_distruction/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
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.1";
import("stdfaust.lib");
process = output with {
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, 1200) <:
fi.highpass(1, 720),_ :
*(voice),*(1 - voice) : +;
post_filter = fi.lowpass(1, 1220) : fi.highpass(1,70);
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 - 6,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 * 60.0 / 100.0)-1) :
*(5) : stage_stomp : *((ba.db2linear(volume * 15.0)-1) / 100.0) : fi.dcblocker;
output = _ : stomp : _;
};
|
f47928fc09d41f2a1e3be42e2068dcab6d792fd99edfb424f74d7ca419169075 | SputnikStan5/GobyJIT | ellip.dsp | import("stdfaust.lib");
// First stage of the series with analog transfer function coefficients
// selected via
//
// [b0, b1, b2, 1, a1, a2] = sos(1, :)
//
// Note that the function signature for `tf2s` seems to label the coefficients
// in reverse order. Looking at the elliptic filter examples in the filter
// library, the coefficients are passed into `tf2s` in the order returned
// by `zp2sos`, (b0, b1, b2, a1, a2), despite the labeling in the implementation.
s1(fc) = fi.tf2s(b0, b1, b2, a1, a2, w1) with {
b0 = 0.000015848949555;
b1 = 0.0;
b2 = 0.000786144271496;
a1 = 0.525921318217520;
a2 = 0.122972664533630;
w1 = 2 * ma.PI * fc;
};
// Second stage of the series with analog transfer function coefficients
// selected via
//
// [b0, b1, b2, 1, a1, a2] = sos(2, :)
//
// Note the reversed ordering as explained above.
s2(fc) = fi.tf2s(b0, b1, b2, a1, a2, w1) with {
b0 = 1.0;
b1 = 0.0;
b2 = 3.241841838455698;
a1 = 0.395086767014789;
a2 = 0.436970590100401;
w1 = 2 * ma.PI * fc;
};
// Third stage of the series with analog transfer function coefficients
// selected via
//
// [b0, b1, b2, 1, a1, a2] = sos(3, :)
//
// Note the reversed ordering as explained above.
s3(fc) = fi.tf2s(b0, b1, b2, a1, a2, w1) with {
b0 = 1.0;
b1 = 0.0;
b2 = 6.579441200694987;
a1 = 0.223580396610885;
a2 = 0.801864840956017;
w1 = 2 * ma.PI * fc;
};
// Fourth stage of the series with analog transfer function coefficients
// selected via
//
// [b0, b1, b2, 1, a1, a2] = sos(4, :)
//
// Note the reversed ordering as explained above.
s4(fc) = fi.tf2s(b0, b1, b2, a1, a2, w1) with {
b0 = 1.0;
b1 = 0.0;
b2 = 2.490623104289200;
a1 = 0.069999468351859;
a2 = 1.014913750494537;
w1 = 2 * ma.PI * fc;
};
// This module defines an elliptic (cauer) lowpass filter of eighth
// order with 0.4dB of passband ripple, 96.0dB of stopband ripple, and a
// half-band cutoff frequency of (sampleRate / 4), computed in four second-order
// sections. The derivation in GNU Octave is as follows,
//
// pkg load signal;
// format long;
// [z, p, g] = ncauer(0.4, 96.0, 8);
// sos = zp2sos(z, p, g);
//
// A quick plot of the frequency response in the s-plane can be drawn by
// computing the analog coefficients and analysing them with `freqs`,
//
// [B, A] = zp2tf(z, p, g);
// w = linspace(0,4,128);
// freqs(B, A, w);
//
// Note the normalized cutoff frequency at 1rad/s.
ellip = s1(fc) : s2(fc) : s3(fc) : s4(fc) with {
fc = ma.SR / 4;
}; | https://raw.githubusercontent.com/SputnikStan5/GobyJIT/589bb827b5b85095d81558c21438d080951a94b5/Faust/ellip.dsp | faust | First stage of the series with analog transfer function coefficients
selected via
[b0, b1, b2, 1, a1, a2] = sos(1, :)
Note that the function signature for `tf2s` seems to label the coefficients
in reverse order. Looking at the elliptic filter examples in the filter
library, the coefficients are passed into `tf2s` in the order returned
by `zp2sos`, (b0, b1, b2, a1, a2), despite the labeling in the implementation.
Second stage of the series with analog transfer function coefficients
selected via
[b0, b1, b2, 1, a1, a2] = sos(2, :)
Note the reversed ordering as explained above.
Third stage of the series with analog transfer function coefficients
selected via
[b0, b1, b2, 1, a1, a2] = sos(3, :)
Note the reversed ordering as explained above.
Fourth stage of the series with analog transfer function coefficients
selected via
[b0, b1, b2, 1, a1, a2] = sos(4, :)
Note the reversed ordering as explained above.
This module defines an elliptic (cauer) lowpass filter of eighth
order with 0.4dB of passband ripple, 96.0dB of stopband ripple, and a
half-band cutoff frequency of (sampleRate / 4), computed in four second-order
sections. The derivation in GNU Octave is as follows,
pkg load signal;
format long;
[z, p, g] = ncauer(0.4, 96.0, 8);
sos = zp2sos(z, p, g);
A quick plot of the frequency response in the s-plane can be drawn by
computing the analog coefficients and analysing them with `freqs`,
[B, A] = zp2tf(z, p, g);
w = linspace(0,4,128);
freqs(B, A, w);
Note the normalized cutoff frequency at 1rad/s. | import("stdfaust.lib");
s1(fc) = fi.tf2s(b0, b1, b2, a1, a2, w1) with {
b0 = 0.000015848949555;
b1 = 0.0;
b2 = 0.000786144271496;
a1 = 0.525921318217520;
a2 = 0.122972664533630;
w1 = 2 * ma.PI * fc;
};
s2(fc) = fi.tf2s(b0, b1, b2, a1, a2, w1) with {
b0 = 1.0;
b1 = 0.0;
b2 = 3.241841838455698;
a1 = 0.395086767014789;
a2 = 0.436970590100401;
w1 = 2 * ma.PI * fc;
};
s3(fc) = fi.tf2s(b0, b1, b2, a1, a2, w1) with {
b0 = 1.0;
b1 = 0.0;
b2 = 6.579441200694987;
a1 = 0.223580396610885;
a2 = 0.801864840956017;
w1 = 2 * ma.PI * fc;
};
s4(fc) = fi.tf2s(b0, b1, b2, a1, a2, w1) with {
b0 = 1.0;
b1 = 0.0;
b2 = 2.490623104289200;
a1 = 0.069999468351859;
a2 = 1.014913750494537;
w1 = 2 * ma.PI * fc;
};
ellip = s1(fc) : s2(fc) : s3(fc) : s4(fc) with {
fc = ma.SR / 4;
}; |
290f485f340004256eed288a8ea1ae417318db2790d521dc56b5355827e9d22b | SputnikStan5/AudioLAB | dx7.dsp | import("stdfaust.lib");
freq = hslider("freq",100,20,600,0.01);
gate = button("gate");
nextAlgo = button("Next algorithm");
gAttack1 = vslider("h:Operator1/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay1 = vslider("h:Operator1/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain1 = vslider("h:Operator1/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease1 = vslider("h:Operator1/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset1 = vslider("h:Operator1/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack1 = vslider("h:Operator1/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay1 = vslider("h:Operator1/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain1 = vslider("h:Operator1/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease1 = vslider("h:Operator1/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset1 = vslider("h:Operator1/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
gAttack2 = vslider("h:Operator2/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay2 = vslider("h:Operator2/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain2 = vslider("h:Operator2/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease2 = vslider("h:Operator2/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset2 = vslider("h:Operator2/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack2 = vslider("h:Operator2/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay2 = vslider("h:Operator2/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain2 = vslider("h:Operator2/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease2 = vslider("h:Operator2/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset2 = vslider("h:Operator2/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
Ratio2 = vslider("h:Operator2/h:[2]General/FreqRatio [style:knob]", 2, 0, 4, 0.01) : si.smoo;
Gain2 = vslider("h:Operator2/h:[2]General/Gain [style:knob]", 1, 0, 100, 0.01) : si.smoo;
gAttack3 = vslider("h:Operator3/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay3 = vslider("h:Operator3/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain3 = vslider("h:Operator3/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease3 = vslider("h:Operator3/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset3 = vslider("h:Operator3/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack3 = vslider("h:Operator3/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay3 = vslider("h:Operator3/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain3 = vslider("h:Operator3/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease3 = vslider("h:Operator3/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset3 = vslider("h:Operator3/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
Ratio3 = vslider("h:Operator3/h:[2]General/FreqRatio [style:knob]", 2, 0, 4, 0.01) : si.smoo;
Gain3 = vslider("h:Operator3/h:[2]General/Gain [style:knob]", 1, 0, 100, 0.01) : si.smoo;
gAttack4 = vslider("h:Operator4/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay4 = vslider("h:Operator4/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain4 = vslider("h:Operator4/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease4 = vslider("h:Operator4/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset4 = vslider("h:Operator4/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack4 = vslider("h:Operator4/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay4 = vslider("h:Operator4/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain4 = vslider("h:Operator4/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease4 = vslider("h:Operator4/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset4 = vslider("h:Operator4/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
Ratio4 = vslider("h:Operator4/h:[2]General/FreqRatio [style:knob]", 2, 0, 4, 0.01) : si.smoo;
Gain4 = vslider("h:Operator4/h:[2]General/Gain [style:knob]", 1, 0, 100, 0.01) : si.smoo;
gAttack5 = vslider("h:Operator5/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay5 = vslider("h:Operator5/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain5 = vslider("h:Operator5/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease5 = vslider("h:Operator5/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset5 = vslider("h:Operator5/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack5 = vslider("h:Operator5/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay5 = vslider("h:Operator5/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain5 = vslider("h:Operator5/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease5 = vslider("h:Operator5/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset5 = vslider("h:Operator5/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
Ratio5 = vslider("h:Operator5/h:[2]General/FreqRatio [style:knob]", 2, 0, 4, 0.01) : si.smoo;
Gain5 = vslider("h:Operator5/h:[2]General/Gain [style:knob]", 1, 0, 100, 0.01) : si.smoo;
gAttack6 = vslider("h:Operator6/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay6 = vslider("h:Operator6/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain6 = vslider("h:Operator6/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease6 = vslider("h:Operator6/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset6 = vslider("h:Operator6/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack6 = vslider("h:Operator6/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay6 = vslider("h:Operator6/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain6 = vslider("h:Operator6/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease6 = vslider("h:Operator6/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset6 = vslider("h:Operator6/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
Ratio6 = vslider("h:Operator6/h:[2]General/FreqRatio [style:knob]", 2, 0, 4, 0.01) : si.smoo;
Gain6 = vslider("h:Operator6/h:[2]General/Gain [style:knob]", 1, 0, 100, 0.01) : si.smoo;
opperator(ga,gd,gs,gr,go,fa,fd,fs,fr,fo,ratio,gain,mod) = genv*os.osc(fenv+mod)
with{
genv = gain * (en.adsr(ga,gd,gs,gr,gate)*(1-go)+go);
fenv = freq * ratio * (en.adsr(fa,fd,fs,fr,gate)*(1-fo)+fo);
};
//Algorithm 1
algorithm(0,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 2
algorithm(1,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,_)~_;
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
//Algorithm 3
algorithm(2,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2);
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 4
algorithm(3,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + (opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4)~_) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2);
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_);
};
//Algorithm 5
algorithm(4,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5) / 3
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 6
algorithm(5,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5) / 3
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 7
algorithm(6,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 8
algorithm(7,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = (opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,_)~_) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
//Algorithm 9
algorithm(8,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,_)~_;
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
//Algorithm 10
algorithm(9,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2);
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,_)~_;
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
//Algorithm 11
algorithm(10,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2);
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + (opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_);
};
//Algorithm 12
algorithm(11,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,_)~_;
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
//Algorithm 13
algorithm(12,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + (opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_);
};
//Algorithm 14
algorithm(13,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + (opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_);
};
//Algorithm 15
algorithm(14,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,_)~_;
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
//Algorithm 16
algorithm(15,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1)
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 17
algorithm(16,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1)
with{
m1 = (opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,_)~_) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
//Algorithm 18
algorithm(17,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1)
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + (opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,_)~_) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
//Algorithm 19
algorithm(18,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m4) / 3
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2);
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 20
algorithm(19,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 3
with{
m1 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,_)~_;
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
//Algorithm 21
algorithm(20,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m4) / 4
with{
m1 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,_)~_;
m4 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
//Algorithm 22
algorithm(21,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m3) / 4
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 23
algorithm(22,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m4) / 4
with{
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 24
algorithm(23,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m3) / 5
with{
m3 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 25
algorithm(24,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m4) / 5
with{
m4 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 26
algorithm(25,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 3
with{
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + (opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_);
};
//Algorithm 27
algorithm(26,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 3
with{
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,_)~_;
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
//Algorithm 28
algorithm(27,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0) / 3
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,_)~_;
};
//Algorithm 29
algorithm(28,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5) / 4
with{
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 30
algorithm(29,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0) / 4
with{
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,_)~_;
};
//Algorithm 31
algorithm(30,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5) / 5
with{
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
//Algorithm 32
algorithm(31,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + (opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_) / 6;
algo(x) = algorithm(x,gAttack1,gDecay1,gSustain1,gRelease1,gOffset1,fAttack1,fDecay1,fSustain1,fRelease1,fOffset1,
gAttack2,gDecay2,gSustain2,gRelease2,gOffset2,fAttack2,fDecay2,fSustain2,fRelease2,fOffset2,Ratio2,Gain2,
gAttack3,gDecay3,gSustain3,gRelease3,gOffset3,fAttack3,fDecay3,fSustain3,fRelease3,fOffset3,Ratio3,Gain3,
gAttack4,gDecay4,gSustain4,gRelease4,gOffset4,fAttack4,fDecay4,fSustain4,fRelease4,fOffset4,Ratio4,Gain4,
gAttack5,gDecay5,gSustain5,gRelease5,gOffset5,fAttack5,fDecay5,fSustain5,fRelease5,fOffset5,Ratio5,Gain5,
gAttack6,gDecay6,gSustain6,gRelease6,gOffset6,fAttack6,fDecay6,fSustain6,fRelease6,fOffset6,Ratio6,Gain6);
dx7(x) = par(i,32,algo(i)) : ba.selectn(32,x);
v = hslider("chooser",0,0,31,1);
process = dx7(v) / 3; | https://raw.githubusercontent.com/SputnikStan5/AudioLAB/c12684b16f4d27dc3c33e63986611923821117d2/Faust/Library/dsp/dx7.dsp | faust | Algorithm 1
Algorithm 2
Algorithm 3
Algorithm 4
Algorithm 5
Algorithm 6
Algorithm 7
Algorithm 8
Algorithm 9
Algorithm 10
Algorithm 11
Algorithm 12
Algorithm 13
Algorithm 14
Algorithm 15
Algorithm 16
Algorithm 17
Algorithm 18
Algorithm 19
Algorithm 20
Algorithm 21
Algorithm 22
Algorithm 23
Algorithm 24
Algorithm 25
Algorithm 26
Algorithm 27
Algorithm 28
Algorithm 29
Algorithm 30
Algorithm 31
Algorithm 32 | import("stdfaust.lib");
freq = hslider("freq",100,20,600,0.01);
gate = button("gate");
nextAlgo = button("Next algorithm");
gAttack1 = vslider("h:Operator1/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay1 = vslider("h:Operator1/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain1 = vslider("h:Operator1/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease1 = vslider("h:Operator1/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset1 = vslider("h:Operator1/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack1 = vslider("h:Operator1/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay1 = vslider("h:Operator1/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain1 = vslider("h:Operator1/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease1 = vslider("h:Operator1/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset1 = vslider("h:Operator1/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
gAttack2 = vslider("h:Operator2/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay2 = vslider("h:Operator2/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain2 = vslider("h:Operator2/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease2 = vslider("h:Operator2/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset2 = vslider("h:Operator2/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack2 = vslider("h:Operator2/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay2 = vslider("h:Operator2/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain2 = vslider("h:Operator2/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease2 = vslider("h:Operator2/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset2 = vslider("h:Operator2/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
Ratio2 = vslider("h:Operator2/h:[2]General/FreqRatio [style:knob]", 2, 0, 4, 0.01) : si.smoo;
Gain2 = vslider("h:Operator2/h:[2]General/Gain [style:knob]", 1, 0, 100, 0.01) : si.smoo;
gAttack3 = vslider("h:Operator3/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay3 = vslider("h:Operator3/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain3 = vslider("h:Operator3/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease3 = vslider("h:Operator3/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset3 = vslider("h:Operator3/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack3 = vslider("h:Operator3/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay3 = vslider("h:Operator3/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain3 = vslider("h:Operator3/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease3 = vslider("h:Operator3/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset3 = vslider("h:Operator3/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
Ratio3 = vslider("h:Operator3/h:[2]General/FreqRatio [style:knob]", 2, 0, 4, 0.01) : si.smoo;
Gain3 = vslider("h:Operator3/h:[2]General/Gain [style:knob]", 1, 0, 100, 0.01) : si.smoo;
gAttack4 = vslider("h:Operator4/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay4 = vslider("h:Operator4/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain4 = vslider("h:Operator4/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease4 = vslider("h:Operator4/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset4 = vslider("h:Operator4/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack4 = vslider("h:Operator4/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay4 = vslider("h:Operator4/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain4 = vslider("h:Operator4/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease4 = vslider("h:Operator4/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset4 = vslider("h:Operator4/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
Ratio4 = vslider("h:Operator4/h:[2]General/FreqRatio [style:knob]", 2, 0, 4, 0.01) : si.smoo;
Gain4 = vslider("h:Operator4/h:[2]General/Gain [style:knob]", 1, 0, 100, 0.01) : si.smoo;
gAttack5 = vslider("h:Operator5/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay5 = vslider("h:Operator5/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain5 = vslider("h:Operator5/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease5 = vslider("h:Operator5/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset5 = vslider("h:Operator5/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack5 = vslider("h:Operator5/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay5 = vslider("h:Operator5/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain5 = vslider("h:Operator5/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease5 = vslider("h:Operator5/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset5 = vslider("h:Operator5/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
Ratio5 = vslider("h:Operator5/h:[2]General/FreqRatio [style:knob]", 2, 0, 4, 0.01) : si.smoo;
Gain5 = vslider("h:Operator5/h:[2]General/Gain [style:knob]", 1, 0, 100, 0.01) : si.smoo;
gAttack6 = vslider("h:Operator6/h:[0]Envelope gain/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
gDecay6 = vslider("h:Operator6/h:[0]Envelope gain/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
gSustain6 = vslider("h:Operator6/h:[0]Envelope gain/[2]Sustain [style:knob]", 0.7, 0, 1, 0.01) : si.smoo;
gRelease6 = vslider("h:Operator6/h:[0]Envelope gain/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
gOffset6 = vslider("h:Operator6/h:[0]Envelope gain/[4]Offset [style:knob]", 0, 0, 1, 0.01) : si.smoo;
fAttack6 = vslider("h:Operator6/h:[1]Envelope freq/[0]Attack [style:knob]", 0.01, 0.01, 0.5, 0.01) : si.smoo;
fDecay6 = vslider("h:Operator6/h:[1]Envelope freq/[1]Decay [style:knob]", 0.1, 0.01, 0.5, 0.01) : si.smoo;
fSustain6 = vslider("h:Operator6/h:[1]Envelope freq/[2]Sustain [style:knob]", 1, 0, 1, 0.01) : si.smoo;
fRelease6 = vslider("h:Operator6/h:[1]Envelope freq/[3]Release [style:knob]", 0.5, 0.01, 2, 0.01) : si.smoo;
fOffset6 = vslider("h:Operator6/h:[1]Envelope freq/[4]Offset [style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
Ratio6 = vslider("h:Operator6/h:[2]General/FreqRatio [style:knob]", 2, 0, 4, 0.01) : si.smoo;
Gain6 = vslider("h:Operator6/h:[2]General/Gain [style:knob]", 1, 0, 100, 0.01) : si.smoo;
opperator(ga,gd,gs,gr,go,fa,fd,fs,fr,fo,ratio,gain,mod) = genv*os.osc(fenv+mod)
with{
genv = gain * (en.adsr(ga,gd,gs,gr,gate)*(1-go)+go);
fenv = freq * ratio * (en.adsr(fa,fd,fs,fr,gate)*(1-fo)+fo);
};
algorithm(0,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(1,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,_)~_;
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
algorithm(2,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2);
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(3,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + (opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4)~_) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2);
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_);
};
algorithm(4,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5) / 3
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(5,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5) / 3
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(6,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(7,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = (opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,_)~_) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
algorithm(8,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,_)~_;
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
algorithm(9,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2);
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,_)~_;
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
algorithm(10,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2);
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + (opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_);
};
algorithm(11,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,_)~_;
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
algorithm(12,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + (opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_);
};
algorithm(13,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + (opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_);
};
algorithm(14,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) / 2
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,_)~_;
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
algorithm(15,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1)
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(16,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1)
with{
m1 = (opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,_)~_) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
algorithm(17,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1)
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + (opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,_)~_) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
algorithm(18,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m4) / 3
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2);
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(19,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 3
with{
m1 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,_)~_;
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
algorithm(20,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m1) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m4) / 4
with{
m1 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,_)~_;
m4 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
algorithm(21,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m3) / 4
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(22,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m4) / 4
with{
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(23,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m3) / 5
with{
m3 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(24,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m4) / 5
with{
m4 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(25,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 3
with{
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + (opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_);
};
algorithm(26,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,m2) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4) / 3
with{
m2 = opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,_)~_;
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0);
};
algorithm(27,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,m1) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0) / 3
with{
m1 = opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0);
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,_)~_;
};
algorithm(28,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5) / 4
with{
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0);
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(29,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,m3) + opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,0) / 4
with{
m3 = opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,m4);
m4 = opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,_)~_;
};
algorithm(30,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,m5) / 5
with{
m5 = opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_;
};
algorithm(31,ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,
ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,
ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,
ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,
ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,
ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6) =
opperator(ga1,gd1,gs1,gr1,go1,fa1,fd1,fs1,fr1,fo1,1,1,0) + opperator(ga2,gd2,gs2,gr2,go2,fa2,fd2,fs2,fr2,fo2,ratio2,gain2,0) + opperator(ga3,gd3,gs3,gr3,go3,fa3,fd3,fs3,fr3,fo3,ratio3,gain3,0) + opperator(ga4,gd4,gs4,gr4,go4,fa4,fd4,fs4,fr4,fo4,ratio4,gain4,0) + opperator(ga5,gd5,gs5,gr5,go5,fa5,fd5,fs5,fr5,fo5,ratio5,gain5,0) + (opperator(ga6,gd6,gs6,gr6,go6,fa6,fd6,fs6,fr6,fo6,ratio6,gain6,_)~_) / 6;
algo(x) = algorithm(x,gAttack1,gDecay1,gSustain1,gRelease1,gOffset1,fAttack1,fDecay1,fSustain1,fRelease1,fOffset1,
gAttack2,gDecay2,gSustain2,gRelease2,gOffset2,fAttack2,fDecay2,fSustain2,fRelease2,fOffset2,Ratio2,Gain2,
gAttack3,gDecay3,gSustain3,gRelease3,gOffset3,fAttack3,fDecay3,fSustain3,fRelease3,fOffset3,Ratio3,Gain3,
gAttack4,gDecay4,gSustain4,gRelease4,gOffset4,fAttack4,fDecay4,fSustain4,fRelease4,fOffset4,Ratio4,Gain4,
gAttack5,gDecay5,gSustain5,gRelease5,gOffset5,fAttack5,fDecay5,fSustain5,fRelease5,fOffset5,Ratio5,Gain5,
gAttack6,gDecay6,gSustain6,gRelease6,gOffset6,fAttack6,fDecay6,fSustain6,fRelease6,fOffset6,Ratio6,Gain6);
dx7(x) = par(i,32,algo(i)) : ba.selectn(32,x);
v = hslider("chooser",0,0,31,1);
process = dx7(v) / 3; |
fc87670bc020fd9bd58efccf29c0de63e0a7579ab25e040daf54f94bfbcaf1b8 | SputnikStan5/AudioLAB | freeverb.dsp | import("stdfaust.lib");
origSR = 44100;
freeverb(fb1,fb2,damp,spread) = _ <: par(i,8,lbcf(combtuningL(i)+spread,fb1,damp)) :>
seq(i,4,fi.allpass_comb(1024,allpasstuningL(i)+spread,fb2))
with{
dLall = (556,441,341,225);
allpasstuningL(i) = ba.take(i+1,dLall)*ma.SR/origSR;
dLcomb = (1116,1188,1277,1356,1422,1491,1557,1617);
combtuningL(i) = ba.take(i+1,dLcomb)*ma.SR/origSR;
lbcf(dt,fb,damp) = (+:@(dt)) ~ (*(1-damp) : (+~*(damp)) : *(fb));
};
stereo_freeverb(fb1,fb2,damp,spread) = + <: freeverb(fb1,fb2,damp,0),
freeverb(fb1,fb2,damp,spread);
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
combfeed = hslider("Room Size",0.5,0,1,0.025)*scaleroom*ma.SR/origSR + offsetroom;
damping = hslider("Damping",0.5,0,1,0.025)*scaledamp*ma.SR/origSR;
spatSpread = hslider("Stereo Spread",0.5,0,1,0.01)*46*ma.SR/origSR;
g = hslider("Dry/Wet",0.333,0,1,0.01);
process = _,_ <:
(*(g)*fixedgain,*(g)*fixedgain : stereo_freeverb(combfeed,allpassfeed,damping,spatSpread)),
*(1-g),*(1-g) :> _,_; | https://raw.githubusercontent.com/SputnikStan5/AudioLAB/c12684b16f4d27dc3c33e63986611923821117d2/Faust/Library/freeverb.dsp | faust | import("stdfaust.lib");
origSR = 44100;
freeverb(fb1,fb2,damp,spread) = _ <: par(i,8,lbcf(combtuningL(i)+spread,fb1,damp)) :>
seq(i,4,fi.allpass_comb(1024,allpasstuningL(i)+spread,fb2))
with{
dLall = (556,441,341,225);
allpasstuningL(i) = ba.take(i+1,dLall)*ma.SR/origSR;
dLcomb = (1116,1188,1277,1356,1422,1491,1557,1617);
combtuningL(i) = ba.take(i+1,dLcomb)*ma.SR/origSR;
lbcf(dt,fb,damp) = (+:@(dt)) ~ (*(1-damp) : (+~*(damp)) : *(fb));
};
stereo_freeverb(fb1,fb2,damp,spread) = + <: freeverb(fb1,fb2,damp,0),
freeverb(fb1,fb2,damp,spread);
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
combfeed = hslider("Room Size",0.5,0,1,0.025)*scaleroom*ma.SR/origSR + offsetroom;
damping = hslider("Damping",0.5,0,1,0.025)*scaledamp*ma.SR/origSR;
spatSpread = hslider("Stereo Spread",0.5,0,1,0.01)*46*ma.SR/origSR;
g = hslider("Dry/Wet",0.333,0,1,0.01);
process = _,_ <:
(*(g)*fixedgain,*(g)*fixedgain : stereo_freeverb(combfeed,allpassfeed,damping,spatSpread)),
*(1-g),*(1-g) :> _,_; |
|
b08cc56035ba68e93a9ce6b8daea1d47602946736948db4d1a97068c24fb3f7c | SputnikStan5/AudioLAB | svf.dsp | import("stdfaust.lib");
lpfilter = fi.svf.lp(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
hpfilter = fi.svf.hp(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
bpfilter = fi.svf.bp(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
apfilter = fi.svf.ap(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
peakfilter = fi.svf.peak(F,Q,Gain) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
Gain = vslider("Gain", 0, -10, 10, 0.01) : si.smoo;
};
notchfilter = fi.svf.notch(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
lsfilter = fi.svf.ls(F,Q,Gain) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
Gain = vslider("Gain", 0, -10, 10, 0.01) : si.smoo;
};
hsfilter = fi.svf.hs(F,Q,Gain) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
Gain = vslider("Gain", 0, -10, 10, 0.01) : si.smoo;
};
bellfilter = fi.svf.bell(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
process = _ <: lpfilter,hpfilter,bpfilter,apfilter,peakfilter,notchfilter,lsfilter,hsfilter,bellfilter;
| https://raw.githubusercontent.com/SputnikStan5/AudioLAB/c12684b16f4d27dc3c33e63986611923821117d2/svf.dsp | faust | import("stdfaust.lib");
lpfilter = fi.svf.lp(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
hpfilter = fi.svf.hp(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
bpfilter = fi.svf.bp(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
apfilter = fi.svf.ap(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
peakfilter = fi.svf.peak(F,Q,Gain) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
Gain = vslider("Gain", 0, -10, 10, 0.01) : si.smoo;
};
notchfilter = fi.svf.notch(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
lsfilter = fi.svf.ls(F,Q,Gain) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
Gain = vslider("Gain", 0, -10, 10, 0.01) : si.smoo;
};
hsfilter = fi.svf.hs(F,Q,Gain) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
Gain = vslider("Gain", 0, -10, 10, 0.01) : si.smoo;
};
bellfilter = fi.svf.bell(F,Q) with {
F = vslider("Freq", 1000, 30, 10000, 1) : si.smoo;
Q = vslider("Q", 1, 0.01, 20, 0.01) : si.smoo;
};
process = _ <: lpfilter,hpfilter,bpfilter,apfilter,peakfilter,notchfilter,lsfilter,hsfilter,bellfilter;
|
|
bf3a6787653b008046ac81db5cda3f70f421e24ffbfebb4adad2ac06c417be19 | vqlion/Teensy-MIDI-synth | myDsp.dsp | import("stdfaust.lib");
// freqs and gains definitions go here
osc(freq) = rdtable(tablesize, os.sinwaveform(tablesize), int(os.phasor(tablesize,freq)))
with{
tablesize = 1 << 15; // instead of 1 << 16
};
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 * osc((1 + pitchenv * 4) * pitch);
out = ma.tanh(clean * drive);
};
freqSynth1 = hslider("freqSynth1", 440, 20, 5000, 0.1);
freqSynth2 = hslider("freqSynth2", 523.25, 20, 5000, 0.1);
freqSynth3 = hslider("freqSynth3", 349.2, 20, 5000, 0.1);
freqSynth4 = hslider("freqSynth4", 587.33, 20, 5000, 0.1);
freqSynth5 = hslider("freqSynth5", 587.33, 20, 5000, 0.1);
freqSynth6 = hslider("freqSynth6", 587.33, 20, 5000, 0.1);
freqSynth7 = hslider("freqSynth7", 587.33, 20, 5000, 0.1);
gateSynth = checkbox("gateSynth");
gateGuitar = checkbox("gateGuitar");
gateDrums = checkbox("gateDrums");
gateSynth1 = checkbox("gateSynth1");
gateSynth2 = checkbox("gateSynth2");
gateSynth3 = checkbox("gateSynth3");
gateSynth4 = checkbox("gateSynth4");
gateSynth5 = checkbox("gateSynth5");
gateSynth6 = checkbox("gateSynth6");
gateSynth7 = checkbox("gateSynth7");
gateDrums1 = checkbox("gateDrums1");
gateDrums2 = checkbox("gateDrums2");
gateDrums3 = checkbox("gateDrums3");
gateDrums4 = checkbox("gateDrums4");
gateDrums5 = checkbox("gateDrums5");
gateDrums6 = checkbox("gateDrums6");
pitch = hslider("pitch", 1, 0.5, 1.5, 0.1);
modFreq1 = hslider("modfreq1", 50, 0.1, 100, 0.1);
index1 = hslider("index1", 1, 0, 20, 1);
filter = hslider("filter", 0, 0, 1, 0.01);
filterFreq = hslider("filterFreq", 10, 0, 400, 0.1);
lowP = fi.lowpass(1, filterFreq);
at = hslider("at", 0, 0, 1, 0.01);
dt = hslider("dt", 0, 0, 1, 0.01);
sl = hslider("sl", 0.5, 0, 1, 0.01);
rt = hslider("rt", 0, 0, 1, 0.01);
envelope = en.adsr(at,dt,sl,rt,gateSynth);
highHat = kick(3000, 0.05, 0.005, 0.005, 5, gateDrums1);
highHat2 = kick(3000, 0.05, 0.005, 0.005, 5, gateDrums2);
kick1 = sy.clap(500, 0.001, 0.002, gateDrums3);
kick2 = sy.clap(500, 0.001, 0.002, gateDrums4);
clap = kick(200, 0.05, 0.005, 0.005, 5, gateDrums5),
sy.hat(3170, 18000, 0.05, 0.05, gateDrums5);
clap2 = kick(200, 0.05, 0.005, 0.005, 5, gateDrums6),
sy.hat(3170, 18000, 0.05, 0.05, gateDrums6);
synth = osc(freqSynth1*pitch+osc(modFreq1)*index1)*envelope*gateSynth1,
osc(freqSynth2+osc(modFreq1)*index1)*envelope*gateSynth2,
osc(freqSynth3+osc(modFreq1)*index1)*envelope*gateSynth3,
osc(freqSynth4+osc(modFreq1)*index1)*envelope*gateSynth4,
osc(freqSynth5+osc(modFreq1)*index1)*envelope*gateSynth5,
osc(freqSynth6+osc(modFreq1)*index1)*envelope*gateSynth5,
osc(freqSynth7+osc(modFreq1)*index1)*envelope*gateSynth5
:> _ *gateSynth;
guitar = pm.guitar_ui_MIDI,
pm.guitar_ui_MIDI :> _ *gateGuitar;
drums = highHat,
highHat2,
kick1,
kick2,
clap,
clap2
:> _ *gateDrums;
//process = polys0*(mode==0), polys1*(mode==1), polys2*(mode==2);
process =
synth, guitar, drums :> _;
effect = dm.zita_light; //multiple voices all go to the same effect line | https://raw.githubusercontent.com/vqlion/Teensy-MIDI-synth/2bdeae824806c4e07259a5a444bcc3bc0953712e/archives/myDsp.dsp | faust | freqs and gains definitions go here
instead of 1 << 16
process = polys0*(mode==0), polys1*(mode==1), polys2*(mode==2);
multiple voices all go to the same effect line | import("stdfaust.lib");
osc(freq) = rdtable(tablesize, os.sinwaveform(tablesize), int(os.phasor(tablesize,freq)))
with{
};
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 * osc((1 + pitchenv * 4) * pitch);
out = ma.tanh(clean * drive);
};
freqSynth1 = hslider("freqSynth1", 440, 20, 5000, 0.1);
freqSynth2 = hslider("freqSynth2", 523.25, 20, 5000, 0.1);
freqSynth3 = hslider("freqSynth3", 349.2, 20, 5000, 0.1);
freqSynth4 = hslider("freqSynth4", 587.33, 20, 5000, 0.1);
freqSynth5 = hslider("freqSynth5", 587.33, 20, 5000, 0.1);
freqSynth6 = hslider("freqSynth6", 587.33, 20, 5000, 0.1);
freqSynth7 = hslider("freqSynth7", 587.33, 20, 5000, 0.1);
gateSynth = checkbox("gateSynth");
gateGuitar = checkbox("gateGuitar");
gateDrums = checkbox("gateDrums");
gateSynth1 = checkbox("gateSynth1");
gateSynth2 = checkbox("gateSynth2");
gateSynth3 = checkbox("gateSynth3");
gateSynth4 = checkbox("gateSynth4");
gateSynth5 = checkbox("gateSynth5");
gateSynth6 = checkbox("gateSynth6");
gateSynth7 = checkbox("gateSynth7");
gateDrums1 = checkbox("gateDrums1");
gateDrums2 = checkbox("gateDrums2");
gateDrums3 = checkbox("gateDrums3");
gateDrums4 = checkbox("gateDrums4");
gateDrums5 = checkbox("gateDrums5");
gateDrums6 = checkbox("gateDrums6");
pitch = hslider("pitch", 1, 0.5, 1.5, 0.1);
modFreq1 = hslider("modfreq1", 50, 0.1, 100, 0.1);
index1 = hslider("index1", 1, 0, 20, 1);
filter = hslider("filter", 0, 0, 1, 0.01);
filterFreq = hslider("filterFreq", 10, 0, 400, 0.1);
lowP = fi.lowpass(1, filterFreq);
at = hslider("at", 0, 0, 1, 0.01);
dt = hslider("dt", 0, 0, 1, 0.01);
sl = hslider("sl", 0.5, 0, 1, 0.01);
rt = hslider("rt", 0, 0, 1, 0.01);
envelope = en.adsr(at,dt,sl,rt,gateSynth);
highHat = kick(3000, 0.05, 0.005, 0.005, 5, gateDrums1);
highHat2 = kick(3000, 0.05, 0.005, 0.005, 5, gateDrums2);
kick1 = sy.clap(500, 0.001, 0.002, gateDrums3);
kick2 = sy.clap(500, 0.001, 0.002, gateDrums4);
clap = kick(200, 0.05, 0.005, 0.005, 5, gateDrums5),
sy.hat(3170, 18000, 0.05, 0.05, gateDrums5);
clap2 = kick(200, 0.05, 0.005, 0.005, 5, gateDrums6),
sy.hat(3170, 18000, 0.05, 0.05, gateDrums6);
synth = osc(freqSynth1*pitch+osc(modFreq1)*index1)*envelope*gateSynth1,
osc(freqSynth2+osc(modFreq1)*index1)*envelope*gateSynth2,
osc(freqSynth3+osc(modFreq1)*index1)*envelope*gateSynth3,
osc(freqSynth4+osc(modFreq1)*index1)*envelope*gateSynth4,
osc(freqSynth5+osc(modFreq1)*index1)*envelope*gateSynth5,
osc(freqSynth6+osc(modFreq1)*index1)*envelope*gateSynth5,
osc(freqSynth7+osc(modFreq1)*index1)*envelope*gateSynth5
:> _ *gateSynth;
guitar = pm.guitar_ui_MIDI,
pm.guitar_ui_MIDI :> _ *gateGuitar;
drums = highHat,
highHat2,
kick1,
kick2,
clap,
clap2
:> _ *gateDrums;
process =
synth, guitar, drums :> _;
|
fb565876149214f838c9b2d426cb68ab6c097a61ba9d464fc39ddeb838afcb42 | vqlion/Teensy-MIDI-synth | myDspFinal.dsp | import("stdfaust.lib");
osc(freq) = rdtable(tablesize, os.sinwaveform(tablesize), int(os.phasor(tablesize,freq)))
with{
tablesize = 1 << 15; // instead of 1 << 16
};
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 * osc((1 + pitchenv * 4) * pitch);
out = ma.tanh(clean * drive);
};
//those two redefinitions were required so the code actually fit on the teensy
freqSynth1 = hslider("freqSynth1", 440, 20, 5000, 0.1);
freqSynth2 = hslider("freqSynth2", 523.25, 20, 5000, 0.1);
freqSynth3 = hslider("freqSynth3", 349.2, 20, 5000, 0.1);
freqSynth4 = hslider("freqSynth4", 587.33, 20, 5000, 0.1);
freqSynth5 = hslider("freqSynth5", 587.33, 20, 5000, 0.1);
freqSynth6 = hslider("freqSynth6", 587.33, 20, 5000, 0.1);
freqSynthLoop1 = hslider("freqSynthLoop1", 587.33, 20, 5000, 0.1);
freqSynthLoop2 = hslider("freqSynthLoop2", 587.33, 20, 5000, 0.1);
freqSynthLoop3 = hslider("freqSynthLoop3", 587.33, 20, 5000, 0.1);
freqSynthLoop4 = hslider("freqSynthLoop4", 587.33, 20, 5000, 0.1);
freqSynthLoop5 = hslider("freqSynthLoop5", 587.33, 20, 5000, 0.1);
freqSynthLoop6 = hslider("freqSynthLoop6", 587.33, 20, 5000, 0.1);
gateSynth = checkbox("gateSynth");
gateGuitar = checkbox("gateGuitar");
gateDrums = checkbox("gateDrums");
gateSynth1 = checkbox("gateSynth1");
gateSynth2 = checkbox("gateSynth2");
gateSynth3 = checkbox("gateSynth3");
gateSynth4 = checkbox("gateSynth4");
gateSynth5 = checkbox("gateSynth5");
gateSynth6 = checkbox("gateSynth6");
gateSynthLoop1 = checkbox("gateSynthLoop1");
gateSynthLoop2 = checkbox("gateSynthLoop2");
gateSynthLoop3 = checkbox("gateSynthLoop3");
gateSynthLoop4 = checkbox("gateSynthLoop3");
gateSynthLoop5 = checkbox("gateSynthLoop3");
gateSynthLoop6 = checkbox("gateSynthLoop3");
gateDrums1 = checkbox("gateDrums1");
gateDrums2 = checkbox("gateDrums2");
gateDrums3 = checkbox("gateDrums3");
gateDrums4 = checkbox("gateDrums4");
gateDrums5 = checkbox("gateDrums5");
gateDrums6 = checkbox("gateDrums6");
gainSynth = hslider("gainSynth", 0.5, 0, 1, 0.01);
gainDrums = hslider("gainDrums", 0.5, 0, 1, 0.01);
gainGuitar = hslider("gainGuitar", 0.5, 0, 1, 0.01);
globalGain = hslider("globalGain", 1, 0, 2, 0.1);
pitch = hslider("pitch", 1, 0.5, 1.5, 0.1);
modFreq1 = hslider("modfreq1", 50, 0.1, 100, 0.1);
index1 = hslider("index1", 1, 0, 20, 1);
filter = hslider("filter", 0, 0, 1, 0.01);
filterFreq = hslider("filterFreq", 10, 5, 3000, 0.1);
lowP = fi.lowpass(2, filterFreq);
at = hslider("at", 0, 0, 1, 0.01);
dt = hslider("dt", 0, 0, 1, 0.01);
sl = hslider("sl", 0.5, 0, 1, 0.01);
rt = hslider("rt", 0, 0, 1, 0.01);
kickDecay = hslider("kickDecay", 0.2, 0.2, 1, 0.01);
kickClick = hslider("kickClick", 0.05, 0.005, 0.1, 0.001);
envelope(gate) = en.adsr(at,dt,sl,rt,gate);
highHat = sy.hat(2500, 10000, 0.05, 0.05, gateDrums1);
highHat2 = sy.hat(2500, 10000, 0.05, 0.05, gateDrums2);
kick1 = kick(40, kickClick, 0.001, kickDecay, 5, gateDrums3);
kick2 = kick(40, kickClick, 0.005, kickDecay, 5, gateDrums4);
clap = sy.clap(3500, 0.001, 0.05, gateDrums5);
clap2 = sy.clap(3500, 0.001, 0.05, gateDrums6);
synth = os.saw2ptr(freqSynth1*pitch+osc(modFreq1)*index1)*envelope(gateSynth1),
os.saw2ptr(freqSynth2*pitch+osc(modFreq1)*index1)*envelope(gateSynth2),
os.saw2ptr(freqSynth3*pitch+osc(modFreq1)*index1)*envelope(gateSynth3),
os.saw2ptr(freqSynth4*pitch+osc(modFreq1)*index1)*envelope(gateSynth4),
os.saw2ptr(freqSynth5*pitch+osc(modFreq1)*index1)*envelope(gateSynth5),
os.saw2ptr(freqSynth6*pitch+osc(modFreq1)*index1)*envelope(gateSynth6),
os.saw2ptr(freqSynthLoop1*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop1),
os.saw2ptr(freqSynthLoop2*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop2),
os.saw2ptr(freqSynthLoop3*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop3),
os.saw2ptr(freqSynthLoop4*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop4),
os.saw2ptr(freqSynthLoop5*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop5),
os.saw2ptr(freqSynthLoop6*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop6)
:> _ *gateSynth*gainSynth : lowP : _;
guitar = pm.ks_ui_MIDI :> _ *gateGuitar*gainGuitar : fi.lowpass(2, 400) : _;
drums = highHat,
highHat2,
kick1,
kick2,
clap,
clap2
:> _ *gateDrums*gainDrums;
process =
synth, guitar, drums :> _ * globalGain; | https://raw.githubusercontent.com/vqlion/Teensy-MIDI-synth/2bdeae824806c4e07259a5a444bcc3bc0953712e/myDspFinal.dsp | faust | instead of 1 << 16
those two redefinitions were required so the code actually fit on the teensy | import("stdfaust.lib");
osc(freq) = rdtable(tablesize, os.sinwaveform(tablesize), int(os.phasor(tablesize,freq)))
with{
};
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 * osc((1 + pitchenv * 4) * pitch);
out = ma.tanh(clean * drive);
};
freqSynth1 = hslider("freqSynth1", 440, 20, 5000, 0.1);
freqSynth2 = hslider("freqSynth2", 523.25, 20, 5000, 0.1);
freqSynth3 = hslider("freqSynth3", 349.2, 20, 5000, 0.1);
freqSynth4 = hslider("freqSynth4", 587.33, 20, 5000, 0.1);
freqSynth5 = hslider("freqSynth5", 587.33, 20, 5000, 0.1);
freqSynth6 = hslider("freqSynth6", 587.33, 20, 5000, 0.1);
freqSynthLoop1 = hslider("freqSynthLoop1", 587.33, 20, 5000, 0.1);
freqSynthLoop2 = hslider("freqSynthLoop2", 587.33, 20, 5000, 0.1);
freqSynthLoop3 = hslider("freqSynthLoop3", 587.33, 20, 5000, 0.1);
freqSynthLoop4 = hslider("freqSynthLoop4", 587.33, 20, 5000, 0.1);
freqSynthLoop5 = hslider("freqSynthLoop5", 587.33, 20, 5000, 0.1);
freqSynthLoop6 = hslider("freqSynthLoop6", 587.33, 20, 5000, 0.1);
gateSynth = checkbox("gateSynth");
gateGuitar = checkbox("gateGuitar");
gateDrums = checkbox("gateDrums");
gateSynth1 = checkbox("gateSynth1");
gateSynth2 = checkbox("gateSynth2");
gateSynth3 = checkbox("gateSynth3");
gateSynth4 = checkbox("gateSynth4");
gateSynth5 = checkbox("gateSynth5");
gateSynth6 = checkbox("gateSynth6");
gateSynthLoop1 = checkbox("gateSynthLoop1");
gateSynthLoop2 = checkbox("gateSynthLoop2");
gateSynthLoop3 = checkbox("gateSynthLoop3");
gateSynthLoop4 = checkbox("gateSynthLoop3");
gateSynthLoop5 = checkbox("gateSynthLoop3");
gateSynthLoop6 = checkbox("gateSynthLoop3");
gateDrums1 = checkbox("gateDrums1");
gateDrums2 = checkbox("gateDrums2");
gateDrums3 = checkbox("gateDrums3");
gateDrums4 = checkbox("gateDrums4");
gateDrums5 = checkbox("gateDrums5");
gateDrums6 = checkbox("gateDrums6");
gainSynth = hslider("gainSynth", 0.5, 0, 1, 0.01);
gainDrums = hslider("gainDrums", 0.5, 0, 1, 0.01);
gainGuitar = hslider("gainGuitar", 0.5, 0, 1, 0.01);
globalGain = hslider("globalGain", 1, 0, 2, 0.1);
pitch = hslider("pitch", 1, 0.5, 1.5, 0.1);
modFreq1 = hslider("modfreq1", 50, 0.1, 100, 0.1);
index1 = hslider("index1", 1, 0, 20, 1);
filter = hslider("filter", 0, 0, 1, 0.01);
filterFreq = hslider("filterFreq", 10, 5, 3000, 0.1);
lowP = fi.lowpass(2, filterFreq);
at = hslider("at", 0, 0, 1, 0.01);
dt = hslider("dt", 0, 0, 1, 0.01);
sl = hslider("sl", 0.5, 0, 1, 0.01);
rt = hslider("rt", 0, 0, 1, 0.01);
kickDecay = hslider("kickDecay", 0.2, 0.2, 1, 0.01);
kickClick = hslider("kickClick", 0.05, 0.005, 0.1, 0.001);
envelope(gate) = en.adsr(at,dt,sl,rt,gate);
highHat = sy.hat(2500, 10000, 0.05, 0.05, gateDrums1);
highHat2 = sy.hat(2500, 10000, 0.05, 0.05, gateDrums2);
kick1 = kick(40, kickClick, 0.001, kickDecay, 5, gateDrums3);
kick2 = kick(40, kickClick, 0.005, kickDecay, 5, gateDrums4);
clap = sy.clap(3500, 0.001, 0.05, gateDrums5);
clap2 = sy.clap(3500, 0.001, 0.05, gateDrums6);
synth = os.saw2ptr(freqSynth1*pitch+osc(modFreq1)*index1)*envelope(gateSynth1),
os.saw2ptr(freqSynth2*pitch+osc(modFreq1)*index1)*envelope(gateSynth2),
os.saw2ptr(freqSynth3*pitch+osc(modFreq1)*index1)*envelope(gateSynth3),
os.saw2ptr(freqSynth4*pitch+osc(modFreq1)*index1)*envelope(gateSynth4),
os.saw2ptr(freqSynth5*pitch+osc(modFreq1)*index1)*envelope(gateSynth5),
os.saw2ptr(freqSynth6*pitch+osc(modFreq1)*index1)*envelope(gateSynth6),
os.saw2ptr(freqSynthLoop1*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop1),
os.saw2ptr(freqSynthLoop2*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop2),
os.saw2ptr(freqSynthLoop3*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop3),
os.saw2ptr(freqSynthLoop4*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop4),
os.saw2ptr(freqSynthLoop5*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop5),
os.saw2ptr(freqSynthLoop6*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop6)
:> _ *gateSynth*gainSynth : lowP : _;
guitar = pm.ks_ui_MIDI :> _ *gateGuitar*gainGuitar : fi.lowpass(2, 400) : _;
drums = highHat,
highHat2,
kick1,
kick2,
clap,
clap2
:> _ *gateDrums*gainDrums;
process =
synth, guitar, drums :> _ * globalGain; |
16cd520e98a03e1f8b485f2c03dc75ab34a29c8d1f9d43baf6556fe3db05b81e | vqlion/Teensy-MIDI-synth | myDsp2.dsp | import("stdfaust.lib");
// freqs and gains definitions go here
osc(freq) = rdtable(tablesize, os.sinwaveform(tablesize), int(os.phasor(tablesize,freq)))
with{
tablesize = 1 << 15; // instead of 1 << 16
};
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 * osc((1 + pitchenv * 4) * pitch);
out = ma.tanh(clean * drive);
};
freqSynth1 = hslider("freqSynth1", 440, 20, 5000, 0.1);
freqSynth2 = hslider("freqSynth2", 523.25, 20, 5000, 0.1);
freqSynth3 = hslider("freqSynth3", 349.2, 20, 5000, 0.1);
freqSynth4 = hslider("freqSynth4", 587.33, 20, 5000, 0.1);
freqSynth5 = hslider("freqSynth5", 587.33, 20, 5000, 0.1);
freqSynth6 = hslider("freqSynth6", 587.33, 20, 5000, 0.1);
freqSynthLoop1 = hslider("freqSynthLoop1", 587.33, 20, 5000, 0.1);
freqSynthLoop2 = hslider("freqSynthLoop2", 587.33, 20, 5000, 0.1);
freqSynthLoop3 = hslider("freqSynthLoop3", 587.33, 20, 5000, 0.1);
freqSynthLoop4 = hslider("freqSynthLoop4", 587.33, 20, 5000, 0.1);
freqSynthLoop5 = hslider("freqSynthLoop5", 587.33, 20, 5000, 0.1);
freqSynthLoop6 = hslider("freqSynthLoop6", 587.33, 20, 5000, 0.1);
gateSynth = checkbox("gateSynth");
gateGuitar = checkbox("gateGuitar");
gateDrums = checkbox("gateDrums");
gateSynth1 = checkbox("gateSynth1");
gateSynth2 = checkbox("gateSynth2");
gateSynth3 = checkbox("gateSynth3");
gateSynth4 = checkbox("gateSynth4");
gateSynth5 = checkbox("gateSynth5");
gateSynth6 = checkbox("gateSynth6");
gateSynthLoop1 = checkbox("gateSynthLoop1");
gateSynthLoop2 = checkbox("gateSynthLoop2");
gateSynthLoop3 = checkbox("gateSynthLoop3");
gateSynthLoop4 = checkbox("gateSynthLoop3");
gateSynthLoop5 = checkbox("gateSynthLoop3");
gateSynthLoop6 = checkbox("gateSynthLoop3");
gateDrums1 = checkbox("gateDrums1");
gateDrums2 = checkbox("gateDrums2");
gateDrums3 = checkbox("gateDrums3");
gateDrums4 = checkbox("gateDrums4");
gateDrums5 = checkbox("gateDrums5");
gateDrums6 = checkbox("gateDrums6");
gainSynth = hslider("gainSynth", 0.5, 0, 1, 0.01);
gainDrums = hslider("gainDrums", 0.5, 0, 1, 0.01);
gainGuitar = hslider("gainGuitar", 0.5, 0, 1, 0.01);
pitch = hslider("pitch", 1, 0.5, 1.5, 0.1);
modFreq1 = hslider("modfreq1", 50, 0.1, 100, 0.1);
index1 = hslider("index1", 1, 0, 20, 1);
filter = hslider("filter", 0, 0, 1, 0.01);
filterFreq = hslider("filterFreq", 10, 5, 3000, 0.1);
lowP = fi.lowpass(2, filterFreq);
at = hslider("at", 0, 0, 1, 0.01);
dt = hslider("dt", 0, 0, 1, 0.01);
sl = hslider("sl", 0.5, 0, 1, 0.01);
rt = hslider("rt", 0, 0, 1, 0.01);
kickDecay = hslider("kickDecay", 0.2, 0.2, 1, 0.01);
kickClick = hslider("kickClick", 0.05, 0.005, 0.1, 0.001);
envelope(gate) = en.adsr(at,dt,sl,rt,gate);
highHat = sy.hat(2500, 10000, 0.05, 0.05, gateDrums1);
highHat2 = sy.hat(2500, 10000, 0.05, 0.05, gateDrums2);
kick1 = kick(40, kickClick, 0.001, kickDecay, 5, gateDrums3);
kick2 = kick(40, kickClick, 0.005, kickDecay, 5, gateDrums4);
clap = sy.clap(3500, 0.001, 0.05, gateDrums5);
clap2 = sy.clap(3500, 0.001, 0.05, gateDrums6);
//lowpass to add!
synth = os.saw2ptr(freqSynth1*pitch+osc(modFreq1)*index1)*envelope(gateSynth1),
os.saw2ptr(freqSynth2*pitch+osc(modFreq1)*index1)*envelope(gateSynth2),
os.saw2ptr(freqSynth3*pitch+osc(modFreq1)*index1)*envelope(gateSynth3),
os.saw2ptr(freqSynth4*pitch+osc(modFreq1)*index1)*envelope(gateSynth4),
os.saw2ptr(freqSynth5*pitch+osc(modFreq1)*index1)*envelope(gateSynth5),
os.saw2ptr(freqSynth6*pitch+osc(modFreq1)*index1)*envelope(gateSynth6),
os.saw2ptr(freqSynthLoop1*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop1),
os.saw2ptr(freqSynthLoop2*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop2),
os.saw2ptr(freqSynthLoop3*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop3),
os.saw2ptr(freqSynthLoop4*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop4),
os.saw2ptr(freqSynthLoop5*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop5),
os.saw2ptr(freqSynthLoop6*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop6)
:> _ *gateSynth*gainSynth : lowP : _;
guitar = pm.ks_ui_MIDI :> _ *gateGuitar*gainGuitar : fi.lowpass(2, 400) : _;
drums = highHat,
highHat2,
kick1,
kick2,
clap,
clap2
:> _ *gateDrums*gainDrums;
//process = polys0*(mode==0), polys1*(mode==1), polys2*(mode==2);
process =
synth, guitar, drums :> _;
effect = dm.zita_light; //multiple voices all go to the same effect line
| https://raw.githubusercontent.com/vqlion/Teensy-MIDI-synth/2bdeae824806c4e07259a5a444bcc3bc0953712e/archives/myDsp2.dsp | faust | freqs and gains definitions go here
instead of 1 << 16
lowpass to add!
process = polys0*(mode==0), polys1*(mode==1), polys2*(mode==2);
multiple voices all go to the same effect line | import("stdfaust.lib");
osc(freq) = rdtable(tablesize, os.sinwaveform(tablesize), int(os.phasor(tablesize,freq)))
with{
};
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 * osc((1 + pitchenv * 4) * pitch);
out = ma.tanh(clean * drive);
};
freqSynth1 = hslider("freqSynth1", 440, 20, 5000, 0.1);
freqSynth2 = hslider("freqSynth2", 523.25, 20, 5000, 0.1);
freqSynth3 = hslider("freqSynth3", 349.2, 20, 5000, 0.1);
freqSynth4 = hslider("freqSynth4", 587.33, 20, 5000, 0.1);
freqSynth5 = hslider("freqSynth5", 587.33, 20, 5000, 0.1);
freqSynth6 = hslider("freqSynth6", 587.33, 20, 5000, 0.1);
freqSynthLoop1 = hslider("freqSynthLoop1", 587.33, 20, 5000, 0.1);
freqSynthLoop2 = hslider("freqSynthLoop2", 587.33, 20, 5000, 0.1);
freqSynthLoop3 = hslider("freqSynthLoop3", 587.33, 20, 5000, 0.1);
freqSynthLoop4 = hslider("freqSynthLoop4", 587.33, 20, 5000, 0.1);
freqSynthLoop5 = hslider("freqSynthLoop5", 587.33, 20, 5000, 0.1);
freqSynthLoop6 = hslider("freqSynthLoop6", 587.33, 20, 5000, 0.1);
gateSynth = checkbox("gateSynth");
gateGuitar = checkbox("gateGuitar");
gateDrums = checkbox("gateDrums");
gateSynth1 = checkbox("gateSynth1");
gateSynth2 = checkbox("gateSynth2");
gateSynth3 = checkbox("gateSynth3");
gateSynth4 = checkbox("gateSynth4");
gateSynth5 = checkbox("gateSynth5");
gateSynth6 = checkbox("gateSynth6");
gateSynthLoop1 = checkbox("gateSynthLoop1");
gateSynthLoop2 = checkbox("gateSynthLoop2");
gateSynthLoop3 = checkbox("gateSynthLoop3");
gateSynthLoop4 = checkbox("gateSynthLoop3");
gateSynthLoop5 = checkbox("gateSynthLoop3");
gateSynthLoop6 = checkbox("gateSynthLoop3");
gateDrums1 = checkbox("gateDrums1");
gateDrums2 = checkbox("gateDrums2");
gateDrums3 = checkbox("gateDrums3");
gateDrums4 = checkbox("gateDrums4");
gateDrums5 = checkbox("gateDrums5");
gateDrums6 = checkbox("gateDrums6");
gainSynth = hslider("gainSynth", 0.5, 0, 1, 0.01);
gainDrums = hslider("gainDrums", 0.5, 0, 1, 0.01);
gainGuitar = hslider("gainGuitar", 0.5, 0, 1, 0.01);
pitch = hslider("pitch", 1, 0.5, 1.5, 0.1);
modFreq1 = hslider("modfreq1", 50, 0.1, 100, 0.1);
index1 = hslider("index1", 1, 0, 20, 1);
filter = hslider("filter", 0, 0, 1, 0.01);
filterFreq = hslider("filterFreq", 10, 5, 3000, 0.1);
lowP = fi.lowpass(2, filterFreq);
at = hslider("at", 0, 0, 1, 0.01);
dt = hslider("dt", 0, 0, 1, 0.01);
sl = hslider("sl", 0.5, 0, 1, 0.01);
rt = hslider("rt", 0, 0, 1, 0.01);
kickDecay = hslider("kickDecay", 0.2, 0.2, 1, 0.01);
kickClick = hslider("kickClick", 0.05, 0.005, 0.1, 0.001);
envelope(gate) = en.adsr(at,dt,sl,rt,gate);
highHat = sy.hat(2500, 10000, 0.05, 0.05, gateDrums1);
highHat2 = sy.hat(2500, 10000, 0.05, 0.05, gateDrums2);
kick1 = kick(40, kickClick, 0.001, kickDecay, 5, gateDrums3);
kick2 = kick(40, kickClick, 0.005, kickDecay, 5, gateDrums4);
clap = sy.clap(3500, 0.001, 0.05, gateDrums5);
clap2 = sy.clap(3500, 0.001, 0.05, gateDrums6);
synth = os.saw2ptr(freqSynth1*pitch+osc(modFreq1)*index1)*envelope(gateSynth1),
os.saw2ptr(freqSynth2*pitch+osc(modFreq1)*index1)*envelope(gateSynth2),
os.saw2ptr(freqSynth3*pitch+osc(modFreq1)*index1)*envelope(gateSynth3),
os.saw2ptr(freqSynth4*pitch+osc(modFreq1)*index1)*envelope(gateSynth4),
os.saw2ptr(freqSynth5*pitch+osc(modFreq1)*index1)*envelope(gateSynth5),
os.saw2ptr(freqSynth6*pitch+osc(modFreq1)*index1)*envelope(gateSynth6),
os.saw2ptr(freqSynthLoop1*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop1),
os.saw2ptr(freqSynthLoop2*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop2),
os.saw2ptr(freqSynthLoop3*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop3),
os.saw2ptr(freqSynthLoop4*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop4),
os.saw2ptr(freqSynthLoop5*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop5),
os.saw2ptr(freqSynthLoop6*pitch+osc(modFreq1)*index1)*envelope(gateSynthLoop6)
:> _ *gateSynth*gainSynth : lowP : _;
guitar = pm.ks_ui_MIDI :> _ *gateGuitar*gainGuitar : fi.lowpass(2, 400) : _;
drums = highHat,
highHat2,
kick1,
kick2,
clap,
clap2
:> _ *gateDrums*gainDrums;
process =
synth, guitar, drums :> _;
|
063b442cf7a74b320106a102a28d8e877dabfe5765e10f4245543f32dfefcd67 | grame-cncm/faustdoc | exfaust8.dsp |
//################################### elecGuitar.dsp #####################################
// Faust instruments specifically designed for faust2smartkeyb where an electric
// guitar physical model is controlled using an isomorphic keyboard. Rock on!
//
// ## SmartKeyboard Use Strategy
//
// we want to create an isomorphic keyboard where each keyboard is monophonic and
// implements a "string". Keyboards should be one fourth apart from each other
// (more or less like on a guitar). We want to be able to slide between keyboards
// (strum) to trigger a new note (voice) and we want new fingers on a keyboard to
// "steal" the pitch from the previous finger (sort of hammer on).
//
// ## 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 elecGuitarEffecr.dsp elecGuitar.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
//########################################################################################
// Interface with 6 monophonic keyboards one fourth apart from each other
declare interface "SmartKeyboard{
'Number of Keyboards':'6',
'Max Keyboard Polyphony':'1',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 4 - Number of Keys':'13',
'Keyboard 5 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'72',
'Keyboard 1 - Lowest Key':'67',
'Keyboard 2 - Lowest Key':'62',
'Keyboard 3 - Lowest Key':'57',
'Keyboard 4 - Lowest Key':'52',
'Keyboard 5 - Lowest Key':'47',
'Rounding Mode':'2'
}";
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");
// mapping params
gate = t+s : min(1);
freq = f*bend : max(50); // min freq is 50 Hz
stringLength = freq : pm.f2l;
pluckPosition = 0.8;
mute = gate : si.polySmooth(gate,0.999,1);
process = pm.elecGuitar(stringLength,pluckPosition,mute,gain,gate) <: _,_;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/b6ac76b628799dc1386e22495e4eeed313560d9a/docs/examples/smartKeyboard/exfaust8/exfaust8.dsp | faust | ################################### elecGuitar.dsp #####################################
Faust instruments specifically designed for faust2smartkeyb where an electric
guitar physical model is controlled using an isomorphic keyboard. Rock on!
## SmartKeyboard Use Strategy
we want to create an isomorphic keyboard where each keyboard is monophonic and
implements a "string". Keyboards should be one fourth apart from each other
(more or less like on a guitar). We want to be able to slide between keyboards
(strum) to trigger a new note (voice) and we want new fingers on a keyboard to
"steal" the pitch from the previous finger (sort of hammer on).
## 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 elecGuitarEffecr.dsp elecGuitar.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
########################################################################################
Interface with 6 monophonic keyboards one fourth apart from each other
standard parameters
for sustain pedal
mapping params
min freq is 50 Hz |
declare interface "SmartKeyboard{
'Number of Keyboards':'6',
'Max Keyboard Polyphony':'1',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 4 - Number of Keys':'13',
'Keyboard 5 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'72',
'Keyboard 1 - Lowest Key':'67',
'Keyboard 2 - Lowest Key':'62',
'Keyboard 3 - Lowest Key':'57',
'Keyboard 4 - Lowest Key':'52',
'Keyboard 5 - Lowest Key':'47',
'Rounding Mode':'2'
}";
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");
gate = t+s : min(1);
stringLength = freq : pm.f2l;
pluckPosition = 0.8;
mute = gate : si.polySmooth(gate,0.999,1);
process = pm.elecGuitar(stringLength,pluckPosition,mute,gain,gate) <: _,_;
|
fe1c3907694ea3944dddf6dc2fda3401870a324fbec3788b106562d6b7e888d7 | grame-cncm/faustdoc | exfaust0.dsp |
//############################### acGuitar.dsp #################################
// Faust instrument specifically designed for faust2smartkeyb where 6 virtual
// nylon strings can be strummed and plucked using a dedicated keyboard. The
// extra "strumming keyboard" could be easily replaced by an external strumming
// interface while the touch screen could keep being used to change the pitch
// of the strings.
//
// ## SmartKeyboard Use Strategy
//
// The first 6 keyboards implement each individual string of the instrument. A
// seventh keybaord is used a strumming/plucking interface. As mentionned
// previously, it could be easily replaced by an external interface.
//
// ## 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 acGuitar.dsp
//
//
// ## Version/Licence
//
// Version 0.0, Aug. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//##############################################################################
declare interface "SmartKeyboard{
'Number of Keyboards':'7',
'Max Keyboard Polyphony':'0',
'Rounding Mode':'2',
'Keyboard 0 - Number of Keys':'14',
'Keyboard 1 - Number of Keys':'14',
'Keyboard 2 - Number of Keys':'14',
'Keyboard 3 - Number of Keys':'14',
'Keyboard 4 - Number of Keys':'14',
'Keyboard 5 - Number of Keys':'14',
'Keyboard 6 - Number of Keys':'6',
'Keyboard 0 - Lowest Key':'52',
'Keyboard 1 - Lowest Key':'57',
'Keyboard 2 - Lowest Key':'62',
'Keyboard 3 - Lowest Key':'67',
'Keyboard 4 - Lowest Key':'71',
'Keyboard 5 - Lowest Key':'76',
'Keyboard 0 - Send Keyboard Freq':'1',
'Keyboard 1 - Send Keyboard Freq':'1',
'Keyboard 2 - Send Keyboard Freq':'1',
'Keyboard 3 - Send Keyboard Freq':'1',
'Keyboard 4 - Send Keyboard Freq':'1',
'Keyboard 5 - Send Keyboard Freq':'1',
'Keyboard 6 - Piano Keyboard':'0',
'Keyboard 6 - Send Key Status':'1',
'Keyboard 6 - Key 0 - Label':'S0',
'Keyboard 6 - Key 1 - Label':'S1',
'Keyboard 6 - Key 2 - Label':'S2',
'Keyboard 6 - Key 3 - Label':'S3',
'Keyboard 6 - Key 4 - Label':'S4',
'Keyboard 6 - Key 5 - Label':'S5'
}";
import("stdfaust.lib");
// SMARTKEYBOARD PARAMS
kbfreq(0) = hslider("kb0freq",164.8,20,10000,0.01);
kbbend(0) = hslider("kb0bend",1,ma.EPSILON,10,0.01);
kbfreq(1) = hslider("kb1freq",220,20,10000,0.01);
kbbend(1) = hslider("kb1bend",1,ma.EPSILON,10,0.01);
kbfreq(2) = hslider("kb2freq",293.7,20,10000,0.01);
kbbend(2) = hslider("kb2bend",1,ma.EPSILON,10,0.01);
kbfreq(3) = hslider("kb3freq",392,20,10000,0.01);
kbbend(3) = hslider("kb3bend",1,ma.EPSILON,10,0.01);
kbfreq(4) = hslider("kb4freq",493.9,20,10000,0.01);
kbbend(4) = hslider("kb4bend",1,ma.EPSILON,10,0.01);
kbfreq(5) = hslider("kb5freq",659.2,20,10000,0.01);
kbbend(5) = hslider("kb5bend",1,ma.EPSILON,10,0.01);
kb6kstatus(0) = hslider("kb6k0status",0,0,1,1) <: ==(1) | ==(4) : int;
kb6kstatus(1) = hslider("kb6k1status",0,0,1,1) <: ==(1) | ==(4) : int;
kb6kstatus(2) = hslider("kb6k2status",0,0,1,1) <: ==(1) | ==(4) : int;
kb6kstatus(3) = hslider("kb6k3status",0,0,1,1) <: ==(1) | ==(4) : int;
kb6kstatus(4) = hslider("kb6k4status",0,0,1,1) <: ==(1) | ==(4) : int;
kb6kstatus(5) = hslider("kb6k5status",0,0,1,1) <: ==(1) | ==(4) : int;
// MODEL PARAMETERS
// strings length
sl(i) = kbfreq(i)*kbbend(i) : pm.f2l : si.smoo;
// pluck position is controlled by the x axis of the accel
pluckPosition =
hslider("pluckPosition[acc: 1 0 -10 0 10]",0.5,0,1,0.01) : si.smoo;
// ASSEMBLING MODELS
// number of strings
nStrings = 6;
guitar = par(i,nStrings,
kb6kstatus(i) : ba.impulsify : // using "raw" impulses to drive the models
pm.nylonGuitarModel(sl(i),pluckPosition)) :> _;
process = guitar <: _,_;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/f2148f87872e3eb1098b39f1daf783ed513dc193/docs/examples/smartKeyboard/exfaust0/exfaust0.dsp | faust | ############################### acGuitar.dsp #################################
Faust instrument specifically designed for faust2smartkeyb where 6 virtual
nylon strings can be strummed and plucked using a dedicated keyboard. The
extra "strumming keyboard" could be easily replaced by an external strumming
interface while the touch screen could keep being used to change the pitch
of the strings.
## SmartKeyboard Use Strategy
The first 6 keyboards implement each individual string of the instrument. A
seventh keybaord is used a strumming/plucking interface. As mentionned
previously, it could be easily replaced by an external interface.
## 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 acGuitar.dsp
## Version/Licence
Version 0.0, Aug. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
##############################################################################
SMARTKEYBOARD PARAMS
MODEL PARAMETERS
strings length
pluck position is controlled by the x axis of the accel
ASSEMBLING MODELS
number of strings
using "raw" impulses to drive the models |
declare interface "SmartKeyboard{
'Number of Keyboards':'7',
'Max Keyboard Polyphony':'0',
'Rounding Mode':'2',
'Keyboard 0 - Number of Keys':'14',
'Keyboard 1 - Number of Keys':'14',
'Keyboard 2 - Number of Keys':'14',
'Keyboard 3 - Number of Keys':'14',
'Keyboard 4 - Number of Keys':'14',
'Keyboard 5 - Number of Keys':'14',
'Keyboard 6 - Number of Keys':'6',
'Keyboard 0 - Lowest Key':'52',
'Keyboard 1 - Lowest Key':'57',
'Keyboard 2 - Lowest Key':'62',
'Keyboard 3 - Lowest Key':'67',
'Keyboard 4 - Lowest Key':'71',
'Keyboard 5 - Lowest Key':'76',
'Keyboard 0 - Send Keyboard Freq':'1',
'Keyboard 1 - Send Keyboard Freq':'1',
'Keyboard 2 - Send Keyboard Freq':'1',
'Keyboard 3 - Send Keyboard Freq':'1',
'Keyboard 4 - Send Keyboard Freq':'1',
'Keyboard 5 - Send Keyboard Freq':'1',
'Keyboard 6 - Piano Keyboard':'0',
'Keyboard 6 - Send Key Status':'1',
'Keyboard 6 - Key 0 - Label':'S0',
'Keyboard 6 - Key 1 - Label':'S1',
'Keyboard 6 - Key 2 - Label':'S2',
'Keyboard 6 - Key 3 - Label':'S3',
'Keyboard 6 - Key 4 - Label':'S4',
'Keyboard 6 - Key 5 - Label':'S5'
}";
import("stdfaust.lib");
kbfreq(0) = hslider("kb0freq",164.8,20,10000,0.01);
kbbend(0) = hslider("kb0bend",1,ma.EPSILON,10,0.01);
kbfreq(1) = hslider("kb1freq",220,20,10000,0.01);
kbbend(1) = hslider("kb1bend",1,ma.EPSILON,10,0.01);
kbfreq(2) = hslider("kb2freq",293.7,20,10000,0.01);
kbbend(2) = hslider("kb2bend",1,ma.EPSILON,10,0.01);
kbfreq(3) = hslider("kb3freq",392,20,10000,0.01);
kbbend(3) = hslider("kb3bend",1,ma.EPSILON,10,0.01);
kbfreq(4) = hslider("kb4freq",493.9,20,10000,0.01);
kbbend(4) = hslider("kb4bend",1,ma.EPSILON,10,0.01);
kbfreq(5) = hslider("kb5freq",659.2,20,10000,0.01);
kbbend(5) = hslider("kb5bend",1,ma.EPSILON,10,0.01);
kb6kstatus(0) = hslider("kb6k0status",0,0,1,1) <: ==(1) | ==(4) : int;
kb6kstatus(1) = hslider("kb6k1status",0,0,1,1) <: ==(1) | ==(4) : int;
kb6kstatus(2) = hslider("kb6k2status",0,0,1,1) <: ==(1) | ==(4) : int;
kb6kstatus(3) = hslider("kb6k3status",0,0,1,1) <: ==(1) | ==(4) : int;
kb6kstatus(4) = hslider("kb6k4status",0,0,1,1) <: ==(1) | ==(4) : int;
kb6kstatus(5) = hslider("kb6k5status",0,0,1,1) <: ==(1) | ==(4) : int;
sl(i) = kbfreq(i)*kbbend(i) : pm.f2l : si.smoo;
pluckPosition =
hslider("pluckPosition[acc: 1 0 -10 0 10]",0.5,0,1,0.01) : si.smoo;
nStrings = 6;
guitar = par(i,nStrings,
pm.nylonGuitarModel(sl(i),pluckPosition)) :> _;
process = guitar <: _,_;
|
908f8f9ae50019d275284dbfee94473c18f3adb26c72c5c95838fe0ee8562240 | makingsoundmachines/Faust-on-Teensy | faustAdditive.dsp |
import("stdfaust.lib");
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Additive synthesizer (harmonic oscillator), originally for BELA, adapted for Teensy.
//
// Original project here:
// https://github.com/grame-cncm/faust/blob/master-dev/examples/bela/AdditiveSynth.dsp
//
// It has 8 harmonics, each with its own ADSR volume envelope.
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Parameters available in Arduino export:
//
// General Parameters - Gate, Pitch, Velocity
// gate : Note on or off
// freq : The fundametal pitch of the harmonic oscillator
// gain : The volume / velocity
//
// For each harmonic (%rang indicates harmonic number, starting at 0):
//
// vol%rang : Volume of harmonic - vol0 (fundamental), vol1 (first harmonic) .. vol7
// A%rang : Attack
// D%rang : Decay
// S%rang : Sustain
// R%rang : Release
//
// For the filter:
//
// ctFreq : center Frequency (cutoff)
// filterQ : quality of the filter
// filterGain : makeup gain
//
///////////////////////////////////////////////////////////////////////////////////////////////////
// Teensy Oscillator
// lowering the resolution of the sine oscillators' lookup table
// in order to make computation easier on the Teensy MCU and memory
oscTeensy(f) = rdtable(tablesize, os.sinwaveform(tablesize), int(os.phasor(tablesize,f)))
with{
tablesize = 1 << 15; // instead of 1 << 16
};
// gate, freq (pitch), gain parameters
gate = button("gate");
freq = hslider("freq[unit:Hz]", 440, 20, 20000, 1);
gain = hslider("gain", 0.5, 0, 10, 0.01);
// Filter Parameters
ctFreq = hslider("ctFreq",500,20,10000,0.01) : si.smoo;
filterQ = hslider("filterQ", 5, 0, 10, 1);
filterGain = hslider("filterGain",1,0,1,0.01) : si.smoo;
// Parameters for the harmonic oscillator
harmonic(rang) = oscTeensy(freq*(rang+1))*volume
with {
// UI
vol = hslider("vol%rang", 1, 0, 1, 0.001) : si.smooth(ba.tau2pole(0.01));
a = 0.01 * hslider("A%rang", 1, 0, 400, 0.001) : si.smoo;
d = 0.01 * hslider("D%rang", 1, 0, 400, 0.001) : si.smoo;
s = hslider("S%rang", 1, 0, 1, 0.001) : si.smoo;
r = 0.01 * hslider("R%rang", 1, 0, 800, 0.001) : si.smoo;
volume = ((en.adsr(a,d,s,r,gate))*vol) : max (0) : min (1);
};
process = par(i, 8, harmonic(i)) :> / (8) : fi.resonlp(ctFreq, filterQ, filterGain);
| https://raw.githubusercontent.com/makingsoundmachines/Faust-on-Teensy/c0c0cb23983005c47ca2f68e68e0f906c5fb5dbc/AdditiveSynth_Faust/faustAdditive.dsp | faust | /////////////////////////////////////////////////////////////////////////////////////////////////
Additive synthesizer (harmonic oscillator), originally for BELA, adapted for Teensy.
Original project here:
https://github.com/grame-cncm/faust/blob/master-dev/examples/bela/AdditiveSynth.dsp
It has 8 harmonics, each with its own ADSR volume envelope.
/////////////////////////////////////////////////////////////////////////////////////////////////
Parameters available in Arduino export:
General Parameters - Gate, Pitch, Velocity
gate : Note on or off
freq : The fundametal pitch of the harmonic oscillator
gain : The volume / velocity
For each harmonic (%rang indicates harmonic number, starting at 0):
vol%rang : Volume of harmonic - vol0 (fundamental), vol1 (first harmonic) .. vol7
A%rang : Attack
D%rang : Decay
S%rang : Sustain
R%rang : Release
For the filter:
ctFreq : center Frequency (cutoff)
filterQ : quality of the filter
filterGain : makeup gain
/////////////////////////////////////////////////////////////////////////////////////////////////
Teensy Oscillator
lowering the resolution of the sine oscillators' lookup table
in order to make computation easier on the Teensy MCU and memory
instead of 1 << 16
gate, freq (pitch), gain parameters
Filter Parameters
Parameters for the harmonic oscillator
UI |
import("stdfaust.lib");
oscTeensy(f) = rdtable(tablesize, os.sinwaveform(tablesize), int(os.phasor(tablesize,f)))
with{
};
gate = button("gate");
freq = hslider("freq[unit:Hz]", 440, 20, 20000, 1);
gain = hslider("gain", 0.5, 0, 10, 0.01);
ctFreq = hslider("ctFreq",500,20,10000,0.01) : si.smoo;
filterQ = hslider("filterQ", 5, 0, 10, 1);
filterGain = hslider("filterGain",1,0,1,0.01) : si.smoo;
harmonic(rang) = oscTeensy(freq*(rang+1))*volume
with {
vol = hslider("vol%rang", 1, 0, 1, 0.001) : si.smooth(ba.tau2pole(0.01));
a = 0.01 * hslider("A%rang", 1, 0, 400, 0.001) : si.smoo;
d = 0.01 * hslider("D%rang", 1, 0, 400, 0.001) : si.smoo;
s = hslider("S%rang", 1, 0, 1, 0.001) : si.smoo;
r = 0.01 * hslider("R%rang", 1, 0, 800, 0.001) : si.smoo;
volume = ((en.adsr(a,d,s,r,gate))*vol) : max (0) : min (1);
};
process = par(i, 8, harmonic(i)) :> / (8) : fi.resonlp(ctFreq, filterQ, filterGain);
|
37e71a2b0a05c9836b6e9364c0311e85b573f4b20e9c0096488d7c433658741d | grame-cncm/faustdoc | exfaust13.dsp |
//################################### multiSynth.dsp ######################################
// Faust instrument specifically designed for faust2smartkeyb where 4 keyboards
// are used to control 4 independent synths.
//
// ## SmartKeyboard Use Strategy
//
// The SmartKeyboard configuration is relatively simple for this example and
// only consists in four polyphonic keyboards in parallel. The keyboard standard
// parameter is used to activate specific elements of the synthesizer.
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with faust2smartkeyb. For best results,
// we recommend to use the following parameters to compile it:
//
//
// faust2smartkeyb [-ios/-android] -effect reverb.dsp multiSynth.dsp
//
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
// Interface with 4 polyphnic keyboards of 13 keys with the same config
declare interface "SmartKeyboard{
'Number of Keyboards':'4',
'Rounding Mode':'2',
'Inter-Keyboard Slide':'0',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'60',
'Keyboard 1 - Lowest Key':'60',
'Keyboard 2 - Lowest Key':'60',
'Keyboard 3 - Lowest Key':'60',
'Keyboard 0 - Send Y':'1',
'Keyboard 1 - Send Y':'1',
'Keyboard 2 - Send Y':'1',
'Keyboard 3 - Send Y':'1'
}";
import("stdfaust.lib");
// standard parameters
f = hslider("freq",300,50,2000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.001)) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
s = hslider("sustain[midi:ctrl 64]",0,0,1,1); // for sustain pedal
t = button("gate");
y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo;
keyboard = hslider("keyboard",0,0,3,1) : int;
// fomating parameters
gate = t+s : min(1);
freq = f*bend;
cutoff = y*4000+50;
// oscillators
oscilators(0) = os.sawtooth(freq);
oscilators(1) = os.triangle(freq);
oscilators(2) = os.square(freq);
oscilators(3) = os.osc(freq);
// oscs are selected in function of the current keyboard
synths = par(i,4,select2(keyboard == i,0,oscilators(i))) :> fi.lowpass(3,cutoff) : *(envelope)
with{
envelope = gate*gain : si.smoo;
};
process = synths <: _,_;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/examples/smartKeyboard/exfaust13/exfaust13.dsp | faust | ################################### multiSynth.dsp ######################################
Faust instrument specifically designed for faust2smartkeyb where 4 keyboards
are used to control 4 independent synths.
## SmartKeyboard Use Strategy
The SmartKeyboard configuration is relatively simple for this example and
only consists in four polyphonic keyboards in parallel. The keyboard standard
parameter is used to activate specific elements of the synthesizer.
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with faust2smartkeyb. For best results,
we recommend to use the following parameters to compile it:
faust2smartkeyb [-ios/-android] -effect reverb.dsp multiSynth.dsp
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
Interface with 4 polyphnic keyboards of 13 keys with the same config
standard parameters
for sustain pedal
fomating parameters
oscillators
oscs are selected in function of the current keyboard |
declare interface "SmartKeyboard{
'Number of Keyboards':'4',
'Rounding Mode':'2',
'Inter-Keyboard Slide':'0',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'60',
'Keyboard 1 - Lowest Key':'60',
'Keyboard 2 - Lowest Key':'60',
'Keyboard 3 - Lowest Key':'60',
'Keyboard 0 - Send Y':'1',
'Keyboard 1 - Send Y':'1',
'Keyboard 2 - Send Y':'1',
'Keyboard 3 - Send Y':'1'
}";
import("stdfaust.lib");
f = hslider("freq",300,50,2000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.001)) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
t = button("gate");
y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo;
keyboard = hslider("keyboard",0,0,3,1) : int;
gate = t+s : min(1);
freq = f*bend;
cutoff = y*4000+50;
oscilators(0) = os.sawtooth(freq);
oscilators(1) = os.triangle(freq);
oscilators(2) = os.square(freq);
oscilators(3) = os.osc(freq);
synths = par(i,4,select2(keyboard == i,0,oscilators(i))) :> fi.lowpass(3,cutoff) : *(envelope)
with{
envelope = gate*gain : si.smoo;
};
process = synths <: _,_;
|
1003ae3fee848b1105dd6e500037395e32493c01e8e88bc30691f411b4a131ed | grame-cncm/faustdoc | exfaust2.dsp |
//##################################### bowed.dsp ########################################
// Faust instrument specifically designed for faust2smartkeyb implementing a
// non-polyphonic synthesizer (e.g., physical model; etc.) using a combination of
// different types of UI elements.
//
// ## SmartKeyboard Use Strategy
//
// 5 keyboards are declared (4 actual keyboards and 1 control surface). We want to
// disable the voice allocation system and we want to activate a voice on start-up
// so that all strings are constantly running so we set Max Keyboard Polyphony to
// 0. Since we don't want the first 4 keyboards to send the X and Y position of
// fingers on the screen, we set Send X and Send Y to 0 for all these keyboards.
// Similarly, we don't want the fifth keyboard to send pitch information to the synth
// so we set Send Freq to 0 for that keyboard. Finally, we deactivate piano keyboard
// mode for the fifth keyboard to make sure that color doesn't change when the key is
// touch and that note names are not displayed.
//
// ## 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
//########################################################################################
declare interface "SmartKeyboard{
'Number of Keyboards':'5',
'Max Keyboard Polyphony':'0',
'Rounding Mode':'1',
'Keyboard 0 - Number of Keys':'19',
'Keyboard 1 - Number of Keys':'19',
'Keyboard 2 - Number of Keys':'19',
'Keyboard 3 - Number of Keys':'19',
'Keyboard 4 - Number of Keys':'1',
'Keyboard 4 - Send Freq':'0',
'Keyboard 0 - Send X':'0',
'Keyboard 1 - Send X':'0',
'Keyboard 2 - Send X':'0',
'Keyboard 3 - Send X':'0',
'Keyboard 0 - Send Y':'0',
'Keyboard 1 - Send Y':'0',
'Keyboard 2 - Send Y':'0',
'Keyboard 3 - Send Y':'0',
'Keyboard 0 - Lowest Key':'55',
'Keyboard 1 - Lowest Key':'62',
'Keyboard 2 - Lowest Key':'69',
'Keyboard 3 - Lowest Key':'76',
'Keyboard 4 - Piano Keyboard':'0',
'Keyboard 4 - Key 0 - Label':'Bow'
}";
import("stdfaust.lib");
// parameters
f = hslider("freq",400,50,2000,0.01);
bend = hslider("bend",1,0,10,0.01);
keyboard = hslider("keyboard",0,0,5,1) : int;
key = hslider("key",0,0,18,1) : int;
x = hslider("x",0.5,0,1,0.01) : si.smoo;
y = hslider("y",0,0,1,0.01) : si.smoo;
// mapping
freq = f*bend;
// dirty motion tracker
velocity = x-x' : abs : an.amp_follower_ar(0.1,1) : *(8000) : min(1);
// 4 "strings"
synthSet = par(i,4,synth(localFreq(i),velocity)) :> _
with{
localFreq(i) = freq : ba.sAndH(keyboard == i) : si.smoo;
synth(freq,velocity) = sy.fm((freq,freq + freq*modFreqRatio),index*velocity)*velocity
with{
index = 1000;
modFreqRatio = y*0.3;
};
};
process = synthSet <: _,_;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/examples/smartKeyboard/exfaust2/exfaust2.dsp | faust | ##################################### bowed.dsp ########################################
Faust instrument specifically designed for faust2smartkeyb implementing a
non-polyphonic synthesizer (e.g., physical model; etc.) using a combination of
different types of UI elements.
## SmartKeyboard Use Strategy
5 keyboards are declared (4 actual keyboards and 1 control surface). We want to
disable the voice allocation system and we want to activate a voice on start-up
so that all strings are constantly running so we set Max Keyboard Polyphony to
0. Since we don't want the first 4 keyboards to send the X and Y position of
fingers on the screen, we set Send X and Send Y to 0 for all these keyboards.
Similarly, we don't want the fifth keyboard to send pitch information to the synth
so we set Send Freq to 0 for that keyboard. Finally, we deactivate piano keyboard
mode for the fifth keyboard to make sure that color doesn't change when the key is
touch and that note names are not displayed.
## 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
########################################################################################
parameters
mapping
dirty motion tracker
4 "strings" |
declare interface "SmartKeyboard{
'Number of Keyboards':'5',
'Max Keyboard Polyphony':'0',
'Rounding Mode':'1',
'Keyboard 0 - Number of Keys':'19',
'Keyboard 1 - Number of Keys':'19',
'Keyboard 2 - Number of Keys':'19',
'Keyboard 3 - Number of Keys':'19',
'Keyboard 4 - Number of Keys':'1',
'Keyboard 4 - Send Freq':'0',
'Keyboard 0 - Send X':'0',
'Keyboard 1 - Send X':'0',
'Keyboard 2 - Send X':'0',
'Keyboard 3 - Send X':'0',
'Keyboard 0 - Send Y':'0',
'Keyboard 1 - Send Y':'0',
'Keyboard 2 - Send Y':'0',
'Keyboard 3 - Send Y':'0',
'Keyboard 0 - Lowest Key':'55',
'Keyboard 1 - Lowest Key':'62',
'Keyboard 2 - Lowest Key':'69',
'Keyboard 3 - Lowest Key':'76',
'Keyboard 4 - Piano Keyboard':'0',
'Keyboard 4 - Key 0 - Label':'Bow'
}";
import("stdfaust.lib");
f = hslider("freq",400,50,2000,0.01);
bend = hslider("bend",1,0,10,0.01);
keyboard = hslider("keyboard",0,0,5,1) : int;
key = hslider("key",0,0,18,1) : int;
x = hslider("x",0.5,0,1,0.01) : si.smoo;
y = hslider("y",0,0,1,0.01) : si.smoo;
freq = f*bend;
velocity = x-x' : abs : an.amp_follower_ar(0.1,1) : *(8000) : min(1);
synthSet = par(i,4,synth(localFreq(i),velocity)) :> _
with{
localFreq(i) = freq : ba.sAndH(keyboard == i) : si.smoo;
synth(freq,velocity) = sy.fm((freq,freq + freq*modFreqRatio),index*velocity)*velocity
with{
index = 1000;
modFreqRatio = y*0.3;
};
};
process = synthSet <: _,_;
|
423e4da6f79c782c436021b01003ee9079df4e09537ea5b07263ea3925acc590 | grame-cncm/faustdoc | exfaust16.dsp |
//################################### turenas.dsp ########################################
// A simple smart phone percussion based on an additive synthesizer.
//
// ## 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 (180), 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] turenas.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 "turenas";
import("stdfaust.lib");
//========================= Smart Keyboard Configuration =================================
// (10 keyboards with 18 keys each configured as a pitch matrix.
//========================================================================================
declare interface "SmartKeyboard{
'Number of Keyboards':'10',
'Keyboard 0 - Number of Keys':'18',
'Keyboard 1 - Number of Keys':'18',
'Keyboard 2 - Number of Keys':'18',
'Keyboard 3 - Number of Keys':'18',
'Keyboard 4 - Number of Keys':'18',
'Keyboard 5 - Number of Keys':'18',
'Keyboard 6 - Number of Keys':'18',
'Keyboard 7 - Number of Keys':'18',
'Keyboard 8 - Number of Keys':'18',
'Keyboard 9 - Number of Keys':'18',
'Keyboard 0 - Lowest Key':'50',
'Keyboard 1 - Lowest Key':'55',
'Keyboard 2 - Lowest Key':'60',
'Keyboard 3 - Lowest Key':'65',
'Keyboard 4 - Lowest Key':'70',
'Keyboard 5 - Lowest Key':'75',
'Keyboard 6 - Lowest Key':'80',
'Keyboard 7 - Lowest Key':'85',
'Keyboard 8 - Lowest Key':'90',
'Keyboard 9 - Lowest Key':'95',
'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',
'Keyboard 8 - Piano Keyboard':'0',
'Keyboard 9 - Piano Keyboard':'0',
'Keyboard 0 - Send X':'0',
'Keyboard 1 - Send X':'0',
'Keyboard 2 - Send X':'0',
'Keyboard 3 - Send X':'0',
'Keyboard 4 - Send X':'0',
'Keyboard 5 - Send X':'0',
'Keyboard 6 - Send X':'0',
'Keyboard 7 - Send X':'0',
'Keyboard 8 - Send X':'0',
'Keyboard 9 - Send X':'0'
}";
//================================ Instrument Parameters =================================
// Creates the connection between the synth and the mobile device
//========================================================================================
// SmartKeyboard Y parameter
y = hslider("y",0,0,1,0.01);
// Smart Keyboard frequency parameter
freq = hslider("freq",400,50,2000,0.01);
// SmartKeyboard gate parameter
gate = button("gate");
// mode resonance duration is controlled with the x axis of the accelerometer
res = hslider("res[acc: 0 0 -10 0 10]",2.5,0.01,5,0.01);
//=================================== Parameters Mapping =================================
//========================================================================================
// number of modes
nModes = 6;
// distance between each mode
maxModeSpread = 5;
modeSpread = y*maxModeSpread;
// computing modes frequency ratio
modeFreqRatios = par(i,nModes,1+(i+1)/nModes*modeSpread);
// computing modes gain
minModeGain = 0.3;
modeGains = par(i,nModes,1-(i+1)/(nModes*minModeGain));
// smoothed mode resonance
modeRes = res : si.smoo;
//============================================ DSP =======================================
//========================================================================================
process = sy.additiveDrum(freq,modeFreqRatios,modeGains,0.8,0.001,modeRes,gate)*0.05;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/examples/smartKeyboard/exfaust16/exfaust16.dsp | faust | ################################### turenas.dsp ########################################
A simple smart phone percussion based on an additive synthesizer.
## 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 (180), 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] turenas.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 =================================
(10 keyboards with 18 keys each configured as a pitch matrix.
========================================================================================
================================ Instrument Parameters =================================
Creates the connection between the synth and the mobile device
========================================================================================
SmartKeyboard Y parameter
Smart Keyboard frequency parameter
SmartKeyboard gate parameter
mode resonance duration is controlled with the x axis of the accelerometer
=================================== Parameters Mapping =================================
========================================================================================
number of modes
distance between each mode
computing modes frequency ratio
computing modes gain
smoothed mode resonance
============================================ DSP =======================================
======================================================================================== |
declare name "turenas";
import("stdfaust.lib");
declare interface "SmartKeyboard{
'Number of Keyboards':'10',
'Keyboard 0 - Number of Keys':'18',
'Keyboard 1 - Number of Keys':'18',
'Keyboard 2 - Number of Keys':'18',
'Keyboard 3 - Number of Keys':'18',
'Keyboard 4 - Number of Keys':'18',
'Keyboard 5 - Number of Keys':'18',
'Keyboard 6 - Number of Keys':'18',
'Keyboard 7 - Number of Keys':'18',
'Keyboard 8 - Number of Keys':'18',
'Keyboard 9 - Number of Keys':'18',
'Keyboard 0 - Lowest Key':'50',
'Keyboard 1 - Lowest Key':'55',
'Keyboard 2 - Lowest Key':'60',
'Keyboard 3 - Lowest Key':'65',
'Keyboard 4 - Lowest Key':'70',
'Keyboard 5 - Lowest Key':'75',
'Keyboard 6 - Lowest Key':'80',
'Keyboard 7 - Lowest Key':'85',
'Keyboard 8 - Lowest Key':'90',
'Keyboard 9 - Lowest Key':'95',
'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',
'Keyboard 8 - Piano Keyboard':'0',
'Keyboard 9 - Piano Keyboard':'0',
'Keyboard 0 - Send X':'0',
'Keyboard 1 - Send X':'0',
'Keyboard 2 - Send X':'0',
'Keyboard 3 - Send X':'0',
'Keyboard 4 - Send X':'0',
'Keyboard 5 - Send X':'0',
'Keyboard 6 - Send X':'0',
'Keyboard 7 - Send X':'0',
'Keyboard 8 - Send X':'0',
'Keyboard 9 - Send X':'0'
}";
y = hslider("y",0,0,1,0.01);
freq = hslider("freq",400,50,2000,0.01);
gate = button("gate");
res = hslider("res[acc: 0 0 -10 0 10]",2.5,0.01,5,0.01);
nModes = 6;
maxModeSpread = 5;
modeSpread = y*maxModeSpread;
modeFreqRatios = par(i,nModes,1+(i+1)/nModes*modeSpread);
minModeGain = 0.3;
modeGains = par(i,nModes,1-(i+1)/(nModes*minModeGain));
modeRes = res : si.smoo;
process = sy.additiveDrum(freq,modeFreqRatios,modeGains,0.8,0.001,modeRes,gate)*0.05;
|
fd03145943f91541f8b074f0591c533c7ebe5b4169ab5fee652a22200e9cd81a | grame-cncm/faustdoc | exfaust6.dsp |
//##################################### drums.dsp ########################################
// Faust instrument specifically designed for faust2smartkeyb where 3 drums can
// be controlled using pads. The X/Y postion of fingers is detected on each key
// and use to control the strike postion on the virtual membrane.
//
// ## SmartKeyboard Use Strategy
//
// The drum physical model used here is implemented to be generic so that its
// fundamental frequency can be changed for each voice. SmartKeyboard is used
// in polyphonic mode so each new strike on the interface corresponds to a new
// new voice.
//
// ## 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 drums.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 2 keyboards of 2 and 1 keys (3 pads)
// Static mode is used so that keys don't change color when touched
// Note labels are hidden
// Piano Keyboard mode is deactivated so all the keys look the same
declare interface "SmartKeyboard{
'Number of Keyboards':'2',
'Keyboard 0 - Number of Keys':'2',
'Keyboard 1 - Number of Keys':'1',
'Keyboard 0 - Static Mode':'1',
'Keyboard 1 - Static Mode':'1',
'Keyboard 0 - Send X':'1',
'Keyboard 0 - Send Y':'1',
'Keyboard 1 - Send X':'1',
'Keyboard 1 - Send Y':'1',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 1 - Piano Keyboard':'0',
'Keyboard 0 - Key 0 - Label':'High',
'Keyboard 0 - Key 1 - Label':'Mid',
'Keyboard 1 - Key 0 - Label':'Low'
}";
import("stdfaust.lib");
// standard parameters
gate = button("gate");
x = hslider("x",1,0,1,0.001);
y = hslider("y",1,0,1,0.001);
keyboard = hslider("keyboard",0,0,1,1) : int;
key = hslider("key",0,0,1,1) : int;
drumModel = pm.djembe(rootFreq,exPos,strikeSharpness,gain,gate)
with{
// frequency of the lowest drum
bFreq = 60;
// retrieving pad ID (0-2)
padID = 2-(keyboard*2+key);
// drum root freq is computed in function of pad number
rootFreq = bFreq*(padID+1);
// excitation position
exPos = min((x*2-1 : abs),(y*2-1 : abs));
strikeSharpness = 0.5;
gain = 2;
};
process = drumModel <: _,_;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/examples/smartKeyboard/exfaust6/exfaust6.dsp | faust | ##################################### drums.dsp ########################################
Faust instrument specifically designed for faust2smartkeyb where 3 drums can
be controlled using pads. The X/Y postion of fingers is detected on each key
and use to control the strike postion on the virtual membrane.
## SmartKeyboard Use Strategy
The drum physical model used here is implemented to be generic so that its
fundamental frequency can be changed for each voice. SmartKeyboard is used
in polyphonic mode so each new strike on the interface corresponds to a new
new voice.
## 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 drums.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 2 keyboards of 2 and 1 keys (3 pads)
Static mode is used so that keys don't change color when touched
Note labels are hidden
Piano Keyboard mode is deactivated so all the keys look the same
standard parameters
frequency of the lowest drum
retrieving pad ID (0-2)
drum root freq is computed in function of pad number
excitation position |
declare interface "SmartKeyboard{
'Number of Keyboards':'2',
'Keyboard 0 - Number of Keys':'2',
'Keyboard 1 - Number of Keys':'1',
'Keyboard 0 - Static Mode':'1',
'Keyboard 1 - Static Mode':'1',
'Keyboard 0 - Send X':'1',
'Keyboard 0 - Send Y':'1',
'Keyboard 1 - Send X':'1',
'Keyboard 1 - Send Y':'1',
'Keyboard 0 - Piano Keyboard':'0',
'Keyboard 1 - Piano Keyboard':'0',
'Keyboard 0 - Key 0 - Label':'High',
'Keyboard 0 - Key 1 - Label':'Mid',
'Keyboard 1 - Key 0 - Label':'Low'
}";
import("stdfaust.lib");
gate = button("gate");
x = hslider("x",1,0,1,0.001);
y = hslider("y",1,0,1,0.001);
keyboard = hslider("keyboard",0,0,1,1) : int;
key = hslider("key",0,0,1,1) : int;
drumModel = pm.djembe(rootFreq,exPos,strikeSharpness,gain,gate)
with{
bFreq = 60;
padID = 2-(keyboard*2+key);
rootFreq = bFreq*(padID+1);
exPos = min((x*2-1 : abs),(y*2-1 : abs));
strikeSharpness = 0.5;
gain = 2;
};
process = drumModel <: _,_;
|
5a45a16a43b65ebe174a165168e5ba31be351bc5da21f1254bfed623f311d366 | grame-cncm/faustdoc | exfaust5.dsp |
//################################### crazyGuiro.dsp #####################################
// A simple smart phone "Guiro" where the touch screen is used to drive the instrument and
// select its pitch and where the x and y axis of the accelerometer control the
// resonance properties of the instrument.
//
// ## 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. Also, it's interesting to notice that the freq parameter
// is not used here. Instead keyboard and key are used which allows us to easily
// make custom mappings.
//
// ## 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
//########################################################################################
import("stdfaust.lib");
//========================= Smart Keyboard Configuration =================================
// 8 keyboards, each has 16 keys, none of them display key names.
//========================================================================================
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 - 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 current keyboard
keyboard = hslider("keyboard",0,0,2,1);
// the current key of the current keyboard
key = hslider("key",0,0,2,1);
// the wet factor of the reverb
wet = hslider("wet[acc: 0 0 -10 0 10]",0,0,1,0.01);
// the resonance factor of the reverb
res = hslider("res[acc: 1 0 -10 0 10]",0.5,0,1,0.01);
// smart keyboard gate parameter
gate = button("gate");
//=================================== Parameters Mapping =================================
//========================================================================================
// the resonance frequency of each click of the Guiro changes in function of
// the selected keyboard and key on it
minKey = 50; // min key of lowest keyboard
keySkipKeyboard = 8; // key skip per keyboard
drumResFreq = (key+minKey)+(keyboard*keySkipKeyboard) : ba.midikey2hz;
reverbWet = wet : si.smoo;
reverbRes = wet : si.smoo;
// filter q
q = 8;
//============================================ DSP =======================================
//========================================================================================
reverb(wet,res) = _ <: *(1-wet),(*(wet) : re.mono_freeverb(res, 0.5, 0.5, 0)) :> _;
process = sy.popFilterDrum(drumResFreq,q,gate) : reverb(wet,res) <: _,_;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/examples/smartKeyboard/exfaust5/exfaust5.dsp | faust | ################################### crazyGuiro.dsp #####################################
A simple smart phone "Guiro" where the touch screen is used to drive the instrument and
select its pitch and where the x and y axis of the accelerometer control the
resonance properties of the instrument.
## 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. Also, it's interesting to notice that the freq parameter
is not used here. Instead keyboard and key are used which allows us to easily
make custom mappings.
## 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 =================================
8 keyboards, each has 16 keys, none of them display key names.
========================================================================================
================================ Instrument Parameters =================================
Creates the connection between the synth and the mobile device
========================================================================================
the current keyboard
the current key of the current keyboard
the wet factor of the reverb
the resonance factor of the reverb
smart keyboard gate parameter
=================================== Parameters Mapping =================================
========================================================================================
the resonance frequency of each click of the Guiro changes in function of
the selected keyboard and key on it
min key of lowest keyboard
key skip per keyboard
filter q
============================================ DSP =======================================
======================================================================================== |
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 - 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'
}";
keyboard = hslider("keyboard",0,0,2,1);
key = hslider("key",0,0,2,1);
wet = hslider("wet[acc: 0 0 -10 0 10]",0,0,1,0.01);
res = hslider("res[acc: 1 0 -10 0 10]",0.5,0,1,0.01);
gate = button("gate");
drumResFreq = (key+minKey)+(keyboard*keySkipKeyboard) : ba.midikey2hz;
reverbWet = wet : si.smoo;
reverbRes = wet : si.smoo;
q = 8;
reverb(wet,res) = _ <: *(1-wet),(*(wet) : re.mono_freeverb(res, 0.5, 0.5, 0)) :> _;
process = sy.popFilterDrum(drumResFreq,q,gate) : reverb(wet,res) <: _,_;
|
4beabe34babe79842511a6a2b84e2a8537cd5572bb869617e9fee6c3b292b792 | hpfmn/FaustTeensyGenerator | FaustInstrument.dsp | // FaustInstrument.dsp
//
// Example for FaustTeensyGenerator
// a simple subtractive synth with gyro and light control
//
// Johannes Wegener
import("stdfaust.lib");
import("noises.lib");
// input parameters with GUI elements
osc1G(x) = vgroup("Osc1", x);
osc2G(x) = vgroup("Osc2", x);
AmpEnv(x) = vgroup("AmpEnv", x);
PitchEnv(x) = vgroup("PitchEnv", x);
Filter(x) = vgroup("Filter", x);
light = nentry("lightSens[io: A10]",0, -1, 1, 0.1);
lightAmt = Filter(hslider("li2fc",0, 0, 2000, 100));
gyro = nentry("gyroSens[gyr: 1]",0, -1, 1, 0.1) : si.smoo;
gyroAmt = Filter(hslider("gy2fc",0, 0, 2000, 100));
freq = hslider("freq",100, 10, 1000, 0.001);
gain = hslider("gain", 1, 0, 1, 0.001) : si.smoo;
gate = hslider("gate",0, 0, 1, 0.001);
osc_sel1 = osc1G(hslider("osz1[style:menu{'Sine':0;'Triangle':1;'Saw':2;'Square':3;'Noise':4}]", 0, 0, 4, 1));
osc_sel2 = osc2G(hslider("osz2[style:menu{'Sine':0;'Triangle':1;'Saw':2;'Square':3;'Noise':4}]", 0, 0, 4, 1));
freq_offset1 = osc1G(hslider("foff1[fine:0.01][unit:Hz]", 0, -12, 12, 1));
freq_offset2 = osc2G(hslider("foff2[fine:0.01][unit:Hz]", 0, -12, 12, 1));
vol1 = osc1G(hslider("vol1",0.5, 0, 1.5, 0.1));
vol2 = osc2G(hslider("vol2",0.5, 0, 1.5, 0.1));
a = AmpEnv(hslider("attack[unit:s]", 0.01, 0, 5, 0.01));
d = AmpEnv(hslider("decay[unit:s]", 0.01, 0, 5, 0.01));
s = AmpEnv(hslider("sustain[unit:%]", 0.98, 0.001, 1, 0.01));
r = AmpEnv(hslider("release[unit:s]", 0.01, 0, 5, 0.01));
aPitch = PitchEnv(hslider("PiAtt[unit:s]", 0.01, 0, 5, 0.01));
dPitch = PitchEnv(hslider("PiDec[unit:s]", 0.01, 0, 5, 0.01));
sPitch = PitchEnv(hslider("PiSus[unit:%]", 0.98, 0.001, 1, 0.01));
rPitch = PitchEnv(hslider("PiRe[unit:s]", 0.01, 0, 5, 0.01));
amtPitch = PitchEnv(hslider("PiAmt[unit:Hz]", 0, 0, 2000, 100));
multiplier1 = 2^(freq_offset1/12);
freq1 = (multiplier1*freq)+(amtPitch*(gate : en.adsr(aPitch,dPitch,sPitch,rPitch)));
saw = os.sawtooth(freq1);
sine = os.osc(freq1);
square = os.square(freq1);
triangle = os.triangle(freq1);
multiplier2 = 2^(freq_offset2/12);
freq2 = (multiplier2*freq)+(amtPitch*(gate : en.adsr(aPitch,dPitch,sPitch,rPitch)));
saw2 = os.sawtooth(freq2);
sine2 = os.osc(freq2);
square2 = os.square(freq2);
triangle2 = os.triangle(freq2);
out_of_osc = sine, triangle, saw, square, noise : ba.selectn(5, osc_sel1) : *(vol1);
out_of_osc2 = sine2, triangle2, saw2, square2, noise : ba.selectn(5, osc_sel2) : *(vol2);
fc = Filter(hslider("FilterFreq[fine:10][unit:Hz]", 8000, 0, 20000, 1000))+(lightAmt*light)+(gyroAmt*gyro);
q = Filter(hslider("Q[fine:0.01]", 2, 0, 50, 1));
fgain = Filter(hslider("FilterGain", 0.2, 0, 1, 0.01));
// fb1 = hslider("feedback1",0.67,0,1,0.01);
// fb2 = hslider("feedback2",0.58,0,1,0.01);
// damp = hslider("damp",0.8,0,1,0.01);
// spread = hslider("spread",0,0,100,1);
// dry = hslider("dry_wet", 0.8, 0,1,0.01);
// reverb = *(dry), (re.mono_freeverb(fb1, fb2, damp, spread) : *(1-dry));
// process = out_of_osc, out_of_osc2 :> fi.resonlp(fc+freq, q, fgain) * (gate : en.adsr(a,d,s,r)) <: reverb :> *(gain);
process = out_of_osc, out_of_osc2 :> fi.resonlp(fc+freq, q, fgain) * (gate : en.adsr(a,d,s,r)) : *(gain);
| https://raw.githubusercontent.com/hpfmn/FaustTeensyGenerator/973e146497d560e30f108d682f5efbfbb488c09f/FaustInstrument.dsp | faust | FaustInstrument.dsp
Example for FaustTeensyGenerator
a simple subtractive synth with gyro and light control
Johannes Wegener
input parameters with GUI elements
fb1 = hslider("feedback1",0.67,0,1,0.01);
fb2 = hslider("feedback2",0.58,0,1,0.01);
damp = hslider("damp",0.8,0,1,0.01);
spread = hslider("spread",0,0,100,1);
dry = hslider("dry_wet", 0.8, 0,1,0.01);
reverb = *(dry), (re.mono_freeverb(fb1, fb2, damp, spread) : *(1-dry));
process = out_of_osc, out_of_osc2 :> fi.resonlp(fc+freq, q, fgain) * (gate : en.adsr(a,d,s,r)) <: reverb :> *(gain); |
import("stdfaust.lib");
import("noises.lib");
osc1G(x) = vgroup("Osc1", x);
osc2G(x) = vgroup("Osc2", x);
AmpEnv(x) = vgroup("AmpEnv", x);
PitchEnv(x) = vgroup("PitchEnv", x);
Filter(x) = vgroup("Filter", x);
light = nentry("lightSens[io: A10]",0, -1, 1, 0.1);
lightAmt = Filter(hslider("li2fc",0, 0, 2000, 100));
gyro = nentry("gyroSens[gyr: 1]",0, -1, 1, 0.1) : si.smoo;
gyroAmt = Filter(hslider("gy2fc",0, 0, 2000, 100));
freq = hslider("freq",100, 10, 1000, 0.001);
gain = hslider("gain", 1, 0, 1, 0.001) : si.smoo;
gate = hslider("gate",0, 0, 1, 0.001);
osc_sel1 = osc1G(hslider("osz1[style:menu{'Sine':0;'Triangle':1;'Saw':2;'Square':3;'Noise':4}]", 0, 0, 4, 1));
osc_sel2 = osc2G(hslider("osz2[style:menu{'Sine':0;'Triangle':1;'Saw':2;'Square':3;'Noise':4}]", 0, 0, 4, 1));
freq_offset1 = osc1G(hslider("foff1[fine:0.01][unit:Hz]", 0, -12, 12, 1));
freq_offset2 = osc2G(hslider("foff2[fine:0.01][unit:Hz]", 0, -12, 12, 1));
vol1 = osc1G(hslider("vol1",0.5, 0, 1.5, 0.1));
vol2 = osc2G(hslider("vol2",0.5, 0, 1.5, 0.1));
a = AmpEnv(hslider("attack[unit:s]", 0.01, 0, 5, 0.01));
d = AmpEnv(hslider("decay[unit:s]", 0.01, 0, 5, 0.01));
s = AmpEnv(hslider("sustain[unit:%]", 0.98, 0.001, 1, 0.01));
r = AmpEnv(hslider("release[unit:s]", 0.01, 0, 5, 0.01));
aPitch = PitchEnv(hslider("PiAtt[unit:s]", 0.01, 0, 5, 0.01));
dPitch = PitchEnv(hslider("PiDec[unit:s]", 0.01, 0, 5, 0.01));
sPitch = PitchEnv(hslider("PiSus[unit:%]", 0.98, 0.001, 1, 0.01));
rPitch = PitchEnv(hslider("PiRe[unit:s]", 0.01, 0, 5, 0.01));
amtPitch = PitchEnv(hslider("PiAmt[unit:Hz]", 0, 0, 2000, 100));
multiplier1 = 2^(freq_offset1/12);
freq1 = (multiplier1*freq)+(amtPitch*(gate : en.adsr(aPitch,dPitch,sPitch,rPitch)));
saw = os.sawtooth(freq1);
sine = os.osc(freq1);
square = os.square(freq1);
triangle = os.triangle(freq1);
multiplier2 = 2^(freq_offset2/12);
freq2 = (multiplier2*freq)+(amtPitch*(gate : en.adsr(aPitch,dPitch,sPitch,rPitch)));
saw2 = os.sawtooth(freq2);
sine2 = os.osc(freq2);
square2 = os.square(freq2);
triangle2 = os.triangle(freq2);
out_of_osc = sine, triangle, saw, square, noise : ba.selectn(5, osc_sel1) : *(vol1);
out_of_osc2 = sine2, triangle2, saw2, square2, noise : ba.selectn(5, osc_sel2) : *(vol2);
fc = Filter(hslider("FilterFreq[fine:10][unit:Hz]", 8000, 0, 20000, 1000))+(lightAmt*light)+(gyroAmt*gyro);
q = Filter(hslider("Q[fine:0.01]", 2, 0, 50, 1));
fgain = Filter(hslider("FilterGain", 0.2, 0, 1, 0.01));
process = out_of_osc, out_of_osc2 :> fi.resonlp(fc+freq, q, fgain) * (gate : en.adsr(a,d,s,r)) : *(gain);
|
cba4020c68c3a0116cfaa9d80d4b9644239f691ff5961ee8ddd2019b7b01c662 | orchidas/Music-256A | synth.dsp | //Subtractive synthesis - sawtooth + square wave is passed through ADSR envelope and a
//butterworth lowpass filter
import("stdfaust.lib");
freqsaw = hslider("frequency", 440, 50, 2000, 0.1) : si.smoo; //create frequency slider and smooth it
freqsqr = hslider("frequency", 218, 50, 2000, 0.1) : si.smoo;
cutoff = hslider("cutoff", 2000, 500, 20000, 50) : si.smoo;
gain = hslider("gain" , 0.5,0,0.5,0.01) : si.smoo;
gate = button("gate");
saw = hgroup("saw", os.sawtooth(freqsaw) * gain);
sqr = hgroup("sqr", os.square(freqsqr) * gain);
process = hgroup("sub_synth", (saw + sqr) * env : lpf)
with{
env = hgroup("env",en.adsr(0.01,0.3,50,0.2, gate));
lpf = hgroup("lpf", fi.lowpass(5,cutoff));
};
| https://raw.githubusercontent.com/orchidas/Music-256A/46c465a3f004a00723088f918106a854af863d08/MySynth/Source/faust/synth.dsp | faust | Subtractive synthesis - sawtooth + square wave is passed through ADSR envelope and a
butterworth lowpass filter
create frequency slider and smooth it |
import("stdfaust.lib");
freqsqr = hslider("frequency", 218, 50, 2000, 0.1) : si.smoo;
cutoff = hslider("cutoff", 2000, 500, 20000, 50) : si.smoo;
gain = hslider("gain" , 0.5,0,0.5,0.01) : si.smoo;
gate = button("gate");
saw = hgroup("saw", os.sawtooth(freqsaw) * gain);
sqr = hgroup("sqr", os.square(freqsqr) * gain);
process = hgroup("sub_synth", (saw + sqr) * env : lpf)
with{
env = hgroup("env",en.adsr(0.01,0.3,50,0.2, gate));
lpf = hgroup("lpf", fi.lowpass(5,cutoff));
};
|
115a5502e3868ea53b39782a2de0c5d7bf858630185f9c915aaa6d1a1eef3b93 | grame-cncm/faustdoc | exfaust34.dsp |
import("stdfaust.lib");
// Approximation of a sawtooth wave using additive synthesis
sawtooth(f) = 2/ma.PI*sum(k, 4, (-1)^k * os.osc((k+1)*f)/(k+1));
process = sawtooth(55);
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/workshops/2020-04-10-faust-101/exfaust34/exfaust34.dsp | faust | Approximation of a sawtooth wave using additive synthesis |
import("stdfaust.lib");
sawtooth(f) = 2/ma.PI*sum(k, 4, (-1)^k * os.osc((k+1)*f)/(k+1));
process = sawtooth(55);
|
173ba7285eb3932f0cfa8ef7dc43b8a0debf3002e29fd55371c6ba85682a9b3c | OceanSwift/Faust-Course-Examples | Filter-Tremolo-Example.dsp | import("stdfaust.lib");
waveGenerator = hgroup("[0]Wave Generator",no.noise,os.triangle(freq),os.square(freq),os.sawtooth(freq) : ba.selectn(4,wave))
with{
wave = nentry("[0]Waveform",3,0,3,1);
freq = hslider("[1]freq",440,50,2000,0.01);
};
subtractive = waveGenerator : hgroup("[1]Filter",fi.resonbp(resFreq,q,1))
with{
ctFreq = hslider("[0]Cutoff Frequency[style:knob]",2000,50,10000,0.1) : si.smoo;
q = hslider("[1]Q[style:knob]",5,1,30,0.1);
lfoFreq = hslider("[2]Rate[style:knob]",10,0.1,20,0.01);
lfoDepth = hslider("[3]Depth[style:knob]",0,0,10000,1);
resFreq = os.osc(lfoFreq)*lfoDepth + ctFreq : max(30);
};
envelope = hgroup("[2]Envelope",en.adsr(attack,decay,sustain,release,gate)*tremolo*0.3)
with{
attack = hslider("[0]Attack[style:knob]",50,1,1000,1)*0.001;
decay = hslider("[1]Decay[style:knob]",50,1,1000,1)*0.001;
sustain = hslider("[2]Sustain[style:knob]",0.8,0.01,1,1);
release = hslider("[3]Release[style:knob]",50,1,1000,1)*0.001;
gain = hslider("[4]gain[style:knob]",1,0,1,0.01);
gate = button("[5]gate");
tremlfoFreq = hslider("[6]Tremolo Rate[style:knob]",10,0.1,20,0.01);
tremlfoDepth = hslider("[7]Tremolo Depth[style:knob]",0,0,1,0.01);
tremolo = (os.osc(tremlfoFreq)*tremlfoDepth) + gain;
};
process = vgroup("Subtractive Synthesizer",subtractive*envelope); | https://raw.githubusercontent.com/OceanSwift/Faust-Course-Examples/c3c779ab8257fae9563de4bc09ee71c5346bb1cd/Filter-Tremolo-Example.dsp | faust | import("stdfaust.lib");
waveGenerator = hgroup("[0]Wave Generator",no.noise,os.triangle(freq),os.square(freq),os.sawtooth(freq) : ba.selectn(4,wave))
with{
wave = nentry("[0]Waveform",3,0,3,1);
freq = hslider("[1]freq",440,50,2000,0.01);
};
subtractive = waveGenerator : hgroup("[1]Filter",fi.resonbp(resFreq,q,1))
with{
ctFreq = hslider("[0]Cutoff Frequency[style:knob]",2000,50,10000,0.1) : si.smoo;
q = hslider("[1]Q[style:knob]",5,1,30,0.1);
lfoFreq = hslider("[2]Rate[style:knob]",10,0.1,20,0.01);
lfoDepth = hslider("[3]Depth[style:knob]",0,0,10000,1);
resFreq = os.osc(lfoFreq)*lfoDepth + ctFreq : max(30);
};
envelope = hgroup("[2]Envelope",en.adsr(attack,decay,sustain,release,gate)*tremolo*0.3)
with{
attack = hslider("[0]Attack[style:knob]",50,1,1000,1)*0.001;
decay = hslider("[1]Decay[style:knob]",50,1,1000,1)*0.001;
sustain = hslider("[2]Sustain[style:knob]",0.8,0.01,1,1);
release = hslider("[3]Release[style:knob]",50,1,1000,1)*0.001;
gain = hslider("[4]gain[style:knob]",1,0,1,0.01);
gate = button("[5]gate");
tremlfoFreq = hslider("[6]Tremolo Rate[style:knob]",10,0.1,20,0.01);
tremlfoDepth = hslider("[7]Tremolo Depth[style:knob]",0,0,1,0.01);
tremolo = (os.osc(tremlfoFreq)*tremlfoDepth) + gain;
};
process = vgroup("Subtractive Synthesizer",subtractive*envelope); |
|
551cf71193bccbab308fdb9bfcc3e28abc72e284891d2987ea890af44fa0c98a | grame-cncm/faustdoc | exfaust2.dsp |
import("stdfaust.lib");
decimalpart(x) = x-int(x);
phase(f) = f/ma.SR : (+ : decimalpart) ~ _;
sawtooth(f) = phase(f) * 2 - 1;
process = sawtooth(440);
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/workshops/2020-03-24-faust-citi/exfaust2/exfaust2.dsp | faust |
import("stdfaust.lib");
decimalpart(x) = x-int(x);
phase(f) = f/ma.SR : (+ : decimalpart) ~ _;
sawtooth(f) = phase(f) * 2 - 1;
process = sawtooth(440);
|
|
14a4045fb8c8be0940a4182acfc5933b599a20e66ece7294c81732c9f369b5fd | grame-cncm/faustdoc | exfaust115.dsp |
import("stdfaust.lib");
s = vslider("Signal[style:menu{'Noise':0;'Sawtooth':1}]",0,0,1,1);
process = select2(s,no.noise,os.sawtooth(440));
| https://raw.githubusercontent.com/grame-cncm/faustdoc/515c59ce7c4e390d3cf0fc518cd0d9f3ef7be262/docs/manual/syntax/exfaust115/exfaust115.dsp | faust |
import("stdfaust.lib");
s = vslider("Signal[style:menu{'Noise':0;'Sawtooth':1}]",0,0,1,1);
process = select2(s,no.noise,os.sawtooth(440));
|
|
e5b26031c2eb907af2280c2dbfb289a8337269107efe1ff24e44610d90d201f4 | grame-cncm/faustdoc | exfaust116.dsp |
import("stdfaust.lib");
s = vslider("Signal[style:radio{'Noise':0;'Sawtooth':1}]",0,0,1,1);
process = select2(s,no.noise,os.sawtooth(440));
| https://raw.githubusercontent.com/grame-cncm/faustdoc/515c59ce7c4e390d3cf0fc518cd0d9f3ef7be262/docs/manual/syntax/exfaust116/exfaust116.dsp | faust |
import("stdfaust.lib");
s = vslider("Signal[style:radio{'Noise':0;'Sawtooth':1}]",0,0,1,1);
process = select2(s,no.noise,os.sawtooth(440));
|
|
14614a37b3757296ecd107cc530ebf7ce0a7494ce6f5886625a62a9a4608afa3 | grame-cncm/faustdoc | exfaust35.dsp |
import("stdfaust.lib");
decimalpart(x) = x-int(x);
phase(f) = f/ma.SR : (+ : decimalpart) ~ _;
sawtooth(f) = phase(f) * 2 - 1;
//process = sawtooth(440);
process = os.sawN(3,400);
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/workshops/2020-04-10-faust-101/exfaust35/exfaust35.dsp | faust | process = sawtooth(440); |
import("stdfaust.lib");
decimalpart(x) = x-int(x);
phase(f) = f/ma.SR : (+ : decimalpart) ~ _;
sawtooth(f) = phase(f) * 2 - 1;
process = os.sawN(3,400);
|
112e64777f3643f640ff5738eab15a4c2ce0c17dcac981a1db0d044577b16bd4 | grame-cncm/faustdoc | exfaust6.dsp |
import("stdfaust.lib");
inst = nentry("Instrument[midi:pgm]",0,0,3,1) : int;
process = (os.sawtooth(400),os.osc(400),os.sawtooth(600),os.osc(600)) : ba.selectn(4,inst);
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/manual/midi/exfaust6/exfaust6.dsp | faust |
import("stdfaust.lib");
inst = nentry("Instrument[midi:pgm]",0,0,3,1) : int;
process = (os.sawtooth(400),os.osc(400),os.sawtooth(600),os.osc(600)) : ba.selectn(4,inst);
|
|
0cb0318005a0a7c0a26a8765b9b229b63d33a2f296f9e90874a9d5895cded994 | grame-cncm/faustdoc | exfaust113.dsp |
import("stdfaust.lib");
freqS = vslider("[0]freq",440,50,1000,0.1);
gainS = vslider("[1]gain",0,0,1,0.01);
freqT = vslider("[0]freq",440,50,1000,0.1);
gainT = vslider("[1]gain",0,0,1,0.01);
process = hgroup("Oscillators",
hgroup("[0]Sawtooth",os.sawtooth(freqS)*gainS) +
hgroup("[1]Triangle",os.triangle(freqT)*gainT)
);
| https://raw.githubusercontent.com/grame-cncm/faustdoc/515c59ce7c4e390d3cf0fc518cd0d9f3ef7be262/docs/manual/syntax/exfaust113/exfaust113.dsp | faust |
import("stdfaust.lib");
freqS = vslider("[0]freq",440,50,1000,0.1);
gainS = vslider("[1]gain",0,0,1,0.01);
freqT = vslider("[0]freq",440,50,1000,0.1);
gainT = vslider("[1]gain",0,0,1,0.01);
process = hgroup("Oscillators",
hgroup("[0]Sawtooth",os.sawtooth(freqS)*gainS) +
hgroup("[1]Triangle",os.triangle(freqT)*gainT)
);
|
|
b656715a2adbacb00f044c459c7acb883b4f2b087232c0ea8cdf66e31e6146ef | OceanSwift/Faust-Course-Examples | Filter Series n FX Example.dsp | import("stdfaust.lib");
waveGenerator = hgroup("[0]Wave Generator",no.noise,os.triangle(freq),os.square(freq),os.sawtooth(freq) : ba.selectn(4,wave))
with{
wave = nentry("[0]Waveform",3,0,3,1);
freq = hslider("[1]freq",440,50,2000,0.01);
};
peakFilters = hgroup("[1]Peak EQ Filters",seq(i,2,myFilters(i)))
with{
myFilters(i) = fi.peak_eq(boost,peakFreq,bw)
with{
boost = hslider("[0]Boost%i[style:knob]",0,-20,20,0.1);
peak = hslider("[1]Peak%i[style:knob]",50,50,10000,0.1);
bw = hslider("[2]Q%i[style:knob]",100,10,1000,1);
peakRate = hslider("[3]LFO Freq%i",10,0.1,20,0.01);
peakMod = hslider("[4]LFO Mod%i",0,0,10000,1);
peakFreq = os.osc(peakRate)*peakMod + peak: max(30);
};
};
subtractive = waveGenerator : peakFilters : hgroup("[2]Main Filter",fi.resonlp(resFreq,q,1))
with{
ctFreq = hslider("[0]Cutoff Frequency[style:knob]",2000,50,10000,0.1) : si.smoo;
q = hslider("[1]Q[style:knob]",5,1,30,0.1);
lfoFreq = hslider("[2]Rate[style:knob]",10,0.1,20,0.01);
lfoDepth = hslider("[3]Depth[style:knob]",0,0,10000,1);
resFreq = os.osc(lfoFreq)*lfoDepth + ctFreq : max(30);
};
envelope = hgroup("[2]Envelope",en.adsr(attack,decay,sustain,release,gate)*tremolo*0.3)
with{
attack = hslider("[0]Attack[style:knob]",50,1,1000,1)*0.001;
decay = hslider("[1]Decay[style:knob]",50,1,1000,1)*0.001;
sustain = hslider("[2]Sustain[style:knob]",0.8,0.01,1,1);
release = hslider("[3]Release[style:knob]",50,1,1000,1)*0.001;
gain = hslider("[4]gain[style:knob]",1,0,1,0.01);
gate = button("[5]gate");
tremlfoFreq = hslider("[6]Tremolo Rate[style:knob]",10,0.1,20,0.01);
tremlfoDepth = hslider("[7]Tremolo Depth[style:knob]",0,0,1,0.01);
tremolo = (os.osc(tremlfoFreq)*tremlfoDepth) + gain;
};
process = vgroup("Subtractive Synthesizer",subtractive*envelope);
effect = dm.phaser2_demo : dm.freeverb_demo; | https://raw.githubusercontent.com/OceanSwift/Faust-Course-Examples/c3c779ab8257fae9563de4bc09ee71c5346bb1cd/Filter%20Series%20n%20FX%20Example.dsp | faust | import("stdfaust.lib");
waveGenerator = hgroup("[0]Wave Generator",no.noise,os.triangle(freq),os.square(freq),os.sawtooth(freq) : ba.selectn(4,wave))
with{
wave = nentry("[0]Waveform",3,0,3,1);
freq = hslider("[1]freq",440,50,2000,0.01);
};
peakFilters = hgroup("[1]Peak EQ Filters",seq(i,2,myFilters(i)))
with{
myFilters(i) = fi.peak_eq(boost,peakFreq,bw)
with{
boost = hslider("[0]Boost%i[style:knob]",0,-20,20,0.1);
peak = hslider("[1]Peak%i[style:knob]",50,50,10000,0.1);
bw = hslider("[2]Q%i[style:knob]",100,10,1000,1);
peakRate = hslider("[3]LFO Freq%i",10,0.1,20,0.01);
peakMod = hslider("[4]LFO Mod%i",0,0,10000,1);
peakFreq = os.osc(peakRate)*peakMod + peak: max(30);
};
};
subtractive = waveGenerator : peakFilters : hgroup("[2]Main Filter",fi.resonlp(resFreq,q,1))
with{
ctFreq = hslider("[0]Cutoff Frequency[style:knob]",2000,50,10000,0.1) : si.smoo;
q = hslider("[1]Q[style:knob]",5,1,30,0.1);
lfoFreq = hslider("[2]Rate[style:knob]",10,0.1,20,0.01);
lfoDepth = hslider("[3]Depth[style:knob]",0,0,10000,1);
resFreq = os.osc(lfoFreq)*lfoDepth + ctFreq : max(30);
};
envelope = hgroup("[2]Envelope",en.adsr(attack,decay,sustain,release,gate)*tremolo*0.3)
with{
attack = hslider("[0]Attack[style:knob]",50,1,1000,1)*0.001;
decay = hslider("[1]Decay[style:knob]",50,1,1000,1)*0.001;
sustain = hslider("[2]Sustain[style:knob]",0.8,0.01,1,1);
release = hslider("[3]Release[style:knob]",50,1,1000,1)*0.001;
gain = hslider("[4]gain[style:knob]",1,0,1,0.01);
gate = button("[5]gate");
tremlfoFreq = hslider("[6]Tremolo Rate[style:knob]",10,0.1,20,0.01);
tremlfoDepth = hslider("[7]Tremolo Depth[style:knob]",0,0,1,0.01);
tremolo = (os.osc(tremlfoFreq)*tremlfoDepth) + gain;
};
process = vgroup("Subtractive Synthesizer",subtractive*envelope);
effect = dm.phaser2_demo : dm.freeverb_demo; |
|
78eb6394e32dd5875729c04a516f2b304e0c6211368c357a4cbfad701582a31e | Corredor1230/varikeyTests | test.dsp | import("stdfaust.lib");
freq = vslider("freq", 220, 40, 1000, 1);
gate = button("gate");
gain = vslider("gain", 1, 0, 1, 0.001);
process = os.sawtooth(freq)*0.2<:_,_; | https://raw.githubusercontent.com/Corredor1230/varikeyTests/de0706c046f4c308e6f300b3e90927df29f369ba/SynthTests/JuceSynth/Source/Faust/test.dsp | faust | import("stdfaust.lib");
freq = vslider("freq", 220, 40, 1000, 1);
gate = button("gate");
gain = vslider("gain", 1, 0, 1, 0.001);
process = os.sawtooth(freq)*0.2<:_,_; |
|
99a3a8db9d8f55e13a9f17c27f00e90fcb8c54269ff4d2b2ef78b21ad341d5ee | grame-cncm/faustdoc | exfaust8.dsp |
import("stdfaust.lib");
process = os.sawtooth(440) <: _,_,_;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/manual/syntax/exfaust8/exfaust8.dsp | faust |
import("stdfaust.lib");
process = os.sawtooth(440) <: _,_,_;
|
|
6e3449423c86d0365eedf9fe50ac4fc2e76652acfffdcb438a200569c6ca6cd2 | grame-cncm/faustdoc | exfaust3.dsp |
import("stdfaust.lib");
process = os.osc(440),os.sawtooth(550),os.triangle(660);
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/manual/syntax/exfaust3/exfaust3.dsp | faust |
import("stdfaust.lib");
process = os.osc(440),os.sawtooth(550),os.triangle(660);
|
|
addec4e201fb46a27dc02d98b1ca6c315df97ac12ec98d40edc8eada20ad4fdf | jpark052/CSC484D | q8.dsp | import("stdfaust.lib");
freq = hslider("frequency[midi:ctrl 11]",200,50,1000,0.01) : si.smoo;
// Q1
process = os.osc(440);
// Q4, need to uncomment each line to generate each sound.
//process = os.sawtooth(440);
//process = os.triangle(440);
//process = os.ba.pulse(440);
//process = no.noise;
| https://raw.githubusercontent.com/jpark052/CSC484D/b86d35d9c08bd682bc2359318bea349a071d9455/A1/q8.dsp | faust | Q1
Q4, need to uncomment each line to generate each sound.
process = os.sawtooth(440);
process = os.triangle(440);
process = os.ba.pulse(440);
process = no.noise; | import("stdfaust.lib");
freq = hslider("frequency[midi:ctrl 11]",200,50,1000,0.01) : si.smoo;
process = os.osc(440);
|
67979f8131539f0be58aadc2c9cdfa1bfac1be360a8b07c6b095cd98d9d291a2 | Corredor1230/varikeyTests | SynthTest2.dsp | import("stdfaust.lib");
//Variables
volume = vslider("Volume",1,0,1,0.001):si.smoo;
//Filter
ctFreq = hslider("cutoffFrequency[scale:log][style:knob]",500,50,20000,0.01):si.smoo;
q = hslider("q[style:knob]",1,1,15,0.1):si.smoo;
qRange=((q-1)/4.67)+1;
gainFilt = hslider("gainFilt[style:knob]",1,0,1,0.01):si.smoo;
qGainAdjust=1/qRange;
//Pan
panSquare = vslider("Pan [style:knob]",0.5,0,1,0.0001):si.smoo;
//Midi Input
freq = hslider("freq", 200, 40, 2000, 0.01):si.polySmooth(gate,0.999,2);
gain = hslider("gain",1,0,1,0.01) : si.polySmooth(gate,0.999,2);
gate = button("gate") : si.smoo;
freqMid = ba.hz2midikey(freq);
finalFreq = ba.midikey2hz(freqMid+bend);
//Detunes
bend=hslider("PitchBend",0,-1,1,0.001):si.smoo;
detuneMid=hslider("Detune[midi:ctrl 1]",0,0,1,0.001):si.smoo;
detuneHz=ba.midikey2hz(freqMid+bend+detuneMid);
detuneHzNeg=ba.midikey2hz(freqMid+bend-detuneMid);
//Vibrato
vibFreq=hslider("VibratoFreq",0,0,20,0.001):si.smoo;
vibDepth=hslider("VibratoDepth",0,0,1,0.001):si.smoo;
vibratoOsc=(os.osc(vibFreq)*vibDepth)+(freqMid+bend);
vibratoHz=ba.midikey2hz(vibratoOsc)-finalFreq;
synthBasic(x)=(os.sawtooth(x)*gain*gate)/8;
synthOsc=(synthBasic((finalFreq+vibratoHz))+synthBasic((detuneHz+vibratoHz))+synthBasic((detuneHzNeg+vibratoHz)))*qGainAdjust;
synthFilt=synthOsc:fi.resonlp(ctFreq,q,gainFilt);
process = synthFilt*volume<:_*((1-panSquare):sqrt),_*(panSquare:sqrt); | https://raw.githubusercontent.com/Corredor1230/varikeyTests/025edd8e1f10e92a23b906a5ad6037cc7272f2fa/Faust/SynthTest2.dsp | faust | Variables
Filter
Pan
Midi Input
Detunes
Vibrato
| import("stdfaust.lib");
volume = vslider("Volume",1,0,1,0.001):si.smoo;
ctFreq = hslider("cutoffFrequency[scale:log][style:knob]",500,50,20000,0.01):si.smoo;
q = hslider("q[style:knob]",1,1,15,0.1):si.smoo;
qRange=((q-1)/4.67)+1;
gainFilt = hslider("gainFilt[style:knob]",1,0,1,0.01):si.smoo;
qGainAdjust=1/qRange;
panSquare = vslider("Pan [style:knob]",0.5,0,1,0.0001):si.smoo;
freq = hslider("freq", 200, 40, 2000, 0.01):si.polySmooth(gate,0.999,2);
gain = hslider("gain",1,0,1,0.01) : si.polySmooth(gate,0.999,2);
gate = button("gate") : si.smoo;
freqMid = ba.hz2midikey(freq);
finalFreq = ba.midikey2hz(freqMid+bend);
bend=hslider("PitchBend",0,-1,1,0.001):si.smoo;
detuneMid=hslider("Detune[midi:ctrl 1]",0,0,1,0.001):si.smoo;
detuneHz=ba.midikey2hz(freqMid+bend+detuneMid);
detuneHzNeg=ba.midikey2hz(freqMid+bend-detuneMid);
vibFreq=hslider("VibratoFreq",0,0,20,0.001):si.smoo;
vibDepth=hslider("VibratoDepth",0,0,1,0.001):si.smoo;
vibratoOsc=(os.osc(vibFreq)*vibDepth)+(freqMid+bend);
vibratoHz=ba.midikey2hz(vibratoOsc)-finalFreq;
synthBasic(x)=(os.sawtooth(x)*gain*gate)/8;
synthOsc=(synthBasic((finalFreq+vibratoHz))+synthBasic((detuneHz+vibratoHz))+synthBasic((detuneHzNeg+vibratoHz)))*qGainAdjust;
synthFilt=synthOsc:fi.resonlp(ctFreq,q,gainFilt);
process = synthFilt*volume<:_*((1-panSquare):sqrt),_*(panSquare:sqrt); |
22af0db5c3ca19a5209dd9e7790f2bbb6629573f74dc04aacc0ed6f863d3c484 | grame-cncm/faustdoc | exfaust15.dsp |
//################################### trumpet.dsp #####################################
// A simple trumpet app... (for large screens).
//
// ## Compilation Instructions
//
// This Faust code will compile fine with any of the standard Faust targets. However
// it was specifically designed to be used with faust2smartkeyb. For best results,
// we recommend to use the following parameters to compile it:
//
//
// faust2smartkeyb [-ios/-android] -effect reverb.dsp trumpet.dsp
//
//
// ## Version/Licence
//
// Version 0.0, Feb. 2017
// Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
// MIT Licence: https://opensource.org/licenses/MIT
//########################################################################################
import("stdfaust.lib");
declare interface "SmartKeyboard{
'Number of Keyboards':'5',
'Max Keyboard Polyphony':'1',
'Mono Mode':'1',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 4 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'77',
'Keyboard 1 - Lowest Key':'72',
'Keyboard 2 - Lowest Key':'67',
'Keyboard 3 - Lowest Key':'62',
'Keyboard 4 - Lowest Key':'57',
'Rounding Mode':'2',
'Keyboard 0 - Send Y':'1',
'Keyboard 1 - Send Y':'1',
'Keyboard 2 - Send Y':'1',
'Keyboard 3 - Send Y':'1',
'Keyboard 4 - Send Y':'1',
}";
// standard parameters
f = hslider("freq",300,50,2000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.001)) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
s = hslider("sustain[midi:ctrl 64]",0,0,1,1); // for sustain pedal
t = button("gate");
y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo;
// fomating parameters
gate = t+s : min(1);
freq = f*bend;
cutoff = y*4000+50;
envelope = gate*gain : si.smoo;
process = os.sawtooth(freq)*envelope : fi.lowpass(3,cutoff) <: _,_;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/examples/smartKeyboard/exfaust15/exfaust15.dsp | faust | ################################### trumpet.dsp #####################################
A simple trumpet app... (for large screens).
## Compilation Instructions
This Faust code will compile fine with any of the standard Faust targets. However
it was specifically designed to be used with faust2smartkeyb. For best results,
we recommend to use the following parameters to compile it:
faust2smartkeyb [-ios/-android] -effect reverb.dsp trumpet.dsp
## Version/Licence
Version 0.0, Feb. 2017
Copyright Romain Michon CCRMA (Stanford University)/GRAME 2017
MIT Licence: https://opensource.org/licenses/MIT
########################################################################################
standard parameters
for sustain pedal
fomating parameters |
import("stdfaust.lib");
declare interface "SmartKeyboard{
'Number of Keyboards':'5',
'Max Keyboard Polyphony':'1',
'Mono Mode':'1',
'Keyboard 0 - Number of Keys':'13',
'Keyboard 1 - Number of Keys':'13',
'Keyboard 2 - Number of Keys':'13',
'Keyboard 3 - Number of Keys':'13',
'Keyboard 4 - Number of Keys':'13',
'Keyboard 0 - Lowest Key':'77',
'Keyboard 1 - Lowest Key':'72',
'Keyboard 2 - Lowest Key':'67',
'Keyboard 3 - Lowest Key':'62',
'Keyboard 4 - Lowest Key':'57',
'Rounding Mode':'2',
'Keyboard 0 - Send Y':'1',
'Keyboard 1 - Send Y':'1',
'Keyboard 2 - Send Y':'1',
'Keyboard 3 - Send Y':'1',
'Keyboard 4 - Send Y':'1',
}";
f = hslider("freq",300,50,2000,0.01);
bend = ba.semi2ratio(hslider("bend[midi:pitchwheel]",0,-2,2,0.001)) : si.polySmooth(gate,0.999,1);
gain = hslider("gain",1,0,1,0.01);
t = button("gate");
y = hslider("y[midi:ctrl 1]",1,0,1,0.001) : si.smoo;
gate = t+s : min(1);
freq = f*bend;
cutoff = y*4000+50;
envelope = gate*gain : si.smoo;
process = os.sawtooth(freq)*envelope : fi.lowpass(3,cutoff) <: _,_;
|
2c0e2fe1753f6c60afe1378cd2e86a136133bbb8a70aa742c39a5af44028117f | Corredor1230/varikeyTests | synthFaustStyle.dsp | import("stdfaust.lib");
//Parameter declarations
freq = vslider("freq[style:knob]",500,200,1000,0.01);
gain = vslider("gain",-20,-60,0,1) : ba.db2linear;
gate = button("gate") : si.smoo;
cutoff = vslider("cutoff[style:knob][scale:log]",1000,110,20000,0.01) : si.smoo : max(20);
vibFreq = vslider("vibFreq",0,0,20,0.02):si.smoo;
vibDepth = vslider("vibDepth[style:knob]",0,0,1,0.001):si.smoo;
tremFreq = vslider("tremFreq",0,0,20,0.02):si.smoo;
tremDepth = vslider("tremDepth[style:knob]",0,0,1,0.001):si.smoo;
pitchWheel = hslider("pitchWheel",0,-1,1,0.001):si.smoo;
detune = hslider("detune",0,0,1,0.001):si.smoo;
lfoFreq = vslider("lfoFreq",0,0,20,0.001):si.smoo;
lfoDepth = vslider("lfoDepth[style:knob]",0,0,20000,1):si.smoo;
midiNote=ba.hz2midikey(freq);
voice(note, detune) = oscillator(note - detune), oscillator(note), oscillator(note + detune) : _ , (_ <: _, _ ), _ : + , + : par(i, 2, _ * 0.5) with {
oscillator(note) = os.sawtooth(freq) with {
freq = ba.midikey2hz(note);
};
};
lfo(freq, depth) = os.osc(freq) * depth;
envelope(gate) = _ * gate;
filter(freq) = fi.lowpass(3, filterFreq) : fi.lowpass(5, 18000) with {
filterFreq = freq : min(20000) : max(20);
};
tremolo(freq) = _ * gain with {
gain = os.osc(freq) - 1 : _ / 2 : _ * tremDepth : _ + 1;
};
masterGain = par(i, 2, _ * gain);
oscFreq=vibrato+wheel with{
oscillator = os.osc(vibFreq)*vibDepth;
midiVib=midiNote+oscillator;
vibrato = ba.midikey2hz(midiVib);
wheel = ba.midikey2hz(midiNote+pitchWheel);
};
note = midiNote + vibrato + pitchWheel with {
vibrato = lfo(vibFreq, vibDepth);
};
process = hgroup("Synth", voice(note, detune) : par(i, 2, envelope(gate) : filter(cutoff + lfo(lfoFreq, lfoDepth)) : tremolo(tremFreq) ) : masterGain);
| https://raw.githubusercontent.com/Corredor1230/varikeyTests/ee7d6798d14d56a2a68a3dcc72d582f7bcab3f6c/Faust/synthFaustStyle.dsp | faust | Parameter declarations | import("stdfaust.lib");
freq = vslider("freq[style:knob]",500,200,1000,0.01);
gain = vslider("gain",-20,-60,0,1) : ba.db2linear;
gate = button("gate") : si.smoo;
cutoff = vslider("cutoff[style:knob][scale:log]",1000,110,20000,0.01) : si.smoo : max(20);
vibFreq = vslider("vibFreq",0,0,20,0.02):si.smoo;
vibDepth = vslider("vibDepth[style:knob]",0,0,1,0.001):si.smoo;
tremFreq = vslider("tremFreq",0,0,20,0.02):si.smoo;
tremDepth = vslider("tremDepth[style:knob]",0,0,1,0.001):si.smoo;
pitchWheel = hslider("pitchWheel",0,-1,1,0.001):si.smoo;
detune = hslider("detune",0,0,1,0.001):si.smoo;
lfoFreq = vslider("lfoFreq",0,0,20,0.001):si.smoo;
lfoDepth = vslider("lfoDepth[style:knob]",0,0,20000,1):si.smoo;
midiNote=ba.hz2midikey(freq);
voice(note, detune) = oscillator(note - detune), oscillator(note), oscillator(note + detune) : _ , (_ <: _, _ ), _ : + , + : par(i, 2, _ * 0.5) with {
oscillator(note) = os.sawtooth(freq) with {
freq = ba.midikey2hz(note);
};
};
lfo(freq, depth) = os.osc(freq) * depth;
envelope(gate) = _ * gate;
filter(freq) = fi.lowpass(3, filterFreq) : fi.lowpass(5, 18000) with {
filterFreq = freq : min(20000) : max(20);
};
tremolo(freq) = _ * gain with {
gain = os.osc(freq) - 1 : _ / 2 : _ * tremDepth : _ + 1;
};
masterGain = par(i, 2, _ * gain);
oscFreq=vibrato+wheel with{
oscillator = os.osc(vibFreq)*vibDepth;
midiVib=midiNote+oscillator;
vibrato = ba.midikey2hz(midiVib);
wheel = ba.midikey2hz(midiNote+pitchWheel);
};
note = midiNote + vibrato + pitchWheel with {
vibrato = lfo(vibFreq, vibDepth);
};
process = hgroup("Synth", voice(note, detune) : par(i, 2, envelope(gate) : filter(cutoff + lfo(lfoFreq, lfoDepth)) : tremolo(tremFreq) ) : masterGain);
|
f0e1fd06b1a796438dca694736acb8513acd975329711e86a6c538289c985024 | luke1241/MUSS3640_Vocal_Synth | dspExternalFormants.dsp | declare options "[nvoices:8]";
import("stdfaust.lib");
/*INPUT/API*/
gate = button("gate");
//Formant Data
f1Freq = nentry("f1Freq", 800, 20, 20000, 1);
f1Gain = nentry("f1Gain", 1.0, 0.0, 1.0, 0.01);
f1BW = nentry("f1BW", 80, 20, 20000, 1);
f2Freq = nentry("f2Freq", 1150, 20, 20000, 1);
f2Gain = nentry("f2Gain", 0.630957, 0.0, 1.0, 0.0001);
f2BW = nentry("f2BW", 90, 20, 20000, 1);
f3Freq = nentry("f3Freq", 2800, 20, 20000, 1);
f3Gain = nentry("f3Gain", 0.100000, 0.0, 1.0, 0.0001);
f3BW = nentry("f3BW", 120, 20, 20000, 1);
f4Freq = nentry("f4Freq", 3500, 20, 20000, 1);
f4Gain = nentry("f4Gain", 0.015849, 0.0, 1.0, 0.0001);
f4BW = nentry("f4BW", 130, 20, 20000, 1);
f5Freq = nentry("f5Freq", 4950, 20, 20000, 1);
f5Gain = nentry("f5Gain", 0.001000, 0.0, 1.0, 0.0001);
f5BW = nentry("f5BW", 140, 20, 20000, 1);
//Voice Envelope Control
voiceAttack = vslider("t:voice/h:envelope/voiceAttack", 0.01, 0.01, 2.0, 0.01);
voiceDecay = vslider("t:voice/h:envelope/voiceDecay", 0.01, 0.01, 2.0, 0.01);
voiceSustain = vslider("t:voice/h:envelope/voiceSustain", 1.0, 0.0, 1.0, 0.01);
voiceRelease = vslider("t:voice/h:envelope/voiceRelease", 1.0, 0.01, 5.0, 0.01);
//Source Control
bpSourcePW = vslider("t:voice/h:source/bpSourcePW", 0.1, 0.001, 0.999, 0.001);
bpSourceSelect = vslider("t:voice/h:source/bpSourceSelect", 0, 0, 2, 1);
glideTime = vslider("t:voice/h:source/glideTime", 0.0, 0.0, 2.0, 0.001);
frequency = vslider("freq", 100, 20, 1046, 0.1) : si.smooth(ba.tau2pole(glideTime));
noiseSlide = vslider("t:voice/h:source/noise", 0.001, 0.0, 1.0, 0.001);
t0Slide = vslider("t:voice/h:source/T0", 0.915, 0.01, 1.0, 0.001);
teSlide = vslider("t:voice/h:source/Te", 0.857, 0.00, 4.0, 0.001);
pressureSlide = vslider("t:voice/h:source/Pressure", 1.0, 0.0, 1.0, 0.001);
//Fricative Control
noiseColourLow = vslider("t:voice/h:fricative/noiseColourLow", 20, 20, 20000, 1);
noiseColourHigh = vslider("t:voice/h:fricative/noiseColourHigh", 20000, 20, 20000, 1);
noiseAttack = vslider("t:voice/h:fricative/noiseAttack", 0.01, 0.01, 2.0, 0.01);
noiseDecay = vslider("t:voice/h:fricative/noiseDecay", 0.01, 0.01, 2.0, 0.01);
noiseSustain = vslider("t:voice/h:fricative/noiseSustain", 0.0, 0.0, 1.0, 0.001);
noiseRelease = vslider("t:voice/h:fricative/noiseRelease", 0.01, 0.01, 3.0, 0.01);
//Vibrato Control
vibratoGain = vslider("t:voice/h:vibrato/vibratoGain", 0.3, 0.0, 1.0, 0.01);
vibratoFreq = vslider("t:voice/h:vibrato/vibratoFreq", 5.0, 0.01, 8.0, 0.01);
vibratoAttack = vslider("t:voice/h:vibrato/vibratoAttack", 0.01, 0.01, 2.0, 0.01);
vibratoSustain = vslider("t:voice/h:vibrato/vibratoSustain", 1.0, 0.0, 1.0, 0.01);
vibratoRelease = vslider("t:voice/h:vibrato/vibratoRelease", 0.01, 0.01, 5.0, 0.01);
//Gain Control
fofGain = vslider("t:voice/h:mixer/fofGain", 0.5, 0.0, 1.0, 0.01);
bpGain = vslider("t:voice/h:mixer/bpGain", 0.5, 0.0, 1.0, 0.01);
fricativeGain = vslider("t:voice/h:mixer/fricativeGain", 0.5, 0.0, 1.0, 0.01);
gain = vslider("gain", 0.5, 0.0, 1.0, 0.01);
//unisonDetune = hslider("unisonDetune", 0.0, 0.0, 2.0, 0.01);
//Global signals
nFormants = 5;
nUnison = 4;
unisonDetune = 0;
voiceEffort = pm.vocalEffort(sourceFreq, gender);
index = (voiceType * nFormants) + vowel : si.smoo;
sourceFreq = frequency + vibratoSignal;
/*ENVLOPE*/
voiceEnvelope = en.adsr(voiceAttack, voiceDecay, voiceSustain, voiceRelease, gate);
/*VIBRATO*/
vibratoSignal = os.osc(vibratoFreq)*vibratoEnvelope;
vibratoEnvelope = en.asr(vibratoAttack, vibratoSustain, vibratoRelease, gate);
/*FOF*/
fofSource(freq_) = os.lf_imptrain(freq_);
//FOF Formant Object
fofFormant(freq_, bw_, gain_) = pm.fofCycle(_freq, _bw, _sw, _gain, 6)
with {
_freq = freq_;
_bw = bw_ : si.smooth(ba.tau2pole(0.001));
_sw = bw_ : si.smooth(ba.tau2pole(0.001));
_gain = gain_;
};
//FOF Formant Bank
fofBank = _fof1, _fof2, _fof3, _fof4, _fof5 :> _ <: _,_
with {
_fof1 = fofFormant(f1Freq, f1BW, f1Gain);
_fof2 = fofFormant(f2Freq, f2BW, f2Gain);
_fof3 = fofFormant(f3Freq, f3BW, f3Gain);
_fof4 = fofFormant(f4Freq, f4BW, f4Gain);
_fof5 = fofFormant(f5Freq, f5BW, f5Gain);
};
//FOF Gain Compensation
fofGainComp = 50;
//FOF Process Block
fofChain = par(i, nUnison,(fofSource(sourceFreq + ((unisonDetune/nUnison) * i)) <: fofBank : *((1/nUnison)*i), *(1-((1/nUnison)*i)))) :> co.compressor_stereo(5, -30, 0.05, 0.5): *(fofGainComp),*(fofGainComp) : *(voiceEnvelope), *(voiceEnvelope) : *(fofGain),*(fofGain);
/*BANDPASS*/
bpSource(freq_) = _square, _saw, _model : select3(bpSourceSelect) :> _
with {
_square = os.pulsetrain(freq_, bpSourcePW);
_saw = os.sawtooth(freq_);
_model = rosenbergModel(freq_, 1.0, t0Slide, teSlide, 0.441, 0.224);
};
bpFormant(freq_, bw_, gain_) = fi.bandpass(1, _freqLow, _freqHigh) : *(_gain)
with {
_freqLow = freq_ - (bw_/2);
_freqHigh = freq_ + (bw_/2);
_gain = gain_;
};
//Bandpass formant bank
bpBank = _ <: _bp1, _bp2, _bp3, _bp4, _bp5 :> _ <: _,_
with {
_bp1 = bpFormant(f1Freq, f1BW, f1Gain);
_bp2 = bpFormant(f2Freq, f2BW, f2Gain);
_bp3 = bpFormant(f3Freq, f3BW, f3Gain);
_bp4 = bpFormant(f4Freq, f4BW, f4Gain);
_bp5 = bpFormant(f5Freq, f5BW, f5Gain);
};
bpChain = par(i, nUnison,(bpSource(sourceFreq + ((unisonDetune/nUnison) * i)) <: bpBank : *((1/nUnison)*i), *(1-((1/nUnison)*i)))) :> co.compressor_stereo(5, -30, 0.05, 0.5) : *(10), *(10) : *(voiceEnvelope), *(voiceEnvelope) : *(bpGain), *(bpGain);
/*FRICATIVE*/
fricativeSource = no.noise : fi.bandpass(1, noiseColourLow, noiseColourHigh);
fricativeEnvelope = en.adsr(noiseAttack, noiseDecay, noiseSustain, noiseRelease, gate);
fricativeChain = fricativeSource : bpBank <: *(fricativeGain)*(fricativeEnvelope), *(fricativeGain)*(fricativeEnvelope);
/* Glottal Model */
phasor(freq) = (+(freq/ma.SR) ~ ma.frac);
rosenbergModel(freq, Av, T0, Te, a0, a1) = ba.if(rCond2_(t_), rosenberg1_(-t_), rosenberg2_(-t_)) * rCond3_(t_)
with {
t_ = (phasor(freq)*pressureSlide) + (no.noise*noiseSlide : fi.highpass(1, 22000));
Tp_ = a0*T0;
Tc_ = a1*T0;
Te_ = Te;
rosenberg1_(t_) = 0.5*Av*(1-cos(ma.PI*t_/Tp_)) * rCond1_(t_);
rosenberg2_(t_) = Av*cos(((ma.PI*(t_-Tp_))/(2*Tc_))) * rCond2_(t_);
rCond1_(t_) = 0 < t_ < Tp_;
rCond2_(t_) = Tp_ < t_ < Te_;
rCond3_(t_) = (Te_ < t_ < T0);
};
process = bpChain, fofChain, fricativeChain :> *(gain), *(gain) : _,_;
| https://raw.githubusercontent.com/luke1241/MUSS3640_Vocal_Synth/deea246b4526f5e89b109fd30150105822909091/dspExternalFormants.dsp | faust | INPUT/API
Formant Data
Voice Envelope Control
Source Control
Fricative Control
Vibrato Control
Gain Control
unisonDetune = hslider("unisonDetune", 0.0, 0.0, 2.0, 0.01);
Global signals
ENVLOPE
VIBRATO
FOF
FOF Formant Object
FOF Formant Bank
FOF Gain Compensation
FOF Process Block
BANDPASS
Bandpass formant bank
FRICATIVE
Glottal Model | declare options "[nvoices:8]";
import("stdfaust.lib");
gate = button("gate");
f1Freq = nentry("f1Freq", 800, 20, 20000, 1);
f1Gain = nentry("f1Gain", 1.0, 0.0, 1.0, 0.01);
f1BW = nentry("f1BW", 80, 20, 20000, 1);
f2Freq = nentry("f2Freq", 1150, 20, 20000, 1);
f2Gain = nentry("f2Gain", 0.630957, 0.0, 1.0, 0.0001);
f2BW = nentry("f2BW", 90, 20, 20000, 1);
f3Freq = nentry("f3Freq", 2800, 20, 20000, 1);
f3Gain = nentry("f3Gain", 0.100000, 0.0, 1.0, 0.0001);
f3BW = nentry("f3BW", 120, 20, 20000, 1);
f4Freq = nentry("f4Freq", 3500, 20, 20000, 1);
f4Gain = nentry("f4Gain", 0.015849, 0.0, 1.0, 0.0001);
f4BW = nentry("f4BW", 130, 20, 20000, 1);
f5Freq = nentry("f5Freq", 4950, 20, 20000, 1);
f5Gain = nentry("f5Gain", 0.001000, 0.0, 1.0, 0.0001);
f5BW = nentry("f5BW", 140, 20, 20000, 1);
voiceAttack = vslider("t:voice/h:envelope/voiceAttack", 0.01, 0.01, 2.0, 0.01);
voiceDecay = vslider("t:voice/h:envelope/voiceDecay", 0.01, 0.01, 2.0, 0.01);
voiceSustain = vslider("t:voice/h:envelope/voiceSustain", 1.0, 0.0, 1.0, 0.01);
voiceRelease = vslider("t:voice/h:envelope/voiceRelease", 1.0, 0.01, 5.0, 0.01);
bpSourcePW = vslider("t:voice/h:source/bpSourcePW", 0.1, 0.001, 0.999, 0.001);
bpSourceSelect = vslider("t:voice/h:source/bpSourceSelect", 0, 0, 2, 1);
glideTime = vslider("t:voice/h:source/glideTime", 0.0, 0.0, 2.0, 0.001);
frequency = vslider("freq", 100, 20, 1046, 0.1) : si.smooth(ba.tau2pole(glideTime));
noiseSlide = vslider("t:voice/h:source/noise", 0.001, 0.0, 1.0, 0.001);
t0Slide = vslider("t:voice/h:source/T0", 0.915, 0.01, 1.0, 0.001);
teSlide = vslider("t:voice/h:source/Te", 0.857, 0.00, 4.0, 0.001);
pressureSlide = vslider("t:voice/h:source/Pressure", 1.0, 0.0, 1.0, 0.001);
noiseColourLow = vslider("t:voice/h:fricative/noiseColourLow", 20, 20, 20000, 1);
noiseColourHigh = vslider("t:voice/h:fricative/noiseColourHigh", 20000, 20, 20000, 1);
noiseAttack = vslider("t:voice/h:fricative/noiseAttack", 0.01, 0.01, 2.0, 0.01);
noiseDecay = vslider("t:voice/h:fricative/noiseDecay", 0.01, 0.01, 2.0, 0.01);
noiseSustain = vslider("t:voice/h:fricative/noiseSustain", 0.0, 0.0, 1.0, 0.001);
noiseRelease = vslider("t:voice/h:fricative/noiseRelease", 0.01, 0.01, 3.0, 0.01);
vibratoGain = vslider("t:voice/h:vibrato/vibratoGain", 0.3, 0.0, 1.0, 0.01);
vibratoFreq = vslider("t:voice/h:vibrato/vibratoFreq", 5.0, 0.01, 8.0, 0.01);
vibratoAttack = vslider("t:voice/h:vibrato/vibratoAttack", 0.01, 0.01, 2.0, 0.01);
vibratoSustain = vslider("t:voice/h:vibrato/vibratoSustain", 1.0, 0.0, 1.0, 0.01);
vibratoRelease = vslider("t:voice/h:vibrato/vibratoRelease", 0.01, 0.01, 5.0, 0.01);
fofGain = vslider("t:voice/h:mixer/fofGain", 0.5, 0.0, 1.0, 0.01);
bpGain = vslider("t:voice/h:mixer/bpGain", 0.5, 0.0, 1.0, 0.01);
fricativeGain = vslider("t:voice/h:mixer/fricativeGain", 0.5, 0.0, 1.0, 0.01);
gain = vslider("gain", 0.5, 0.0, 1.0, 0.01);
nFormants = 5;
nUnison = 4;
unisonDetune = 0;
voiceEffort = pm.vocalEffort(sourceFreq, gender);
index = (voiceType * nFormants) + vowel : si.smoo;
sourceFreq = frequency + vibratoSignal;
voiceEnvelope = en.adsr(voiceAttack, voiceDecay, voiceSustain, voiceRelease, gate);
vibratoSignal = os.osc(vibratoFreq)*vibratoEnvelope;
vibratoEnvelope = en.asr(vibratoAttack, vibratoSustain, vibratoRelease, gate);
fofSource(freq_) = os.lf_imptrain(freq_);
fofFormant(freq_, bw_, gain_) = pm.fofCycle(_freq, _bw, _sw, _gain, 6)
with {
_freq = freq_;
_bw = bw_ : si.smooth(ba.tau2pole(0.001));
_sw = bw_ : si.smooth(ba.tau2pole(0.001));
_gain = gain_;
};
fofBank = _fof1, _fof2, _fof3, _fof4, _fof5 :> _ <: _,_
with {
_fof1 = fofFormant(f1Freq, f1BW, f1Gain);
_fof2 = fofFormant(f2Freq, f2BW, f2Gain);
_fof3 = fofFormant(f3Freq, f3BW, f3Gain);
_fof4 = fofFormant(f4Freq, f4BW, f4Gain);
_fof5 = fofFormant(f5Freq, f5BW, f5Gain);
};
fofGainComp = 50;
fofChain = par(i, nUnison,(fofSource(sourceFreq + ((unisonDetune/nUnison) * i)) <: fofBank : *((1/nUnison)*i), *(1-((1/nUnison)*i)))) :> co.compressor_stereo(5, -30, 0.05, 0.5): *(fofGainComp),*(fofGainComp) : *(voiceEnvelope), *(voiceEnvelope) : *(fofGain),*(fofGain);
bpSource(freq_) = _square, _saw, _model : select3(bpSourceSelect) :> _
with {
_square = os.pulsetrain(freq_, bpSourcePW);
_saw = os.sawtooth(freq_);
_model = rosenbergModel(freq_, 1.0, t0Slide, teSlide, 0.441, 0.224);
};
bpFormant(freq_, bw_, gain_) = fi.bandpass(1, _freqLow, _freqHigh) : *(_gain)
with {
_freqLow = freq_ - (bw_/2);
_freqHigh = freq_ + (bw_/2);
_gain = gain_;
};
bpBank = _ <: _bp1, _bp2, _bp3, _bp4, _bp5 :> _ <: _,_
with {
_bp1 = bpFormant(f1Freq, f1BW, f1Gain);
_bp2 = bpFormant(f2Freq, f2BW, f2Gain);
_bp3 = bpFormant(f3Freq, f3BW, f3Gain);
_bp4 = bpFormant(f4Freq, f4BW, f4Gain);
_bp5 = bpFormant(f5Freq, f5BW, f5Gain);
};
bpChain = par(i, nUnison,(bpSource(sourceFreq + ((unisonDetune/nUnison) * i)) <: bpBank : *((1/nUnison)*i), *(1-((1/nUnison)*i)))) :> co.compressor_stereo(5, -30, 0.05, 0.5) : *(10), *(10) : *(voiceEnvelope), *(voiceEnvelope) : *(bpGain), *(bpGain);
fricativeSource = no.noise : fi.bandpass(1, noiseColourLow, noiseColourHigh);
fricativeEnvelope = en.adsr(noiseAttack, noiseDecay, noiseSustain, noiseRelease, gate);
fricativeChain = fricativeSource : bpBank <: *(fricativeGain)*(fricativeEnvelope), *(fricativeGain)*(fricativeEnvelope);
phasor(freq) = (+(freq/ma.SR) ~ ma.frac);
rosenbergModel(freq, Av, T0, Te, a0, a1) = ba.if(rCond2_(t_), rosenberg1_(-t_), rosenberg2_(-t_)) * rCond3_(t_)
with {
t_ = (phasor(freq)*pressureSlide) + (no.noise*noiseSlide : fi.highpass(1, 22000));
Tp_ = a0*T0;
Tc_ = a1*T0;
Te_ = Te;
rosenberg1_(t_) = 0.5*Av*(1-cos(ma.PI*t_/Tp_)) * rCond1_(t_);
rosenberg2_(t_) = Av*cos(((ma.PI*(t_-Tp_))/(2*Tc_))) * rCond2_(t_);
rCond1_(t_) = 0 < t_ < Tp_;
rCond2_(t_) = Tp_ < t_ < Te_;
rCond3_(t_) = (Te_ < t_ < T0);
};
process = bpChain, fofChain, fricativeChain :> *(gain), *(gain) : _,_;
|
255922ad49b47f6c64f334b05066c5a39e3edcdd9b7632a05f3b3f620103a2e7 | OceanSwift/Faust-Course-Examples | ITDpan.dsp | import("stdfaust.lib");
// ITD: the Interaural Time Difference in samples, assuming that:
// - the distance between the two ears is: 0.2 m
// - the speed of the sound is: 340 m/s
// - the sampling rate is: ma.SR
ITD = (0.2/340)*ma.SR;
// itdpan(p): ITD based panoramic
// The parameter p indicates the position of the source:
// 0.0 (full left): 0 on the left channel, full ITD delay on the right channel
// 0.5 (center): half ITD delay on both channels
// 1.0 (full right): full ITD delay on the left channel and 0 delay on the right channel
itdpan(p) = _ <: @(p*ITD), @(ITD*(1-p));
process = ba.pulsen(1,10000) * checkbox("play") : pm.djembe(60,0.3,0.5,1) : itdpan(hslider("pan", 0.5, 0, 1, 0.01)); | https://raw.githubusercontent.com/OceanSwift/Faust-Course-Examples/c3c779ab8257fae9563de4bc09ee71c5346bb1cd/ITDpan.dsp | faust | ITD: the Interaural Time Difference in samples, assuming that:
- the distance between the two ears is: 0.2 m
- the speed of the sound is: 340 m/s
- the sampling rate is: ma.SR
itdpan(p): ITD based panoramic
The parameter p indicates the position of the source:
0.0 (full left): 0 on the left channel, full ITD delay on the right channel
0.5 (center): half ITD delay on both channels
1.0 (full right): full ITD delay on the left channel and 0 delay on the right channel | import("stdfaust.lib");
ITD = (0.2/340)*ma.SR;
itdpan(p) = _ <: @(p*ITD), @(ITD*(1-p));
process = ba.pulsen(1,10000) * checkbox("play") : pm.djembe(60,0.3,0.5,1) : itdpan(hslider("pan", 0.5, 0, 1, 0.01)); |
fc61de2b95bc6b388112c44bb36b08aa6bb5abfb18b498b38787c2d285b2f8be | grame-cncm/FAST | guitar-effects.dsp | import("stdfaust.lib");
// Reverb
reverb = ba.bypass2(rbp,dattorro_rev_demo)
with {
rbp = button("Bypass [switch:5]");
};
dattorro_rev_demo = _,_ <: re.dattorro_rev(pre_delay, bw, i_diff1, i_diff2, decay, d_diff1, d_diff2, damping),_,_:
dry_wet
with {
pre_delay = 0;
bw = 0.7;
i_diff1 = 0.625;
i_diff2 = 0.625;
d_diff1 = 0.625;
d_diff2 = 0.625;
decay = 0.7;
damping = 0.625;
dry_wet(x,y) = *(dry) + wet*x, *(dry) + wet*y
with {
wet = 0.5*(drywet+1.0);
dry = 1.0-wet;
};
drywet = hslider("reverb [slider:7]",0,-1.0,1.0,0.01) : si.smoo;
};
// Flanger
flanger_custom = flanger_stereo_demo
with {
invert = 0;
flanger_stereo_demo(x,y) = x,y : pf.flanger_stereo(dmax,curdel1,curdel2,depth,fb,invert);
lfol = os.oscrs;
lfor = os.oscrc;
dmax = 2048;
dflange = 0.001 * ma.SR *10;
odflange = 0.001 * ma.SR *1;
freq = hslider("Speed [knob:4]", 0.5, 0, 10, 0.01);
depth = hslider("Depth [knob:3]", 1, 0, 1, 0.001);
fb = hslider("Feedback [knob:2]", 0, 0, 1, 0.001);
curdel1 = odflange+dflange*(1 + lfol(freq))/2;
curdel2 = odflange+dflange*(1 + lfor(freq))/2;
};
// Drive
drive = hslider("Drive [knob:1]", 0, 0, 1, 0.01);
offset = 0;
cubicnl(drive,offset) = *(pregain) : +(offset) : clip(-1,1) : cubic
with {
pregain = pow(10.0,2*drive);
clip(lo,hi) = min(hi) : max(lo);
cubic(x) = x - x*x*x/3;
postgain = max(1.0,1.0/pregain);
};
master = hslider("master [slider:8]", 1, 0, 1, 0.01);
killswitch = 1-button("killSwitch [switch:6]");
process = cubicnl(drive,offset)<:flanger_custom:reverb:_*master*killswitch,_*master*killswitch;
| https://raw.githubusercontent.com/grame-cncm/FAST/b6e4397756a6f57dbc792d536d5bbd3ddc58e915/docs/codes/guitar-effects.dsp | faust | Reverb
Flanger
Drive | import("stdfaust.lib");
reverb = ba.bypass2(rbp,dattorro_rev_demo)
with {
rbp = button("Bypass [switch:5]");
};
dattorro_rev_demo = _,_ <: re.dattorro_rev(pre_delay, bw, i_diff1, i_diff2, decay, d_diff1, d_diff2, damping),_,_:
dry_wet
with {
pre_delay = 0;
bw = 0.7;
i_diff1 = 0.625;
i_diff2 = 0.625;
d_diff1 = 0.625;
d_diff2 = 0.625;
decay = 0.7;
damping = 0.625;
dry_wet(x,y) = *(dry) + wet*x, *(dry) + wet*y
with {
wet = 0.5*(drywet+1.0);
dry = 1.0-wet;
};
drywet = hslider("reverb [slider:7]",0,-1.0,1.0,0.01) : si.smoo;
};
flanger_custom = flanger_stereo_demo
with {
invert = 0;
flanger_stereo_demo(x,y) = x,y : pf.flanger_stereo(dmax,curdel1,curdel2,depth,fb,invert);
lfol = os.oscrs;
lfor = os.oscrc;
dmax = 2048;
dflange = 0.001 * ma.SR *10;
odflange = 0.001 * ma.SR *1;
freq = hslider("Speed [knob:4]", 0.5, 0, 10, 0.01);
depth = hslider("Depth [knob:3]", 1, 0, 1, 0.001);
fb = hslider("Feedback [knob:2]", 0, 0, 1, 0.001);
curdel1 = odflange+dflange*(1 + lfol(freq))/2;
curdel2 = odflange+dflange*(1 + lfor(freq))/2;
};
drive = hslider("Drive [knob:1]", 0, 0, 1, 0.01);
offset = 0;
cubicnl(drive,offset) = *(pregain) : +(offset) : clip(-1,1) : cubic
with {
pregain = pow(10.0,2*drive);
clip(lo,hi) = min(hi) : max(lo);
cubic(x) = x - x*x*x/3;
postgain = max(1.0,1.0/pregain);
};
master = hslider("master [slider:8]", 1, 0, 1, 0.01);
killswitch = 1-button("killSwitch [switch:6]");
process = cubicnl(drive,offset)<:flanger_custom:reverb:_*master*killswitch,_*master*killswitch;
|
787a0b9bdf39ee91b8a25d0b1153b59afd29ec21af3145ff0947e77813a11158 | grame-cncm/FAST | guitar-effects.dsp | import("stdfaust.lib");
//Reverb
reverb=ba.bypass2(rbp,dattorro_rev_demo)
with{
rbp = button("Bypass [switch:5]");
};
dattorro_rev_demo = _,_ <: re.dattorro_rev(pre_delay, bw, i_diff1, i_diff2, decay, d_diff1, d_diff2, damping),_,_:
dry_wet
with {
pre_delay = 0;
bw = 0.7;
i_diff1 = 0.625;
i_diff2 = 0.625;
d_diff1 = 0.625;
d_diff2 = 0.625;
decay = 0.7;
damping = 0.625;
dry_wet(x,y) = *(dry) + wet*x, *(dry) + wet*y
with {
wet = 0.5*(drywet+1.0);
dry = 1.0-wet;
};
drywet = hslider("reverb [slider:7]",0,-1.0,1.0,0.01) : si.smoo;
};
// Flanger
flanger_custom=flanger_stereo_demo
with{
invert = 0;
flanger_stereo_demo(x,y) = x,y : pf.flanger_stereo(dmax,curdel1,curdel2,depth,fb,invert);
lfol = os.oscrs;
lfor = os.oscrc;
dmax = 2048;
dflange = 0.001 * ma.SR *10;
odflange = 0.001 * ma.SR *1;
freq = hslider("Speed [knob:4]", 0.5, 0, 10, 0.01);
depth = hslider("Depth [knob:3]", 1, 0, 1, 0.001);
fb = hslider("Feedback [knob:2]", 0, 0, 1, 0.001);
curdel1 = odflange+dflange*(1 + lfol(freq))/2;
curdel2 = odflange+dflange*(1 + lfor(freq))/2;
};
//drive
drive = hslider("Drive [knob:1]",
0, 0, 1, 0.01);
offset = 0;
cubicnl(drive,offset) = *(pregain) : +(offset) : clip(-1,1) : cubic
with {
pregain = pow(10.0,2*drive);
clip(lo,hi) = min(hi) : max(lo);
cubic(x) = x - x*x*x/3;
postgain = max(1.0,1.0/pregain);
};
master = hslider("master [slider:8]", 1, 0, 1, 0.01);
killswitch = 1-button("killSwitch [switch:6]");
process =cubicnl(drive,offset)<:flanger_custom:reverb:_*master*killswitch,_*master*killswitch;
| https://raw.githubusercontent.com/grame-cncm/FAST/fe3db7307fb11e046b3d39c0aea22a9b66803773/web/docs/codes/guitar-effects.dsp | faust | Reverb
Flanger
drive | import("stdfaust.lib");
reverb=ba.bypass2(rbp,dattorro_rev_demo)
with{
rbp = button("Bypass [switch:5]");
};
dattorro_rev_demo = _,_ <: re.dattorro_rev(pre_delay, bw, i_diff1, i_diff2, decay, d_diff1, d_diff2, damping),_,_:
dry_wet
with {
pre_delay = 0;
bw = 0.7;
i_diff1 = 0.625;
i_diff2 = 0.625;
d_diff1 = 0.625;
d_diff2 = 0.625;
decay = 0.7;
damping = 0.625;
dry_wet(x,y) = *(dry) + wet*x, *(dry) + wet*y
with {
wet = 0.5*(drywet+1.0);
dry = 1.0-wet;
};
drywet = hslider("reverb [slider:7]",0,-1.0,1.0,0.01) : si.smoo;
};
flanger_custom=flanger_stereo_demo
with{
invert = 0;
flanger_stereo_demo(x,y) = x,y : pf.flanger_stereo(dmax,curdel1,curdel2,depth,fb,invert);
lfol = os.oscrs;
lfor = os.oscrc;
dmax = 2048;
dflange = 0.001 * ma.SR *10;
odflange = 0.001 * ma.SR *1;
freq = hslider("Speed [knob:4]", 0.5, 0, 10, 0.01);
depth = hslider("Depth [knob:3]", 1, 0, 1, 0.001);
fb = hslider("Feedback [knob:2]", 0, 0, 1, 0.001);
curdel1 = odflange+dflange*(1 + lfol(freq))/2;
curdel2 = odflange+dflange*(1 + lfor(freq))/2;
};
drive = hslider("Drive [knob:1]",
0, 0, 1, 0.01);
offset = 0;
cubicnl(drive,offset) = *(pregain) : +(offset) : clip(-1,1) : cubic
with {
pregain = pow(10.0,2*drive);
clip(lo,hi) = min(hi) : max(lo);
cubic(x) = x - x*x*x/3;
postgain = max(1.0,1.0/pregain);
};
master = hslider("master [slider:8]", 1, 0, 1, 0.01);
killswitch = 1-button("killSwitch [switch:6]");
process =cubicnl(drive,offset)<:flanger_custom:reverb:_*master*killswitch,_*master*killswitch;
|
ca4db815ec33b662000a8a318102e4f9840be6261db3b2b49509258064114147 | zeloe/ReverbZen | reverb.dsp | import("stdfaust.lib");
hipfilter(ct) = fi.highpass(1,fc)
with {
fc = ct;
};
filters(dp) = fi.lowpass(1,fc1) , fi.lowpass(1,fc2), fi.lowpass(1,fc3), fi.lowpass(1,fc4),fi.lowpass(1,fc5), fi.lowpass(1,fc6), fi.lowpass(1,fc7), fi.lowpass(1,fc8)
with {
fc1 = (10000) * dp + 100;
fc2 = 9000 * dp + 90;
fc3 = 8500 * dp + 85;
fc4 = 8900 * dp + 89;
fc5 = 10000 * dp + 100;
fc6 = 8666 * dp + 86;
fc7 = 9500 * dp + 95;
fc8 = 9999 * dp + 99;
};
delay(pd) = de.delay(30000,d) , de.delay(30000,d2), de.delay(30000,d3), de.delay(30000,d4) , de.delay(30000,d5), de.delay(30000,d6), de.delay(30000,d7) ,de.delay(30000,d8)
with {
d = pd * ma.SR * 0.001 * 500 + 10;
d2 = pd * ma.SR * 0.001 * 520 + 20;
d3 = pd * ma.SR * 0.001 * 510 + 30;
d4 = pd * ma.SR * 0.001 * 500 + 10;
d5 = pd * ma.SR * 0.001 * 520 + 20;
d6 = pd * ma.SR * 0.001 * 590 + 20;
d7 = pd * ma.SR * 0.001 * 510 + 10;
d8 = pd * ma.SR * 0.001 * 520 + 20;
};
allpass(erd) = fi.fb_comb(30000,d,.85, 1-.85), fi.fb_comb(30000,d2,.85, 1- .85), fi.fb_comb(30000,d3,.55, 1-.55), fi.fb_comb(30000,d4,.84, 1-.84) , fi.fb_comb(30000,d5,.89, 1-.89 ), fi.fb_comb(30000,d6,.75, 1-.75), fi.fb_comb(30000,d7,.89, 1-.89 ),fi.fb_comb(30000,d8,.93,1-.93)
with {
d = erd * ma.SR * 0.001 * 550 + 10;
d2 = erd * ma.SR * 0.001 * 530 +5;
d3 = erd * ma.SR * 0.001 * 540 + 8;
d4 = erd * ma.SR * 0.001 * 550 +16;
d5 = erd * ma.SR * 0.001 * 530 + 20;
d6 = erd * ma.SR * 0.001 * 560 + 10;
d7 = erd * ma.SR * 0.001 * 540 + 8;
d8 = erd * ma.SR * 0.001 * 530 + 5;
};
feedback(fbd) = fi.fbcombfilter(10000,d,0.85), fi.fbcombfilter(10000,d2,0.75),fi.fbcombfilter(10000,d3,0.85),fi.fbcombfilter(10000,d4,0.84),
fi.fbcombfilter(10000,d5,0.75), fi.fbcombfilter(10000,d6,0.85) , fi.fbcombfilter(10000,d7,0.85) , fi.fbcombfilter(10000,d8,0.75)
with {
d = fbd * ma.SR * 0.001 * 122 + 10;
d2 = fbd * ma.SR * 0.001 * 120 +5;
d3 = fbd * ma.SR * 0.001 * 130 + 8;
d4 = fbd * ma.SR * 0.001 * 140 +16;
d5 = fbd * ma.SR * 0.001 * 130 + 20;
d6 = fbd * ma.SR * 0.001 * 140 + 10;
d7 = fbd * ma.SR * 0.001 * 130 + 8;
d8 = fbd * ma.SR * 0.001 * 110 + 5;
};
lowpass(fc) = fi.lowpass(1,f1),fi.lowpass(1,f2),fi.lowpass(1,f3),fi.lowpass(1,f4),fi.lowpass(1,f5),fi.lowpass(1,f6),fi.lowpass(1,f7),fi.lowpass(1,f8)
with {
f1 = fc * 19000 + 10;
f2 = fc * 19000 + 20;
f3 = fc * 19000 + 30;
f4 = fc * 19000 + 40;
f5 = fc * 19000 + 50;
f6 = fc * 19000 + 60;
f7 = fc * 19000 + 70;
f8 = fc * 19000 + 80;
};
predelay = nentry("predelay",1.0,0,1,0.01) : si.smoo;
highpass = nentry("highpasscutoff", 5000,20,20000,1) : si.smoo;
lowpassfc = nentry("lowpassfc",1.0,0,1,0.01) : si.smoo;
erdelay = nentry("erdelay",1.0,0,1,0.01) : si.smoo;
width = nentry("width",1.0,0,1,0.01) : si.smoo;
reflectionsdelay = nentry("reflectionsdelay",1.0,0,1,0.01) : si.smoo;
decaydelay = nentry("decaydelay",1.0,0,1,0.01) : si.smoo;
delaywet = nentry("delaywet",1.0,0,1,0.01) : si.smoo;
damping = nentry("damp", 1.0,0,1,0.01) : si.smoo;
mixhighpassin = nentry("mixhighpassin", 1,0,1,1) :si.smoo;
mixhighpassout = nentry("mixhighpassout", 0,0,1,1) :si.smoo;
matrix = mix_mtx
with {
mix_mtx = _, _ , _ ,_ <: _,_,_,_,_,_,_,_;
};
matrix2 = mix_mtx
with {
mix_mtx = _,_,_,_,_,_,_,_ :> _,_ ;
};
process(x,y) = ((x + y) * 0.5) * (1 - width) + ((x - y) * 0.5) * (width) <:hipfilter(highpass) * mixhighpassin, hipfilter(highpass) * mixhighpassin , _ * (1 - mixhighpassin), _ * (1 - mixhighpassin) : matrix : filters(damping) : delay(predelay) : allpass(erdelay) : lowpass(lowpassfc) : feedback(decaydelay) : matrix2 <: _ * mixhighpassout , _ * mixhighpassout , _ *(1-mixhighpassout) , _ *(1-mixhighpassout) : hipfilter(highpass), hipfilter(highpass), _ ,_ :> _ , _ : (_ * delaywet) + x * (1 - delaywet) , (_ * delaywet) + y * (1 - delaywet) ; | https://raw.githubusercontent.com/zeloe/ReverbZen/0755f81dc499df09cc1e77117ad484a6bfd43386/Source/reverb.dsp | faust | import("stdfaust.lib");
hipfilter(ct) = fi.highpass(1,fc)
with {
fc = ct;
};
filters(dp) = fi.lowpass(1,fc1) , fi.lowpass(1,fc2), fi.lowpass(1,fc3), fi.lowpass(1,fc4),fi.lowpass(1,fc5), fi.lowpass(1,fc6), fi.lowpass(1,fc7), fi.lowpass(1,fc8)
with {
fc1 = (10000) * dp + 100;
fc2 = 9000 * dp + 90;
fc3 = 8500 * dp + 85;
fc4 = 8900 * dp + 89;
fc5 = 10000 * dp + 100;
fc6 = 8666 * dp + 86;
fc7 = 9500 * dp + 95;
fc8 = 9999 * dp + 99;
};
delay(pd) = de.delay(30000,d) , de.delay(30000,d2), de.delay(30000,d3), de.delay(30000,d4) , de.delay(30000,d5), de.delay(30000,d6), de.delay(30000,d7) ,de.delay(30000,d8)
with {
d = pd * ma.SR * 0.001 * 500 + 10;
d2 = pd * ma.SR * 0.001 * 520 + 20;
d3 = pd * ma.SR * 0.001 * 510 + 30;
d4 = pd * ma.SR * 0.001 * 500 + 10;
d5 = pd * ma.SR * 0.001 * 520 + 20;
d6 = pd * ma.SR * 0.001 * 590 + 20;
d7 = pd * ma.SR * 0.001 * 510 + 10;
d8 = pd * ma.SR * 0.001 * 520 + 20;
};
allpass(erd) = fi.fb_comb(30000,d,.85, 1-.85), fi.fb_comb(30000,d2,.85, 1- .85), fi.fb_comb(30000,d3,.55, 1-.55), fi.fb_comb(30000,d4,.84, 1-.84) , fi.fb_comb(30000,d5,.89, 1-.89 ), fi.fb_comb(30000,d6,.75, 1-.75), fi.fb_comb(30000,d7,.89, 1-.89 ),fi.fb_comb(30000,d8,.93,1-.93)
with {
d = erd * ma.SR * 0.001 * 550 + 10;
d2 = erd * ma.SR * 0.001 * 530 +5;
d3 = erd * ma.SR * 0.001 * 540 + 8;
d4 = erd * ma.SR * 0.001 * 550 +16;
d5 = erd * ma.SR * 0.001 * 530 + 20;
d6 = erd * ma.SR * 0.001 * 560 + 10;
d7 = erd * ma.SR * 0.001 * 540 + 8;
d8 = erd * ma.SR * 0.001 * 530 + 5;
};
feedback(fbd) = fi.fbcombfilter(10000,d,0.85), fi.fbcombfilter(10000,d2,0.75),fi.fbcombfilter(10000,d3,0.85),fi.fbcombfilter(10000,d4,0.84),
fi.fbcombfilter(10000,d5,0.75), fi.fbcombfilter(10000,d6,0.85) , fi.fbcombfilter(10000,d7,0.85) , fi.fbcombfilter(10000,d8,0.75)
with {
d = fbd * ma.SR * 0.001 * 122 + 10;
d2 = fbd * ma.SR * 0.001 * 120 +5;
d3 = fbd * ma.SR * 0.001 * 130 + 8;
d4 = fbd * ma.SR * 0.001 * 140 +16;
d5 = fbd * ma.SR * 0.001 * 130 + 20;
d6 = fbd * ma.SR * 0.001 * 140 + 10;
d7 = fbd * ma.SR * 0.001 * 130 + 8;
d8 = fbd * ma.SR * 0.001 * 110 + 5;
};
lowpass(fc) = fi.lowpass(1,f1),fi.lowpass(1,f2),fi.lowpass(1,f3),fi.lowpass(1,f4),fi.lowpass(1,f5),fi.lowpass(1,f6),fi.lowpass(1,f7),fi.lowpass(1,f8)
with {
f1 = fc * 19000 + 10;
f2 = fc * 19000 + 20;
f3 = fc * 19000 + 30;
f4 = fc * 19000 + 40;
f5 = fc * 19000 + 50;
f6 = fc * 19000 + 60;
f7 = fc * 19000 + 70;
f8 = fc * 19000 + 80;
};
predelay = nentry("predelay",1.0,0,1,0.01) : si.smoo;
highpass = nentry("highpasscutoff", 5000,20,20000,1) : si.smoo;
lowpassfc = nentry("lowpassfc",1.0,0,1,0.01) : si.smoo;
erdelay = nentry("erdelay",1.0,0,1,0.01) : si.smoo;
width = nentry("width",1.0,0,1,0.01) : si.smoo;
reflectionsdelay = nentry("reflectionsdelay",1.0,0,1,0.01) : si.smoo;
decaydelay = nentry("decaydelay",1.0,0,1,0.01) : si.smoo;
delaywet = nentry("delaywet",1.0,0,1,0.01) : si.smoo;
damping = nentry("damp", 1.0,0,1,0.01) : si.smoo;
mixhighpassin = nentry("mixhighpassin", 1,0,1,1) :si.smoo;
mixhighpassout = nentry("mixhighpassout", 0,0,1,1) :si.smoo;
matrix = mix_mtx
with {
mix_mtx = _, _ , _ ,_ <: _,_,_,_,_,_,_,_;
};
matrix2 = mix_mtx
with {
mix_mtx = _,_,_,_,_,_,_,_ :> _,_ ;
};
process(x,y) = ((x + y) * 0.5) * (1 - width) + ((x - y) * 0.5) * (width) <:hipfilter(highpass) * mixhighpassin, hipfilter(highpass) * mixhighpassin , _ * (1 - mixhighpassin), _ * (1 - mixhighpassin) : matrix : filters(damping) : delay(predelay) : allpass(erdelay) : lowpass(lowpassfc) : feedback(decaydelay) : matrix2 <: _ * mixhighpassout , _ * mixhighpassout , _ *(1-mixhighpassout) , _ *(1-mixhighpassout) : hipfilter(highpass), hipfilter(highpass), _ ,_ :> _ , _ : (_ * delaywet) + x * (1 - delaywet) , (_ * delaywet) + y * (1 - delaywet) ; |
|
22bd358d1fa39a7bc5b8febfd21f57dbe073fd7b8a7e068ec802b401bf3b688e | butchwarns/LR_Delay | delay.dsp | import("stdfaust.lib");
maxDelay = 1.5 * ma.SR; // 1.5s max delay time
interpTime = 42 * ma.SR / 1000; // 1ms interpolation time
p_drive = vslider("drive[unit:dB][style:knob]", 0.0, -24.0, 12.0, 0.1) : ba.db2linear : si.smoo;
p_volume = vslider("volume[unit:dB][style:knob]", 0.0, -24.0, 12.0, 0.1) : ba.db2linear : si.smoo;
p_dryWet_L = vslider("dryWet_L[unit:%][style:knob]", 0, 0, 100, 0) / 100 : si.smoo;
p_dryWet_R = vslider("dryWet_R[unit:%][style:knob]", 0, 0, 100, 0) / 100 : si.smoo;
p_cutoffLP_L = vslider("cutoffLP_L[unit:Hz][style:knob][scale:log]", 20000, 20, 20000, 0.1) : /(20000.0) : si.smoo;
p_cutoffHP_L = vslider("cutoffHP_L[unit:Hz][style:knob][scale:log]", 20, 20, 20000, 0.1) : /(20000) : si.smoo;
p_cutoffLP_R = vslider("cutoffLP_R[unit:Hz][style:knob][scale:log]", 20000, 20, 20000, 0.1) /(20000) : si.smoo;
p_cutoffHP_R = vslider("cutoffHP_R[unit:Hz][style:knob][scale:log]", 20, 20, 20000, 0.1) : /(20000) : si.smoo;
p_feedback_L = vslider("feedback_L[unit:%][style:knob]", 0.0, 0.0, 100.0, 0.1) / 100.0 : si.smoo;
p_feedback_R = vslider("feedback_R[unit:%][style:knob]", 0.0, 0.0, 100.0, 0.1) / 100.0 : si.smoo;
p_delayTime_L = vslider("delayTime_L[unit:ms][style:knob][scale:log]", 0.0, 0.0, 1500.0, 0.01) * ma.SR / 1000.0 : si.smoo;
p_delayTime_R = vslider("delayTime_R[unit:ms][style:knob][scale:log]", 0.0, 0.0, 1500.0, 0.01) * ma.SR / 1000.0 : si.smoo;
p_preDelay_L = vslider("preDelay_L[unit:ms][style:knob][scale:log]", 0.0, 0.0, 1500.0, 0.01) * ma.SR / 1000.0 : si.smoo;
p_preDelay_R = vslider("preDelay_R[unit:ms][style:knob][scale:log]", 0.0, 0.0, 1500.0, 0.01) * ma.SR / 1000.0 : si.smoo;
p_width = vslider("stereoWidth[unit:%][style:knob]", 100, 0, 100, 1) / 100;
// Left channel
voice_L = _ <: (de.sdelay(maxDelay, interpTime, p_preDelay_L) : delayLoop_L) * p_dryWet_L, *(1 - p_dryWet_L) :> *(p_volume);
delayLoop_L = *(p_drive) : aa.tanh1 : /(p_drive) : (+ : delay_L) ~ (*(p_feedback_L) : feedbackChain_L);
feedbackChain_L = ve.sallenKeyOnePoleLPF(p_cutoffLP_L) : ve.sallenKeyOnePoleHPF(p_cutoffHP_L);
delay_L = de.sdelay(maxDelay, interpTime, p_delayTime_L);
// Right channel
voice_R = _ <: (de.sdelay(maxDelay, interpTime, p_preDelay_R) : delayLoop_R) * p_dryWet_R, *(1 - p_dryWet_R) :> *(p_volume);
delayLoop_R = *(p_drive) : aa.tanh1 : /(p_drive) : (+ : delay_R) ~ (*(p_feedback_R) : feedbackChain_R);
feedbackChain_R = ve.sallenKeyOnePoleLPF(p_cutoffLP_R) : ve.sallenKeyOnePoleHPF(p_cutoffHP_R);
delay_R = de.sdelay(maxDelay, interpTime, p_delayTime_R);
// DC blocking and stereo width
DCBlock_L = fi.dcblockerat(20);
DCBlock_R = fi.dcblockerat(20);
stereoChain = _, _ : *(p_width), *(p_width) : _, _;
monoChain = _, _ :> /(2.0) : *(1 - p_width) <: _, _;
DCBlockChain = voice_L, voice_R : DCBlock_L, DCBlock_R;
process = _, _ : DCBlockChain <: stereoChain, monoChain :> _, _;
| https://raw.githubusercontent.com/butchwarns/LR_Delay/42b39fcc4a326d05a7317b6d4dfb64bc867fdb9e/dsp/delay.dsp | faust | 1.5s max delay time
1ms interpolation time
Left channel
Right channel
DC blocking and stereo width | import("stdfaust.lib");
p_drive = vslider("drive[unit:dB][style:knob]", 0.0, -24.0, 12.0, 0.1) : ba.db2linear : si.smoo;
p_volume = vslider("volume[unit:dB][style:knob]", 0.0, -24.0, 12.0, 0.1) : ba.db2linear : si.smoo;
p_dryWet_L = vslider("dryWet_L[unit:%][style:knob]", 0, 0, 100, 0) / 100 : si.smoo;
p_dryWet_R = vslider("dryWet_R[unit:%][style:knob]", 0, 0, 100, 0) / 100 : si.smoo;
p_cutoffLP_L = vslider("cutoffLP_L[unit:Hz][style:knob][scale:log]", 20000, 20, 20000, 0.1) : /(20000.0) : si.smoo;
p_cutoffHP_L = vslider("cutoffHP_L[unit:Hz][style:knob][scale:log]", 20, 20, 20000, 0.1) : /(20000) : si.smoo;
p_cutoffLP_R = vslider("cutoffLP_R[unit:Hz][style:knob][scale:log]", 20000, 20, 20000, 0.1) /(20000) : si.smoo;
p_cutoffHP_R = vslider("cutoffHP_R[unit:Hz][style:knob][scale:log]", 20, 20, 20000, 0.1) : /(20000) : si.smoo;
p_feedback_L = vslider("feedback_L[unit:%][style:knob]", 0.0, 0.0, 100.0, 0.1) / 100.0 : si.smoo;
p_feedback_R = vslider("feedback_R[unit:%][style:knob]", 0.0, 0.0, 100.0, 0.1) / 100.0 : si.smoo;
p_delayTime_L = vslider("delayTime_L[unit:ms][style:knob][scale:log]", 0.0, 0.0, 1500.0, 0.01) * ma.SR / 1000.0 : si.smoo;
p_delayTime_R = vslider("delayTime_R[unit:ms][style:knob][scale:log]", 0.0, 0.0, 1500.0, 0.01) * ma.SR / 1000.0 : si.smoo;
p_preDelay_L = vslider("preDelay_L[unit:ms][style:knob][scale:log]", 0.0, 0.0, 1500.0, 0.01) * ma.SR / 1000.0 : si.smoo;
p_preDelay_R = vslider("preDelay_R[unit:ms][style:knob][scale:log]", 0.0, 0.0, 1500.0, 0.01) * ma.SR / 1000.0 : si.smoo;
p_width = vslider("stereoWidth[unit:%][style:knob]", 100, 0, 100, 1) / 100;
voice_L = _ <: (de.sdelay(maxDelay, interpTime, p_preDelay_L) : delayLoop_L) * p_dryWet_L, *(1 - p_dryWet_L) :> *(p_volume);
delayLoop_L = *(p_drive) : aa.tanh1 : /(p_drive) : (+ : delay_L) ~ (*(p_feedback_L) : feedbackChain_L);
feedbackChain_L = ve.sallenKeyOnePoleLPF(p_cutoffLP_L) : ve.sallenKeyOnePoleHPF(p_cutoffHP_L);
delay_L = de.sdelay(maxDelay, interpTime, p_delayTime_L);
voice_R = _ <: (de.sdelay(maxDelay, interpTime, p_preDelay_R) : delayLoop_R) * p_dryWet_R, *(1 - p_dryWet_R) :> *(p_volume);
delayLoop_R = *(p_drive) : aa.tanh1 : /(p_drive) : (+ : delay_R) ~ (*(p_feedback_R) : feedbackChain_R);
feedbackChain_R = ve.sallenKeyOnePoleLPF(p_cutoffLP_R) : ve.sallenKeyOnePoleHPF(p_cutoffHP_R);
delay_R = de.sdelay(maxDelay, interpTime, p_delayTime_R);
DCBlock_L = fi.dcblockerat(20);
DCBlock_R = fi.dcblockerat(20);
stereoChain = _, _ : *(p_width), *(p_width) : _, _;
monoChain = _, _ :> /(2.0) : *(1 - p_width) <: _, _;
DCBlockChain = voice_L, voice_R : DCBlock_L, DCBlock_R;
process = _, _ : DCBlockChain <: stereoChain, monoChain :> _, _;
|
d40b62415b1cdabdd1aa5905fd3ce873f067e6a1c60eba6c29492fdc0600be17 | AppliedAcousticsChalmers/pass-by-synth | wfsParallel.dsp | import("maths.lib");
import("basics.lib");
// import("filters.lib");
// import("delays.lib");
import("stdfaust.lib");
nSpeakers = 24;
d = 0.154;
freqs = (562.0, 708.0, 891.0, 1122.0, 1413.0, 1778.0, 2239.0, 2818.0, 3548.0);
freqs3Ob(k) = ba.take(k, (500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, 2000.0, 2500.0, 3150.0, 4000.0));
airatt(f,r) = _ : (*(10^(-r*airattdb1m(f)/20.0))) : _
with{
ht = 40.0;
// Temperature in Celsius
tempC = 24.0;
// Temperature in Kelvin
tempK = 273.15 + tempC;
// Reference temperature
t0 = 293.15;
t01 = 273.16;
// Reference ambient pressure
pa = 101325.0;
pr = 101325.0;
c = -6.8346 * (t01 / tempK)^1.261 + 4.6151;
// Molar conc.of water vapour( %)
h = ht * pr / pa * 10.0 ^ c;
// Relaxation freq of oxygen
fro = (pa / pr) * (24.0 + 4.04 * 10.0 ^ 4.0 * h * (0.02 + h) / (0.391 + h));
frn = (pa / pr) / sqrt(tempK / t0) * (9.0 + 280.0 * h * exp(-4.17 * ((tempK / t0)^(-1.0 / 3.0) - 1.0)));
airattdb1m(f) = 8.686 * f^2.0 * (1.84 * 10.0^(-11.0) * (pr / pa) * sqrt(tempK / t0) + (tempK / t0)^(-2.5)*(0.01275 * exp(-2239.1 / tempK) * (fro + f^2.0/fro)^(-1.0) + 0.1068 * exp(-3352.0 / tempK) * (frn + f^2.0/frn)^(-1.0)));
};
y = nentry("y", 1, 1, 1000, 0.1);
x_offset = nentry("x_offset", 0, -1000, 1000, 0.1);
V = nentry("speed", 30, -120, 120, 1);
ampA = nentry("ampa", 1, 0, 1, 0.001);
ampB = nentry("ampb", 1, 0, 1, 0.001);
tmax = nentry("time", 15, 1, 60, 1);
// yref = 0.0;
trig = button("start"):ba.impulsify;
t = ba.countdown(SR * tmax, trig);
v = V*(10/36);
x = (tmax/2)*v + (d * ((nSpeakers - 1)/2)) + x_offset;
D(d,i,x,y) = (x - (i - 1) * d - (v*t/SR) )^2 + y^2 * (1 - (v/343)^2): sqrt;
r = (x - (nSpeakers/2. - 1./2.) * d - (v*t/SR) )^2 + y^2 * (1 - (v/343)^2): sqrt;
// xnew(d,i) = ma.fabs(x - (i - 1) * d - (v*t/SR) );
// cosphi(d,i,y) = xnew(d,i)/((y^2 + xnew(d,i)^2)^0.5);
// directivity(d,i,y) = 10^((4*cosphi(d,i,y)-2.5)/20);
partialAir = _ : fi.filterbank(5,freqs) : par(i,10,((_:airatt(freqs3Ob(i+1), D(d,nSpeakers/2,x,y))))) :> _;
//amplitude
// Amp(d,i,x,y,sig1,sig2) = (t!=0)*(sig1, sig2*directivity(d,i,y) :> _)/(D(d,i,x,y)^1.5);
Amp(d,i,x,y,sig) = (t!=0)*(sig)/(D(d,i,x,y)^1.5);
OutA(d,1,x,y,sig) = Amp(d,1,x,y,sig);
OutA(d,i,x,y,sig) = OutA(d,i-1,x,y,sig), Amp(d,i,x,y,sig);
//delay
// R(d,i,x,y) = (t!=0)*de.fdelay1s( (((v*(x - (i - 1) * d - (v*t/SR))/343) + D(d,i,x,y)) / (343 * (1 - (v/343)^2) )) * SR);
R(d,i,x,y) = (t!=0)*de.fdelayltv(5, 65536, (((v*(x - (i - 1) * d - (v*t/SR))/343) + D(d,i,x,y)) / (343 * (1 - (v/343)^2) )) * SR);
OutR(d,1,x,y) = R(d,1,x,y);
OutR(d,i,x,y) = OutR(d,i-1,x,y), R(d,i,x,y);
// subwoofer
AmpSub(d,i,x,y,sig) = (t!=0)*(sig)/(D(d,i/2,x,y));
//composition
Out(d,n,x,y,sig) = OutA(d,n,x,y,sig) : OutR(d,n,x,y);
OutSub(d,n,x,y,sig) = AmpSub(d,n/2,x,y,sig) : R(d,n/2,x,y);
// inverse output order
Xo(expr) = expr <: par(i,n,ba.selector(n-i-1,n))
with {
n = outputs(expr);
};
process = _ : fi.lowpass(5,343/d/2) : partialAir : fi.filterbank(3, 100) : (Out(d,nSpeakers,x,y), OutSub(d,nSpeakers,x,y));
| https://raw.githubusercontent.com/AppliedAcousticsChalmers/pass-by-synth/a3fa80a91bf8bba39d6944d25e16021ff3fde2ba/wfsParallel.dsp | faust | import("filters.lib");
import("delays.lib");
Temperature in Celsius
Temperature in Kelvin
Reference temperature
Reference ambient pressure
Molar conc.of water vapour( %)
Relaxation freq of oxygen
yref = 0.0;
xnew(d,i) = ma.fabs(x - (i - 1) * d - (v*t/SR) );
cosphi(d,i,y) = xnew(d,i)/((y^2 + xnew(d,i)^2)^0.5);
directivity(d,i,y) = 10^((4*cosphi(d,i,y)-2.5)/20);
amplitude
Amp(d,i,x,y,sig1,sig2) = (t!=0)*(sig1, sig2*directivity(d,i,y) :> _)/(D(d,i,x,y)^1.5);
delay
R(d,i,x,y) = (t!=0)*de.fdelay1s( (((v*(x - (i - 1) * d - (v*t/SR))/343) + D(d,i,x,y)) / (343 * (1 - (v/343)^2) )) * SR);
subwoofer
composition
inverse output order | import("maths.lib");
import("basics.lib");
import("stdfaust.lib");
nSpeakers = 24;
d = 0.154;
freqs = (562.0, 708.0, 891.0, 1122.0, 1413.0, 1778.0, 2239.0, 2818.0, 3548.0);
freqs3Ob(k) = ba.take(k, (500.0, 630.0, 800.0, 1000.0, 1250.0, 1600.0, 2000.0, 2500.0, 3150.0, 4000.0));
airatt(f,r) = _ : (*(10^(-r*airattdb1m(f)/20.0))) : _
with{
ht = 40.0;
tempC = 24.0;
tempK = 273.15 + tempC;
t0 = 293.15;
t01 = 273.16;
pa = 101325.0;
pr = 101325.0;
c = -6.8346 * (t01 / tempK)^1.261 + 4.6151;
h = ht * pr / pa * 10.0 ^ c;
fro = (pa / pr) * (24.0 + 4.04 * 10.0 ^ 4.0 * h * (0.02 + h) / (0.391 + h));
frn = (pa / pr) / sqrt(tempK / t0) * (9.0 + 280.0 * h * exp(-4.17 * ((tempK / t0)^(-1.0 / 3.0) - 1.0)));
airattdb1m(f) = 8.686 * f^2.0 * (1.84 * 10.0^(-11.0) * (pr / pa) * sqrt(tempK / t0) + (tempK / t0)^(-2.5)*(0.01275 * exp(-2239.1 / tempK) * (fro + f^2.0/fro)^(-1.0) + 0.1068 * exp(-3352.0 / tempK) * (frn + f^2.0/frn)^(-1.0)));
};
y = nentry("y", 1, 1, 1000, 0.1);
x_offset = nentry("x_offset", 0, -1000, 1000, 0.1);
V = nentry("speed", 30, -120, 120, 1);
ampA = nentry("ampa", 1, 0, 1, 0.001);
ampB = nentry("ampb", 1, 0, 1, 0.001);
tmax = nentry("time", 15, 1, 60, 1);
trig = button("start"):ba.impulsify;
t = ba.countdown(SR * tmax, trig);
v = V*(10/36);
x = (tmax/2)*v + (d * ((nSpeakers - 1)/2)) + x_offset;
D(d,i,x,y) = (x - (i - 1) * d - (v*t/SR) )^2 + y^2 * (1 - (v/343)^2): sqrt;
r = (x - (nSpeakers/2. - 1./2.) * d - (v*t/SR) )^2 + y^2 * (1 - (v/343)^2): sqrt;
partialAir = _ : fi.filterbank(5,freqs) : par(i,10,((_:airatt(freqs3Ob(i+1), D(d,nSpeakers/2,x,y))))) :> _;
Amp(d,i,x,y,sig) = (t!=0)*(sig)/(D(d,i,x,y)^1.5);
OutA(d,1,x,y,sig) = Amp(d,1,x,y,sig);
OutA(d,i,x,y,sig) = OutA(d,i-1,x,y,sig), Amp(d,i,x,y,sig);
R(d,i,x,y) = (t!=0)*de.fdelayltv(5, 65536, (((v*(x - (i - 1) * d - (v*t/SR))/343) + D(d,i,x,y)) / (343 * (1 - (v/343)^2) )) * SR);
OutR(d,1,x,y) = R(d,1,x,y);
OutR(d,i,x,y) = OutR(d,i-1,x,y), R(d,i,x,y);
AmpSub(d,i,x,y,sig) = (t!=0)*(sig)/(D(d,i/2,x,y));
Out(d,n,x,y,sig) = OutA(d,n,x,y,sig) : OutR(d,n,x,y);
OutSub(d,n,x,y,sig) = AmpSub(d,n/2,x,y,sig) : R(d,n/2,x,y);
Xo(expr) = expr <: par(i,n,ba.selector(n-i-1,n))
with {
n = outputs(expr);
};
process = _ : fi.lowpass(5,343/d/2) : partialAir : fi.filterbank(3, 100) : (Out(d,nSpeakers,x,y), OutSub(d,nSpeakers,x,y));
|
af9f5d54e1ea388021ae07ac35c427ca5aec0f954f6ef418a0aa3a91d3295e3e | grame-cncm/faustdoc | exfaust1.dsp |
import("stdfaust.lib");
echo(d,f) = +~de.delay(48000,del)*f
with {
del = d*ma.SR;
};
delay = nentry("delay",0.25,0,1,0.01) : si.smoo;
feedback = nentry("feedback",0.5,0,1,0.01) : si.smoo;
process = par(i,2,echo(delay,feedback));
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/workshops/2020-04-10-faust-juce/exfaust1/exfaust1.dsp | faust |
import("stdfaust.lib");
echo(d,f) = +~de.delay(48000,del)*f
with {
del = d*ma.SR;
};
delay = nentry("delay",0.25,0,1,0.01) : si.smoo;
feedback = nentry("feedback",0.5,0,1,0.01) : si.smoo;
process = par(i,2,echo(delay,feedback));
|
|
db30e7a88aa97687d1df830fbcd38fe2d203da83af25d01129eccdd5655a644b | orchidas/Music-256A | delay.dsp | import("stdfaust.lib");
d = hslider("duration",0.5,0,1,0.01) : si.smoo;
f = hslider("feedback",0,0,1,0.01) : si.smoo;
gain = hslider("gain",1,0,1,0.01) : si.smoo;
gate = button("gate");
echo(duration,feedback) = +~(de.delay(ma.np2(44100),delayLength) : *(feedback))
with{
delayLength = duration*ma.SR-1;
};
process = vgroup("delay",par(i,2,echo(d,f)*gain*gate));
| https://raw.githubusercontent.com/orchidas/Music-256A/46c465a3f004a00723088f918106a854af863d08/ofEffectsChain/src/faust/delay.dsp | faust | import("stdfaust.lib");
d = hslider("duration",0.5,0,1,0.01) : si.smoo;
f = hslider("feedback",0,0,1,0.01) : si.smoo;
gain = hslider("gain",1,0,1,0.01) : si.smoo;
gate = button("gate");
echo(duration,feedback) = +~(de.delay(ma.np2(44100),delayLength) : *(feedback))
with{
delayLength = duration*ma.SR-1;
};
process = vgroup("delay",par(i,2,echo(d,f)*gain*gate));
|
|
a62cc73e902d09493e52765e7b939480a61e56abef32b59cab550a9d065e7199 | miccio-dk/LeslieSim | leslie.dsp | import("stdfaust.lib");
//// params
// amp
amp_drive = hslider("[0]Amp drive", 0.1, 0, 1, 0.01) : si.smoo;
// crossover
xver_freq = hslider("[1]Crossover freq (Hz)", 800, 200, 8000, 0.01) : si.smoo;
// bass
bass_speed = hslider("[00]Bass speed (RPM)", 30, 5, 500, 0.01) : si.smoo;
bass_am_depth = hslider("[1]Bass AM depth", 1, 0, 10, 0.01) : si.smoo;
// treble
treble_speed = hslider("[00]Treble speed (RPM)", 35, 5, 500, 0.01) : si.smoo;
treble_radius = hslider("[1]Treble radius (cm)", 19, 5, 30, 0.01) : si.smoo;
treble_mics = hslider("[2]Mics distance (deg)", 90, 0, 180, 0.01) : si.smoo;
treble_am_depth = hslider("[3]Treble AM depth", 1, 0, 10, 0.01) : si.smoo;
treble_lpf_freq = hslider("[4]Treble LPF center freq (Hz)", 1500, 500, 3000, 0.01) : si.smoo;
treble_lpf_depth = hslider("[5]Treble LPF depth (oct.)", 1, 0, 4, 0.01) : si.smoo;
treble_horn_freq = hslider("[6]Horn resonance freq (Hz)", 2000, 1000, 3000, 0.01) : si.smoo;
// mix
bass_mix = hslider("[999]Bass mix (%)", 100, 0, 100, 0.01) : si.smoo;
treble_mix = hslider("[999]Treble mix (%)", 100, 0, 100, 0.01) : si.smoo;
//// modules
// phasor
rotation(bpm) = os.lf_saw(bpm / 60) : *(ma.PI);
// tube amplifier
amplifier(g) = ef.cubicnl_nodc(g, 0.1);
// passive crossover
crossover(fc) = _ <: high,low
with {
high = fi.highpass(2, fc) : fi.highpass(2, fc);
low = fi.lowpass(2, fc) : fi.lowpass(2, fc);
};
// source-listener distance
distance(radius, theta) = sqrt(x_dist*x_dist + y_dist*y_dist)
with {
x_dist = radius + radius*cos(theta);
y_dist = radius + radius*sin(theta);
};
// doppler simulation based on delay lines
doppler(radius, theta) = de.fdelay(10000, distance_hat)
with {
distance_hat = distance(radius, theta) : /(100) : /(343) : *(ma.SR);
};
// amplitude modulation
am(radius, theta, depth) = *(gain)
with {
gain = pow(10, ((norm_level*depth)/20))
with {
// signal level, normalized in range +/- 1
norm_level = (sqrt(2) - (distance(radius, theta) / radius));
};
};
// variable low pass filter
lpf(radius, theta, freq, depth) = fi.lowpass(2, fc)
with {
fc = freq * pow(2, depth * norm_level)
with {
norm_level = (sqrt(2) - (distance(radius, theta) / radius));
};
};
// horn frequency response
horn(f) = peak
with {
peak = fi.peak_eq(10, f, 4000);
};
//// signal routing and UI
bass_theta_view = hbargraph("[01]Bass rotation angle", -1*ma.PI, ma.PI);
bass_theta = rotation(bass_speed) : bass_theta_view;
bass = crossover(200) : (*(-1) : am(1, bass_theta, bass_am_depth)),_ : + : *(bass_mix/100);
bass_group = vgroup("[0]Bass channel", bass);
treble_theta_view = hbargraph("[01]Treble rotation angle", -1*ma.PI, ma.PI);
treble_theta = rotation(treble_speed) : treble_theta_view;
treble_channel(radius, theta) = doppler(radius, theta) : am(radius, theta, treble_am_depth) : lpf(radius, theta, treble_lpf_freq, treble_lpf_depth) : horn(treble_horn_freq) : *(treble_mix/100);
treble_channel_group(radius, theta) = vgroup("[1]Treble channels", treble_channel(radius, theta));
treble_theta_l = treble_theta - (treble_mics / 360 * ma.PI);
treble_theta_r = treble_theta + (treble_mics / 360 * ma.PI);
treble = _ <: treble_channel_group(treble_radius, treble_theta_l),treble_channel_group(treble_radius, treble_theta_r);
xver_signals_group = hgroup("[2]Signal channels", treble,(bass_group <: _,_));
//// process
process = amplifier(amp_drive) : crossover(xver_freq) : xver_signals_group :> _,_;
| https://raw.githubusercontent.com/miccio-dk/LeslieSim/c82211a42a14a40914be8c857b2f69f69f3d97e0/faust/leslie.dsp | faust | // params
amp
crossover
bass
treble
mix
// modules
phasor
tube amplifier
passive crossover
source-listener distance
doppler simulation based on delay lines
amplitude modulation
signal level, normalized in range +/- 1
variable low pass filter
horn frequency response
// signal routing and UI
// process | import("stdfaust.lib");
amp_drive = hslider("[0]Amp drive", 0.1, 0, 1, 0.01) : si.smoo;
xver_freq = hslider("[1]Crossover freq (Hz)", 800, 200, 8000, 0.01) : si.smoo;
bass_speed = hslider("[00]Bass speed (RPM)", 30, 5, 500, 0.01) : si.smoo;
bass_am_depth = hslider("[1]Bass AM depth", 1, 0, 10, 0.01) : si.smoo;
treble_speed = hslider("[00]Treble speed (RPM)", 35, 5, 500, 0.01) : si.smoo;
treble_radius = hslider("[1]Treble radius (cm)", 19, 5, 30, 0.01) : si.smoo;
treble_mics = hslider("[2]Mics distance (deg)", 90, 0, 180, 0.01) : si.smoo;
treble_am_depth = hslider("[3]Treble AM depth", 1, 0, 10, 0.01) : si.smoo;
treble_lpf_freq = hslider("[4]Treble LPF center freq (Hz)", 1500, 500, 3000, 0.01) : si.smoo;
treble_lpf_depth = hslider("[5]Treble LPF depth (oct.)", 1, 0, 4, 0.01) : si.smoo;
treble_horn_freq = hslider("[6]Horn resonance freq (Hz)", 2000, 1000, 3000, 0.01) : si.smoo;
bass_mix = hslider("[999]Bass mix (%)", 100, 0, 100, 0.01) : si.smoo;
treble_mix = hslider("[999]Treble mix (%)", 100, 0, 100, 0.01) : si.smoo;
rotation(bpm) = os.lf_saw(bpm / 60) : *(ma.PI);
amplifier(g) = ef.cubicnl_nodc(g, 0.1);
crossover(fc) = _ <: high,low
with {
high = fi.highpass(2, fc) : fi.highpass(2, fc);
low = fi.lowpass(2, fc) : fi.lowpass(2, fc);
};
distance(radius, theta) = sqrt(x_dist*x_dist + y_dist*y_dist)
with {
x_dist = radius + radius*cos(theta);
y_dist = radius + radius*sin(theta);
};
doppler(radius, theta) = de.fdelay(10000, distance_hat)
with {
distance_hat = distance(radius, theta) : /(100) : /(343) : *(ma.SR);
};
am(radius, theta, depth) = *(gain)
with {
gain = pow(10, ((norm_level*depth)/20))
with {
norm_level = (sqrt(2) - (distance(radius, theta) / radius));
};
};
lpf(radius, theta, freq, depth) = fi.lowpass(2, fc)
with {
fc = freq * pow(2, depth * norm_level)
with {
norm_level = (sqrt(2) - (distance(radius, theta) / radius));
};
};
horn(f) = peak
with {
peak = fi.peak_eq(10, f, 4000);
};
bass_theta_view = hbargraph("[01]Bass rotation angle", -1*ma.PI, ma.PI);
bass_theta = rotation(bass_speed) : bass_theta_view;
bass = crossover(200) : (*(-1) : am(1, bass_theta, bass_am_depth)),_ : + : *(bass_mix/100);
bass_group = vgroup("[0]Bass channel", bass);
treble_theta_view = hbargraph("[01]Treble rotation angle", -1*ma.PI, ma.PI);
treble_theta = rotation(treble_speed) : treble_theta_view;
treble_channel(radius, theta) = doppler(radius, theta) : am(radius, theta, treble_am_depth) : lpf(radius, theta, treble_lpf_freq, treble_lpf_depth) : horn(treble_horn_freq) : *(treble_mix/100);
treble_channel_group(radius, theta) = vgroup("[1]Treble channels", treble_channel(radius, theta));
treble_theta_l = treble_theta - (treble_mics / 360 * ma.PI);
treble_theta_r = treble_theta + (treble_mics / 360 * ma.PI);
treble = _ <: treble_channel_group(treble_radius, treble_theta_l),treble_channel_group(treble_radius, treble_theta_r);
xver_signals_group = hgroup("[2]Signal channels", treble,(bass_group <: _,_));
process = amplifier(amp_drive) : crossover(xver_freq) : xver_signals_group :> _,_;
|
b0c4605f60b6ed7959b0be9e2474944558f136e5c2677b51b20601dfdf22decf | orchidas/Music-256A | flanger.dsp | import("stdfaust.lib");
flangerMaxDelay = hslider("maxDelay",10,0,20,0.01)*0.001*ma.SR : si.smoo; //control either this parameter or depth
flangerDepth = hslider("depth",0,0,1,0.01) : si.smoo;
flangerSpeed = hslider("speed",1,0.1,10,0.01) : si.smoo;
gain = hslider("gain",1,0,1,0.01) : si.smoo;
gate = button("gate");
flanger(maxDelay,depth,speed) = comb(delLength,depth)
with{
delLength = maxDelay*(os.osc(speed)+1)/2;
comb(delLength,b1) = _ <: (de.fdelay4(2048,delLength) : *(b1)),_ : + ;
};
process = hgroup("flanger",par(i,2,flanger(flangerMaxDelay,flangerDepth,flangerSpeed)*gain*gate));
| https://raw.githubusercontent.com/orchidas/Music-256A/46c465a3f004a00723088f918106a854af863d08/ofEffectsChain/src/faust/flanger.dsp | faust | control either this parameter or depth | import("stdfaust.lib");
flangerDepth = hslider("depth",0,0,1,0.01) : si.smoo;
flangerSpeed = hslider("speed",1,0.1,10,0.01) : si.smoo;
gain = hslider("gain",1,0,1,0.01) : si.smoo;
gate = button("gate");
flanger(maxDelay,depth,speed) = comb(delLength,depth)
with{
delLength = maxDelay*(os.osc(speed)+1)/2;
comb(delLength,b1) = _ <: (de.fdelay4(2048,delLength) : *(b1)),_ : + ;
};
process = hgroup("flanger",par(i,2,flanger(flangerMaxDelay,flangerDepth,flangerSpeed)*gain*gate));
|
84d362bcf6364dd67ac6c0b0575a971270beaad00c3131a18ed5880a6042765f | grame-cncm/faustdoc | exfaust43.dsp |
import("stdfaust.lib");
// IIR, comb filter
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01) :
+ ~ transformation;
transformation = @(hslider("delay", 0, 0, 20, 1)) : *(hslider("gain", 0, -0.98, 0.98, 0.01));
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/workshops/2020-04-10-faust-101/exfaust43/exfaust43.dsp | faust | IIR, comb filter |
import("stdfaust.lib");
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01) :
+ ~ transformation;
transformation = @(hslider("delay", 0, 0, 20, 1)) : *(hslider("gain", 0, -0.98, 0.98, 0.01));
|
c505d80e2cd15f3b80c4d9004d2f345b169e4c705c1e753586e6f222938c5c3c | grame-cncm/faustdoc | exfaust44.dsp |
import("stdfaust.lib");
// Karplus Strong (1/2)
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01) :
+ ~ transformation;
transformation = @(hslider("delay", 0, 0, 200, 1)) : mean : *(hslider("gain", 0, -0.98, 0.98, 0.01));
mean(x) = (x+x')/2;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/workshops/2020-04-10-faust-101/exfaust44/exfaust44.dsp | faust | Karplus Strong (1/2) |
import("stdfaust.lib");
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01) :
+ ~ transformation;
transformation = @(hslider("delay", 0, 0, 200, 1)) : mean : *(hslider("gain", 0, -0.98, 0.98, 0.01));
mean(x) = (x+x')/2;
|
066681ca0ed815cbf784eb98667daf608b7efc559d577eee07d35871002e0b06 | grame-cncm/faustdoc | exfaust20.dsp |
import("stdfaust.lib");
// Karplus Strong (1/2)
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01) :
+ ~ transformation;
transformation = @(hslider("delay", 0, 0, 200, 1)) : moyenne : *(hslider("gain", 0, -0.98, 0.98, 0.01));
moyenne(x) = (x+x')/2;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/workshops/2020-03-24-faust-citi/exfaust20/exfaust20.dsp | faust | Karplus Strong (1/2) |
import("stdfaust.lib");
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01) :
+ ~ transformation;
transformation = @(hslider("delay", 0, 0, 200, 1)) : moyenne : *(hslider("gain", 0, -0.98, 0.98, 0.01));
moyenne(x) = (x+x')/2;
|
07314ed613c866cea74d1d1b02db3e7c32ea758d9deb2a79de3dda59f10c5c74 | grame-cncm/faustdoc | exfaust19.dsp |
import("stdfaust.lib");
// IIR, Filtre en peigne
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01) :
+ ~ transformation;
transformation = @(hslider("delay", 0, 0, 20, 1)) : *(hslider("gain", 0, -0.98, 0.98, 0.01));
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/workshops/2020-03-24-faust-citi/exfaust19/exfaust19.dsp | faust | IIR, Filtre en peigne |
import("stdfaust.lib");
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01) :
+ ~ transformation;
transformation = @(hslider("delay", 0, 0, 20, 1)) : *(hslider("gain", 0, -0.98, 0.98, 0.01));
|
78e1d3a0a064ff8666ffb9b7f8467b9e180b0f2f27ddefa820073fcba2e73dda | orchidas/Music-256A | reverb.dsp | import ("stdfaust.lib");
//need to fix this to add gate button
fsmax = 48000;
rdel = hslider("in_delay", 60,20,100,0.1);
f1 = 200;
f2 = 6000;
t60dc = 3;
t60m = 2;
gate = button("gate");
process = hgroup("reverb", re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax));
| https://raw.githubusercontent.com/orchidas/Music-256A/46c465a3f004a00723088f918106a854af863d08/ofEffectsChain/src/faust/reverb.dsp | faust | need to fix this to add gate button | import ("stdfaust.lib");
fsmax = 48000;
rdel = hslider("in_delay", 60,20,100,0.1);
f1 = 200;
f2 = 6000;
t60dc = 3;
t60m = 2;
gate = button("gate");
process = hgroup("reverb", re.zita_rev1_stereo(rdel,f1,f2,t60dc,t60m,fsmax));
|
2154b0dc93e5dd7c09bb688720b47f21b6e997b71811e9cafbb7b6584af3d560 | grame-cncm/faustdoc | exfaust45.dsp |
import("stdfaust.lib");
// Karplus Strong (2/2)
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01)
: *(envelop)
: + ~ transformation;
transformation = @(hslider("delay", 0, 0, 200, 1)) : mean : *(hslider("gain", 0, -0.999, 0.999, 0.001));
mean(x) = (x+x')/2;
envelop = button("gate") : upfront : en.ar(0.002, 0.01);
upfront(x) = x>x';
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/workshops/2020-04-10-faust-101/exfaust45/exfaust45.dsp | faust | Karplus Strong (2/2) |
import("stdfaust.lib");
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01)
: *(envelop)
: + ~ transformation;
transformation = @(hslider("delay", 0, 0, 200, 1)) : mean : *(hslider("gain", 0, -0.999, 0.999, 0.001));
mean(x) = (x+x')/2;
envelop = button("gate") : upfront : en.ar(0.002, 0.01);
upfront(x) = x>x';
|
ad514bffc0608de26fbae0f3fc12a57b477d2196f812459c57f18f506f66bb9b | grame-cncm/faustdoc | exfaust21.dsp |
import("stdfaust.lib");
// Karplus Strong (2/2)
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01)
: *(envelop)
: + ~ transformation;
transformation = @(hslider("delay", 0, 0, 200, 1)) : moyenne : *(hslider("gain", 0, -0.999, 0.999, 0.001));
moyenne(x) = (x+x')/2;
envelop = button("gate") : upfront : en.ar(0.002, 0.01);
upfront(x) = x>x';
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/workshops/2020-03-24-faust-citi/exfaust21/exfaust21.dsp | faust | Karplus Strong (2/2) |
import("stdfaust.lib");
process = no.noise * hslider("noise", 0.5, 0, 1, 0.01)
: *(envelop)
: + ~ transformation;
transformation = @(hslider("delay", 0, 0, 200, 1)) : moyenne : *(hslider("gain", 0, -0.999, 0.999, 0.001));
moyenne(x) = (x+x')/2;
envelop = button("gate") : upfront : en.ar(0.002, 0.01);
upfront(x) = x>x';
|
4cf37032063dbeb9f2b37e7c093773e96294ac044251a05ac200cecea22875a3 | orchidas/Music-256A | guitar.dsp | import("stdfaust.lib");
//freq = hslider("freq", 440, 20, 20000, 1); // Hz
gain = hslider("gain", 1, 0, 10, 0.01);
// Excitator
//-----------
upfront(x) = (x-x') > 0.0;
decay(n,x) = x - (x>0.0)/n;
release(n) = + ~ decay(n);
trigger(n) = upfront : release(n) : >(0.0);
size = hslider("excitation [unit:f]", 128, 2, 512, 1);
// resonator
//------------
dur = hslider("duration [unit:f] [midi: ctrl 7]", 128, 2 ,512, 1);
att = hslider("attenuation", 0.03, 0, 1, 0.01);
average(x) = (x+x')/2;
resonator(d, a) = (+ : de.fdelay4(4096, d-1.5)) ~ (average : *(1.0-a)) ;
//string frequency is modulated by sine wave, added to LPF and distorted
modIndex = hslider("modIndex" ,3 ,1, 10 ,1) : si.smoo;
modFreq = hslider("modFreq", 5, 0, 10, 1) : si.smoo;
drive = hslider("drive", 0, 0, 1, 0.01) : si.smoo;
maxDur = hslider("maxDur [unit:s]", 1.5,1,2,0.01);
delayDur = hslider("delayDur [unit:s]",0.5,0,1,0.01) : si.smoo;
d = hslider("echoDuration",0.5,0,1,0.01) : si.smoo;
f = hslider("echoFeedback",0,0,1,0.01) : si.smoo;
echo(duration,feedback) = +~(de.delay(ma.np2(44100),delayLength) : *(feedback))
with{
delayLength = duration*ma.SR-1;
};
process = hgroup("karplus", no.noise * hslider("level", 0.5, 0, 1, 0.01)
: hgroup("excitator", *(button("play"): trigger(size)))
: hgroup("resonator", resonator(dur, att))
: hgroup("distortion",ef.cubicnl(drive,0))
: hgroup("delay", echo(d,f))
* hgroup("am", modIndex * os.osc(modFreq))
* gain);
| https://raw.githubusercontent.com/orchidas/Music-256A/46c465a3f004a00723088f918106a854af863d08/MidiPolyPlugin/Source/faust/guitar.dsp | faust | freq = hslider("freq", 440, 20, 20000, 1); // Hz
Excitator
-----------
resonator
------------
string frequency is modulated by sine wave, added to LPF and distorted | import("stdfaust.lib");
gain = hslider("gain", 1, 0, 10, 0.01);
upfront(x) = (x-x') > 0.0;
decay(n,x) = x - (x>0.0)/n;
release(n) = + ~ decay(n);
trigger(n) = upfront : release(n) : >(0.0);
size = hslider("excitation [unit:f]", 128, 2, 512, 1);
dur = hslider("duration [unit:f] [midi: ctrl 7]", 128, 2 ,512, 1);
att = hslider("attenuation", 0.03, 0, 1, 0.01);
average(x) = (x+x')/2;
resonator(d, a) = (+ : de.fdelay4(4096, d-1.5)) ~ (average : *(1.0-a)) ;
modIndex = hslider("modIndex" ,3 ,1, 10 ,1) : si.smoo;
modFreq = hslider("modFreq", 5, 0, 10, 1) : si.smoo;
drive = hslider("drive", 0, 0, 1, 0.01) : si.smoo;
maxDur = hslider("maxDur [unit:s]", 1.5,1,2,0.01);
delayDur = hslider("delayDur [unit:s]",0.5,0,1,0.01) : si.smoo;
d = hslider("echoDuration",0.5,0,1,0.01) : si.smoo;
f = hslider("echoFeedback",0,0,1,0.01) : si.smoo;
echo(duration,feedback) = +~(de.delay(ma.np2(44100),delayLength) : *(feedback))
with{
delayLength = duration*ma.SR-1;
};
process = hgroup("karplus", no.noise * hslider("level", 0.5, 0, 1, 0.01)
: hgroup("excitator", *(button("play"): trigger(size)))
: hgroup("resonator", resonator(dur, att))
: hgroup("distortion",ef.cubicnl(drive,0))
: hgroup("delay", echo(d,f))
* hgroup("am", modIndex * os.osc(modFreq))
* gain);
|
648d7077bb011421e988de7d41f1c78a68bd90037a659772b7dde18e795d0d2f | xiaozhuo12138/StdSamples | nextprimeverb.dsp | import("stdfaust.lib");
// ------ comb
dflc(t, g) = (+ : de.delay(ma.SR, int(t-1)))~*(max(0, min(0.999, g))) : mem;
// ------ allpass
alp(t, g) = _<:(_*(ma.neg(max(0.5, min(0.9, g)))))+(dflc(t, g)*(1-(g*g)));
t = hslider("Largest T",2,2,24000,1);
fbk = hslider("FeedBack", 0.708, 0, 0.99, 0.01) : si.smoo;
np = ffunction(int next_pr(int), <nextprime.h>,"");
alpseq(N,t,fb) = seq(i, N, alp((t/(i+1)) : np, fb));
process = alpseq(16,t,fbk);
| https://raw.githubusercontent.com/xiaozhuo12138/StdSamples/1a52fc6bf6e7600a503c0e5731bb1b9d2b077fef/Faust/faust-libraries/examples/cfunctions/nextprimeverb.dsp | faust | ------ comb
------ allpass | import("stdfaust.lib");
dflc(t, g) = (+ : de.delay(ma.SR, int(t-1)))~*(max(0, min(0.999, g))) : mem;
alp(t, g) = _<:(_*(ma.neg(max(0.5, min(0.9, g)))))+(dflc(t, g)*(1-(g*g)));
t = hslider("Largest T",2,2,24000,1);
fbk = hslider("FeedBack", 0.708, 0, 0.99, 0.01) : si.smoo;
np = ffunction(int next_pr(int), <nextprime.h>,"");
alpseq(N,t,fb) = seq(i, N, alp((t/(i+1)) : np, fb));
process = alpseq(16,t,fbk);
|
242a379fc6be19697586d5984451ceae3708125f02dbe2d467be9f8de60ca8bc | improvoid/EchoMatrix | EchoMatrix.dsp | declare name "EchoMatrix";
declare author "ImprovOid";
declare copyright "ImprovOid";
declare version "1.00";
declare license "BSD";
import("stdfaust.lib");
// Can change the number of delay lines and the matrix size
numberOfDelays = 6;
// Can change the max delay time, calculates samples
maxDelaySeconds = 2;
maxDelayMsec = maxDelaySeconds * 1000.0;
maxDelaySamples = maxDelaySeconds * float(ma.SR);
minDelaySamples = ma.SR / 10000;
// Define the matrix mixer, can be any N x M size
// Note the hslider label spec. It defines the knobs for the whole matrix
// t:EchoMatrix : Defines a "t" tab pane called EchoMatrix, essentially the "top" level
// /h:[2]MatrixMixed : Defines one tab page called MatrixMixer, it will be a "h" horizontal layout and the [2] second page
// /v:Unit%2c Out : Defines the "v" vertical knob group for all of the Units, %2c imbeds a 2 digit column number
// /U%1c to U%1in[style:knob] : Defines the labels on the knobs an styles the sliders as knobs
volume(c, in) = hslider("t:EchoMatrix/h:[2]MatrixMixer/v:Unit%2c Out/U%1c to U%1in[style:knob]",0.0,0.0,1.0,0.001): si.smoo;
Mixer(N,out) = par(in, N, *(volume(in, out)) ) :> _;
Matrix(N,M) = par(in, N, _) <: par(out, M, Mixer(N, out));
// Make a square matrix mixer
fdMatrix(N) = Matrix(N, N);
// Modulation waveforms, saw->sine->reverse saw
modsaw(f,m) = (0.5 - m) : max(0.0) : _ * 2.0 * os.lf_saw(f);
modsin(f,m) = (((m < 0.5) * m * 2.0) + ((m >= 0.5) * (1.0 - m) * 2.0)) * os.oscsin(f);
modrevsaw(f,m) = (m - 0.5) : max(0.0) : _ * 2.0 * (0.0 - os.lf_saw(f));
// Slider morphs between wave types
// Note the hslider label spec. It will define the wave morph knobs
// There will be one for each modulator assigned one per delay
// t:EchoMatrix : Defines a "t" tab pane called EchoMatrix, essentially the "top" level
// /v:[1]Delays : Defines one tab page called Delays, it will be a "v" vertical layout and the [1] 1st page
// /h:[4]ModWave : Defines a control group that will group sub-controls in a "h" horizontal layout
// /MW U%j[style:knob] : Defines the labels on the knobs an styles the sliders as knobs
modwave(j,f) = modsaw(f,m) + modsin(f,m) + modrevsaw(f,m) : si.smoo
with {
m = hslider("t:EchoMatrix/v:[1]Delays/h:[4]ModWave/MW U%j[style:knob]",0.5, 0.0, 1.0, 0.001) //: si.smoo;
};
// Define the matrix, delays, and feedback paths
// The last 2 channels just flow through with no feedback path
// The par(..) constructs create multiple signals in parallel
// The ~ (recursive operator) connects the outputs sequentially to the inputs
// The "effect" in this case is a delay implemented by the Faust library fdelay2 function
// This provides a three point interpolated (smoothed) delay that works quite nicely
// There are other delays avalable that work differently, but any effect could really be used
// Note the hslider label specs. They define the delay time, mod frequency and mod depth
// There will be one for each modulator assigned one per delay
// t:EchoMatrix : Defines a "t" tab pane called EchoMatrix, essentially the "top" level
// /v:[1]Delays : Defines one tab page called Delays, it will be a "v" vertical layout and the [1] 1st page
// These same specs are used for all of the controls "paths", so all of the controls will end up on the Delays tab
// Idential control paths define identical controls, so if you want one control to control multiple things
// use the same path for multiple controls
// The control numbers inserted with %j start with 0
//
// /h:[3]Delay Time : Defines the [2] second horizontal group of delay time controls
// /DT U%j[unit:ms][scale:exp][style:knob] : Defines the delay time (DT) with a msec label as a knob.
// The control is styled as a knob with an exponential range, so there will be more resolution in the low end of the knob
//
// /h:[4]ModFreq : Defines the [3] third horizontal group of modulation frequency controls
// /MF U%j[scale:exp][style:knob] : Defines the mod frequency control (MF) as a knob.
// The control is styled as a knob with an exponential range, so there will be more resolution in the low end of the knob
//
// /h:[5]ModDepth : Defines the [4] fourth horizontal group of modulation depth controls
// /MD U%j[scale:exp][style:knob] : Defines the mod depth control (MD) as a knob.
// The control is styled as a knob with an exponential range, so there will be more resolution in the low end of the knob
matrixDelays(N) = _,_ : ( fdMatrix(N + 2) : par(i,N, effects(i)),_,_ ) ~ par(r,N,_) : par(l,N,!),_,_
with {
// For now, the effect is just the delay with a time and a modulator
effects(j) = de.fdelay2(maxDelaySamples, dtime(j));
dtime(j) = hslider("t:EchoMatrix/v:[1]Delays/h:[2]Delay Time/DT U%j[unit:ms][scale:exp][style:knob]", 0, 0, maxDelayMsec, 0.1) : si.smoo :
*(1.0+modOsc(j))*ma.SR/1000.0
: min(maxDelaySamples) : max(minDelaySamples);
modFreq(j) = hslider("t:EchoMatrix/v:[1]Delays/h:[3]ModFreq/MF U%j[scale:exp][style:knob]", 0.05, 0.0, 10.0, 0.001) : si.smoo ;
modDepth(j) = hslider("t:EchoMatrix/v:[1]Delays/h:[4]ModDepth/MD U%j[scale:exp][style:knob]", 0.0, 0.0, 0.8, 0.001) : si.smoo ;
modOsc(j) = modwave(j, modFreq(j)) * modDepth(j);
};
// Allow some gain control on the output
// t:EchoMatrix : Defines a "t" tab pane called EchoMatrix, essentially the "top" level
// /v:[1]Delays : Defines one tab page called Delays, it will be a "v" vertical layout and the [1] 1st page
// These same specs are used for all of the controls "paths", so all of the controls will end up on the Delays tab
// Idential control paths define identical controls, so if you want one control to control multiple things
// use the same path for multiple controls
// /[1]Output Gain : Defines the overall volume control as the [1] first control
stereoSplit = _,_ : matrixDelays(numberOfDelays) : (_*outputGain), (_*outputGain)
with {
outputGain = hslider("t:EchoMatrix/v:[1]Delays/[1]Output Gain", 0.9, 0.0, 1.5, 0.01) : si.smoo;
};
process = _,_ : stereoSplit : _,_;
| https://raw.githubusercontent.com/improvoid/EchoMatrix/b8f33983962802f770ee93754fd618a170dc5d2d/EchoMatrix.dsp | faust | Can change the number of delay lines and the matrix size
Can change the max delay time, calculates samples
Define the matrix mixer, can be any N x M size
Note the hslider label spec. It defines the knobs for the whole matrix
t:EchoMatrix : Defines a "t" tab pane called EchoMatrix, essentially the "top" level
/h:[2]MatrixMixed : Defines one tab page called MatrixMixer, it will be a "h" horizontal layout and the [2] second page
/v:Unit%2c Out : Defines the "v" vertical knob group for all of the Units, %2c imbeds a 2 digit column number
/U%1c to U%1in[style:knob] : Defines the labels on the knobs an styles the sliders as knobs
Make a square matrix mixer
Modulation waveforms, saw->sine->reverse saw
Slider morphs between wave types
Note the hslider label spec. It will define the wave morph knobs
There will be one for each modulator assigned one per delay
t:EchoMatrix : Defines a "t" tab pane called EchoMatrix, essentially the "top" level
/v:[1]Delays : Defines one tab page called Delays, it will be a "v" vertical layout and the [1] 1st page
/h:[4]ModWave : Defines a control group that will group sub-controls in a "h" horizontal layout
/MW U%j[style:knob] : Defines the labels on the knobs an styles the sliders as knobs
: si.smoo;
Define the matrix, delays, and feedback paths
The last 2 channels just flow through with no feedback path
The par(..) constructs create multiple signals in parallel
The ~ (recursive operator) connects the outputs sequentially to the inputs
The "effect" in this case is a delay implemented by the Faust library fdelay2 function
This provides a three point interpolated (smoothed) delay that works quite nicely
There are other delays avalable that work differently, but any effect could really be used
Note the hslider label specs. They define the delay time, mod frequency and mod depth
There will be one for each modulator assigned one per delay
t:EchoMatrix : Defines a "t" tab pane called EchoMatrix, essentially the "top" level
/v:[1]Delays : Defines one tab page called Delays, it will be a "v" vertical layout and the [1] 1st page
These same specs are used for all of the controls "paths", so all of the controls will end up on the Delays tab
Idential control paths define identical controls, so if you want one control to control multiple things
use the same path for multiple controls
The control numbers inserted with %j start with 0
/h:[3]Delay Time : Defines the [2] second horizontal group of delay time controls
/DT U%j[unit:ms][scale:exp][style:knob] : Defines the delay time (DT) with a msec label as a knob.
The control is styled as a knob with an exponential range, so there will be more resolution in the low end of the knob
/h:[4]ModFreq : Defines the [3] third horizontal group of modulation frequency controls
/MF U%j[scale:exp][style:knob] : Defines the mod frequency control (MF) as a knob.
The control is styled as a knob with an exponential range, so there will be more resolution in the low end of the knob
/h:[5]ModDepth : Defines the [4] fourth horizontal group of modulation depth controls
/MD U%j[scale:exp][style:knob] : Defines the mod depth control (MD) as a knob.
The control is styled as a knob with an exponential range, so there will be more resolution in the low end of the knob
For now, the effect is just the delay with a time and a modulator
Allow some gain control on the output
t:EchoMatrix : Defines a "t" tab pane called EchoMatrix, essentially the "top" level
/v:[1]Delays : Defines one tab page called Delays, it will be a "v" vertical layout and the [1] 1st page
These same specs are used for all of the controls "paths", so all of the controls will end up on the Delays tab
Idential control paths define identical controls, so if you want one control to control multiple things
use the same path for multiple controls
/[1]Output Gain : Defines the overall volume control as the [1] first control | declare name "EchoMatrix";
declare author "ImprovOid";
declare copyright "ImprovOid";
declare version "1.00";
declare license "BSD";
import("stdfaust.lib");
numberOfDelays = 6;
maxDelaySeconds = 2;
maxDelayMsec = maxDelaySeconds * 1000.0;
maxDelaySamples = maxDelaySeconds * float(ma.SR);
minDelaySamples = ma.SR / 10000;
volume(c, in) = hslider("t:EchoMatrix/h:[2]MatrixMixer/v:Unit%2c Out/U%1c to U%1in[style:knob]",0.0,0.0,1.0,0.001): si.smoo;
Mixer(N,out) = par(in, N, *(volume(in, out)) ) :> _;
Matrix(N,M) = par(in, N, _) <: par(out, M, Mixer(N, out));
fdMatrix(N) = Matrix(N, N);
modsaw(f,m) = (0.5 - m) : max(0.0) : _ * 2.0 * os.lf_saw(f);
modsin(f,m) = (((m < 0.5) * m * 2.0) + ((m >= 0.5) * (1.0 - m) * 2.0)) * os.oscsin(f);
modrevsaw(f,m) = (m - 0.5) : max(0.0) : _ * 2.0 * (0.0 - os.lf_saw(f));
modwave(j,f) = modsaw(f,m) + modsin(f,m) + modrevsaw(f,m) : si.smoo
with {
};
matrixDelays(N) = _,_ : ( fdMatrix(N + 2) : par(i,N, effects(i)),_,_ ) ~ par(r,N,_) : par(l,N,!),_,_
with {
effects(j) = de.fdelay2(maxDelaySamples, dtime(j));
dtime(j) = hslider("t:EchoMatrix/v:[1]Delays/h:[2]Delay Time/DT U%j[unit:ms][scale:exp][style:knob]", 0, 0, maxDelayMsec, 0.1) : si.smoo :
*(1.0+modOsc(j))*ma.SR/1000.0
: min(maxDelaySamples) : max(minDelaySamples);
modFreq(j) = hslider("t:EchoMatrix/v:[1]Delays/h:[3]ModFreq/MF U%j[scale:exp][style:knob]", 0.05, 0.0, 10.0, 0.001) : si.smoo ;
modDepth(j) = hslider("t:EchoMatrix/v:[1]Delays/h:[4]ModDepth/MD U%j[scale:exp][style:knob]", 0.0, 0.0, 0.8, 0.001) : si.smoo ;
modOsc(j) = modwave(j, modFreq(j)) * modDepth(j);
};
stereoSplit = _,_ : matrixDelays(numberOfDelays) : (_*outputGain), (_*outputGain)
with {
outputGain = hslider("t:EchoMatrix/v:[1]Delays/[1]Output Gain", 0.9, 0.0, 1.5, 0.01) : si.smoo;
};
process = _,_ : stereoSplit : _,_;
|
98837f4354f2dec5cdfc65aa2329c180da60bf17662ec671147cff4e7d32d7d3 | dblanchemain/MultiSpace3D | Auro51.dsp | declare name "objMatrixAuro51.dsp"; // modifier le nom de votre greffon
declare version "1.0";
declare author "D.Blanchemain";
declare license "BSD";
declare copyright "(c)D.Blanchemain 2020";
import("stdfaust.lib");
Matrix(N,M) =_*cdistance:filter:transpose:delay:freeverb<: par(out, M, *(Fader(1,out): si.smoo)) :> par(out, M, _)
with {
tabSpeakerX(0)=-1.000;
tabSpeakerY(0)=-0.181;
tabSpeakerZ(0)=1.000;
tabSpeakerD(0)=1.426;
tabSpeakerX(1)=1.000;
tabSpeakerY(1)=-0.181;
tabSpeakerZ(1)=1.000;
tabSpeakerD(1)=1.426;
tabSpeakerX(2)=-0.002;
tabSpeakerY(2)=-0.181;
tabSpeakerZ(2)=1.000;
tabSpeakerD(2)=1.016;
tabSpeakerX(3)=-1.000;
tabSpeakerY(3)=-0.181;
tabSpeakerZ(3)=0.500;
tabSpeakerD(3)=1.133;
tabSpeakerX(4)=1.000;
tabSpeakerY(4)=-0.181;
tabSpeakerZ(4)=0.500;
tabSpeakerD(4)=1.133;
dtencGen(in, out) = sqrt(pow(tabSpeakerX(out)-x(in),2) + pow(tabSpeakerY(out)-y(in),2) + pow(tabSpeakerZ(out)-z(in),2));
process = Matrix(1,5); // le deuxième chiffre permet de définir la dimension de votre espace :9,10, ...
hspot = hslider("Hot Spot",-20,-50,0,1);
dgain(in, out) = ba.db2linear((hspot/tabSpeakerD(out))*dtencGen(in,out));
x(i) = hslider("/X%i",0,-1,1,0.01);
y(i) = hslider("/Y%i",0,-1,1,0.01);
z(i) = hslider("/Z%i",0,-1,1,0.01);
Fader(in,out)= vgroup("[1]Input %2in",dgain(in,out));
cdistance=hslider("dt",1,0,1,0.1);
paramDistance(x)=hgroup("[2]Distance",x);
//-----------------------------------------------------------
// LPF
//-----------------------------------------------------------
ampfreq=vslider("LPF Amp[unit:Hz]",5000, 20, 19980, 1);
rpf=ampfreq:floor;
LPF=fi.lowpass(3,rpf);
fbp = checkbox("[0] Bypass [tooltip: When this is checked, the filters has no effect]");
filter=paramDistance(vgroup("FILTERS",ba.bypass1(fbp,hgroup("[1]",LPF))));
//-----------------------------------------------------------
// Pitchshifting
//-----------------------------------------------------------
paramPitch(x)=vgroup("[2]Param",x);pwindow=paramPitch(vslider("window (samples)[style:knob]", 1000, 50, 10000, 1));
pxfade=paramPitch(vslider("xfade (samples)[style:knob]", 10, 1, 10000, 1));
pshift=vslider("shift (semitones) ", 0, -12, +12, 0.1):si.smoo;
pbp = checkbox("[0] Bypass [tooltip: When this is checked, the filters has no effect]");
transpose=paramDistance(vgroup("TRANSPOSE",ba.bypass1(pbp,hgroup("[1]",ef.transpose(pwindow,pxfade,pshift)))));
//-----------------------------------------------------------
// Delay
//-----------------------------------------------------------
delay_group(x) = paramDistance(vgroup("[2]DELAY", x));
cbp =delay_group(vgroup("[0]",checkbox("Bypass [tooltip: When this is checked, Delay has no effect]")));
voice = delay_group(vgroup("[1]",(+ : de.sdelay(N, interp, dtime)) ~ *(fback)));
N = int(2^19);
interp = hslider("interpolation[unit:ms][style:knob]",10,1,100,0.1)*ma.SR/1000.0;
fback = hslider("feedback[style:knob]",0,0,100,0.1)/100.0;
dtime = hslider("delay[unit:ms][style:knob]", 0, 0, 1000, 0.01)*ma.SR/1000.0;
delay = ba.bypass1(cbp,voice);
//-----------------------------------------------------------
// Freeverb
//-----------------------------------------------------------
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
origSR = ma.SR;
g=parameters(vslider("[1] Wet [tooltip: The amount of reverb applied to the signal between 0 and 1 with 1 for the maximum amount of reverb.]", 0.3333, 0.3, 1, 0.025));
freeverbMono=_<: (*(g)*fixedgain :re.mono_freeverb(combfeed, allpassfeed, damping, spatSpread)),*(1-g):> _;
parameters(x) = paramDistance(hgroup("[3]Freeverb",x));
knobGroup(x) = parameters(vgroup("[1]",x));
fvbp = knobGroup(checkbox("[0] Bypass [tooltip: When this is checked, the freeverb has no effect]"));
damping = knobGroup(vslider("[1] Damp [style: knob] [tooltip: Somehow control the density of the reverb.]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR);
combfeed = knobGroup(vslider("[2] RoomSize [style: knob] [tooltip: The room size between 0 and 1 with 1 for the largest room.]", 0.5, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom);
spatSpread = knobGroup(vslider("[3] Stereo Spread [style: knob] [tooltip: Spatial spread between 0 and 1 with 1 for maximum spread.]",0.5,0,1,0.01)*46*ma.SR/origSR: int);
freeverb = ba.bypass1(fvbp,freeverbMono);
};
process = Matrix(1,5);
| https://raw.githubusercontent.com/dblanchemain/MultiSpace3D/5125d94de7f28e47c15e4432bba31a1ad7a51fb8/Plugins/DSP/Auro51.dsp | faust | modifier le nom de votre greffon
le deuxième chiffre permet de définir la dimension de votre espace :9,10, ...
-----------------------------------------------------------
LPF
-----------------------------------------------------------
-----------------------------------------------------------
Pitchshifting
-----------------------------------------------------------
-----------------------------------------------------------
Delay
-----------------------------------------------------------
-----------------------------------------------------------
Freeverb
----------------------------------------------------------- | declare version "1.0";
declare author "D.Blanchemain";
declare license "BSD";
declare copyright "(c)D.Blanchemain 2020";
import("stdfaust.lib");
Matrix(N,M) =_*cdistance:filter:transpose:delay:freeverb<: par(out, M, *(Fader(1,out): si.smoo)) :> par(out, M, _)
with {
tabSpeakerX(0)=-1.000;
tabSpeakerY(0)=-0.181;
tabSpeakerZ(0)=1.000;
tabSpeakerD(0)=1.426;
tabSpeakerX(1)=1.000;
tabSpeakerY(1)=-0.181;
tabSpeakerZ(1)=1.000;
tabSpeakerD(1)=1.426;
tabSpeakerX(2)=-0.002;
tabSpeakerY(2)=-0.181;
tabSpeakerZ(2)=1.000;
tabSpeakerD(2)=1.016;
tabSpeakerX(3)=-1.000;
tabSpeakerY(3)=-0.181;
tabSpeakerZ(3)=0.500;
tabSpeakerD(3)=1.133;
tabSpeakerX(4)=1.000;
tabSpeakerY(4)=-0.181;
tabSpeakerZ(4)=0.500;
tabSpeakerD(4)=1.133;
dtencGen(in, out) = sqrt(pow(tabSpeakerX(out)-x(in),2) + pow(tabSpeakerY(out)-y(in),2) + pow(tabSpeakerZ(out)-z(in),2));
hspot = hslider("Hot Spot",-20,-50,0,1);
dgain(in, out) = ba.db2linear((hspot/tabSpeakerD(out))*dtencGen(in,out));
x(i) = hslider("/X%i",0,-1,1,0.01);
y(i) = hslider("/Y%i",0,-1,1,0.01);
z(i) = hslider("/Z%i",0,-1,1,0.01);
Fader(in,out)= vgroup("[1]Input %2in",dgain(in,out));
cdistance=hslider("dt",1,0,1,0.1);
paramDistance(x)=hgroup("[2]Distance",x);
ampfreq=vslider("LPF Amp[unit:Hz]",5000, 20, 19980, 1);
rpf=ampfreq:floor;
LPF=fi.lowpass(3,rpf);
fbp = checkbox("[0] Bypass [tooltip: When this is checked, the filters has no effect]");
filter=paramDistance(vgroup("FILTERS",ba.bypass1(fbp,hgroup("[1]",LPF))));
paramPitch(x)=vgroup("[2]Param",x);pwindow=paramPitch(vslider("window (samples)[style:knob]", 1000, 50, 10000, 1));
pxfade=paramPitch(vslider("xfade (samples)[style:knob]", 10, 1, 10000, 1));
pshift=vslider("shift (semitones) ", 0, -12, +12, 0.1):si.smoo;
pbp = checkbox("[0] Bypass [tooltip: When this is checked, the filters has no effect]");
transpose=paramDistance(vgroup("TRANSPOSE",ba.bypass1(pbp,hgroup("[1]",ef.transpose(pwindow,pxfade,pshift)))));
delay_group(x) = paramDistance(vgroup("[2]DELAY", x));
cbp =delay_group(vgroup("[0]",checkbox("Bypass [tooltip: When this is checked, Delay has no effect]")));
voice = delay_group(vgroup("[1]",(+ : de.sdelay(N, interp, dtime)) ~ *(fback)));
N = int(2^19);
interp = hslider("interpolation[unit:ms][style:knob]",10,1,100,0.1)*ma.SR/1000.0;
fback = hslider("feedback[style:knob]",0,0,100,0.1)/100.0;
dtime = hslider("delay[unit:ms][style:knob]", 0, 0, 1000, 0.01)*ma.SR/1000.0;
delay = ba.bypass1(cbp,voice);
scaleroom = 0.28;
offsetroom = 0.7;
allpassfeed = 0.5;
scaledamp = 0.4;
fixedgain = 0.1;
origSR = ma.SR;
g=parameters(vslider("[1] Wet [tooltip: The amount of reverb applied to the signal between 0 and 1 with 1 for the maximum amount of reverb.]", 0.3333, 0.3, 1, 0.025));
freeverbMono=_<: (*(g)*fixedgain :re.mono_freeverb(combfeed, allpassfeed, damping, spatSpread)),*(1-g):> _;
parameters(x) = paramDistance(hgroup("[3]Freeverb",x));
knobGroup(x) = parameters(vgroup("[1]",x));
fvbp = knobGroup(checkbox("[0] Bypass [tooltip: When this is checked, the freeverb has no effect]"));
damping = knobGroup(vslider("[1] Damp [style: knob] [tooltip: Somehow control the density of the reverb.]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR);
combfeed = knobGroup(vslider("[2] RoomSize [style: knob] [tooltip: The room size between 0 and 1 with 1 for the largest room.]", 0.5, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom);
spatSpread = knobGroup(vslider("[3] Stereo Spread [style: knob] [tooltip: Spatial spread between 0 and 1 with 1 for maximum spread.]",0.5,0,1,0.01)*46*ma.SR/origSR: int);
freeverb = ba.bypass1(fvbp,freeverbMono);
};
process = Matrix(1,5);
|
7f7435b1cb2059c19976dcea9943f7b329ed591340ac8468329f987606eedd7a | rbdannenberg/arco | sine_aa_a.dsp | declare name "sine";
declare description "Sine Unit Generator for Arco";
declare interoplate "amp";
import("stdfaust.lib");
process(freq, amp) =
os.osc(freq)*amp;
| https://raw.githubusercontent.com/rbdannenberg/arco/22385b6ba59d3e4a5b5d35c264080537d806fd04/ugens/sine_aa_a.dsp | faust | declare name "sine";
declare description "Sine Unit Generator for Arco";
declare interoplate "amp";
import("stdfaust.lib");
process(freq, amp) =
os.osc(freq)*amp;
|
|
6463c63ce29e133b597db7b803fc8cdd53401521157b55b0cd154d0ff7d781f7 | rbdannenberg/arco | sine_ab_a.dsp | declare name "sine";
declare description "Sine Unit Generator for Arco";
declare interoplate "amp";
import("stdfaust.lib");
amp = nentry("amp", 0, 0, 1, 0.1);
process(freq) =
os.osc(freq)*amp;
| https://raw.githubusercontent.com/rbdannenberg/arco/22385b6ba59d3e4a5b5d35c264080537d806fd04/ugens/sine_ab_a.dsp | faust | declare name "sine";
declare description "Sine Unit Generator for Arco";
declare interoplate "amp";
import("stdfaust.lib");
amp = nentry("amp", 0, 0, 1, 0.1);
process(freq) =
os.osc(freq)*amp;
|
|
ccda7f8a46cd2f4f84003c8ba458dd3ff2f1aaa4e5a9442354bc7d31e5c55a60 | rbdannenberg/arco | sine_ba_a.dsp | declare name "sine";
declare description "Sine Unit Generator for Arco";
declare interoplate "amp";
import("stdfaust.lib");
freq = nentry("freq", 0, 0, 1, 0.1);
process(amp) =
os.osc(freq)*amp;
| https://raw.githubusercontent.com/rbdannenberg/arco/22385b6ba59d3e4a5b5d35c264080537d806fd04/ugens/sine_ba_a.dsp | faust | declare name "sine";
declare description "Sine Unit Generator for Arco";
declare interoplate "amp";
import("stdfaust.lib");
freq = nentry("freq", 0, 0, 1, 0.1);
process(amp) =
os.osc(freq)*amp;
|
|
280836c2aac8780ccd7542735acbd4279a9bb3134c634405cb9174b44be82435 | rbdannenberg/arco | sine_bb_a.dsp | declare name "sine";
declare description "Sine Unit Generator for Arco";
declare interoplate "amp";
import("stdfaust.lib");
freq = nentry("freq", 0, 0, 1, 0.1);
amp = nentry("amp", 0, 0, 1, 0.1);
process =
os.osc(freq)*amp;
| https://raw.githubusercontent.com/rbdannenberg/arco/22385b6ba59d3e4a5b5d35c264080537d806fd04/ugens/sine_bb_a.dsp | faust | declare name "sine";
declare description "Sine Unit Generator for Arco";
declare interoplate "amp";
import("stdfaust.lib");
freq = nentry("freq", 0, 0, 1, 0.1);
amp = nentry("amp", 0, 0, 1, 0.1);
process =
os.osc(freq)*amp;
|
|
6f180ec96a533384ef286f60c7eb041771f57b96049489a51bbf3d892c0c6792 | rbdannenberg/arco | sineb_bb_b.dsp | declare name "sineb";
declare description "Sine Unit Generator for Arco";
declare interoplate "amp";
import("stdfaust.lib");
freq = nentry("freq", 0, 0, 1, 0.1);
amp = nentry("amp", 0, 0, 1, 0.1);
process =
os.osc(freq)*amp;
| https://raw.githubusercontent.com/rbdannenberg/arco/22385b6ba59d3e4a5b5d35c264080537d806fd04/ugens/sineb_bb_b.dsp | faust | declare name "sineb";
declare description "Sine Unit Generator for Arco";
declare interoplate "amp";
import("stdfaust.lib");
freq = nentry("freq", 0, 0, 1, 0.1);
amp = nentry("amp", 0, 0, 1, 0.1);
process =
os.osc(freq)*amp;
|
|
ebee64aa32688c2b019b4bbdd96109ad93ed5f1495fccb8cb9416cdf253beb6f | grame-cncm/faustdoc | exfaust4.dsp |
import("stdfaust.lib");
// control variables
master = hslider("master", 0.3, 0, 2, 0.01);
pan = hslider("pan", 0.5, 0, 1, 0.01);
freq = nentry("freq [CV:1]", 440, 20, 20000, 1);
gate = button("gate [CV:2]");
gain = nentry("gain [CV:3]", 0.3, 0, 10, 0.01);
// relative amplitudes of the different partials
amp(1) = hslider("amp1", 1.0, 0, 3, 0.01);
amp(2) = hslider("amp2", 0.5, 0, 3, 0.01);
amp(3) = hslider("amp3", 0.25, 0, 3, 0.01);
// panner function
panner(pan, x) = x*sqrt(1-pan), x*sqrt(pan);
// additive synth: 3 sine oscillators with adsr envelop
partial(i) = amp(i+1)*os.osc((i+1)*freq);
process = sum(i, 3, partial(i))
* (gate : vgroup("1-adsr", en.adsr(0.05, 0.1, 0.1, 0.1)))
* gain : vgroup("2-master", *(master) : panner(pan));
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/workshops/2020-11-21-faust-vcvrack/exfaust4/exfaust4.dsp | faust | control variables
relative amplitudes of the different partials
panner function
additive synth: 3 sine oscillators with adsr envelop |
import("stdfaust.lib");
master = hslider("master", 0.3, 0, 2, 0.01);
pan = hslider("pan", 0.5, 0, 1, 0.01);
freq = nentry("freq [CV:1]", 440, 20, 20000, 1);
gate = button("gate [CV:2]");
gain = nentry("gain [CV:3]", 0.3, 0, 10, 0.01);
amp(1) = hslider("amp1", 1.0, 0, 3, 0.01);
amp(2) = hslider("amp2", 0.5, 0, 3, 0.01);
amp(3) = hslider("amp3", 0.25, 0, 3, 0.01);
panner(pan, x) = x*sqrt(1-pan), x*sqrt(pan);
partial(i) = amp(i+1)*os.osc((i+1)*freq);
process = sum(i, 3, partial(i))
* (gate : vgroup("1-adsr", en.adsr(0.05, 0.1, 0.1, 0.1)))
* gain : vgroup("2-master", *(master) : panner(pan));
|
2ac0a1028f609760161d12c773c582f456a6dcce92735f4a17bf76712fd3534a | orchidas/Music-256A | karplus.dsp | //-----------------------------------------------
// karplus-strong
//-----------------------------------------------
import("stdfaust.lib");
freq = hslider("freq", 440, 20, 20000, 1); // Hz
gain = hslider("gain", 1, 0, 10, 0.01);
// Excitator
//-----------
upfront(x) = (x-x') > 0.0;
decay(n,x) = x - (x>0.0)/n;
release(n) = + ~ decay(n);
trigger(n) = upfront : release(n) : >(0.0);
size = hslider("excitation [unit:f]", 128, 2, 512, 1);
// resonator
//------------
dur = hslider("duration [unit:f] [midi: ctrl 7]", 128, 2 ,512, 1);
att = hslider("attenuation", 0.03, 0, 1, 0.01);
average(x) = (x+x')/2;
//P = ma.SR/freq;
resonator(d, a) = (+ : de.fdelay4(4096, d-1.5)) ~ (average : *(1.0-a)) ;
//string frequency is modulated by sine wave, added to LPF and distorted
modIndex = hslider("modIndex" ,3 ,1, 10 ,1);
modFreq = hslider("modFreq", 5, 0, 10, 1);
modulation = os.osc(modFreq) * modIndex;
cutoff = hslider("cutoff", 2000, 500, 20000, 50) : si.smoo;
drive = hslider("drive", 0, 0, 1, 0.01);
process = no.noise * hslider("level", 0.5, 0, 1, 0.01)
: hgroup("excitator", *(button("play"): trigger(size)))
: hgroup("resonator", resonator(dur+modulation, att)) : hgroup("lpf", fi.lowpass(2, cutoff)) : hgroup("distortion", ef.cubicnl(drive,0))
* hgroup("am", modIndex * os.osc(modFreq));
| https://raw.githubusercontent.com/orchidas/Music-256A/46c465a3f004a00723088f918106a854af863d08/MidiPolyPlugin/Source/faust/karplus.dsp | faust | -----------------------------------------------
karplus-strong
-----------------------------------------------
Hz
Excitator
-----------
resonator
------------
P = ma.SR/freq;
string frequency is modulated by sine wave, added to LPF and distorted |
import("stdfaust.lib");
gain = hslider("gain", 1, 0, 10, 0.01);
upfront(x) = (x-x') > 0.0;
decay(n,x) = x - (x>0.0)/n;
release(n) = + ~ decay(n);
trigger(n) = upfront : release(n) : >(0.0);
size = hslider("excitation [unit:f]", 128, 2, 512, 1);
dur = hslider("duration [unit:f] [midi: ctrl 7]", 128, 2 ,512, 1);
att = hslider("attenuation", 0.03, 0, 1, 0.01);
average(x) = (x+x')/2;
resonator(d, a) = (+ : de.fdelay4(4096, d-1.5)) ~ (average : *(1.0-a)) ;
modIndex = hslider("modIndex" ,3 ,1, 10 ,1);
modFreq = hslider("modFreq", 5, 0, 10, 1);
modulation = os.osc(modFreq) * modIndex;
cutoff = hslider("cutoff", 2000, 500, 20000, 50) : si.smoo;
drive = hslider("drive", 0, 0, 1, 0.01);
process = no.noise * hslider("level", 0.5, 0, 1, 0.01)
: hgroup("excitator", *(button("play"): trigger(size)))
: hgroup("resonator", resonator(dur+modulation, att)) : hgroup("lpf", fi.lowpass(2, cutoff)) : hgroup("distortion", ef.cubicnl(drive,0))
* hgroup("am", modIndex * os.osc(modFreq));
|
be8ebaa143d70cb2ae663fb0d3f3a315ed5183ed32e16f314cf6ce9f7ca2947e | grame-cncm/faustlive | organ.dsp |
declare name "organ -- a simple additive synth";
declare author "Albert Graef";
declare version "1.0";
import("stdfaust.lib");
// control variables
vol = hslider("vol", 0.3, 0, 10, 0.01); // %
pan = hslider("pan", 0.5, 0, 1, 0.01); // %
attack = hslider("attack", 0.01, 0, 1, 0.001); // sec
decay = hslider("decay", 0.3, 0, 1, 0.001); // sec
sustain = hslider("sustain", 0.5, 0, 1, 0.01); // %
release = hslider("release", 0.2, 0, 1, 0.001); // sec
freq = nentry("freq", 440, 20, 20000, 1); // Hz
gain = nentry("gain", 0.3, 0, 10, 0.01); // %
gate = button("gate"); // 0/1
// additive synth: 3 sine oscillators with adsr envelop
process = (os.osc(freq)+0.5*os.osc(2*freq)+0.25*os.osc(3*freq))
* (gate : vgroup("1-adsr", en.adsr(attack, decay, sustain, release)))
* gain : vgroup("2-master", *(vol) : sp.panner(pan));
| https://raw.githubusercontent.com/grame-cncm/faustlive/9a9d5d550d6fffdb647e08aea0b5daf3279c9102/Resources/Examples/organ.dsp | faust | control variables
%
%
sec
sec
%
sec
Hz
%
0/1
additive synth: 3 sine oscillators with adsr envelop |
declare name "organ -- a simple additive synth";
declare author "Albert Graef";
declare version "1.0";
import("stdfaust.lib");
process = (os.osc(freq)+0.5*os.osc(2*freq)+0.25*os.osc(3*freq))
* (gate : vgroup("1-adsr", en.adsr(attack, decay, sustain, release)))
* gain : vgroup("2-master", *(vol) : sp.panner(pan));
|
4a2ba35471c91c76abf01b6f3321fda5e04d3f3b70c19bce4d31f0d1f0a4ab71 | OceanSwift/Faust-Course-Examples | Phasor Triangle.dsp | import("stdfaust.lib");
phase(f) = f/ma.SR : (+,1:fmod) ~ _;
triangle(f) = (((phase(f)-0.5) : abs)*4)-1;
test(f) = os.triangle(f);
process = triangle(hslider("freq", 440, 40, 8000, 1)); | https://raw.githubusercontent.com/OceanSwift/Faust-Course-Examples/c3c779ab8257fae9563de4bc09ee71c5346bb1cd/Phasor%20Triangle.dsp | faust | import("stdfaust.lib");
phase(f) = f/ma.SR : (+,1:fmod) ~ _;
triangle(f) = (((phase(f)-0.5) : abs)*4)-1;
test(f) = os.triangle(f);
process = triangle(hslider("freq", 440, 40, 8000, 1)); |
|
954b6d82c6a1b087cbbd48d8d8171a899dab9138dd6354d7501c47f1d3b4d231 | barnabycollins/MEng-Project | test.dsp | import("stdfaust.lib");
// DEFINITIONS
midifreq = hslider("freq[unit:Hz]", 440, 20, 20000, 1);
bend = ba.semi2ratio(hslider("pitchBend[midi:pitchwheel]", 0, -2, 2, 0.01));
frequency = vgroup("Frequency", midifreq*bend);
p10 = hslider("[10]MAIN_ENV_A (CC10)[midi:ctrl 10][scale:linear]", 0.01, 0, 10, 0.01) : si.smoo;
p11 = hslider("[11]MAIN_ENV_D (CC11)[midi:ctrl 11][scale:linear]", 0.3, 0, 10, 0.01) : si.smoo;
p12 = hslider("[12]MAIN_ENV_S (CC12)[midi:ctrl 12][scale:linear]", 0.8, 0, 1, 0.01) : si.smoo;
p13 = hslider("[13]MAIN_ENV_R (CC13)[midi:ctrl 13][scale:linear]", 0.01, 0, 10, 0.01) : si.smoo;
midigate = button("gate");
midigain = hslider("gain", 0.5, 0, 1, 0.01);
p14 = hslider("[14]MAIN_LP_FREQ (CC14)[midi:ctrl 14][scale:log]", 20000, 20, 20000, 1) : si.smoo;
p15 = hslider("[15]MAIN_LP_Q (CC15)[midi:ctrl 15][scale:log]", 0.5, 0.1, 30, 0.1) : si.smoo;
// PROCESS
process = (((vgroup("env0", en.adsr(p10, p11, p12, p13, midigate))*midigain*os.triangle(19980*(frequency-20)/19980+20)) : vgroup("Low Pass Filter", fi.resonlp(p14, p15, 1)))) : fi.dcblocker : fi.lowpass(1, 20000); | https://raw.githubusercontent.com/barnabycollins/MEng-Project/ff026917c6511303af8ca7cce4edc2fd8ab7bb96/src/test.dsp | faust | DEFINITIONS
PROCESS | import("stdfaust.lib");
midifreq = hslider("freq[unit:Hz]", 440, 20, 20000, 1);
bend = ba.semi2ratio(hslider("pitchBend[midi:pitchwheel]", 0, -2, 2, 0.01));
frequency = vgroup("Frequency", midifreq*bend);
p10 = hslider("[10]MAIN_ENV_A (CC10)[midi:ctrl 10][scale:linear]", 0.01, 0, 10, 0.01) : si.smoo;
p11 = hslider("[11]MAIN_ENV_D (CC11)[midi:ctrl 11][scale:linear]", 0.3, 0, 10, 0.01) : si.smoo;
p12 = hslider("[12]MAIN_ENV_S (CC12)[midi:ctrl 12][scale:linear]", 0.8, 0, 1, 0.01) : si.smoo;
p13 = hslider("[13]MAIN_ENV_R (CC13)[midi:ctrl 13][scale:linear]", 0.01, 0, 10, 0.01) : si.smoo;
midigate = button("gate");
midigain = hslider("gain", 0.5, 0, 1, 0.01);
p14 = hslider("[14]MAIN_LP_FREQ (CC14)[midi:ctrl 14][scale:log]", 20000, 20, 20000, 1) : si.smoo;
p15 = hslider("[15]MAIN_LP_Q (CC15)[midi:ctrl 15][scale:log]", 0.5, 0.1, 30, 0.1) : si.smoo;
process = (((vgroup("env0", en.adsr(p10, p11, p12, p13, midigate))*midigain*os.triangle(19980*(frequency-20)/19980+20)) : vgroup("Low Pass Filter", fi.resonlp(p14, p15, 1)))) : fi.dcblocker : fi.lowpass(1, 20000); |
6fc154a6d9448b6d414778ee374890127b7a6023566837eccdb938e012384d78 | grame-cncm/faustdoc | exfaust34.dsp |
import("stdfaust.lib");
triangleWave = waveform{0,0.5,1,0.5,0,-0.5,-1,-.5};
triangleOsc(f) = triangleWave,int(os.phasor(8,f)) : rdtable;
f = hslider("freq",440,50,2000,0.01);
process = triangleOsc(f);
| https://raw.githubusercontent.com/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/manual/syntax/exfaust34/exfaust34.dsp | faust |
import("stdfaust.lib");
triangleWave = waveform{0,0.5,1,0.5,0,-0.5,-1,-.5};
triangleOsc(f) = triangleWave,int(os.phasor(8,f)) : rdtable;
f = hslider("freq",440,50,2000,0.01);
process = triangleOsc(f);
|
|
ad207f7d5bb05e1bc09288c32dc314736ba9e0940feac7404babddc159258891 | grame-cncm/faustdoc | exfaust89.dsp |
import("stdfaust.lib");
s = nentry("Selector",0,0,1,1);
sig = os.osc(440),os.sawtooth(440),os.triangle(440) : select3(s);
process = sig;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/515c59ce7c4e390d3cf0fc518cd0d9f3ef7be262/docs/manual/syntax/exfaust89/exfaust89.dsp | faust |
import("stdfaust.lib");
s = nentry("Selector",0,0,1,1);
sig = os.osc(440),os.sawtooth(440),os.triangle(440) : select3(s);
process = sig;
|
|
0236769bcfb9daabbaa5178f1b323b8779df769096ed661b0021cec472d18a3f | grame-cncm/faustdoc | exfaust90.dsp |
import("stdfaust.lib");
s = nentry("Selector",0,0,2,1) : int;
mySelect3(s) = *(s==0),*(s==1),*(s==2) :> _;
sig = os.osc(440),os.sawtooth(440),os.triangle(440) : mySelect3(s);
process = sig;
| https://raw.githubusercontent.com/grame-cncm/faustdoc/515c59ce7c4e390d3cf0fc518cd0d9f3ef7be262/docs/manual/syntax/exfaust90/exfaust90.dsp | faust |
import("stdfaust.lib");
s = nentry("Selector",0,0,2,1) : int;
mySelect3(s) = *(s==0),*(s==1),*(s==2) :> _;
sig = os.osc(440),os.sawtooth(440),os.triangle(440) : mySelect3(s);
process = sig;
|
|
8436c8f77f5e347cba65dcd84ae62c111f4de15a04e627697510036f62c068ce | Bindernews/NESting | NESting.dsp |
declare name "SquareTri2A03";
import("stdfaust.lib");
import("soundfiles.lib");
declare options "[midi:on]";
grGeneral(x) = vgroup("Main", hgroup("General", x));
grRow2(x) = vgroup("Main", hgroup("Row 2", x));
midigate = grGeneral(checkbox("h:gate"));
midifreq = grGeneral(nentry("freq[unit:Hz]", 440, 20, 20000, 1));
midigain = grGeneral(hslider("gain", 0.5, 0, 1, 0.01));
waveshape = grRow2(nentry("WaveShape", 0, 0, 3, 1));
pulsewidth = grRow2(nentry("PulseWidth", 2, 0, 4.1, 1)) : si.smoo;
// Unused, but maybe useful later
clock_cycle = 1789773; // 1.789773 MHz
clock_samples = ba.sec2samp(1. / (clock_cycle)); // 2^11 = 2048 CPU cycles per phase value
lerp(low, high, x) = (x - low) / (high - low);
unlerp(low, high, x) = (x * (high - low)) + low;
//////
// Square Wave Generator
//////
squareValue = saw1 + saw2
with {
phase_table = waveform{0.06, 0.12, 0.25, 0.50, 0.75};
phase1 = rdtable(phase_table, int(pulsewidth));
saw1 = os.sawNp(2, midifreq, 0) : fi.lowpass(2, 13000);
saw2 = os.sawNp(2, midifreq, phase1) * -1 : fi.lowpass(2, 13000);
};
//////
// Triangle Wave Generator
//////
triangleValue = (rdtable(triWave,int(os.phasor(512,midifreq))) * 0.125) - 1.
with {
// From https://www.mattmontag.com/nesvst/triangle_wavetable.txt
triWave = waveform{8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58,
14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58,
13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1,
11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46,
9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88,
8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7,
7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66,
6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64,
5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70,
4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76,
3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82,
2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88,
2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18,
1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46,
.76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76,
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,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
};
square2Value = os.square(midifreq);
// Noise is implemented in C++.
//////
// DPCM Generator
//////
dpcmValue = _ : dpcmFilter
with {
// We assume that our sample is already at the correct sample rate.
// If not, the host will have to re-sample it.
//isample = soundfile( "[url:http://example.com/test.mp3]", 1 );
dpcmFilter = _ : fi.low_shelf(dGain, lCutoff) : fi.high_shelf(dGain, hCutoff);
lCutoff = 0.9;
lSlope = 0.7;
dGain = 0.1;
hCutoff = 0.2;
hSlope = 0.7;
};
process = (ba.selectn(4, waveshape, (squareValue, triangleValue, square2Value, dpcmValue)) * midigain * midigate) <: (_,_) ;
| https://raw.githubusercontent.com/Bindernews/NESting/dc1bf9c38dc814d554d85066cb75c5d68a5de74b/NESting/NESting.dsp | faust | Unused, but maybe useful later
1.789773 MHz
2^11 = 2048 CPU cycles per phase value
////
Square Wave Generator
////
////
Triangle Wave Generator
////
From https://www.mattmontag.com/nesvst/triangle_wavetable.txt
Noise is implemented in C++.
////
DPCM Generator
////
We assume that our sample is already at the correct sample rate.
If not, the host will have to re-sample it.
isample = soundfile( "[url:http://example.com/test.mp3]", 1 ); |
declare name "SquareTri2A03";
import("stdfaust.lib");
import("soundfiles.lib");
declare options "[midi:on]";
grGeneral(x) = vgroup("Main", hgroup("General", x));
grRow2(x) = vgroup("Main", hgroup("Row 2", x));
midigate = grGeneral(checkbox("h:gate"));
midifreq = grGeneral(nentry("freq[unit:Hz]", 440, 20, 20000, 1));
midigain = grGeneral(hslider("gain", 0.5, 0, 1, 0.01));
waveshape = grRow2(nentry("WaveShape", 0, 0, 3, 1));
pulsewidth = grRow2(nentry("PulseWidth", 2, 0, 4.1, 1)) : si.smoo;
lerp(low, high, x) = (x - low) / (high - low);
unlerp(low, high, x) = (x * (high - low)) + low;
squareValue = saw1 + saw2
with {
phase_table = waveform{0.06, 0.12, 0.25, 0.50, 0.75};
phase1 = rdtable(phase_table, int(pulsewidth));
saw1 = os.sawNp(2, midifreq, 0) : fi.lowpass(2, 13000);
saw2 = os.sawNp(2, midifreq, phase1) * -1 : fi.lowpass(2, 13000);
};
triangleValue = (rdtable(triWave,int(os.phasor(512,midifreq))) * 0.125) - 1.
with {
triWave = waveform{8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58,
14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58,
13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1,
11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46,
9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88,
8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7,
7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66,
6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64,
5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70,
4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76,
3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82,
2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88,
2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18,
1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46,
.76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76,
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,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
};
square2Value = os.square(midifreq);
dpcmValue = _ : dpcmFilter
with {
dpcmFilter = _ : fi.low_shelf(dGain, lCutoff) : fi.high_shelf(dGain, hCutoff);
lCutoff = 0.9;
lSlope = 0.7;
dGain = 0.1;
hCutoff = 0.2;
hSlope = 0.7;
};
process = (ba.selectn(4, waveshape, (squareValue, triangleValue, square2Value, dpcmValue)) * midigain * midigate) <: (_,_) ;
|
553d6492b3bcb7c56fc7441150f248c23fe915492da72c1ca635eb5fa404eafe | Bindernews/NESting | BlockTriangle.dsp | import("stdfaust.lib");
//declare options "[nvoices:4]";
generate(gain, freq) = ((rdtable(triWave,int(os.phasor(512,freq))) * 0.125) - 1.) * gain
with {
// From https://www.mattmontag.com/nesvst/triangle_wavetable.txt
triWave = waveform{8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58,
14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58,
13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1,
11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46,
9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88,
8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7,
7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66,
6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64,
5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70,
4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76,
3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82,
2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88,
2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18,
1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46,
.76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76,
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,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
};
process = (_,_) : generate : _;
| https://raw.githubusercontent.com/Bindernews/NESting/dc1bf9c38dc814d554d85066cb75c5d68a5de74b/NESting/BlockTriangle.dsp | faust | declare options "[nvoices:4]";
From https://www.mattmontag.com/nesvst/triangle_wavetable.txt | import("stdfaust.lib");
generate(gain, freq) = ((rdtable(triWave,int(os.phasor(512,freq))) * 0.125) - 1.) * gain
with {
triWave = waveform{8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58,
14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58, 14.58,
13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1, 13.1,
11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46, 11.46,
9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88, 9.88,
8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7, 8.7,
7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66, 7.66,
6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64, 6.64,
5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70, 5.70,
4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76, 4.76,
3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82, 3.82,
2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88, 2.88,
2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18, 2.18,
1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46, 1.46,
.76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76, .76,
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,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
};
process = (_,_) : generate : _;
|
bc0dedae749e7140e6513bf8474a58a37d4a14cce3f500b82ede5dfe234b40f0 | grame-cncm/faustdoc | exfaust7.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',
'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");
// 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,1);
// 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/grame-cncm/faustdoc/493929103510997ef8adb66603d4aba123b2a70d/docs/examples/smartKeyboard/exfaust7/exfaust7.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',
'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");
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,1);
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 <: _,_;
|