_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
5110796b44ce7dd1120f28f0505c5167d52ad472e571b58e938fe21f1e243bb7
LucaSpanedda/RITI-Room-Is-The-Instrument
RITIsinemapNetwork.dsp
// Faust standard libraries import("stdfaust.lib"); // SYSTEM VARIABLES ---------------------------------------- Voices = 4; BPFilterOrder = 1; SystemSpaceVar = 1 * ma.SR; NetworkGlobalFBGain = hslider("NetworkGlobalFBGain",1,0,10,.001) : si.smoo; ExternalSigGain = hslider("ExternalSigGain",0,0,10,.001) : si.smoo; FreqShift = hslider("FreqShift",1,0.001,2,.001) : si.smoo; Bandwidth = hslider("Bandwidth",1,1,10,.001) : si.smoo; SingleUnitInternalFBGain = hslider("SingleUnitInternalFBGain", 1, 0, 1, .001): si.smoo; Ktf = hslider("tahn", 10, 1, 100, .001); MUf = hslider("mu", .08, 0.01, 1.0, .001); OutputGain = hslider("OutputGain",1,0,1,.001) : si.smoo; // FILTERS ------------------------------------------------- // TPT version of the One Pole and SVF Filter by Vadim Zavalishin // reference : (by Will Pirkle) // http://www.willpirkle.com/Downloads/AN-4VirtualAnalogFilters.2.0.pdf // OnePoleTPT filter function onePoleTPT(cf, x) = loop ~ _ : ! , si.bus(3) with { g = tan(cf * ma.PI * (1/ma.SR)); G = g / (1.0 + g); loop(s) = u , lp , hp , ap with { v = (x - s) * G; u = v + lp; lp = v + s; hp = x - lp; ap = lp - hp; }; }; LPTPT(cf, x) = onePoleTPT(limit(20000,1.19209e-07,cf), x) : (_ , ! , !); HPTPT(cf, x) = onePoleTPT(limit(20000,1.19209e-07,cf), x) : (! , _ , !); // TEST // process = (-100, no.noise) : HPTPT; // SVFTPT filter function SVFTPT(K, Q, CF, x) = circuitout : !,!,_,_,_,_,_,_,_,_ with{ g = tan(CF * ma.PI / ma.SR); R = 1.0 / (2.0 * Q); G1 = 1.0 / (1.0 + 2.0 * R * g + g * g); G2 = 2.0 * R + g; circuit(s1, s2) = u1 , u2 , lp , hp , bp, notch, apf, ubp, peak, bshelf with{ hp = (x - s1 * G2 - s2) * G1; v1 = hp * g; bp = s1 + v1; v2 = bp * g; lp = s2 + v2; u1 = v1 + bp; u2 = v2 + lp; notch = x - ((2*R)*bp); apf = x - ((4*R)*bp); ubp = ((2*R)*bp); peak = lp -hp; bshelf = x + (((2*K)*R)*bp); }; // choose the output from the SVF Filter (ex. bshelf) circuitout = circuit ~ si.bus(2); }; // Outs = (lp , hp , bp, notch, apf, ubp, peak, bshelf) // SVFTPT(K, Q, CF, x) = (Filter-K, Filter-Q, Frequency Cut) // Filters Bank LPSVF(Q, CF, x) = SVFTPT(0, Q, limit(20000,1.19209e-07,CF), x) : _,!,!,!,!,!,!,!; HPSVF(Q, CF, x) = SVFTPT(0, Q, limit(20000,1.19209e-07,CF), x) : !,_,!,!,!,!,!,!; //process = (-1, -10000, no.noise) <: LPSVF, HPSVF; BPsvftpt(BW, CF, A, x) = SVFTPT(0 : ba.db2linear, ql, cfl, x * A) : !,!,!,!,!,_,!,! with{ limit(maxl,minl,x) = x : max(minl, min(maxl)); cfl = limit(20000,1.19209e-07,CF); bwl = limit(20000,1.19209e-07,BW); ql = cfl / bwl; }; // INSTRUMENT SPECTRE -------------------------------------- // list: Frequencies, Amps, Bandwidth spectrefreq = ( 129.55994499312413, 261.8764845605701, 259.11988998624827, 325.27815976997124, 132.31653956744594, 195.7182147768471, 135.07313414176772, 256.3632954119265, 264.6330791348919, 328.03475434429305, 846.2745343167896, 520.9963745468184, 1108.1510188773598, 330.79134891861486, 137.8297287160895, 391.4364295536942, 198.47480935116891, 716.7145893236655, 1105.394424303038, 780.1162645330667, 121.29016127015878, 118.53356669583698, 192.96162020252532, 782.8728591073884, 2409.263657957245, 319.7649706213277, 317.00837604700587, 333.5479434929366, 1041.9927490936368, 275.659457432179, 454.83810476309543, 650.5563195399425, 115.7769721215152, 314.2517814726841, 1171.552694086761, 201.2314039254907, 203.98799849981248, 124.04675584448057, 190.20502562820354, 245.33691711463933, 975.8344793099138, 278.4160520065008, 267.38967370921364, 66.15826978372297, 242.58032254031755, 849.0311288911114, 272.90286285785726, 388.67983497937246, 148.8561070133767, 311.4951868983623, 978.5910738842356, 2412.0202525315667, 281.17264658082263, 206.7445930741343, 253.6067008376047, 151.61270158769847, 126.80335041880235, 912.4328041005126, 294.95561945243156, 239.82372796599577, 336.3045380672584, 457.5946993374172, 322.5215651956495, 2083.9854981872736 ); spectreamps = ( 0.10296897, 0.08541786, 0.08251663, 0.06961161, 0.05287735, 0.045743566, 0.023809433, 0.0222178, 0.021449901, 0.020397715, 0.018738171, 0.016159637, 0.014195229, 0.012720414, 0.0122202635, 0.011309004, 0.01096574, 0.010652141, 0.010569801, 0.01052872, 0.010389255, 0.009786074, 0.009583302, 0.0088912705, 0.008741568, 0.00872121, 0.008528015, 0.008511754, 0.008424098, 0.008201121, 0.008183193, 0.008126589, 0.007836982, 0.0077589434, 0.0076152403, 0.007559998, 0.0075054276, 0.0073422813, 0.007247762, 0.007225244, 0.0070567015, 0.006937664, 0.0067791366, 0.0067622834, 0.006728307, 0.0064722965, 0.0061831484, 0.005800677, 0.0057434384, 0.0057088095, 0.005630103, 0.0055296235, 0.0054903137, 0.00545266, 0.0054097753, 0.0054018316, 0.005351535, 0.0052661845, 0.0051531605, 0.0051409504, 0.005139122, 0.0051108524, 0.004931564, 0.0048702704); spectreband = ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ); // index Flist(index) = ba.take(index + 1, spectrefreq); Alist(index) = ba.take(index + 1, spectreamps); Qlist(index) = ba.take(index + 1, spectreband); // Filters bands = B // Filters in Cascade = O // Gain for each filters out = G // Bandpass Filter Banks filterbanks(O, B, G, x) = x <:par(i, B, seq(r, O, BPsvftpt( Qlist(i) * Bandwidth, Flist(i) * FreqShift, Alist(i) ) * G ) ):> (+/B); //process = no.noise : filterbanks(3, 10, 36) <: _,_; soloBP(O) = seq(r, O, BPsvftpt( hslider("BW",50,1,20000,.001), hslider("F",1000,1,20000,.001), hslider("G",.8,0,1,.001) ) ); //process = no.noise : soloBP(4); sinemap(x0) = ( circuit : tanf(Ktf) : filterbanks(BPFilterOrder, 32, 10000) : fi.dcblocker ) ~ * (SingleUnitInternalFBGain) with { circuit(x) = (xInit-xInit') + mu * sin(ma.PI * ((x0) + (x))); xInit = .5; tanf(k,x) = ma.tanh(k * x)/(k * x); mu = MUf; }; //process = _ : fi.dcblocker : sinemap <: _,_; Network(NetV,ExternalSig) = loop ~ _ : (si.block(1), si.bus(NetV)) with{ loop(fb) = par(i, NetV, ( ((ExternalSig/NetV) * ExternalSigGain) + ((fb * NetworkGlobalFBGain)@(SystemSpaceVar*(i+1))) : sinemap) ) <: (si.bus(NetV) :> +/NetV), (si.bus(NetV)); }; process = _ : fi.dcblocker : Network(Voices) : par(i, Voices, _ * OutputGain);
https://raw.githubusercontent.com/LucaSpanedda/RITI-Room-Is-The-Instrument/8c49f5b5ea699577e5c0b50a92b680b0173aaea9/Code_Drafts/RITIsinemapNetwork.dsp
faust
Faust standard libraries SYSTEM VARIABLES ---------------------------------------- FILTERS ------------------------------------------------- TPT version of the One Pole and SVF Filter by Vadim Zavalishin reference : (by Will Pirkle) http://www.willpirkle.com/Downloads/AN-4VirtualAnalogFilters.2.0.pdf OnePoleTPT filter function TEST process = (-100, no.noise) : HPTPT; SVFTPT filter function choose the output from the SVF Filter (ex. bshelf) Outs = (lp , hp , bp, notch, apf, ubp, peak, bshelf) SVFTPT(K, Q, CF, x) = (Filter-K, Filter-Q, Frequency Cut) Filters Bank process = (-1, -10000, no.noise) <: LPSVF, HPSVF; INSTRUMENT SPECTRE -------------------------------------- list: Frequencies, Amps, Bandwidth index Filters bands = B Filters in Cascade = O Gain for each filters out = G Bandpass Filter Banks process = no.noise : filterbanks(3, 10, 36) <: _,_; process = no.noise : soloBP(4); process = _ : fi.dcblocker : sinemap <: _,_;
import("stdfaust.lib"); Voices = 4; BPFilterOrder = 1; SystemSpaceVar = 1 * ma.SR; NetworkGlobalFBGain = hslider("NetworkGlobalFBGain",1,0,10,.001) : si.smoo; ExternalSigGain = hslider("ExternalSigGain",0,0,10,.001) : si.smoo; FreqShift = hslider("FreqShift",1,0.001,2,.001) : si.smoo; Bandwidth = hslider("Bandwidth",1,1,10,.001) : si.smoo; SingleUnitInternalFBGain = hslider("SingleUnitInternalFBGain", 1, 0, 1, .001): si.smoo; Ktf = hslider("tahn", 10, 1, 100, .001); MUf = hslider("mu", .08, 0.01, 1.0, .001); OutputGain = hslider("OutputGain",1,0,1,.001) : si.smoo; onePoleTPT(cf, x) = loop ~ _ : ! , si.bus(3) with { g = tan(cf * ma.PI * (1/ma.SR)); G = g / (1.0 + g); loop(s) = u , lp , hp , ap with { v = (x - s) * G; u = v + lp; lp = v + s; hp = x - lp; ap = lp - hp; }; }; LPTPT(cf, x) = onePoleTPT(limit(20000,1.19209e-07,cf), x) : (_ , ! , !); HPTPT(cf, x) = onePoleTPT(limit(20000,1.19209e-07,cf), x) : (! , _ , !); SVFTPT(K, Q, CF, x) = circuitout : !,!,_,_,_,_,_,_,_,_ with{ g = tan(CF * ma.PI / ma.SR); R = 1.0 / (2.0 * Q); G1 = 1.0 / (1.0 + 2.0 * R * g + g * g); G2 = 2.0 * R + g; circuit(s1, s2) = u1 , u2 , lp , hp , bp, notch, apf, ubp, peak, bshelf with{ hp = (x - s1 * G2 - s2) * G1; v1 = hp * g; bp = s1 + v1; v2 = bp * g; lp = s2 + v2; u1 = v1 + bp; u2 = v2 + lp; notch = x - ((2*R)*bp); apf = x - ((4*R)*bp); ubp = ((2*R)*bp); peak = lp -hp; bshelf = x + (((2*K)*R)*bp); }; circuitout = circuit ~ si.bus(2); }; LPSVF(Q, CF, x) = SVFTPT(0, Q, limit(20000,1.19209e-07,CF), x) : _,!,!,!,!,!,!,!; HPSVF(Q, CF, x) = SVFTPT(0, Q, limit(20000,1.19209e-07,CF), x) : !,_,!,!,!,!,!,!; BPsvftpt(BW, CF, A, x) = SVFTPT(0 : ba.db2linear, ql, cfl, x * A) : !,!,!,!,!,_,!,! with{ limit(maxl,minl,x) = x : max(minl, min(maxl)); cfl = limit(20000,1.19209e-07,CF); bwl = limit(20000,1.19209e-07,BW); ql = cfl / bwl; }; spectrefreq = ( 129.55994499312413, 261.8764845605701, 259.11988998624827, 325.27815976997124, 132.31653956744594, 195.7182147768471, 135.07313414176772, 256.3632954119265, 264.6330791348919, 328.03475434429305, 846.2745343167896, 520.9963745468184, 1108.1510188773598, 330.79134891861486, 137.8297287160895, 391.4364295536942, 198.47480935116891, 716.7145893236655, 1105.394424303038, 780.1162645330667, 121.29016127015878, 118.53356669583698, 192.96162020252532, 782.8728591073884, 2409.263657957245, 319.7649706213277, 317.00837604700587, 333.5479434929366, 1041.9927490936368, 275.659457432179, 454.83810476309543, 650.5563195399425, 115.7769721215152, 314.2517814726841, 1171.552694086761, 201.2314039254907, 203.98799849981248, 124.04675584448057, 190.20502562820354, 245.33691711463933, 975.8344793099138, 278.4160520065008, 267.38967370921364, 66.15826978372297, 242.58032254031755, 849.0311288911114, 272.90286285785726, 388.67983497937246, 148.8561070133767, 311.4951868983623, 978.5910738842356, 2412.0202525315667, 281.17264658082263, 206.7445930741343, 253.6067008376047, 151.61270158769847, 126.80335041880235, 912.4328041005126, 294.95561945243156, 239.82372796599577, 336.3045380672584, 457.5946993374172, 322.5215651956495, 2083.9854981872736 ); spectreamps = ( 0.10296897, 0.08541786, 0.08251663, 0.06961161, 0.05287735, 0.045743566, 0.023809433, 0.0222178, 0.021449901, 0.020397715, 0.018738171, 0.016159637, 0.014195229, 0.012720414, 0.0122202635, 0.011309004, 0.01096574, 0.010652141, 0.010569801, 0.01052872, 0.010389255, 0.009786074, 0.009583302, 0.0088912705, 0.008741568, 0.00872121, 0.008528015, 0.008511754, 0.008424098, 0.008201121, 0.008183193, 0.008126589, 0.007836982, 0.0077589434, 0.0076152403, 0.007559998, 0.0075054276, 0.0073422813, 0.007247762, 0.007225244, 0.0070567015, 0.006937664, 0.0067791366, 0.0067622834, 0.006728307, 0.0064722965, 0.0061831484, 0.005800677, 0.0057434384, 0.0057088095, 0.005630103, 0.0055296235, 0.0054903137, 0.00545266, 0.0054097753, 0.0054018316, 0.005351535, 0.0052661845, 0.0051531605, 0.0051409504, 0.005139122, 0.0051108524, 0.004931564, 0.0048702704); spectreband = ( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ); Flist(index) = ba.take(index + 1, spectrefreq); Alist(index) = ba.take(index + 1, spectreamps); Qlist(index) = ba.take(index + 1, spectreband); filterbanks(O, B, G, x) = x <:par(i, B, seq(r, O, BPsvftpt( Qlist(i) * Bandwidth, Flist(i) * FreqShift, Alist(i) ) * G ) ):> (+/B); soloBP(O) = seq(r, O, BPsvftpt( hslider("BW",50,1,20000,.001), hslider("F",1000,1,20000,.001), hslider("G",.8,0,1,.001) ) ); sinemap(x0) = ( circuit : tanf(Ktf) : filterbanks(BPFilterOrder, 32, 10000) : fi.dcblocker ) ~ * (SingleUnitInternalFBGain) with { circuit(x) = (xInit-xInit') + mu * sin(ma.PI * ((x0) + (x))); xInit = .5; tanf(k,x) = ma.tanh(k * x)/(k * x); mu = MUf; }; Network(NetV,ExternalSig) = loop ~ _ : (si.block(1), si.bus(NetV)) with{ loop(fb) = par(i, NetV, ( ((ExternalSig/NetV) * ExternalSigGain) + ((fb * NetworkGlobalFBGain)@(SystemSpaceVar*(i+1))) : sinemap) ) <: (si.bus(NetV) :> +/NetV), (si.bus(NetV)); }; process = _ : fi.dcblocker : Network(Voices) : par(i, Voices, _ * OutputGain);
7f395d17943c8f07c7d057fbadaf3a429f1f8ad55cfef8043940dc6793cfd08a
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.11_Onepolefilter.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // ONEPOLE FILTER (IIR di I° Ordine) // ---------------------------------------- /* +~ è il sommatore, e la retroazione degli argomenti dentro parentesi () _ è il segnale in ingresso, (_ rappresentazione segnale) in ritardo di un campione _ (in automatico nella retroazione) che entra : nel gain del controllo della retroazione * 1-feedback lo stesso feedback controlla l'amplificazione in ingresso del segnale non iniettato nella retroazione c'è un controllo di ampiezza generale * outgain sulla funzione in uscita onezeroout */ // (G) = give amplitude 1-0 (open-close) for the lowpass cut // (CF) = Frequency Cut in HZ OPF(CF,x) = OPFFBcircuit ~ _ with{ g(x) = x / (1.0 + x); G = tan(CF * ma.PI / ma.SR):g; OPFFBcircuit(y) = x*G+(y*(1-G)); }; process = OPF(20000) <: _,_;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/5b0d8fdd01d355676ef017cd351e0e89f22d7387/0.11_Onepolefilter.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- ONEPOLE FILTER (IIR di I° Ordine) ---------------------------------------- +~ è il sommatore, e la retroazione degli argomenti dentro parentesi () _ è il segnale in ingresso, (_ rappresentazione segnale) in ritardo di un campione _ (in automatico nella retroazione) che entra : nel gain del controllo della retroazione * 1-feedback lo stesso feedback controlla l'amplificazione in ingresso del segnale non iniettato nella retroazione c'è un controllo di ampiezza generale * outgain sulla funzione in uscita onezeroout (G) = give amplitude 1-0 (open-close) for the lowpass cut (CF) = Frequency Cut in HZ
import("stdfaust.lib"); OPF(CF,x) = OPFFBcircuit ~ _ with{ g(x) = x / (1.0 + x); G = tan(CF * ma.PI / ma.SR):g; OPFFBcircuit(y) = x*G+(y*(1-G)); }; process = OPF(20000) <: _,_;
d06df8a9adf118704ca99550ec9201eed1fd2a8825183044649fc399af0de8c0
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.21_Feedback_Comb_Filter.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // FEEDBACK COMB FILTER (IIR di N° Ordine) // ---------------------------------------- /* NO DIRECT SIGNAL FB-COMB */ /* +~ è il sommatore, e la retroazione degli argomenti dentro parentesi () _ è il segnale in ingresso, (_ rappresentazione segnale) in ritardo di @(delaysamples) campioni (dunque valore da passare esternamente) che entra : nel gain del controllo della retroazione * feedback Nel feedback è già presente di default un campione di ritardo, ecco perché delaysamples-1. c'è un controllo di ampiezza generale * outgain sulla funzione in uscita combfeedbout */ // (Del,G) = DEL=delay time in samples. G=feedback gain 0-1 FBCF(Del,G,x) = x:(+ @(Del-1)~ *(G)):mem; // Out process = FBCF(4481,0.9);
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/5b0d8fdd01d355676ef017cd351e0e89f22d7387/0.21_Feedback_Comb_Filter.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- FEEDBACK COMB FILTER (IIR di N° Ordine) ---------------------------------------- NO DIRECT SIGNAL FB-COMB +~ è il sommatore, e la retroazione degli argomenti dentro parentesi () _ è il segnale in ingresso, (_ rappresentazione segnale) in ritardo di @(delaysamples) campioni (dunque valore da passare esternamente) che entra : nel gain del controllo della retroazione * feedback Nel feedback è già presente di default un campione di ritardo, ecco perché delaysamples-1. c'è un controllo di ampiezza generale * outgain sulla funzione in uscita combfeedbout (Del,G) = DEL=delay time in samples. G=feedback gain 0-1 Out
import("stdfaust.lib"); FBCF(Del,G,x) = x:(+ @(Del-1)~ *(G)):mem; process = FBCF(4481,0.9);
f6a2ad05ab399a33c0f18528cc2ebb2b4da2522df9213a07bb0732241072c51a
LucaSpanedda/Riverberazione_Digitale_in_FAUST
1.01_Riverbero_Allpass_di_Hal_Chamberlin.dsp
//----------------------------------------- // CHAMBERLIN REVERB // ---------------------------------------- // High-quality stereo reverberator: // Musical Applications of Microprocessor // ---------------------------------------- // Standard Library FAUST import("stdfaust.lib"); // MS TO SAMPLES // (t) = give time in milliseconds we want to know in samples msasamps(t) = (ma.SR/1000.)*t; // ALLPASS CHAMBERLIN // (t,g) = give: delay in samples, feedback gain 0-1 apfch(t,g) = (+: _<: @(min(max(t-1,0),ma.SR)), *(-g))~ *(g) : mem, _ : + : _; // CHAMBERLIN REVERB ap3ch = apfch(msasamps(49.6),0.75) : apfch(msasamps(34.75),0.72) : apfch(msasamps(24.18),0.691); apout1ch = apfch(msasamps(17.85),0.649) : apfch(msasamps(10.98),0.662); apout2ch = apfch(msasamps(18.01),0.646) : apfch(msasamps(10.82),0.666); process = os.impulse : ap3ch <: apout1ch, apout2ch;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/161bf5eef371336c08341df3a22d58aea01b5805/1.01_Riverbero_Allpass_di_Hal_Chamberlin.dsp
faust
----------------------------------------- CHAMBERLIN REVERB ---------------------------------------- High-quality stereo reverberator: Musical Applications of Microprocessor ---------------------------------------- Standard Library FAUST MS TO SAMPLES (t) = give time in milliseconds we want to know in samples ALLPASS CHAMBERLIN (t,g) = give: delay in samples, feedback gain 0-1 CHAMBERLIN REVERB
import("stdfaust.lib"); msasamps(t) = (ma.SR/1000.)*t; apfch(t,g) = (+: _<: @(min(max(t-1,0),ma.SR)), *(-g))~ *(g) : mem, _ : + : _; ap3ch = apfch(msasamps(49.6),0.75) : apfch(msasamps(34.75),0.72) : apfch(msasamps(24.18),0.691); apout1ch = apfch(msasamps(17.85),0.649) : apfch(msasamps(10.98),0.662); apout2ch = apfch(msasamps(18.01),0.646) : apfch(msasamps(10.82),0.666); process = os.impulse : ap3ch <: apout1ch, apout2ch;
274c9f5a8db5bf9ba5ff522741c863f11f2c5991b3ff0ea0b47938c56f179713
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.06_Decadimento_T60.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // DECADIMENTO DELAY IN TEMPO T60 // ---------------------------------------- /* Inserisci all'interno degli argomenti della funzione: - il valore in campioni del filtro che stai usando per il ritardo. - il valore di decadimento in T60 (tempo di decadimento di 60 dB in secondi) = OTTIENI in uscita dalla funzione, il valore che devi passare come amplificazione alla retroazione del filtro per ottenere il tempo di decadimento T60 che si desidera */ // (samps,seconds) = give: samples of the filter, seconds we want for t60 decay dect60(samps,seconds) = 1/(10^((3*(((1000 / ma.SR)*samps)/1000))/seconds)); process = _;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/28c95cf5d82679b9100bd3ab59d7f310029b80e7/0.06_Decadimento_T60.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- DECADIMENTO DELAY IN TEMPO T60 ---------------------------------------- Inserisci all'interno degli argomenti della funzione: - il valore in campioni del filtro che stai usando per il ritardo. - il valore di decadimento in T60 (tempo di decadimento di 60 dB in secondi) = OTTIENI in uscita dalla funzione, il valore che devi passare come amplificazione alla retroazione del filtro per ottenere il tempo di decadimento T60 che si desidera (samps,seconds) = give: samples of the filter, seconds we want for t60 decay
import("stdfaust.lib"); dect60(samps,seconds) = 1/(10^((3*(((1000 / ma.SR)*samps)/1000))/seconds)); process = _;
9bc57ee5b2c124f7fd4d0c05d531e82ef3c2dc3696357eccc24f0b720a7b0a86
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.25_Lowpass_Feedback_Comb_Filter.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // FEEDBACK COMB LOWPASS FILTER (IIR di N° Ordine) // ---------------------------------------- /* NO DIRECT SIGNAL LPFB-COMB */ /* come filtro comb, ma all'interno della retroazione, a seguito del feedback entra il segnale : nel onepole. L'onepole è un lowpass dove si può controllare il taglio di frequenza tra 0. e 1. Nel feedback è già presente di default un campione di ritardo, ecco perché delaysamples-1. */ // LPFBC(Del,CFG,FCut) = give: delay samps, feedback gain 0-1, lowpass Freq.Cut HZ LPFBC(Del,CFG,FCut) = lfbcf with{ G(x) = x / (1.0 + x); CF(x) = tan(x * ma.PI / ma.SR):G; lfbcf(x) = x:(+ :@(Del-1) :_*(FCut:CF): +~(_ :*(1-(FCut:CF))))~ *(CFG):mem; }; // out process = LPFBC(2000, 0.99999, 10000);
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/5b0d8fdd01d355676ef017cd351e0e89f22d7387/0.25_Lowpass_Feedback_Comb_Filter.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- FEEDBACK COMB LOWPASS FILTER (IIR di N° Ordine) ---------------------------------------- NO DIRECT SIGNAL LPFB-COMB come filtro comb, ma all'interno della retroazione, a seguito del feedback entra il segnale : nel onepole. L'onepole è un lowpass dove si può controllare il taglio di frequenza tra 0. e 1. Nel feedback è già presente di default un campione di ritardo, ecco perché delaysamples-1. LPFBC(Del,CFG,FCut) = give: delay samps, feedback gain 0-1, lowpass Freq.Cut HZ out
import("stdfaust.lib"); LPFBC(Del,CFG,FCut) = lfbcf with{ G(x) = x / (1.0 + x); CF(x) = tan(x * ma.PI / ma.SR):G; lfbcf(x) = x:(+ :@(Del-1) :_*(FCut:CF): +~(_ :*(1-(FCut:CF))))~ *(CFG):mem; }; process = LPFBC(2000, 0.99999, 10000);
a77e3de5bbc5238e8ae3a85a6693fb23883fe8e03cb5258702bedb577e87ae80
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.10_Onezerofilter.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // ONEZERO FILTER (FIR di I° Ordine) // ---------------------------------------- /* Controlli del filtro: filtergain = gain della sezione in ritardo outgain = gain generale all'uscita del filtro */ /* _ è il segnale in ingresso, (_ rappresentazione segnale) viene a seguito diviso in due percorsi paralleli <: uno in ritardo di un campione _' (' segna il ritardo di un sample) e uno senza ritardo , _ (, segna il passaggio al secondo percorso) vengono poi risommati in un segnale unico :> _ ; il segnale in ritardo di un campione ha un controllo di ampiezza * feedforward c'è un controllo di ampiezza generale * outgain sulla funzione in uscita onezeroout */ // (G,x) = x=input, G=give amplitude 0-1(open-close) to the delayed signal OZF(G,x) = (x:mem*G), x :> +; // out process = OZF(0.1);
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/5b0d8fdd01d355676ef017cd351e0e89f22d7387/0.10_Onezerofilter.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- ONEZERO FILTER (FIR di I° Ordine) ---------------------------------------- Controlli del filtro: filtergain = gain della sezione in ritardo outgain = gain generale all'uscita del filtro _ è il segnale in ingresso, (_ rappresentazione segnale) viene a seguito diviso in due percorsi paralleli <: uno in ritardo di un campione _' (' segna il ritardo di un sample) e uno senza ritardo , _ (, segna il passaggio al secondo percorso) vengono poi risommati in un segnale unico :> _ ; il segnale in ritardo di un campione ha un controllo di ampiezza * feedforward c'è un controllo di ampiezza generale * outgain sulla funzione in uscita onezeroout (G,x) = x=input, G=give amplitude 0-1(open-close) to the delayed signal out
import("stdfaust.lib"); OZF(G,x) = (x:mem*G), x :> +; process = OZF(0.1);
e57c2e95702c67efbb5ecf6bfd358fc625e58cf521ca569c46370e29e5849acb
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.40_Variable_Delay.dsp
// import Standard Faust library // https://github.com/grame-cncm/faustlibraries/ import("stdfaust.lib"); // GUI AND CONVERSIONS // Delay in samples & Delay in milliseconds GUIdelsamps = hslider("Delay[unit:samples][style:knob]",0,0,196000,1); GUIdelms = hslider("Delay[unit:milliseconds][style:knob]", 0, 0, 1000, 0.1)*ma.SR/1000.0; // Interpolation in samples & in milliseconds GUIintersamps = hslider("interpolation[unit:samples][style:knob]", 1,1,19600,1); GUIinterms = hslider("interpolation[unit:milliseconds][style:knob]", 10,1,100,0.1)*ma.SR/1000.0; // Feedback 0 to 1. GUIfeedback = hslider("feedback[style:knob]",0,0,100,0.1)/100.0; onems = ma.SR/1000.0; // VARIABLE DELAY LINE with FEEDBACK // vardelay in samples: buffer, delay time, interpolation, feedback vardelay(memdim,delay,inter,fb) = delcircuit with { delcircuit = (+ : de.sdelay(buffer, it, dt)) ~ *(fb); buffer = int(memdim); it = inter; dt = delay; }; process = vardelay(196000,GUIdelsamps,onems,0) <: _,_;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/c317ce80d81667953f95f85f02ba18493c720ee3/0.40_Variable_Delay.dsp
faust
import Standard Faust library https://github.com/grame-cncm/faustlibraries/ GUI AND CONVERSIONS Delay in samples & Delay in milliseconds Interpolation in samples & in milliseconds Feedback 0 to 1. VARIABLE DELAY LINE with FEEDBACK vardelay in samples: buffer, delay time, interpolation, feedback
import("stdfaust.lib"); GUIdelsamps = hslider("Delay[unit:samples][style:knob]",0,0,196000,1); GUIdelms = hslider("Delay[unit:milliseconds][style:knob]", 0, 0, 1000, 0.1)*ma.SR/1000.0; GUIintersamps = hslider("interpolation[unit:samples][style:knob]", 1,1,19600,1); GUIinterms = hslider("interpolation[unit:milliseconds][style:knob]", 10,1,100,0.1)*ma.SR/1000.0; GUIfeedback = hslider("feedback[style:knob]",0,0,100,0.1)/100.0; onems = ma.SR/1000.0; vardelay(memdim,delay,inter,fb) = delcircuit with { delcircuit = (+ : de.sdelay(buffer, it, dt)) ~ *(fb); buffer = int(memdim); it = inter; dt = delay; }; process = vardelay(196000,GUIdelsamps,onems,0) <: _,_;
ff312a7db2aa4b7e2b1fa39b2daf577b250f13efee6e5c2eceacec1328b45cda
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.01_Introduzione_Delay.dsp
// LINEE DI RITARDO IN FAUST /* Le linee di ritardo in Faust si suddividono nelle seguenti categorie: mem - indica un solo campione di ritardo @ - indica un numero (ex. 44100) di campioni di ritardo variabile x'- x indica un qualsiasi ingresso e: ' un campione di ritardo, ''(2), ecc. rdtable - indica una tabella di sola lettura rwtable - indica una tabella di scrittura e lettura */ // IMPULSO DI DIRAC tramite linea di ritardo // Importo la libreria import("stdfaust.lib"); // tramite le linee di ritardo // possiamo creare un impulso di Dirac, che rappresenta // la nostra unità minima, ovvero il singolo campione // mettendo un numero 1 e sottraendo da esso lo stesso valore // ma facendolo ad un campione di ritardo. // Impulso di Dirac dirac = 1-1'; // Process process = dirac, dirac;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/48b7304b541a812dd1292a3867da0aaf3395b074/0.01_Introduzione_Delay.dsp
faust
LINEE DI RITARDO IN FAUST Le linee di ritardo in Faust si suddividono nelle seguenti categorie: mem - indica un solo campione di ritardo @ - indica un numero (ex. 44100) di campioni di ritardo variabile x'- x indica un qualsiasi ingresso e: ' un campione di ritardo, ''(2), ecc. rdtable - indica una tabella di sola lettura rwtable - indica una tabella di scrittura e lettura IMPULSO DI DIRAC tramite linea di ritardo Importo la libreria tramite le linee di ritardo possiamo creare un impulso di Dirac, che rappresenta la nostra unità minima, ovvero il singolo campione mettendo un numero 1 e sottraendo da esso lo stesso valore ma facendolo ad un campione di ritardo. Impulso di Dirac Process
import("stdfaust.lib"); dirac = 1-1'; process = dirac, dirac;
20fee96903c4cd14363a03799beb870bb722a5d1b4f0c345809411a18a9ebb8b
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.30_Allpass_Filter.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // ALLPASS FILTER (FIR + IIR COMB FILTER) // ---------------------------------------- /* NO DIRECT SIGNAL APF */ /* dalla somma (+ si passa : ad un cavo _ ed uno split <: poi @ritardo e gain, in retroazione ~ alla somma iniziale. filtergain controlla l'ampiezza dei due stati di guadagno, che sono nel filtro lo stesso valore ma positivo e negativo, da una parte *-filtergain e da una parte *+filtergain. Nel feedback è già presente di default un campione di ritardo, ecco perché delaysamples-1. Per mantenere invece la soglia di ritardo del valore delaysamples, viene aggiunto un ritardo mem (del campione sottratto) in coda, prima della somma di uscita dell'allpass */ // (t,g) = give: delay in samples, feedback gain 0-1 APF(Del,G,x) = x:(+: _<: @(Del-1), *(G))~ *(-G):mem, _ : + : _; // out process = APF(420, 0.9);
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/5b0d8fdd01d355676ef017cd351e0e89f22d7387/0.30_Allpass_Filter.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- ALLPASS FILTER (FIR + IIR COMB FILTER) ---------------------------------------- NO DIRECT SIGNAL APF dalla somma (+ si passa : ad un cavo _ ed uno split <: poi @ritardo e gain, in retroazione ~ alla somma iniziale. filtergain controlla l'ampiezza dei due stati di guadagno, che sono nel filtro lo stesso valore ma positivo e negativo, da una parte *-filtergain e da una parte *+filtergain. Nel feedback è già presente di default un campione di ritardo, ecco perché delaysamples-1. Per mantenere invece la soglia di ritardo del valore delaysamples, viene aggiunto un ritardo mem (del campione sottratto) in coda, prima della somma di uscita dell'allpass (t,g) = give: delay in samples, feedback gain 0-1 out
import("stdfaust.lib"); APF(Del,G,x) = x:(+: _<: @(Del-1), *(G))~ *(-G):mem, _ : + : _; process = APF(420, 0.9);
4a1dd6b39a0825e66c0144f7278d7a89c93fe9379f4b43f6dfec2d3e5286c67a
LucaSpanedda/Riverberazione_Digitale_in_FAUST
1.02_Riverbero_di_Chamberlin_DecayMOD.dsp
// ---------------------------------------- // CHAMBERLIN REVERB // with T60 Decay // ---------------------------------------- // FAUST standard library import("stdfaust.lib"); // MS TO SAMPLES // (t) = give time in milliseconds we want to know in samples msasamps(t) = (ma.SR/1000)*t; // ALLPASS CHAMBERLIN // (t,g) = give: delay in samples, feedback gain 0-1 apffp(t,g) = (+: _<: @(min(max(t-1,0),ma.SR)), *(-g))~ *(g) : mem, _ : + : _; // T60 DECAY TIME from MILLISECONDS // (ms,seconds) = give: ms delay of the filter, seconds we want for t60 decay dect60(ms,seconds) = 1/(10^((3*(ms/1000))/seconds)); // CHAMBERLIN REVERB // (seconds) = give: decay time in seconds of 60dB chamberlindecay(seconds) = ap3ch <: apout1ch, apout2ch with{ ap3ch = apffp(msasamps(49.6),dect60(49.6,seconds)) : apffp(msasamps(34.75),dect60(34.75,seconds)) : apffp(msasamps(24.18),dect60(24.18,seconds)); apout1ch = apffp(msasamps(17.85),dect60(17.85,seconds)) : apffp(msasamps(10.98),dect60(10.98,seconds)); apout2ch = apffp(msasamps(18.01),dect60(18.01,seconds)) : apffp(msasamps(10.82),dect60(10.82,seconds)); }; process = chamberlindecay(10);
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/1777d784bae5508e833dccf6706d9986838ab4b2/1.02_Riverbero_di_Chamberlin_DecayMOD.dsp
faust
---------------------------------------- CHAMBERLIN REVERB with T60 Decay ---------------------------------------- FAUST standard library MS TO SAMPLES (t) = give time in milliseconds we want to know in samples ALLPASS CHAMBERLIN (t,g) = give: delay in samples, feedback gain 0-1 T60 DECAY TIME from MILLISECONDS (ms,seconds) = give: ms delay of the filter, seconds we want for t60 decay CHAMBERLIN REVERB (seconds) = give: decay time in seconds of 60dB
import("stdfaust.lib"); msasamps(t) = (ma.SR/1000)*t; apffp(t,g) = (+: _<: @(min(max(t-1,0),ma.SR)), *(-g))~ *(g) : mem, _ : + : _; dect60(ms,seconds) = 1/(10^((3*(ms/1000))/seconds)); chamberlindecay(seconds) = ap3ch <: apout1ch, apout2ch with{ ap3ch = apffp(msasamps(49.6),dect60(49.6,seconds)) : apffp(msasamps(34.75),dect60(34.75,seconds)) : apffp(msasamps(24.18),dect60(24.18,seconds)); apout1ch = apffp(msasamps(17.85),dect60(17.85,seconds)) : apffp(msasamps(10.98),dect60(10.98,seconds)); apout2ch = apffp(msasamps(18.01),dect60(18.01,seconds)) : apffp(msasamps(10.82),dect60(10.82,seconds)); }; process = chamberlindecay(10);
45f1eab1ee693f9538f2b701ade77e072892bfcbc34ae188497edda378e1affd
LucaSpanedda/Riverberazione_Digitale_in_FAUST
1.00_Early_Reflections.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // EARLY REFLECTIONS (PRIME RIFLESSIONI) // ---------------------------------------- /* Simulazione delle prime riflessioni in una stanza con il punto sorgente che coincide col punto di ascolto: */ // col router definisco gli input che mi devo passare dentro il codice // in questo caso 7 input: (a,b,c,d,e,f,g) in_router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; // process = router; // mando il segnale in ingresso ai 7 input del router input = _ <: in_router; //process = input; // definisco le prime riflessioni - multitap delay lines (NO FEEDBACK) multitap_delay(frnt,bck,sx,dx,up,dwn,direct) = frnt@(4481),bck@(2713),sx@(3719),dx@(3739),up@(1877),dwn@(659),direct; //process = early_reflections; // definisco un router per l'output che prenda 7 ingressi e li sommi // in un unica uscita out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; //process = earlyrelfect_router; // definisco una funzione dove esplico il percorso del segnale early_reflections = input : multitap_delay :> out_router; // output e test con un impulso di dirac (1 sample) process = os.impulse : early_reflections <: _,_;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/73b0b497131a09138aec088e3e82762202138ac9/1.00_Early_Reflections.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- EARLY REFLECTIONS (PRIME RIFLESSIONI) ---------------------------------------- Simulazione delle prime riflessioni in una stanza con il punto sorgente che coincide col punto di ascolto: col router definisco gli input che mi devo passare dentro il codice in questo caso 7 input: (a,b,c,d,e,f,g) process = router; mando il segnale in ingresso ai 7 input del router process = input; definisco le prime riflessioni - multitap delay lines (NO FEEDBACK) process = early_reflections; definisco un router per l'output che prenda 7 ingressi e li sommi in un unica uscita process = earlyrelfect_router; definisco una funzione dove esplico il percorso del segnale output e test con un impulso di dirac (1 sample)
import("stdfaust.lib"); in_router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; input = _ <: in_router; multitap_delay(frnt,bck,sx,dx,up,dwn,direct) = frnt@(4481),bck@(2713),sx@(3719),dx@(3739),up@(1877),dwn@(659),direct; out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; early_reflections = input : multitap_delay :> out_router; process = os.impulse : early_reflections <: _,_;
107e06fd5d6d4fd2e2a82d7fdab9a100cba7957e427fd1fe1641d9c086661021
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.20_Feedforward_Comb_Filter.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // FEEDFORWARD COMB FILTER (FIR of N° Order) // ---------------------------------------- /* Controlli del filtro: delaysamples = campioni di ritardo nel fastforward feedback = gain della retroazione col ritardo outgain = gain generale all'uscita del filtro */ /* _ è il segnale in ingresso, (_ rappresentazione segnale) viene a seguito diviso in due percorsi paralleli <: uno in ritardo di @(delaysamples) campioni (dunque valore da passare esternamente) e uno senza ritardo , _ (, segna il passaggio al secondo percorso) vengono poi risommati in un segnale unico :> _ ; Nel feedback è già presente di default un campione di ritardo, ecco perché delaysamples-1. il segnale in ritardo di un campione ha un controllo di ampiezza * feedforward c'è un controllo di ampiezza generale * outgain sulla funzione in uscita onezeroout */ // (t,g) = delay time in samples, filter gain 0-1 ffcf(t,g) = _ <: ( _@(t-1) *g), _ :> _; // uscita con il process: // viene usato un noise per testare il filtro in questa uscita process = no.noise : ffcf(100, 0.9) <: _,_;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/d021716c3bf373adf4d1b79fffc49e3ca8d62280/0.20_Feedforward_Comb_Filter.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- FEEDFORWARD COMB FILTER (FIR of N° Order) ---------------------------------------- Controlli del filtro: delaysamples = campioni di ritardo nel fastforward feedback = gain della retroazione col ritardo outgain = gain generale all'uscita del filtro _ è il segnale in ingresso, (_ rappresentazione segnale) viene a seguito diviso in due percorsi paralleli <: uno in ritardo di @(delaysamples) campioni (dunque valore da passare esternamente) e uno senza ritardo , _ (, segna il passaggio al secondo percorso) vengono poi risommati in un segnale unico :> _ ; Nel feedback è già presente di default un campione di ritardo, ecco perché delaysamples-1. il segnale in ritardo di un campione ha un controllo di ampiezza * feedforward c'è un controllo di ampiezza generale * outgain sulla funzione in uscita onezeroout (t,g) = delay time in samples, filter gain 0-1 uscita con il process: viene usato un noise per testare il filtro in questa uscita
import("stdfaust.lib"); ffcf(t,g) = _ <: ( _@(t-1) *g), _ :> _; process = no.noise : ffcf(100, 0.9) <: _,_;
c113dfb07d9594bb40fb356a6d59a180aefa21814f313915f6e02fda48f98f3f
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.07_Routing_di_un_segnale.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // IL ROUTING DI UN SEGNALE // ---------------------------------------- /* in FAUST di base, non è un processo scontato gestire il routing di un segnale che superi le due entrate o uscite di collegamento in catena. Con la tecnica della funzione router illustrata a seguito si rende possibile la gestione di più canali indipendenti nello sviluppo del nostro algoritmo DSP */ // con la funzione router // definisco gli input che mi devo passare dentro il codice // ad esempio: in questo caso 7 input (a,b,c,d,e,f,g) router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; // process = router; // e gestisco le operazioni desiderate tra i canali, // in questo caso sommo tutti i canali in un unica uscita out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; //process = out_router; // infine definisco la funzione dove esplico il percorso del segnale process = _ <: router :> out_router; // avrò dunque creato un percorso di un singolo canale // che si ramifica in 7 ingressi nella funzione router // e che si sommano in un unica uscita con la funzione out_router
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/0a121ccb7a2a8f828c482b77781e2fa39a24b69c/0.07_Routing_di_un_segnale.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- IL ROUTING DI UN SEGNALE ---------------------------------------- in FAUST di base, non è un processo scontato gestire il routing di un segnale che superi le due entrate o uscite di collegamento in catena. Con la tecnica della funzione router illustrata a seguito si rende possibile la gestione di più canali indipendenti nello sviluppo del nostro algoritmo DSP con la funzione router definisco gli input che mi devo passare dentro il codice ad esempio: in questo caso 7 input (a,b,c,d,e,f,g) process = router; e gestisco le operazioni desiderate tra i canali, in questo caso sommo tutti i canali in un unica uscita process = out_router; infine definisco la funzione dove esplico il percorso del segnale avrò dunque creato un percorso di un singolo canale che si ramifica in 7 ingressi nella funzione router e che si sommano in un unica uscita con la funzione out_router
import("stdfaust.lib"); router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; process = _ <: router :> out_router;
cd13abfee177242eb2a597253b6f19c15083d1435c6a8c6847b59c2186e09954
LucaSpanedda/Riverberazione_Digitale_in_FAUST
2.0_Xavier_Godart_owlgazer_dirty.dsp
declare name "Owlgazer Dirty Reverb"; declare version "1.0.0"; declare author "Xavier Godart"; declare copyright "(c) Empirical Noises 2017"; import("stdfaust.lib"); owlgazer(mix,decay,hicut,gain) = _,_ <: ( _,_ <: (si.bus(N*2) :> networkline)~(feedbackline) :> distorsion,distorsion : fi.lowpass(2, hicut),fi.lowpass(2, hicut) : *(mix),*(mix) ), (*(1-mix),*(1-mix)) :> _,_ with { N = 4; earlyAPNb = 3; MAXDELAY = 8192; clip(lo,hi) = min(hi) : max(lo); cubic(x) = x - x*x*x/3; preGain = pow(10, gain*2); postVolume = 1-gain; distorsion = *(preGain) : clip(-1,1) : cubic : fi.dcblocker : *(postVolume); delays = (2401, 3125, 6561, 14641); delayval(i) = ba.take(i+1,delays); earlyreflections(i) = seq(j, earlyAPNb, fi.allpass_fcomb(2048, delayval(j+1), -allpassfb) ) with{ allpassfb = 0.6; delays = (243, 343, 625, 727, 1331, 2403, 3119); delayval(x) = ba.take(x+1, delays); }; latereflections(i) = de.fdelay(MAXDELAY, delayval(i)); networkline = par(i,N, _ : earlyreflections(i) : latereflections(i) : _/sqrt(N) ) : _,_,fi.highpass(1, 90),_; feedbackline = ro.hadamard(N) : par(i,N,*(decay)); }; owlgazer_ui = owlgazer(mix,decay,hicut,gain) with { decay = hslider("DECAY[OWL:A]", 0.7, 0.5, 1.00, 0.01) : *(0.5) : +(0.5); hicut = hslider("TONE[OWL:B][scale:log]", 4000, 900, 8000, 0.01); gain = hslider("DRIVE[OWL:C]", 0, 0, 0.7, 0.1); mix = hslider("MIX[OWL:D]", 0.75, 0, 1, 0.01); }; process = owlgazer_ui;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/af19b40c9b0289cf2f759b957a63c48ac3c17ae5/2.0_Xavier_Godart_owlgazer_dirty.dsp
faust
declare name "Owlgazer Dirty Reverb"; declare version "1.0.0"; declare author "Xavier Godart"; declare copyright "(c) Empirical Noises 2017"; import("stdfaust.lib"); owlgazer(mix,decay,hicut,gain) = _,_ <: ( _,_ <: (si.bus(N*2) :> networkline)~(feedbackline) :> distorsion,distorsion : fi.lowpass(2, hicut),fi.lowpass(2, hicut) : *(mix),*(mix) ), (*(1-mix),*(1-mix)) :> _,_ with { N = 4; earlyAPNb = 3; MAXDELAY = 8192; clip(lo,hi) = min(hi) : max(lo); cubic(x) = x - x*x*x/3; preGain = pow(10, gain*2); postVolume = 1-gain; distorsion = *(preGain) : clip(-1,1) : cubic : fi.dcblocker : *(postVolume); delays = (2401, 3125, 6561, 14641); delayval(i) = ba.take(i+1,delays); earlyreflections(i) = seq(j, earlyAPNb, fi.allpass_fcomb(2048, delayval(j+1), -allpassfb) ) with{ allpassfb = 0.6; delays = (243, 343, 625, 727, 1331, 2403, 3119); delayval(x) = ba.take(x+1, delays); }; latereflections(i) = de.fdelay(MAXDELAY, delayval(i)); networkline = par(i,N, _ : earlyreflections(i) : latereflections(i) : _/sqrt(N) ) : _,_,fi.highpass(1, 90),_; feedbackline = ro.hadamard(N) : par(i,N,*(decay)); }; owlgazer_ui = owlgazer(mix,decay,hicut,gain) with { decay = hslider("DECAY[OWL:A]", 0.7, 0.5, 1.00, 0.01) : *(0.5) : +(0.5); hicut = hslider("TONE[OWL:B][scale:log]", 4000, 900, 8000, 0.01); gain = hslider("DRIVE[OWL:C]", 0, 0, 0.7, 0.1); mix = hslider("MIX[OWL:D]", 0.75, 0, 1, 0.01); }; process = owlgazer_ui;
5b51e9e6e2bd1258fd87d068b0933426f291b1e50a20cb96ebb42fbc7d2ef9f9
LucaSpanedda/Riverberazione_Digitale_in_FAUST
2.0_Xavier_Godart_owlgazer_shimmer.dsp
declare name "Owlgazer Shimmer Reverb"; declare version "1.0.0"; declare author "Xavier Godart"; declare copyright "(c) Empirical Noises 2017"; import("stdfaust.lib"); owlgazer(mix,decay,hicut,pitchmix) = _,_ <: ( _,_ <: (si.bus(N*2) :> networkline)~(feedbackline) :> *(mix),*(mix) ), (*(1-mix),*(1-mix)) :> _,_ with { N = 4; earlyAPNb = 2; MAXDELAY = 8192; delays = (2401.0, 3125.0, 6561.0, 14641.0); delayval(i) = ba.take(i+1,delays); pitchshifter(delay, pitch, amount) = _ <: de.delay(MAXDELAY, delay)*(1-amount),(ef.transpose(delay,delay,pitch)*amount) :> _; earlyreflections = seq(i, earlyAPNb, fi.allpass_comb(2048, delayval(i), -allpassfb) ) with{ allpassfb = 0.6; delays = (729.0, 1331.0, 625.0, 343.0); delayval(j) = ba.take(j+1, delays); }; latereflections(i) = _ <: de.fdelay(MAXDELAY, delayval(i))*(i!=3), pitchshifter(MAXDELAY + delayval(i),12,pitchmix)*(i==3) :> _; networkline = par(i,N, _ : earlyreflections : latereflections(i) : _/sqrt(N) ) : fi.lowpass(1, hicut),fi.highpass(1, 90),fi.lowpass(1, hicut),_; feedbackline = ro.hadamard(N) : par(i,N,*(decay)); }; owlgazer_ui = owlgazer(mix,decay,hicut,pitchmix) with { decay = hslider("DECAY[OWL:A]", 0.7, 0.5, 1.00, 0.01) : *(0.5) : +(0.5); hicut = hslider("TONE[OWL:B][scale:log]", 4000, 900, 8000, 0.01); pitchmix = hslider("SHIMMER[OWL:C]", 0.3, 0, 0.7, 0.01); mix = hslider("MIX[OWL:D]", 0.75, 0, 1, 0.01); }; process = owlgazer_ui;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/af19b40c9b0289cf2f759b957a63c48ac3c17ae5/2.0_Xavier_Godart_owlgazer_shimmer.dsp
faust
declare name "Owlgazer Shimmer Reverb"; declare version "1.0.0"; declare author "Xavier Godart"; declare copyright "(c) Empirical Noises 2017"; import("stdfaust.lib"); owlgazer(mix,decay,hicut,pitchmix) = _,_ <: ( _,_ <: (si.bus(N*2) :> networkline)~(feedbackline) :> *(mix),*(mix) ), (*(1-mix),*(1-mix)) :> _,_ with { N = 4; earlyAPNb = 2; MAXDELAY = 8192; delays = (2401.0, 3125.0, 6561.0, 14641.0); delayval(i) = ba.take(i+1,delays); pitchshifter(delay, pitch, amount) = _ <: de.delay(MAXDELAY, delay)*(1-amount),(ef.transpose(delay,delay,pitch)*amount) :> _; earlyreflections = seq(i, earlyAPNb, fi.allpass_comb(2048, delayval(i), -allpassfb) ) with{ allpassfb = 0.6; delays = (729.0, 1331.0, 625.0, 343.0); delayval(j) = ba.take(j+1, delays); }; latereflections(i) = _ <: de.fdelay(MAXDELAY, delayval(i))*(i!=3), pitchshifter(MAXDELAY + delayval(i),12,pitchmix)*(i==3) :> _; networkline = par(i,N, _ : earlyreflections : latereflections(i) : _/sqrt(N) ) : fi.lowpass(1, hicut),fi.highpass(1, 90),fi.lowpass(1, hicut),_; feedbackline = ro.hadamard(N) : par(i,N,*(decay)); }; owlgazer_ui = owlgazer(mix,decay,hicut,pitchmix) with { decay = hslider("DECAY[OWL:A]", 0.7, 0.5, 1.00, 0.01) : *(0.5) : +(0.5); hicut = hslider("TONE[OWL:B][scale:log]", 4000, 900, 8000, 0.01); pitchmix = hslider("SHIMMER[OWL:C]", 0.3, 0, 0.7, 0.01); mix = hslider("MIX[OWL:D]", 0.75, 0, 1, 0.01); }; process = owlgazer_ui;
463dd498dd7d474f44169688240bb17837e28aec0ad0733aaf92d18c44dda1c0
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.03_Conversione_Millisecondi_In_Campioni.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // CONVERSIONE MILLISECONDI IN CAMPIONI // ---------------------------------------- /* Funzione Conversione Campioni in ms. : inserisco il tempo in Millisecondi, e la funzione mi tira fuori il valore in Campioni. Ad esempio, se ho una frequenza di campionamento di 48.000 campioni al secondo, vuole dire che 1000ms (1 secondo) sono rappresentati da 48.000 parti, e che quindi una singola unità temporale come 1 ms. Corrisponde in digitale a 48 campioni. Per questo motivo si divide la frequenza di campionamento per 1000ms avendo dunque in risultato un tot. di campioni che corrisponde ad 1 ms. nel mondo digitale ad una determinata frequenza di campionamento. E poi si moltiplica il risultato di questa operazione per il totale di ms. che vogliamo ottenere come rappresentazione in campioni. Se moltiplico *10. Ad esempio avrò in uscita dalla funzione, 480 campioni ad una frequenza di campionamento di 48.000 campioni al secondo. */ // (t) = give time in milliseconds we want to know in samples msasamps(t) = (ma.SR / 1000.) * t; process = _;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/aee95412f2f648cef4a6dd06a2a7ab73f848ddc0/0.03_Conversione_Millisecondi_In_Campioni.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- CONVERSIONE MILLISECONDI IN CAMPIONI ---------------------------------------- Funzione Conversione Campioni in ms. : inserisco il tempo in Millisecondi, e la funzione mi tira fuori il valore in Campioni. Ad esempio, se ho una frequenza di campionamento di 48.000 campioni al secondo, vuole dire che 1000ms (1 secondo) sono rappresentati da 48.000 parti, e che quindi una singola unità temporale come 1 ms. Corrisponde in digitale a 48 campioni. Per questo motivo si divide la frequenza di campionamento per 1000ms avendo dunque in risultato un tot. di campioni che corrisponde ad 1 ms. nel mondo digitale ad una determinata frequenza di campionamento. E poi si moltiplica il risultato di questa operazione per il totale di ms. che vogliamo ottenere come rappresentazione in campioni. Se moltiplico *10. Ad esempio avrò in uscita dalla funzione, 480 campioni ad una frequenza di campionamento di 48.000 campioni al secondo. (t) = give time in milliseconds we want to know in samples
import("stdfaust.lib"); msasamps(t) = (ma.SR / 1000.) * t; process = _;
27b72871d0ec5c0174b2c9d9c3fcd4535eabd772e7b7f60f0627ca2f438a28bc
LucaSpanedda/Luca_Spanedda_St_Cecilia_Conservatory_Thesis
CSGA.dsp
// import faust standard library import("stdfaust.lib"); // FFT analysis - List Cello1_D2_frequencies = ( 368.0, 221.0, 147.0, 515.0, 736.0, 74.0, 589.0, 810.0, 883.0, 295.0, 442.0, 662.0, 1693.0, 956.0, 1030.0, 2282.0, 1914.0, 1546.0, 1104.0, 1472.0, 2356.0, 2503.0, 2135.0, 1251.0, 1398.0, 1325.0, 1178.0, 2061.0, 2429.0, 2209.0, 1619.0, 2572.0, 1840.0, 2655.0, 1766.0, 2865.0) ; Cello1_D2_amplitudes = ( 1.0, 0.883508750371294, 0.6105272358722508, 0.25009984168236576, 0.2004373971446242, 0.19782531572463796, 0.15986608084324763, 0.15408867955329245, 0.15388399774271314, 0.12206611629626225, 0.07568694217870818, 0.0749419685950924, 0.04993743413946004, 0.04296305701601583, 0.03695324484801036, 0.035190168499954565, 0.034299901561064564, 0.027814420294695608, 0.025519908386620865, 0.025451275008886335, 0.024970356245165314, 0.02376619002590769, 0.02359690477324046, 0.02108580284017779, 0.020955020563014883, 0.02080994218773682, 0.020502590513884294, 0.019359564369447416, 0.01934635943322834, 0.018745547950376563, 0.014962909727368317, 0.011249397635411025, 0.00849049090994134, 0.0070851384197025405, 0.006322712098150642, 0.0062269201300692465) ; Cello1_D2_bandwidths = ( 1.0 ) ; Cello2_D2_frequencies = ( 129.0, 782.0, 260.0, 521.0, 391.0, 1042.0, 1949.0, 912.0, 1558.0, 2079.0, 651.0, 2351.0, 1699.0, 2221.0, 1433.0, 1819.0, 442.0, 1308.0, 1178.0, 569.0, 2481.0, 2275.0, 2861.0, 2532.0, 2403.0, 2991.0, 2600.0, 2142.0, 3116.0, 1753.0, 2667.0, 3377.0, 3637.0, 3446.0, 3523.0, 3268.0) ; Cello2_D2_amplitudes = ( 1.0, 0.5539841329657997, 0.5527755241243919, 0.3798690322097816, 0.24385623120426272, 0.1858573818584144, 0.1718924484719696, 0.13549203046918346, 0.09550335625230665, 0.06326345700196957, 0.05721228382207657, 0.046121609704541516, 0.04311865463771355, 0.032964828166694375, 0.02880281110676074, 0.02747889262701017, 0.02513218851591026, 0.02498359541143432, 0.024351519031547093, 0.022320475851666407, 0.020022022408488896, 0.01947464397996532, 0.018274828098453825, 0.017151821615801758, 0.016455897816434754, 0.014466403589882717, 0.011927332037780307, 0.010669371414647293, 0.008807995446126208, 0.007513211416567189, 0.007349012756623662, 0.0044685740115062425, 0.004297015920414301, 0.004118966421804356, 0.003062546865966815, 0.002902563274463849) ; Cello2_D2_bandwidths = ( 1.0 ) ; Cello3_D2_frequencies = ( 98.0, 783.0, 294.0, 587.0, 685.0, 196.0, 489.0, 1566.0, 2055.0, 391.0, 1957.0, 1468.0, 881.0, 1076.0, 2153.0, 1664.0, 2544.0, 2349.0, 2251.0, 1370.0, 2446.0, 1272.0, 2642.0, 978.0, 2936.0, 1761.0, 1174.0, 3033.0, 2740.0, 3229.0, 832.0, 2838.0, 3327.0, 3621.0, 3717.0, 3816.0, 3425.0, 3523.0) ; Cello3_D2_amplitudes = ( 1.0, 0.5246811846335828, 0.4012585768972376, 0.22942034106512663, 0.20079641370293627, 0.18876983281899867, 0.12502443350296757, 0.0933584257472202, 0.07841217109023603, 0.07786536078021235, 0.06732374792084482, 0.06398941035139119, 0.06048111263906231, 0.05915731723672648, 0.058731470170536024, 0.05118398937740636, 0.046391926665833076, 0.040066228067825026, 0.03988990722982784, 0.03345736827139034, 0.032867690289697674, 0.026159698256227056, 0.02450082955507741, 0.022720013057591623, 0.01673071239995854, 0.01386228359792361, 0.011125330538207747, 0.01045539895797359, 0.008912949330652495, 0.008614981571685254, 0.007903782014397535, 0.006904461116857643, 0.005737821129793645, 0.004468696578275683, 0.004458611785686046, 0.004255083332897215, 0.004082351498449864, 0.003974921717750587) ; Cello3_D2_bandwidths = ( 1.0 ) ; Cello4_D2_frequencies = ( 165.0, 247.0, 82.0, 412.0, 329.0, 576.0, 824.0, 906.0, 741.0, 494.0, 659.0, 1560.0, 1725.0, 1071.0, 1658.0, 2152.0, 1313.0, 994.0, 1488.0, 1807.0, 2564.0, 1905.0, 1230.0, 2296.0, 1972.0, 2214.0, 2070.0, 2399.0, 1395.0, 1153.0, 2950.0, 2873.0, 2708.0) ; Cello4_D2_amplitudes = ( 1.0, 0.40463907988091696, 0.24305538012575184, 0.09564215197843938, 0.07882101859578412, 0.07272871966988338, 0.06616610763986651, 0.05372820415795432, 0.03670485927598048, 0.027388497371127554, 0.021635361017390872, 0.010607924019265583, 0.009233410589260653, 0.008987446999479275, 0.008735131399976701, 0.007861982586356843, 0.007105490361846338, 0.006690209866887384, 0.005720588228210853, 0.005655438992297758, 0.00564938401160071, 0.0054292290841770575, 0.00528525120649931, 0.0051118414293123745, 0.004984368543658675, 0.004299506779823275, 0.004149143995148571, 0.003924111275742912, 0.003601811817177141, 0.002426805651034355, 0.001983449226846196, 0.0017614827121850407, 0.0015088640939487819) ; Cello4_D2_bandwidths = ( 1.0 ) ; // Take FFT Lists FrequenciesListCH1(index) = ba.take(index, Cello1_D2_frequencies) ; AmplitudesListCH1(index) = ba.take(index, Cello1_D2_amplitudes) ; BandwidthsListCH1(index) = ba.take(1, Cello1_D2_bandwidths) ; FrequenciesListCH2(index) = ba.take(index, Cello2_D2_frequencies) ; AmplitudesListCH2(index) = ba.take(index, Cello2_D2_amplitudes) ; BandwidthsListCH2(index) = ba.take(1, Cello2_D2_bandwidths) ; FrequenciesListCH3(index) = ba.take(index, Cello3_D2_frequencies) ; AmplitudesListCH3(index) = ba.take(index, Cello3_D2_amplitudes) ; BandwidthsListCH3(index) = ba.take(1, Cello3_D2_bandwidths) ; FrequenciesListCH4(index) = ba.take(index, Cello4_D2_frequencies) ; AmplitudesListCH4(index) = ba.take(index, Cello4_D2_amplitudes) ; BandwidthsListCH4(index) = ba.take(1, Cello4_D2_bandwidths) ; // linear interpolation linInterpolate(x0, x1, delta) = x0 + delta * (x1-x0); siglinInterpol(order, x) = x : seq(r, order, interpolate) with{ interpolate(y) = y + .5 * (y' - y); }; // bilinear interpolation bilinInterpolate(x0, x1, x0b, x1b, dt1, dt2) = linInterpolate( linInterpolate(x0, x1, dt1), linInterpolate(x0b, x1b, dt1), dt2) with{ linInterpolate(x0, x1, delta) = x0 + delta * (x1-x0); }; // lists interpolations FrequenciesListinterpolate(index, dt1, dt2) = bilinInterpolate(FrequenciesListCH1(index), FrequenciesListCH2(index), FrequenciesListCH3(index), FrequenciesListCH4(index), dt1, dt2); AmplitudesListinterpolate(index, dt1, dt2) = bilinInterpolate(AmplitudesListCH1(index), AmplitudesListCH2(index), AmplitudesListCH3(index), AmplitudesListCH4(index), dt1, dt2); BandwidthsListinterpolate(index, dt1, dt2) = bilinInterpolate(BandwidthsListCH1(index), BandwidthsListCH2(index), BandwidthsListCH3(index), BandwidthsListCH4(index), dt1, dt2); // optimized BP from the TPT version of the SVF Filter by Vadim Zavalishin BPSVF(glin, bw, cf, x) = loop ~ si.bus(2) : (! , ! , _) with { g = tan(cf * ma.PI * (1.0/ma.SR)); Q = cf / max(ma.EPSILON, bw); R = 1.0 / (Q + Q); G = 1.0 / (1.0 + 2.0 * R * g + g * g); loop(s1, s2) = u1 , u2 , bp * glin with { bp = (g * (x - s2) + s1) * G; bp2 = bp + bp; v2 = bp2 * g; u1 = bp2 - s1; u2 = v2 + s2; }; }; // Spectre BP Filter Banks BandpassFiltersBank(bypassFilter, filterPartials, filterOrder, globalFreq, globalAmps, globalBW, interpolation1, interpolation2, x) = x <: par(i, filterPartials, seq(r, filterOrder, BPSVF( AmplitudesListinterpolate( (i + 1), interpolation1, interpolation2) * globalAmps, BandwidthsListinterpolate( (i + 1), interpolation1, interpolation2) * globalBW, FrequenciesListinterpolate( (i + 1), interpolation1, interpolation2) * globalFreq ) ) ):> (+ / filterPartials) * (1 - bypassFilter) + x * bypassFilter; // Hyperbolic Tangent Saturator Parameter THRESHOLD = 1000; // Hyperbolic Tangent Saturator Function saturator(lim, x) = lim * ma.tanh( x / (max(lim, ma.EPSILON)) ); // DC Blocker Parameters ZERO = 1; POLE = .995; // DC Blocker Filter Function dcblocker(zero, pole, x) = x : _ <: _, mem : _, * (zero) : - : + ~ * (pole); // Costrained (Modified) Lorenz System LorenzSystem(x0, y0, z0, dt, beta, rho, sigma, tanHrange) = ( LorenzSystemEquations : par(i, 3, dcblocker(1, .995)) : par(i, 3, saturator(tanHrange)) : par(i, 3, _ : BandpassFiltersBank(0, 32, 1, 1, 1, 2, 1, 1)) ) ~ si.bus(3) : par(i, 3, _ / (tanHrange)) :> (_ / (3 * 2)) with { x_init = x0-x0'; y_init = y0-y0'; z_init = z0-z0'; LorenzSystemEquations(x, y, z) = (x + (sigma * (y - x)) * dt + x_init), (y + ((rho * x) - (x * z) - y) * dt + y_init), (z + ((x * y) - (beta * z)) * dt + z_init); }; process = LorenzSystem(1.2, 1.3, 1.6, .150, 2, 3.4, 1.9, THRESHOLD) <: _, _;
https://raw.githubusercontent.com/LucaSpanedda/Luca_Spanedda_St_Cecilia_Conservatory_Thesis/b73b60d9e0b45e09bbf72b1477c21202b895f1bb/ITA/codes/CSGA.dsp
faust
import faust standard library FFT analysis - List Take FFT Lists linear interpolation bilinear interpolation lists interpolations optimized BP from the TPT version of the SVF Filter by Vadim Zavalishin Spectre BP Filter Banks Hyperbolic Tangent Saturator Parameter Hyperbolic Tangent Saturator Function DC Blocker Parameters DC Blocker Filter Function Costrained (Modified) Lorenz System
import("stdfaust.lib"); Cello1_D2_frequencies = ( 368.0, 221.0, 147.0, 515.0, 736.0, 74.0, 589.0, 810.0, 883.0, 295.0, 442.0, 662.0, 1693.0, 956.0, 1030.0, 2282.0, 1914.0, 1546.0, 1104.0, 1472.0, 2356.0, 2503.0, 2135.0, 1251.0, 1398.0, 1325.0, 1178.0, 2061.0, 2429.0, 2209.0, 1619.0, 2572.0, 1840.0, 2655.0, 1766.0, 2865.0) ; Cello1_D2_amplitudes = ( 1.0, 0.883508750371294, 0.6105272358722508, 0.25009984168236576, 0.2004373971446242, 0.19782531572463796, 0.15986608084324763, 0.15408867955329245, 0.15388399774271314, 0.12206611629626225, 0.07568694217870818, 0.0749419685950924, 0.04993743413946004, 0.04296305701601583, 0.03695324484801036, 0.035190168499954565, 0.034299901561064564, 0.027814420294695608, 0.025519908386620865, 0.025451275008886335, 0.024970356245165314, 0.02376619002590769, 0.02359690477324046, 0.02108580284017779, 0.020955020563014883, 0.02080994218773682, 0.020502590513884294, 0.019359564369447416, 0.01934635943322834, 0.018745547950376563, 0.014962909727368317, 0.011249397635411025, 0.00849049090994134, 0.0070851384197025405, 0.006322712098150642, 0.0062269201300692465) ; Cello1_D2_bandwidths = ( 1.0 ) ; Cello2_D2_frequencies = ( 129.0, 782.0, 260.0, 521.0, 391.0, 1042.0, 1949.0, 912.0, 1558.0, 2079.0, 651.0, 2351.0, 1699.0, 2221.0, 1433.0, 1819.0, 442.0, 1308.0, 1178.0, 569.0, 2481.0, 2275.0, 2861.0, 2532.0, 2403.0, 2991.0, 2600.0, 2142.0, 3116.0, 1753.0, 2667.0, 3377.0, 3637.0, 3446.0, 3523.0, 3268.0) ; Cello2_D2_amplitudes = ( 1.0, 0.5539841329657997, 0.5527755241243919, 0.3798690322097816, 0.24385623120426272, 0.1858573818584144, 0.1718924484719696, 0.13549203046918346, 0.09550335625230665, 0.06326345700196957, 0.05721228382207657, 0.046121609704541516, 0.04311865463771355, 0.032964828166694375, 0.02880281110676074, 0.02747889262701017, 0.02513218851591026, 0.02498359541143432, 0.024351519031547093, 0.022320475851666407, 0.020022022408488896, 0.01947464397996532, 0.018274828098453825, 0.017151821615801758, 0.016455897816434754, 0.014466403589882717, 0.011927332037780307, 0.010669371414647293, 0.008807995446126208, 0.007513211416567189, 0.007349012756623662, 0.0044685740115062425, 0.004297015920414301, 0.004118966421804356, 0.003062546865966815, 0.002902563274463849) ; Cello2_D2_bandwidths = ( 1.0 ) ; Cello3_D2_frequencies = ( 98.0, 783.0, 294.0, 587.0, 685.0, 196.0, 489.0, 1566.0, 2055.0, 391.0, 1957.0, 1468.0, 881.0, 1076.0, 2153.0, 1664.0, 2544.0, 2349.0, 2251.0, 1370.0, 2446.0, 1272.0, 2642.0, 978.0, 2936.0, 1761.0, 1174.0, 3033.0, 2740.0, 3229.0, 832.0, 2838.0, 3327.0, 3621.0, 3717.0, 3816.0, 3425.0, 3523.0) ; Cello3_D2_amplitudes = ( 1.0, 0.5246811846335828, 0.4012585768972376, 0.22942034106512663, 0.20079641370293627, 0.18876983281899867, 0.12502443350296757, 0.0933584257472202, 0.07841217109023603, 0.07786536078021235, 0.06732374792084482, 0.06398941035139119, 0.06048111263906231, 0.05915731723672648, 0.058731470170536024, 0.05118398937740636, 0.046391926665833076, 0.040066228067825026, 0.03988990722982784, 0.03345736827139034, 0.032867690289697674, 0.026159698256227056, 0.02450082955507741, 0.022720013057591623, 0.01673071239995854, 0.01386228359792361, 0.011125330538207747, 0.01045539895797359, 0.008912949330652495, 0.008614981571685254, 0.007903782014397535, 0.006904461116857643, 0.005737821129793645, 0.004468696578275683, 0.004458611785686046, 0.004255083332897215, 0.004082351498449864, 0.003974921717750587) ; Cello3_D2_bandwidths = ( 1.0 ) ; Cello4_D2_frequencies = ( 165.0, 247.0, 82.0, 412.0, 329.0, 576.0, 824.0, 906.0, 741.0, 494.0, 659.0, 1560.0, 1725.0, 1071.0, 1658.0, 2152.0, 1313.0, 994.0, 1488.0, 1807.0, 2564.0, 1905.0, 1230.0, 2296.0, 1972.0, 2214.0, 2070.0, 2399.0, 1395.0, 1153.0, 2950.0, 2873.0, 2708.0) ; Cello4_D2_amplitudes = ( 1.0, 0.40463907988091696, 0.24305538012575184, 0.09564215197843938, 0.07882101859578412, 0.07272871966988338, 0.06616610763986651, 0.05372820415795432, 0.03670485927598048, 0.027388497371127554, 0.021635361017390872, 0.010607924019265583, 0.009233410589260653, 0.008987446999479275, 0.008735131399976701, 0.007861982586356843, 0.007105490361846338, 0.006690209866887384, 0.005720588228210853, 0.005655438992297758, 0.00564938401160071, 0.0054292290841770575, 0.00528525120649931, 0.0051118414293123745, 0.004984368543658675, 0.004299506779823275, 0.004149143995148571, 0.003924111275742912, 0.003601811817177141, 0.002426805651034355, 0.001983449226846196, 0.0017614827121850407, 0.0015088640939487819) ; Cello4_D2_bandwidths = ( 1.0 ) ; FrequenciesListCH1(index) = ba.take(index, Cello1_D2_frequencies) ; AmplitudesListCH1(index) = ba.take(index, Cello1_D2_amplitudes) ; BandwidthsListCH1(index) = ba.take(1, Cello1_D2_bandwidths) ; FrequenciesListCH2(index) = ba.take(index, Cello2_D2_frequencies) ; AmplitudesListCH2(index) = ba.take(index, Cello2_D2_amplitudes) ; BandwidthsListCH2(index) = ba.take(1, Cello2_D2_bandwidths) ; FrequenciesListCH3(index) = ba.take(index, Cello3_D2_frequencies) ; AmplitudesListCH3(index) = ba.take(index, Cello3_D2_amplitudes) ; BandwidthsListCH3(index) = ba.take(1, Cello3_D2_bandwidths) ; FrequenciesListCH4(index) = ba.take(index, Cello4_D2_frequencies) ; AmplitudesListCH4(index) = ba.take(index, Cello4_D2_amplitudes) ; BandwidthsListCH4(index) = ba.take(1, Cello4_D2_bandwidths) ; linInterpolate(x0, x1, delta) = x0 + delta * (x1-x0); siglinInterpol(order, x) = x : seq(r, order, interpolate) with{ interpolate(y) = y + .5 * (y' - y); }; bilinInterpolate(x0, x1, x0b, x1b, dt1, dt2) = linInterpolate( linInterpolate(x0, x1, dt1), linInterpolate(x0b, x1b, dt1), dt2) with{ linInterpolate(x0, x1, delta) = x0 + delta * (x1-x0); }; FrequenciesListinterpolate(index, dt1, dt2) = bilinInterpolate(FrequenciesListCH1(index), FrequenciesListCH2(index), FrequenciesListCH3(index), FrequenciesListCH4(index), dt1, dt2); AmplitudesListinterpolate(index, dt1, dt2) = bilinInterpolate(AmplitudesListCH1(index), AmplitudesListCH2(index), AmplitudesListCH3(index), AmplitudesListCH4(index), dt1, dt2); BandwidthsListinterpolate(index, dt1, dt2) = bilinInterpolate(BandwidthsListCH1(index), BandwidthsListCH2(index), BandwidthsListCH3(index), BandwidthsListCH4(index), dt1, dt2); BPSVF(glin, bw, cf, x) = loop ~ si.bus(2) : (! , ! , _) with { g = tan(cf * ma.PI * (1.0/ma.SR)); Q = cf / max(ma.EPSILON, bw); R = 1.0 / (Q + Q); G = 1.0 / (1.0 + 2.0 * R * g + g * g); loop(s1, s2) = u1 , u2 , bp * glin with { bp = (g * (x - s2) + s1) * G; bp2 = bp + bp; v2 = bp2 * g; u1 = bp2 - s1; u2 = v2 + s2; }; }; BandpassFiltersBank(bypassFilter, filterPartials, filterOrder, globalFreq, globalAmps, globalBW, interpolation1, interpolation2, x) = x <: par(i, filterPartials, seq(r, filterOrder, BPSVF( AmplitudesListinterpolate( (i + 1), interpolation1, interpolation2) * globalAmps, BandwidthsListinterpolate( (i + 1), interpolation1, interpolation2) * globalBW, FrequenciesListinterpolate( (i + 1), interpolation1, interpolation2) * globalFreq ) ) ):> (+ / filterPartials) * (1 - bypassFilter) + x * bypassFilter; THRESHOLD = 1000; saturator(lim, x) = lim * ma.tanh( x / (max(lim, ma.EPSILON)) ); ZERO = 1; POLE = .995; dcblocker(zero, pole, x) = x : _ <: _, mem : _, * (zero) : - : + ~ * (pole); LorenzSystem(x0, y0, z0, dt, beta, rho, sigma, tanHrange) = ( LorenzSystemEquations : par(i, 3, dcblocker(1, .995)) : par(i, 3, saturator(tanHrange)) : par(i, 3, _ : BandpassFiltersBank(0, 32, 1, 1, 1, 2, 1, 1)) ) ~ si.bus(3) : par(i, 3, _ / (tanHrange)) :> (_ / (3 * 2)) with { x_init = x0-x0'; y_init = y0-y0'; z_init = z0-z0'; LorenzSystemEquations(x, y, z) = (x + (sigma * (y - x)) * dt + x_init), (y + ((rho * x) - (x * z) - y) * dt + y_init), (z + ((x * y) - (beta * z)) * dt + z_init); }; process = LorenzSystem(1.2, 1.3, 1.6, .150, 2, 3.4, 1.9, THRESHOLD) <: _, _;
967047006b74197a63f3a994b2b17f0f93bbcc416595a790f221a0d2c22a3fe6
LucaSpanedda/Riverberazione_Digitale_in_FAUST
1.20_Riverbero_Feedback_Delay_Network.dsp
// ---------------------------------------- // fdn2combs di Luca Spanedda. // Implementazione basata su: // FDN di Stautner e Puckette // ---------------------------------------- // Importo libreria standard di FAUST import("stdfaust.lib"); /* Nel 1982 Stautner e Puckette presentano nella loro pubblicazione ”Designing multichannel reverberators” un algoritmo di riverberazione multicanale chiamato: ”Feedback Delay Network” che tende a voler simulare il comportamento delle riflessioni all’interno di una stanza, utilizzando solo una serie di filtri comb paralleli ma con le retroazioni interconnesse fra loro. Qui una implementazione di una FDN a soli due Comb Filter. */ // ------------ FILTER SECTION ------------ // FEEDBACK COMB FILTER // fbcf(delay in samples, comb filter gain) fbcf(t,g) = _ : (+ @(t-1)~ *(g)) : mem; // ---------------------------------------- // ------------ FEEDBACK DELAY NETWORK ---- // // FDN A 2 COMB FILTER // fdn2combs(del1,del2,g12,g21,g11,g22) // // del1,del2 : sono i samples dei filtri comb // // MATRICE delle FDN: // g12 vuole dire g del comb 1 -->(va) al comb 2 // g21 vuole dire g del comb 2 -->(va) al comb 1 // g22 vuole dire g del comb 2 -->(va) in retroazione // g11 vuole dire g del comb 1 -->(va) in retroazione // fdn2combs(del1,del2,g12,g21,g11,g22) = fdnout with{ two_combs = fbcf(del1,g11), fbcf(del2,g22); routerin(a,b) = _+a, _+b; matrixout(a, b) = b*g12, a*g21; fdnout = _<:(routerin : two_combs : matrixout)~ si.bus(2); }; // ---------------------------------------- // fdn2combs(del1,del2,g12,g21,g11,g22) process = _:fdn2combs(6000,5000,0.25,0.25,0.5,0.5);
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/7fba5d0c0c1d47fb0da6b9a491de13142eb1afcc/1.20_Riverbero_Feedback_Delay_Network.dsp
faust
---------------------------------------- fdn2combs di Luca Spanedda. Implementazione basata su: FDN di Stautner e Puckette ---------------------------------------- Importo libreria standard di FAUST Nel 1982 Stautner e Puckette presentano nella loro pubblicazione ”Designing multichannel reverberators” un algoritmo di riverberazione multicanale chiamato: ”Feedback Delay Network” che tende a voler simulare il comportamento delle riflessioni all’interno di una stanza, utilizzando solo una serie di filtri comb paralleli ma con le retroazioni interconnesse fra loro. Qui una implementazione di una FDN a soli due Comb Filter. ------------ FILTER SECTION ------------ FEEDBACK COMB FILTER fbcf(delay in samples, comb filter gain) ---------------------------------------- ------------ FEEDBACK DELAY NETWORK ---- FDN A 2 COMB FILTER fdn2combs(del1,del2,g12,g21,g11,g22) del1,del2 : sono i samples dei filtri comb MATRICE delle FDN: g12 vuole dire g del comb 1 -->(va) al comb 2 g21 vuole dire g del comb 2 -->(va) al comb 1 g22 vuole dire g del comb 2 -->(va) in retroazione g11 vuole dire g del comb 1 -->(va) in retroazione ---------------------------------------- fdn2combs(del1,del2,g12,g21,g11,g22)
import("stdfaust.lib"); fbcf(t,g) = _ : (+ @(t-1)~ *(g)) : mem; fdn2combs(del1,del2,g12,g21,g11,g22) = fdnout with{ two_combs = fbcf(del1,g11), fbcf(del2,g22); routerin(a,b) = _+a, _+b; matrixout(a, b) = b*g12, a*g21; fdnout = _<:(routerin : two_combs : matrixout)~ si.bus(2); }; process = _:fdn2combs(6000,5000,0.25,0.25,0.5,0.5);
9a5cbb68a636e4e342a38648a35571eed2893a8854937a6860477b12be5a48f0
LucaSpanedda/Riverberazione_Digitale_in_FAUST
1.03_Riverbero_Schroeder-Chowning.dsp
// ---------------------------------------- // SCHROEDER-CHOWNING SATREV REVERBERATOR // ---------------------------------------- // Importo libreria standard di FAUST import("stdfaust.lib"); /* Simulazione di Riverbero secondo il modello di John Chowning. Modello SATREV, basato sul modello riverberante di Schroeder. 4 Comb IIR Paralleli e 3 Allpass in serie. ------------------------------------------- Nel 1962 Manfred Schroeder propone un’applicazione efficiente di riverberazione digitale nel suo articolo “Natural Sounding Artificial Reverb”. Schroeder propone l’utilizzo di filtri allpass e comb combinati fra di loro per ottenere un riverbero che non colori (grazie ai filtri allpass) e che crei una densità degli echi sufficiente a simulare la complessità delle riflessioni date da un effetto di riverberazione naturale (almeno 1000 echi per secondo) */ // ------------ FILTER SECTION ------------ // FEEDBACK COMB FILTER // (t,g) = give: delay time in samples, feedback gain 0-1 fbcf(t,g) = _ : (+ @(t-1)~ *(g)) : mem; // ALLPASS FILTER // (t,g) = give: delay in samples, feedback gain 0-1 apffp(t,g) = (+: _<: @(min(max(t-1,0),ma.SR)), *(-g))~ *(g) : mem, _ : + : _; // ---------------------------------------- // ------------ COMB SECTION -------------- schroeder4comb = combsection with { // ROUTING PARALLELO in_router(a,b,c,d)= a, b, c, d; input = _ <: in_router; // 4 FILTRI COMB PARALLELI combs=fbcf(901,0.805),fbcf(778,0.827),fbcf(1011,0.783),fbcf(1123,0.764); // SUM SEGNALI PARALLELI out_router(a,b,c,d) = a+b+c+d; // COMBS OUT combsection = input : combs :> out_router; }; // ---------------------------------------- // ------------ ALLPASS SECTION ----------- schroederallp = apffp(125,0.7):apffp(42,0.7):apffp(12,0.7); // ---------------------------------------- // ------------ OUT PATH ------------------ satreverb = _ : schroeder4comb : schroederallp; process = os.impulse : satreverb <: _,_;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/a3ad65cb2ecfd24562e8928b29e3c10584f4c078/1.03_Riverbero_Schroeder-Chowning.dsp
faust
---------------------------------------- SCHROEDER-CHOWNING SATREV REVERBERATOR ---------------------------------------- Importo libreria standard di FAUST Simulazione di Riverbero secondo il modello di John Chowning. Modello SATREV, basato sul modello riverberante di Schroeder. 4 Comb IIR Paralleli e 3 Allpass in serie. ------------------------------------------- Nel 1962 Manfred Schroeder propone un’applicazione efficiente di riverberazione digitale nel suo articolo “Natural Sounding Artificial Reverb”. Schroeder propone l’utilizzo di filtri allpass e comb combinati fra di loro per ottenere un riverbero che non colori (grazie ai filtri allpass) e che crei una densità degli echi sufficiente a simulare la complessità delle riflessioni date da un effetto di riverberazione naturale (almeno 1000 echi per secondo) ------------ FILTER SECTION ------------ FEEDBACK COMB FILTER (t,g) = give: delay time in samples, feedback gain 0-1 ALLPASS FILTER (t,g) = give: delay in samples, feedback gain 0-1 ---------------------------------------- ------------ COMB SECTION -------------- ROUTING PARALLELO 4 FILTRI COMB PARALLELI SUM SEGNALI PARALLELI COMBS OUT ---------------------------------------- ------------ ALLPASS SECTION ----------- ---------------------------------------- ------------ OUT PATH ------------------
import("stdfaust.lib"); fbcf(t,g) = _ : (+ @(t-1)~ *(g)) : mem; apffp(t,g) = (+: _<: @(min(max(t-1,0),ma.SR)), *(-g))~ *(g) : mem, _ : + : _; schroeder4comb = combsection with { in_router(a,b,c,d)= a, b, c, d; input = _ <: in_router; combs=fbcf(901,0.805),fbcf(778,0.827),fbcf(1011,0.783),fbcf(1123,0.764); out_router(a,b,c,d) = a+b+c+d; combsection = input : combs :> out_router; }; schroederallp = apffp(125,0.7):apffp(42,0.7):apffp(12,0.7); satreverb = _ : schroeder4comb : schroederallp; process = os.impulse : satreverb <: _,_;
8191db46bc6230169964cec2ca3c9a4090505076c92cdafa7d9bc8272d0f7482
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.04_Conversione_Campioni_In_Millisecondi.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // CONVERSIONE CAMPIONI IN MILLISECONDI // ---------------------------------------- /* Funzione Conversione ms. in Campioni : inserisco un totale di campioni, di cui mi serve di sapere la durata complessiva in millisecondi basandomi sulla mia frequenza di campionamento. Sappiamo che una frequenza di campionamento corrisponde ad un insieme di valori che esprimono nel loro insieme la durata di 1 secondo (1000 ms.). Vuole dire ad esempio, che ad una frequenza di campionamento di 48.000 campioni al secondo, ho 1000 millisecondi rappresentati da 48.000 parti. E dunque se divido i miei 1000ms. / nelle 48.000 parti che sarebbero i campioni del mio sistema, otterrei la durata in millisecondi di un singolo campione a quella frequenza di campionamento, in questo caso dunque: 1000 / 48.000 = 0,02ms. E dunque la durata in millisecondi di un singolo campione a 48.000 campioni al secondo, è di 0,02 millisecondi. se moltiplico il numero ottenuto * un totale di campioni, otterrò il tempo in millisecondi di quei campioni per quella frequenza di campionamento usata. Ovviamente come si può dedurre dalle considerazioni, all'incrementare della frequenza di campionamento corrisponde una durata temporale più piccola del singolo campione, e dunque una definizione maggiore. */ // (samps) = give tot. samples we want to know in milliseconds sampsams(samps) = ((1000 / ma.SR) * samps); process = _;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/aee95412f2f648cef4a6dd06a2a7ab73f848ddc0/0.04_Conversione_Campioni_In_Millisecondi.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- CONVERSIONE CAMPIONI IN MILLISECONDI ---------------------------------------- Funzione Conversione ms. in Campioni : inserisco un totale di campioni, di cui mi serve di sapere la durata complessiva in millisecondi basandomi sulla mia frequenza di campionamento. Sappiamo che una frequenza di campionamento corrisponde ad un insieme di valori che esprimono nel loro insieme la durata di 1 secondo (1000 ms.). Vuole dire ad esempio, che ad una frequenza di campionamento di 48.000 campioni al secondo, ho 1000 millisecondi rappresentati da 48.000 parti. E dunque se divido i miei 1000ms. / nelle 48.000 parti che sarebbero i campioni del mio sistema, otterrei la durata in millisecondi di un singolo campione a quella frequenza di campionamento, in questo caso dunque: 1000 / 48.000 = 0,02ms. E dunque la durata in millisecondi di un singolo campione a 48.000 campioni al secondo, è di 0,02 millisecondi. se moltiplico il numero ottenuto * un totale di campioni, otterrò il tempo in millisecondi di quei campioni per quella frequenza di campionamento usata. Ovviamente come si può dedurre dalle considerazioni, all'incrementare della frequenza di campionamento corrisponde una durata temporale più piccola del singolo campione, e dunque una definizione maggiore. (samps) = give tot. samples we want to know in milliseconds
import("stdfaust.lib"); sampsams(samps) = ((1000 / ma.SR) * samps); process = _;
62e95c31a123dfbbbb8396db141d9ae1ad882cca10eb33801777f9bddda3b2e1
LucaSpanedda/Riverberazione_Digitale_in_FAUST
1.04_Riverbero_Schroeder-Samsonbox.dsp
// ---------------------------------------- // SCHROEDER SAMSON BOX REVERBERATOR // ---------------------------------------- // Importo libreria standard di FAUST import("stdfaust.lib"); /* Simulazione di Riverbero secondo il modello della Samson Box - 1977 CCRMA. Modello SATREV, basato sul modello riverberante di Schroeder. 3 Allpass in serie e 4 Comb IIR Paralleli. ------------------------------------------- Nel 1962 Manfred Schroeder propone un’applicazione efficiente di riverberazione digitale nel suo articolo “Natural Sounding Artificial Reverb”. Schroeder propone l’utilizzo di filtri allpass e comb combinati fra di loro per ottenere un riverbero che non colori (grazie ai filtri allpass) e che crei una densità degli echi sufficiente a simulare la complessità delle riflessioni date da un effetto di riverberazione naturale (almeno 1000 echi per secondo) */ // ------------ FILTER SECTION ------------ // FEEDBACK COMB FILTER // (t,g) = give: delay time in samples, feedback gain 0-1 fbcf(t,g) = _ : (+ @(t-1)~ *(g)) : mem; // ALLPASS FILTER // (t,g) = give: delay in samples, feedback gain 0-1 apffp(t,g) = (+: _<: @(min(max(t-1,0),ma.SR)), *(-g))~ *(g) : mem, _ : + : _; // ---------------------------------------- // ------------ ALLPASS SECTION ----------- schroederallp = apffp(1051,0.7):apffp(337,0.7):apffp(113,0.7); // ---------------------------------------- // ------------ COMB SECTION -------------- schroeder4comb = combsection with { // ROUTING PARALLELO in_router(a,b,c,d)= a, b, c, d; input = _ <: in_router; // 4 FILTRI COMB PARALLELI combs=fbcf(4799,0.742),fbcf(4999,0.733),fbcf(5399,0.715),fbcf(5801,0.697); // SUM SEGNALI PARALLELI out_router(a,b,c,d) = a+b+c+d; // COMBS OUT combsection = input : combs :> out_router; }; // ---------------------------------------- // ------------ OUT PATH ------------------ samsonboxverb = _ : schroederallp : schroeder4comb; process = os.impulse : samsonboxverb <: _,_; // Sarebbe necessario decorrelare in uscita le somme dei comb // per avere un buon effetto spaziale. // nel modello originale è incluso un mixer con 4 differenti uscite // che hanno 4 differenti linee di ritardo, che sono : // A = z-0.046fs // B = z-0.057fs // C = z-0.041fs // D = z-0.054fs
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/e0f0b215ddf9a5ec659d9032f377a4fcdee828f1/1.04_Riverbero_Schroeder-Samsonbox.dsp
faust
---------------------------------------- SCHROEDER SAMSON BOX REVERBERATOR ---------------------------------------- Importo libreria standard di FAUST Simulazione di Riverbero secondo il modello della Samson Box - 1977 CCRMA. Modello SATREV, basato sul modello riverberante di Schroeder. 3 Allpass in serie e 4 Comb IIR Paralleli. ------------------------------------------- Nel 1962 Manfred Schroeder propone un’applicazione efficiente di riverberazione digitale nel suo articolo “Natural Sounding Artificial Reverb”. Schroeder propone l’utilizzo di filtri allpass e comb combinati fra di loro per ottenere un riverbero che non colori (grazie ai filtri allpass) e che crei una densità degli echi sufficiente a simulare la complessità delle riflessioni date da un effetto di riverberazione naturale (almeno 1000 echi per secondo) ------------ FILTER SECTION ------------ FEEDBACK COMB FILTER (t,g) = give: delay time in samples, feedback gain 0-1 ALLPASS FILTER (t,g) = give: delay in samples, feedback gain 0-1 ---------------------------------------- ------------ ALLPASS SECTION ----------- ---------------------------------------- ------------ COMB SECTION -------------- ROUTING PARALLELO 4 FILTRI COMB PARALLELI SUM SEGNALI PARALLELI COMBS OUT ---------------------------------------- ------------ OUT PATH ------------------ Sarebbe necessario decorrelare in uscita le somme dei comb per avere un buon effetto spaziale. nel modello originale è incluso un mixer con 4 differenti uscite che hanno 4 differenti linee di ritardo, che sono : A = z-0.046fs B = z-0.057fs C = z-0.041fs D = z-0.054fs
import("stdfaust.lib"); fbcf(t,g) = _ : (+ @(t-1)~ *(g)) : mem; apffp(t,g) = (+: _<: @(min(max(t-1,0),ma.SR)), *(-g))~ *(g) : mem, _ : + : _; schroederallp = apffp(1051,0.7):apffp(337,0.7):apffp(113,0.7); schroeder4comb = combsection with { in_router(a,b,c,d)= a, b, c, d; input = _ <: in_router; combs=fbcf(4799,0.742),fbcf(4999,0.733),fbcf(5399,0.715),fbcf(5801,0.697); out_router(a,b,c,d) = a+b+c+d; combsection = input : combs :> out_router; }; samsonboxverb = _ : schroederallp : schroeder4comb; process = os.impulse : samsonboxverb <: _,_;
efeff9c024da216fd611877a0cc342a8c660577927b4c75d2984159c993921de
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.02_Introduzione_Metodi_Ricorsività.dsp
// ---------------------------------------- // ALCUNI METODI PER LA REALIZZAZIONE DI // CIRCUITI RICORSIVI (FEEDBACK) IN FAUST // ---------------------------------------- /* ------------------------------------------- Referenze: https://www.dariosanfilippo.com/blog/2020/faust_recursive_circuits/ ------------------------------------------- Illustreremo 3 Metodi principali: 1 - Scrivere la riga di codice con recorsività interne: in questo modo l'operatore tilde ~ manda il segnale in uscita all'interno di se stesso, al primo ingresso disponibile. Creando un circuito di retroazione (feedback). Un modo per forzare l'operatore a puntare in un certo punto del codice, è mettere le parentesi (), in questo modo ~ punterà all'ingresso prima della parentesi. 2 - Un secondo metodo consiste nell'utilizzo del with{} . Si può definire una funzione in cui vengono passati i vari argomenti della funzione che controllano i paramteri del codice, e dire che quella funzione è uguale a uscita dal with con ~ _ esempio: funzione_with(argomento1, argomento2) = out_with ~ _ with{ sezione1 = _ * argomento1; sezione2 = argomento1 * argomento2; out_with = sezione2; }; dove out_with ~ _ rientra in se stesso. Inoltre il with in Faust permette di dichiarare delle variabili che non vengono puntate dall'esterno del codice ma solo dalla funzione di appartenenza; in questo caso la funzione a cui appartiene il with è "funzione_with". 3 - Un terzo metodo è utilizzare l'ambiente letrec. con questo metodo possiamo scrivere un segnale in modo ricorsivo, in modo simile a come vengono scritte le equazioni di ricorrenza. esempio: */ // Importo la libreria standard di FAUST import("stdfaust.lib"); // metodo con letrec: // funzione lowpass(cf, x) = y // definizione letrec letrec { 'y = b0 * x - a1 * y; } // cosa contiene il letrec with { b0 = 1 + a1; a1 = exp(-w(cf)) * -1; w(f) = 2 * ma.PI * f / ma.SR; }; // Uscita della funzione ricorsiva scritta con letrec process = lowpass;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/0a121ccb7a2a8f828c482b77781e2fa39a24b69c/0.02_Introduzione_Metodi_Ricorsivit%C3%A0.dsp
faust
---------------------------------------- ALCUNI METODI PER LA REALIZZAZIONE DI CIRCUITI RICORSIVI (FEEDBACK) IN FAUST ---------------------------------------- ------------------------------------------- Referenze: https://www.dariosanfilippo.com/blog/2020/faust_recursive_circuits/ ------------------------------------------- Illustreremo 3 Metodi principali: 1 - Scrivere la riga di codice con recorsività interne: in questo modo l'operatore tilde ~ manda il segnale in uscita all'interno di se stesso, al primo ingresso disponibile. Creando un circuito di retroazione (feedback). Un modo per forzare l'operatore a puntare in un certo punto del codice, è mettere le parentesi (), in questo modo ~ punterà all'ingresso prima della parentesi. 2 - Un secondo metodo consiste nell'utilizzo del with{} . Si può definire una funzione in cui vengono passati i vari argomenti della funzione che controllano i paramteri del codice, e dire che quella funzione è uguale a uscita dal with con ~ _ esempio: funzione_with(argomento1, argomento2) = out_with ~ _ with{ sezione1 = _ * argomento1; sezione2 = argomento1 * argomento2; out_with = sezione2; }; dove out_with ~ _ rientra in se stesso. Inoltre il with in Faust permette di dichiarare delle variabili che non vengono puntate dall'esterno del codice ma solo dalla funzione di appartenenza; in questo caso la funzione a cui appartiene il with è "funzione_with". 3 - Un terzo metodo è utilizzare l'ambiente letrec. con questo metodo possiamo scrivere un segnale in modo ricorsivo, in modo simile a come vengono scritte le equazioni di ricorrenza. esempio: Importo la libreria standard di FAUST metodo con letrec: funzione definizione letrec cosa contiene il letrec Uscita della funzione ricorsiva scritta con letrec
import("stdfaust.lib"); lowpass(cf, x) = y letrec { 'y = b0 * x - a1 * y; } with { b0 = 1 + a1; a1 = exp(-w(cf)) * -1; w(f) = 2 * ma.PI * f / ma.SR; }; process = lowpass;
d082dca8286b3734fbf818fbfb5a027118e9af2f43a77b93511d30cbab7ef8c4
LucaSpanedda/Riverberazione_Digitale_in_FAUST
1.10_Riverbero_di_Moorer.dsp
// ---------------------------------------- // RIVERBERO DI MOORER // ---------------------------------------- // Importo libreria standard di FAUST import("stdfaust.lib"); /* Simulazione di Riverbero secondo il modello di James A. Moorer il punto sorgente che coincide col punto di ascolto ------------------------------------------- Nel 1979 nella sua pubblicazione ”About This Reverberation Business” James Moorer, seguendo le proposte esposte da Schroeder nel suo articolo, implementa a seguito una topologia che fa uso delle TDL (tapped delay lines) per una simulazione delle prime riflessioni, ed inserisce all’interno della retroazione del FBCF (feedback comb filter) un filtro Lowpass, creando così i filtri LBCF(lowpass feedback comb filter) per ottenere una simulazione di assorbimento dell’aria all’interno del suo modello di riverberazione. */ // ------------ FILTER SECTION ------------ // LOWPASS FEEDBACK COMB FILTER lfbcf(delsamps, g, lowcut) = // lfbcf(delay in samples, comb filter gain, lowcut) (+ : @(delsamps-1) : _*lowcut : +~(_ : *(1- lowcut)))~ *(g) : mem; // process = _ : lfbcf(3000, 0.999, 0.2) <:_,_; // ALLPASS FILTER apf(delaysamples, g) = (+ : _ <: @(delaysamples-1), *(g)) ~ *(-g) : mem, _ : + : _; // ---------------------------------------- // ------------ EARLY REFLECTIONS NETWORK - early_reflections = reflections with { in_router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; // process = in_router; input = _ <: in_router; //process = input; // multitap delay lines (NO FEEDBACK) multitap_delay(frnt,bck,sx,dx,up,dwn,direct) = frnt@(4481) *0.2, bck@(2713) *0.2, sx@(3719) *0.2, dx@(3739) *0.2, up@(1877) *0.2, dwn@(1783) *0.2, direct *0.2; //process = early_reflections; out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; //process = out_router; // early reflections routing reflections = input : multitap_delay :> out_router; }; // ---------------------------------------- // ------------ LATE REFLECTIONS NETWORK -- moorerverbtail = apf_section with{ in_router(a,b,c,d,e,f) = a, b, c, d, e, f; //process = in_router; // COMBS FILTER SECTION comb_section = lfbcf(4481, 0.98, 0.8), lfbcf(2713, 0.98, 0.8), lfbcf(3719, 0.98, 0.8), lfbcf(3739, 0.98, 0.8), lfbcf(1847, 0.98, 0.8), lfbcf(1783, 0.98, 0.8); //process = comb_section; out_router(a,b,c,d,e,f) = a+b+c+d+e+f; //process = out_router; combsrouting = early_reflections <: in_router : comb_section :> out_router; //process = input; apf_section = combsrouting : apf(556, 0.5) : @(4800); //process = apf_section; }; // ---------------------------------------- // ------------ OUT PATH ------------------ moorerverb = _<: moorerverbtail + early_reflections; process = os.impulse : moorerverb <: _,_;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/2624820dcf1e3ce28a970e0c754f8553a8639575/1.10_Riverbero_di_Moorer.dsp
faust
---------------------------------------- RIVERBERO DI MOORER ---------------------------------------- Importo libreria standard di FAUST Simulazione di Riverbero secondo il modello di James A. Moorer il punto sorgente che coincide col punto di ascolto ------------------------------------------- Nel 1979 nella sua pubblicazione ”About This Reverberation Business” James Moorer, seguendo le proposte esposte da Schroeder nel suo articolo, implementa a seguito una topologia che fa uso delle TDL (tapped delay lines) per una simulazione delle prime riflessioni, ed inserisce all’interno della retroazione del FBCF (feedback comb filter) un filtro Lowpass, creando così i filtri LBCF(lowpass feedback comb filter) per ottenere una simulazione di assorbimento dell’aria all’interno del suo modello di riverberazione. ------------ FILTER SECTION ------------ LOWPASS FEEDBACK COMB FILTER lfbcf(delay in samples, comb filter gain, lowcut) process = _ : lfbcf(3000, 0.999, 0.2) <:_,_; ALLPASS FILTER ---------------------------------------- ------------ EARLY REFLECTIONS NETWORK - process = in_router; process = input; multitap delay lines (NO FEEDBACK) process = early_reflections; process = out_router; early reflections routing ---------------------------------------- ------------ LATE REFLECTIONS NETWORK -- process = in_router; COMBS FILTER SECTION process = comb_section; process = out_router; process = input; process = apf_section; ---------------------------------------- ------------ OUT PATH ------------------
import("stdfaust.lib"); lfbcf(delsamps, g, lowcut) = (+ : @(delsamps-1) : _*lowcut : +~(_ : *(1- lowcut)))~ *(g) : mem; apf(delaysamples, g) = (+ : _ <: @(delaysamples-1), *(g)) ~ *(-g) : mem, _ : + : _; early_reflections = reflections with { in_router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; input = _ <: in_router; multitap_delay(frnt,bck,sx,dx,up,dwn,direct) = frnt@(4481) *0.2, bck@(2713) *0.2, sx@(3719) *0.2, dx@(3739) *0.2, up@(1877) *0.2, dwn@(1783) *0.2, direct *0.2; out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; reflections = input : multitap_delay :> out_router; }; moorerverbtail = apf_section with{ in_router(a,b,c,d,e,f) = a, b, c, d, e, f; comb_section = lfbcf(4481, 0.98, 0.8), lfbcf(2713, 0.98, 0.8), lfbcf(3719, 0.98, 0.8), lfbcf(3739, 0.98, 0.8), lfbcf(1847, 0.98, 0.8), lfbcf(1783, 0.98, 0.8); out_router(a,b,c,d,e,f) = a+b+c+d+e+f; combsrouting = early_reflections <: in_router : comb_section :> out_router; apf_section = combsrouting : apf(556, 0.5) : @(4800); }; moorerverb = _<: moorerverbtail + early_reflections; process = os.impulse : moorerverb <: _,_;
66ee14d8816c43a775391a8370c4701e60f7856e8beffe5f02f0b2a5854f9eb4
LucaSpanedda/Riverberazione_Digitale_in_FAUST
1.11_ Riverbero_Freeverb.dsp
// ---------------------------------------- // FREEVERB di Jezar at Dreampoint // ---------------------------------------- // Importo libreria standard di FAUST import("stdfaust.lib"); /* Simulazione di Riverbero di Schroeder/Moorer secondo il modello di Jezar at Dreampoint. Utilizza 4 Allpass di Schroeder in serie, ed 8 Schroeder-Moorer Filtered-feedback comb-filters in parallelo. ------------------------------------------- Nel 1979 nella sua pubblicazione ”About This Reverberation Business” James Moorer, seguendo le proposte esposte da Schroeder nel suo articolo, implementa a seguito una topologia che fa uso delle TDL (tapped delay lines) per una simulazione delle prime riflessioni, ed inserisce all’interno della retroazione del FBCF (feedback comb filter) un filtro Lowpass, creando così i filtri LBCF(lowpass feedback comb filter) per ottenere una simulazione di assorbimento dell’aria all’interno del suo modello di riverberazione. */ // ------------ FILTER SECTION ------------ // LOWPASS FEEDBACK COMB FILTER lfbcf(delsamps, g, lowcut) = // lfbcf(delay in samples, comb filter gain, lowcut) (+ : @(delsamps-1) : _*lowcut : +~(_ : *(1- lowcut)))~ *(g) : mem; // process = _ : lfbcf(3000, 0.999, 0.2) <:_,_; // ALLPASS FILTER apf(delaysamples, g) = (+ : _ <: @(delaysamples-1), *(g)) ~ *(-g) : mem, _ : + : _; // ---------------------------------------- // ------------ EARLY REFLECTIONS NETWORK - early_reflections = reflections with { in_router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; // process = in_router; input = _ <: in_router; //process = input; // multitap delay lines (NO FEEDBACK) multitap_delay(frnt,bck,sx,dx,up,dwn,direct) = frnt@(1617) *0.4, bck@(1557) *0.4, sx@(1491) *0.4, dx@(1422) *0.4, up@(1277) *0.4, dwn@(1356) *0.4, direct *0.2; //process = early_reflections; out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; //process = out_router; // early reflections routing reflections = input : multitap_delay :> out_router; }; // ---------------------------------------- // ------------ LATE REFLECTIONS NETWORK -- freeverbtail = apf_section with{ in_router(a,b,c,d,e,f,g,h) = a, b, c, d, e, f, g, h; //process = in_router; // COMBS FILTER SECTION comb_section = lfbcf(1557, 0.84, 0.2), lfbcf(1617, 0.84, 0.2), lfbcf(1491, 0.84, 0.2), lfbcf(1422, 0.84, 0.2), lfbcf(1277, 0.84, 0.2), lfbcf(1356, 0.84, 0.2), lfbcf(1188, 0.84, 0.2), lfbcf(1116, 0.84, 0.2); //process = comb_section; out_router(a,b,c,d,e,f,g,h) = a+b+c+d+e+f+g+h; //process = out_router; combsrouting = early_reflections <: in_router : comb_section :> out_router; //process = input; apf_section = combsrouting : apf(225, 0.5) : apf(556, 0.5) : apf(441, 0.5) : apf(341, 0.5); //process = apf_section; }; // ---------------------------------------- // ------------ OUT PATH ------------------ freeverb = _<: freeverbtail + early_reflections; process = os.impulse : freeverb <: _,_; // Freeverb mono channel. // Processing for the second channel is obtained by adding // an integer to each of the twelve delay-line lengths. // This integer is called stereospread, and its default value is 23.
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/86532cf30f20d704ad4d83f97452c3a556ce888c/1.11_%20Riverbero_Freeverb.dsp
faust
---------------------------------------- FREEVERB di Jezar at Dreampoint ---------------------------------------- Importo libreria standard di FAUST Simulazione di Riverbero di Schroeder/Moorer secondo il modello di Jezar at Dreampoint. Utilizza 4 Allpass di Schroeder in serie, ed 8 Schroeder-Moorer Filtered-feedback comb-filters in parallelo. ------------------------------------------- Nel 1979 nella sua pubblicazione ”About This Reverberation Business” James Moorer, seguendo le proposte esposte da Schroeder nel suo articolo, implementa a seguito una topologia che fa uso delle TDL (tapped delay lines) per una simulazione delle prime riflessioni, ed inserisce all’interno della retroazione del FBCF (feedback comb filter) un filtro Lowpass, creando così i filtri LBCF(lowpass feedback comb filter) per ottenere una simulazione di assorbimento dell’aria all’interno del suo modello di riverberazione. ------------ FILTER SECTION ------------ LOWPASS FEEDBACK COMB FILTER lfbcf(delay in samples, comb filter gain, lowcut) process = _ : lfbcf(3000, 0.999, 0.2) <:_,_; ALLPASS FILTER ---------------------------------------- ------------ EARLY REFLECTIONS NETWORK - process = in_router; process = input; multitap delay lines (NO FEEDBACK) process = early_reflections; process = out_router; early reflections routing ---------------------------------------- ------------ LATE REFLECTIONS NETWORK -- process = in_router; COMBS FILTER SECTION process = comb_section; process = out_router; process = input; process = apf_section; ---------------------------------------- ------------ OUT PATH ------------------ Freeverb mono channel. Processing for the second channel is obtained by adding an integer to each of the twelve delay-line lengths. This integer is called stereospread, and its default value is 23.
import("stdfaust.lib"); lfbcf(delsamps, g, lowcut) = (+ : @(delsamps-1) : _*lowcut : +~(_ : *(1- lowcut)))~ *(g) : mem; apf(delaysamples, g) = (+ : _ <: @(delaysamples-1), *(g)) ~ *(-g) : mem, _ : + : _; early_reflections = reflections with { in_router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; input = _ <: in_router; multitap_delay(frnt,bck,sx,dx,up,dwn,direct) = frnt@(1617) *0.4, bck@(1557) *0.4, sx@(1491) *0.4, dx@(1422) *0.4, up@(1277) *0.4, dwn@(1356) *0.4, direct *0.2; out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; reflections = input : multitap_delay :> out_router; }; freeverbtail = apf_section with{ in_router(a,b,c,d,e,f,g,h) = a, b, c, d, e, f, g, h; comb_section = lfbcf(1557, 0.84, 0.2), lfbcf(1617, 0.84, 0.2), lfbcf(1491, 0.84, 0.2), lfbcf(1422, 0.84, 0.2), lfbcf(1277, 0.84, 0.2), lfbcf(1356, 0.84, 0.2), lfbcf(1188, 0.84, 0.2), lfbcf(1116, 0.84, 0.2); out_router(a,b,c,d,e,f,g,h) = a+b+c+d+e+f+g+h; combsrouting = early_reflections <: in_router : comb_section :> out_router; apf_section = combsrouting : apf(225, 0.5) : apf(556, 0.5) : apf(441, 0.5) : apf(341, 0.5); }; freeverb = _<: freeverbtail + early_reflections; process = os.impulse : freeverb <: _,_;
4f08985adcc36caead8bc0ca9e0679cab019f2c5d90a256ab4a6d76b9dcf44f8
LucaSpanedda/Riverberazione_Digitale_in_FAUST
0.05_Messa_in_Fase_Retroazione.dsp
// Importo libreria standard di FAUST import("stdfaust.lib"); // ---------------------------------------- // Messa in Fase della Retroazione // ---------------------------------------- // Per ottenere il giusto tempo di ritardo // desiderato nel circuito di retroazione // ---------------------------------------- /* nel dominio digitale la retroazione di una linea di ritardo, nel momento in cui viene applicata, costa di default un campione di ritardo. Retroazione = 1 Campione Nel momento in cui decido dunque di porre all'interno della retroazione un numero di campioni di ritardo, possiamo prendere ad esempio 10 campioni nella nostra linea di ritardo, vuole dire che, Il segnale diretto uscirà per ritardo campioni a: ingresso nel delay segnale --> uscita dal delay 10samp Il 1° Ricircolo: uscita dal delay a 10samp + 1 retroazione = ingresso nel delay 11samp --> uscita dal delay 21samp Il 2° Ricircolo: uscita dal delay a 21samp + 1 retroazione = ingresso nel delay 22samp --> uscita dal delay 32samp Il 3° Ricircolo: uscita dal delay a 32samp + 1 retroazione = ingresso nel delay 33samp --> uscita dal delay 43samp e così via... possiamo dunque notare da subito che non avremo il corretto valore di ritardo richiesto all'interno della stessa, a causa del campione di ritardo che avviene nel momento in cui decido di creare un circuito di retroazione. se utilizziamo il metodo di sottrarre un campione dalla linea di ritardo, avremo questo risultato: ingresso nel delay segnale --> -1, uscita dal delay 9samp Il 1° Ricircolo: uscita dal delay a 9samp + 1 retroazione = ingresso nel delay 10samp --> -1, uscita dal delay 19samp Il 2° Ricircolo: uscita dal delay a 19samp + 1 retroazione = ingresso nel delay 20samp --> -1, uscita dal delay 29samp Il 3° Ricircolo: uscita dal delay a 29samp + 1 retroazione = ingresso nel delay 30samp --> -1, uscita dal delay 39samp e così via... possiamo dunque notare che con questo metodo, rispetto al precedente avremo in ingresso alla linea di ritardo sempre il numero di campioni di ritardo richiesti. Ma notiamo che sin dalla prima uscita del segnale ritardato sottraendo -1 abbiamo in out un campione di ritardo in meno rispetto a quanto vorremmo. Per rimettere in fase il tutto, basterà sommare un campione di ritardo all'uscita complessiva del circuito, avendo così sin dal primo out: ingresso nel delay segnale --> -1, uscita dal delay 9samp +1 = 10out Il 1° Ricircolo: uscita dal delay a 9samp + 1 retroazione = ingresso nel delay 10samp --> -1, uscita dal delay 19samp +1 = 20out e così via... */ // Procediamo con una implementazione: campioni_ritardo = ma.SR; // frequenza campionamento process = _ : // segnale in input entra in +~ @(campioni_ritardo -1) *(0.8) // linea ritardo con feedback: +~ : mem; // uscita entra in campione singolo ritardo
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/48b7304b541a812dd1292a3867da0aaf3395b074/0.05_Messa_in_Fase_Retroazione.dsp
faust
Importo libreria standard di FAUST ---------------------------------------- Messa in Fase della Retroazione ---------------------------------------- Per ottenere il giusto tempo di ritardo desiderato nel circuito di retroazione ---------------------------------------- nel dominio digitale la retroazione di una linea di ritardo, nel momento in cui viene applicata, costa di default un campione di ritardo. Retroazione = 1 Campione Nel momento in cui decido dunque di porre all'interno della retroazione un numero di campioni di ritardo, possiamo prendere ad esempio 10 campioni nella nostra linea di ritardo, vuole dire che, Il segnale diretto uscirà per ritardo campioni a: ingresso nel delay segnale --> uscita dal delay 10samp Il 1° Ricircolo: uscita dal delay a 10samp + 1 retroazione = ingresso nel delay 11samp --> uscita dal delay 21samp Il 2° Ricircolo: uscita dal delay a 21samp + 1 retroazione = ingresso nel delay 22samp --> uscita dal delay 32samp Il 3° Ricircolo: uscita dal delay a 32samp + 1 retroazione = ingresso nel delay 33samp --> uscita dal delay 43samp e così via... possiamo dunque notare da subito che non avremo il corretto valore di ritardo richiesto all'interno della stessa, a causa del campione di ritardo che avviene nel momento in cui decido di creare un circuito di retroazione. se utilizziamo il metodo di sottrarre un campione dalla linea di ritardo, avremo questo risultato: ingresso nel delay segnale --> -1, uscita dal delay 9samp Il 1° Ricircolo: uscita dal delay a 9samp + 1 retroazione = ingresso nel delay 10samp --> -1, uscita dal delay 19samp Il 2° Ricircolo: uscita dal delay a 19samp + 1 retroazione = ingresso nel delay 20samp --> -1, uscita dal delay 29samp Il 3° Ricircolo: uscita dal delay a 29samp + 1 retroazione = ingresso nel delay 30samp --> -1, uscita dal delay 39samp e così via... possiamo dunque notare che con questo metodo, rispetto al precedente avremo in ingresso alla linea di ritardo sempre il numero di campioni di ritardo richiesti. Ma notiamo che sin dalla prima uscita del segnale ritardato sottraendo -1 abbiamo in out un campione di ritardo in meno rispetto a quanto vorremmo. Per rimettere in fase il tutto, basterà sommare un campione di ritardo all'uscita complessiva del circuito, avendo così sin dal primo out: ingresso nel delay segnale --> -1, uscita dal delay 9samp +1 = 10out Il 1° Ricircolo: uscita dal delay a 9samp + 1 retroazione = ingresso nel delay 10samp --> -1, uscita dal delay 19samp +1 = 20out e così via... Procediamo con una implementazione: frequenza campionamento segnale in input entra in linea ritardo con feedback: +~ uscita entra in campione singolo ritardo
import("stdfaust.lib"); campioni_ritardo = ma.SR; process = _ : +~ @(campioni_ritardo -1) *(0.8) : mem;
73653ff153fa3dd8fb923e1f9faab214464f5a1a704fd4da24c5739ddd9bdd28
LucaSpanedda/Musical_Plugins
Time_Splicing.dsp
// import Standard Faust library // https://github.com/grame-cncm/faustlibraries/ import("stdfaust.lib"); /* TIME SPLICING: WRITING AND READING WITH SCATTERING ON A FIXED TABLE OF 1 SECOND (TAPE) */ // Prime Numbers List primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); // index of the primes numbers primeNumbers(index) = ba.take(index , list) with{ list = primes; }; phsplice(seed) = (f/ma.SR) : (+ :\(x).(selector(trigph(fT),x,noise(seed))) : \(x).(x-int(x)))~_ with{ selector(sel,x,y) = (x*(1-sel)+y*(sel)); trigph(f) = (f/ma.SR) : (+ :\(x).(selector(0,x,0)) : \(x).(x-int(x)))~_ : \(x).(x-(1-dim) > 0); noise(seed) = abs((+(primeNumbers(seed + 1))~ * (1103515245)) / 2147483647); dim = hslider("scatter dimension",0,0,.1,.001); fT = hslider("scatter frequency",0,0,100,.001); f = 1; }; // TAPE-SPLICER max. lenght 1 second for every sample rate tapesplicer(noiseseed) = rwtable(dimension,0.0,indexwrite,_,indexread) with{ rec = 1-checkbox("freeze") : int; dimension = 192000; indexwrite = (+(1) : %(ma.SR : int)) ~ *(rec); indexread = phsplice(noiseseed) : *(float(ma.SR)) : int; }; process = _ <: tapesplicer(10),tapesplicer(12);
https://raw.githubusercontent.com/LucaSpanedda/Musical_Plugins/d17556035378ac5c6a0a2033de7f0a93390e94e1/Time%20Splicing/Time_Splicing.dsp
faust
import Standard Faust library https://github.com/grame-cncm/faustlibraries/ TIME SPLICING: WRITING AND READING WITH SCATTERING ON A FIXED TABLE OF 1 SECOND (TAPE) Prime Numbers List index of the primes numbers TAPE-SPLICER max. lenght 1 second for every sample rate
import("stdfaust.lib"); primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); primeNumbers(index) = ba.take(index , list) with{ list = primes; }; phsplice(seed) = (f/ma.SR) : (+ :\(x).(selector(trigph(fT),x,noise(seed))) : \(x).(x-int(x)))~_ with{ selector(sel,x,y) = (x*(1-sel)+y*(sel)); trigph(f) = (f/ma.SR) : (+ :\(x).(selector(0,x,0)) : \(x).(x-int(x)))~_ : \(x).(x-(1-dim) > 0); noise(seed) = abs((+(primeNumbers(seed + 1))~ * (1103515245)) / 2147483647); dim = hslider("scatter dimension",0,0,.1,.001); fT = hslider("scatter frequency",0,0,100,.001); f = 1; }; tapesplicer(noiseseed) = rwtable(dimension,0.0,indexwrite,_,indexread) with{ rec = 1-checkbox("freeze") : int; dimension = 192000; indexwrite = (+(1) : %(ma.SR : int)) ~ *(rec); indexread = phsplice(noiseseed) : *(float(ma.SR)) : int; }; process = _ <: tapesplicer(10),tapesplicer(12);
2ae900e87ebb4e67201a84c69d8d0d68d9e656cad16d3c6e4ad6b667b1b478ea
LucaSpanedda/Musical_Studies_of_Chaotic_Systems
Noise.dsp
// import Standard Faust library // https://github.com/grame-cncm/faustlibraries/ import("stdfaust.lib"); // Prime Numbers List primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); // index of the primes numbers primeNumbers(index) = ba.take(index , list) with{ list = primes; }; // noise generated with prime numbers and index noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647; process = noise(10), noise(11), noise(13);
https://raw.githubusercontent.com/LucaSpanedda/Musical_Studies_of_Chaotic_Systems/d8b78c011cc0b2b75f74643eba78306d6a3f92df/Noise-plots/Noise.dsp
faust
import Standard Faust library https://github.com/grame-cncm/faustlibraries/ Prime Numbers List index of the primes numbers noise generated with prime numbers and index
import("stdfaust.lib"); primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); primeNumbers(index) = ba.take(index , list) with{ list = primes; }; noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647; process = noise(10), noise(11), noise(13);
6f42c84ce4d2716e15abc90cec0a21ff4bdb55b442fe34325838ca631606d98c
LucaSpanedda/Musical_Studies_of_Chaotic_Systems
0.01_Random.dsp
// import Standard Faust library // https://github.com/grame-cncm/faustlibraries/ import("stdfaust.lib"); // Prime Numbers List primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); // index of the primes numbers primeNumbers(index) = ba.take(index , list) with{ list = primes; }; // noise generated with prime numbers and index random(seed) = (primeNumbers(seed + 1) * 1103515245) / 2147483647; process = random(10), random(11), random(13);
https://raw.githubusercontent.com/LucaSpanedda/Musical_Studies_of_Chaotic_Systems/d8b78c011cc0b2b75f74643eba78306d6a3f92df/0.01_Random.dsp
faust
import Standard Faust library https://github.com/grame-cncm/faustlibraries/ Prime Numbers List index of the primes numbers noise generated with prime numbers and index
import("stdfaust.lib"); primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); primeNumbers(index) = ba.take(index , list) with{ list = primes; }; random(seed) = (primeNumbers(seed + 1) * 1103515245) / 2147483647; process = random(10), random(11), random(13);
d502041372e05d48b3ec7ce96d4e48d5118aaa7fc79cdb716c7faf58c4ce7c3f
LucaSpanedda/Luca_Spanedda_St_Cecilia_Conservatory_Thesis
Audible_Ecosystemics_2.dsp
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "1.0"; declare description "2023 version Realised on the 2017 composer's instructions"; // import faust standard library import("stdfaust.lib"); // import audible ecosystemics objects library import("aelibrary.lib"); //------- ------------- ----- ----------- //-- AE2 ----------------------------------------------------------------------- //------- -------- // MAIN SYSTEM FUNCTION outputrouting(grainOut1, grainOut2, out1, out2, out3, out4, out5, out6, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) = out1, out2, out3, out4, out5, out6; // choose here the signals in output process = si.bus(8) :> si.bus(4) : (signalflow1a : signalflow1b : signalflow2a : signalflow2b : signalflow3) ~ si.bus(2) : outputrouting; signalflow1a( grainOut1, grainOut2, mic1, mic2, mic3, mic4 ) = grainOut1, grainOut2, mic1, mic2, mic3, mic4, ((diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain) : SF1Ainspect) with { Mic_1A_1 = mic3 : gainMic_1A1; Mic_1A_2 = mic4 : gainMic_1A2; map6sumx6 = (Mic_1A_1 : integrator(.01) : delayfb(.01, .95)) + (Mic_1A_2 : integrator(.01) : delayfb(.01, .95)) : \(x).(6 + x * 6); localMaxDiff = ((map6sumx6, Mic_1A_1) : localmax) , ((map6sumx6, Mic_1A_2) : localmax) : \(x, y).(x - y); SenstoExt = (map6sumx6, localMaxDiff) : localmax <: _ , (_ : delayfb(12, 0)) : + : * (.5) : LP1(.5) : tgroup("Control", vgroup("System Inspectors", hgroup("Signal Flow 1a [1]", hgroup("Sens. to Ext. Cond.", inspect(101, -1, 1))))); diffHL = ((Mic_1A_1 + Mic_1A_2) : HP3(var2) : integrator(.05)) , ((Mic_1A_1 + Mic_1A_2) : LP3(var2) : integrator(.10)) : \(x, y).((x - y) : tgroup("Control", vgroup("System Inspectors", hgroup("Signal Flow 1a [1]", hgroup("diffHL Centroid", inspect(100, -1, 1)))))) * (1 - SenstoExt) : delayfb(.01, .995) : LP5(25) : \(x).(.5 + x * .5) : // LIMIT - max - min limit(1, 0); memWriteLev = (Mic_1A_1 + Mic_1A_2) : integrator(.1) : delayfb(.01, .9) : LP5(25) : \(x).(1 - (x * x)) : // LIMIT - max - min limit(1, 0); memWriteDel1 = memWriteLev : delayfb((var1 / 2), 0) : // LIMIT - max - min limit(1, 0); memWriteDel2 = memWriteLev : delayfb((var1 / 3), 0) : // LIMIT - max - min limit(1, 0); cntrlMain = (Mic_1A_1 + Mic_1A_2) * SenstoExt : integrator(.01) : delayfb(.01, .995) : LP5(25) : // LIMIT - max - min limit(1, 0); cntrlLev1 = cntrlMain : delayfb((var1 / 3), 0) : // LIMIT - max - min limit(1, 0); cntrlLev2 = cntrlMain : delayfb((var1 / 2), 0) : // LIMIT - max - min limit(1, 0); cntrlFeed = cntrlMain : \(x).(ba.if(x <= .5, 1.0, (1.0 - x) * 2.0)) : // LIMIT - max - min limit(1, 0); }; signalflow1b( grainOut1, grainOut2, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, ((cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3) : SF1Binspect) with { Mic_1B_1 = mic1 : gainMic_1B1; Mic_1B_2 = mic2 : gainMic_1B2; // cntrlMic - original version cntrlMic(x) = x : HP1(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.5); // cntrlMic - alternative version // cntrlMic(x) = x : HP2(50) : LP1(6000) : // integrator(.01) : delayfb(.01, .995) : LP5(.04); cntrlMic1 = Mic_1B_1 : cntrlMic : // LIMIT - max - min limit(1, 0); cntrlMic2 = Mic_1B_2 : cntrlMic : // LIMIT - max - min limit(1, 0); directLevel = (grainOut1 + grainOut2) : integrator(.01) : delayfb(.01, .97) : LP5(.5) <: _ , (_ : delayfb(var1 * 2, (1 - var3) * 0.5)) : + : \(x).(1 - x * .5) : // LIMIT - max - min limit(1, 0); timeIndex1 = triangleWave(1 / (var1 * 2)) : \(x).((x - 2) * 0.5); timeIndex2 = triangleWave(1 / (var1 * 2)) : \(x).((x + 1) * 0.5); triangle1 = triangleWave(1 / (var1 * 6)) * memWriteLev; triangle2 = triangleWave(var1 * (1 - cntrlMain)); triangle3 = triangleWave(1 / var1); }; signalflow2a( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, ((sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) : SF2Ainspect) with { Mic_2A_1 = mic1 : gainMic_2A1; Mic_2A_2 = mic2 : gainMic_2A2; micIN1 = Mic_2A_1 : HP1(50) : LP1(6000) * (1 - cntrlMic1); micIN2 = Mic_2A_2 : HP1(50) : LP1(6000) * (1 - cntrlMic2); SRSect1(x) = x : sampler(var1, (1 - memWriteDel2), (var2 + (diffHL * 1000)) / 261) : SRinspect(1) : HP4(50) : delayfb(var1 / 2, 0); SRSect2(x) = x : sampler(var1, (memWriteLev + memWriteDel1) / 2, (290 - (diffHL * 90)) / 261) : SRinspect(2) : HP4(50) : delayfb(var1, 0); SRSect3(x) = x : sampler(var1, (1 - memWriteDel1), ((var2 * 2) - (diffHL * 1000)) / 261) : SRinspect(3) : HP4(50); SRSectBP1(x) = x : SRSect3 : BPsvftpt(diffHL * 400, (var2 / 2) * memWriteDel2); SRSectBP2(x) = x : SRSect3 : BPsvftpt((1 - diffHL) * 800, var2 * (1 - memWriteDel1)); SRSect4(x) = x : sampler(var1, 1, (250 + (diffHL * 20)) / 261) : SRinspect(4); SRSect5(x) = x : sampler(var1, memWriteLev, .766283) : SRinspect(5); SampleWriteLoop = loop ~ _ with { loop(fb) = ( ( SRSect1(fb) , SRSect2(fb) , SRSectBP1(fb) , SRSectBP2(fb) :> + ) * (cntrlFeed * memWriteLev) ) <: ( _ + (micIN1 + micIN2) : _ * triangle1 ), _ , SRSect4(fb) , SRSect5(fb) , SRSect3(fb) ; }; sig1 = micIN1 * directLevel; sig2 = micIN2 * directLevel; sampWOut = SampleWriteLoop : \(A,B,C,D,E).( A ); variabledelaysig3(x) = x : de.delay(max(0, ba.sec2samp(.05)), max(0, int(ba.sec2samp(.05 * cntrlMain))) ); sig3 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev : variabledelaysig3 * triangle2 * directLevel; sig4 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev * (1-triangle2) * directLevel; sig5 = SampleWriteLoop : \(A,B,C,D,E).( C ) : HP4(50) : delayfb(var1 / 3, 0); sig6 = SampleWriteLoop : \(A,B,C,D,E).( D ) : HP4(50) : delayfb(var1 / 2.5, 0); sig7 = SampleWriteLoop : \(A,B,C,D,E).( E ) : delayfb(var1 / 1.5, 0) * directLevel; }; signalflow2b( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 with { grainOut1 = granular_sampling(var1, timeIndex1, memWriteDel1, cntrlLev1, 21, sampWOut) : GSinspect(1); grainOut2 = granular_sampling(var1, timeIndex2, memWriteDel2, cntrlLev2, 20, sampWOut) : GSinspect(2); out1 = ( ((sig5 : delayfb(.040, 0)) * (1 - triangle3)), (sig5 * triangle3), ((sig6 : delayfb(.036, 0)) * (1 - triangle3)), ((sig6 : delayfb(.036, 0)) * triangle3 ), sig1, 0, sig4, grainOut1 * (1 - memWriteLev) + grainOut2 * memWriteLev ) :> _ : gainMic_3O1; out2 = ( (sig5 * (1 - triangle3)), ((sig5 : delayfb(.040, 0)) * triangle3), (sig6 * (1 - triangle3)), (sig6 * triangle3), sig2, sig3, sig7, grainOut1 * memWriteLev + grainOut2 * (1 - memWriteLev) ) :> _ : gainMic_3O2; }; signalflow3( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 ) = grainOut1, grainOut2, ( ( out1, out2, ( out2 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb(var4 / 344, 0)), ( out2 : delayfb(var4 / 344, 0)) ) : SF3Oinspect ), mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7;
https://raw.githubusercontent.com/LucaSpanedda/Luca_Spanedda_St_Cecilia_Conservatory_Thesis/b73b60d9e0b45e09bbf72b1477c21202b895f1bb/ITA/codes/Audible_Ecosystemics_2.dsp
faust
import faust standard library import audible ecosystemics objects library ------- ------------- ----- ----------- -- AE2 ----------------------------------------------------------------------- ------- -------- MAIN SYSTEM FUNCTION choose here the signals in output LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min cntrlMic - original version cntrlMic - alternative version cntrlMic(x) = x : HP2(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.04); LIMIT - max - min LIMIT - max - min LIMIT - max - min
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "1.0"; declare description "2023 version Realised on the 2017 composer's instructions"; import("stdfaust.lib"); import("aelibrary.lib"); outputrouting(grainOut1, grainOut2, out1, out2, out3, out4, out5, out6, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) = process = si.bus(8) :> si.bus(4) : (signalflow1a : signalflow1b : signalflow2a : signalflow2b : signalflow3) ~ si.bus(2) : outputrouting; signalflow1a( grainOut1, grainOut2, mic1, mic2, mic3, mic4 ) = grainOut1, grainOut2, mic1, mic2, mic3, mic4, ((diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain) : SF1Ainspect) with { Mic_1A_1 = mic3 : gainMic_1A1; Mic_1A_2 = mic4 : gainMic_1A2; map6sumx6 = (Mic_1A_1 : integrator(.01) : delayfb(.01, .95)) + (Mic_1A_2 : integrator(.01) : delayfb(.01, .95)) : \(x).(6 + x * 6); localMaxDiff = ((map6sumx6, Mic_1A_1) : localmax) , ((map6sumx6, Mic_1A_2) : localmax) : \(x, y).(x - y); SenstoExt = (map6sumx6, localMaxDiff) : localmax <: _ , (_ : delayfb(12, 0)) : + : * (.5) : LP1(.5) : tgroup("Control", vgroup("System Inspectors", hgroup("Signal Flow 1a [1]", hgroup("Sens. to Ext. Cond.", inspect(101, -1, 1))))); diffHL = ((Mic_1A_1 + Mic_1A_2) : HP3(var2) : integrator(.05)) , ((Mic_1A_1 + Mic_1A_2) : LP3(var2) : integrator(.10)) : \(x, y).((x - y) : tgroup("Control", vgroup("System Inspectors", hgroup("Signal Flow 1a [1]", hgroup("diffHL Centroid", inspect(100, -1, 1)))))) * (1 - SenstoExt) : delayfb(.01, .995) : LP5(25) : \(x).(.5 + x * .5) : limit(1, 0); memWriteLev = (Mic_1A_1 + Mic_1A_2) : integrator(.1) : delayfb(.01, .9) : LP5(25) : \(x).(1 - (x * x)) : limit(1, 0); memWriteDel1 = memWriteLev : delayfb((var1 / 2), 0) : limit(1, 0); memWriteDel2 = memWriteLev : delayfb((var1 / 3), 0) : limit(1, 0); cntrlMain = (Mic_1A_1 + Mic_1A_2) * SenstoExt : integrator(.01) : delayfb(.01, .995) : LP5(25) : limit(1, 0); cntrlLev1 = cntrlMain : delayfb((var1 / 3), 0) : limit(1, 0); cntrlLev2 = cntrlMain : delayfb((var1 / 2), 0) : limit(1, 0); cntrlFeed = cntrlMain : \(x).(ba.if(x <= .5, 1.0, (1.0 - x) * 2.0)) : limit(1, 0); }; signalflow1b( grainOut1, grainOut2, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, ((cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3) : SF1Binspect) with { Mic_1B_1 = mic1 : gainMic_1B1; Mic_1B_2 = mic2 : gainMic_1B2; cntrlMic(x) = x : HP1(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.5); cntrlMic1 = Mic_1B_1 : cntrlMic : limit(1, 0); cntrlMic2 = Mic_1B_2 : cntrlMic : limit(1, 0); directLevel = (grainOut1 + grainOut2) : integrator(.01) : delayfb(.01, .97) : LP5(.5) <: _ , (_ : delayfb(var1 * 2, (1 - var3) * 0.5)) : + : \(x).(1 - x * .5) : limit(1, 0); timeIndex1 = triangleWave(1 / (var1 * 2)) : \(x).((x - 2) * 0.5); timeIndex2 = triangleWave(1 / (var1 * 2)) : \(x).((x + 1) * 0.5); triangle1 = triangleWave(1 / (var1 * 6)) * memWriteLev; triangle2 = triangleWave(var1 * (1 - cntrlMain)); triangle3 = triangleWave(1 / var1); }; signalflow2a( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, ((sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) : SF2Ainspect) with { Mic_2A_1 = mic1 : gainMic_2A1; Mic_2A_2 = mic2 : gainMic_2A2; micIN1 = Mic_2A_1 : HP1(50) : LP1(6000) * (1 - cntrlMic1); micIN2 = Mic_2A_2 : HP1(50) : LP1(6000) * (1 - cntrlMic2); SRSect1(x) = x : sampler(var1, (1 - memWriteDel2), (var2 + (diffHL * 1000)) / 261) : SRinspect(1) : HP4(50) : delayfb(var1 / 2, 0); SRSect2(x) = x : sampler(var1, (memWriteLev + memWriteDel1) / 2, (290 - (diffHL * 90)) / 261) : SRinspect(2) : HP4(50) : delayfb(var1, 0); SRSect3(x) = x : sampler(var1, (1 - memWriteDel1), ((var2 * 2) - (diffHL * 1000)) / 261) : SRinspect(3) : HP4(50); SRSectBP1(x) = x : SRSect3 : BPsvftpt(diffHL * 400, (var2 / 2) * memWriteDel2); SRSectBP2(x) = x : SRSect3 : BPsvftpt((1 - diffHL) * 800, var2 * (1 - memWriteDel1)); SRSect4(x) = x : sampler(var1, 1, (250 + (diffHL * 20)) / 261) : SRinspect(4); SRSect5(x) = x : sampler(var1, memWriteLev, .766283) : SRinspect(5); SampleWriteLoop = loop ~ _ with { loop(fb) = ( ( SRSect1(fb) , SRSect2(fb) , SRSectBP1(fb) , SRSectBP2(fb) :> + ) * (cntrlFeed * memWriteLev) ) <: ( _ + (micIN1 + micIN2) : _ * triangle1 ), _ , SRSect4(fb) , SRSect5(fb) , SRSect3(fb) ; }; sig1 = micIN1 * directLevel; sig2 = micIN2 * directLevel; sampWOut = SampleWriteLoop : \(A,B,C,D,E).( A ); variabledelaysig3(x) = x : de.delay(max(0, ba.sec2samp(.05)), max(0, int(ba.sec2samp(.05 * cntrlMain))) ); sig3 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev : variabledelaysig3 * triangle2 * directLevel; sig4 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev * (1-triangle2) * directLevel; sig5 = SampleWriteLoop : \(A,B,C,D,E).( C ) : HP4(50) : delayfb(var1 / 3, 0); sig6 = SampleWriteLoop : \(A,B,C,D,E).( D ) : HP4(50) : delayfb(var1 / 2.5, 0); sig7 = SampleWriteLoop : \(A,B,C,D,E).( E ) : delayfb(var1 / 1.5, 0) * directLevel; }; signalflow2b( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 with { grainOut1 = granular_sampling(var1, timeIndex1, memWriteDel1, cntrlLev1, 21, sampWOut) : GSinspect(1); grainOut2 = granular_sampling(var1, timeIndex2, memWriteDel2, cntrlLev2, 20, sampWOut) : GSinspect(2); out1 = ( ((sig5 : delayfb(.040, 0)) * (1 - triangle3)), (sig5 * triangle3), ((sig6 : delayfb(.036, 0)) * (1 - triangle3)), ((sig6 : delayfb(.036, 0)) * triangle3 ), sig1, 0, sig4, grainOut1 * (1 - memWriteLev) + grainOut2 * memWriteLev ) :> _ : gainMic_3O1; out2 = ( (sig5 * (1 - triangle3)), ((sig5 : delayfb(.040, 0)) * triangle3), (sig6 * (1 - triangle3)), (sig6 * triangle3), sig2, sig3, sig7, grainOut1 * memWriteLev + grainOut2 * (1 - memWriteLev) ) :> _ : gainMic_3O2; }; signalflow3( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 ) = grainOut1, grainOut2, ( ( out1, out2, ( out2 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb(var4 / 344, 0)), ( out2 : delayfb(var4 / 344, 0)) ) : SF3Oinspect ), mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7;
ccffce7cd12cf16af7a30535e485818e7dc78502fa98b7ae1e4bc553d571289f
LucaSpanedda/Riverberazione_Digitale_in_FAUST
1.12_Freevrev_di_Spanedda.dsp
// ---------------------------------------- // FREEVREV di Luca Spanedda. // Implementazione basata su: // FREEVERB di Jezar at Dreampoint // ---------------------------------------- // Importo libreria standard di FAUST import("stdfaust.lib"); /* Simulazione di Riverbero Schroeder/Moorer basandosi sul modello "Freeverb" di Jezar at Dreampoint. Utilizza 4 Allpass di Schroeder in serie, ed 8 Schroeder-Moorer Filtered-feedback comb-filters in parallelo. 2 Sezioni parallele e distinte del processo. */ // ------------ CONTROLLI ----------------- gaincontrol = vslider("gain[style:knob]",1,0,1,0.001) : si.smoo; lowcutcontrol = vslider("lowcut[style:knob]",1,0,1,0.001) : si.smoo; t60control = vslider("decay-seconds[style:knob]",1,0,100,1) : si.smoo; // ---------------------------------------- // ------------ T60 SECTION --------------- /* Inserisci all'interno degli argomenti della funzione: - il valore in campioni del filtro che stai usando per il ritardo. - il valore di decadimento in T60 (tempo di decadimento di 60 dB in secondi) = OTTIENI in uscita dalla funzione, il valore che devi passare come amplificazione alla retroazione del filtro per ottenere il tempo di decadimento T60 che si desidera */ // (samps,seconds) = give: samples of the filter, // seconds we want for t60 decay dect60(samps,seconds) = 1/(10^((3*(((1000 / ma.SR)*samps)/1000))/seconds)); // ---------------------------------------- // ------------ FILTER SECTION ------------ // LOWPASS FEEDBACK COMB FILTER lfbcf(delsamps, g, lowcut) = // lfbcf(delay in samples, comb filter gain, lowcut) (+ : @(delsamps-1) : _*lowcut : +~(_ : *(1- lowcut)))~ *(g) : mem; // process = _ : lfbcf(3000, 0.999, 0.2) <:_,_; // ALLPASS FILTER apf(delaysamples, g) = (+ : _ <: @(delaysamples-1), *(g)) ~ *(-g) : mem, _ : + : _; // ---------------------------------------- // ------------ EARLY REFLECTIONS NETWORK 1 early_reflections1 = reflections1 with { in_router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; // process = in_router; input = _ <: in_router; //process = input; // multitap delay lines (NO FEEDBACK) multitap_delay(frnt,bck,sx,dx,up,dwn,direct) = frnt@(1619), bck@(1559), sx@(1493), dx@(1423), up@(1277), dwn@(1361), direct; //process = early_reflections; out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; //process = out_router; // early reflections routing reflections1 = input : multitap_delay :> out_router; }; // ---------------------------------------- // ------------ EARLY REFLECTIONS NETWORK 2 early_reflections2 = reflections2 with { in_router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; // process = in_router; input = _ <: in_router; //process = input; // multitap delay lines (NO FEEDBACK) multitap_delay(frnt,bck,sx,dx,up,dwn,direct) = frnt@(1621), bck@(1567), sx@(1499), dx@(1433), up@(1283), dwn@(1373), direct; //process = early_reflections; out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; //process = out_router; // early reflections routing reflections2 = input : multitap_delay :> out_router; }; // ---------------------------------------- // ------------ LATE REFLECTIONS NETWORK 1- freeverbtail1(seconds,absorb) = apf_section1 with{ in_router(a,b,c,d,e,f,g,h) = a, b, c, d, e, f, g, h; //process = in_router; // COMBS FILTER SECTION comb_section = lfbcf(1559, dect60(1559,seconds), absorb), lfbcf(1619, dect60(1619,seconds), absorb), lfbcf(1493, dect60(1493,seconds), absorb), lfbcf(1423, dect60(1423,seconds), absorb), lfbcf(1277, dect60(1277,seconds), absorb), lfbcf(1361, dect60(1361,seconds), absorb), lfbcf(1187, dect60(1187,seconds), absorb), lfbcf(1117, dect60(1117,seconds), absorb); //process = comb_section; out_router(a,b,c,d,e,f,g,h) = a+b+c+d+e+f+g+h; //process = out_router; combsrouting = early_reflections1 <: in_router : comb_section :> out_router; //process = input; apf_section1 = combsrouting : apf(223, 0.5) : apf(563, 0.5) : apf(441, 0.5) : apf(341, 0.5); //process = apf_section; }; // ---------------------------------------- // ------------ LATE REFLECTIONS NETWORK 2- freeverbtail2(seconds,absorb) = apf_section2 with{ in_router(a,b,c,d,e,f,g,h) = a, b, c, d, e, f, g, h; //process = in_router; // COMBS FILTER SECTION comb_section = lfbcf(1621, dect60(1621,seconds), absorb), lfbcf(1567, dect60(1567,seconds), absorb), lfbcf(1499, dect60(1499,seconds), absorb), lfbcf(1433, dect60(1433,seconds), absorb), lfbcf(1283, dect60(1283,seconds), absorb), lfbcf(1373, dect60(1373,seconds), absorb), lfbcf(1187, dect60(1187,seconds), absorb), lfbcf(1123, dect60(1123,seconds), absorb); //process = comb_section; out_router(a,b,c,d,e,f,g,h) = a+b+c+d+e+f+g+h; //process = out_router; combsrouting = early_reflections2 <: in_router : comb_section :> out_router; //process = input; apf_section2 = combsrouting : apf(227, 0.5) : apf(557, 0.5) : apf(433, 0.5) : apf(353, 0.5); //process = apf_section; }; // ---------------------------------------- // ------------ OUT PATH ------------------ freeverb1(t60,lowcut) = _ <: freeverbtail1(t60,lowcut) + early_reflections1; freeverb2(t60,lowcut) = _ <: freeverbtail2(t60,lowcut) + early_reflections2; process = _ *(gaincontrol*0.04) <: freeverb1(t60control,lowcutcontrol), freeverb2(t60control,lowcutcontrol);
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/af31377ad550a94ad90674bc187ec75c10a2c745/1.12_Freevrev_di_Spanedda.dsp
faust
---------------------------------------- FREEVREV di Luca Spanedda. Implementazione basata su: FREEVERB di Jezar at Dreampoint ---------------------------------------- Importo libreria standard di FAUST Simulazione di Riverbero Schroeder/Moorer basandosi sul modello "Freeverb" di Jezar at Dreampoint. Utilizza 4 Allpass di Schroeder in serie, ed 8 Schroeder-Moorer Filtered-feedback comb-filters in parallelo. 2 Sezioni parallele e distinte del processo. ------------ CONTROLLI ----------------- ---------------------------------------- ------------ T60 SECTION --------------- Inserisci all'interno degli argomenti della funzione: - il valore in campioni del filtro che stai usando per il ritardo. - il valore di decadimento in T60 (tempo di decadimento di 60 dB in secondi) = OTTIENI in uscita dalla funzione, il valore che devi passare come amplificazione alla retroazione del filtro per ottenere il tempo di decadimento T60 che si desidera (samps,seconds) = give: samples of the filter, seconds we want for t60 decay ---------------------------------------- ------------ FILTER SECTION ------------ LOWPASS FEEDBACK COMB FILTER lfbcf(delay in samples, comb filter gain, lowcut) process = _ : lfbcf(3000, 0.999, 0.2) <:_,_; ALLPASS FILTER ---------------------------------------- ------------ EARLY REFLECTIONS NETWORK 1 process = in_router; process = input; multitap delay lines (NO FEEDBACK) process = early_reflections; process = out_router; early reflections routing ---------------------------------------- ------------ EARLY REFLECTIONS NETWORK 2 process = in_router; process = input; multitap delay lines (NO FEEDBACK) process = early_reflections; process = out_router; early reflections routing ---------------------------------------- ------------ LATE REFLECTIONS NETWORK 1- process = in_router; COMBS FILTER SECTION process = comb_section; process = out_router; process = input; process = apf_section; ---------------------------------------- ------------ LATE REFLECTIONS NETWORK 2- process = in_router; COMBS FILTER SECTION process = comb_section; process = out_router; process = input; process = apf_section; ---------------------------------------- ------------ OUT PATH ------------------
import("stdfaust.lib"); gaincontrol = vslider("gain[style:knob]",1,0,1,0.001) : si.smoo; lowcutcontrol = vslider("lowcut[style:knob]",1,0,1,0.001) : si.smoo; t60control = vslider("decay-seconds[style:knob]",1,0,100,1) : si.smoo; dect60(samps,seconds) = 1/(10^((3*(((1000 / ma.SR)*samps)/1000))/seconds)); lfbcf(delsamps, g, lowcut) = (+ : @(delsamps-1) : _*lowcut : +~(_ : *(1- lowcut)))~ *(g) : mem; apf(delaysamples, g) = (+ : _ <: @(delaysamples-1), *(g)) ~ *(-g) : mem, _ : + : _; early_reflections1 = reflections1 with { in_router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; input = _ <: in_router; multitap_delay(frnt,bck,sx,dx,up,dwn,direct) = frnt@(1619), bck@(1559), sx@(1493), dx@(1423), up@(1277), dwn@(1361), direct; out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; reflections1 = input : multitap_delay :> out_router; }; early_reflections2 = reflections2 with { in_router(a,b,c,d,e,f,g) = a, b, c, d, e, f, g; input = _ <: in_router; multitap_delay(frnt,bck,sx,dx,up,dwn,direct) = frnt@(1621), bck@(1567), sx@(1499), dx@(1433), up@(1283), dwn@(1373), direct; out_router(a,b,c,d,e,f,g) = a+b+c+d+e+f+g; reflections2 = input : multitap_delay :> out_router; }; freeverbtail1(seconds,absorb) = apf_section1 with{ in_router(a,b,c,d,e,f,g,h) = a, b, c, d, e, f, g, h; comb_section = lfbcf(1559, dect60(1559,seconds), absorb), lfbcf(1619, dect60(1619,seconds), absorb), lfbcf(1493, dect60(1493,seconds), absorb), lfbcf(1423, dect60(1423,seconds), absorb), lfbcf(1277, dect60(1277,seconds), absorb), lfbcf(1361, dect60(1361,seconds), absorb), lfbcf(1187, dect60(1187,seconds), absorb), lfbcf(1117, dect60(1117,seconds), absorb); out_router(a,b,c,d,e,f,g,h) = a+b+c+d+e+f+g+h; combsrouting = early_reflections1 <: in_router : comb_section :> out_router; apf_section1 = combsrouting : apf(223, 0.5) : apf(563, 0.5) : apf(441, 0.5) : apf(341, 0.5); }; freeverbtail2(seconds,absorb) = apf_section2 with{ in_router(a,b,c,d,e,f,g,h) = a, b, c, d, e, f, g, h; comb_section = lfbcf(1621, dect60(1621,seconds), absorb), lfbcf(1567, dect60(1567,seconds), absorb), lfbcf(1499, dect60(1499,seconds), absorb), lfbcf(1433, dect60(1433,seconds), absorb), lfbcf(1283, dect60(1283,seconds), absorb), lfbcf(1373, dect60(1373,seconds), absorb), lfbcf(1187, dect60(1187,seconds), absorb), lfbcf(1123, dect60(1123,seconds), absorb); out_router(a,b,c,d,e,f,g,h) = a+b+c+d+e+f+g+h; combsrouting = early_reflections2 <: in_router : comb_section :> out_router; apf_section2 = combsrouting : apf(227, 0.5) : apf(557, 0.5) : apf(433, 0.5) : apf(353, 0.5); }; freeverb1(t60,lowcut) = _ <: freeverbtail1(t60,lowcut) + early_reflections1; freeverb2(t60,lowcut) = _ <: freeverbtail2(t60,lowcut) + early_reflections2; process = _ *(gaincontrol*0.04) <: freeverb1(t60control,lowcutcontrol), freeverb2(t60control,lowcutcontrol);
598960b169ecfb84a6d0f45a8a867444ea91c95d6526de0a0e1acf2500e22132
LucaSpanedda/Musical_Studies_of_Chaotic_Systems
0.03_Random_Walk.dsp
// import Standard Faust library // https://github.com/grame-cncm/faustlibraries/ import("stdfaust.lib"); // Prime Numbers List primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); // index of the primes numbers primeNumbers(index) = ba.take(index , list) with{ list = primes; }; // RANDOM WALK - function randomwalk(walkfreq,noisefreq,noiseseed) = randomwalkout with{ // NOISE GENERATION - function noise(seed) = variablenoiseout with{ rescaleint(a) = a-int(a); variablenoiseout = ((+(1457932343)~*(1103515245)) * seed) / (2147483647.0) : rescaleint; }; // SAMPLE AND HOLD - function sampleandhold(frequency) = sampleandholdout with{ // PHASOR decimal(x)= x-int(x); // reset to 0 when int phase = frequency/ma.SR : (+ : decimal) ~ _; // phasor with frequency // PHASOR to 0 and 1 saw = phase-0.5; // phasor : -0.5 to +0.5 ifpos = (saw > 0); // phasor positive =1; phasor negative =0 // PHASOR 1 to Impulse trainpulse = ( ifpos - ( ifpos:mem ) ) > 0; // impulse and delette all under 0 // SAMPLE AND HOLD sampleandholdout(a) = (*(1 - trainpulse) + a * trainpulse) ~ _; }; // RANDOM WALK: // SAMPLE AND HOLD THE NOISE: noise ---> sample and hold ---> pos sahnoise = noise(primeNumbers(noiseseed)) : sampleandhold(noisefreq); // BINARY NOISE (-1 and +1) plusminuscond(a) = (a>0)+(a<0)*-1; noisebinary = sahnoise : plusminuscond; // PHASOR GENERATION randomwalkout = (walkfreq/ma.SR)*noisebinary : + ~ _; }; // randomwalk(walkfreq,noisefreq,noiseseed) process = randomwalk(100,100,10);
https://raw.githubusercontent.com/LucaSpanedda/Musical_Studies_of_Chaotic_Systems/d8b78c011cc0b2b75f74643eba78306d6a3f92df/0.03_Random_Walk.dsp
faust
import Standard Faust library https://github.com/grame-cncm/faustlibraries/ Prime Numbers List index of the primes numbers RANDOM WALK - function NOISE GENERATION - function SAMPLE AND HOLD - function PHASOR reset to 0 when int phasor with frequency PHASOR to 0 and 1 phasor : -0.5 to +0.5 phasor positive =1; phasor negative =0 PHASOR 1 to Impulse impulse and delette all under 0 SAMPLE AND HOLD RANDOM WALK: SAMPLE AND HOLD THE NOISE: noise ---> sample and hold ---> pos BINARY NOISE (-1 and +1) PHASOR GENERATION randomwalk(walkfreq,noisefreq,noiseseed)
import("stdfaust.lib"); primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); primeNumbers(index) = ba.take(index , list) with{ list = primes; }; randomwalk(walkfreq,noisefreq,noiseseed) = randomwalkout with{ noise(seed) = variablenoiseout with{ rescaleint(a) = a-int(a); variablenoiseout = ((+(1457932343)~*(1103515245)) * seed) / (2147483647.0) : rescaleint; }; sampleandhold(frequency) = sampleandholdout with{ trainpulse = ( ifpos - ( ifpos:mem ) ) > 0; sampleandholdout(a) = (*(1 - trainpulse) + a * trainpulse) ~ _; }; sahnoise = noise(primeNumbers(noiseseed)) : sampleandhold(noisefreq); plusminuscond(a) = (a>0)+(a<0)*-1; noisebinary = sahnoise : plusminuscond; randomwalkout = (walkfreq/ma.SR)*noisebinary : + ~ _; }; process = randomwalk(100,100,10);
3d7e639fd5d3b6a17c6268e00ceacd3e39c75455a6da2157e81fd773053ea26a
LucaSpanedda/Musical_Plugins
DARK.dsp
declare name "DARK - Multitap Delay"; declare version "xxx"; declare author "Luca Spanedda"; declare copyright "(c)Luca Spanedda 2022"; // import standard Faust library import("stdfaust.lib"); // Prime Numbers List primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); // index of the primes numbers primeNumbers(index) = ba.take(index , list) with{ list = primes; }; SahNoise(Offset,Range,Seed,Tap) = ( abs(noise(Seed)) : ba.sAndH( prgmChange + dirac ) ) * Range + Offset with{ trig(x) = (x - x') > 0; prgmChange = Tap : trig; dirac = (1-1''); noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647; }; multitapDelay(voices,offset,range,fb,tap,x) = hgroup("[0] Delay Taps Times", par(i, voices, (vmeter( i, SahNoise(offset,range,i,tap) ), fb, x) : delayline ) ) with{ vmeter(i, x) = (x : vbargraph(" %i[unit:Sec]", 0, 20)); hmeter(i, x) = (x : hbargraph("Delay CH %i[unit:Sec]", 0, 20)); delMax = 20; // 20 Seconds delayline(T,FB,x) = ( (_*FB)+x : de.sdelay(ma.SR*delMax, 1024, ma.SR*T) )~_ ; }; GD = hslider("[2] Delay Inputs",0,0,1,.001) : si.smoo; G = hslider("[1] Direct Input",1,0,1,.001) : si.smoo; Feedback = hslider("[3] Delays Feedback",0,0,1,.001) : si.smoo; Offset = hslider("[4] Min. delay Time[unit:Sec]",4,0,10,.001) : si.smoo; Range = hslider("[5] Max. delay Time + Min.[unit:Sec]",8,1,10,.001) : si.smoo; Tap = button("[0] TAP : Change Delay Times"); process = (_,GUI) : \(x,gd,g,fb,off,rng,tap). (x*gd : multitapDelay(20,off,rng,fb,tap) :> (_,_), x*g) : \(A,B,C).(A+C,B+C) with{ GUI = vgroup("[1] Control Interface",(GD,G,Feedback,Offset,Range,Tap)); };
https://raw.githubusercontent.com/LucaSpanedda/Musical_Plugins/d17556035378ac5c6a0a2033de7f0a93390e94e1/DARK%20-%20Multitap%20Delay/DARK.dsp
faust
import standard Faust library Prime Numbers List index of the primes numbers 20 Seconds
declare name "DARK - Multitap Delay"; declare version "xxx"; declare author "Luca Spanedda"; declare copyright "(c)Luca Spanedda 2022"; import("stdfaust.lib"); primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); primeNumbers(index) = ba.take(index , list) with{ list = primes; }; SahNoise(Offset,Range,Seed,Tap) = ( abs(noise(Seed)) : ba.sAndH( prgmChange + dirac ) ) * Range + Offset with{ trig(x) = (x - x') > 0; prgmChange = Tap : trig; dirac = (1-1''); noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647; }; multitapDelay(voices,offset,range,fb,tap,x) = hgroup("[0] Delay Taps Times", par(i, voices, (vmeter( i, SahNoise(offset,range,i,tap) ), fb, x) : delayline ) ) with{ vmeter(i, x) = (x : vbargraph(" %i[unit:Sec]", 0, 20)); hmeter(i, x) = (x : hbargraph("Delay CH %i[unit:Sec]", 0, 20)); delayline(T,FB,x) = ( (_*FB)+x : de.sdelay(ma.SR*delMax, 1024, ma.SR*T) )~_ ; }; GD = hslider("[2] Delay Inputs",0,0,1,.001) : si.smoo; G = hslider("[1] Direct Input",1,0,1,.001) : si.smoo; Feedback = hslider("[3] Delays Feedback",0,0,1,.001) : si.smoo; Offset = hslider("[4] Min. delay Time[unit:Sec]",4,0,10,.001) : si.smoo; Range = hslider("[5] Max. delay Time + Min.[unit:Sec]",8,1,10,.001) : si.smoo; Tap = button("[0] TAP : Change Delay Times"); process = (_,GUI) : \(x,gd,g,fb,off,rng,tap). (x*gd : multitapDelay(20,off,rng,fb,tap) :> (_,_), x*g) : \(A,B,C).(A+C,B+C) with{ GUI = vgroup("[1] Control Interface",(GD,G,Feedback,Offset,Range,Tap)); };
8acb9cca3bc83a4bd6515df50f52835dbed693aeb222cb259259432307265ea6
LucaSpanedda/Musical_Plugins
Glitch Reader.dsp
// import Standard Faust library // https://github.com/grame-cncm/faustlibraries/ import("stdfaust.lib"); /* GLITCHER READER: WRITING AND READING WITH AN ENVELOPE ON A FIXED TABLE OF 1 SECOND (TAPE) */ // Prime Numbers List primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); // index of the primes numbers primeNumbers(index) = ba.take(index , list) with{ list = primes; }; // noise with prime numbers noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647; // SAH with internal trigger SAH2(freq,y) = loop~_ with{ decimal(x) = x-int(x); selector(sel,x,y) = (x*(1-sel)+y*(sel)); ph2pulse(x) = (x < x') + (1 - 1'); phasor(f) = (f/ma.SR):(+ :\(x).(selector(0,x,0)) : decimal)~_ ; impulse(f) = phasor(f) : ph2pulse; loop(fb) = selector(impulse(freq),fb,y); }; glitchidxrd(seed,f,decay) = SAH2(f,noise(seed)) > 0 : \(x).(x-x'>0) : \(fb,x).(x*-1+fb*decay)~_ : \(x).(x+1); sampler(seed,f,decay,x) = rwtable(192000,0.0,idxwr,x,idxrd) with{ rec = 1-checkbox("freeze") : int; idxwr = (+(1) : %(ma.SR : int)) ~ *(rec); idxrd = glitchidxrd(seed,f,decay) : * (float(ma.SR)) : int; }; Gd = hslider("decay",0,0,.995,.0001); Gf = hslider("frequency",10,0,40,.0001); process = _ <: sampler(10,Gf,Gd), sampler(12,Gf,Gd);
https://raw.githubusercontent.com/LucaSpanedda/Musical_Plugins/d17556035378ac5c6a0a2033de7f0a93390e94e1/Glitch%20Reader/Glitch%20Reader.dsp
faust
import Standard Faust library https://github.com/grame-cncm/faustlibraries/ GLITCHER READER: WRITING AND READING WITH AN ENVELOPE ON A FIXED TABLE OF 1 SECOND (TAPE) Prime Numbers List index of the primes numbers noise with prime numbers SAH with internal trigger
import("stdfaust.lib"); primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); primeNumbers(index) = ba.take(index , list) with{ list = primes; }; noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647; SAH2(freq,y) = loop~_ with{ decimal(x) = x-int(x); selector(sel,x,y) = (x*(1-sel)+y*(sel)); ph2pulse(x) = (x < x') + (1 - 1'); phasor(f) = (f/ma.SR):(+ :\(x).(selector(0,x,0)) : decimal)~_ ; impulse(f) = phasor(f) : ph2pulse; loop(fb) = selector(impulse(freq),fb,y); }; glitchidxrd(seed,f,decay) = SAH2(f,noise(seed)) > 0 : \(x).(x-x'>0) : \(fb,x).(x*-1+fb*decay)~_ : \(x).(x+1); sampler(seed,f,decay,x) = rwtable(192000,0.0,idxwr,x,idxrd) with{ rec = 1-checkbox("freeze") : int; idxwr = (+(1) : %(ma.SR : int)) ~ *(rec); idxrd = glitchidxrd(seed,f,decay) : * (float(ma.SR)) : int; }; Gd = hslider("decay",0,0,.995,.0001); Gf = hslider("frequency",10,0,40,.0001); process = _ <: sampler(10,Gf,Gd), sampler(12,Gf,Gd);
82a8cea1740bfd08ff637eeefa31ea2a807226505b29da62a6421575eabcaa87
LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust
1.03_Time_Splicing.dsp
// import Standard Faust library // https://github.com/grame-cncm/faustlibraries/ import("stdfaust.lib"); /* TIME SPLICING: WRITING AND READING WITH SCATTERING ON A FIXED TABLE OF 1 SECOND (TAPE) */ // Prime Numbers List primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); // index of the primes numbers primeNumbers(index) = ba.take(index , list) with{ list = primes; }; phsplice(seed) = (f/ma.SR) : (+ :\(x).(selector(trigph(fT),x,noise(seed))) :\(x).(x-int(x)))~_ with{ selector(sel,x,y) = (x*(1-sel)+y*(sel)); trigph(f) = (f/ma.SR) : (+ :\(x).(selector(0,x,0)) :\(x).(x-int(x)))~_ :\(x).(x-(1-dim) > 0); noise(seed) = abs((+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647); dim = hslider("scatter dimension",0,0,1,.001); fT = hslider("scatter frequency",0,0,1000,.001); f = 1; }; // TAPE-SPLICER max. lenght 1 second for every sample rate tapesplicer(noiseseed) = rwtable(dimension,0.0,indexwrite,_,indexread) with{ rec = 1-checkbox("freeze") : int; dimension = 192000; indexwrite = (+(1) : %(ma.SR : int)) ~ *(rec); indexread = phsplice(noiseseed) : *(float(ma.SR)) : int; }; process = _ <: tapesplicer(10),tapesplicer(12);
https://raw.githubusercontent.com/LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust/10a753583b4a029b68e2f2cf44b585c9abe7e89b/0_work-in-progress/1.03_Time_Splicing.dsp
faust
import Standard Faust library https://github.com/grame-cncm/faustlibraries/ TIME SPLICING: WRITING AND READING WITH SCATTERING ON A FIXED TABLE OF 1 SECOND (TAPE) Prime Numbers List index of the primes numbers TAPE-SPLICER max. lenght 1 second for every sample rate
import("stdfaust.lib"); primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); primeNumbers(index) = ba.take(index , list) with{ list = primes; }; phsplice(seed) = (f/ma.SR) : (+ :\(x).(selector(trigph(fT),x,noise(seed))) :\(x).(x-int(x)))~_ with{ selector(sel,x,y) = (x*(1-sel)+y*(sel)); trigph(f) = (f/ma.SR) : (+ :\(x).(selector(0,x,0)) :\(x).(x-int(x)))~_ :\(x).(x-(1-dim) > 0); noise(seed) = abs((+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647); dim = hslider("scatter dimension",0,0,1,.001); fT = hslider("scatter frequency",0,0,1000,.001); f = 1; }; tapesplicer(noiseseed) = rwtable(dimension,0.0,indexwrite,_,indexread) with{ rec = 1-checkbox("freeze") : int; dimension = 192000; indexwrite = (+(1) : %(ma.SR : int)) ~ *(rec); indexread = phsplice(noiseseed) : *(float(ma.SR)) : int; }; process = _ <: tapesplicer(10),tapesplicer(12);
22a59cae749bd0030c5fa5a4b657e0109679695e899fdc18d275c8f536e8a924
LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust
0.0_Prime_Noises.dsp
// FAUST standard library import("stdfaust.lib"); primesnumbers(index) = ba.take(index , list) with{ list = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); }; noise(seed) = (+(seed)~*(1103515245))/(2147483647.0); multinoise(outs) = par(i,outs,Noise((outs+i)*243176982)); pMultinoise(outs) = par(i,outs,Noise(primesnumbers(outs+i+1000))); primenoise(seed) = (+(primesnumbers(1000+seed))~*(1103515245))/(2147483647.0); process = PMultinoise(10);
https://raw.githubusercontent.com/LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust/7d4c6c3367dc301074e826213e82dc345b9ed84f/0.0_Prime_Noises.dsp
faust
FAUST standard library
import("stdfaust.lib"); primesnumbers(index) = ba.take(index , list) with{ list = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); }; noise(seed) = (+(seed)~*(1103515245))/(2147483647.0); multinoise(outs) = par(i,outs,Noise((outs+i)*243176982)); pMultinoise(outs) = par(i,outs,Noise(primesnumbers(outs+i+1000))); primenoise(seed) = (+(primesnumbers(1000+seed))~*(1103515245))/(2147483647.0); process = PMultinoise(10);
c1146729503221962388062f2237e647e2a9f92788b09ed87a5ec95227e1e734
LucaSpanedda/Audible-Ecosystemics-2
Audible_Ecosystemics_2.dsp
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "alpha"; declare description " 2022 version - Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; // import faust standard library import("stdfaust.lib"); // import audible ecosystemics objects library import("aelibrary.lib"); // PERFORMANCE SYSTEM VARIABLES SampleRate = 44100; var1 = 8; var2 = 100; var3 = 0.20; var4 = 8; //------- ------------- ----- ----------- //-- AE2 ----------------------------------------------------------------------- //------- -------- // MAIN SYSTEM FUNCTION outputrouting(grainOut1, grainOut2, out1, out2, out3, out4, out5, out6, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) = out1, out2, out3, out4, out5, out6; // choose here the signals in output process = si.bus(8) : vgroup("System Inspectors", par(i, 8, hgroup("Mics", inspect(i, -1, 1)))) :> si.bus(4) : (signalflow1a : signalflow1b : signalflow2a : signalflow2b : signalflow3) ~ si.bus(2) : outputrouting; signalflow1a( grainOut1, grainOut2, mic1, mic2, mic3, mic4 ) = grainOut1, grainOut2, mic1, mic2, mic3, mic4, ( (diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1a", inspect(i, -1, 1)))) ) with { Mic_1A_1 = mic3 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); Mic_1A_2 = mic4 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); map6sumx6 = (Mic_1A_1 : integrator(.01) : delayfb(.01, .95)) + (Mic_1A_2 : integrator(.01) : delayfb(.01, .95)) : \(x).(6 + x * 6); localMaxDiff = ((map6sumx6, Mic_1A_1) : localmax) , ((map6sumx6, Mic_1A_2) : localmax) : \(x, y).(x - y); SenstoExt = (map6sumx6, localMaxDiff) : localmax <: _ , (_ : delayfb(12, 0)) : + : * (.5) : LP1(.5) ; diffHL = ((Mic_1A_1 + Mic_1A_2) : HP3(var2) : integrator(.05)) , ((Mic_1A_1 + Mic_1A_2) : LP3(var2) : integrator(.10)) : \(x, y).(x - y) * (1 - SenstoExt) : delayfb(.01, .995) : LP5(25) : \(x).(.5 + x * .5) : // LIMIT - max - min limit(1, 0); memWriteLev = (Mic_1A_1 + Mic_1A_2) : integrator(.1) : delayfb(.01, .9) : LP5(25) : \(x).(1 - (x * x)) : // LIMIT - max - min limit(1, 0); memWriteDel1 = memWriteLev : delayfb((var1 / 2), 0) : // LIMIT - max - min limit(1, 0); memWriteDel2 = memWriteLev : delayfb((var1 / 3), 0) : // LIMIT - max - min limit(1, 0); cntrlMain = (Mic_1A_1 + Mic_1A_2) * SenstoExt : integrator(.01) : delayfb(.01, .995) : LP5(25) : // LIMIT - max - min limit(1, 0); cntrlLev1 = cntrlMain : delayfb((var1 / 3), 0) : // LIMIT - max - min limit(1, 0); cntrlLev2 = cntrlMain : delayfb((var1 / 2), 0) : // LIMIT - max - min limit(1, 0); cntrlFeed = cntrlMain : \(x).(ba.if(x <= .5, 1.0, (1.0 - x) * 2.0)) : // LIMIT - max - min limit(1, 0); }; signalflow1b( grainOut1, grainOut2, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, ( (cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1b", inspect(i, -1, 1)))) ) with { Mic_1B_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); Mic_1B_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); // cntrlMic - original version cntrlMic(x) = x : HP1(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.5); // cntrlMic - alternative version // cntrlMic(x) = x : HP2(50) : LP1(6000) : // integrator(.01) : delayfb(.01, .995) : LP5(.04); cntrlMic1 = Mic_1B_1 : cntrlMic : // LIMIT - max - min limit(1, 0); cntrlMic2 = Mic_1B_2 : cntrlMic : // LIMIT - max - min limit(1, 0); directLevel = (grainOut1 + grainOut2) : integrator(.01) : delayfb(.01, .97) : LP5(.5) <: _ , (_ : delayfb(var1 * 2, (1 - var3) * 0.5)) : + : \(x).(1 - x * .5) : // LIMIT - max - min limit(1, 0); timeIndex1 = triangleWave(1 / (var1 * 2)) : \(x).((x - 2) * 0.5); timeIndex2 = triangleWave(1 / (var1 * 2)) : \(x).((x + 1) * 0.5); triangle1 = triangleWave(1 / (var1 * 6)) * memWriteLev; triangle2 = triangleWave(var1 * (1 - cntrlMain)); triangle3 = triangleWave(1 / var1); }; signalflow2a( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, ( (sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 2a", inspect(i, -1, 1)))) ) with { Mic_2A_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); Mic_2A_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); micIN1 = Mic_2A_1 : HP1(50) : LP1(6000) * (1 - cntrlMic1); micIN2 = Mic_2A_2 : HP1(50) : LP1(6000) * (1 - cntrlMic2); SRSect1(x) = x : sampler(var1, (1 - memWriteDel2), (var2 + (diffHL * 1000)) / 261) : HP4(50) : delayfb(var1 / 2, 0); SRSect2(x) = x : sampler(var1, (memWriteLev + memWriteDel1) / 2, (290 - (diffHL * 90)) / 261) : HP4(50) : delayfb(var1, 0); SRSect3(x) = x : sampler(var1, (1 - memWriteDel1), ((var2 * 2) - (diffHL * 1000)) / 261) : HP4(50); SRSectBP1(x) = x : SRSect3 : BPsvftpt(diffHL * 400, (var2 / 2) * memWriteDel2); SRSectBP2(x) = x : SRSect3 : BPsvftpt((1 - diffHL) * 800, var2 * (1 - memWriteDel1)); SRSect4(x) = x : sampler(var1, 1, (250 + (diffHL * 20)) / 261); SRSect5(x) = x : sampler(var1, memWriteLev, .766283); SampleWriteLoop = loop ~ _ with { loop(fb) = ( ( SRSect1(fb) , SRSect2(fb) , SRSectBP1(fb) , SRSectBP2(fb) :> _ ) * (cntrlFeed * memWriteLev) ) <: ( _ + (micIN1 + micIN2) : _ * triangle1 ), _ , SRSect4(fb) , SRSect5(fb) , SRSect3(fb) ; }; sig1 = micIN1 * directLevel; sig2 = micIN2 * directLevel; sampWOut = SampleWriteLoop : \(A,B,C,D,E).( A ); variabledelaysig3(x) = x : de.delay( max(0, ba.sec2samp(.05)), max(0, int(ba.sec2samp(.05 * cntrlMain))) ); sig3 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev : variabledelaysig3 * triangle2 * directLevel; sig4 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev * (1-triangle2) * directLevel; sig5 = SampleWriteLoop : \(A,B,C,D,E).( C ) : HP4(50) : delayfb(var1 / 3, 0); sig6 = SampleWriteLoop : \(A,B,C,D,E).( D ) : HP4(50) : delayfb(var1 / 2.5, 0); sig7 = SampleWriteLoop : \(A,B,C,D,E).( E ) : delayfb(var1 / 1.5, 0) * directLevel; }; signalflow2b( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 with { grainOut1 = granular_sampling(var1, timeIndex1, memWriteDel1, cntrlLev1, 21, sampWOut); grainOut2 = granular_sampling(var1, timeIndex2, memWriteDel2, cntrlLev2, 20, sampWOut); out1 = ( ((sig5 : delayfb(.040, 0)) * (1 - triangle3)), (sig5 * triangle3), ((sig6 : delayfb(.036, 0)) * (1 - triangle3)), ((sig6 : delayfb(.036, 0)) * triangle3 ), sig1, 0, sig4, grainOut1 * (1 - memWriteLev) + grainOut2 * memWriteLev ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); out2 = ( (sig5 * (1 - triangle3)), ((sig5 : delayfb(.040, 0)) * triangle3), (sig6 * (1 - triangle3)), (sig6 * triangle3), sig2, sig3, sig7, grainOut1 * memWriteLev + grainOut2 * (1 - memWriteLev) ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); }; signalflow3( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 ) = grainOut1, grainOut2, ( ( out1, out2, ( out2 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb(var4 / 344, 0)), ( out2 : delayfb(var4 / 344, 0)) ) : vgroup("System Inspectors", par(i, 6, hgroup("Signal Flow 3", inspect(i, -1, 1))) ) ), mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7;
https://raw.githubusercontent.com/LucaSpanedda/Audible-Ecosystemics-2/c4be0f10b765b5466fe87fbe42afaab5cfd37793/Compiled_19-1-2023_Audible_Ecosystemics_2/Audible_Ecosystemics_2.dsp
faust
import faust standard library import audible ecosystemics objects library PERFORMANCE SYSTEM VARIABLES ------- ------------- ----- ----------- -- AE2 ----------------------------------------------------------------------- ------- -------- MAIN SYSTEM FUNCTION choose here the signals in output LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min cntrlMic - original version cntrlMic - alternative version cntrlMic(x) = x : HP2(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.04); LIMIT - max - min LIMIT - max - min LIMIT - max - min
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "alpha"; declare description " 2022 version - Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; import("stdfaust.lib"); import("aelibrary.lib"); SampleRate = 44100; var1 = 8; var2 = 100; var3 = 0.20; var4 = 8; outputrouting(grainOut1, grainOut2, out1, out2, out3, out4, out5, out6, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) = process = si.bus(8) : vgroup("System Inspectors", par(i, 8, hgroup("Mics", inspect(i, -1, 1)))) :> si.bus(4) : (signalflow1a : signalflow1b : signalflow2a : signalflow2b : signalflow3) ~ si.bus(2) : outputrouting; signalflow1a( grainOut1, grainOut2, mic1, mic2, mic3, mic4 ) = grainOut1, grainOut2, mic1, mic2, mic3, mic4, ( (diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1a", inspect(i, -1, 1)))) ) with { Mic_1A_1 = mic3 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); Mic_1A_2 = mic4 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); map6sumx6 = (Mic_1A_1 : integrator(.01) : delayfb(.01, .95)) + (Mic_1A_2 : integrator(.01) : delayfb(.01, .95)) : \(x).(6 + x * 6); localMaxDiff = ((map6sumx6, Mic_1A_1) : localmax) , ((map6sumx6, Mic_1A_2) : localmax) : \(x, y).(x - y); SenstoExt = (map6sumx6, localMaxDiff) : localmax <: _ , (_ : delayfb(12, 0)) : + : * (.5) : LP1(.5) ; diffHL = ((Mic_1A_1 + Mic_1A_2) : HP3(var2) : integrator(.05)) , ((Mic_1A_1 + Mic_1A_2) : LP3(var2) : integrator(.10)) : \(x, y).(x - y) * (1 - SenstoExt) : delayfb(.01, .995) : LP5(25) : \(x).(.5 + x * .5) : limit(1, 0); memWriteLev = (Mic_1A_1 + Mic_1A_2) : integrator(.1) : delayfb(.01, .9) : LP5(25) : \(x).(1 - (x * x)) : limit(1, 0); memWriteDel1 = memWriteLev : delayfb((var1 / 2), 0) : limit(1, 0); memWriteDel2 = memWriteLev : delayfb((var1 / 3), 0) : limit(1, 0); cntrlMain = (Mic_1A_1 + Mic_1A_2) * SenstoExt : integrator(.01) : delayfb(.01, .995) : LP5(25) : limit(1, 0); cntrlLev1 = cntrlMain : delayfb((var1 / 3), 0) : limit(1, 0); cntrlLev2 = cntrlMain : delayfb((var1 / 2), 0) : limit(1, 0); cntrlFeed = cntrlMain : \(x).(ba.if(x <= .5, 1.0, (1.0 - x) * 2.0)) : limit(1, 0); }; signalflow1b( grainOut1, grainOut2, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, ( (cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1b", inspect(i, -1, 1)))) ) with { Mic_1B_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); Mic_1B_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); cntrlMic(x) = x : HP1(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.5); cntrlMic1 = Mic_1B_1 : cntrlMic : limit(1, 0); cntrlMic2 = Mic_1B_2 : cntrlMic : limit(1, 0); directLevel = (grainOut1 + grainOut2) : integrator(.01) : delayfb(.01, .97) : LP5(.5) <: _ , (_ : delayfb(var1 * 2, (1 - var3) * 0.5)) : + : \(x).(1 - x * .5) : limit(1, 0); timeIndex1 = triangleWave(1 / (var1 * 2)) : \(x).((x - 2) * 0.5); timeIndex2 = triangleWave(1 / (var1 * 2)) : \(x).((x + 1) * 0.5); triangle1 = triangleWave(1 / (var1 * 6)) * memWriteLev; triangle2 = triangleWave(var1 * (1 - cntrlMain)); triangle3 = triangleWave(1 / var1); }; signalflow2a( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, ( (sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 2a", inspect(i, -1, 1)))) ) with { Mic_2A_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); Mic_2A_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); micIN1 = Mic_2A_1 : HP1(50) : LP1(6000) * (1 - cntrlMic1); micIN2 = Mic_2A_2 : HP1(50) : LP1(6000) * (1 - cntrlMic2); SRSect1(x) = x : sampler(var1, (1 - memWriteDel2), (var2 + (diffHL * 1000)) / 261) : HP4(50) : delayfb(var1 / 2, 0); SRSect2(x) = x : sampler(var1, (memWriteLev + memWriteDel1) / 2, (290 - (diffHL * 90)) / 261) : HP4(50) : delayfb(var1, 0); SRSect3(x) = x : sampler(var1, (1 - memWriteDel1), ((var2 * 2) - (diffHL * 1000)) / 261) : HP4(50); SRSectBP1(x) = x : SRSect3 : BPsvftpt(diffHL * 400, (var2 / 2) * memWriteDel2); SRSectBP2(x) = x : SRSect3 : BPsvftpt((1 - diffHL) * 800, var2 * (1 - memWriteDel1)); SRSect4(x) = x : sampler(var1, 1, (250 + (diffHL * 20)) / 261); SRSect5(x) = x : sampler(var1, memWriteLev, .766283); SampleWriteLoop = loop ~ _ with { loop(fb) = ( ( SRSect1(fb) , SRSect2(fb) , SRSectBP1(fb) , SRSectBP2(fb) :> _ ) * (cntrlFeed * memWriteLev) ) <: ( _ + (micIN1 + micIN2) : _ * triangle1 ), _ , SRSect4(fb) , SRSect5(fb) , SRSect3(fb) ; }; sig1 = micIN1 * directLevel; sig2 = micIN2 * directLevel; sampWOut = SampleWriteLoop : \(A,B,C,D,E).( A ); variabledelaysig3(x) = x : de.delay( max(0, ba.sec2samp(.05)), max(0, int(ba.sec2samp(.05 * cntrlMain))) ); sig3 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev : variabledelaysig3 * triangle2 * directLevel; sig4 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev * (1-triangle2) * directLevel; sig5 = SampleWriteLoop : \(A,B,C,D,E).( C ) : HP4(50) : delayfb(var1 / 3, 0); sig6 = SampleWriteLoop : \(A,B,C,D,E).( D ) : HP4(50) : delayfb(var1 / 2.5, 0); sig7 = SampleWriteLoop : \(A,B,C,D,E).( E ) : delayfb(var1 / 1.5, 0) * directLevel; }; signalflow2b( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 with { grainOut1 = granular_sampling(var1, timeIndex1, memWriteDel1, cntrlLev1, 21, sampWOut); grainOut2 = granular_sampling(var1, timeIndex2, memWriteDel2, cntrlLev2, 20, sampWOut); out1 = ( ((sig5 : delayfb(.040, 0)) * (1 - triangle3)), (sig5 * triangle3), ((sig6 : delayfb(.036, 0)) * (1 - triangle3)), ((sig6 : delayfb(.036, 0)) * triangle3 ), sig1, 0, sig4, grainOut1 * (1 - memWriteLev) + grainOut2 * memWriteLev ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); out2 = ( (sig5 * (1 - triangle3)), ((sig5 : delayfb(.040, 0)) * triangle3), (sig6 * (1 - triangle3)), (sig6 * triangle3), sig2, sig3, sig7, grainOut1 * memWriteLev + grainOut2 * (1 - memWriteLev) ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); }; signalflow3( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 ) = grainOut1, grainOut2, ( ( out1, out2, ( out2 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb(var4 / 344, 0)), ( out2 : delayfb(var4 / 344, 0)) ) : vgroup("System Inspectors", par(i, 6, hgroup("Signal Flow 3", inspect(i, -1, 1))) ) ), mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7;
3fa9bdd9a07b687be74484bb8e4f83d242dec32304e1d4f23ff16b4ea4e2b66f
LucaSpanedda/Audible-Ecosystemics-2
Audible_Ecosystemics_2.dsp
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "alpha"; declare description " 2022 version - Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; // import faust standard library import("stdfaust.lib"); // import audible ecosystemics objects library import("aelibrary.lib"); //------- ------------- ----- ----------- //-- AE2 ----------------------------------------------------------------------- //------- -------- // MAIN SYSTEM FUNCTION outputrouting(grainOut1, grainOut2, out1, out2, out3, out4, out5, out6, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) = out1, out2, out3, out4, out5, out6; // choose here the signals in output process = si.bus(8) :> si.bus(4) : (signalflow1a : signalflow1b : signalflow2a : signalflow2b : signalflow3) ~ si.bus(2) : outputrouting; signalflow1a( grainOut1, grainOut2, mic1, mic2, mic3, mic4 ) = grainOut1, grainOut2, mic1, mic2, mic3, mic4, ((diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain) : SF1Ainspect) with { Mic_1A_1 = mic3 : gainMic_1A1; Mic_1A_2 = mic4 : gainMic_1A2; map6sumx6 = (Mic_1A_1 : integrator(.01) : delayfb(.01, .95)) + (Mic_1A_2 : integrator(.01) : delayfb(.01, .95)) : \(x).(6 + x * 6); localMaxDiff = ((map6sumx6, Mic_1A_1) : localmax) , ((map6sumx6, Mic_1A_2) : localmax) : \(x, y).(x - y); SenstoExt = (map6sumx6, localMaxDiff) : localmax <: _ , (_ : delayfb(12, 0)) : + : * (.5) : LP1(.5) : tgroup("Control", vgroup("System Inspectors", hgroup("Signal Flow 1a [1]", hgroup("Sens. to Ext. Cond.", inspect(101, -1, 1))))); diffHL = ((Mic_1A_1 + Mic_1A_2) : HP3(var2) : integrator(.05)) , ((Mic_1A_1 + Mic_1A_2) : LP3(var2) : integrator(.10)) : \(x, y).((x - y) : tgroup("Control", vgroup("System Inspectors", hgroup("Signal Flow 1a [1]", hgroup("diffHL Centroid", inspect(100, -1, 1)))))) * (1 - SenstoExt) : delayfb(.01, .995) : LP5(25) : \(x).(.5 + x * .5) : // LIMIT - max - min limit(1, 0); memWriteLev = (Mic_1A_1 + Mic_1A_2) : integrator(.1) : delayfb(.01, .9) : LP5(25) : \(x).(1 - (x * x)) : // LIMIT - max - min limit(1, 0); memWriteDel1 = memWriteLev : delayfb((var1 / 2), 0) : // LIMIT - max - min limit(1, 0); memWriteDel2 = memWriteLev : delayfb((var1 / 3), 0) : // LIMIT - max - min limit(1, 0); cntrlMain = (Mic_1A_1 + Mic_1A_2) * SenstoExt : integrator(.01) : delayfb(.01, .995) : LP5(25) : // LIMIT - max - min limit(1, 0); cntrlLev1 = cntrlMain : delayfb((var1 / 3), 0) : // LIMIT - max - min limit(1, 0); cntrlLev2 = cntrlMain : delayfb((var1 / 2), 0) : // LIMIT - max - min limit(1, 0); cntrlFeed = cntrlMain : \(x).(ba.if(x <= .5, 1.0, (1.0 - x) * 2.0)) : // LIMIT - max - min limit(1, 0); }; signalflow1b( grainOut1, grainOut2, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, ((cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3) : SF1Binspect) with { Mic_1B_1 = mic1 : gainMic_1B1; Mic_1B_2 = mic2 : gainMic_1B2; // cntrlMic - original version cntrlMic(x) = x : HP1(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.5); // cntrlMic - alternative version // cntrlMic(x) = x : HP2(50) : LP1(6000) : // integrator(.01) : delayfb(.01, .995) : LP5(.04); cntrlMic1 = Mic_1B_1 : cntrlMic : // LIMIT - max - min limit(1, 0); cntrlMic2 = Mic_1B_2 : cntrlMic : // LIMIT - max - min limit(1, 0); directLevel = (grainOut1 + grainOut2) : integrator(.01) : delayfb(.01, .97) : LP5(.5) <: _ , (_ : delayfb(var1 * 2, (1 - var3) * 0.5)) : + : \(x).(1 - x * .5) : // LIMIT - max - min limit(1, 0); timeIndex1 = triangleWave(1 / (var1 * 2)) : \(x).((x - 2) * 0.5); timeIndex2 = triangleWave(1 / (var1 * 2)) : \(x).((x + 1) * 0.5); triangle1 = triangleWave(1 / (var1 * 6)) * memWriteLev; triangle2 = triangleWave(var1 * (1 - cntrlMain)); triangle3 = triangleWave(1 / var1); }; signalflow2a( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, ((sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) : SF2Ainspect) with { Mic_2A_1 = mic1 : gainMic_2A1; Mic_2A_2 = mic2 : gainMic_2A2; micIN1 = Mic_2A_1 : HP1(50) : LP1(6000) * (1 - cntrlMic1); micIN2 = Mic_2A_2 : HP1(50) : LP1(6000) * (1 - cntrlMic2); SRSect1(x) = x : sampler(var1, (1 - memWriteDel2), (var2 + (diffHL * 1000)) / 261) : SRinspect(1) : HP4(50) : delayfb(var1 / 2, 0); SRSect2(x) = x : sampler(var1, (memWriteLev + memWriteDel1) / 2, (290 - (diffHL * 90)) / 261) : SRinspect(2) : HP4(50) : delayfb(var1, 0); SRSect3(x) = x : sampler(var1, (1 - memWriteDel1), ((var2 * 2) - (diffHL * 1000)) / 261) : SRinspect(3) : HP4(50); SRSectBP1(x) = x : SRSect3 : BPsvftpt(diffHL * 400, (var2 / 2) * memWriteDel2); SRSectBP2(x) = x : SRSect3 : BPsvftpt((1 - diffHL) * 800, var2 * (1 - memWriteDel1)); SRSect4(x) = x : sampler(var1, 1, (250 + (diffHL * 20)) / 261) : SRinspect(4); SRSect5(x) = x : sampler(var1, memWriteLev, .766283) : SRinspect(5); SampleWriteLoop = loop ~ _ with { loop(fb) = ( ( SRSect1(fb) , SRSect2(fb) , SRSectBP1(fb) , SRSectBP2(fb) :> + ) * (cntrlFeed * memWriteLev) ) <: ( _ + (micIN1 + micIN2) : _ * triangle1 ), _ , SRSect4(fb) , SRSect5(fb) , SRSect3(fb) ; }; sig1 = micIN1 * directLevel; sig2 = micIN2 * directLevel; sampWOut = SampleWriteLoop : \(A,B,C,D,E).( A ); variabledelaysig3(x) = x : de.delay(max(0, ba.sec2samp(.05)), max(0, int(ba.sec2samp(.05 * cntrlMain))) ); sig3 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev : variabledelaysig3 * triangle2 * directLevel; sig4 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev * (1-triangle2) * directLevel; sig5 = SampleWriteLoop : \(A,B,C,D,E).( C ) : HP4(50) : delayfb(var1 / 3, 0); sig6 = SampleWriteLoop : \(A,B,C,D,E).( D ) : HP4(50) : delayfb(var1 / 2.5, 0); sig7 = SampleWriteLoop : \(A,B,C,D,E).( E ) : delayfb(var1 / 1.5, 0) * directLevel; }; signalflow2b( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 with { grainOut1 = granular_sampling(var1, timeIndex1, memWriteDel1, cntrlLev1, 21, sampWOut) : GSinspect(1); grainOut2 = granular_sampling(var1, timeIndex2, memWriteDel2, cntrlLev2, 20, sampWOut) : GSinspect(2); out1 = ( ((sig5 : delayfb(.040, 0)) * (1 - triangle3)), (sig5 * triangle3), ((sig6 : delayfb(.036, 0)) * (1 - triangle3)), ((sig6 : delayfb(.036, 0)) * triangle3 ), sig1, 0, sig4, grainOut1 * (1 - memWriteLev) + grainOut2 * memWriteLev ) :> _ : gainMic_3O1; out2 = ( (sig5 * (1 - triangle3)), ((sig5 : delayfb(.040, 0)) * triangle3), (sig6 * (1 - triangle3)), (sig6 * triangle3), sig2, sig3, sig7, grainOut1 * memWriteLev + grainOut2 * (1 - memWriteLev) ) :> _ : gainMic_3O2; }; signalflow3( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 ) = grainOut1, grainOut2, ( ( out1, out2, ( out2 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb(var4 / 344, 0)), ( out2 : delayfb(var4 / 344, 0)) ) : SF3Oinspect ), mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7;
https://raw.githubusercontent.com/LucaSpanedda/Audible-Ecosystemics-2/c4be0f10b765b5466fe87fbe42afaab5cfd37793/Compiled_17-2-2023_Audible_Ecosystemics_2/Audible_Ecosystemics_2.dsp
faust
import faust standard library import audible ecosystemics objects library ------- ------------- ----- ----------- -- AE2 ----------------------------------------------------------------------- ------- -------- MAIN SYSTEM FUNCTION choose here the signals in output LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min cntrlMic - original version cntrlMic - alternative version cntrlMic(x) = x : HP2(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.04); LIMIT - max - min LIMIT - max - min LIMIT - max - min
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "alpha"; declare description " 2022 version - Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; import("stdfaust.lib"); import("aelibrary.lib"); outputrouting(grainOut1, grainOut2, out1, out2, out3, out4, out5, out6, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) = process = si.bus(8) :> si.bus(4) : (signalflow1a : signalflow1b : signalflow2a : signalflow2b : signalflow3) ~ si.bus(2) : outputrouting; signalflow1a( grainOut1, grainOut2, mic1, mic2, mic3, mic4 ) = grainOut1, grainOut2, mic1, mic2, mic3, mic4, ((diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain) : SF1Ainspect) with { Mic_1A_1 = mic3 : gainMic_1A1; Mic_1A_2 = mic4 : gainMic_1A2; map6sumx6 = (Mic_1A_1 : integrator(.01) : delayfb(.01, .95)) + (Mic_1A_2 : integrator(.01) : delayfb(.01, .95)) : \(x).(6 + x * 6); localMaxDiff = ((map6sumx6, Mic_1A_1) : localmax) , ((map6sumx6, Mic_1A_2) : localmax) : \(x, y).(x - y); SenstoExt = (map6sumx6, localMaxDiff) : localmax <: _ , (_ : delayfb(12, 0)) : + : * (.5) : LP1(.5) : tgroup("Control", vgroup("System Inspectors", hgroup("Signal Flow 1a [1]", hgroup("Sens. to Ext. Cond.", inspect(101, -1, 1))))); diffHL = ((Mic_1A_1 + Mic_1A_2) : HP3(var2) : integrator(.05)) , ((Mic_1A_1 + Mic_1A_2) : LP3(var2) : integrator(.10)) : \(x, y).((x - y) : tgroup("Control", vgroup("System Inspectors", hgroup("Signal Flow 1a [1]", hgroup("diffHL Centroid", inspect(100, -1, 1)))))) * (1 - SenstoExt) : delayfb(.01, .995) : LP5(25) : \(x).(.5 + x * .5) : limit(1, 0); memWriteLev = (Mic_1A_1 + Mic_1A_2) : integrator(.1) : delayfb(.01, .9) : LP5(25) : \(x).(1 - (x * x)) : limit(1, 0); memWriteDel1 = memWriteLev : delayfb((var1 / 2), 0) : limit(1, 0); memWriteDel2 = memWriteLev : delayfb((var1 / 3), 0) : limit(1, 0); cntrlMain = (Mic_1A_1 + Mic_1A_2) * SenstoExt : integrator(.01) : delayfb(.01, .995) : LP5(25) : limit(1, 0); cntrlLev1 = cntrlMain : delayfb((var1 / 3), 0) : limit(1, 0); cntrlLev2 = cntrlMain : delayfb((var1 / 2), 0) : limit(1, 0); cntrlFeed = cntrlMain : \(x).(ba.if(x <= .5, 1.0, (1.0 - x) * 2.0)) : limit(1, 0); }; signalflow1b( grainOut1, grainOut2, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, ((cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3) : SF1Binspect) with { Mic_1B_1 = mic1 : gainMic_1B1; Mic_1B_2 = mic2 : gainMic_1B2; cntrlMic(x) = x : HP1(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.5); cntrlMic1 = Mic_1B_1 : cntrlMic : limit(1, 0); cntrlMic2 = Mic_1B_2 : cntrlMic : limit(1, 0); directLevel = (grainOut1 + grainOut2) : integrator(.01) : delayfb(.01, .97) : LP5(.5) <: _ , (_ : delayfb(var1 * 2, (1 - var3) * 0.5)) : + : \(x).(1 - x * .5) : limit(1, 0); timeIndex1 = triangleWave(1 / (var1 * 2)) : \(x).((x - 2) * 0.5); timeIndex2 = triangleWave(1 / (var1 * 2)) : \(x).((x + 1) * 0.5); triangle1 = triangleWave(1 / (var1 * 6)) * memWriteLev; triangle2 = triangleWave(var1 * (1 - cntrlMain)); triangle3 = triangleWave(1 / var1); }; signalflow2a( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, ((sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) : SF2Ainspect) with { Mic_2A_1 = mic1 : gainMic_2A1; Mic_2A_2 = mic2 : gainMic_2A2; micIN1 = Mic_2A_1 : HP1(50) : LP1(6000) * (1 - cntrlMic1); micIN2 = Mic_2A_2 : HP1(50) : LP1(6000) * (1 - cntrlMic2); SRSect1(x) = x : sampler(var1, (1 - memWriteDel2), (var2 + (diffHL * 1000)) / 261) : SRinspect(1) : HP4(50) : delayfb(var1 / 2, 0); SRSect2(x) = x : sampler(var1, (memWriteLev + memWriteDel1) / 2, (290 - (diffHL * 90)) / 261) : SRinspect(2) : HP4(50) : delayfb(var1, 0); SRSect3(x) = x : sampler(var1, (1 - memWriteDel1), ((var2 * 2) - (diffHL * 1000)) / 261) : SRinspect(3) : HP4(50); SRSectBP1(x) = x : SRSect3 : BPsvftpt(diffHL * 400, (var2 / 2) * memWriteDel2); SRSectBP2(x) = x : SRSect3 : BPsvftpt((1 - diffHL) * 800, var2 * (1 - memWriteDel1)); SRSect4(x) = x : sampler(var1, 1, (250 + (diffHL * 20)) / 261) : SRinspect(4); SRSect5(x) = x : sampler(var1, memWriteLev, .766283) : SRinspect(5); SampleWriteLoop = loop ~ _ with { loop(fb) = ( ( SRSect1(fb) , SRSect2(fb) , SRSectBP1(fb) , SRSectBP2(fb) :> + ) * (cntrlFeed * memWriteLev) ) <: ( _ + (micIN1 + micIN2) : _ * triangle1 ), _ , SRSect4(fb) , SRSect5(fb) , SRSect3(fb) ; }; sig1 = micIN1 * directLevel; sig2 = micIN2 * directLevel; sampWOut = SampleWriteLoop : \(A,B,C,D,E).( A ); variabledelaysig3(x) = x : de.delay(max(0, ba.sec2samp(.05)), max(0, int(ba.sec2samp(.05 * cntrlMain))) ); sig3 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev : variabledelaysig3 * triangle2 * directLevel; sig4 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev * (1-triangle2) * directLevel; sig5 = SampleWriteLoop : \(A,B,C,D,E).( C ) : HP4(50) : delayfb(var1 / 3, 0); sig6 = SampleWriteLoop : \(A,B,C,D,E).( D ) : HP4(50) : delayfb(var1 / 2.5, 0); sig7 = SampleWriteLoop : \(A,B,C,D,E).( E ) : delayfb(var1 / 1.5, 0) * directLevel; }; signalflow2b( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 with { grainOut1 = granular_sampling(var1, timeIndex1, memWriteDel1, cntrlLev1, 21, sampWOut) : GSinspect(1); grainOut2 = granular_sampling(var1, timeIndex2, memWriteDel2, cntrlLev2, 20, sampWOut) : GSinspect(2); out1 = ( ((sig5 : delayfb(.040, 0)) * (1 - triangle3)), (sig5 * triangle3), ((sig6 : delayfb(.036, 0)) * (1 - triangle3)), ((sig6 : delayfb(.036, 0)) * triangle3 ), sig1, 0, sig4, grainOut1 * (1 - memWriteLev) + grainOut2 * memWriteLev ) :> _ : gainMic_3O1; out2 = ( (sig5 * (1 - triangle3)), ((sig5 : delayfb(.040, 0)) * triangle3), (sig6 * (1 - triangle3)), (sig6 * triangle3), sig2, sig3, sig7, grainOut1 * memWriteLev + grainOut2 * (1 - memWriteLev) ) :> _ : gainMic_3O2; }; signalflow3( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 ) = grainOut1, grainOut2, ( ( out1, out2, ( out2 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb(var4 / 344, 0)), ( out2 : delayfb(var4 / 344, 0)) ) : SF3Oinspect ), mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7;
c8fcfc1ac06e43bd67bb567ec6cb05aba54126710408f26bb672f45eb4bd5858
LucaSpanedda/Audible-Ecosystemics-2
Audible_Ecosystemics_2.dsp
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "alpha"; declare description " 2022 version - Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; // import faust standard library import("stdfaust.lib"); // import audible ecosystemics objects library import("aelibrary.lib"); // PERFORMANCE SYSTEM VARIABLES SampleRate = 44100; var1 = hgroup("System Variables", nentry("Var 1", 20, 1, 20, 1)); var2 = hgroup("System Variables", nentry("Var 2", 100, 1, 10000, 1)); var3 = hgroup("System Variables", nentry("Var 3", .5, 0, 1, .001)); var4 = hgroup("System Variables", nentry("Var 4", 20, 1, 20, 1)); //------- ------------- ----- ----------- //-- AE2 ----------------------------------------------------------------------- //------- -------- // MAIN SYSTEM FUNCTION outputrouting(grainOut1, grainOut2, out1, out2, out3, out4, out5, out6, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) = out1, out2, out3, out4, out5, out6; // choose here the signals in output process = si.bus(8) :> par(i, 4, _ * vgroup("Mixer ON/OFF", checkbox("mute/unmute"))) : (signalflow1a : signalflow1b : signalflow2a : signalflow2b : signalflow3) ~ si.bus(2) : outputrouting; signalflow1a( grainOut1, grainOut2, mic1, mic2, mic3, mic4 ) = grainOut1, grainOut2, mic1, mic2, mic3, mic4, ( (diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1a", inspect(i, -1, 1)))) ) with { Mic_1A_1 = mic3 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); Mic_1A_2 = mic4 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); map6sumx6 = (Mic_1A_1 : integrator(.01) : delayfb(.01, .95)) + (Mic_1A_2 : integrator(.01) : delayfb(.01, .95)) : \(x).(6 + x * 6); localMaxDiff = ((map6sumx6, Mic_1A_1) : localmax) , ((map6sumx6, Mic_1A_2) : localmax) : \(x, y).(x - y); SenstoExt = (map6sumx6, localMaxDiff) : localmax <: _ , (_ : delayfb(12, 0)) : + : * (.5) : LP1(.5) : vgroup("System Inspectors", hgroup("Signal Flow 1a", hgroup("Sens. to Ext. Cond.", inspect(101, -1, 1)))); diffHL = ((Mic_1A_1 + Mic_1A_2) : HP3(var2) : integrator(.05)) , ((Mic_1A_1 + Mic_1A_2) : LP3(var2) : integrator(.10)) : \(x, y).((x - y) : vgroup("System Inspectors", hgroup("Signal Flow 1a", hgroup("diffHL Centroid", inspect(100, -1, 1))))) * (1 - SenstoExt) : delayfb(.01, .995) : LP5(25) : \(x).(.5 + x * .5) : // LIMIT - max - min limit(1, 0); memWriteLev = (Mic_1A_1 + Mic_1A_2 : MicSum1Ainspect) : integrator(.1) : delayfb(.01, .9) : LP5(25) : \(x).(1 - (x * x)) : // LIMIT - max - min limit(1, 0); memWriteDel1 = memWriteLev : delayfb((var1 / 2), 0) : // LIMIT - max - min limit(1, 0); memWriteDel2 = memWriteLev : delayfb((var1 / 3), 0) : // LIMIT - max - min limit(1, 0); cntrlMain = (Mic_1A_1 + Mic_1A_2) * SenstoExt : integrator(.01) : delayfb(.01, .995) : LP5(25) : // LIMIT - max - min limit(1, 0); cntrlLev1 = cntrlMain : delayfb((var1 / 3), 0) : // LIMIT - max - min limit(1, 0); cntrlLev2 = cntrlMain : delayfb((var1 / 2), 0) : // LIMIT - max - min limit(1, 0); cntrlFeed = cntrlMain : \(x).(ba.if(x <= .5, 1.0, (1.0 - x) * 2.0)) : // LIMIT - max - min limit(1, 0); }; signalflow1b( grainOut1, grainOut2, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, ( (cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1b", inspect(i, -1, 1)))) ) with { Mic_1B_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); Mic_1B_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); // cntrlMic - original version cntrlMic(x) = x : HP1(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.5); // cntrlMic - alternative version // cntrlMic(x) = x : HP2(50) : LP1(6000) : // integrator(.01) : delayfb(.01, .995) : LP5(.04); cntrlMic1 = Mic_1B_1 : Mic11Binspect : cntrlMic : // LIMIT - max - min limit(1, 0); cntrlMic2 = Mic_1B_2 : Mic21Binspect : cntrlMic : // LIMIT - max - min limit(1, 0); directLevel = (grainOut1 + grainOut2) : integrator(.01) : delayfb(.01, .97) : LP5(.5) <: _ , (_ : delayfb(var1 * 2, (1 - var3) * 0.5)) : + : \(x).(1 - x * .5) : // LIMIT - max - min limit(1, 0); timeIndex1 = triangleWave(1 / (var1 * 2)) : \(x).((x - 2) * 0.5); timeIndex2 = triangleWave(1 / (var1 * 2)) : \(x).((x + 1) * 0.5); triangle1 = triangleWave(1 / (var1 * 6)) * memWriteLev; triangle2 = triangleWave(var1 * (1 - cntrlMain)); triangle3 = triangleWave(1 / var1); }; signalflow2a( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, ( (sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 2a", inspect(i, -1, 1)))) ) with { Mic_2A_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); Mic_2A_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); micIN1 = Mic_2A_1 : Mic12Ainspect : HP1(50) : LP1(6000) * (1 - cntrlMic1); micIN2 = Mic_2A_2 : Mic22Ainspect : HP1(50) : LP1(6000) * (1 - cntrlMic2); SRSect1(x) = x : sampler(var1, (1 - memWriteDel2), (var2 + (diffHL * 1000)) / 261) : HP4(50) : delayfb(var1 / 2, 0); SRSect2(x) = x : sampler(var1, (memWriteLev + memWriteDel1) / 2, (290 - (diffHL * 90)) / 261) : HP4(50) : delayfb(var1, 0); SRSect3(x) = x : sampler(var1, (1 - memWriteDel1), ((var2 * 2) - (diffHL * 1000)) / 261) : HP4(50); SRSectBP1(x) = x : SRSect3 : BPsvftpt(diffHL * 400, (var2 / 2) * memWriteDel2); SRSectBP2(x) = x : SRSect3 : BPsvftpt((1 - diffHL) * 800, var2 * (1 - memWriteDel1)); SRSect4(x) = x : sampler(var1, 1, (250 + (diffHL * 20)) / 261); SRSect5(x) = x : sampler(var1, memWriteLev, .766283); SampleWriteLoop = loop ~ _ with { loop(fb) = ( ( SRSect1(fb) , SRSect2(fb) , SRSectBP1(fb) , SRSectBP2(fb) :> _ ) * (cntrlFeed * memWriteLev) ) <: ( _ + (micIN1 + micIN2) : _ * triangle1 ), _ , SRSect4(fb) , SRSect5(fb) , SRSect3(fb) ; }; sig1 = micIN1 * directLevel; sig2 = micIN2 * directLevel; sampWOut = SampleWriteLoop : \(A,B,C,D,E).( A ); variabledelaysig3(x) = x : de.delay( max(0, ba.sec2samp(.05)), max(0, int(ba.sec2samp(.05 * cntrlMain))) ); sig3 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev : variabledelaysig3 * triangle2 * directLevel; sig4 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev * (1-triangle2) * directLevel; sig5 = SampleWriteLoop : \(A,B,C,D,E).( C ) : HP4(50) : delayfb(var1 / 3, 0); sig6 = SampleWriteLoop : \(A,B,C,D,E).( D ) : HP4(50) : delayfb(var1 / 2.5, 0); sig7 = SampleWriteLoop : \(A,B,C,D,E).( E ) : delayfb(var1 / 1.5, 0) * directLevel; }; signalflow2b( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 with { grainOut1 = granular_sampling(var1, timeIndex1, memWriteDel1, cntrlLev1, 21, sampWOut); grainOut2 = granular_sampling(var1, timeIndex2, memWriteDel2, cntrlLev2, 20, sampWOut); out1 = ( ((sig5 : delayfb(.040, 0)) * (1 - triangle3)), (sig5 * triangle3), ((sig6 : delayfb(.036, 0)) * (1 - triangle3)), ((sig6 : delayfb(.036, 0)) * triangle3 ), sig1, 0, sig4, grainOut1 * (1 - memWriteLev) + grainOut2 * memWriteLev ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); out2 = ( (sig5 * (1 - triangle3)), ((sig5 : delayfb(.040, 0)) * triangle3), (sig6 * (1 - triangle3)), (sig6 * triangle3), sig2, sig3, sig7, grainOut1 * memWriteLev + grainOut2 * (1 - memWriteLev) ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); }; signalflow3( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 ) = grainOut1, grainOut2, ( ( out1, out2, ( out2 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb(var4 / 344, 0)), ( out2 : delayfb(var4 / 344, 0)) ) : vgroup("System Inspectors", par(i, 6, hgroup("Signal Flow 3", inspect(i, -1, 1))) ) ), mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7;
https://raw.githubusercontent.com/LucaSpanedda/Audible-Ecosystemics-2/c4be0f10b765b5466fe87fbe42afaab5cfd37793/Compiled_22-1-2023_Audible_Ecosystemics_2/Audible_Ecosystemics_2.dsp
faust
import faust standard library import audible ecosystemics objects library PERFORMANCE SYSTEM VARIABLES ------- ------------- ----- ----------- -- AE2 ----------------------------------------------------------------------- ------- -------- MAIN SYSTEM FUNCTION choose here the signals in output LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min cntrlMic - original version cntrlMic - alternative version cntrlMic(x) = x : HP2(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.04); LIMIT - max - min LIMIT - max - min LIMIT - max - min
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "alpha"; declare description " 2022 version - Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; import("stdfaust.lib"); import("aelibrary.lib"); SampleRate = 44100; var1 = hgroup("System Variables", nentry("Var 1", 20, 1, 20, 1)); var2 = hgroup("System Variables", nentry("Var 2", 100, 1, 10000, 1)); var3 = hgroup("System Variables", nentry("Var 3", .5, 0, 1, .001)); var4 = hgroup("System Variables", nentry("Var 4", 20, 1, 20, 1)); outputrouting(grainOut1, grainOut2, out1, out2, out3, out4, out5, out6, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) = process = si.bus(8) :> par(i, 4, _ * vgroup("Mixer ON/OFF", checkbox("mute/unmute"))) : (signalflow1a : signalflow1b : signalflow2a : signalflow2b : signalflow3) ~ si.bus(2) : outputrouting; signalflow1a( grainOut1, grainOut2, mic1, mic2, mic3, mic4 ) = grainOut1, grainOut2, mic1, mic2, mic3, mic4, ( (diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1a", inspect(i, -1, 1)))) ) with { Mic_1A_1 = mic3 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); Mic_1A_2 = mic4 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); map6sumx6 = (Mic_1A_1 : integrator(.01) : delayfb(.01, .95)) + (Mic_1A_2 : integrator(.01) : delayfb(.01, .95)) : \(x).(6 + x * 6); localMaxDiff = ((map6sumx6, Mic_1A_1) : localmax) , ((map6sumx6, Mic_1A_2) : localmax) : \(x, y).(x - y); SenstoExt = (map6sumx6, localMaxDiff) : localmax <: _ , (_ : delayfb(12, 0)) : + : * (.5) : LP1(.5) : vgroup("System Inspectors", hgroup("Signal Flow 1a", hgroup("Sens. to Ext. Cond.", inspect(101, -1, 1)))); diffHL = ((Mic_1A_1 + Mic_1A_2) : HP3(var2) : integrator(.05)) , ((Mic_1A_1 + Mic_1A_2) : LP3(var2) : integrator(.10)) : \(x, y).((x - y) : vgroup("System Inspectors", hgroup("Signal Flow 1a", hgroup("diffHL Centroid", inspect(100, -1, 1))))) * (1 - SenstoExt) : delayfb(.01, .995) : LP5(25) : \(x).(.5 + x * .5) : limit(1, 0); memWriteLev = (Mic_1A_1 + Mic_1A_2 : MicSum1Ainspect) : integrator(.1) : delayfb(.01, .9) : LP5(25) : \(x).(1 - (x * x)) : limit(1, 0); memWriteDel1 = memWriteLev : delayfb((var1 / 2), 0) : limit(1, 0); memWriteDel2 = memWriteLev : delayfb((var1 / 3), 0) : limit(1, 0); cntrlMain = (Mic_1A_1 + Mic_1A_2) * SenstoExt : integrator(.01) : delayfb(.01, .995) : LP5(25) : limit(1, 0); cntrlLev1 = cntrlMain : delayfb((var1 / 3), 0) : limit(1, 0); cntrlLev2 = cntrlMain : delayfb((var1 / 2), 0) : limit(1, 0); cntrlFeed = cntrlMain : \(x).(ba.if(x <= .5, 1.0, (1.0 - x) * 2.0)) : limit(1, 0); }; signalflow1b( grainOut1, grainOut2, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, ( (cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1b", inspect(i, -1, 1)))) ) with { Mic_1B_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); Mic_1B_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); cntrlMic(x) = x : HP1(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.5); cntrlMic1 = Mic_1B_1 : Mic11Binspect : cntrlMic : limit(1, 0); cntrlMic2 = Mic_1B_2 : Mic21Binspect : cntrlMic : limit(1, 0); directLevel = (grainOut1 + grainOut2) : integrator(.01) : delayfb(.01, .97) : LP5(.5) <: _ , (_ : delayfb(var1 * 2, (1 - var3) * 0.5)) : + : \(x).(1 - x * .5) : limit(1, 0); timeIndex1 = triangleWave(1 / (var1 * 2)) : \(x).((x - 2) * 0.5); timeIndex2 = triangleWave(1 / (var1 * 2)) : \(x).((x + 1) * 0.5); triangle1 = triangleWave(1 / (var1 * 6)) * memWriteLev; triangle2 = triangleWave(var1 * (1 - cntrlMain)); triangle3 = triangleWave(1 / var1); }; signalflow2a( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, ( (sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 2a", inspect(i, -1, 1)))) ) with { Mic_2A_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); Mic_2A_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); micIN1 = Mic_2A_1 : Mic12Ainspect : HP1(50) : LP1(6000) * (1 - cntrlMic1); micIN2 = Mic_2A_2 : Mic22Ainspect : HP1(50) : LP1(6000) * (1 - cntrlMic2); SRSect1(x) = x : sampler(var1, (1 - memWriteDel2), (var2 + (diffHL * 1000)) / 261) : HP4(50) : delayfb(var1 / 2, 0); SRSect2(x) = x : sampler(var1, (memWriteLev + memWriteDel1) / 2, (290 - (diffHL * 90)) / 261) : HP4(50) : delayfb(var1, 0); SRSect3(x) = x : sampler(var1, (1 - memWriteDel1), ((var2 * 2) - (diffHL * 1000)) / 261) : HP4(50); SRSectBP1(x) = x : SRSect3 : BPsvftpt(diffHL * 400, (var2 / 2) * memWriteDel2); SRSectBP2(x) = x : SRSect3 : BPsvftpt((1 - diffHL) * 800, var2 * (1 - memWriteDel1)); SRSect4(x) = x : sampler(var1, 1, (250 + (diffHL * 20)) / 261); SRSect5(x) = x : sampler(var1, memWriteLev, .766283); SampleWriteLoop = loop ~ _ with { loop(fb) = ( ( SRSect1(fb) , SRSect2(fb) , SRSectBP1(fb) , SRSectBP2(fb) :> _ ) * (cntrlFeed * memWriteLev) ) <: ( _ + (micIN1 + micIN2) : _ * triangle1 ), _ , SRSect4(fb) , SRSect5(fb) , SRSect3(fb) ; }; sig1 = micIN1 * directLevel; sig2 = micIN2 * directLevel; sampWOut = SampleWriteLoop : \(A,B,C,D,E).( A ); variabledelaysig3(x) = x : de.delay( max(0, ba.sec2samp(.05)), max(0, int(ba.sec2samp(.05 * cntrlMain))) ); sig3 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev : variabledelaysig3 * triangle2 * directLevel; sig4 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev * (1-triangle2) * directLevel; sig5 = SampleWriteLoop : \(A,B,C,D,E).( C ) : HP4(50) : delayfb(var1 / 3, 0); sig6 = SampleWriteLoop : \(A,B,C,D,E).( D ) : HP4(50) : delayfb(var1 / 2.5, 0); sig7 = SampleWriteLoop : \(A,B,C,D,E).( E ) : delayfb(var1 / 1.5, 0) * directLevel; }; signalflow2b( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 with { grainOut1 = granular_sampling(var1, timeIndex1, memWriteDel1, cntrlLev1, 21, sampWOut); grainOut2 = granular_sampling(var1, timeIndex2, memWriteDel2, cntrlLev2, 20, sampWOut); out1 = ( ((sig5 : delayfb(.040, 0)) * (1 - triangle3)), (sig5 * triangle3), ((sig6 : delayfb(.036, 0)) * (1 - triangle3)), ((sig6 : delayfb(.036, 0)) * triangle3 ), sig1, 0, sig4, grainOut1 * (1 - memWriteLev) + grainOut2 * memWriteLev ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); out2 = ( (sig5 * (1 - triangle3)), ((sig5 : delayfb(.040, 0)) * triangle3), (sig6 * (1 - triangle3)), (sig6 * triangle3), sig2, sig3, sig7, grainOut1 * memWriteLev + grainOut2 * (1 - memWriteLev) ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); }; signalflow3( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 ) = grainOut1, grainOut2, ( ( out1, out2, ( out2 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb(var4 / 344, 0)), ( out2 : delayfb(var4 / 344, 0)) ) : vgroup("System Inspectors", par(i, 6, hgroup("Signal Flow 3", inspect(i, -1, 1))) ) ), mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7;
28213471f2c93f1302d260ebc796260919b2cabdabaf64e9b8543b926e66b4a0
LucaSpanedda/Audible-Ecosystemics-2
IR_Tests.dsp
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "alpha"; declare description " 2022 version - Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; // import faust standard library import("stdfaust.lib"); // PERFORMANCE SYSTEM VARIABLES SampleRate = 44100; var1 = 20; var2 = 2000; var3 = 0.5; var4 = 20; //------- ------------- ----- ----------- //-- TEST IR ------------------------------------------------------------------- //------- -------- // ------------------------------------------------------------------------ // TEST risposte : // per tutti gli esempi: 44.1 kHz,16 bit, mono // segnale di test // pulse1.wav = 1 secondo di campioni = 0, poi 1 campione = 1, poi 1 secondo di campioni = 0 // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // pulse hp1.dsp - pulse hp1.wav = hipass ordine1, cf 50 hz // process = (1-1')@ma.SR : HPButterworthN(1, 50); // pulse lp1.dsp - pulse lp1.wav = lopass ordine1, cf 6000 hz // process = (1-1')@ma.SR : LPButterworthN(1, 6000); // pulse hp2.dsp - pulse hp2.wav = hipass ordine2, cf 50 hz // process = (1-1')@ma.SR : HPButterworthN(2, 50); // pulse hp2-lp1-envF.dsp - pulse hp2-lp1-envF.wav = ...., envFoll 0.01 // process = (1-1')@ma.SR : HPButterworthN(2, 50) : // LPButterworthN(1, 6000) : integrator(.01); // pulse hp2-lp1-envF-delFB.dsp - pulse hp2-lp1-envF-delFB.wav = ..., delFB time 0.01 fb 0.995 // process = (1-1')@ma.SR : HPButterworthN(2, 50) : // LPButterworthN(1, 6000) : integrator(.01) : // delayfb(.01,.995); // pulse lp4(0.5).dsp - pulse lp4(0.5).wav = lopass ordine4, fc 0.5 hz (mezzo hz) // process = (1-1')@ma.SR : LPButterworthN(4, .5); // pulse lp4(0.04).dsp - pulse lp4(0.04).wav = ..., lopass ordine 4, cf 0.04 hz (4 centesimi di hz) // process = (1-1')@ma.SR : LPButterworthN(4, .04); // pulse hp2-lp1-envF-delFB-lp4(0.5).dsp - pulse hp2-lp1-envF-delFB-lp4(0.5).wav = ..., lopass ordine 4, cf 0.5 (mezzo hz) // process = (1-1')@ma.SR : HPButterworthN(2, 50) : // LPButterworthN(1, 6000) : integrator(.01) : // delayfb(.01,.995) : LPButterworthN(4, .5); // pulse hp2-lp1-envF-delFB-lp4(0.04).dsp - pulse hp2-lp1-envF-delFB-lp4(0.04).wav = ..., lopass ordine 4, cf 0.04 (4 centesimi di hz) // process = (1-1')@ma.SR : HPButterworthN(2, 50) : // LPButterworthN(1, 6000) : integrator(.01) : // delayfb(.01,.995) : LPButterworthN(4, .04); // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // SINE CntrlMic TEST risposte : // sine1000.wav = 1 secondo di sinusoide a 1 kHz, -34 dB // risposte // sine1000-CntrlMic1(partitura).dsp - sine1000-CntrlMic1(partitura).wav = tutta la catena di cntrlMic come in partitura // sine1000-CntrlMic1(alternativa).dsp - sine1000-CntrlMic1(alternativa).wav = tutta la catena di cntrlMic con parametri alternativi // ovvero: hp ordine 2, delay feedback 0.995, lp ord 4 fc 0.04 hz, e con pow^2 alla fine // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ sig1ktest = os.osc(1000) * ba.db2linear(-34) * (1 - [email protected]); // process = sig1ktest; cntrlMicOtiginal(x) = x : HPButterworthN(1, 50) : LPButterworthN(1, 6000) : integrator(.01) : delayfb(.01,.999) : LPButterworthN(5, .5); // process = sig1ktest : cntrlMicOtiginal; cntrlMicModified(x) = x : HPButterworthN(2, 50) : LPButterworthN(1, 6000) : integrator(.01) : delayfb(.01,.995) : LPButterworthN(4, .04) : \(y).(y*y); // process = sig1ktest : cntrlMicModified; //------- ------------- ----- ----------- //-- LIBRARY ------------------------------------------------------------------- //------- -------- //----------------------------------------------------------------- UTILITIES -- // limit function for library and system limit(maxl,minl,x) = x : max(minl, min(maxl)); // see signal values inspect(i, lower, upper) = _ <: _ , vbargraph("sig_%2i [style:numerical]", lower, upper) : attach; //process = (os.osc(.01) : inspect(1, .1, -1, 1)); diffDebug(x) = an.abs_envelope_tau(1, (x-x')) * (SampleRate/2); //-------------------------------------------------------------------- DELAYS -- delayfb(delSec,fb,x) = loop ~ _ : mem with{ loop(z) = ( (z * fb + x) @(ba.sec2samp(delSec)-1) ); }; //---------------------------------------------------------------- SAMPLEREAD -- sampler(bufferLength, memChunk, ratio, x) = y with { y = it.frwtable(3, L, .0, writePtr, x, readPtr * memChunkLock * L) * trapezoidal(.95, readPtr) with { memChunkLimited = max(.100, min(1.0, memChunk)); L = bufferLength * SampleRate; // hard-coded: change this to match your samplerate writePtr = ba.period(L); readPtr = phasor : _ , !; memChunkLock = phasor : ! , _; phasor = loop ~ si.bus(3) : _ , ! , _ with { loop(phState, incrState, chunkLenState) = ph , incr , chunkLen with { ph = ba.if(phState < 1.0, phState + incrState, 0.0); unlock = phState < phState' + 1 - 1'; incr = ba.if( unlock, ma.T * max(.1, min(10.0, ratio)) / max(ma.T, (memChunkLimited * bufferLength)), incrState); chunkLen = ba.if(unlock, memChunkLimited, chunkLenState); }; }; trapezoidal(width, ph) = min(1.0, abs(ma.decimal(ph + .5) * 2.0 - 1.0) / max(ma.EPSILON, 1.0 - width)); }; }; // process = sampleRead( 1, hslider("chnk",0,0,1,.001), // hslider("rati",1,0,2,.001), os.osc(200)) <: _,_; //--------------------------------------------------------------- INTEGRATOR --- integrator(seconds, x) = an.abs_envelope_tau(limit(1000,.001,seconds), x); //----------------------------------------------------------------- LOCALMAX --- localMax(seconds, x) = loop ~ si.bus(4) : _ , ! , ! , ! with { loop(yState, timerState, peakState, timeInSamplesState) = y , timer , peak , timeInSamples with { timeInSamples = ba.if(reset + 1 - 1', seconds * ma.SR, timeInSamplesState); reset = timerState >= (timeInSamplesState - 1); timer = ba.if(reset, 1, timerState + 1); peak = max(abs(x), peakState * (1.0 - reset)); y = ba.if(reset, peak', yState); }; }; //process = os.osc(.1245) : localMax(hslider("windowlocalM",-1,-1,8,.001)); localmax(resetPeriod, x) = localMax(limit(1000,0,resetPeriod), x); //----------------------------------------------------------------- TRIANGLE --- triangularFunc(x) = abs(ma.frac((x - .5)) * 2.0 - 1.0); triangleWave(f) = triangularFunc(os.phasor(1,f)); //------------------------------------------------------------------ FILTERS --- onePoleTPT(cf, x) = loop ~ _ : ! , si.bus(3) with { g = tan(cf * ma.PI * (1/ma.SR)); G = g / (1.0 + g); loop(s) = u , lp , hp , ap with { v = (x - s) * G; u = v + lp; lp = v + s; hp = x - lp; ap = lp - hp; }; }; LPTPT(cf, x) = onePoleTPT(limit(20000,ma.EPSILON,cf), x) : (_ , ! , !); HPTPT(cf, x) = onePoleTPT(limit(20000,ma.EPSILON,cf), x) : (! , _ , !); // TEST // process = (-100, no.noise) : HPTPT; SVFTPT(K, Q, CF, x) = circuitout : ! , ! , _ , _ , _ , _ , _ , _ , _ , _ with{ g = tan(CF * ma.PI / ma.SR); R = 1.0 / (2.0 * Q); G1 = 1.0 / (1.0 + 2.0 * R * g + g * g); G2 = 2.0 * R + g; circuit(s1, s2) = u1 , u2 , lp , hp , bp, notch, apf, ubp, peak, bshelf with{ hp = (x - s1 * G2 - s2) * G1; v1 = hp * g; bp = s1 + v1; v2 = bp * g; lp = s2 + v2; u1 = v1 + bp; u2 = v2 + lp; notch = x - ((2*R)*bp); apf = x - ((4*R)*bp); ubp = ((2*R)*bp); peak = lp -hp; bshelf = x + (((2*K)*R)*bp); }; // choose the output from the SVF Filter (ex. bshelf) circuitout = circuit ~ si.bus(2); }; // Outs = (lp , hp , bp, notch, apf, ubp, peak, bshelf) // SVFTPT(K, Q, CF, x) = (Filter-K, Filter-Q, Frequency Cut) // Filters Bank LPSVF(Q, CF, x) = SVFTPT(0, Q, limit(20000,ma.EPSILON,CF), x) : _ , ! , ! , ! , ! , ! , ! , ! ; HPSVF(Q, CF, x) = SVFTPT(0, Q, limit(20000,ma.EPSILON,CF), x) : ! , _ , ! , ! , ! , ! , ! , !; //process = (-1, -10000, no.noise) <: LPSVF, HPSVF; BPsvftpt(BW, CF, x) = SVFTPT(0 : ba.db2linear, ql, cfl, x ) : ! , ! , ! , ! , !, _ , ! , ! with{ cfl = limit(20000,ma.EPSILON,CF); bwl = limit(20000,ma.EPSILON,BW); ql = cfl / bwl; }; // TEST //process = (1, 1000, no.noise) : BPsvftpt; // Butterworth butterworthQ(order, stage) = qFactor(order % 2) with { qFactor(0) = 1.0 / (2.0 * cos(((2.0 * stage + 1) * (ma.PI / (order * 2.0))))); qFactor(1) = 1.0 / (2.0 * cos(((stage + 1) * (ma.PI / order)))); }; LPButterworthN(1, cf, x) = LPTPT(cf, x); LPButterworthN(N, cf, x) = cascade(N % 2) with { cascade(0) = x : seq(i, N / 2, LPSVF(butterworthQ(N, i), cf)); cascade(1) = x : LPTPT(cf) : seq(i, (N - 1) / 2, LPSVF(butterworthQ(N, i), cf)); }; HPButterworthN(1, cf, x) = HPTPT(cf, x); HPButterworthN(N, cf, x) = cascade(N % 2) with { cascade(0) = x : seq(i, N / 2, HPSVF(butterworthQ(N, i), cf)); cascade(1) = x : HPTPT(cf) : seq(i, (N - 1) / 2, HPSVF(butterworthQ(N, i), cf)); }; //process = HPButterworthN(10, -1000, no.noise), // LPButterworthN(10, -1000, no.noise); //-------------------------------------------------------- GRANULAR SAMPLING --- grain(L, position, duration, x, trigger) = hann(phase) * buffer(readPtr, x) with { maxLength = 1920000; length = L * ma.SR; hann(ph) = sin(ma.PI * ph) ^ 2.0; lineSegment = loop ~ si.bus(2) : _ , ! , _ with { loop(yState, incrementState) = y , increment , ready with { ready = ((yState == 0.0) | (yState == 1.0)) & trigger; y = ba.if(ready, increment, min(1.0, yState + increment)); increment = ba.if(ready, ma.T / max(ma.T, duration), incrementState); }; }; phase = lineSegment : _ , !; unlocking = lineSegment : ! , _; lock(param) = ba.sAndH(unlocking, param); grainPosition = lock(position); grainDuration = lock(duration); readPtr = grainPosition * length + phase * grainDuration * ma.SR; buffer(readPtr, x) = it.frwtable(3, maxLength, .0, writePtr, x, readPtrWrapped) with { writePtr = ba.period(length); readPtrWrapped = ma.modulo(readPtr, length); }; }; // works for N >= 2 triggerArray(N, rate) = loop ~ si.bus(3) : (! , ! , _) <: par(i, N, == (i)) : par(i, N, \(x).(x > x')) with { loop(incrState, phState, counterState) = incr , ph , counter with { init = 1 - 1'; trigger = (phState < phState') + init; incr = ba.if(trigger, rate * ma.T, incrState); ph = ma.frac(incr + phState); counter = (trigger + counterState) % N; }; }; grainN(voices, L, position, rate, duration, x) = triggerArray(voices, rate) : par(i, voices, grain(L, position, duration, x)); granular_sampling(var1, timeIndex, memWriteDel, cntrlLev, divDur, x) = grainN(8, var1, position, rate, duration, x) :> /(8) with { rnd = no.noise; memPointerJitter = rnd * (1.0 - memWriteDel) * .01; position = timeIndex * (1.0 - ((1.0 - memWriteDel) * .01)) + memPointerJitter; density = 1.0 - cntrlLev; rate = 50 ^ (density * 2.0 - 1.0); grainDuration = .023 + (1.0 - memWriteDel) / divDur; duration = grainDuration + grainDuration * .1 * rnd; };
https://raw.githubusercontent.com/LucaSpanedda/Audible-Ecosystemics-2/c4be0f10b765b5466fe87fbe42afaab5cfd37793/IR_Tests/IR_Tests.dsp
faust
import faust standard library PERFORMANCE SYSTEM VARIABLES ------- ------------- ----- ----------- -- TEST IR ------------------------------------------------------------------- ------- -------- ------------------------------------------------------------------------ TEST risposte : per tutti gli esempi: 44.1 kHz,16 bit, mono segnale di test pulse1.wav = 1 secondo di campioni = 0, poi 1 campione = 1, poi 1 secondo di campioni = 0 ------------------------------------------------------------------------ ------------------------------------------------------------------------ pulse hp1.dsp - pulse hp1.wav = hipass ordine1, cf 50 hz process = (1-1')@ma.SR : HPButterworthN(1, 50); pulse lp1.dsp - pulse lp1.wav = lopass ordine1, cf 6000 hz process = (1-1')@ma.SR : LPButterworthN(1, 6000); pulse hp2.dsp - pulse hp2.wav = hipass ordine2, cf 50 hz process = (1-1')@ma.SR : HPButterworthN(2, 50); pulse hp2-lp1-envF.dsp - pulse hp2-lp1-envF.wav = ...., envFoll 0.01 process = (1-1')@ma.SR : HPButterworthN(2, 50) : LPButterworthN(1, 6000) : integrator(.01); pulse hp2-lp1-envF-delFB.dsp - pulse hp2-lp1-envF-delFB.wav = ..., delFB time 0.01 fb 0.995 process = (1-1')@ma.SR : HPButterworthN(2, 50) : LPButterworthN(1, 6000) : integrator(.01) : delayfb(.01,.995); pulse lp4(0.5).dsp - pulse lp4(0.5).wav = lopass ordine4, fc 0.5 hz (mezzo hz) process = (1-1')@ma.SR : LPButterworthN(4, .5); pulse lp4(0.04).dsp - pulse lp4(0.04).wav = ..., lopass ordine 4, cf 0.04 hz (4 centesimi di hz) process = (1-1')@ma.SR : LPButterworthN(4, .04); pulse hp2-lp1-envF-delFB-lp4(0.5).dsp - pulse hp2-lp1-envF-delFB-lp4(0.5).wav = ..., lopass ordine 4, cf 0.5 (mezzo hz) process = (1-1')@ma.SR : HPButterworthN(2, 50) : LPButterworthN(1, 6000) : integrator(.01) : delayfb(.01,.995) : LPButterworthN(4, .5); pulse hp2-lp1-envF-delFB-lp4(0.04).dsp - pulse hp2-lp1-envF-delFB-lp4(0.04).wav = ..., lopass ordine 4, cf 0.04 (4 centesimi di hz) process = (1-1')@ma.SR : HPButterworthN(2, 50) : LPButterworthN(1, 6000) : integrator(.01) : delayfb(.01,.995) : LPButterworthN(4, .04); ------------------------------------------------------------------------ ------------------------------------------------------------------------ SINE CntrlMic TEST risposte : sine1000.wav = 1 secondo di sinusoide a 1 kHz, -34 dB risposte sine1000-CntrlMic1(partitura).dsp - sine1000-CntrlMic1(partitura).wav = tutta la catena di cntrlMic come in partitura sine1000-CntrlMic1(alternativa).dsp - sine1000-CntrlMic1(alternativa).wav = tutta la catena di cntrlMic con parametri alternativi ovvero: hp ordine 2, delay feedback 0.995, lp ord 4 fc 0.04 hz, e con pow^2 alla fine ------------------------------------------------------------------------ ------------------------------------------------------------------------ process = sig1ktest; process = sig1ktest : cntrlMicOtiginal; process = sig1ktest : cntrlMicModified; ------- ------------- ----- ----------- -- LIBRARY ------------------------------------------------------------------- ------- -------- ----------------------------------------------------------------- UTILITIES -- limit function for library and system see signal values process = (os.osc(.01) : inspect(1, .1, -1, 1)); -------------------------------------------------------------------- DELAYS -- ---------------------------------------------------------------- SAMPLEREAD -- hard-coded: change this to match your samplerate process = sampleRead( 1, hslider("chnk",0,0,1,.001), hslider("rati",1,0,2,.001), os.osc(200)) <: _,_; --------------------------------------------------------------- INTEGRATOR --- ----------------------------------------------------------------- LOCALMAX --- process = os.osc(.1245) : localMax(hslider("windowlocalM",-1,-1,8,.001)); ----------------------------------------------------------------- TRIANGLE --- ------------------------------------------------------------------ FILTERS --- TEST process = (-100, no.noise) : HPTPT; choose the output from the SVF Filter (ex. bshelf) Outs = (lp , hp , bp, notch, apf, ubp, peak, bshelf) SVFTPT(K, Q, CF, x) = (Filter-K, Filter-Q, Frequency Cut) Filters Bank process = (-1, -10000, no.noise) <: LPSVF, HPSVF; TEST process = (1, 1000, no.noise) : BPsvftpt; Butterworth process = HPButterworthN(10, -1000, no.noise), LPButterworthN(10, -1000, no.noise); -------------------------------------------------------- GRANULAR SAMPLING --- works for N >= 2
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "alpha"; declare description " 2022 version - Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; import("stdfaust.lib"); SampleRate = 44100; var1 = 20; var2 = 2000; var3 = 0.5; var4 = 20; sig1ktest = os.osc(1000) * ba.db2linear(-34) * (1 - [email protected]); cntrlMicOtiginal(x) = x : HPButterworthN(1, 50) : LPButterworthN(1, 6000) : integrator(.01) : delayfb(.01,.999) : LPButterworthN(5, .5); cntrlMicModified(x) = x : HPButterworthN(2, 50) : LPButterworthN(1, 6000) : integrator(.01) : delayfb(.01,.995) : LPButterworthN(4, .04) : \(y).(y*y); limit(maxl,minl,x) = x : max(minl, min(maxl)); inspect(i, lower, upper) = _ <: _ , vbargraph("sig_%2i [style:numerical]", lower, upper) : attach; diffDebug(x) = an.abs_envelope_tau(1, (x-x')) * (SampleRate/2); delayfb(delSec,fb,x) = loop ~ _ : mem with{ loop(z) = ( (z * fb + x) @(ba.sec2samp(delSec)-1) ); }; sampler(bufferLength, memChunk, ratio, x) = y with { y = it.frwtable(3, L, .0, writePtr, x, readPtr * memChunkLock * L) * trapezoidal(.95, readPtr) with { memChunkLimited = max(.100, min(1.0, memChunk)); writePtr = ba.period(L); readPtr = phasor : _ , !; memChunkLock = phasor : ! , _; phasor = loop ~ si.bus(3) : _ , ! , _ with { loop(phState, incrState, chunkLenState) = ph , incr , chunkLen with { ph = ba.if(phState < 1.0, phState + incrState, 0.0); unlock = phState < phState' + 1 - 1'; incr = ba.if( unlock, ma.T * max(.1, min(10.0, ratio)) / max(ma.T, (memChunkLimited * bufferLength)), incrState); chunkLen = ba.if(unlock, memChunkLimited, chunkLenState); }; }; trapezoidal(width, ph) = min(1.0, abs(ma.decimal(ph + .5) * 2.0 - 1.0) / max(ma.EPSILON, 1.0 - width)); }; }; integrator(seconds, x) = an.abs_envelope_tau(limit(1000,.001,seconds), x); localMax(seconds, x) = loop ~ si.bus(4) : _ , ! , ! , ! with { loop(yState, timerState, peakState, timeInSamplesState) = y , timer , peak , timeInSamples with { timeInSamples = ba.if(reset + 1 - 1', seconds * ma.SR, timeInSamplesState); reset = timerState >= (timeInSamplesState - 1); timer = ba.if(reset, 1, timerState + 1); peak = max(abs(x), peakState * (1.0 - reset)); y = ba.if(reset, peak', yState); }; }; localmax(resetPeriod, x) = localMax(limit(1000,0,resetPeriod), x); triangularFunc(x) = abs(ma.frac((x - .5)) * 2.0 - 1.0); triangleWave(f) = triangularFunc(os.phasor(1,f)); onePoleTPT(cf, x) = loop ~ _ : ! , si.bus(3) with { g = tan(cf * ma.PI * (1/ma.SR)); G = g / (1.0 + g); loop(s) = u , lp , hp , ap with { v = (x - s) * G; u = v + lp; lp = v + s; hp = x - lp; ap = lp - hp; }; }; LPTPT(cf, x) = onePoleTPT(limit(20000,ma.EPSILON,cf), x) : (_ , ! , !); HPTPT(cf, x) = onePoleTPT(limit(20000,ma.EPSILON,cf), x) : (! , _ , !); SVFTPT(K, Q, CF, x) = circuitout : ! , ! , _ , _ , _ , _ , _ , _ , _ , _ with{ g = tan(CF * ma.PI / ma.SR); R = 1.0 / (2.0 * Q); G1 = 1.0 / (1.0 + 2.0 * R * g + g * g); G2 = 2.0 * R + g; circuit(s1, s2) = u1 , u2 , lp , hp , bp, notch, apf, ubp, peak, bshelf with{ hp = (x - s1 * G2 - s2) * G1; v1 = hp * g; bp = s1 + v1; v2 = bp * g; lp = s2 + v2; u1 = v1 + bp; u2 = v2 + lp; notch = x - ((2*R)*bp); apf = x - ((4*R)*bp); ubp = ((2*R)*bp); peak = lp -hp; bshelf = x + (((2*K)*R)*bp); }; circuitout = circuit ~ si.bus(2); }; LPSVF(Q, CF, x) = SVFTPT(0, Q, limit(20000,ma.EPSILON,CF), x) : _ , ! , ! , ! , ! , ! , ! , ! ; HPSVF(Q, CF, x) = SVFTPT(0, Q, limit(20000,ma.EPSILON,CF), x) : ! , _ , ! , ! , ! , ! , ! , !; BPsvftpt(BW, CF, x) = SVFTPT(0 : ba.db2linear, ql, cfl, x ) : ! , ! , ! , ! , !, _ , ! , ! with{ cfl = limit(20000,ma.EPSILON,CF); bwl = limit(20000,ma.EPSILON,BW); ql = cfl / bwl; }; butterworthQ(order, stage) = qFactor(order % 2) with { qFactor(0) = 1.0 / (2.0 * cos(((2.0 * stage + 1) * (ma.PI / (order * 2.0))))); qFactor(1) = 1.0 / (2.0 * cos(((stage + 1) * (ma.PI / order)))); }; LPButterworthN(1, cf, x) = LPTPT(cf, x); LPButterworthN(N, cf, x) = cascade(N % 2) with { cascade(0) = x : seq(i, N / 2, LPSVF(butterworthQ(N, i), cf)); cascade(1) = x : LPTPT(cf) : seq(i, (N - 1) / 2, LPSVF(butterworthQ(N, i), cf)); }; HPButterworthN(1, cf, x) = HPTPT(cf, x); HPButterworthN(N, cf, x) = cascade(N % 2) with { cascade(0) = x : seq(i, N / 2, HPSVF(butterworthQ(N, i), cf)); cascade(1) = x : HPTPT(cf) : seq(i, (N - 1) / 2, HPSVF(butterworthQ(N, i), cf)); }; grain(L, position, duration, x, trigger) = hann(phase) * buffer(readPtr, x) with { maxLength = 1920000; length = L * ma.SR; hann(ph) = sin(ma.PI * ph) ^ 2.0; lineSegment = loop ~ si.bus(2) : _ , ! , _ with { loop(yState, incrementState) = y , increment , ready with { ready = ((yState == 0.0) | (yState == 1.0)) & trigger; y = ba.if(ready, increment, min(1.0, yState + increment)); increment = ba.if(ready, ma.T / max(ma.T, duration), incrementState); }; }; phase = lineSegment : _ , !; unlocking = lineSegment : ! , _; lock(param) = ba.sAndH(unlocking, param); grainPosition = lock(position); grainDuration = lock(duration); readPtr = grainPosition * length + phase * grainDuration * ma.SR; buffer(readPtr, x) = it.frwtable(3, maxLength, .0, writePtr, x, readPtrWrapped) with { writePtr = ba.period(length); readPtrWrapped = ma.modulo(readPtr, length); }; }; triggerArray(N, rate) = loop ~ si.bus(3) : (! , ! , _) <: par(i, N, == (i)) : par(i, N, \(x).(x > x')) with { loop(incrState, phState, counterState) = incr , ph , counter with { init = 1 - 1'; trigger = (phState < phState') + init; incr = ba.if(trigger, rate * ma.T, incrState); ph = ma.frac(incr + phState); counter = (trigger + counterState) % N; }; }; grainN(voices, L, position, rate, duration, x) = triggerArray(voices, rate) : par(i, voices, grain(L, position, duration, x)); granular_sampling(var1, timeIndex, memWriteDel, cntrlLev, divDur, x) = grainN(8, var1, position, rate, duration, x) :> /(8) with { rnd = no.noise; memPointerJitter = rnd * (1.0 - memWriteDel) * .01; position = timeIndex * (1.0 - ((1.0 - memWriteDel) * .01)) + memPointerJitter; density = 1.0 - cntrlLev; rate = 50 ^ (density * 2.0 - 1.0); grainDuration = .023 + (1.0 - memWriteDel) / divDur; duration = grainDuration + grainDuration * .1 * rnd; };
beb740695150f34705e3af8b0557abb5bdec9bcdbdab46ec41958ba598bfe27a
LucaSpanedda/Audible-Ecosystemics-2
Audible_Ecosystemics_2.dsp
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "alpha"; declare description " 2022 version - Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; // import faust standard library import("stdfaust.lib"); // import audible ecosystemics objects library import("aelibrary.lib"); // PERFORMANCE SYSTEM VARIABLES SampleRate = 44100; var1 = hgroup("System Variables", nentry("Var 1", 8.0, 1, 20, 1)); var2 = hgroup("System Variables", nentry("Var 2", 50, 1, 10000, 1)); var3 = hgroup("System Variables", nentry("Var 3", .25, 0, 1, .001)); var4 = hgroup("System Variables", nentry("Var 4", 8.2, 1, 20, 1)); //------- ------------- ----- ----------- //-- AE2 ----------------------------------------------------------------------- //------- -------- // MAIN SYSTEM FUNCTION outputrouting(grainOut1, grainOut2, out1, out2, out3, out4, out5, out6, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) = out1, out2, out3, out4, out5, out6; // choose here the signals in output process = si.bus(8) :> par(i, 4, _ * vgroup("Mixer ON/OFF", checkbox("mute/unmute"))) : (signalflow1a : signalflow1b : signalflow2a : signalflow2b : signalflow3) ~ si.bus(2) : outputrouting; signalflow1a( grainOut1, grainOut2, mic1, mic2, mic3, mic4 ) = grainOut1, grainOut2, mic1, mic2, mic3, mic4, ( (diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1a", inspect(i, -1, 1)))) ) with { Mic_1A_1 = mic3 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); Mic_1A_2 = mic4 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); map6sumx6 = (Mic_1A_1 : integrator(.01) : delayfb(.01, .95)) + (Mic_1A_2 : integrator(.01) : delayfb(.01, .95)) : \(x).(6 + x * 6); localMaxDiff = ((map6sumx6, Mic_1A_1) : localmax) , ((map6sumx6, Mic_1A_2) : localmax) : \(x, y).(x - y); SenstoExt = (map6sumx6, localMaxDiff) : localmax <: _ , (_ : delayfb(12, 0)) : + : * (.5) : LP1(.5) : vgroup("System Inspectors", hgroup("Signal Flow 1a", hgroup("Sens. to Ext. Cond.", inspect(101, -1, 1)))); diffHL = ((Mic_1A_1 + Mic_1A_2) : HP3(var2) : integrator(.05)) , ((Mic_1A_1 + Mic_1A_2) : LP3(var2) : integrator(.10)) : \(x, y).((x - y) : vgroup("System Inspectors", hgroup("Signal Flow 1a", hgroup("diffHL Centroid", inspect(100, -1, 1))))) * (1 - SenstoExt) : delayfb(.01, .995) : LP5(25) : \(x).(.5 + x * .5) : // LIMIT - max - min limit(1, 0); memWriteLev = (Mic_1A_1 + Mic_1A_2 : MicSum1Ainspect) : integrator(.1) : delayfb(.01, .9) : LP5(25) : \(x).(1 - (x * x)) : // LIMIT - max - min limit(1, 0); memWriteDel1 = memWriteLev : delayfb((var1 / 2), 0) : // LIMIT - max - min limit(1, 0); memWriteDel2 = memWriteLev : delayfb((var1 / 3), 0) : // LIMIT - max - min limit(1, 0); cntrlMain = (Mic_1A_1 + Mic_1A_2) * SenstoExt : integrator(.01) : delayfb(.01, .995) : LP5(25) : // LIMIT - max - min limit(1, 0); cntrlLev1 = cntrlMain : delayfb((var1 / 3), 0) : // LIMIT - max - min limit(1, 0); cntrlLev2 = cntrlMain : delayfb((var1 / 2), 0) : // LIMIT - max - min limit(1, 0); cntrlFeed = cntrlMain : \(x).(ba.if(x <= .5, 1.0, (1.0 - x) * 2.0)) : // LIMIT - max - min limit(1, 0); }; signalflow1b( grainOut1, grainOut2, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, ( (cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1b", inspect(i, -1, 1)))) ) with { Mic_1B_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); Mic_1B_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); // cntrlMic - original version cntrlMic(x) = x : HP1(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.5); // cntrlMic - alternative version // cntrlMic(x) = x : HP2(50) : LP1(6000) : // integrator(.01) : delayfb(.01, .995) : LP5(.04); cntrlMic1 = Mic_1B_1 : Mic11Binspect : cntrlMic : // LIMIT - max - min limit(1, 0); cntrlMic2 = Mic_1B_2 : Mic21Binspect : cntrlMic : // LIMIT - max - min limit(1, 0); directLevel = (grainOut1 + grainOut2) : integrator(.01) : delayfb(.01, .97) : LP5(.5) <: _ , (_ : delayfb(var1 * 2, (1 - var3) * 0.5)) : + : \(x).(1 - x * .5) : // LIMIT - max - min limit(1, 0); timeIndex1 = triangleWave(1 / (var1 * 2)) : \(x).((x - 2) * 0.5); timeIndex2 = triangleWave(1 / (var1 * 2)) : \(x).((x + 1) * 0.5); triangle1 = triangleWave(1 / (var1 * 6)) * memWriteLev; triangle2 = triangleWave(var1 * (1 - cntrlMain)); triangle3 = triangleWave(1 / var1); }; signalflow2a( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, ( (sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 2a", inspect(i, -1, 1)))) ) with { Mic_2A_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); Mic_2A_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); micIN1 = Mic_2A_1 : Mic12Ainspect : HP1(50) : LP1(6000) * (1 - cntrlMic1); micIN2 = Mic_2A_2 : Mic22Ainspect : HP1(50) : LP1(6000) * (1 - cntrlMic2); SRSect1(x) = x : sampler(var1, (1 - memWriteDel2), (var2 + (diffHL * 1000)) / 261) : HP4(50) : delayfb(var1 / 2, 0); SRSect2(x) = x : sampler(var1, (memWriteLev + memWriteDel1) / 2, (290 - (diffHL * 90)) / 261) : HP4(50) : delayfb(var1, 0); SRSect3(x) = x : sampler(var1, (1 - memWriteDel1), ((var2 * 2) - (diffHL * 1000)) / 261) : HP4(50); SRSectBP1(x) = x : SRSect3 : BPsvftpt(diffHL * 400, (var2 / 2) * memWriteDel2); SRSectBP2(x) = x : SRSect3 : BPsvftpt((1 - diffHL) * 800, var2 * (1 - memWriteDel1)); SRSect4(x) = x : sampler(var1, 1, (250 + (diffHL * 20)) / 261); SRSect5(x) = x : sampler(var1, memWriteLev, .766283); SampleWriteLoop = loop ~ _ with { loop(fb) = ( ( SRSect1(fb) , SRSect2(fb) , SRSectBP1(fb) , SRSectBP2(fb) :> _ ) * (cntrlFeed * memWriteLev) ) <: ( _ + (micIN1 + micIN2) : _ * triangle1 ), _ , SRSect4(fb) , SRSect5(fb) , SRSect3(fb) ; }; sig1 = micIN1 * directLevel; sig2 = micIN2 * directLevel; sampWOut = SampleWriteLoop : \(A,B,C,D,E).( A ); variabledelaysig3(x) = x : de.delay( max(0, ba.sec2samp(.05)), max(0, int(ba.sec2samp(.05 * cntrlMain))) ); sig3 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev : variabledelaysig3 * triangle2 * directLevel; sig4 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev * (1-triangle2) * directLevel; sig5 = SampleWriteLoop : \(A,B,C,D,E).( C ) : HP4(50) : delayfb(var1 / 3, 0); sig6 = SampleWriteLoop : \(A,B,C,D,E).( D ) : HP4(50) : delayfb(var1 / 2.5, 0); sig7 = SampleWriteLoop : \(A,B,C,D,E).( E ) : delayfb(var1 / 1.5, 0) * directLevel; }; signalflow2b( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 with { grainOut1 = granular_sampling(var1, timeIndex1, memWriteDel1, cntrlLev1, 21, sampWOut) : vgroup("System Inspectors", hgroup("Signal Flow 3", hgroup("Granular Sampling 1", inspect(180, -1, 1)))); grainOut2 = granular_sampling(var1, timeIndex2, memWriteDel2, cntrlLev2, 20, sampWOut) : vgroup("System Inspectors", hgroup("Signal Flow 3", hgroup("Granular Sampling 2", inspect(181, -1, 1)))); out1 = ( ((sig5 : delayfb(.040, 0)) * (1 - triangle3)), (sig5 * triangle3), ((sig6 : delayfb(.036, 0)) * (1 - triangle3)), ((sig6 : delayfb(.036, 0)) * triangle3 ), sig1, 0, sig4, grainOut1 * (1 - memWriteLev) + grainOut2 * memWriteLev ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); out2 = ( (sig5 * (1 - triangle3)), ((sig5 : delayfb(.040, 0)) * triangle3), (sig6 * (1 - triangle3)), (sig6 * triangle3), sig2, sig3, sig7, grainOut1 * memWriteLev + grainOut2 * (1 - memWriteLev) ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); }; signalflow3( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 ) = grainOut1, grainOut2, ( ( out1, out2, ( out2 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb(var4 / 344, 0)), ( out2 : delayfb(var4 / 344, 0)) ) : vgroup("System Inspectors", par(i, 6, hgroup("Signal Flow 3", inspect(i, -1, 1))) ) ), mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7;
https://raw.githubusercontent.com/LucaSpanedda/Audible-Ecosystemics-2/c4be0f10b765b5466fe87fbe42afaab5cfd37793/Compiled_15-2-2023_Audible_Ecosystemics_2/Audible_Ecosystemics_2.dsp
faust
import faust standard library import audible ecosystemics objects library PERFORMANCE SYSTEM VARIABLES ------- ------------- ----- ----------- -- AE2 ----------------------------------------------------------------------- ------- -------- MAIN SYSTEM FUNCTION choose here the signals in output LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min LIMIT - max - min cntrlMic - original version cntrlMic - alternative version cntrlMic(x) = x : HP2(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.04); LIMIT - max - min LIMIT - max - min LIMIT - max - min
declare name "Agostino Di Scipio - AUDIBLE ECOSYSTEMICS n.2"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare version "alpha"; declare description " 2022 version - Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; import("stdfaust.lib"); import("aelibrary.lib"); SampleRate = 44100; var1 = hgroup("System Variables", nentry("Var 1", 8.0, 1, 20, 1)); var2 = hgroup("System Variables", nentry("Var 2", 50, 1, 10000, 1)); var3 = hgroup("System Variables", nentry("Var 3", .25, 0, 1, .001)); var4 = hgroup("System Variables", nentry("Var 4", 8.2, 1, 20, 1)); outputrouting(grainOut1, grainOut2, out1, out2, out3, out4, out5, out6, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) = process = si.bus(8) :> par(i, 4, _ * vgroup("Mixer ON/OFF", checkbox("mute/unmute"))) : (signalflow1a : signalflow1b : signalflow2a : signalflow2b : signalflow3) ~ si.bus(2) : outputrouting; signalflow1a( grainOut1, grainOut2, mic1, mic2, mic3, mic4 ) = grainOut1, grainOut2, mic1, mic2, mic3, mic4, ( (diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1a", inspect(i, -1, 1)))) ) with { Mic_1A_1 = mic3 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); Mic_1A_2 = mic4 * hgroup( "Mixer", hgroup( "Signal Flow 1A", gainMic_1A) ); map6sumx6 = (Mic_1A_1 : integrator(.01) : delayfb(.01, .95)) + (Mic_1A_2 : integrator(.01) : delayfb(.01, .95)) : \(x).(6 + x * 6); localMaxDiff = ((map6sumx6, Mic_1A_1) : localmax) , ((map6sumx6, Mic_1A_2) : localmax) : \(x, y).(x - y); SenstoExt = (map6sumx6, localMaxDiff) : localmax <: _ , (_ : delayfb(12, 0)) : + : * (.5) : LP1(.5) : vgroup("System Inspectors", hgroup("Signal Flow 1a", hgroup("Sens. to Ext. Cond.", inspect(101, -1, 1)))); diffHL = ((Mic_1A_1 + Mic_1A_2) : HP3(var2) : integrator(.05)) , ((Mic_1A_1 + Mic_1A_2) : LP3(var2) : integrator(.10)) : \(x, y).((x - y) : vgroup("System Inspectors", hgroup("Signal Flow 1a", hgroup("diffHL Centroid", inspect(100, -1, 1))))) * (1 - SenstoExt) : delayfb(.01, .995) : LP5(25) : \(x).(.5 + x * .5) : limit(1, 0); memWriteLev = (Mic_1A_1 + Mic_1A_2 : MicSum1Ainspect) : integrator(.1) : delayfb(.01, .9) : LP5(25) : \(x).(1 - (x * x)) : limit(1, 0); memWriteDel1 = memWriteLev : delayfb((var1 / 2), 0) : limit(1, 0); memWriteDel2 = memWriteLev : delayfb((var1 / 3), 0) : limit(1, 0); cntrlMain = (Mic_1A_1 + Mic_1A_2) * SenstoExt : integrator(.01) : delayfb(.01, .995) : LP5(25) : limit(1, 0); cntrlLev1 = cntrlMain : delayfb((var1 / 3), 0) : limit(1, 0); cntrlLev2 = cntrlMain : delayfb((var1 / 2), 0) : limit(1, 0); cntrlFeed = cntrlMain : \(x).(ba.if(x <= .5, 1.0, (1.0 - x) * 2.0)) : limit(1, 0); }; signalflow1b( grainOut1, grainOut2, mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, ( (cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 1b", inspect(i, -1, 1)))) ) with { Mic_1B_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); Mic_1B_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 1B", gainMic_1B) ); cntrlMic(x) = x : HP1(50) : LP1(6000) : integrator(.01) : delayfb(.01, .995) : LP5(.5); cntrlMic1 = Mic_1B_1 : Mic11Binspect : cntrlMic : limit(1, 0); cntrlMic2 = Mic_1B_2 : Mic21Binspect : cntrlMic : limit(1, 0); directLevel = (grainOut1 + grainOut2) : integrator(.01) : delayfb(.01, .97) : LP5(.5) <: _ , (_ : delayfb(var1 * 2, (1 - var3) * 0.5)) : + : \(x).(1 - x * .5) : limit(1, 0); timeIndex1 = triangleWave(1 / (var1 * 2)) : \(x).((x - 2) * 0.5); timeIndex2 = triangleWave(1 / (var1 * 2)) : \(x).((x + 1) * 0.5); triangle1 = triangleWave(1 / (var1 * 6)) * memWriteLev; triangle2 = triangleWave(var1 * (1 - cntrlMain)); triangle3 = triangleWave(1 / var1); }; signalflow2a( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, ( (sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7) : vgroup("System Inspectors", par(i, 8, hgroup("Signal Flow 2a", inspect(i, -1, 1)))) ) with { Mic_2A_1 = mic1 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); Mic_2A_2 = mic2 * hgroup( "Mixer", hgroup( "Signal Flow 2A", gainMic_2A) ); micIN1 = Mic_2A_1 : Mic12Ainspect : HP1(50) : LP1(6000) * (1 - cntrlMic1); micIN2 = Mic_2A_2 : Mic22Ainspect : HP1(50) : LP1(6000) * (1 - cntrlMic2); SRSect1(x) = x : sampler(var1, (1 - memWriteDel2), (var2 + (diffHL * 1000)) / 261) : HP4(50) : delayfb(var1 / 2, 0); SRSect2(x) = x : sampler(var1, (memWriteLev + memWriteDel1) / 2, (290 - (diffHL * 90)) / 261) : HP4(50) : delayfb(var1, 0); SRSect3(x) = x : sampler(var1, (1 - memWriteDel1), ((var2 * 2) - (diffHL * 1000)) / 261) : HP4(50); SRSectBP1(x) = x : SRSect3 : BPsvftpt(diffHL * 400, (var2 / 2) * memWriteDel2); SRSectBP2(x) = x : SRSect3 : BPsvftpt((1 - diffHL) * 800, var2 * (1 - memWriteDel1)); SRSect4(x) = x : sampler(var1, 1, (250 + (diffHL * 20)) / 261); SRSect5(x) = x : sampler(var1, memWriteLev, .766283); SampleWriteLoop = loop ~ _ with { loop(fb) = ( ( SRSect1(fb) , SRSect2(fb) , SRSectBP1(fb) , SRSectBP2(fb) :> _ ) * (cntrlFeed * memWriteLev) ) <: ( _ + (micIN1 + micIN2) : _ * triangle1 ), _ , SRSect4(fb) , SRSect5(fb) , SRSect3(fb) ; }; sig1 = micIN1 * directLevel; sig2 = micIN2 * directLevel; sampWOut = SampleWriteLoop : \(A,B,C,D,E).( A ); variabledelaysig3(x) = x : de.delay( max(0, ba.sec2samp(.05)), max(0, int(ba.sec2samp(.05 * cntrlMain))) ); sig3 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev : variabledelaysig3 * triangle2 * directLevel; sig4 = SampleWriteLoop : \(A,B,C,D,E).( B ) : _ * memWriteLev * (1-triangle2) * directLevel; sig5 = SampleWriteLoop : \(A,B,C,D,E).( C ) : HP4(50) : delayfb(var1 / 3, 0); sig6 = SampleWriteLoop : \(A,B,C,D,E).( D ) : HP4(50) : delayfb(var1 / 2.5, 0); sig7 = SampleWriteLoop : \(A,B,C,D,E).( E ) : delayfb(var1 / 1.5, 0) * directLevel; }; signalflow2b( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7 ) = mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 with { grainOut1 = granular_sampling(var1, timeIndex1, memWriteDel1, cntrlLev1, 21, sampWOut) : vgroup("System Inspectors", hgroup("Signal Flow 3", hgroup("Granular Sampling 1", inspect(180, -1, 1)))); grainOut2 = granular_sampling(var1, timeIndex2, memWriteDel2, cntrlLev2, 20, sampWOut) : vgroup("System Inspectors", hgroup("Signal Flow 3", hgroup("Granular Sampling 2", inspect(181, -1, 1)))); out1 = ( ((sig5 : delayfb(.040, 0)) * (1 - triangle3)), (sig5 * triangle3), ((sig6 : delayfb(.036, 0)) * (1 - triangle3)), ((sig6 : delayfb(.036, 0)) * triangle3 ), sig1, 0, sig4, grainOut1 * (1 - memWriteLev) + grainOut2 * memWriteLev ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); out2 = ( (sig5 * (1 - triangle3)), ((sig5 : delayfb(.040, 0)) * triangle3), (sig6 * (1 - triangle3)), (sig6 * triangle3), sig2, sig3, sig7, grainOut1 * memWriteLev + grainOut2 * (1 - memWriteLev) ) :> _ * hgroup( "Mixer", hgroup( "Signal Flow 3", gainMic_3) ); }; signalflow3( mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7, grainOut1, grainOut2, out1, out2 ) = grainOut1, grainOut2, ( ( out1, out2, ( out2 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb((var4 / 2) / 344, 0)), ( out1 : delayfb(var4 / 344, 0)), ( out2 : delayfb(var4 / 344, 0)) ) : vgroup("System Inspectors", par(i, 6, hgroup("Signal Flow 3", inspect(i, -1, 1))) ) ), mic1, mic2, mic3, mic4, diffHL, memWriteDel1, memWriteDel2, memWriteLev, cntrlLev1, cntrlLev2, cntrlFeed, cntrlMain, cntrlMic1, cntrlMic2, directLevel, timeIndex1, timeIndex2, triangle1, triangle2, triangle3, sampWOut, sig1, sig2, sig3, sig4, sig5, sig6, sig7;
195d3f63c9497d010e55374ab421b9445f340abf0761cb48d0bffd25a1bf8536
LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust
Granulator_nonDecorrelated_PAR.dsp
declare name "Granulator with Parallel Instances"; declare version "xxx"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare description "Granulator with Parallel Instances"; // FAUST standard library import("stdfaust.lib"); primeNumbers(index) = ba.take(index , list) with{ list = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); }; noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647 ; randm(seed) = (((primeNumbers(seed + 1)) * (1103515245)) / 2147483647) : \(z).((z) - int(z)); // position Gposition = hslider("Position in Buffer", 0, 0, 1, .001); // position jitter Gposjitter = hslider("positionJitter", 0, 0, 1, .001); // duration Gduration = hslider("Duration S.", .1, .001, 0.1, .001); // duration jitter Gdurjitter = hslider("durationJitter", 0, 0, 1, .001); // density GDensity = hslider("Density S.", 1, 1, 100, .001); // buffersize (in seconds) Gbuffersize = hslider("Buffer Size S.", 3, 1, 10, 1); grain(seed,buffersize,position,posjitter,duration,durjitter,density,x) = (hann(readingSegment) * buffer(bufferSize, readPtr, x)) with{ // density _grainRate = density; // target grain duration in seconds _grainDuration = duration; // target grain position in the buffer _grainPosition = position; // make sure to have decorrelated noises durationJitter = durjitter * noise(2 * seed) : abs; positionJitter = posjitter * noise(2 * seed + 1) : abs; // buffer size bufferSize = buffersize * ma.SR; // hann window hann(x) = sin(ma.PI * x) ^ 2.0; // a phasor that read new params only when: y_1 < y_2 phasorLocking = loop ~ _ with { loop(y_1) = ph, unlock with{ y_2 = y_1'; ph = os.phasor(1, ba.sAndH(unlock, _grainRate)); unlock = (y_1 < y_2) + 1 - 1'; }; }; // two outputs of the phasor: phasor, trigger(y_1<y_2) phasor = phasorLocking : _ , !; unlocking = phasorLocking : ! , _; // new param with lock function based on the phasor lock(param) = ba.sAndH(unlocking, param); // TO DO: wrap & receive param from AE2 grainPosition = lock(_grainPosition * (1-positionJitter) ); // TO DO: wrap & receive param from AE2 grainRate = lock(_grainRate); // TO DO: wrap & receive param from AE2 grainDuration = lock(_grainDuration * (1-durationJitter) ); // maximum allowed grain duration in seconds maxGrainDuration = 1.0 / grainRate; // phase segment multiplication factor to complete a Hann cycle in the target duration phasorSlopeFactor = maxGrainDuration / min(maxGrainDuration, grainDuration); readingSegment = min(1.0, phasor * phasorSlopeFactor); // read pointer readPtr = grainPosition * bufferSize + readingSegment * (ma.SR / (grainRate * phasorSlopeFactor)); buffer(length, readPtr, x) = it.frwtable(5, 192000 * 10, .0, writePtr, x, readPtr) with{ writePtr = ba.period(length); }; }; // par (how much grains/instances do you want?) grainN(voices,buffersize,position,posjitter,duration,durjitter,density,x) = par(i, voices, grain( i, buffersize, position, posjitter, duration, durjitter, density, (x/voices) ) ); // Granular Sampling OUT granulator(x) = grainN(8,Gbuffersize,Gposition,Gposjitter,Gduration,Gdurjitter,GDensity,x); process = os.osc(1000) : granulator;
https://raw.githubusercontent.com/LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust/6bad45f99a5d1137968123b6c7ab628b0aa6eeae/Granulator_nonDecorrelated_PAR.dsp
faust
FAUST standard library position position jitter duration duration jitter density buffersize (in seconds) density target grain duration in seconds target grain position in the buffer make sure to have decorrelated noises buffer size hann window a phasor that read new params only when: y_1 < y_2 two outputs of the phasor: phasor, trigger(y_1<y_2) new param with lock function based on the phasor TO DO: wrap & receive param from AE2 TO DO: wrap & receive param from AE2 TO DO: wrap & receive param from AE2 maximum allowed grain duration in seconds phase segment multiplication factor to complete a Hann cycle in the target duration read pointer par (how much grains/instances do you want?) Granular Sampling OUT
declare name "Granulator with Parallel Instances"; declare version "xxx"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare description "Granulator with Parallel Instances"; import("stdfaust.lib"); primeNumbers(index) = ba.take(index , list) with{ list = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); }; noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647 ; randm(seed) = (((primeNumbers(seed + 1)) * (1103515245)) / 2147483647) : \(z).((z) - int(z)); Gposition = hslider("Position in Buffer", 0, 0, 1, .001); Gposjitter = hslider("positionJitter", 0, 0, 1, .001); Gduration = hslider("Duration S.", .1, .001, 0.1, .001); Gdurjitter = hslider("durationJitter", 0, 0, 1, .001); GDensity = hslider("Density S.", 1, 1, 100, .001); Gbuffersize = hslider("Buffer Size S.", 3, 1, 10, 1); grain(seed,buffersize,position,posjitter,duration,durjitter,density,x) = (hann(readingSegment) * buffer(bufferSize, readPtr, x)) with{ _grainRate = density; _grainDuration = duration; _grainPosition = position; durationJitter = durjitter * noise(2 * seed) : abs; positionJitter = posjitter * noise(2 * seed + 1) : abs; bufferSize = buffersize * ma.SR; hann(x) = sin(ma.PI * x) ^ 2.0; phasorLocking = loop ~ _ with { loop(y_1) = ph, unlock with{ y_2 = y_1'; ph = os.phasor(1, ba.sAndH(unlock, _grainRate)); unlock = (y_1 < y_2) + 1 - 1'; }; }; phasor = phasorLocking : _ , !; unlocking = phasorLocking : ! , _; lock(param) = ba.sAndH(unlocking, param); grainPosition = lock(_grainPosition * (1-positionJitter) ); grainRate = lock(_grainRate); grainDuration = lock(_grainDuration * (1-durationJitter) ); maxGrainDuration = 1.0 / grainRate; phasorSlopeFactor = maxGrainDuration / min(maxGrainDuration, grainDuration); readingSegment = min(1.0, phasor * phasorSlopeFactor); readPtr = grainPosition * bufferSize + readingSegment * (ma.SR / (grainRate * phasorSlopeFactor)); buffer(length, readPtr, x) = it.frwtable(5, 192000 * 10, .0, writePtr, x, readPtr) with{ writePtr = ba.period(length); }; }; grainN(voices,buffersize,position,posjitter,duration,durjitter,density,x) = par(i, voices, grain( i, buffersize, position, posjitter, duration, durjitter, density, (x/voices) ) ); granulator(x) = grainN(8,Gbuffersize,Gposition,Gposjitter,Gduration,Gdurjitter,GDensity,x); process = os.osc(1000) : granulator;
a4f4dce5598c29edbc2422416894e2b21039d14cec7d963c5274c818d83c48b1
LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust
AE2_granular_sampling.dsp
declare name "granular_sampling for AUDIBLE ECOSYSTEMICS n.2"; declare version "xxx"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare description "Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; // FAUST standard library import("stdfaust.lib"); primeNumbers(index) = ba.take(index , list) with{ list = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); }; noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647; // timeIndex1 - a signal between -1 and -0.5 GtimeIndex1 = hslider("timeIndex1", -1, -1, -0.5, .001); // memWriteDel1 - a signal between 0 and 1 GmemWriteDel1 = hslider("memWriteDel1", 0, 0, 1, .001); // cntrlLev: a signal between 0 and 1 (1 max, 0 no grains) GcntrlLev = hslider("cntrlLev", .5, 0, 1, .001); // var1 distance (in meters) between the two farthest removed loudspeakers Gvar1 = 3; grain(seed,var1,timeIndex,memWriteDel,cntrlLev,x) = (hann(readingSegment) * buffer(bufferSize, readPtr, x)) : vdelay with{ // density _grainRate = (cntrlLev*(100-1))+1; // target grain duration in seconds _grainDuration = 0.023 + ((1 - memWriteDel) / 21); // target grain position in the buffer _grainPosition = ((timeIndex)+1)/2; // make sure to have decorrelated noises // grain.dur.jitter: 0.1 - constant value durationJitter = noise(2 * seed) * .1 + .1; positionJitter = noise(2 * seed + 1) * (1 - memWriteDel) / 100; // buffer size bufferSize = var1 * ma.SR; // hann window hann(x) = sin(ma.PI * x) ^ 2.0; // a phasor that read new params only when: y_1 < y_2 phasorLocking = loop ~ _ with { loop(y_1) = ph , unlock with{ y_2 = y_1'; ph = os.phasor(1, ba.sAndH(unlock, _grainRate)); unlock = (y_1 < y_2) + 1 - 1'; }; }; // two outputs of the phasor: phasor, trigger(y_1<y_2) phasor = phasorLocking : _ , !; unlocking = phasorLocking : ! , _; // new param with lock function based on the phasor lock(param) = ba.sAndH(unlocking, param); // TO DO: wrap & receive param from AE2 grainPosition = lock(_grainPosition * positionJitter); // TO DO: wrap & receive param from AE2 grainRate = lock(_grainRate); // TO DO: wrap & receive param from AE2 grainDuration = lock(_grainDuration * durationJitter); // maximum allowed grain duration in seconds maxGrainDuration = 1.0 / grainRate; // phase segment multiplication factor to complete a Hann cycle in the target duration phasorSlopeFactor = maxGrainDuration / min(maxGrainDuration, grainDuration); readingSegment = min(1.0, phasor * phasorSlopeFactor); // decorrelation delay noisePadding = hslider("decorrelation", 1, 0, 1, .001) * lock(noise(seed+3)) : abs; vdelay(x) = x : de.sdelay(ma.SR, 1024, noisePadding * ma.SR); // read pointer readPtr = grainPosition * bufferSize + readingSegment * (ma.SR / (grainRate * phasorSlopeFactor)); buffer(length, readPtr, x) = it.frwtable(5, 1920000, .0, writePtr, x, readPtr) with{ writePtr = ba.period(length); }; }; // par (how much grains/instances do you want?) grainN(voices,var1,timeIndex,memWriteDel,cntrlLev,x) = par(i, voices, grain(i,var1,timeIndex,memWriteDel,cntrlLev,x)); // Granular Sampling OUT granular_sampling(x) = grainN(4,Gvar1,GtimeIndex1,GmemWriteDel1,GcntrlLev,x); process = os.osc(1000) : granular_sampling :> (+,+);
https://raw.githubusercontent.com/LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust/290292529f49f5288dfcbe102f37ddc5515b33f8/AE2_granular_sampling.dsp
faust
FAUST standard library timeIndex1 - a signal between -1 and -0.5 memWriteDel1 - a signal between 0 and 1 cntrlLev: a signal between 0 and 1 (1 max, 0 no grains) var1 distance (in meters) between the two farthest removed loudspeakers density target grain duration in seconds target grain position in the buffer make sure to have decorrelated noises grain.dur.jitter: 0.1 - constant value buffer size hann window a phasor that read new params only when: y_1 < y_2 two outputs of the phasor: phasor, trigger(y_1<y_2) new param with lock function based on the phasor TO DO: wrap & receive param from AE2 TO DO: wrap & receive param from AE2 TO DO: wrap & receive param from AE2 maximum allowed grain duration in seconds phase segment multiplication factor to complete a Hann cycle in the target duration decorrelation delay read pointer par (how much grains/instances do you want?) Granular Sampling OUT
declare name "granular_sampling for AUDIBLE ECOSYSTEMICS n.2"; declare version "xxx"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare description "Realised on composer's instructions of the year 2017 edited in L’Aquila, Italy"; import("stdfaust.lib"); primeNumbers(index) = ba.take(index , list) with{ list = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); }; noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647; GtimeIndex1 = hslider("timeIndex1", -1, -1, -0.5, .001); GmemWriteDel1 = hslider("memWriteDel1", 0, 0, 1, .001); GcntrlLev = hslider("cntrlLev", .5, 0, 1, .001); Gvar1 = 3; grain(seed,var1,timeIndex,memWriteDel,cntrlLev,x) = (hann(readingSegment) * buffer(bufferSize, readPtr, x)) : vdelay with{ _grainRate = (cntrlLev*(100-1))+1; _grainDuration = 0.023 + ((1 - memWriteDel) / 21); _grainPosition = ((timeIndex)+1)/2; durationJitter = noise(2 * seed) * .1 + .1; positionJitter = noise(2 * seed + 1) * (1 - memWriteDel) / 100; bufferSize = var1 * ma.SR; hann(x) = sin(ma.PI * x) ^ 2.0; phasorLocking = loop ~ _ with { loop(y_1) = ph , unlock with{ y_2 = y_1'; ph = os.phasor(1, ba.sAndH(unlock, _grainRate)); unlock = (y_1 < y_2) + 1 - 1'; }; }; phasor = phasorLocking : _ , !; unlocking = phasorLocking : ! , _; lock(param) = ba.sAndH(unlocking, param); grainPosition = lock(_grainPosition * positionJitter); grainRate = lock(_grainRate); grainDuration = lock(_grainDuration * durationJitter); maxGrainDuration = 1.0 / grainRate; phasorSlopeFactor = maxGrainDuration / min(maxGrainDuration, grainDuration); readingSegment = min(1.0, phasor * phasorSlopeFactor); noisePadding = hslider("decorrelation", 1, 0, 1, .001) * lock(noise(seed+3)) : abs; vdelay(x) = x : de.sdelay(ma.SR, 1024, noisePadding * ma.SR); readPtr = grainPosition * bufferSize + readingSegment * (ma.SR / (grainRate * phasorSlopeFactor)); buffer(length, readPtr, x) = it.frwtable(5, 1920000, .0, writePtr, x, readPtr) with{ writePtr = ba.period(length); }; }; grainN(voices,var1,timeIndex,memWriteDel,cntrlLev,x) = par(i, voices, grain(i,var1,timeIndex,memWriteDel,cntrlLev,x)); granular_sampling(x) = grainN(4,Gvar1,GtimeIndex1,GmemWriteDel1,GcntrlLev,x); process = os.osc(1000) : granular_sampling :> (+,+);
899615878bef1865113c2769f8ff64b94262571816ded69364a39de7fde1bb39
LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust
Granulator_PAR.dsp
declare name "Granulator with Parallel Instances"; declare version "xxx"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare description "Granulator with Parallel Instances"; // FAUST standard library import("stdfaust.lib"); primeNumbers(index) = ba.take(index , list) with{ list = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); }; noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647; // position Gposition = hslider("Position in Buffer", 0, 0, 1, .001); // position jitter Gposjitter = hslider("positionJitter", 0, 0, 1, .001); // duration Gduration = hslider("Duration S.", .1, .001, 0.1, .001); // duration jitter Gdurjitter = hslider("durationJitter", 0, 0, 1, .001); // density GDensity = hslider("Density S.", 1, 1, 100, .001); // buffersize (in seconds) Gbuffersize = hslider("Buffer Size S.", 3, 1, 10, 1); grain(seed,buffersize,position,posjitter,duration,durjitter,density,x) = (hann(readingSegment) * buffer(bufferSize, readPtr, x)) : vdelay with{ // density _grainRate = density; // target grain duration in seconds _grainDuration = duration; // target grain position in the buffer _grainPosition = position; // make sure to have decorrelated noises durationJitter = durjitter * noise(2 * seed) : abs; positionJitter = posjitter * noise(2 * seed + 1) : abs; // buffer size bufferSize = buffersize * ma.SR; // hann window hann(x) = sin(ma.PI * x) ^ 2.0; // a phasor that read new params only when: y_1 < y_2 phasorLocking = loop ~ _ with { loop(y_1) = ph , unlock with{ y_2 = y_1'; ph = os.phasor(1, ba.sAndH(unlock, _grainRate)); unlock = (y_1 < y_2) + 1 - 1'; }; }; // two outputs of the phasor: phasor, trigger(y_1<y_2) phasor = phasorLocking : _ , !; unlocking = phasorLocking : ! , _; // new param with lock function based on the phasor lock(param) = ba.sAndH(unlocking, param); // TO DO: wrap & receive param from AE2 grainPosition = lock(_grainPosition * (1-positionJitter) ); // TO DO: wrap & receive param from AE2 grainRate = lock(_grainRate); // TO DO: wrap & receive param from AE2 grainDuration = lock(_grainDuration * (1-durationJitter) ); // maximum allowed grain duration in seconds maxGrainDuration = 1.0 / grainRate; // phase segment multiplication factor to complete a Hann cycle in the target duration phasorSlopeFactor = maxGrainDuration / min(maxGrainDuration, grainDuration); readingSegment = min(1.0, phasor * phasorSlopeFactor); // decorrelation delay noisePadding = hslider("decorrelation", 1, 0, 1, .001) * lock(noise(seed+3)) : abs; vdelay(x) = x : de.sdelay(ma.SR, 1024, noisePadding * ma.SR); // read pointer readPtr = grainPosition * bufferSize + readingSegment * (ma.SR / (grainRate * phasorSlopeFactor)); buffer(length, readPtr, x) = it.frwtable(5, 192000*10, .0, writePtr, x, readPtr) with{ writePtr = ba.period(length); }; }; // par (how much grains/instances do you want?) grainN(voices,buffersize,position,posjitter,duration,durjitter,density,x) = par(i, voices, grain(i,buffersize,position,posjitter,duration,durjitter,density,x)); // Granular Sampling OUT granulator(x) = grainN(8,Gbuffersize,Gposition,Gposjitter,Gduration,Gdurjitter,GDensity,x); process = _ : granulator :> (+,+);
https://raw.githubusercontent.com/LucaSpanedda/Sound_reading_and_writing_techniques_in_Faust/290292529f49f5288dfcbe102f37ddc5515b33f8/Granulator_PAR.dsp
faust
FAUST standard library position position jitter duration duration jitter density buffersize (in seconds) density target grain duration in seconds target grain position in the buffer make sure to have decorrelated noises buffer size hann window a phasor that read new params only when: y_1 < y_2 two outputs of the phasor: phasor, trigger(y_1<y_2) new param with lock function based on the phasor TO DO: wrap & receive param from AE2 TO DO: wrap & receive param from AE2 TO DO: wrap & receive param from AE2 maximum allowed grain duration in seconds phase segment multiplication factor to complete a Hann cycle in the target duration decorrelation delay read pointer par (how much grains/instances do you want?) Granular Sampling OUT
declare name "Granulator with Parallel Instances"; declare version "xxx"; declare author "Luca Spanedda"; declare author "Dario Sanfilippo"; declare description "Granulator with Parallel Instances"; import("stdfaust.lib"); primeNumbers(index) = ba.take(index , list) with{ list = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); }; noise(seed) = (+(primeNumbers(seed + 1)) ~ *(1103515245)) / 2147483647; Gposition = hslider("Position in Buffer", 0, 0, 1, .001); Gposjitter = hslider("positionJitter", 0, 0, 1, .001); Gduration = hslider("Duration S.", .1, .001, 0.1, .001); Gdurjitter = hslider("durationJitter", 0, 0, 1, .001); GDensity = hslider("Density S.", 1, 1, 100, .001); Gbuffersize = hslider("Buffer Size S.", 3, 1, 10, 1); grain(seed,buffersize,position,posjitter,duration,durjitter,density,x) = (hann(readingSegment) * buffer(bufferSize, readPtr, x)) : vdelay with{ _grainRate = density; _grainDuration = duration; _grainPosition = position; durationJitter = durjitter * noise(2 * seed) : abs; positionJitter = posjitter * noise(2 * seed + 1) : abs; bufferSize = buffersize * ma.SR; hann(x) = sin(ma.PI * x) ^ 2.0; phasorLocking = loop ~ _ with { loop(y_1) = ph , unlock with{ y_2 = y_1'; ph = os.phasor(1, ba.sAndH(unlock, _grainRate)); unlock = (y_1 < y_2) + 1 - 1'; }; }; phasor = phasorLocking : _ , !; unlocking = phasorLocking : ! , _; lock(param) = ba.sAndH(unlocking, param); grainPosition = lock(_grainPosition * (1-positionJitter) ); grainRate = lock(_grainRate); grainDuration = lock(_grainDuration * (1-durationJitter) ); maxGrainDuration = 1.0 / grainRate; phasorSlopeFactor = maxGrainDuration / min(maxGrainDuration, grainDuration); readingSegment = min(1.0, phasor * phasorSlopeFactor); noisePadding = hslider("decorrelation", 1, 0, 1, .001) * lock(noise(seed+3)) : abs; vdelay(x) = x : de.sdelay(ma.SR, 1024, noisePadding * ma.SR); readPtr = grainPosition * bufferSize + readingSegment * (ma.SR / (grainRate * phasorSlopeFactor)); buffer(length, readPtr, x) = it.frwtable(5, 192000*10, .0, writePtr, x, readPtr) with{ writePtr = ba.period(length); }; }; grainN(voices,buffersize,position,posjitter,duration,durjitter,density,x) = par(i, voices, grain(i,buffersize,position,posjitter,duration,durjitter,density,x)); granulator(x) = grainN(8,Gbuffersize,Gposition,Gposjitter,Gduration,Gdurjitter,GDensity,x); process = _ : granulator :> (+,+);
31310e0f851dbbf80d2864b998e73bd4fdf84b0f455023e7b816f9c6b09e2591
LucaSpanedda/Riverberazione_Digitale_in_FAUST
2.0_Luca_Spanedda_KBVerb.dsp
declare name "Luca Spanedda's KBVerb"; declare version "1.0.0"; declare author "Luca Spanedda"; declare copyright "Copyright(c) 2022 Luca Spanedda"; // import Standard Faust library // https://github.com/grame-cncm/faustlibraries/ import("stdfaust.lib"); // Reverb Model based on: Keith Barr Allpass Loop Reverb //------- ------------- ----- ----------- //-- Luca Spanedda's KBVerb ---------------------------------------------------- //------- -------- KBReverb(decay, del_A1, del_A2, del_B1, del_B2, del_C1, del_C2, del_D1, del_D2, X, Y, Z, W) = X <: _ , ( ( loop_A <: ( Y, _ * decay : loop_B <: ( Z, _ * decay : loop_C <: ( W, _ * decay : loop_D <: _ * decay, si.bus(2) ), si.bus(2) ), si.bus(2) ), si.bus(2) ) ~ _ : !, si.bus(8) : delays ) : !, si.bus(2) with{ loop_A(x, y) = x + y : APF(del_A1) : APF(del_A2); loop_B(x, y) = x + y : APF(del_B1) : APF(del_B2); loop_C(x, y) = x + y : APF(del_C1) : APF(del_C2); loop_D(x, y) = x + y : APF(del_D1) : APF(del_D2); Delay(x,del) = x@(del); delays(L1,R1,L2,R2,L3,R3,L4,R4) = ( Delay(L1,Lsum_1) , Delay(L2,Lsum_2) , Delay(L3,Lsum_3) , Delay(L4,Lsum_4) :> _ ) / 8, ( Delay(R1,Rsum_1) , Delay(R2,Rsum_2) , Delay(R3,Rsum_3) , Delay(R4,Rsum_4) :> _ ) / 8; }; KRT = hslider("Reverb Decay [style:knob]",0.820,0,1,0.001) : si.smoo; process = _ <: KBReverb(KRT, APF_A1, APF_A2, APF_B1, APF_B2, APF_C1, APF_C2, APF_D1, APF_D2) ; //------- ------------- ----- ----------- //-- LIBRARY ------------------------------------------------------------------- //------- -------- // insert an Index for the prime number list, report ms. and Meters reverbPrimeTest(index) = primeNumbers(index) : \(x).(x : ba.samp2sec, (343.1)*(x : ba.samp2sec)); /* process = reverbPrimeTest(410) , reverbPrimeTest(420) , reverbPrimeTest(430) , reverbPrimeTest(440) , reverbPrimeTest(460) , reverbPrimeTest(480) , reverbPrimeTest(500) , reverbPrimeTest(520) ; */ // Allpass filter APF(delaysamples) = (+ : _ <: @(delaysamples-1), *(0.5)) ~ *(-0.5) : mem, _ : + : _; primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); // index of the primes numbers primeNumbers(index) = ba.take(index , list) with{ list = primes; }; // ALLPASS Tuning : APF_A1 = primeNumbers(520) ; APF_A2 = primeNumbers(500) ; APF_B1 = primeNumbers(480) ; APF_B2 = primeNumbers(460) ; APF_C1 = primeNumbers(440) ; APF_C2 = primeNumbers(420) ; APF_D1 = primeNumbers(410) ; APF_D2 = primeNumbers(400) ; Lsum_1 = primeNumbers(520) ; Lsum_2 = primeNumbers(500) ; Lsum_3 = primeNumbers(480) ; Lsum_4 = primeNumbers(460) ; Rsum_1 = primeNumbers(440) ; Rsum_2 = primeNumbers(420) ; Rsum_3 = primeNumbers(410) ; Rsum_4 = primeNumbers(400) ;
https://raw.githubusercontent.com/LucaSpanedda/Riverberazione_Digitale_in_FAUST/87cbf7cc52291b3d49335834d401b453ef5b62e9/2.0_Luca_Spanedda_KBVerb.dsp
faust
import Standard Faust library https://github.com/grame-cncm/faustlibraries/ Reverb Model based on: Keith Barr Allpass Loop Reverb ------- ------------- ----- ----------- -- Luca Spanedda's KBVerb ---------------------------------------------------- ------- -------- ------- ------------- ----- ----------- -- LIBRARY ------------------------------------------------------------------- ------- -------- insert an Index for the prime number list, report ms. and Meters process = reverbPrimeTest(410) , reverbPrimeTest(420) , reverbPrimeTest(430) , reverbPrimeTest(440) , reverbPrimeTest(460) , reverbPrimeTest(480) , reverbPrimeTest(500) , reverbPrimeTest(520) ; Allpass filter index of the primes numbers ALLPASS Tuning :
declare name "Luca Spanedda's KBVerb"; declare version "1.0.0"; declare author "Luca Spanedda"; declare copyright "Copyright(c) 2022 Luca Spanedda"; import("stdfaust.lib"); KBReverb(decay, del_A1, del_A2, del_B1, del_B2, del_C1, del_C2, del_D1, del_D2, X, Y, Z, W) = X <: _ , ( ( loop_A <: ( Y, _ * decay : loop_B <: ( Z, _ * decay : loop_C <: ( W, _ * decay : loop_D <: _ * decay, si.bus(2) ), si.bus(2) ), si.bus(2) ), si.bus(2) ) ~ _ : !, si.bus(8) : delays ) : !, si.bus(2) with{ loop_A(x, y) = x + y : APF(del_A1) : APF(del_A2); loop_B(x, y) = x + y : APF(del_B1) : APF(del_B2); loop_C(x, y) = x + y : APF(del_C1) : APF(del_C2); loop_D(x, y) = x + y : APF(del_D1) : APF(del_D2); Delay(x,del) = x@(del); delays(L1,R1,L2,R2,L3,R3,L4,R4) = ( Delay(L1,Lsum_1) , Delay(L2,Lsum_2) , Delay(L3,Lsum_3) , Delay(L4,Lsum_4) :> _ ) / 8, ( Delay(R1,Rsum_1) , Delay(R2,Rsum_2) , Delay(R3,Rsum_3) , Delay(R4,Rsum_4) :> _ ) / 8; }; KRT = hslider("Reverb Decay [style:knob]",0.820,0,1,0.001) : si.smoo; process = _ <: KBReverb(KRT, APF_A1, APF_A2, APF_B1, APF_B2, APF_C1, APF_C2, APF_D1, APF_D2) ; reverbPrimeTest(index) = primeNumbers(index) : \(x).(x : ba.samp2sec, (343.1)*(x : ba.samp2sec)); APF(delaysamples) = (+ : _ <: @(delaysamples-1), *(0.5)) ~ *(-0.5) : mem, _ : + : _; primes = (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, 10651, 10657, 10663, 10667); primeNumbers(index) = ba.take(index , list) with{ list = primes; }; APF_A1 = primeNumbers(520) ; APF_A2 = primeNumbers(500) ; APF_B1 = primeNumbers(480) ; APF_B2 = primeNumbers(460) ; APF_C1 = primeNumbers(440) ; APF_C2 = primeNumbers(420) ; APF_D1 = primeNumbers(410) ; APF_D2 = primeNumbers(400) ; Lsum_1 = primeNumbers(520) ; Lsum_2 = primeNumbers(500) ; Lsum_3 = primeNumbers(480) ; Lsum_4 = primeNumbers(460) ; Rsum_1 = primeNumbers(440) ; Rsum_2 = primeNumbers(420) ; Rsum_3 = primeNumbers(410) ; Rsum_4 = primeNumbers(400) ;
1e6b48578c7e589f05d6df7ea866c252cc2c5be53bcb5fe485607a7002570085
ArcAudio/ScrewDriver_MadeOfJelly
karplunk.dsp
import("stdfaust.lib"); declare options "[midi:on][nvoices:12]"; string = hgroup("String[0]",+~(de.fdelay4(maxDelLength,delLength-1) : filter : * (damping) ) )*gate*gain with { freq = hslider("[0]freq",440,50,5000,1); damping = hslider("[1]damping", 0.99,0,1,0.01); gain = hslider("[2]gain",1,0,1,0.01); gate = button("[3]gate"); maxDelLength = 960; filter = _ <: _,_ ' :> / (2); delLength = ma.SR/freq; }; process = string <: _,_;
https://raw.githubusercontent.com/ArcAudio/ScrewDriver_MadeOfJelly/4f8f9a99f5b02af9d66eb4a02e622cd9ea3ff8f6/karplunk.dsp
faust
import("stdfaust.lib"); declare options "[midi:on][nvoices:12]"; string = hgroup("String[0]",+~(de.fdelay4(maxDelLength,delLength-1) : filter : * (damping) ) )*gate*gain with { freq = hslider("[0]freq",440,50,5000,1); damping = hslider("[1]damping", 0.99,0,1,0.01); gain = hslider("[2]gain",1,0,1,0.01); gate = button("[3]gate"); maxDelLength = 960; filter = _ <: _,_ ' :> / (2); delLength = ma.SR/freq; }; process = string <: _,_;
a39007f47861fa5414125506cb9e004d76f87730767cab61e0a72afdb64e9ade
ArcAudio/Resonator
mplucker.dsp
import("stdfaust.lib"); // IIR hilbert transform Emmanuel Favreau (via Miller Puckette) // fastest hilbertef(x) = real(x), imag(x) with { biquad(a1,a2,b0,b1,b2) = + ~ conv2(a1,a2) : conv3(b0,b1,b2) with { conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x''; conv2(k0,k1,x) = k0*x + k1*x'; }; real = biquad(-0.02569, 0.260502, -0.260502, 0.02569, 1) : biquad(1.8685, -0.870686, 0.870686, -1.8685, 1) ; imag = biquad(1.94632, -0.94657, 0.94657, -1.94632, 1) : biquad(0.83774, -0.06338, 0.06338, -0.83774, 1) ; }; freqshift(x, shift) = negative(x), positive(x) with { negative(x) = real(x)*cosv - imag(x)*sinv; positive(x) = real(x)*cosv + imag(x)*sinv; real(x) = hilbert(x) : _ , !; imag(x) = hilbert(x) : ! , _; phasor(x) = fmod((x/float(ma.SR) : (+ : ma.decimal) ~ _), 1.) * (ma.PI * 2); sinv = sin(phasor(shift)); cosv = cos(phasor(shift)); hilbert = hilbertef; }; ssb(shift, x) = freqshift(x, shift) : _ , !; // only take one sideband shift = hslider("shift [knob:4]", 2.2, -20., 20, 0.001); shift_scalar = hslider("shift_scalar[knob:5]", 6., 1., 100, 0.1); lr_offset = hslider("lr_offset [knob:3]", 0., 0., 1., 0.00001); fmix = hslider("fmix [knob:2]",0.0,0,1,0.01) : si.smooth(ba.tau2pole(0.005)); shift_amount = shift*shift_scalar; shifter(l, r) = l, r <: *(1-fmix) , *(1-fmix), ssb(shift_amount ,l )*fmix , ssb(shift_amount +lr_offset,r )*fmix :> _,_ ; myString(length,pluckPos,excite) = pm.endChain(myChain) with { stringL = length-0.11; stiffness = hslider("stiffness",0.3,0,1,0.01) : si.smoo ; myChain = pm.chain(pm.elecGuitarNuts : pm.openStringPick(stringL,stiffness,pluckPos,excite) : pm.elecGuitarBridge); }; //l = hslider("freq",200,20,1000,0.01) : pm.f2l : si.smoo; l = ba.midikey2hz(base) : pm.f2l; l2 = ba.midikey2hz(base+freq1) : pm.f2l; l3 = ba.midikey2hz(base+freq2) : pm.f2l; l4 = ba.midikey2hz(base+freq3) : pm.f2l; //l2 = hslider("freq2",400,100,1000,0.01) : pm.f2l : si.smoo; level = hslider("level",0.3,0.0,0.5,0.01) : si.smoo; filterlevel = hslider("filterlevel",0.1,0.0,0.3,0.01) : si.smoo; //l = 1.0; excitation = hslider("excitation",1,0,1,0.01) : si.smoo; base = hslider("base",50,10,120,1):si.smoo; freq1 = hslider("freq1",0,0,24,1):si.smoo; freq2 = hslider("freq2",3,0,24,1):si.smoo; freq3 = hslider("freq3",7,0,24,1):si.smoo; freq4 = hslider("freq4",9,0,24,1):si.smoo; stringer = (myString(l,excitation) *level,myString(l2,excitation) *level,myString(l3,excitation) *level,myString(l4,excitation) *level); // 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) = os.saw2f4(freq)*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); }; selectInput = hgroup("[0]inputSelect",(par(i, 8, harmonic(i)) :> / (8)) , (_<: stringer :>_) : ba.selectn(2,input)) with{ input = nentry("input",1,0,1,1); }; dmix = hslider("dmix [knob:4]", 0.55, 0, 1, 0.01) : si.smooth(ba.tau2pole(0.005)); echof(l) = l<: *(1-dmix), +~(de.fdelay4(maxDelLength,delLength-1) : *(feedback))*dmix :> _; duration = hslider("duration [knob:1]", 200,1,200,1)*0.001 : si.smoo; feedback = hslider("feedback [knob:2]", 0.8, 0 , 1.0 ,0.01);// //damping = hslider("Damping", 0.99,0,1,0.01); filter = _ <: _,_ ' :> / (2); maxDelLength = 12000; delLength = ma.SR*duration; process = + <: stringer :> shifter(_,_) : echof(_) ,echof(_) ;
https://raw.githubusercontent.com/ArcAudio/Resonator/e67a48999bea931547198ccecd38cd2c8130406b/mplucker.dsp
faust
IIR hilbert transform Emmanuel Favreau (via Miller Puckette) fastest only take one sideband l = hslider("freq",200,20,1000,0.01) : pm.f2l : si.smoo; l2 = hslider("freq2",400,100,1000,0.01) : pm.f2l : si.smoo; l = 1.0; gate, freq (pitch), gain parameters Filter Parameters Parameters for the harmonic oscillator UI damping = hslider("Damping", 0.99,0,1,0.01);
import("stdfaust.lib"); hilbertef(x) = real(x), imag(x) with { biquad(a1,a2,b0,b1,b2) = + ~ conv2(a1,a2) : conv3(b0,b1,b2) with { conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x''; conv2(k0,k1,x) = k0*x + k1*x'; }; real = biquad(-0.02569, 0.260502, -0.260502, 0.02569, 1) : biquad(1.8685, -0.870686, 0.870686, -1.8685, 1) ; imag = biquad(1.94632, -0.94657, 0.94657, -1.94632, 1) : biquad(0.83774, -0.06338, 0.06338, -0.83774, 1) ; }; freqshift(x, shift) = negative(x), positive(x) with { negative(x) = real(x)*cosv - imag(x)*sinv; positive(x) = real(x)*cosv + imag(x)*sinv; real(x) = hilbert(x) : _ , !; imag(x) = hilbert(x) : ! , _; phasor(x) = fmod((x/float(ma.SR) : (+ : ma.decimal) ~ _), 1.) * (ma.PI * 2); sinv = sin(phasor(shift)); cosv = cos(phasor(shift)); hilbert = hilbertef; }; shift = hslider("shift [knob:4]", 2.2, -20., 20, 0.001); shift_scalar = hslider("shift_scalar[knob:5]", 6., 1., 100, 0.1); lr_offset = hslider("lr_offset [knob:3]", 0., 0., 1., 0.00001); fmix = hslider("fmix [knob:2]",0.0,0,1,0.01) : si.smooth(ba.tau2pole(0.005)); shift_amount = shift*shift_scalar; shifter(l, r) = l, r <: *(1-fmix) , *(1-fmix), ssb(shift_amount ,l )*fmix , ssb(shift_amount +lr_offset,r )*fmix :> _,_ ; myString(length,pluckPos,excite) = pm.endChain(myChain) with { stringL = length-0.11; stiffness = hslider("stiffness",0.3,0,1,0.01) : si.smoo ; myChain = pm.chain(pm.elecGuitarNuts : pm.openStringPick(stringL,stiffness,pluckPos,excite) : pm.elecGuitarBridge); }; l = ba.midikey2hz(base) : pm.f2l; l2 = ba.midikey2hz(base+freq1) : pm.f2l; l3 = ba.midikey2hz(base+freq2) : pm.f2l; l4 = ba.midikey2hz(base+freq3) : pm.f2l; level = hslider("level",0.3,0.0,0.5,0.01) : si.smoo; filterlevel = hslider("filterlevel",0.1,0.0,0.3,0.01) : si.smoo; excitation = hslider("excitation",1,0,1,0.01) : si.smoo; base = hslider("base",50,10,120,1):si.smoo; freq1 = hslider("freq1",0,0,24,1):si.smoo; freq2 = hslider("freq2",3,0,24,1):si.smoo; freq3 = hslider("freq3",7,0,24,1):si.smoo; freq4 = hslider("freq4",9,0,24,1):si.smoo; stringer = (myString(l,excitation) *level,myString(l2,excitation) *level,myString(l3,excitation) *level,myString(l4,excitation) *level); 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) = os.saw2f4(freq)*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); }; selectInput = hgroup("[0]inputSelect",(par(i, 8, harmonic(i)) :> / (8)) , (_<: stringer :>_) : ba.selectn(2,input)) with{ input = nentry("input",1,0,1,1); }; dmix = hslider("dmix [knob:4]", 0.55, 0, 1, 0.01) : si.smooth(ba.tau2pole(0.005)); echof(l) = l<: *(1-dmix), +~(de.fdelay4(maxDelLength,delLength-1) : *(feedback))*dmix :> _; duration = hslider("duration [knob:1]", 200,1,200,1)*0.001 : si.smoo; filter = _ <: _,_ ' :> / (2); maxDelLength = 12000; delLength = ma.SR*duration; process = + <: stringer :> shifter(_,_) : echof(_) ,echof(_) ;
9d630c00b49bc975f201a60eb390fec7f2e14d43edccf533abc7601f347895bd
ArcAudio/faust-web-test
osc.dsp
import("stdfaust.lib"); //---------------------------`bubble`-------------------------- // bubble(f0, trig) : produces a water drop bubble sound // // #### Usage // // ``` // bubble(f0, trig) : _ // ``` // // Where: // // * ` f0 `: base frequency of bubble sound // * `trig`: trigs the bubble sound on the rising front // // #### Example // // ``` // button("drop") : bubble(600) : _ // ``` // // #### Reference: // // <http://www.cs.ubc.ca/~kvdoel/publications/tap05.pdf> //------------------------------------------------------------ //Shifter taken from ollie's wicked OWL patches // Copywrite "Oli Larkin ([email protected])"; // IIR hilbert transform Emmanuel Favreau (via Miller Puckette) // fastest hilbertef(x) = real(x), imag(x) with { biquad(a1,a2,b0,b1,b2) = + ~ conv2(a1,a2) : conv3(b0,b1,b2) with { conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x''; conv2(k0,k1,x) = k0*x + k1*x'; }; real = biquad(-0.02569, 0.260502, -0.260502, 0.02569, 1) : biquad(1.8685, -0.870686, 0.870686, -1.8685, 1) ; imag = biquad(1.94632, -0.94657, 0.94657, -1.94632, 1) : biquad(0.83774, -0.06338, 0.06338, -0.83774, 1) ; }; freqshift(x, shift) = negative(x), positive(x) with { negative(x) = real(x)*cosv - imag(x)*sinv; positive(x) = real(x)*cosv + imag(x)*sinv; real(x) = hilbert(x) : _ , !; imag(x) = hilbert(x) : ! , _; phasor(x) = fmod((x/float(ma.SR) : (+ : ma.decimal) ~ _), 1.) * (ma.PI * 2); sinv = sin(phasor(shift)); cosv = cos(phasor(shift)); hilbert = hilbertef; }; ssb(shift, x) = freqshift(x, shift) : _ , !; // only take one sideband shift_amount = shift*shift_scalar; string(f,d) = (+~(de.fdelay4(960,ma.SR/f-1) : _ <: _,_ ' :> / (2) : * (d) ) ) ; gain = hslider("gain",0.22,0,1,0.01); base = hslider("Res Base",50,10,120,1):si.smoo; freq1 = hslider("Res freq1",0,0,24,1):si.smoo; freq2 = hslider("Res freq2",3,0,24,1):si.smoo; freq3 = hslider("Res freq3",7,0,24,1):si.smoo; freq4 = hslider("Res freq4",9,0,24,1):si.smoo; damp = hslider("Res damp",0.98,0,0.99,0.01):si.smoo; invol = hslider("invol",0.98,0,0.99,0.01) :si.smoo; cutoffHigh = hslider("cutoffHi",20,20,20000,1):si.smoo; cutoffLow = hslider("cutoffLow",20000,20,20000,1):si.smoo; l1 = hslider("Res l1",0.22,0,0.22,0.01); l2 = hslider("Res l2",0.22,0,0.22,0.01); l3 = hslider("Res l3",0.22,0,0.22,0.01); msec = ma.SR/1000.0; shiftl = hslider("Pitch Shift L ", 12, -24, +24, 0.1); shiftr = hslider("Pitch Shift R ", 12, -24, +24, 0.1); ws = hslider("Pitch Shift Window Size ", 50, 20, 1000, 1) * msec : si.smooth(ba.tau2pole(0.005)); mixP = hslider("PitchShiftMix", 0.5, 0, 1, 0.01) : si.smooth(ba.tau2pole(0.005)); xf = 20 * msec; transpose (w, x, s, sig) = de.fdelay(65536, d,sig)*ma.fmin(d/x,1) + de.fdelay(65536,d+w,sig)*(1-ma.fmin(d/x,1)) with { i = 1 - pow(2, s/12); d = i : (+ : +(w) : fmod(_,w)) ~ _; }; pitchShifter(l,r) = l,r <: *(1-mixP), *(1-mixP), transpose(ws, xf, shiftl, l)*mixP, transpose(ws, xf, shiftr, r)*mixP :> _,_; mixD = hslider("DelayMix [knob:4]", 1.0, 0, 1, 0.01) : si.smooth(ba.tau2pole(0.005)); echof(l) = l<: *(1-mixD), +~(de.fdelay4(maxDelLength,dLength-1) : *(dfeedback))*mixD :> _; duration = hslider("Duration [knob:1]", 200,1,200,1)*0.001 : si.smoo; dfeedback = hslider("Feedback [knob:2]", 0.78, 0 , 0.999 ,0.01);// //damping = hslider("Damping", 0.99,0,1,0.01); filter = _ <: _,_ ' :> / (2); maxDelLength = 12000; dLength = ma.SR*duration; nbits = hslider("BitCrush BITS",24,1,24,1); scaler = float(2^nbits-1); round(x) = floor(x+0.5); bitcrusher(nbits,x) = x :abs: *(scaler) : round : /(scaler) * (2*(x>0)-1.0); redux = hslider("BitCrush SamplFrq",192000,44100/64,192000,1); sampleRedux = ba.downSample(redux); comb = hgroup("Comb[0]", +~(@(delLength-1) : *(feedback))); delLength = hslider("Duration[1]", 1,1,200,1); feedback = hslider("Feedback[2]", 0.0, 0 , 0.85 ,0.01); bubble(f0,trig) = os.osc(f) * (exp(-damp*time) : si.smooth(0.99)) with { damp = 0.043*f0 + 0.0014*f0^(3/2); f = f0*(1+sigma*time); sigma = eta * damp; eta = 0.075; time = 0 : (select2(trig>trig'):+(1)) ~ _ : ba.samp2sec; }; vol = hslider("volume [unit:dB]", 0, -96, 0, 0.1) : ba.db2linear : si.smoo; freq = hslider("freq [unit:Hz]", 1000, 20, 24000, 1); shift = hslider("shift [unit:hz]", 2.2, -20., 20, 0.001); shift_scalar = hslider("shift_scalar", 6., 1., 100, 0.1); lr_offset = hslider("lr_offset", 0., 0., 1., 0.00001); mix = hslider("mix",0.5,0,1,0.01) : si.smooth(ba.tau2pole(0.005)); process = vgroup("Oscillator", os.osc(500.0) * vol <: *(1-mix) , *(1-mix), ssb(shift_amount ,_ )*mix , ssb(shift_amount +lr_offset,_ )*mix :> (_,_) ); shifter(l, r) = l, r <: *(1-mix) , *(1-mix), ssb(shift_amount ,l )*mix , ssb(shift_amount +lr_offset,r )*mix :> _,_ ; // process = ba.pulsen(1, 10000) : pm.djembe(60, 0.3, 0.4, 1) <: string(ba.midikey2hz(base+freq1),damp)*l1 , string(ba.midikey2hz(base+freq2),damp)*l2 , string(ba.midikey2hz(base+freq3),damp)*l3 :> _ <: shifter(_,_) : echof,echof; // shifter(l, r) = l, r <: *(1-mix) , *(1-mix), ssb(shift_amount ,l )*mix , ssb(shift_amount +lr_offset,r )*mix :> _,_ ;
https://raw.githubusercontent.com/ArcAudio/faust-web-test/a7c9a2813390eeed259416ba0163102a71732266/osc.dsp
faust
---------------------------`bubble`-------------------------- bubble(f0, trig) : produces a water drop bubble sound #### Usage ``` bubble(f0, trig) : _ ``` Where: * ` f0 `: base frequency of bubble sound * `trig`: trigs the bubble sound on the rising front #### Example ``` button("drop") : bubble(600) : _ ``` #### Reference: <http://www.cs.ubc.ca/~kvdoel/publications/tap05.pdf> ------------------------------------------------------------ Shifter taken from ollie's wicked OWL patches Copywrite "Oli Larkin ([email protected])"; IIR hilbert transform Emmanuel Favreau (via Miller Puckette) fastest only take one sideband damping = hslider("Damping", 0.99,0,1,0.01); process = ba.pulsen(1, 10000) : pm.djembe(60, 0.3, 0.4, 1) <: string(ba.midikey2hz(base+freq1),damp)*l1 , string(ba.midikey2hz(base+freq2),damp)*l2 , string(ba.midikey2hz(base+freq3),damp)*l3 :> _ <: shifter(_,_) : echof,echof; shifter(l, r) = l, r <: *(1-mix) , *(1-mix), ssb(shift_amount ,l )*mix , ssb(shift_amount +lr_offset,r )*mix :> _,_ ;
import("stdfaust.lib"); hilbertef(x) = real(x), imag(x) with { biquad(a1,a2,b0,b1,b2) = + ~ conv2(a1,a2) : conv3(b0,b1,b2) with { conv3(k0,k1,k2,x) = k0*x + k1*x' + k2*x''; conv2(k0,k1,x) = k0*x + k1*x'; }; real = biquad(-0.02569, 0.260502, -0.260502, 0.02569, 1) : biquad(1.8685, -0.870686, 0.870686, -1.8685, 1) ; imag = biquad(1.94632, -0.94657, 0.94657, -1.94632, 1) : biquad(0.83774, -0.06338, 0.06338, -0.83774, 1) ; }; freqshift(x, shift) = negative(x), positive(x) with { negative(x) = real(x)*cosv - imag(x)*sinv; positive(x) = real(x)*cosv + imag(x)*sinv; real(x) = hilbert(x) : _ , !; imag(x) = hilbert(x) : ! , _; phasor(x) = fmod((x/float(ma.SR) : (+ : ma.decimal) ~ _), 1.) * (ma.PI * 2); sinv = sin(phasor(shift)); cosv = cos(phasor(shift)); hilbert = hilbertef; }; shift_amount = shift*shift_scalar; string(f,d) = (+~(de.fdelay4(960,ma.SR/f-1) : _ <: _,_ ' :> / (2) : * (d) ) ) ; gain = hslider("gain",0.22,0,1,0.01); base = hslider("Res Base",50,10,120,1):si.smoo; freq1 = hslider("Res freq1",0,0,24,1):si.smoo; freq2 = hslider("Res freq2",3,0,24,1):si.smoo; freq3 = hslider("Res freq3",7,0,24,1):si.smoo; freq4 = hslider("Res freq4",9,0,24,1):si.smoo; damp = hslider("Res damp",0.98,0,0.99,0.01):si.smoo; invol = hslider("invol",0.98,0,0.99,0.01) :si.smoo; cutoffHigh = hslider("cutoffHi",20,20,20000,1):si.smoo; cutoffLow = hslider("cutoffLow",20000,20,20000,1):si.smoo; l1 = hslider("Res l1",0.22,0,0.22,0.01); l2 = hslider("Res l2",0.22,0,0.22,0.01); l3 = hslider("Res l3",0.22,0,0.22,0.01); msec = ma.SR/1000.0; shiftl = hslider("Pitch Shift L ", 12, -24, +24, 0.1); shiftr = hslider("Pitch Shift R ", 12, -24, +24, 0.1); ws = hslider("Pitch Shift Window Size ", 50, 20, 1000, 1) * msec : si.smooth(ba.tau2pole(0.005)); mixP = hslider("PitchShiftMix", 0.5, 0, 1, 0.01) : si.smooth(ba.tau2pole(0.005)); xf = 20 * msec; transpose (w, x, s, sig) = de.fdelay(65536, d,sig)*ma.fmin(d/x,1) + de.fdelay(65536,d+w,sig)*(1-ma.fmin(d/x,1)) with { i = 1 - pow(2, s/12); d = i : (+ : +(w) : fmod(_,w)) ~ _; }; pitchShifter(l,r) = l,r <: *(1-mixP), *(1-mixP), transpose(ws, xf, shiftl, l)*mixP, transpose(ws, xf, shiftr, r)*mixP :> _,_; mixD = hslider("DelayMix [knob:4]", 1.0, 0, 1, 0.01) : si.smooth(ba.tau2pole(0.005)); echof(l) = l<: *(1-mixD), +~(de.fdelay4(maxDelLength,dLength-1) : *(dfeedback))*mixD :> _; duration = hslider("Duration [knob:1]", 200,1,200,1)*0.001 : si.smoo; filter = _ <: _,_ ' :> / (2); maxDelLength = 12000; dLength = ma.SR*duration; nbits = hslider("BitCrush BITS",24,1,24,1); scaler = float(2^nbits-1); round(x) = floor(x+0.5); bitcrusher(nbits,x) = x :abs: *(scaler) : round : /(scaler) * (2*(x>0)-1.0); redux = hslider("BitCrush SamplFrq",192000,44100/64,192000,1); sampleRedux = ba.downSample(redux); comb = hgroup("Comb[0]", +~(@(delLength-1) : *(feedback))); delLength = hslider("Duration[1]", 1,1,200,1); feedback = hslider("Feedback[2]", 0.0, 0 , 0.85 ,0.01); bubble(f0,trig) = os.osc(f) * (exp(-damp*time) : si.smooth(0.99)) with { damp = 0.043*f0 + 0.0014*f0^(3/2); f = f0*(1+sigma*time); sigma = eta * damp; eta = 0.075; time = 0 : (select2(trig>trig'):+(1)) ~ _ : ba.samp2sec; }; vol = hslider("volume [unit:dB]", 0, -96, 0, 0.1) : ba.db2linear : si.smoo; freq = hslider("freq [unit:Hz]", 1000, 20, 24000, 1); shift = hslider("shift [unit:hz]", 2.2, -20., 20, 0.001); shift_scalar = hslider("shift_scalar", 6., 1., 100, 0.1); lr_offset = hslider("lr_offset", 0., 0., 1., 0.00001); mix = hslider("mix",0.5,0,1,0.01) : si.smooth(ba.tau2pole(0.005)); process = vgroup("Oscillator", os.osc(500.0) * vol <: *(1-mix) , *(1-mix), ssb(shift_amount ,_ )*mix , ssb(shift_amount +lr_offset,_ )*mix :> (_,_) ); shifter(l, r) = l, r <: *(1-mix) , *(1-mix), ssb(shift_amount ,l )*mix , ssb(shift_amount +lr_offset,r )*mix :> _,_ ;
ca9d4631ca0cc1da65a7a527999642d877b37d3bf0b21bae982b3cab378a8e3e
ArcAudio/synthtest
synth.dsp
import("stdfaust.lib"); /////////////////////////////////////////////////////////////////////////////////////////////////// // // A very simple subtractive synthesizer with 1 VCO 1 VCF. // The VCO Waveform is variable between Saw and Square // The frequency is modulated by an LFO // The envelope control volum and filter frequency // /////////////////////////////////////////////////////////////////////////////////////////////////// // ANALOG IMPLEMENTATION: // // ANALOG_0 : waveform (Saw to square) // ANALOG_1 : Filter Cutoff frequency // ANALOG_2 : Filter resonance (Q) // ANALOG_3 : Filter Envelope Modulation // // MIDI: // CC 79 : Filter keyboard tracking (0 to X2, default 1) // // Envelope // CC 73 : Attack // CC 76 : Decay // CC 77 : Sustain // CC 72 : Release // // CC 78 : LFO frequency (0.001Hz to 10Hz) // CC 1 : LFO Amplitude (Modulation) // /////////////////////////////////////////////////////////////////////////////////////////////////// // // HUI ////////////////////////////////////////////////// // Keyboard midigate = button("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 0.5, 0.01);// MIDI KEYBOARD // pitchwheel pitchwheel = hslider("bend [midi:pitchwheel]",1,0.001,10,0.01); // VCO wfFade = hslider("waveform[BELA: ANALOG_0]",0.5,0,1,0.001):si.smoo; // VCF res = hslider("resonnance[BELA: ANALOG_2]",0.5,0,1,0.001):si.smoo; fr = hslider("fc[BELA: ANALOG_1]", 15, 15, 12000, 0.001):si.smoo; track = hslider("tracking[midi:ctrl 79]", 1, 0, 2, 0.001); envMod = hslider("envMod[BELA: ANALOG_3]",50,0,100,0.01):si.smoo; // ENV att = 0.01 * (hslider ("attack[midi:ctrl 73]",0.1,0.1,400,0.001)); dec = 0.01 * (hslider ("decay[midi:ctrl 76]",60,0.1,400,0.001)); sust = hslider ("sustain[midi:ctrl 77]",0.2,0,1,0.001); rel = 0.01 * (hslider ("release[midi:ctrl 72]",100,0.1,400,0.001)); // LFO lfoFreq = hslider("lfoFreq[midi:ctrl 78]",6,0.001,10,0.001):si.smoo; modwheel = hslider("modwheel[midi:ctrl 1]",0,0,0.5,0.001):si.smoo; // PROCESS ///////////////////////////////////////////// allfreq = (midifreq * pitchwheel) + LFO; // VCF cutoff = ((allfreq * track) + fr + (envMod * midigain * env)) : min(ma.SR/8); // VCO oscillo(f) = (os.sawtooth(f)*(1-wfFade))+(os.square(f)*wfFade); // VCA volume = midigain * env; // Enveloppe env = en.adsre(att,dec,sust,rel,midigate); // LFO LFO = os.lf_triangle(lfoFreq)*modwheel*12; // SYNTH //////////////////////////////////////////////// synth = (oscillo(allfreq) :ve.moog_vcf(res,cutoff)) * volume <: _,_; //#################################################################################################// //##################################### EFFECT SECTION ############################################// //#################################################################################################// // // Simple FX chaine build for a mono synthesizer. // It controle general volume and pan. // FX Chaine is: // Drive // Flanger // Reverberation // // This version use ANALOG IN to controle some of the parameters. // Other parameters continue to be available by MIDI or OSC. // /////////////////////////////////////////////////////////////////////////////////////////////////// // ANALOG IMPLEMENTATION: // // ANALOG_4 : Distortion Drive // ANALOG_5 : Flanger Dry/Wet // ANALOG_6 : Reverberation Dry/Wet // ANALOG_7 : Reverberation Room size // // MIDI: // CC 7 : Volume // CC 10 : Pan // // CC 13 : Flanger Delay // CC 13 : Flanger Delay // CC 94 : Flanger Feedback // // CC 95 : Reverberation Damp // CC 90 : Reverberation Stereo Width // /////////////////////////////////////////////////////////////////////////////////////////////////// // VOLUME: volFX = hslider ("volume[midi:ctrl 7]",1,0,1,0.001);// Should be 7 according to MIDI CC norm. // EFFECTS ///////////////////////////////////////////// drive = hslider ("drive[BELA: ANALOG_4]",0.3,0,1,0.001); // Flanger curdel = hslider ("flangDel[midi:ctrl 13]",4,0.001,10,0.001); fb = hslider ("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001); fldw = hslider ("dryWetFlang[BELA: ANALOG_5]",0.5,0,1,0.001); flanger = efx with { fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10); efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw); }; // Pannoramique: panno = _ : sp.panner(hslider ("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_; // REVERB (from freeverb_demo) reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain : re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)), *(1-g), *(1-g) :> _,_ with { scaleroom = 0.28; offsetroom = 0.7; allpassfeed = 0.5; scaledamp = 0.4; fixedgain = 0.1; origSR = 44100; damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR; combfeed = vslider("RoomSize[BELA: ANALOG_7]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom; spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR; g = vslider("dryWetReverb[BELA: ANALOG_6]", 0.4, 0, 1, 0.001); // (g = Dry/Wet) }; // Dry-Wet (from C. LEBRETON) dry_wet(dw,x,y) = wet*y + dry*x with { wet = 0.5*(dw+1.0); dry = 1.0-wet; }; // ALL effect = _ *(volFX) : flanger : panno : reverb; // PROCESS ///////////////////////////////////////////// process = synth;
https://raw.githubusercontent.com/ArcAudio/synthtest/850d16dc49e962f4c8ffb56426dab2cb24c06ac6/synth.dsp
faust
///////////////////////////////////////////////////////////////////////////////////////////////// A very simple subtractive synthesizer with 1 VCO 1 VCF. The VCO Waveform is variable between Saw and Square The frequency is modulated by an LFO The envelope control volum and filter frequency ///////////////////////////////////////////////////////////////////////////////////////////////// ANALOG IMPLEMENTATION: ANALOG_0 : waveform (Saw to square) ANALOG_1 : Filter Cutoff frequency ANALOG_2 : Filter resonance (Q) ANALOG_3 : Filter Envelope Modulation MIDI: CC 79 : Filter keyboard tracking (0 to X2, default 1) Envelope CC 73 : Attack CC 76 : Decay CC 77 : Sustain CC 72 : Release CC 78 : LFO frequency (0.001Hz to 10Hz) CC 1 : LFO Amplitude (Modulation) ///////////////////////////////////////////////////////////////////////////////////////////////// HUI ////////////////////////////////////////////////// Keyboard MIDI KEYBOARD pitchwheel VCO VCF ENV LFO PROCESS ///////////////////////////////////////////// VCF VCO VCA Enveloppe LFO SYNTH //////////////////////////////////////////////// #################################################################################################// ##################################### EFFECT SECTION ############################################// #################################################################################################// Simple FX chaine build for a mono synthesizer. It controle general volume and pan. FX Chaine is: Drive Flanger Reverberation This version use ANALOG IN to controle some of the parameters. Other parameters continue to be available by MIDI or OSC. ///////////////////////////////////////////////////////////////////////////////////////////////// ANALOG IMPLEMENTATION: ANALOG_4 : Distortion Drive ANALOG_5 : Flanger Dry/Wet ANALOG_6 : Reverberation Dry/Wet ANALOG_7 : Reverberation Room size MIDI: CC 7 : Volume CC 10 : Pan CC 13 : Flanger Delay CC 13 : Flanger Delay CC 94 : Flanger Feedback CC 95 : Reverberation Damp CC 90 : Reverberation Stereo Width ///////////////////////////////////////////////////////////////////////////////////////////////// VOLUME: Should be 7 according to MIDI CC norm. EFFECTS ///////////////////////////////////////////// Flanger Pannoramique: REVERB (from freeverb_demo) (g = Dry/Wet) Dry-Wet (from C. LEBRETON) ALL PROCESS /////////////////////////////////////////////
import("stdfaust.lib"); midigate = button("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); pitchwheel = hslider("bend [midi:pitchwheel]",1,0.001,10,0.01); wfFade = hslider("waveform[BELA: ANALOG_0]",0.5,0,1,0.001):si.smoo; res = hslider("resonnance[BELA: ANALOG_2]",0.5,0,1,0.001):si.smoo; fr = hslider("fc[BELA: ANALOG_1]", 15, 15, 12000, 0.001):si.smoo; track = hslider("tracking[midi:ctrl 79]", 1, 0, 2, 0.001); envMod = hslider("envMod[BELA: ANALOG_3]",50,0,100,0.01):si.smoo; att = 0.01 * (hslider ("attack[midi:ctrl 73]",0.1,0.1,400,0.001)); dec = 0.01 * (hslider ("decay[midi:ctrl 76]",60,0.1,400,0.001)); sust = hslider ("sustain[midi:ctrl 77]",0.2,0,1,0.001); rel = 0.01 * (hslider ("release[midi:ctrl 72]",100,0.1,400,0.001)); lfoFreq = hslider("lfoFreq[midi:ctrl 78]",6,0.001,10,0.001):si.smoo; modwheel = hslider("modwheel[midi:ctrl 1]",0,0,0.5,0.001):si.smoo; allfreq = (midifreq * pitchwheel) + LFO; cutoff = ((allfreq * track) + fr + (envMod * midigain * env)) : min(ma.SR/8); oscillo(f) = (os.sawtooth(f)*(1-wfFade))+(os.square(f)*wfFade); volume = midigain * env; env = en.adsre(att,dec,sust,rel,midigate); LFO = os.lf_triangle(lfoFreq)*modwheel*12; synth = (oscillo(allfreq) :ve.moog_vcf(res,cutoff)) * volume <: _,_; drive = hslider ("drive[BELA: ANALOG_4]",0.3,0,1,0.001); curdel = hslider ("flangDel[midi:ctrl 13]",4,0.001,10,0.001); fb = hslider ("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001); fldw = hslider ("dryWetFlang[BELA: ANALOG_5]",0.5,0,1,0.001); flanger = efx with { fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10); efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw); }; panno = _ : sp.panner(hslider ("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_; reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain : re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)), *(1-g), *(1-g) :> _,_ with { scaleroom = 0.28; offsetroom = 0.7; allpassfeed = 0.5; scaledamp = 0.4; fixedgain = 0.1; origSR = 44100; damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR; combfeed = vslider("RoomSize[BELA: ANALOG_7]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom; spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR; g = vslider("dryWetReverb[BELA: ANALOG_6]", 0.4, 0, 1, 0.001); }; dry_wet(dw,x,y) = wet*y + dry*x with { wet = 0.5*(dw+1.0); dry = 1.0-wet; }; effect = _ *(volFX) : flanger : panno : reverb; process = synth;
ffc71b224f7c18fa725c58e13b0d126103d7c57411ff9d196224144919228818
prithviKantanAAU/sliderSoniFinal
sliderSoniFinal.dsp
// // // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // import("stdfaust.lib"); // Panner NUM_PANPOS = 7; // Dotted Delay DOTDEL_FC_HP = 800; DOTDEL_FC_LP = 2000; // FM Synth FM_DISTMIX = 0.05; // Piano Single Note PIANO_WAVEWIDTH1 = 33; PIANO_WAVEWIDTH2 = 10; PIANO_WAVEWIDTH3 = 66; // Full Chord Synth CS_DEL_N1 = 0.015; CS_DEL_N2 = 0.030; CS_DEL_N3 = 0.045; // MUSIC Trackwise SYNTH // // 1, 2, 3, 8 are sample-based // 4 - CHORD SYNTH PANPOS_NOTES = 3,4,5,6; AT_C = 0.001; RL_C = 1; FV_C = 1; // MALLET FM MALLET_MRATIO = 2; MALLET_I_FIXED = 2.4; MALLET_I_ENV = 6.86; MALLET_A = 0.001; MALLET_D = 0.001; MALLET_S = 0.5; MALLET_R = 0.4; MALLET_ENVTYPE = 0; // 5 - BASSLINE AT_R = 0.001; RL_R = 0.6 + (tempo < 120)*(120-tempo)*0.06; MOD_NUM_R = 5; FREQ_FACTOR_R = 3; MOD_DEPTH_R = 35; // BASSLINE FM BASSLINE_MRATIO = 2; BASSLINE_I_FIXED = 6.75; BASSLINE_I_ENV = 7.46; BASSLINE_A = 0.007; BASSLINE_D = 0.001; BASSLINE_S = 0.6553; BASSLINE_R = 0.65; BASSLINE_ENVTYPE = 1; // AGGRO FM AGGRO_MRATIO = 3; AGGRO_I_FIXED = 10; AGGRO_I_ENV = 10; AGGRO_A = 0.01; AGGRO_D = 0.0001; AGGRO_S = 0.5; AGGRO_R = 0.867; AGGRO_ENVTYPE = 1; // 6 - MAIN MELODY AT_M = 0.001; RL_M = 4; FB_DEL_M = 0.5; WET_DEL_M = 0.8; FC_LP_M = 20000; G_SIN_M = -90; G_NS_M = -90; RL_NS_M = 0.05; FC_HP_NS_M = 3000; // TRUMPETISH FM TRUMPET_MRATIO = 1; TRUMPET_I_FIXED = 10; TRUMPET_I_ENV = 10; TRUMPET_A = 0.05; TRUMPET_D = 0.0001; TRUMPET_S = 0.5; TRUMPET_R = 0.78; TRUMPET_ENVTYPE = 1; // 7 AT_CS = 0.001; RL_CS = 5; FB_DEL_CS = 0.8; WET_DEL_CS = 0.4; DMP_KS_CS = 0.99; FREQ_OFFSET_LR = 0.7; //Sonifications LIST_FREQ_DISTFACTORS = 0.05,-0.03,0.31,-0.27; // CHORD FREQ DIST FACTORS SONI_SB_Z2_ONOFF = waveform {1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1}; SONI_SB_Z2_ONOFF_RD(i) = SONI_SB_Z2_ONOFF,i : rdtable; Soni_R1_maxLevel = 0; Soni_R1_minLevel = -80; // INSTRUMENTATION Soni_R3_Fc_Max = 20000; Soni_R3_Fc_Min = 200; // BRIGHTNESS Soni_J1_MaxWarpFactor = 10; // TONIC PITCH Soni_J2_minFreq = 250; Soni_J2_maxFreq = 5000; // PITCHED WAVE Soni_J3_minFreq = 1000; Soni_J3_maxFreq = 20000; // WHOOSH NOISE Soni_J3_HPF_FC = 150; Soni_J3_LPF_Q = 5; // " // BUSS REVERB REV_MST_PDEL_MS = 10; // PRE-DELAY REV_MST_F_DC_MID = 100; // DC/MID CROSSOVER FREQ REV_MST_F_MID_HI = 2000; // MID/HI CROSSOVER FREQ REV_MST_T60_DC = 1; // RT60 - DC REV_MST_FsMax = 48000; // FS MAX REV_MST_HPF_FC = 200; // FC - LOWER REV_MST_LPF_FC = 3500; // FC - UPPER // REVERB SENDS REV_SND = -8,-10,-5,0,-5; // // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // // TABS musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); mixMasterTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); traditionalSoni(x) = sonificationTab(vgroup("Traditional_Strategies",x)); // SLIDER GROUPS // MUSIC INFO TAB pitchInfo(x) = musicInfoTab(vgroup("Pitch",x)); accentInfo(x) = musicInfoTab(vgroup("Accent",x)); velocityInfo(x) = musicInfoTab(vgroup("Velocity",x)); // MIX AND MASTER TAB trackGainGroup(x) = mixMasterTab(vgroup("Track Gain",x)); trackMuteGroup(x) = mixMasterTab(vgroup("Track Mute",x)); masterGainGroup(x) = mixMasterTab(vgroup("Master Gain",x)); masterEQGroup(x) = mixMasterTab(vgroup("Master EQ",x)); variantGroup(x) = mixMasterTab(vgroup("Track Variant",x)); // EQ TAB eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); // COMP TAB compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); // Tempo and Fluidity tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); fluidity = musicInfoTab(vslider("Fluidity",1,0.05,10,0.01)) : limit(0.2,5); // Traditional Soni sonificationType = checkbox("Traditional"); Soni_X_Trad = traditionalSoni(hslider("x_Traditional",0,0,1,0.001)) : si.smoo; Soni_Choice_Trad = traditionalSoni(hslider("Choice_Traditional",0,0,4,1)); //Variants VAR_1 = variantGroup(nentry("Variant_1",1,1,3,1)); VAR_2 = variantGroup(nentry("Variant_2",1,1,3,1)); VAR_3 = variantGroup(nentry("Variant_3",1,1,3,1)); VAR_4 = variantGroup(nentry("Variant_4",1,1,3,1)); VAR_5 = variantGroup(nentry("Variant_5",1,1,3,1)); VAR_6 = variantGroup(nentry("Variant_6",1,1,3,1)); VAR_7 = variantGroup(nentry("Variant_7",1,1,3,1)); VAR_8 = variantGroup(nentry("Variant_8",1,1,3,1)); //Music Info // NOTE NUMBERS KEYNUM_C_1 = pitchInfo(hslider("T4_P_1",100,20,10000,0.001)); // 4-1 KEYNUM_C_2 = pitchInfo(hslider("T4_P_2",100,20,10000,0.001)); // 4-2 KEYNUM_C_3 = pitchInfo(hslider("T4_P_3",100,20,10000,0.001)); // 4-3 KEYNUM_C_4 = pitchInfo(hslider("T4_P_4",100,20,10000,0.001)); // 4-4 KEYNUM_R = pitchInfo(hslider("T5_P_1",100,20,10000,0.001)); // 5 KEYNUM_M = pitchInfo(hslider("T6_P_1",100,20,10000,0.001)); // 6 KEYNUM_CS_1 = pitchInfo(hslider("T7_P_1",100,20,10000,0.001)); // 7-1 KEYNUM_CS_2 = pitchInfo(hslider("T7_P_2",100,20,10000,0.001)); // 7-2 KEYNUM_CS_3 = pitchInfo(hslider("T7_P_3",100,20,10000,0.001)); // 7-3 KEYNUM_CS_4 = pitchInfo(hslider("T7_P_4",100,20,10000,0.001)); // 7-4 //Accent Info ACC_M = accentInfo(hslider("T6_A_1",5,0,9,0.01)); // 6 ACC_C_1 = accentInfo(hslider("T4_A_1",5,0,9,0.01)); // 4-1 ACC_C_2 = accentInfo(hslider("T4_A_2",5,0,9,0.01)); // 4-2 ACC_C_3 = accentInfo(hslider("T4_A_3",5,0,9,0.01)); // 4-3 ACC_C_4 = accentInfo(hslider("T4_A_4",5,0,9,0.01)); // 4-4 ACC_R = accentInfo(hslider("T5_A_1",5,0,9,0.01)); // 5 // VELOCITIES V_K = velocityInfo(hslider("T1_V_1",9,0,9,0.1)); // 1 V_S = velocityInfo(hslider("T2_V_1",9,0,9,0.1)); // 2 S_FNUM = ((V_S > 3) + (V_S > 6)) : ba.sAndH(V_S*TRG_S); // Snare - File Number V_HH = velocityInfo(hslider("T3_V_1",9,0,9,0.1)); // 3 HH_FNUM = ((V_HH > 3) + (V_HH > 6)) : ba.sAndH(V_HH*TRG_HH); // HH - File Number V_C_1 = velocityInfo(hslider("T4_V_1",9,0,9,0.1)); // 4-1 V_C_2 = velocityInfo(hslider("T4_V_2",9,0,9,0.1)); // 4-2 V_C_3 = velocityInfo(hslider("T4_V_3",9,0,9,0.1)); // 4-3 V_C_4 = velocityInfo(hslider("T4_V_4",9,0,9,0.1)); // 4-4 V_LIST_C = V_C_1, V_C_2, V_C_3, V_C_4; // 4 - LIST V_R = velocityInfo(hslider("T5_V_1",9,1,9,0.1)); // 5 V_M = velocityInfo(hslider("T6_V_1",9,1,9,0.1)); // 6 V_CS = velocityInfo(hslider("T7_V_1",9,0,9,0.1)); // 7 V_CR = velocityInfo(hslider("T8_V_1",9,0,9,0.1)); // 8 //Sonification Sliders and Preprocessing soniSlider(idx,defaultVal) = sonificationTab(vgroup("AP Values",hslider("Soni %idx",defaultVal,0,1,0.001))); // TRADITIONAL X_T_Pitch = soniSlider(1,0); X_T_Tempo = soniSlider(2,0); X_T_Synchronicity = soniSlider(3,0); X_T_Harmonicity = soniSlider(4,0); X_T_Brightness = soniSlider(5,0); // MUSICAL X_M_MelDegree = soniSlider(6,0); X_M_Tempo = soniSlider(7,0); X_M_Synchronicity = soniSlider(8,0); X_M_Harmonicity = soniSlider(9,0); X_M_Brightness = soniSlider(10,0); SONI_GAIN_DB = masterGainGroup(vslider("Soni Buss Gain",-8,-10,2,0.01)); masterGain = masterGainGroup(vslider("Master Gain",-6,-96,12,0.01) : ba.db2linear); // // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // UTILITY BT_SMPL = ba.tempo(tempo); stereoLinGain(gain) = _,_ : *(gain),*(gain); stereodBGain(gain) = _,_ : *(linGain),*(linGain) with { linGain = ba.db2linear(gain); }; stereoLinMult(gainPair) = _,_ : *(gainPair : select2(0)),*(gainPair : select2(1)); stereoEffect(effect) = _,_ : effect,effect; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; // CONVERT VELOCITY VALUE TO TRIGGER ON CHANGE velToTrigger(vel) = trigger with { trigger = (posTrig + negTrig); posTrig = vel : ba.impulsify; negTrig = - 1 * (vel) : ba.impulsify : *(vel > 0); }; // CONVERT 0-10 VELOCITY VALUE TO MONO GAIN MULTIPLIER applyVelocity(velocity,trigger,maxVel) = _ : *(gainMult) with { sampledVel = velocity : ba.sAndH(trigger); dBGain = (sampledVel - 10) * 26.0 / 9.0; gainMult = ba.db2linear(dBGain); }; // TEMPO-BASED INSTRUMENT RELEASE FACTOR tempo_RelFactor = fluidity + 1.5 * (120-tempo) / 40 * (tempo < 120); // MASTER LIMITER masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); // SHORT STRUM DELAY shortDelay(d_ms) = stereoEffect(de.fdelay(5000,d_ms*ma.SR)); // CHANNEL PROCESSORS - MONO AND STEREO monoChannel(trackIndex) = *(0.25) : channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)); stereoChannel(trackIndex) = stereoLinGain(0.25) : stereoEffect(channelComp(compTrackGroup(trackIndex))) : stereoEffect(parametricEQ(eqTrackGroup(trackIndex))); // PREPROCESS CHORD FREQUENCIES getChordFinalFreqs(LIST) = freqs with { freqs = par(i,4,freq(i)); // CREATE FREQ LIST freq(i) = freqs_pre(i) : *(Soni_P3_freqDistFactor(i)); // APPLY TUNING SONIFICATIONS Soni_P3_freqDistFactor(i) = LIST_FREQ_DISTFACTORS : ba.selectn(4,i) : *(X_M_Harmonicity) : +(1); // CALCULATE CHORD DIST AMOUNT freqs_pre(i) = LIST : ba.selectn(4,i); // GET INDIVIDUAL MIDI KEYS }; // GET STEREO PAN GAINS getPanFunction(panIndex) = panFunction with { panFunction = _ <: _*(L_multiplier), _*(R_multiplier); // SPLIT AND MULTIPLY L_multiplier = 1,0.95,0.3,0.9,0.8,0.6,0.4 : ba.selectn(NUM_PANPOS,panIndex); // L-MULTIPLIER R_multiplier = 1,0.3,0.95,0.4,0.6,0.8,0.9 : ba.selectn(NUM_PANPOS,panIndex); // R-MULTIPLIER }; // CHANNEL COMP channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; // CHANNEL EQ parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",2000,1500,15000,0.01))); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); }; // 3 - Effects // Dotted Delay dotted_delay(feedback,delay,wet) = +~(de.delay(100000,del) : filt)*feedback*wet :> _ with { filt = fi.bandpass(2,DOTDEL_FC_HP,DOTDEL_FC_LP); del = 0.75*delay; }; // Compressor-Limiter compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); outminusindb(level) = max(level-thresh,0)*(1/ratio - 1); // CALCULATE GAIN REDUCTION kneesmooth = si.smooth(ba.tau2pole(kneeAtt)); }; // SMOOTH KNEE // Master COMP masterComp = stereoEffect(compLimiter(0,1.01,-20,100,300,0.05)) : stereoEffect(compLimiter(0,1.1,-5,50,200,0.05)) : stereodBGain(2); //Reverb Master reverbMaster = _,_ <: re.zita_rev1_stereo(REV_MST_PDEL_MS,REV_MST_F_DC_MID,REV_MST_F_MID_HI,REV_MST_T60_DC,rt_60,REV_MST_FsMax) : filter with { rt_60 = min(0.3 + (150 - tempo) * 0.05,1.85); // TEMPO DEPENDENT RT60 filter = stereoEffect(fi.bandpass(1,REV_MST_HPF_FC,REV_MST_LPF_FC)); // OUTPUT FILTER }; stereoMasterSection(trackIndex) = stereoOut with { stereoOut = stereoLinGain(trackGain) : stereoLinGain(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,24,0.01) : ba.db2linear); trackMute = trackMuteGroup(checkbox("%trackIndex")); }; //4 - Synthesis samplePlayer(fileFunc,trigger) = fileFunc(ba.countup(96000,trigger)); K_FILES = soundfile("K_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V3.wav'}]",1) : !,!,_; S_V1_FILES = soundfile("S_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_3.wav'}]",1) : !,!,_; S_V2_FILES = soundfile("S_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_3.wav'}]",1) : !,!,_; S_V3_FILES = soundfile("S_SMPL_V3[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_3.wav'}]",1) : !,!,_; CR_FILES = soundfile("CR_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V3.wav'}]",1) : !,!,_; HH_V1_FILES = soundfile("HH_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_3.wav'}]",1) : !,!,_; HH_V2_FILES = soundfile("HH_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_3.wav'}]",1) : !,!,_; K_SMPL_V1(i) = 0,i : K_FILES; K_SMPL_V2(i) = 1,i : K_FILES; K_SMPL_V3(i) = 2,i : K_FILES; S_SMPL_V1_1(i) = 0,i : S_V1_FILES; S_SMPL_V1_2(i) = 1,i : S_V1_FILES; S_SMPL_V1_3(i) = 2,i : S_V1_FILES; S_SMPL_V2_1(i) = 0,i : S_V2_FILES; S_SMPL_V2_2(i) = 1,i : S_V2_FILES; S_SMPL_V2_3(i) = 2,i : S_V2_FILES; S_SMPL_V3_1(i) = 0,i : S_V3_FILES; S_SMPL_V3_2(i) = 1,i : S_V3_FILES; S_SMPL_V3_3(i) = 2,i : S_V3_FILES; CR_SMPL_V1(i) = 0,i : CR_FILES; CR_SMPL_V2(i) = 1,i : CR_FILES; CR_SMPL_V3(i) = 2,i : CR_FILES; HH_SMPL_V1_1(i) = 0,i : HH_V1_FILES; HH_SMPL_V1_2(i) = 1,i : HH_V1_FILES; HH_SMPL_V1_3(i) = 2,i : HH_V1_FILES; HH_SMPL_V2_1(i) = 0,i : HH_V2_FILES; HH_SMPL_V2_2(i) = 1,i : HH_V2_FILES; HH_SMPL_V2_3(i) = 2,i : HH_V2_FILES; fmSynth_Versatile(fc,modRatio,I_fixed,I_ampDependent,a,d,s,r,envType,trigger,vel,acc) = output with { fc_cooked = fc : si.smooth(ba.tau2pole(0.005)); acc_cooked = 1 + (acc-5.0)/5.0; output = os.osc(fc_cooked + dev) * ampEnv; dev = I * ampEnv * modFreq * os.triangle(modFreq); I = I_fixed + (I_ampDependent * acc_cooked * (0.5 + velFactor) + I_freq) * (ampEnv); I_freq = 4 * (fc - 300)/300; modFreq = (modRatio + X_M_Harmonicity) * fc_cooked; release_basic = ba.tempo(ba.tempo(tempo))/ma.SR * (1 + velFactor * 2); env_basic = en.ar(a,release_basic,trigger); triggerCooked = (env_basic > 0.5) + (env_basic > env_basic'); chosenEnv = en.adsr(a,d,s,r*tempo_RelFactor,triggerCooked), en.adsre(a,d,s,r*tempo_RelFactor,triggerCooked), en.ar(a,r*tempo_RelFactor,trigger), en.are(a,r*tempo_RelFactor,trigger), en.arfe(a,r*tempo_RelFactor,0.3,trigger) : ba.selectn(5,envType); ampEnv = chosenEnv : si.smooth(ba.tau2pole(a)); velFactor = 1 : applyVelocity(vel,trigger,9); }; leadSynth(fundamental,synthFunc,velocity,trigger,synthRelease,synthCutoff,acc) = output with { output = melSynth,melSynth; // OUTPUT SUMMING melSynth = synthFunc(fundamentalCooked) * env : applyVelocity(velocity,trigger,9); // MEL COMPONENT fundamentalCooked = 2 * fundamental * soniVibratoLFO * accVibrato : limit(20,5000); env = en.ar(0.001,synthRelease * tempo_RelFactor,trigger); // MEL ENVELOPE vibLFO = os.osc(tempo/15); accVibrato = 1 + (0.00045 * acc * vibLFO) : si.smooth(ba.tau2pole(0.001)); soniVibratoLFO = 1 + X_M_Harmonicity * vibLFO * 0.5 : si.smoo; // CF DIST SONI - VIBRATO LFO }; fmSynth(fundamental,numMod,freqFactor,release,depth,trigger) = (fmSynth + dirtyBus) * env with { fmSynth = sy.fm(freqList,depthList); // SYNTH - FM dirtyBus = fmSynth : ef.cubicnl(0.7,0) : _ *(FM_DISTMIX); // DIST MIX freqList = par(i,numMod,fundamental * pow(freqFactor,i)); // (1)CARRIER + MOD FREQ LIST depthList = par(i,numMod-1,depthCooked); // MOD DEPTH LIST depthCooked = depth * env * 9; // COOKED DEPTH env = sqrt(en.ar(0.001,release * tempo_RelFactor, trigger)) : si.smooth(ba.tau2pole(0.001)); // AMP ENVELOPE }; pulseWave(freq,widthPercent) = output with { output = 2 * (ba.pulsen(duration,interval) - 0.5); // DC CORRECTED OUTPUT WAVE duration = widthPercent * interval / 100; // PULSE UP TIME interval = ma.SR / freq; // PUlSE TOTAL PERIOD }; pianoSim_singleNote(freq,trigger,acc) = monoOut with { monoOut = pulseWave(freq,PIANO_WAVEWIDTH1),pulseWave(freq, PIANO_WAVEWIDTH2),pulseWave(freq,PIANO_WAVEWIDTH3):> fi.lowpass(2,cutoff) * ampEnv; // WAVESUMMING cutoff = (freqEnv + 0.01) * 4000 * freq / 600 * (1 - min(freq,1000)/2000) : limit(20,20000); // FC freqEnv = (1 + (acc - 5.0)/5.0) * en.arfe(0.001,1.6,0.4 * tempo_RelFactor,trigger) : si.smooth(ba.tau2pole(0.0001)); // FREQUENCY ENV ampEnv = pow(en.ar(0.001,4 * tempo_RelFactor,trigger),6) : si.smooth(ba.tau2pole(0.0001)); // AMPLITUDE ENV }; voiceSynth_FormantBP(freq,vel,trigger,acc) = pm.SFFormantModelBP(2,vowel_H,fric,freqLow,0.04) * env : fi.resonlp(8000,3,1) with { fric = 0.13 - acc/10.0 * 0.13 : max(0); freqLow = freq / 2.0; vowel_idx = 0; env = en.ar(0.02, 1.5 / tempo * 78.6 * tempo_RelFactor * (1 + acc/5.0), trigger); vowel_H = vowel_idx : si.smooth(ba.tau2pole(0.01)); }; fullChordSynth(freqList,synthFunc,env) = stereoChordOut with { freqSelector(n) = freqList : ba.selectn(4,n-1); // INDIVIDUAL FREQS strumDelay(dMax) = dMax * (tempo < 120) * (120 - tempo)/60; // CALCULATE DELAY freq1Bus = synthFunc(freqSelector(1)),synthFunc(freqSelector(1) + FREQ_OFFSET_LR); // F1 freq2Bus = synthFunc(freqSelector(2)),synthFunc(freqSelector(2) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N1)); // F2 freq3Bus = synthFunc(freqSelector(3)),synthFunc(freqSelector(3) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N2)); // F3 freq4Bus = synthFunc(freqSelector(4)),synthFunc(freqSelector(4) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N3)); // F4 stereoChordOut = freq1Bus,freq2Bus,freq3Bus,freq4Bus :> stereoLinGain(env); // SUM + ENVELOPE }; chordSingle_Synth(freq,acc,synthFunc) = noteOut with { noteOut = synthFunc(freq,acc),synthFunc(freq + 0.5,acc); }; ks(freq,damping) = +~((de.fdelay4(1024,del)*damping) : dampingFilter) with { del = ma.SR/freqCooked - 0.5 - 1*(freqCooked > 600); // CALCULATE DELAY LENGTH + TUNING COMPENSATE dampingFilter = _ <: (_'+ _)/2; // DAMPING FB FILTER freqCooked = freq * 1.0116; }; ks_excitation(trigger) = no.noise*en.ar(0.001,0.001,trigger); // KARPLUS STRONG NOISE EXCITATION staticBalanceMult(z) = 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 5), 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 6) : stereoEffect(si.smoo); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // MASTER FILTER - LPF Soni_R3_Filter = fi.resonlp(cutoff,qCooked,1) with // R3 - BRIGHTNESS { cutoff = Soni_R3_Fc_Max - X_M_Brightness * (Soni_R3_Fc_Max - Soni_R3_Fc_Min) : si.smoo; // CALCULTE CUTOFF qCooked = 4 - 3.3 * pow(X_M_Brightness,2); // CALCULATE F-DEPENDENT Q }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRIGGERS TRG_K = velToTrigger(V_K); TRG_S = velToTrigger(V_S); TRG_HH = velToTrigger(V_HH); TRG_C_1 = velToTrigger(V_C_1); TRG_C_2 = velToTrigger(V_C_2); TRG_C_3 = velToTrigger(V_C_3); TRG_C_4 = velToTrigger(V_C_4); TRG_LIST_C = TRG_C_1,TRG_C_2,TRG_C_3,TRG_C_4; TRG_R = velToTrigger(V_R); TRG_M = velToTrigger(V_M); TRG_CS = velToTrigger(V_CS); TRG_CR = velToTrigger(V_CR); //Kick kick_V1 = samplePlayer(K_SMPL_V1,TRG_K); kick_V2 = samplePlayer(K_SMPL_V2,TRG_K); kick_V3 = samplePlayer(K_SMPL_V3,TRG_K); kickSynth = kick_V1,kick_V2,kick_V3 : ba.selectn(3,VAR_1 - 1); kick_Normal = kickSynth : applyVelocity(V_K,TRG_K,9); kickTrack = kick_Normal,(kickSynth * 1.4) :> monoChannel(1) : getPanFunction(0); //Snare snare_V1 = samplePlayer(S_SMPL_V1_1,TRG_S), samplePlayer(S_SMPL_V1_2,TRG_S),samplePlayer(S_SMPL_V1_3,TRG_S) : ba.selectn(3,S_FNUM); snare_V2 = samplePlayer(S_SMPL_V2_1,TRG_S), samplePlayer(S_SMPL_V2_2,TRG_S),samplePlayer(S_SMPL_V2_3,TRG_S) : ba.selectn(3,S_FNUM); snare_V3 = samplePlayer(S_SMPL_V3_1,TRG_S), samplePlayer(S_SMPL_V3_2,TRG_S),samplePlayer(S_SMPL_V3_3,TRG_S) : ba.selectn(3,S_FNUM); snareSynth = snare_V1,snare_V2,snare_V3 : ba.selectn(3,VAR_2 - 1); snare_Normal = snareSynth : applyVelocity(V_S,TRG_S,3); snareTrack = snare_Normal,(snareSynth * 1.4) :> monoChannel(2) : getPanFunction(0); //HH hh_V1 = samplePlayer(HH_SMPL_V1_1,TRG_HH), samplePlayer(HH_SMPL_V1_2,TRG_HH),samplePlayer(HH_SMPL_V1_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V2 = samplePlayer(HH_SMPL_V2_1,TRG_HH), samplePlayer(HH_SMPL_V2_2,TRG_HH),samplePlayer(HH_SMPL_V2_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V3 = pm.marimba(800,0.75,5000,1,1,TRG_HH) * 10; hhSynth = hh_V1,hh_V2,hh_V3 : ba.selectn(3,VAR_3 - 1); hhTrack = hhSynth : applyVelocity(V_HH,TRG_HH,3) : monoChannel(3) : getPanFunction(1); //Chord KEYNUM_LIST_C = KEYNUM_C_1,KEYNUM_C_2,KEYNUM_C_3,KEYNUM_C_4; // LIST MIDI KEYS F0_LIST_HZ_C = getChordFinalFreqs(KEYNUM_LIST_C); // MIDI KEYS TO FREQ ACC_LIST_C = ACC_C_1,ACC_C_2,ACC_C_3,ACC_C_4; // ACCENTS chordFreq(noteIdx) = F0_LIST_HZ_C : ba.selectn(4,noteIdx); // FREQ SELECTOR chordVel(noteIdx) = V_LIST_C : ba.selectn(4,noteIdx); // VEL SELECTOR chordTrg(noteIdx) = TRG_LIST_C : ba.selectn(4,noteIdx); // TRG SELECTOR chordAcc(noteIdx) = ACC_LIST_C : ba.selectn(4,noteIdx); // ACC SELECTOR chord_SF_V1(trigger,freq,acc) = pianoSim_singleNote(freq,trigger,acc); // CHORD - SF VARIANT 1 chord_SF_V2(trigger,freq,acc) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, MALLET_A,MALLET_D,MALLET_S,MALLET_R,MALLET_ENVTYPE,trigger,7,acc); // CHORD - SF VARIANT 2 chord_SF_V3(trigger,freq,acc) = os.CZresTrap(0.5*(1+os.osc(freq)),4.54 * (1 + pow(acc/5,2))) * en.are(0.001,2 * tempo_RelFactor,trigger); chord_notePanFunc(idx) = ba.take(idx+1,PANPOS_NOTES); chordSynthFunc(trigger,freq,acc) = chord_SF_V1(trigger,freq,acc), chord_SF_V2(trigger,freq,acc), chord_SF_V3(trigger,freq,acc) : ba.selectn(3,VAR_4 - 1); chordSum = par(i,4,chordSingle_Synth(chordFreq(i), chordAcc(i), chordSynthFunc(chordTrg(i))) : stereoEffect(applyVelocity(chordVel(i),chordTrg(i),9))) :> _,_; chordTrack = chordSum : stereoChannel(4); //Riff F0_R = KEYNUM_R; // CALCULATE F0 HZ riff_V1 = fmSynth(F0_R,MOD_NUM_R,FREQ_FACTOR_R,RL_R,MOD_DEPTH_R,TRG_R); // RIFF VARIANT 1 riff_V2 = fmSynth_Versatile(F0_R,BASSLINE_MRATIO,BASSLINE_I_FIXED,BASSLINE_I_ENV, BASSLINE_A,BASSLINE_D,BASSLINE_S,BASSLINE_R,BASSLINE_ENVTYPE,TRG_R,V_R,ACC_R); // RIFF VARIANT 2 riff_V3 = fmSynth_Versatile(F0_R,AGGRO_MRATIO,AGGRO_I_FIXED,AGGRO_I_ENV, AGGRO_A,AGGRO_D,AGGRO_S,AGGRO_R,AGGRO_ENVTYPE,TRG_R,V_R,ACC_R); // RIFF VARIANT 2 riffSynth = riff_V1,riff_V2,riff_V3 : ba.selectn(3,VAR_5 - 1); riffTrack = riffSynth : applyVelocity(V_R,TRG_R,9) : monoChannel(5) : getPanFunction(0); //Melody Main F0_M = KEYNUM_M; V_M_SUS = V_M : ba.sAndH(TRG_M); M_FreqFactor = (F0_M - 300)/700 : si.smooth(ba.tau2pole(0.001)); M_V1(freq) = voiceSynth_FormantBP(freq,V_M_SUS,TRG_M,ACC_M); // MELODY SF - VARIANT 1 M_V2(freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, MALLET_A,MALLET_D,MALLET_S,MALLET_R,MALLET_ENVTYPE,TRG_M,V_M,ACC_M); // MELODY SF - VARIANT 2 M_V3(freq) = fmSynth_Versatile(freq,TRUMPET_MRATIO,TRUMPET_I_FIXED,TRUMPET_I_ENV, TRUMPET_A,TRUMPET_D,TRUMPET_S,TRUMPET_R,TRUMPET_ENVTYPE,TRG_M,V_M,ACC_M); // MELODY SF - VARIANT 3 M_SynthFunc(freq) = M_V1(freq),M_V2(freq),M_V3(freq) : ba.selectn(3,VAR_6 - 1); M_FX1 = dotted_delay(FB_DEL_M,BT_SMPL,WET_DEL_M),dotted_delay(FB_DEL_M,2*BT_SMPL,WET_DEL_M); // DEFINE STEREO DOTTED DELAY melodySynth = leadSynth(F0_M,M_SynthFunc,V_M,TRG_M,RL_M,FC_LP_M,ACC_M); // SYNTHESIZE MELODY melodyTrack = melodySynth : M_FX1 : stereoChannel(6); //Chord Stabs KEYNUM_LIST_CS = KEYNUM_CS_1,KEYNUM_CS_2,KEYNUM_CS_3,KEYNUM_CS_4; F0_LIST_HZ_CS = getChordFinalFreqs(KEYNUM_LIST_CS); // GET F0 LIST ENV_CS = en.ar(AT_CS,RL_CS,TRG_CS); // GET ENV DEL_CS = stereoEffect(dotted_delay(FB_DEL_CS,BT_SMPL,WET_DEL_CS)); // DEFINE DOTTED DELAY CS_V1(freq) = ks_excitation(TRG_CS) : ks(freq,DMP_KS_CS); CS_V2(freq) = os.triangle(freq); CS_V3(freq) = os.sawtooth(freq); SynthFunc_CS(freq) = CS_V1(freq),CS_V2(freq),CS_V3(freq) : ba.selectn(3,VAR_7 - 1); CSTrack = fullChordSynth(F0_LIST_HZ_CS,SynthFunc_CS,ENV_CS) : stereoLinGain(0.3) : DEL_CS; // CS SYNTH chordStabTrack = CSTrack : stereoChannel(7); //Crash crash_V1 = samplePlayer(CR_SMPL_V1,TRG_CR); crash_V2 = samplePlayer(CR_SMPL_V2,TRG_CR); crash_V3 = samplePlayer(CR_SMPL_V3,TRG_CR); crashSynth = crash_V1,crash_V2,crash_V3 : ba.selectn(3,VAR_8 - 1); crashTrack = crashSynth : applyVelocity(V_CR,TRG_CR,9) : monoChannel(8) : getPanFunction(2); // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRADITIONAL STRATEGIES // // // // // // // // // // // // // // // // // // // // // // // // // // // // S1_Pitch = os.osc(S1_freq) *(0.5); S1_freq = S1_fmin * pow(2,X_T_Pitch*S1_nOct); S1_fmin = 300; S1_nOct = 3.5; S2_Tempo = os.osc(1000) * en.ar(0.001,0.05,S2_PulseTrain) *(0.5); S2_PulseTrain = ba.pulse(S2_SampleInterval); S2_TempoMax = 20*60; S2_TempoMin = 2*60; S2_IntervalRange = ba.tempo(S2_TempoMin) - ba.tempo(S2_TempoMax); S2_SampleInterval = ba.tempo(S2_TempoMax) + X_T_Tempo * (S2_IntervalRange); S3_Synchronicity = (S3_OriginalTrain + S3_Delayed) : en.ar(0.001,0.05) : *(os.osc(1000) *(0.5)); S3_PulseFreq = 3; S3_PeriodSamples = ba.sec2samp(1/S3_PulseFreq); S3_MaxSampleDelay = 0.25 * S3_PeriodSamples; S3_CurrentDelay = S3_MaxSampleDelay * X_T_Synchronicity; S3_OriginalTrain = ba.pulse(S3_PeriodSamples); S3_Delayed = S3_OriginalTrain : de.fdelay(40000,S3_CurrentDelay); S4_Inharmonicity = (os.osc(S4_F) + S4_addedPartials) * 0.15; S4_addedPartials = par(i,15,S4_InharmExp(i)) :> _; S4_InharmExp(i) = os.osc(S4_F*i*sqrt(1+ X_T_Harmonicity/10*i*i)); S4_F = 200; S5_Brightness = no.noise : fi.resonlp(S5_fc,0.7,1); S5_fc = S5_fmin * pow(2,(1-X_T_Brightness)*S5_nOct); S5_fmin = 300; S5_nOct = 3.5; tradSoniOut = S1_Pitch,S2_Tempo,S3_Synchronicity,S4_Inharmonicity,S5_Brightness : ba.selectn(5,Soni_Choice_Trad) <: _,_; // // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // track1 = kickTrack : stereoMasterSection(1); track2 = snareTrack : stereoMasterSection(2); track3 = hhTrack : stereoMasterSection(3); track4 = chordTrack : stereoMasterSection(4); track5 = riffTrack : stereoMasterSection(5); track6 = melodyTrack : stereoMasterSection(6); track7 = chordStabTrack : stereoMasterSection(7); track8 = crashTrack : stereoMasterSection(8); percBus = track1,track2,track3,track8; reverbBus = track2,track3,track4,track6,track7 : par(i,5,stereodBGain(ba.take(i+1,REV_SND))) :> reverbMaster; melBus = track4,track5,track6,track7,reverbBus :> _,_; masterChannel = masterComp : stereoEffect(parametricEQ(masterEQGroup)) : stereoEffect(Soni_R3_Filter) : stereoLinGain(masterGain) : stereoEffect(masterLimiter(0)) : stereoEffect(hard_clip(1)); musicBus = melBus,percBus,reverbBus :> masterChannel; process = musicBus,tradSoniOut : ba.select2stereo(sonificationType);
https://raw.githubusercontent.com/prithviKantanAAU/sliderSoniFinal/571109d221f5eadc4d6cc410c1220e5fa387b47e/sliderSoniFinal.dsp
faust
// // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // Panner Dotted Delay FM Synth Piano Single Note Full Chord Synth MUSIC Trackwise SYNTH // 1, 2, 3, 8 are sample-based 4 - CHORD SYNTH MALLET FM 5 - BASSLINE BASSLINE FM AGGRO FM 6 - MAIN MELODY TRUMPETISH FM 7 Sonifications CHORD FREQ DIST FACTORS INSTRUMENTATION BRIGHTNESS TONIC PITCH PITCHED WAVE WHOOSH NOISE " BUSS REVERB PRE-DELAY DC/MID CROSSOVER FREQ MID/HI CROSSOVER FREQ RT60 - DC FS MAX FC - LOWER FC - UPPER REVERB SENDS // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // TABS SLIDER GROUPS MUSIC INFO TAB MIX AND MASTER TAB EQ TAB COMP TAB Tempo and Fluidity Traditional Soni Variants Music Info NOTE NUMBERS 4-1 4-2 4-3 4-4 5 6 7-1 7-2 7-3 7-4 Accent Info 6 4-1 4-2 4-3 4-4 5 VELOCITIES 1 2 Snare - File Number 3 HH - File Number 4-1 4-2 4-3 4-4 4 - LIST 5 6 7 8 Sonification Sliders and Preprocessing TRADITIONAL MUSICAL // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // UTILITY CONVERT VELOCITY VALUE TO TRIGGER ON CHANGE CONVERT 0-10 VELOCITY VALUE TO MONO GAIN MULTIPLIER TEMPO-BASED INSTRUMENT RELEASE FACTOR MASTER LIMITER SHORT STRUM DELAY CHANNEL PROCESSORS - MONO AND STEREO PREPROCESS CHORD FREQUENCIES CREATE FREQ LIST APPLY TUNING SONIFICATIONS CALCULATE CHORD DIST AMOUNT GET INDIVIDUAL MIDI KEYS GET STEREO PAN GAINS SPLIT AND MULTIPLY L-MULTIPLIER R-MULTIPLIER CHANNEL COMP CHANNEL EQ 3 - Effects Dotted Delay Compressor-Limiter CALCULATE GAIN REDUCTION SMOOTH KNEE Master COMP Reverb Master TEMPO DEPENDENT RT60 OUTPUT FILTER 4 - Synthesis OUTPUT SUMMING MEL COMPONENT MEL ENVELOPE CF DIST SONI - VIBRATO LFO SYNTH - FM DIST MIX (1)CARRIER + MOD FREQ LIST MOD DEPTH LIST COOKED DEPTH AMP ENVELOPE DC CORRECTED OUTPUT WAVE PULSE UP TIME PUlSE TOTAL PERIOD WAVESUMMING FC FREQUENCY ENV AMPLITUDE ENV INDIVIDUAL FREQS CALCULATE DELAY F1 F2 F3 F4 SUM + ENVELOPE CALCULATE DELAY LENGTH + TUNING COMPENSATE DAMPING FB FILTER KARPLUS STRONG NOISE EXCITATION // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // MASTER FILTER - LPF R3 - BRIGHTNESS CALCULTE CUTOFF CALCULATE F-DEPENDENT Q // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRIGGERS Kick Snare HH Chord LIST MIDI KEYS MIDI KEYS TO FREQ ACCENTS FREQ SELECTOR VEL SELECTOR TRG SELECTOR ACC SELECTOR CHORD - SF VARIANT 1 CHORD - SF VARIANT 2 Riff CALCULATE F0 HZ RIFF VARIANT 1 RIFF VARIANT 2 RIFF VARIANT 2 Melody Main MELODY SF - VARIANT 1 MELODY SF - VARIANT 2 MELODY SF - VARIANT 3 DEFINE STEREO DOTTED DELAY SYNTHESIZE MELODY Chord Stabs GET F0 LIST GET ENV DEFINE DOTTED DELAY CS SYNTH Crash // // // // // // // // // // // // // // // // // // // // // // // // // // // TRADITIONAL STRATEGIES // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
import("stdfaust.lib"); NUM_PANPOS = 7; DOTDEL_FC_HP = 800; DOTDEL_FC_LP = 2000; FM_DISTMIX = 0.05; PIANO_WAVEWIDTH1 = 33; PIANO_WAVEWIDTH2 = 10; PIANO_WAVEWIDTH3 = 66; CS_DEL_N1 = 0.015; CS_DEL_N2 = 0.030; CS_DEL_N3 = 0.045; PANPOS_NOTES = 3,4,5,6; AT_C = 0.001; RL_C = 1; FV_C = 1; MALLET_MRATIO = 2; MALLET_I_FIXED = 2.4; MALLET_I_ENV = 6.86; MALLET_A = 0.001; MALLET_D = 0.001; MALLET_S = 0.5; MALLET_R = 0.4; MALLET_ENVTYPE = 0; AT_R = 0.001; RL_R = 0.6 + (tempo < 120)*(120-tempo)*0.06; MOD_NUM_R = 5; FREQ_FACTOR_R = 3; MOD_DEPTH_R = 35; BASSLINE_MRATIO = 2; BASSLINE_I_FIXED = 6.75; BASSLINE_I_ENV = 7.46; BASSLINE_A = 0.007; BASSLINE_D = 0.001; BASSLINE_S = 0.6553; BASSLINE_R = 0.65; BASSLINE_ENVTYPE = 1; AGGRO_MRATIO = 3; AGGRO_I_FIXED = 10; AGGRO_I_ENV = 10; AGGRO_A = 0.01; AGGRO_D = 0.0001; AGGRO_S = 0.5; AGGRO_R = 0.867; AGGRO_ENVTYPE = 1; AT_M = 0.001; RL_M = 4; FB_DEL_M = 0.5; WET_DEL_M = 0.8; FC_LP_M = 20000; G_SIN_M = -90; G_NS_M = -90; RL_NS_M = 0.05; FC_HP_NS_M = 3000; TRUMPET_MRATIO = 1; TRUMPET_I_FIXED = 10; TRUMPET_I_ENV = 10; TRUMPET_A = 0.05; TRUMPET_D = 0.0001; TRUMPET_S = 0.5; TRUMPET_R = 0.78; TRUMPET_ENVTYPE = 1; AT_CS = 0.001; RL_CS = 5; FB_DEL_CS = 0.8; WET_DEL_CS = 0.4; DMP_KS_CS = 0.99; FREQ_OFFSET_LR = 0.7; SONI_SB_Z2_ONOFF = waveform {1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1}; SONI_SB_Z2_ONOFF_RD(i) = SONI_SB_Z2_ONOFF,i : rdtable; REV_SND = -8,-10,-5,0,-5; musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); mixMasterTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); traditionalSoni(x) = sonificationTab(vgroup("Traditional_Strategies",x)); pitchInfo(x) = musicInfoTab(vgroup("Pitch",x)); accentInfo(x) = musicInfoTab(vgroup("Accent",x)); velocityInfo(x) = musicInfoTab(vgroup("Velocity",x)); trackGainGroup(x) = mixMasterTab(vgroup("Track Gain",x)); trackMuteGroup(x) = mixMasterTab(vgroup("Track Mute",x)); masterGainGroup(x) = mixMasterTab(vgroup("Master Gain",x)); masterEQGroup(x) = mixMasterTab(vgroup("Master EQ",x)); variantGroup(x) = mixMasterTab(vgroup("Track Variant",x)); eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); fluidity = musicInfoTab(vslider("Fluidity",1,0.05,10,0.01)) : limit(0.2,5); sonificationType = checkbox("Traditional"); Soni_X_Trad = traditionalSoni(hslider("x_Traditional",0,0,1,0.001)) : si.smoo; Soni_Choice_Trad = traditionalSoni(hslider("Choice_Traditional",0,0,4,1)); VAR_1 = variantGroup(nentry("Variant_1",1,1,3,1)); VAR_2 = variantGroup(nentry("Variant_2",1,1,3,1)); VAR_3 = variantGroup(nentry("Variant_3",1,1,3,1)); VAR_4 = variantGroup(nentry("Variant_4",1,1,3,1)); VAR_5 = variantGroup(nentry("Variant_5",1,1,3,1)); VAR_6 = variantGroup(nentry("Variant_6",1,1,3,1)); VAR_7 = variantGroup(nentry("Variant_7",1,1,3,1)); VAR_8 = variantGroup(nentry("Variant_8",1,1,3,1)); soniSlider(idx,defaultVal) = sonificationTab(vgroup("AP Values",hslider("Soni %idx",defaultVal,0,1,0.001))); X_T_Pitch = soniSlider(1,0); X_T_Tempo = soniSlider(2,0); X_T_Synchronicity = soniSlider(3,0); X_T_Harmonicity = soniSlider(4,0); X_T_Brightness = soniSlider(5,0); X_M_MelDegree = soniSlider(6,0); X_M_Tempo = soniSlider(7,0); X_M_Synchronicity = soniSlider(8,0); X_M_Harmonicity = soniSlider(9,0); X_M_Brightness = soniSlider(10,0); SONI_GAIN_DB = masterGainGroup(vslider("Soni Buss Gain",-8,-10,2,0.01)); masterGain = masterGainGroup(vslider("Master Gain",-6,-96,12,0.01) : ba.db2linear); BT_SMPL = ba.tempo(tempo); stereoLinGain(gain) = _,_ : *(gain),*(gain); stereodBGain(gain) = _,_ : *(linGain),*(linGain) with { linGain = ba.db2linear(gain); }; stereoLinMult(gainPair) = _,_ : *(gainPair : select2(0)),*(gainPair : select2(1)); stereoEffect(effect) = _,_ : effect,effect; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; velToTrigger(vel) = trigger with { trigger = (posTrig + negTrig); posTrig = vel : ba.impulsify; negTrig = - 1 * (vel) : ba.impulsify : *(vel > 0); }; applyVelocity(velocity,trigger,maxVel) = _ : *(gainMult) with { sampledVel = velocity : ba.sAndH(trigger); dBGain = (sampledVel - 10) * 26.0 / 9.0; gainMult = ba.db2linear(dBGain); }; tempo_RelFactor = fluidity + 1.5 * (120-tempo) / 40 * (tempo < 120); masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); shortDelay(d_ms) = stereoEffect(de.fdelay(5000,d_ms*ma.SR)); monoChannel(trackIndex) = *(0.25) : channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)); stereoChannel(trackIndex) = stereoLinGain(0.25) : stereoEffect(channelComp(compTrackGroup(trackIndex))) : stereoEffect(parametricEQ(eqTrackGroup(trackIndex))); getChordFinalFreqs(LIST) = freqs with { }; getPanFunction(panIndex) = panFunction with { }; channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",2000,1500,15000,0.01))); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); }; dotted_delay(feedback,delay,wet) = +~(de.delay(100000,del) : filt)*feedback*wet :> _ with { filt = fi.bandpass(2,DOTDEL_FC_HP,DOTDEL_FC_LP); del = 0.75*delay; }; compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); masterComp = stereoEffect(compLimiter(0,1.01,-20,100,300,0.05)) : stereoEffect(compLimiter(0,1.1,-5,50,200,0.05)) : stereodBGain(2); reverbMaster = _,_ <: re.zita_rev1_stereo(REV_MST_PDEL_MS,REV_MST_F_DC_MID,REV_MST_F_MID_HI,REV_MST_T60_DC,rt_60,REV_MST_FsMax) : filter with { }; stereoMasterSection(trackIndex) = stereoOut with { stereoOut = stereoLinGain(trackGain) : stereoLinGain(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,24,0.01) : ba.db2linear); trackMute = trackMuteGroup(checkbox("%trackIndex")); }; samplePlayer(fileFunc,trigger) = fileFunc(ba.countup(96000,trigger)); K_FILES = soundfile("K_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V3.wav'}]",1) : !,!,_; S_V1_FILES = soundfile("S_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_3.wav'}]",1) : !,!,_; S_V2_FILES = soundfile("S_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_3.wav'}]",1) : !,!,_; S_V3_FILES = soundfile("S_SMPL_V3[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_3.wav'}]",1) : !,!,_; CR_FILES = soundfile("CR_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V3.wav'}]",1) : !,!,_; HH_V1_FILES = soundfile("HH_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_3.wav'}]",1) : !,!,_; HH_V2_FILES = soundfile("HH_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_3.wav'}]",1) : !,!,_; K_SMPL_V1(i) = 0,i : K_FILES; K_SMPL_V2(i) = 1,i : K_FILES; K_SMPL_V3(i) = 2,i : K_FILES; S_SMPL_V1_1(i) = 0,i : S_V1_FILES; S_SMPL_V1_2(i) = 1,i : S_V1_FILES; S_SMPL_V1_3(i) = 2,i : S_V1_FILES; S_SMPL_V2_1(i) = 0,i : S_V2_FILES; S_SMPL_V2_2(i) = 1,i : S_V2_FILES; S_SMPL_V2_3(i) = 2,i : S_V2_FILES; S_SMPL_V3_1(i) = 0,i : S_V3_FILES; S_SMPL_V3_2(i) = 1,i : S_V3_FILES; S_SMPL_V3_3(i) = 2,i : S_V3_FILES; CR_SMPL_V1(i) = 0,i : CR_FILES; CR_SMPL_V2(i) = 1,i : CR_FILES; CR_SMPL_V3(i) = 2,i : CR_FILES; HH_SMPL_V1_1(i) = 0,i : HH_V1_FILES; HH_SMPL_V1_2(i) = 1,i : HH_V1_FILES; HH_SMPL_V1_3(i) = 2,i : HH_V1_FILES; HH_SMPL_V2_1(i) = 0,i : HH_V2_FILES; HH_SMPL_V2_2(i) = 1,i : HH_V2_FILES; HH_SMPL_V2_3(i) = 2,i : HH_V2_FILES; fmSynth_Versatile(fc,modRatio,I_fixed,I_ampDependent,a,d,s,r,envType,trigger,vel,acc) = output with { fc_cooked = fc : si.smooth(ba.tau2pole(0.005)); acc_cooked = 1 + (acc-5.0)/5.0; output = os.osc(fc_cooked + dev) * ampEnv; dev = I * ampEnv * modFreq * os.triangle(modFreq); I = I_fixed + (I_ampDependent * acc_cooked * (0.5 + velFactor) + I_freq) * (ampEnv); I_freq = 4 * (fc - 300)/300; modFreq = (modRatio + X_M_Harmonicity) * fc_cooked; release_basic = ba.tempo(ba.tempo(tempo))/ma.SR * (1 + velFactor * 2); env_basic = en.ar(a,release_basic,trigger); triggerCooked = (env_basic > 0.5) + (env_basic > env_basic'); chosenEnv = en.adsr(a,d,s,r*tempo_RelFactor,triggerCooked), en.adsre(a,d,s,r*tempo_RelFactor,triggerCooked), en.ar(a,r*tempo_RelFactor,trigger), en.are(a,r*tempo_RelFactor,trigger), en.arfe(a,r*tempo_RelFactor,0.3,trigger) : ba.selectn(5,envType); ampEnv = chosenEnv : si.smooth(ba.tau2pole(a)); velFactor = 1 : applyVelocity(vel,trigger,9); }; leadSynth(fundamental,synthFunc,velocity,trigger,synthRelease,synthCutoff,acc) = output with { fundamentalCooked = 2 * fundamental * soniVibratoLFO * accVibrato : limit(20,5000); vibLFO = os.osc(tempo/15); accVibrato = 1 + (0.00045 * acc * vibLFO) : si.smooth(ba.tau2pole(0.001)); }; fmSynth(fundamental,numMod,freqFactor,release,depth,trigger) = (fmSynth + dirtyBus) * env with { }; pulseWave(freq,widthPercent) = output with { }; pianoSim_singleNote(freq,trigger,acc) = monoOut with { monoOut = pulseWave(freq,PIANO_WAVEWIDTH1),pulseWave(freq, }; voiceSynth_FormantBP(freq,vel,trigger,acc) = pm.SFFormantModelBP(2,vowel_H,fric,freqLow,0.04) * env : fi.resonlp(8000,3,1) with { fric = 0.13 - acc/10.0 * 0.13 : max(0); freqLow = freq / 2.0; vowel_idx = 0; env = en.ar(0.02, 1.5 / tempo * 78.6 * tempo_RelFactor * (1 + acc/5.0), trigger); vowel_H = vowel_idx : si.smooth(ba.tau2pole(0.01)); }; fullChordSynth(freqList,synthFunc,env) = stereoChordOut with { }; chordSingle_Synth(freq,acc,synthFunc) = noteOut with { noteOut = synthFunc(freq,acc),synthFunc(freq + 0.5,acc); }; ks(freq,damping) = +~((de.fdelay4(1024,del)*damping) : dampingFilter) with { freqCooked = freq * 1.0116; }; staticBalanceMult(z) = 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 5), 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 6) : stereoEffect(si.smoo); { }; TRG_K = velToTrigger(V_K); TRG_S = velToTrigger(V_S); TRG_HH = velToTrigger(V_HH); TRG_C_1 = velToTrigger(V_C_1); TRG_C_2 = velToTrigger(V_C_2); TRG_C_3 = velToTrigger(V_C_3); TRG_C_4 = velToTrigger(V_C_4); TRG_LIST_C = TRG_C_1,TRG_C_2,TRG_C_3,TRG_C_4; TRG_R = velToTrigger(V_R); TRG_M = velToTrigger(V_M); TRG_CS = velToTrigger(V_CS); TRG_CR = velToTrigger(V_CR); kick_V1 = samplePlayer(K_SMPL_V1,TRG_K); kick_V2 = samplePlayer(K_SMPL_V2,TRG_K); kick_V3 = samplePlayer(K_SMPL_V3,TRG_K); kickSynth = kick_V1,kick_V2,kick_V3 : ba.selectn(3,VAR_1 - 1); kick_Normal = kickSynth : applyVelocity(V_K,TRG_K,9); kickTrack = kick_Normal,(kickSynth * 1.4) :> monoChannel(1) : getPanFunction(0); snare_V1 = samplePlayer(S_SMPL_V1_1,TRG_S), samplePlayer(S_SMPL_V1_2,TRG_S),samplePlayer(S_SMPL_V1_3,TRG_S) : ba.selectn(3,S_FNUM); snare_V2 = samplePlayer(S_SMPL_V2_1,TRG_S), samplePlayer(S_SMPL_V2_2,TRG_S),samplePlayer(S_SMPL_V2_3,TRG_S) : ba.selectn(3,S_FNUM); snare_V3 = samplePlayer(S_SMPL_V3_1,TRG_S), samplePlayer(S_SMPL_V3_2,TRG_S),samplePlayer(S_SMPL_V3_3,TRG_S) : ba.selectn(3,S_FNUM); snareSynth = snare_V1,snare_V2,snare_V3 : ba.selectn(3,VAR_2 - 1); snare_Normal = snareSynth : applyVelocity(V_S,TRG_S,3); snareTrack = snare_Normal,(snareSynth * 1.4) :> monoChannel(2) : getPanFunction(0); hh_V1 = samplePlayer(HH_SMPL_V1_1,TRG_HH), samplePlayer(HH_SMPL_V1_2,TRG_HH),samplePlayer(HH_SMPL_V1_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V2 = samplePlayer(HH_SMPL_V2_1,TRG_HH), samplePlayer(HH_SMPL_V2_2,TRG_HH),samplePlayer(HH_SMPL_V2_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V3 = pm.marimba(800,0.75,5000,1,1,TRG_HH) * 10; hhSynth = hh_V1,hh_V2,hh_V3 : ba.selectn(3,VAR_3 - 1); hhTrack = hhSynth : applyVelocity(V_HH,TRG_HH,3) : monoChannel(3) : getPanFunction(1); chord_SF_V2(trigger,freq,acc) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, chord_SF_V3(trigger,freq,acc) = os.CZresTrap(0.5*(1+os.osc(freq)),4.54 * (1 + pow(acc/5,2))) * en.are(0.001,2 * tempo_RelFactor,trigger); chord_notePanFunc(idx) = ba.take(idx+1,PANPOS_NOTES); chordSynthFunc(trigger,freq,acc) = chord_SF_V1(trigger,freq,acc), chord_SF_V2(trigger,freq,acc), chord_SF_V3(trigger,freq,acc) : ba.selectn(3,VAR_4 - 1); chordSum = par(i,4,chordSingle_Synth(chordFreq(i), chordAcc(i), chordSynthFunc(chordTrg(i))) : stereoEffect(applyVelocity(chordVel(i),chordTrg(i),9))) :> _,_; chordTrack = chordSum : stereoChannel(4); riff_V2 = fmSynth_Versatile(F0_R,BASSLINE_MRATIO,BASSLINE_I_FIXED,BASSLINE_I_ENV, riff_V3 = fmSynth_Versatile(F0_R,AGGRO_MRATIO,AGGRO_I_FIXED,AGGRO_I_ENV, riffSynth = riff_V1,riff_V2,riff_V3 : ba.selectn(3,VAR_5 - 1); riffTrack = riffSynth : applyVelocity(V_R,TRG_R,9) : monoChannel(5) : getPanFunction(0); F0_M = KEYNUM_M; V_M_SUS = V_M : ba.sAndH(TRG_M); M_FreqFactor = (F0_M - 300)/700 : si.smooth(ba.tau2pole(0.001)); M_V2(freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, M_V3(freq) = fmSynth_Versatile(freq,TRUMPET_MRATIO,TRUMPET_I_FIXED,TRUMPET_I_ENV, M_SynthFunc(freq) = M_V1(freq),M_V2(freq),M_V3(freq) : ba.selectn(3,VAR_6 - 1); melodyTrack = melodySynth : M_FX1 : stereoChannel(6); KEYNUM_LIST_CS = KEYNUM_CS_1,KEYNUM_CS_2,KEYNUM_CS_3,KEYNUM_CS_4; CS_V1(freq) = ks_excitation(TRG_CS) : ks(freq,DMP_KS_CS); CS_V2(freq) = os.triangle(freq); CS_V3(freq) = os.sawtooth(freq); SynthFunc_CS(freq) = CS_V1(freq),CS_V2(freq),CS_V3(freq) : ba.selectn(3,VAR_7 - 1); chordStabTrack = CSTrack : stereoChannel(7); crash_V1 = samplePlayer(CR_SMPL_V1,TRG_CR); crash_V2 = samplePlayer(CR_SMPL_V2,TRG_CR); crash_V3 = samplePlayer(CR_SMPL_V3,TRG_CR); crashSynth = crash_V1,crash_V2,crash_V3 : ba.selectn(3,VAR_8 - 1); crashTrack = crashSynth : applyVelocity(V_CR,TRG_CR,9) : monoChannel(8) : getPanFunction(2); S1_Pitch = os.osc(S1_freq) *(0.5); S1_freq = S1_fmin * pow(2,X_T_Pitch*S1_nOct); S1_fmin = 300; S1_nOct = 3.5; S2_Tempo = os.osc(1000) * en.ar(0.001,0.05,S2_PulseTrain) *(0.5); S2_PulseTrain = ba.pulse(S2_SampleInterval); S2_TempoMax = 20*60; S2_TempoMin = 2*60; S2_IntervalRange = ba.tempo(S2_TempoMin) - ba.tempo(S2_TempoMax); S2_SampleInterval = ba.tempo(S2_TempoMax) + X_T_Tempo * (S2_IntervalRange); S3_Synchronicity = (S3_OriginalTrain + S3_Delayed) : en.ar(0.001,0.05) : *(os.osc(1000) *(0.5)); S3_PulseFreq = 3; S3_PeriodSamples = ba.sec2samp(1/S3_PulseFreq); S3_MaxSampleDelay = 0.25 * S3_PeriodSamples; S3_CurrentDelay = S3_MaxSampleDelay * X_T_Synchronicity; S3_OriginalTrain = ba.pulse(S3_PeriodSamples); S3_Delayed = S3_OriginalTrain : de.fdelay(40000,S3_CurrentDelay); S4_Inharmonicity = (os.osc(S4_F) + S4_addedPartials) * 0.15; S4_addedPartials = par(i,15,S4_InharmExp(i)) :> _; S4_InharmExp(i) = os.osc(S4_F*i*sqrt(1+ X_T_Harmonicity/10*i*i)); S4_F = 200; S5_Brightness = no.noise : fi.resonlp(S5_fc,0.7,1); S5_fc = S5_fmin * pow(2,(1-X_T_Brightness)*S5_nOct); S5_fmin = 300; S5_nOct = 3.5; tradSoniOut = S1_Pitch,S2_Tempo,S3_Synchronicity,S4_Inharmonicity,S5_Brightness : ba.selectn(5,Soni_Choice_Trad) <: _,_; track1 = kickTrack : stereoMasterSection(1); track2 = snareTrack : stereoMasterSection(2); track3 = hhTrack : stereoMasterSection(3); track4 = chordTrack : stereoMasterSection(4); track5 = riffTrack : stereoMasterSection(5); track6 = melodyTrack : stereoMasterSection(6); track7 = chordStabTrack : stereoMasterSection(7); track8 = crashTrack : stereoMasterSection(8); percBus = track1,track2,track3,track8; reverbBus = track2,track3,track4,track6,track7 : par(i,5,stereodBGain(ba.take(i+1,REV_SND))) :> reverbMaster; melBus = track4,track5,track6,track7,reverbBus :> _,_; masterChannel = masterComp : stereoEffect(parametricEQ(masterEQGroup)) : stereoEffect(Soni_R3_Filter) : stereoLinGain(masterGain) : stereoEffect(masterLimiter(0)) : stereoEffect(hard_clip(1)); musicBus = melBus,percBus,reverbBus :> masterChannel; process = musicBus,tradSoniOut : ba.select2stereo(sonificationType);
d79e72cefb0c0091dff28137661f6785c7ec0886c6728a430186e8e5e5b09e49
prithviKantanAAU/SMC2022_AG_Code_Data
RSMC - LATEST FAUST.dsp
// // // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // import("stdfaust.lib"); numStyles = 4; numScales = 5; freqOffset_LR = 0.5; kickNoise = multiNoiseSelector(0); snareNoise = multiNoiseSelector(1); hhNoise = multiNoiseSelector(2); melodyNoise = multiNoiseSelector(3); crashNoise = multiNoiseSelector(4); major_scale = waveform{-1,0,2,4,5,7,9,11,12,14,16,17}; majorScaleTable(i) = major_scale,i : rdtable; minor_scale = waveform{-2,0,2,3,5,7,8,10,12,14,15,17,19,20,22,24}; minorScaleTable(i) = minor_scale,i : rdtable; phrygian_scale = waveform{-2,0,1,3,5,7,8,10,12,13,15,17}; phrygianScaleTable(i) = phrygian_scale,i : rdtable; arabic_scale = waveform{-2,0,1,4,5,7,8,10,12,13,16,17,19,20,22,24}; arabicScaleTable(i) = arabic_scale,i : rdtable; pentatonic_scale = waveform{-2,0,2,3,5,6,7,10,12,14,15,17,19,22,24,26}; pentatonicScaleTable(i) = pentatonic_scale,i : rdtable; // Order = Major Minor Maj7 Min7 Dominant Maj9 Min9 Power chord_Seconds = 4,3,4,3,4,4,3,7; chord_Thirds = 7,7,7,7,7,7,7,12; chord_Fourths = 12,12,11,10,10,14,14,19; hh_S1_FreqList = 14903, 20715, 72502; hh_S1_DepthList = 8516,8516; hh_S1_Carrier = 14903; hh_S1_Release = 0.15; crash_S1_FreqList = 2100, 6500, 9543; crash_S1_DepthList = 8516,8516; crash_S1_Carrier = 2000; // // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // clockTrigger = button("Master Clock"); clockDiff = clockTrigger - clockTrigger'; masterClock = (clockDiff > 0); musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); melodyInfo(x) = musicInfoTab(vgroup("Melody",x)); chordInfo(x) = musicInfoTab(vgroup("Chords",x)); drumInfo(x) = musicInfoTab(vgroup("Drums",x)); masterGainTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); trackGainGroup(x) = masterGainTab(vgroup("Track Gain",x)); trackMuteGroup(x) = masterGainTab(vgroup("Track Mute",x)); masterGroup(x) = masterGainTab(vgroup("Master Gain",x)); masterEQGroup(x) = masterGainTab(vgroup("Master EQ",x)); masterSoniTypeToggle(x) = masterGainTab(vgroup("Sonification Type",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); basicSoni(x) = sonificationTab(vgroup("Basic_Strategies",x)); referenceSoni(x) = sonificationTab(vgroup("Reference_Strategies",x)); refZoomSoni(x) = sonificationTab(vgroup("RefZoom_Strategies",x)); traditionalSoni(x) = sonificationTab(vgroup("Traditional_Strategies",x)); tonic = musicInfoTab(vslider("Tonic",36,30,42,1)) : limit(20,70); activeScale = musicInfoTab(vslider("Active Scale",1,0,numScales-1,1)) : limit(0,numScales-1); tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); currentStyle = musicInfoTab(vslider("Current Style",0,0,numStyles - 1,1) : limit(0,numStyles - 1)); mf_present = melodyInfo(hslider("MF Current",1,0,9,1) : int : limit(0,9)); mv_present = melodyInfo(hslider("MV Current",4,1,9,0.1) : int : limit(0,9)); mf_octave = melodyInfo(hslider("MF Octave",0,-2,2,1) : int : limit(0,9)); rf_present = melodyInfo(hslider("RF Current",1,0,9,1) : int : limit(0,9)); rv_present = melodyInfo(hslider("RV Current",4,1,9,0.1) : int : limit(0,9)); rf_octave = melodyInfo(hslider("RF Octave",-1,-2,5,1) : int : limit(0,9)); cd_present = chordInfo(hslider("CD Current",1,0,9,1) : int : limit(0,9)); ct_present = chordInfo(hslider("CT Current",1,0,9,1) : int : limit(0,9)); cv_present = chordInfo(hslider("CV Current",4,0,9,1) : int : limit(0,9)); cs_v_present = chordInfo(hslider("CSV Current",4,0,9,1) : int : limit(0,9)); cs_d_present = chordInfo(hslider("CSD Current",0,3,3,1) : int : limit(0,9)); cs_arpMode = chordInfo(hslider("Arp Mode",0,0,1,1) : int : limit(0,9)); kick_v_present = drumInfo(hslider("Kick Velocity",9,0,9,8) : int : limit(0,9)); snare_v_present = drumInfo(hslider("Snare Velocity",9,0,9,8) : int : limit(0,9)); hh_v_present = drumInfo(hslider("HH Velocity",9,0,9,8) : int : limit(0,9)); hh_v_true = hh_v_present : _%(5) : *(2); hh_Openness = 1 + 2 * (hh_v_present > 5); crash_v_present = drumInfo(hslider("Crash Velocity",9,0,9,8) : int : limit(0,9)); //Sonification Soni_X_B1_MelBaseFreq = basicSoni(hslider("x_B1_MelBaseFreq",0,0,1,0.001)) : si.smoo; Soni_X_B2_MelLoudness = basicSoni(hslider("x_B2_MelLoudness",0,0,1,0.001)) : si.smoo; // B3 HANDLED OUTSIDE IN JUCE Soni_X_B4_MelBrightness = basicSoni(hslider("x_B4_MelBrightness",0,0,1,0.001)) : si.smoo; Soni_X_B5_PercRelTime = basicSoni(hslider("x_B5_PercRelTime",0,0,1,0.001)) : si.smoo; Soni_X_R1_InstSynch = referenceSoni(hslider("x_R1_InstSynch",0,0,1,0.001)) : si.smoo; Soni_X_R2_Inharmonicity = referenceSoni(hslider("x_R2_Inharmonicity",0,0,1,0.001)) : si.smoo; Soni_X_R3_Tremolo = referenceSoni(hslider("x_R3_Tremolo",0,0,1,0.001)) : si.smoo; Soni_X_R4_Dist = referenceSoni(hslider("x_R4_Distortion",0,0,1,0.001)) : si.smoo; Soni_X_RZ1_MultiPhaser = refZoomSoni(hslider("x_RZ1_MultiPhaser",0,0,1,0.001)) : si.smoo; Soni_X_RZ2_MultiWah = refZoomSoni(hslider("x_RZ1_MultiWah",0,0,1,0.001)) : si.smoo; Soni_X_Trad = traditionalSoni(hslider("x_Traditional",0,0,1,0.001)) : si.smoo; Soni_Choice_Trad = traditionalSoni(hslider("Choice_Traditional",0,0,8,1)); // // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // 1 - UTILITY noiseMulti = no.multinoise(8); multiNoiseSelector(n) = noiseMulti : ba.selectn(8,n); quarterNoteSampleTime = ba.tempo(tempo); beatTime = 60.0/tempo; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; envAmplitude(velocity) = velocity : ba.sAndH(masterClock * velocity) : si.smooth(ba.tau2pole(0.0001)) : *(0.1); masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); scaleIntervals(activeNoteDegree) = majorScaleTable(activeNoteDegree), minorScaleTable(activeNoteDegree), phrygianScaleTable(activeNoteDegree), arabicScaleTable(activeNoteDegree), pentatonicScaleTable(activeNoteDegree); melodyFundamentalFreq(activeScale,tonic,octave,activeNoteDegree,lowerlim_MIDI,upperlim_MIDI) = ba.midikey2hz(finalMidiValue) : limit(20,5000) : Soni_B1_FreqWarpFactor with { activeInterval = scaleIntervals(activeNoteDegree) : ba.selectn(numScales,activeScale); preliminaryMidiValue = tonic + 12*octave + activeInterval; tooLow = lowerlim_MIDI > preliminaryMidiValue; tooHigh = upperlim_MIDI < preliminaryMidiValue; octavesUnder = (lowerlim_MIDI - preliminaryMidiValue)*tooLow / 12 : +(1*tooLow) : int; octaveOver = (preliminaryMidiValue - upperlim_MIDI)*tooHigh / 12 : +(1*tooHigh) : int; finalMidiValue = preliminaryMidiValue + 12*octavesUnder - 12*octaveOver; }; chordFrequencies(chordDegree,chordType,chordsOctave) = freqList with { activeInterval = scaleIntervals(chordDegree) : ba.selectn(numScales,activeScale); midiTonic = (tonic + 12*chordsOctave + activeInterval); increment_Second = chord_Seconds : ba.selectn(8,chordType); increment_Third = chord_Thirds : ba.selectn(8,chordType); increment_Fourth = chord_Fourths : ba.selectn(8,chordType); midiSecond = midiTonic + increment_Second; midiThird = midiTonic + increment_Third; midiFourth = midiTonic + increment_Fourth; freq1 = midiTonic : ba.midikey2hz : Soni_B1_FreqWarpFactor; freq2 = midiSecond : ba.midikey2hz : Soni_B1_FreqWarpFactor; freq3 = midiThird : ba.midikey2hz : Soni_B1_FreqWarpFactor; freq4 = midiFourth : ba.midikey2hz : Soni_B1_FreqWarpFactor; freqList = freq1,freq2,freq3,freq4; }; getPanFunction(panIndex) = panFunction with { numPanPositions = 3; L_multiplier = 1,0.95,0.2 : ba.selectn(numPanPositions,panIndex); R_multiplier = 1,0.2,0.95 : ba.selectn(numPanPositions,panIndex); panFunction = _ <: _*(L_multiplier), _*(R_multiplier); }; expEnvelope(attack,release,velocity) = en.are(attack,release,triggerCooked) * envAmp : si.smooth(ba.tau2pole(0.001)) with { envAmp = envAmplitude(velocity); triggerCooked = velocity * masterClock; }; chordEnvelope(attack,release,finalVal,velocity) = en.arfe(attack,release,finalVal,triggerCooked) * envAmp : si.smooth(ba.tau2pole(0.001)) with { envAmp = envAmplitude(velocity); triggerCooked = velocity * masterClock; }; // 2 - CHANNEL STRIP channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))) : limit(20,20000); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))) : limit(20,20000); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))) : limit(-24,24); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))) : limit(20,20000); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))) : limit(-24,24); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",500,1500,15000,0.01))) : limit(20,20000); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); }; // 3 - Effects applyStereoFX(index,wet,stereoInput) = outL_final,outR_final with { leftChannel = stereoInput : select2(0); rightChannel = stereoInput : select2(1); numFX = 3; fx1 = _ : _; fx2 = ve.autowah(wet); fx3 = pf.flanger_mono(10,5,wet,0,0); outL_1 = leftChannel : fx1; outR_1 = rightChannel : fx1; outL_2 = leftChannel : fx2; outR_2 = rightChannel : fx2; outL_3 = leftChannel : fx3; outR_3 = rightChannel : fx3; outL_final = outL_1,outL_2,outL_3 : ba.selectn(numFX,index); outR_final = outR_1,outR_2,outR_3 : ba.selectn(numFX,index); }; // Dotted Delay dotted_delay(feedback,delay,wet,condition) = +~(de.fdelay(100000,del) : filt)*feedback*wet*condition :> _ with { filt = fi.bandpass(2,400,1500); del = 0.75*delay; }; // Compressor-Limiter compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); outminusindb(level) = max(level-thresh,0)*(1/ratio - 1); kneesmooth = si.smooth(ba.tau2pole(kneeAtt)); }; // Sidechain Compressor sideChainComp(sidechain,inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(sidechain : an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); outminusindb(level) = max(level-thresh,0)*(1/ratio - 1); kneesmooth = si.smooth(ba.tau2pole(kneeAtt)); }; //4 - Synthesis generalizedDrumSynth(noiseSource ,rel_noise, rel_sine, fPeak_sine, gain_noise, gain_sine, gain_dist, cutoff_LP, cutoff_HP, velocity) = output : masterFilter with { gain_sine_lin = gain_sine : ba.db2linear; gain_noise_lin = gain_noise : ba.db2linear; gain_dist_lin = gain_dist : ba.db2linear; envAmp = envAmplitude(velocity); trig = velocity * masterClock; rel_sine_Sonified = rel_sine * Soni_B5_RelFactor; rel_noise_Sonified = rel_noise * Soni_B5_RelFactor; env_sine = en.are(0.001,rel_sine_Sonified,trig); env_noise = en.are(0.001,rel_noise_Sonified,trig); freq_sine = fPeak_sine * env_sine; osc_sine = os.osc(freq_sine) * env_sine * gain_sine_lin; osc_noise = noiseSource * env_noise * gain_noise_lin; onCondition = (envAmp > 0); defaultOut = 0; cleanBus = (osc_sine + osc_noise) * envAmp; dirtyBus = cleanBus : ef.cubicnl(0.5,0) : _ *(gain_dist_lin); activeOut = cleanBus + dirtyBus; output = defaultOut,activeOut : ba.selectn(2,onCondition); masterFilter = fi.resonlp(cutoff_LP,0.7,1) : fi.resonhp(cutoff_HP,0.7,1); }; fmPercSynth(noiseSource,fmLeveldB,noiseLeveldB,fc_HPF,depthList,freqList,carrierFreq,release,velocity) = output : filter with { envAmp = envAmplitude(velocity); trig = masterClock * velocity; fmLevel = fmLeveldB : ba.db2linear; noiseLevel = noiseLeveldB : ba.db2linear; filter = fi.resonhp(fc_HPF,0.7,3); release_Sonified = release * Soni_B5_RelFactor; env = en.are(0.001,release_Sonified,trig) * envAmp; fmSignal = sy.fm(freqList,depthList) :> _; onCondition = (envAmp > 0); defaultOut = 0; activeOut = fmSignal * fmLevel + noiseSource * noiseLevel : *(env); output = defaultOut,activeOut : ba.selectn(2,onCondition); }; leadSynth(fundamental,synthFunc,noiseSource,velocity,synthRelease,synthCutoff,addedSineLeveldB,noiseLeveldB,noiseRelease,noiseCutoff,fx1,fx2) = output with { trigger = masterClock * velocity; envAmp = envAmplitude(velocity); onCondition = (envAmp > 0); addedSineLevel = addedSineLeveldB : ba.db2linear; noiseLevel = noiseLeveldB : ba.db2linear; //Cooking LFO = 0.5*(1 + 0.7*os.osc(tempo/15) + 0.3*no.noise); freqFactor = envAmp * envAmp; timeFactor = envAmp; synthCutoffCooked = synthCutoff * (0.01 + 0.99*(freqFactor)) : si.smoo : limit(20,20000); releaseCooked = synthRelease * (0.35 + 0.65*(timeFactor)) : limit(0.02,50); fundamentalCooked = fundamental * (1 + 0.015 * freqFactor * LFO) : limit(20,5000); //Synthesis melSynth = ((os.osc(fundamentalCooked) * addedSineLevel + synthFunc(fundamentalCooked)) * en.ar(0.01,synthRelease,trigger)) : fi.resonlp(synthCutoffCooked,0.7,1); noiseSynth = (noiseSource * en.ar(0.001,noiseRelease,trigger) * noiseLevel) : fi.resonlp(noiseCutoff,3,1); defaultOut = 0; activeOut = melSynth + noiseSynth; combiSynth = defaultOut,activeOut : ba.selectn(2,onCondition); output = combiSynth : fx1 : fx2; }; fmSynth(fundamental,numMod,freqFactor,release,depth,velocity) = fmSynth * env with { trigger = masterClock * velocity; depthCooked = depth * velocity; freqList = par(i,numMod,fundamental * pow(freqFactor,i)); depthList = par(i,numMod-1,depthCooked); envAmp = envAmplitude(velocity); env = en.ar(0.005,release, trigger) * envAmp; fmSynth = sy.fm(freqList,depthList); }; fullChordSynth(freqList,synthFunc) = stereoChordOut with { freqSelector(n) = freqList : ba.selectn(4,n-1); freq1Bus = synthFunc(freqSelector(1)),synthFunc(freqSelector(1) + freqOffset_LR); freq2Bus = synthFunc(freqSelector(2)),synthFunc(freqSelector(2) + freqOffset_LR); freq3Bus = synthFunc(freqSelector(3)),synthFunc(freqSelector(3) + freqOffset_LR); freq4Bus = synthFunc(freqSelector(4)),synthFunc(freqSelector(4) + freqOffset_LR); stereoChordOut = freq1Bus,freq2Bus,freq3Bus,freq4Bus :> _,_; }; arpChordSynth(freqList,synthFunc) = stereoNoteOut with { freqSelector(n) = freqList : ba.selectn(4,n-1); stereoNoteOut = synthFunc(freqSelector(cs_d_present)),synthFunc(freqSelector(cs_d_present) + freqOffset_LR); }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Soni_B1_MaxWarpFactor = 5; Soni_B2_A_Max = 0; Soni_B2_A_Min = -80; Soni_B4_Fc_Max = 12000; Soni_B4_Fc_Min = 200; Soni_B5_MaxRelFactor = 5; Soni_R1_MaxDelSec(trackIndex) = 0.1,0.17,0.23,0.29,0.37,0.47,0.59,0.71 : ba.selectn(8,trackIndex); Soni_RZ_OscFreqs(index) = tempo/120, tempo/60, tempo/30 : select3(index); Soni_RZ_LFO_Riff = os.osc(Soni_RZ_OscFreqs(0)); Soni_RZ_LFO_Chords = os.osc(Soni_RZ_OscFreqs(1)); Soni_RZ_LFO_Mel = os.osc(Soni_RZ_OscFreqs(2)); Soni_RZ1_numNotches = 10; Soni_RZ1_notchWidth = 800; Soni_RZ1_notch1Min = 100; Soni_RZ1_notchSpacing = 1.5; Soni_RZ1_notch1Max = 400; Soni_RZ2_wahMinFreq = 250; Soni_RZ2_wahMaxFreq = 5000; Soni_B1_FreqWarpFactor = _*(warpFactor) with { warpFactor = Soni_B1_MaxWarpFactor * Soni_X_B1_MelBaseFreq + 1; }; Soni_B2_AmpMultiplier = -1*(ba.db2linear(Soni_B2_A_Max) - ba.db2linear(Soni_B2_A_Min)) * Soni_X_B2_MelLoudness + ba.db2linear(Soni_B2_A_Max); Soni_B4_Filter = fi.resonlp(cutoff,2.5,1) with {cutoff = Soni_B4_Fc_Max - Soni_X_B4_MelBrightness * (Soni_B4_Fc_Max - Soni_B4_Fc_Min);}; Soni_B5_RelFactor = 1 + Soni_X_B5_PercRelTime * Soni_B5_MaxRelFactor; Soni_R1(maxDelay) = _ : de.fdelay(50000,cookedDelaySamples) with {cookedDelaySamples = maxDelay * Soni_X_R1_InstSynch * ma.SR : ba.sAndH(ba.pulse(ma.SR/2));}; Soni_R2_InharmonicityFX = _ <: *(Soni_X_R2_Inharmonicity*os.osc(tritoneFreq)),*(1-Soni_X_R2_Inharmonicity) :> _ with { tritoneFreq = (tonic + 6) : ba.midikey2hz; }; Soni_R3_TremoloFX = _ <: *(mult * tremoloLFO),*(1-mult) :> _ with { tremoloLFO = 0.5*(1 + os.osc(tempo/60)); mult = Soni_X_R3_Tremolo; }; Soni_R4_Dist = _ <: ef.cubicnl(0.8,0)*(mult),*(1-mult) :> _ with { mult = Soni_X_R4_Dist * (1 - 0.5*Soni_X_R4_Dist); }; Soni_RZ1_Phaser(oscFreq) = _ : pf.phaser2_mono(Soni_RZ1_numNotches,0,Soni_RZ1_notchWidth,Soni_RZ1_notch1Min,Soni_RZ1_notchSpacing,Soni_RZ1_notch1Max,oscFreq ,(1 - Soni_X_RZ1_MultiPhaser),0,0) : _*(ba.db2linear(4*(1 - Soni_X_RZ1_MultiPhaser))); Soni_RZ2_Wah(LFO,minFreq,maxFreq) = _ : fi.peak_eq_cq(currentGain,currentFreq,0.7) : *(ba.db2linear(-0.4*currentGain)) with { LFO_unipolar = 0.5*(LFO + 1); currentFreq = (minFreq + LFO_unipolar*(maxFreq - minFreq)); currentGain = 20 * ( 1- Soni_X_RZ2_MultiWah); }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //Kick kickSynth_S1 = generalizedDrumSynth(kickNoise ,0.113, 0.261, 225, -2, 10.7, -22, 15000, 20, kick_v_present) : *(ba.db2linear(-6)); kickSynth_S2 = os.osc(100); kickSynth_S3 = os.osc(200); kickSynth_S4 = os.osc(300); kickSynth_ChosenStyle = kickSynth_S1,kickSynth_S2,kickSynth_S3,kickSynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(0)); kickTrack = kickSynth_ChosenStyle : channelComp(compTrackGroup(1)) : parametricEQ(eqTrackGroup(1)) : getPanFunction(0); //Snare snareSynth_S1 = generalizedDrumSynth(snareNoise ,0.23, 0.238, 200, 2, 2, -17, 15000, 200, snare_v_present) : *(ba.db2linear(-6)); snareSynth_S2 = os.osc(400); snareSynth_S3 = os.osc(600); snareSynth_S4 = os.osc(800); snareSynth_ChosenStyle = snareSynth_S1,snareSynth_S2,snareSynth_S3,snareSynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(1)); snareTrack =snareSynth_ChosenStyle : channelComp(compTrackGroup(2)) : parametricEQ(eqTrackGroup(2)) : getPanFunction(0); //HH hhSynth_S1 = fmPercSynth(hhNoise,-5,-10,6000,hh_S1_DepthList,hh_S1_FreqList,hh_S1_Carrier,0.18 * hh_Openness,hh_v_true); hhSynth_S2 = os.osc(800); hhSynth_S3 = os.osc(1200); hhSynth_S4 = os.osc(1600); hhSynth_ChosenStyle = hhSynth_S1,hhSynth_S2,hhSynth_S3,hhSynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(2)); hhTrack = hhSynth_ChosenStyle : channelComp(compTrackGroup(3)) : parametricEQ(eqTrackGroup(3)) : getPanFunction(1); //Chord //Frequency currentChordFreqs = chordFrequencies(cd_present,ct_present,1); currentChordSynthFunc(freq) = chordSynthFunc_S1(freq), chordSynthFunc_S2(freq), chordSynthFunc_S3(freq), chordSynthFunc_S4(freq) : ba.selectn(numStyles,currentStyle); //Envelope chordAttack = 0.001, 0.001, 0.001, 0.001 : ba.selectn(numStyles,currentStyle); chordRelease = 0.8, 0.8, 0.8, 0.8 : ba.selectn(numStyles,currentStyle); chordFinalVal = 0.7, 0.5, 0.5, 0.5 : ba.selectn(numStyles,currentStyle); chordEnv = chordEnvelope(chordAttack,chordRelease,chordFinalVal,cv_present); //Synthesis sideChainComp(sidechain,inputGain_dB,ratio,thresh,att,rel,kneeAtt) chordSynthFunc_S1(freq) = os.sawtooth(freq);// : sideChainComp(kickSynth_ChosenStyle,0,7,-10,0.005,0.03,0); chordSynthFunc_S2(freq) = os.square(freq); chordSynthFunc_S3(freq) = os.sawtooth(freq); chordSynthFunc_S4(freq) = os.osc(freq); chordFinal = fullChordSynth(currentChordFreqs,currentChordSynthFunc) : _*chordEnv, _*chordEnv : Soni_R1(Soni_R1_MaxDelSec(3)), Soni_R1(Soni_R1_MaxDelSec(3)) : Soni_RZ1_Phaser(Soni_RZ_OscFreqs(0)), Soni_RZ1_Phaser(Soni_RZ_OscFreqs(0)) : Soni_RZ2_Wah(Soni_RZ_LFO_Chords,Soni_RZ2_wahMinFreq,Soni_RZ2_wahMaxFreq), Soni_RZ2_Wah(Soni_RZ_LFO_Chords,Soni_RZ2_wahMinFreq,Soni_RZ2_wahMaxFreq); chordTrack = chordFinal : channelComp(compTrackGroup(4)),channelComp(compTrackGroup(4)) : parametricEQ(eqTrackGroup(5)),parametricEQ(eqTrackGroup(5)); //Riff riff_fundamental_freq = melodyFundamentalFreq(activeScale,tonic,rf_octave,rf_present,24,38); riffAttackBase = 0.001, 0.001, 0.001, 0.001 : ba.selectn(numStyles,currentStyle); riffReleaseBase = 0.2, 0.15, 0.15, 0.15 : ba.selectn(numStyles,currentStyle); riffSynth_S1 = fmSynth(riff_fundamental_freq,5,3,riffReleaseBase,18,rv_present) * ba.db2linear(12); riffSynth_S2 = os.osc(2000); riffSynth_S3 = os.osc(3000); riffSynth_S4 = os.osc(4000); riffSynth_ChosenStyle = riffSynth_S1, riffSynth_S2, riffSynth_S3, riffSynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(4)) : Soni_RZ1_Phaser(Soni_RZ_OscFreqs(1)) : Soni_RZ2_Wah(Soni_RZ_LFO_Riff,Soni_RZ2_wahMinFreq,Soni_RZ2_wahMaxFreq); riffTrack = riffSynth_ChosenStyle : channelComp(compTrackGroup(5)) : parametricEQ(eqTrackGroup(5)) : getPanFunction(0); //Melody Main melody_fundamental_freq = melodyFundamentalFreq(activeScale,tonic,mf_octave,mf_present,10,80); melodyAttackBase = 0.001, 0.001, 0.001, 0.001 : ba.selectn(numStyles,currentStyle); melodyReleaseBase = 0.4 * 120/tempo, 0.4, 0.4, 0.4 : ba.selectn(numStyles,currentStyle); melody_S1_fx1 = dotted_delay(0.8,quarterNoteSampleTime,0.4,1); melody_S1_fx2 = _ : _; melodySynth_S1 = leadSynth(melody_fundamental_freq,os.sawtooth,melodyNoise,mv_present,melodyReleaseBase,4000,4,-8,0.05,6000,melody_S1_fx1,melody_S1_fx2); melodySynth_S2 = os.sawtooth(melody_fundamental_freq); melodySynth_S3 = os.triangle(melody_fundamental_freq); melodySynth_S4 = os.osc(melody_fundamental_freq); melodySynth_ChosenStyle = melodySynth_S1, melodySynth_S2, melodySynth_S3, melodySynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(5)) : Soni_RZ1_Phaser(Soni_RZ_OscFreqs(1)) : Soni_RZ2_Wah(Soni_RZ_LFO_Mel,Soni_RZ2_wahMinFreq,Soni_RZ2_wahMaxFreq); melodyTrack = melodySynth_ChosenStyle : channelComp(compTrackGroup(6)) : parametricEQ(eqTrackGroup(6)) : getPanFunction(0); //Chord Stabs //Frequency currentChordStabFreqs = chordFrequencies(cd_present,ct_present,2); currentChordStabSynthFunc(freq) = chordStabSynthFunc_S1(freq), chordStabSynthFunc_S2(freq), chordStabSynthFunc_S3(freq), chordStabSynthFunc_S4(freq) : ba.selectn(numStyles,currentStyle); //Envelope chordStabAttack = 0.001, 0.001, 0.001, 0.001 : ba.selectn(numStyles,currentStyle); chordStabRelease = 0.4, 0.4, 0.4, 0.4 : ba.selectn(numStyles,currentStyle); chordStabEnv = expEnvelope(chordAttack,chordRelease,cs_v_present); //Synthesis chordStabSynthFunc_S1(freq) = os.square(freq); chordStabSynthFunc_S2(freq) = os.square(freq); chordStabSynthFunc_S3(freq) = os.sawtooth(freq); chordStabSynthFunc_S4(freq) = os.osc(freq); fullChords = fullChordSynth(currentChordStabFreqs,currentChordStabSynthFunc) : *(0.3), *(0.3); arpChords = arpChordSynth(currentChordStabFreqs,currentChordStabSynthFunc); chordStabSynthCurrent = fullChords, arpChords : ba.select2stereo(cs_arpMode); chordStabFinal = chordStabSynthCurrent : _*chordStabEnv, _*chordStabEnv : Soni_R1(Soni_R1_MaxDelSec(6)), Soni_R1(Soni_R1_MaxDelSec(6)) : Soni_RZ1_Phaser(Soni_RZ_OscFreqs(2)), Soni_RZ1_Phaser(Soni_RZ_OscFreqs(2)); chordStabTrack = chordStabFinal : channelComp(compTrackGroup(7)), channelComp(compTrackGroup(7)) : parametricEQ(eqTrackGroup(7)), parametricEQ(eqTrackGroup(7)); //Crash crashSynth_S1 = fmPercSynth(crashNoise,-6,-5,6000,crash_S1_DepthList,crash_S1_FreqList,crash_S1_Carrier,1.8,crash_v_present); crashSynth_S2 = os.osc(800); crashSynth_S3 = os.osc(1200); crashSynth_S4 = os.osc(1600); crashSynth_ChosenStyle = crashSynth_S1,crashSynth_S2,crashSynth_S3,crashSynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(7)); crashTrack = crashSynth_ChosenStyle : channelComp(compTrackGroup(8)) : parametricEQ(eqTrackGroup(8)) : getPanFunction(2); // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRADITIONAL STRATEGIES // // // // // // // // // // // // // // // // // // // // // // // // // // // // x = Soni_X_Trad; S1_Pitch = os.osc(S1_freq) *(0.5); S1_freq = S1_fmin * pow(2,x*S1_nOct); S1_fmin = 300; S1_nOct = 3.5; S2_Loudness = S2_Amp * os.osc(1000); S2_Amax = -5; S2_Amin = -40; S2_Amp = (ba.db2linear(S2_Amax) - ba.db2linear(S2_Amin)) * x + ba.db2linear(S2_Amin); S3_Tempo = os.osc(1000) * en.ar(0.001,0.05,S3_PulseTrain) *(0.5); S3_PulseTrain = ba.pulse(S3_SampleInterval); S3_TempoMax = 20*60; S3_TempoMin = 2*60; S3_IntervalRange = ba.tempo(S3_TempoMin) - ba.tempo(S3_TempoMax); S3_SampleInterval = ba.tempo(S3_TempoMax) + x * (S3_IntervalRange); S4_Brightness = no.noise : fi.resonlp(S4_fc,0.7,1); S4_fc = S4_fmin * pow(2,(1-x)*S4_nOct); S4_fmin = 300; S4_nOct = 3.5; S5_FluctStrength = (0.5 * os.osc(1000) + 0.5 * os.osc(1000 + 10*x)) *(0.5); S6_Synchronicity = (S6_OriginalTrain + S6_Delayed) : en.ar(0.001,0.05) : *(os.osc(1000) *(0.5)); S6_PulseFreq = 3; S6_PeriodSamples = ba.sec2samp(1/S6_PulseFreq); S6_MaxSampleDelay = 0.25 * S6_PeriodSamples; S6_CurrentDelay = S6_MaxSampleDelay * x; S6_OriginalTrain = ba.pulse(S6_PeriodSamples); S6_Delayed = S6_OriginalTrain : de.fdelay(40000,S6_CurrentDelay); S7_Inharmonicity = (os.osc(S7_F) + S7_addedPartials) * 0.15; S7_addedPartials = par(i,15,S7_InharmExp(i)) :> _; S7_InharmExp(i) = os.osc(S7_F*i*sqrt(1+ x/10*i*i)); S7_F = 200; S8_MBFM = par(i,7,os.triangle(S8_freqExp(i))) :> _ *(0.3); S8_freqExp(i) = i*S8_F + S8_I * os.osc(10*x); S8_I = 30; S8_F = 100; S9_MSB = par(k,S9_N,S9_innerLoop(k)) :> _*(0.5); S9_innerLoop(k) = par(m,S9_M,S9_innerExp(k,m)); S9_innerExp(k,m) = os.osc(S9_F * k *(1 + m*(S9_alpha(x) - 1))); S9_alpha(dist) = 1 + 0.06*(dist); S9_F = 200; S9_N = 5; S9_M = 5; tradSoniOut = S1_Pitch,S2_Loudness,S3_Tempo,S4_Brightness,S5_FluctStrength,S6_Synchronicity,S7_Inharmonicity,S8_MBFM,S9_MSB : ba.selectn(9,Soni_Choice_Trad) <: _,_; // // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // track1 = kickTrack : stereoMasterSection(1); track2 = snareTrack : stereoMasterSection(2); track3 = hhTrack : stereoMasterSection(3); track4 = chordTrack : stereoMasterSection(4); track5 = riffTrack : stereoMasterSection(5); track6 = melodyTrack : stereoMasterSection(6); track7 = chordStabTrack : stereoMasterSection(7); track8 = crashTrack : stereoMasterSection(8); stereoMasterSection(trackIndex) = stereoOut with { stereoOut = _,_ : *(trackGain),*(trackGain) : *(1-trackMute),*(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,12,0.01) : ba.db2linear : si.smoo); trackMute = trackMuteGroup(checkbox("%trackIndex") : si.smoo); }; masterGain = masterGroup(vslider("Master Gain",-12,-96,12,0.01) : ba.db2linear : si.smoo); sonificationType = masterSoniTypeToggle(checkbox("Traditional")); melBuss = track4,track5,track6,track7 :> *(Soni_B2_AmpMultiplier), *(Soni_B2_AmpMultiplier) : Soni_R2_InharmonicityFX,Soni_R2_InharmonicityFX : Soni_R3_TremoloFX,Soni_R3_TremoloFX : Soni_B4_Filter,Soni_B4_Filter : Soni_R4_Dist,Soni_R4_Dist; masterOut = track1,track2,track3,track8,melBuss :> parametricEQ(masterEQGroup) , parametricEQ(masterEQGroup) : _*(masterGain),_*(masterGain) : masterLimiter(0),masterLimiter(0) : hard_clip(1), hard_clip(1); process = masterOut,tradSoniOut : ba.select2stereo(sonificationType);
https://raw.githubusercontent.com/prithviKantanAAU/SMC2022_AG_Code_Data/87c2b2e418934c383676993510e45fcb6df23202/Source/RSMC%20-%20LATEST%20FAUST.dsp
faust
// // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // Order = Major Minor Maj7 Min7 Dominant Maj9 Min9 Power // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // Sonification B3 HANDLED OUTSIDE IN JUCE // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // 1 - UTILITY 2 - CHANNEL STRIP 3 - Effects Dotted Delay Compressor-Limiter Sidechain Compressor 4 - Synthesis Cooking Synthesis // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Kick Snare HH Chord Frequency Envelope Synthesis sideChainComp(sidechain,inputGain_dB,ratio,thresh,att,rel,kneeAtt) : sideChainComp(kickSynth_ChosenStyle,0,7,-10,0.005,0.03,0); Riff Melody Main Chord Stabs Frequency Envelope Synthesis Crash // // // // // // // // // // // // // // // // // // // // // // // // // // // TRADITIONAL STRATEGIES // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
import("stdfaust.lib"); numStyles = 4; numScales = 5; freqOffset_LR = 0.5; kickNoise = multiNoiseSelector(0); snareNoise = multiNoiseSelector(1); hhNoise = multiNoiseSelector(2); melodyNoise = multiNoiseSelector(3); crashNoise = multiNoiseSelector(4); major_scale = waveform{-1,0,2,4,5,7,9,11,12,14,16,17}; majorScaleTable(i) = major_scale,i : rdtable; minor_scale = waveform{-2,0,2,3,5,7,8,10,12,14,15,17,19,20,22,24}; minorScaleTable(i) = minor_scale,i : rdtable; phrygian_scale = waveform{-2,0,1,3,5,7,8,10,12,13,15,17}; phrygianScaleTable(i) = phrygian_scale,i : rdtable; arabic_scale = waveform{-2,0,1,4,5,7,8,10,12,13,16,17,19,20,22,24}; arabicScaleTable(i) = arabic_scale,i : rdtable; pentatonic_scale = waveform{-2,0,2,3,5,6,7,10,12,14,15,17,19,22,24,26}; pentatonicScaleTable(i) = pentatonic_scale,i : rdtable; chord_Seconds = 4,3,4,3,4,4,3,7; chord_Thirds = 7,7,7,7,7,7,7,12; chord_Fourths = 12,12,11,10,10,14,14,19; hh_S1_FreqList = 14903, 20715, 72502; hh_S1_DepthList = 8516,8516; hh_S1_Carrier = 14903; hh_S1_Release = 0.15; crash_S1_FreqList = 2100, 6500, 9543; crash_S1_DepthList = 8516,8516; crash_S1_Carrier = 2000; clockTrigger = button("Master Clock"); clockDiff = clockTrigger - clockTrigger'; masterClock = (clockDiff > 0); musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); melodyInfo(x) = musicInfoTab(vgroup("Melody",x)); chordInfo(x) = musicInfoTab(vgroup("Chords",x)); drumInfo(x) = musicInfoTab(vgroup("Drums",x)); masterGainTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); trackGainGroup(x) = masterGainTab(vgroup("Track Gain",x)); trackMuteGroup(x) = masterGainTab(vgroup("Track Mute",x)); masterGroup(x) = masterGainTab(vgroup("Master Gain",x)); masterEQGroup(x) = masterGainTab(vgroup("Master EQ",x)); masterSoniTypeToggle(x) = masterGainTab(vgroup("Sonification Type",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); basicSoni(x) = sonificationTab(vgroup("Basic_Strategies",x)); referenceSoni(x) = sonificationTab(vgroup("Reference_Strategies",x)); refZoomSoni(x) = sonificationTab(vgroup("RefZoom_Strategies",x)); traditionalSoni(x) = sonificationTab(vgroup("Traditional_Strategies",x)); tonic = musicInfoTab(vslider("Tonic",36,30,42,1)) : limit(20,70); activeScale = musicInfoTab(vslider("Active Scale",1,0,numScales-1,1)) : limit(0,numScales-1); tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); currentStyle = musicInfoTab(vslider("Current Style",0,0,numStyles - 1,1) : limit(0,numStyles - 1)); mf_present = melodyInfo(hslider("MF Current",1,0,9,1) : int : limit(0,9)); mv_present = melodyInfo(hslider("MV Current",4,1,9,0.1) : int : limit(0,9)); mf_octave = melodyInfo(hslider("MF Octave",0,-2,2,1) : int : limit(0,9)); rf_present = melodyInfo(hslider("RF Current",1,0,9,1) : int : limit(0,9)); rv_present = melodyInfo(hslider("RV Current",4,1,9,0.1) : int : limit(0,9)); rf_octave = melodyInfo(hslider("RF Octave",-1,-2,5,1) : int : limit(0,9)); cd_present = chordInfo(hslider("CD Current",1,0,9,1) : int : limit(0,9)); ct_present = chordInfo(hslider("CT Current",1,0,9,1) : int : limit(0,9)); cv_present = chordInfo(hslider("CV Current",4,0,9,1) : int : limit(0,9)); cs_v_present = chordInfo(hslider("CSV Current",4,0,9,1) : int : limit(0,9)); cs_d_present = chordInfo(hslider("CSD Current",0,3,3,1) : int : limit(0,9)); cs_arpMode = chordInfo(hslider("Arp Mode",0,0,1,1) : int : limit(0,9)); kick_v_present = drumInfo(hslider("Kick Velocity",9,0,9,8) : int : limit(0,9)); snare_v_present = drumInfo(hslider("Snare Velocity",9,0,9,8) : int : limit(0,9)); hh_v_present = drumInfo(hslider("HH Velocity",9,0,9,8) : int : limit(0,9)); hh_v_true = hh_v_present : _%(5) : *(2); hh_Openness = 1 + 2 * (hh_v_present > 5); crash_v_present = drumInfo(hslider("Crash Velocity",9,0,9,8) : int : limit(0,9)); Soni_X_B1_MelBaseFreq = basicSoni(hslider("x_B1_MelBaseFreq",0,0,1,0.001)) : si.smoo; Soni_X_B2_MelLoudness = basicSoni(hslider("x_B2_MelLoudness",0,0,1,0.001)) : si.smoo; Soni_X_B4_MelBrightness = basicSoni(hslider("x_B4_MelBrightness",0,0,1,0.001)) : si.smoo; Soni_X_B5_PercRelTime = basicSoni(hslider("x_B5_PercRelTime",0,0,1,0.001)) : si.smoo; Soni_X_R1_InstSynch = referenceSoni(hslider("x_R1_InstSynch",0,0,1,0.001)) : si.smoo; Soni_X_R2_Inharmonicity = referenceSoni(hslider("x_R2_Inharmonicity",0,0,1,0.001)) : si.smoo; Soni_X_R3_Tremolo = referenceSoni(hslider("x_R3_Tremolo",0,0,1,0.001)) : si.smoo; Soni_X_R4_Dist = referenceSoni(hslider("x_R4_Distortion",0,0,1,0.001)) : si.smoo; Soni_X_RZ1_MultiPhaser = refZoomSoni(hslider("x_RZ1_MultiPhaser",0,0,1,0.001)) : si.smoo; Soni_X_RZ2_MultiWah = refZoomSoni(hslider("x_RZ1_MultiWah",0,0,1,0.001)) : si.smoo; Soni_X_Trad = traditionalSoni(hslider("x_Traditional",0,0,1,0.001)) : si.smoo; Soni_Choice_Trad = traditionalSoni(hslider("Choice_Traditional",0,0,8,1)); noiseMulti = no.multinoise(8); multiNoiseSelector(n) = noiseMulti : ba.selectn(8,n); quarterNoteSampleTime = ba.tempo(tempo); beatTime = 60.0/tempo; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; envAmplitude(velocity) = velocity : ba.sAndH(masterClock * velocity) : si.smooth(ba.tau2pole(0.0001)) : *(0.1); masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); scaleIntervals(activeNoteDegree) = majorScaleTable(activeNoteDegree), minorScaleTable(activeNoteDegree), phrygianScaleTable(activeNoteDegree), arabicScaleTable(activeNoteDegree), pentatonicScaleTable(activeNoteDegree); melodyFundamentalFreq(activeScale,tonic,octave,activeNoteDegree,lowerlim_MIDI,upperlim_MIDI) = ba.midikey2hz(finalMidiValue) : limit(20,5000) : Soni_B1_FreqWarpFactor with { activeInterval = scaleIntervals(activeNoteDegree) : ba.selectn(numScales,activeScale); preliminaryMidiValue = tonic + 12*octave + activeInterval; tooLow = lowerlim_MIDI > preliminaryMidiValue; tooHigh = upperlim_MIDI < preliminaryMidiValue; octavesUnder = (lowerlim_MIDI - preliminaryMidiValue)*tooLow / 12 : +(1*tooLow) : int; octaveOver = (preliminaryMidiValue - upperlim_MIDI)*tooHigh / 12 : +(1*tooHigh) : int; finalMidiValue = preliminaryMidiValue + 12*octavesUnder - 12*octaveOver; }; chordFrequencies(chordDegree,chordType,chordsOctave) = freqList with { activeInterval = scaleIntervals(chordDegree) : ba.selectn(numScales,activeScale); midiTonic = (tonic + 12*chordsOctave + activeInterval); increment_Second = chord_Seconds : ba.selectn(8,chordType); increment_Third = chord_Thirds : ba.selectn(8,chordType); increment_Fourth = chord_Fourths : ba.selectn(8,chordType); midiSecond = midiTonic + increment_Second; midiThird = midiTonic + increment_Third; midiFourth = midiTonic + increment_Fourth; freq1 = midiTonic : ba.midikey2hz : Soni_B1_FreqWarpFactor; freq2 = midiSecond : ba.midikey2hz : Soni_B1_FreqWarpFactor; freq3 = midiThird : ba.midikey2hz : Soni_B1_FreqWarpFactor; freq4 = midiFourth : ba.midikey2hz : Soni_B1_FreqWarpFactor; freqList = freq1,freq2,freq3,freq4; }; getPanFunction(panIndex) = panFunction with { numPanPositions = 3; L_multiplier = 1,0.95,0.2 : ba.selectn(numPanPositions,panIndex); R_multiplier = 1,0.2,0.95 : ba.selectn(numPanPositions,panIndex); panFunction = _ <: _*(L_multiplier), _*(R_multiplier); }; expEnvelope(attack,release,velocity) = en.are(attack,release,triggerCooked) * envAmp : si.smooth(ba.tau2pole(0.001)) with { envAmp = envAmplitude(velocity); triggerCooked = velocity * masterClock; }; chordEnvelope(attack,release,finalVal,velocity) = en.arfe(attack,release,finalVal,triggerCooked) * envAmp : si.smooth(ba.tau2pole(0.001)) with { envAmp = envAmplitude(velocity); triggerCooked = velocity * masterClock; }; channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))) : limit(20,20000); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))) : limit(20,20000); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))) : limit(-24,24); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))) : limit(20,20000); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))) : limit(-24,24); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",500,1500,15000,0.01))) : limit(20,20000); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); }; applyStereoFX(index,wet,stereoInput) = outL_final,outR_final with { leftChannel = stereoInput : select2(0); rightChannel = stereoInput : select2(1); numFX = 3; fx1 = _ : _; fx2 = ve.autowah(wet); fx3 = pf.flanger_mono(10,5,wet,0,0); outL_1 = leftChannel : fx1; outR_1 = rightChannel : fx1; outL_2 = leftChannel : fx2; outR_2 = rightChannel : fx2; outL_3 = leftChannel : fx3; outR_3 = rightChannel : fx3; outL_final = outL_1,outL_2,outL_3 : ba.selectn(numFX,index); outR_final = outR_1,outR_2,outR_3 : ba.selectn(numFX,index); }; dotted_delay(feedback,delay,wet,condition) = +~(de.fdelay(100000,del) : filt)*feedback*wet*condition :> _ with { filt = fi.bandpass(2,400,1500); del = 0.75*delay; }; compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); outminusindb(level) = max(level-thresh,0)*(1/ratio - 1); kneesmooth = si.smooth(ba.tau2pole(kneeAtt)); }; sideChainComp(sidechain,inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(sidechain : an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); outminusindb(level) = max(level-thresh,0)*(1/ratio - 1); kneesmooth = si.smooth(ba.tau2pole(kneeAtt)); }; generalizedDrumSynth(noiseSource ,rel_noise, rel_sine, fPeak_sine, gain_noise, gain_sine, gain_dist, cutoff_LP, cutoff_HP, velocity) = output : masterFilter with { gain_sine_lin = gain_sine : ba.db2linear; gain_noise_lin = gain_noise : ba.db2linear; gain_dist_lin = gain_dist : ba.db2linear; envAmp = envAmplitude(velocity); trig = velocity * masterClock; rel_sine_Sonified = rel_sine * Soni_B5_RelFactor; rel_noise_Sonified = rel_noise * Soni_B5_RelFactor; env_sine = en.are(0.001,rel_sine_Sonified,trig); env_noise = en.are(0.001,rel_noise_Sonified,trig); freq_sine = fPeak_sine * env_sine; osc_sine = os.osc(freq_sine) * env_sine * gain_sine_lin; osc_noise = noiseSource * env_noise * gain_noise_lin; onCondition = (envAmp > 0); defaultOut = 0; cleanBus = (osc_sine + osc_noise) * envAmp; dirtyBus = cleanBus : ef.cubicnl(0.5,0) : _ *(gain_dist_lin); activeOut = cleanBus + dirtyBus; output = defaultOut,activeOut : ba.selectn(2,onCondition); masterFilter = fi.resonlp(cutoff_LP,0.7,1) : fi.resonhp(cutoff_HP,0.7,1); }; fmPercSynth(noiseSource,fmLeveldB,noiseLeveldB,fc_HPF,depthList,freqList,carrierFreq,release,velocity) = output : filter with { envAmp = envAmplitude(velocity); trig = masterClock * velocity; fmLevel = fmLeveldB : ba.db2linear; noiseLevel = noiseLeveldB : ba.db2linear; filter = fi.resonhp(fc_HPF,0.7,3); release_Sonified = release * Soni_B5_RelFactor; env = en.are(0.001,release_Sonified,trig) * envAmp; fmSignal = sy.fm(freqList,depthList) :> _; onCondition = (envAmp > 0); defaultOut = 0; activeOut = fmSignal * fmLevel + noiseSource * noiseLevel : *(env); output = defaultOut,activeOut : ba.selectn(2,onCondition); }; leadSynth(fundamental,synthFunc,noiseSource,velocity,synthRelease,synthCutoff,addedSineLeveldB,noiseLeveldB,noiseRelease,noiseCutoff,fx1,fx2) = output with { trigger = masterClock * velocity; envAmp = envAmplitude(velocity); onCondition = (envAmp > 0); addedSineLevel = addedSineLeveldB : ba.db2linear; noiseLevel = noiseLeveldB : ba.db2linear; LFO = 0.5*(1 + 0.7*os.osc(tempo/15) + 0.3*no.noise); freqFactor = envAmp * envAmp; timeFactor = envAmp; synthCutoffCooked = synthCutoff * (0.01 + 0.99*(freqFactor)) : si.smoo : limit(20,20000); releaseCooked = synthRelease * (0.35 + 0.65*(timeFactor)) : limit(0.02,50); fundamentalCooked = fundamental * (1 + 0.015 * freqFactor * LFO) : limit(20,5000); melSynth = ((os.osc(fundamentalCooked) * addedSineLevel + synthFunc(fundamentalCooked)) * en.ar(0.01,synthRelease,trigger)) : fi.resonlp(synthCutoffCooked,0.7,1); noiseSynth = (noiseSource * en.ar(0.001,noiseRelease,trigger) * noiseLevel) : fi.resonlp(noiseCutoff,3,1); defaultOut = 0; activeOut = melSynth + noiseSynth; combiSynth = defaultOut,activeOut : ba.selectn(2,onCondition); output = combiSynth : fx1 : fx2; }; fmSynth(fundamental,numMod,freqFactor,release,depth,velocity) = fmSynth * env with { trigger = masterClock * velocity; depthCooked = depth * velocity; freqList = par(i,numMod,fundamental * pow(freqFactor,i)); depthList = par(i,numMod-1,depthCooked); envAmp = envAmplitude(velocity); env = en.ar(0.005,release, trigger) * envAmp; fmSynth = sy.fm(freqList,depthList); }; fullChordSynth(freqList,synthFunc) = stereoChordOut with { freqSelector(n) = freqList : ba.selectn(4,n-1); freq1Bus = synthFunc(freqSelector(1)),synthFunc(freqSelector(1) + freqOffset_LR); freq2Bus = synthFunc(freqSelector(2)),synthFunc(freqSelector(2) + freqOffset_LR); freq3Bus = synthFunc(freqSelector(3)),synthFunc(freqSelector(3) + freqOffset_LR); freq4Bus = synthFunc(freqSelector(4)),synthFunc(freqSelector(4) + freqOffset_LR); stereoChordOut = freq1Bus,freq2Bus,freq3Bus,freq4Bus :> _,_; }; arpChordSynth(freqList,synthFunc) = stereoNoteOut with { freqSelector(n) = freqList : ba.selectn(4,n-1); stereoNoteOut = synthFunc(freqSelector(cs_d_present)),synthFunc(freqSelector(cs_d_present) + freqOffset_LR); }; Soni_B1_MaxWarpFactor = 5; Soni_B2_A_Max = 0; Soni_B2_A_Min = -80; Soni_B4_Fc_Max = 12000; Soni_B4_Fc_Min = 200; Soni_B5_MaxRelFactor = 5; Soni_R1_MaxDelSec(trackIndex) = 0.1,0.17,0.23,0.29,0.37,0.47,0.59,0.71 : ba.selectn(8,trackIndex); Soni_RZ_OscFreqs(index) = tempo/120, tempo/60, tempo/30 : select3(index); Soni_RZ_LFO_Riff = os.osc(Soni_RZ_OscFreqs(0)); Soni_RZ_LFO_Chords = os.osc(Soni_RZ_OscFreqs(1)); Soni_RZ_LFO_Mel = os.osc(Soni_RZ_OscFreqs(2)); Soni_RZ1_numNotches = 10; Soni_RZ1_notchWidth = 800; Soni_RZ1_notch1Min = 100; Soni_RZ1_notchSpacing = 1.5; Soni_RZ1_notch1Max = 400; Soni_RZ2_wahMinFreq = 250; Soni_RZ2_wahMaxFreq = 5000; Soni_B1_FreqWarpFactor = _*(warpFactor) with { warpFactor = Soni_B1_MaxWarpFactor * Soni_X_B1_MelBaseFreq + 1; }; Soni_B2_AmpMultiplier = -1*(ba.db2linear(Soni_B2_A_Max) - ba.db2linear(Soni_B2_A_Min)) * Soni_X_B2_MelLoudness + ba.db2linear(Soni_B2_A_Max); Soni_B4_Filter = fi.resonlp(cutoff,2.5,1) with {cutoff = Soni_B4_Fc_Max - Soni_X_B4_MelBrightness * (Soni_B4_Fc_Max - Soni_B4_Fc_Min);}; Soni_B5_RelFactor = 1 + Soni_X_B5_PercRelTime * Soni_B5_MaxRelFactor; Soni_R1(maxDelay) = _ : de.fdelay(50000,cookedDelaySamples) with {cookedDelaySamples = maxDelay * Soni_X_R1_InstSynch * ma.SR : ba.sAndH(ba.pulse(ma.SR/2));}; Soni_R2_InharmonicityFX = _ <: *(Soni_X_R2_Inharmonicity*os.osc(tritoneFreq)),*(1-Soni_X_R2_Inharmonicity) :> _ with { tritoneFreq = (tonic + 6) : ba.midikey2hz; }; Soni_R3_TremoloFX = _ <: *(mult * tremoloLFO),*(1-mult) :> _ with { tremoloLFO = 0.5*(1 + os.osc(tempo/60)); mult = Soni_X_R3_Tremolo; }; Soni_R4_Dist = _ <: ef.cubicnl(0.8,0)*(mult),*(1-mult) :> _ with { mult = Soni_X_R4_Dist * (1 - 0.5*Soni_X_R4_Dist); }; Soni_RZ1_Phaser(oscFreq) = _ : pf.phaser2_mono(Soni_RZ1_numNotches,0,Soni_RZ1_notchWidth,Soni_RZ1_notch1Min,Soni_RZ1_notchSpacing,Soni_RZ1_notch1Max,oscFreq ,(1 - Soni_X_RZ1_MultiPhaser),0,0) : _*(ba.db2linear(4*(1 - Soni_X_RZ1_MultiPhaser))); Soni_RZ2_Wah(LFO,minFreq,maxFreq) = _ : fi.peak_eq_cq(currentGain,currentFreq,0.7) : *(ba.db2linear(-0.4*currentGain)) with { LFO_unipolar = 0.5*(LFO + 1); currentFreq = (minFreq + LFO_unipolar*(maxFreq - minFreq)); currentGain = 20 * ( 1- Soni_X_RZ2_MultiWah); }; kickSynth_S1 = generalizedDrumSynth(kickNoise ,0.113, 0.261, 225, -2, 10.7, -22, 15000, 20, kick_v_present) : *(ba.db2linear(-6)); kickSynth_S2 = os.osc(100); kickSynth_S3 = os.osc(200); kickSynth_S4 = os.osc(300); kickSynth_ChosenStyle = kickSynth_S1,kickSynth_S2,kickSynth_S3,kickSynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(0)); kickTrack = kickSynth_ChosenStyle : channelComp(compTrackGroup(1)) : parametricEQ(eqTrackGroup(1)) : getPanFunction(0); snareSynth_S1 = generalizedDrumSynth(snareNoise ,0.23, 0.238, 200, 2, 2, -17, 15000, 200, snare_v_present) : *(ba.db2linear(-6)); snareSynth_S2 = os.osc(400); snareSynth_S3 = os.osc(600); snareSynth_S4 = os.osc(800); snareSynth_ChosenStyle = snareSynth_S1,snareSynth_S2,snareSynth_S3,snareSynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(1)); snareTrack =snareSynth_ChosenStyle : channelComp(compTrackGroup(2)) : parametricEQ(eqTrackGroup(2)) : getPanFunction(0); hhSynth_S1 = fmPercSynth(hhNoise,-5,-10,6000,hh_S1_DepthList,hh_S1_FreqList,hh_S1_Carrier,0.18 * hh_Openness,hh_v_true); hhSynth_S2 = os.osc(800); hhSynth_S3 = os.osc(1200); hhSynth_S4 = os.osc(1600); hhSynth_ChosenStyle = hhSynth_S1,hhSynth_S2,hhSynth_S3,hhSynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(2)); hhTrack = hhSynth_ChosenStyle : channelComp(compTrackGroup(3)) : parametricEQ(eqTrackGroup(3)) : getPanFunction(1); currentChordFreqs = chordFrequencies(cd_present,ct_present,1); currentChordSynthFunc(freq) = chordSynthFunc_S1(freq), chordSynthFunc_S2(freq), chordSynthFunc_S3(freq), chordSynthFunc_S4(freq) : ba.selectn(numStyles,currentStyle); chordAttack = 0.001, 0.001, 0.001, 0.001 : ba.selectn(numStyles,currentStyle); chordRelease = 0.8, 0.8, 0.8, 0.8 : ba.selectn(numStyles,currentStyle); chordFinalVal = 0.7, 0.5, 0.5, 0.5 : ba.selectn(numStyles,currentStyle); chordEnv = chordEnvelope(chordAttack,chordRelease,chordFinalVal,cv_present); chordSynthFunc_S2(freq) = os.square(freq); chordSynthFunc_S3(freq) = os.sawtooth(freq); chordSynthFunc_S4(freq) = os.osc(freq); chordFinal = fullChordSynth(currentChordFreqs,currentChordSynthFunc) : _*chordEnv, _*chordEnv : Soni_R1(Soni_R1_MaxDelSec(3)), Soni_R1(Soni_R1_MaxDelSec(3)) : Soni_RZ1_Phaser(Soni_RZ_OscFreqs(0)), Soni_RZ1_Phaser(Soni_RZ_OscFreqs(0)) : Soni_RZ2_Wah(Soni_RZ_LFO_Chords,Soni_RZ2_wahMinFreq,Soni_RZ2_wahMaxFreq), Soni_RZ2_Wah(Soni_RZ_LFO_Chords,Soni_RZ2_wahMinFreq,Soni_RZ2_wahMaxFreq); chordTrack = chordFinal : channelComp(compTrackGroup(4)),channelComp(compTrackGroup(4)) : parametricEQ(eqTrackGroup(5)),parametricEQ(eqTrackGroup(5)); riff_fundamental_freq = melodyFundamentalFreq(activeScale,tonic,rf_octave,rf_present,24,38); riffAttackBase = 0.001, 0.001, 0.001, 0.001 : ba.selectn(numStyles,currentStyle); riffReleaseBase = 0.2, 0.15, 0.15, 0.15 : ba.selectn(numStyles,currentStyle); riffSynth_S1 = fmSynth(riff_fundamental_freq,5,3,riffReleaseBase,18,rv_present) * ba.db2linear(12); riffSynth_S2 = os.osc(2000); riffSynth_S3 = os.osc(3000); riffSynth_S4 = os.osc(4000); riffSynth_ChosenStyle = riffSynth_S1, riffSynth_S2, riffSynth_S3, riffSynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(4)) : Soni_RZ1_Phaser(Soni_RZ_OscFreqs(1)) : Soni_RZ2_Wah(Soni_RZ_LFO_Riff,Soni_RZ2_wahMinFreq,Soni_RZ2_wahMaxFreq); riffTrack = riffSynth_ChosenStyle : channelComp(compTrackGroup(5)) : parametricEQ(eqTrackGroup(5)) : getPanFunction(0); melody_fundamental_freq = melodyFundamentalFreq(activeScale,tonic,mf_octave,mf_present,10,80); melodyAttackBase = 0.001, 0.001, 0.001, 0.001 : ba.selectn(numStyles,currentStyle); melodyReleaseBase = 0.4 * 120/tempo, 0.4, 0.4, 0.4 : ba.selectn(numStyles,currentStyle); melody_S1_fx1 = dotted_delay(0.8,quarterNoteSampleTime,0.4,1); melody_S1_fx2 = _ : _; melodySynth_S1 = leadSynth(melody_fundamental_freq,os.sawtooth,melodyNoise,mv_present,melodyReleaseBase,4000,4,-8,0.05,6000,melody_S1_fx1,melody_S1_fx2); melodySynth_S2 = os.sawtooth(melody_fundamental_freq); melodySynth_S3 = os.triangle(melody_fundamental_freq); melodySynth_S4 = os.osc(melody_fundamental_freq); melodySynth_ChosenStyle = melodySynth_S1, melodySynth_S2, melodySynth_S3, melodySynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(5)) : Soni_RZ1_Phaser(Soni_RZ_OscFreqs(1)) : Soni_RZ2_Wah(Soni_RZ_LFO_Mel,Soni_RZ2_wahMinFreq,Soni_RZ2_wahMaxFreq); melodyTrack = melodySynth_ChosenStyle : channelComp(compTrackGroup(6)) : parametricEQ(eqTrackGroup(6)) : getPanFunction(0); currentChordStabFreqs = chordFrequencies(cd_present,ct_present,2); currentChordStabSynthFunc(freq) = chordStabSynthFunc_S1(freq), chordStabSynthFunc_S2(freq), chordStabSynthFunc_S3(freq), chordStabSynthFunc_S4(freq) : ba.selectn(numStyles,currentStyle); chordStabAttack = 0.001, 0.001, 0.001, 0.001 : ba.selectn(numStyles,currentStyle); chordStabRelease = 0.4, 0.4, 0.4, 0.4 : ba.selectn(numStyles,currentStyle); chordStabEnv = expEnvelope(chordAttack,chordRelease,cs_v_present); chordStabSynthFunc_S1(freq) = os.square(freq); chordStabSynthFunc_S2(freq) = os.square(freq); chordStabSynthFunc_S3(freq) = os.sawtooth(freq); chordStabSynthFunc_S4(freq) = os.osc(freq); fullChords = fullChordSynth(currentChordStabFreqs,currentChordStabSynthFunc) : *(0.3), *(0.3); arpChords = arpChordSynth(currentChordStabFreqs,currentChordStabSynthFunc); chordStabSynthCurrent = fullChords, arpChords : ba.select2stereo(cs_arpMode); chordStabFinal = chordStabSynthCurrent : _*chordStabEnv, _*chordStabEnv : Soni_R1(Soni_R1_MaxDelSec(6)), Soni_R1(Soni_R1_MaxDelSec(6)) : Soni_RZ1_Phaser(Soni_RZ_OscFreqs(2)), Soni_RZ1_Phaser(Soni_RZ_OscFreqs(2)); chordStabTrack = chordStabFinal : channelComp(compTrackGroup(7)), channelComp(compTrackGroup(7)) : parametricEQ(eqTrackGroup(7)), parametricEQ(eqTrackGroup(7)); crashSynth_S1 = fmPercSynth(crashNoise,-6,-5,6000,crash_S1_DepthList,crash_S1_FreqList,crash_S1_Carrier,1.8,crash_v_present); crashSynth_S2 = os.osc(800); crashSynth_S3 = os.osc(1200); crashSynth_S4 = os.osc(1600); crashSynth_ChosenStyle = crashSynth_S1,crashSynth_S2,crashSynth_S3,crashSynth_S4 : ba.selectn(numStyles,currentStyle) : Soni_R1(Soni_R1_MaxDelSec(7)); crashTrack = crashSynth_ChosenStyle : channelComp(compTrackGroup(8)) : parametricEQ(eqTrackGroup(8)) : getPanFunction(2); x = Soni_X_Trad; S1_Pitch = os.osc(S1_freq) *(0.5); S1_freq = S1_fmin * pow(2,x*S1_nOct); S1_fmin = 300; S1_nOct = 3.5; S2_Loudness = S2_Amp * os.osc(1000); S2_Amax = -5; S2_Amin = -40; S2_Amp = (ba.db2linear(S2_Amax) - ba.db2linear(S2_Amin)) * x + ba.db2linear(S2_Amin); S3_Tempo = os.osc(1000) * en.ar(0.001,0.05,S3_PulseTrain) *(0.5); S3_PulseTrain = ba.pulse(S3_SampleInterval); S3_TempoMax = 20*60; S3_TempoMin = 2*60; S3_IntervalRange = ba.tempo(S3_TempoMin) - ba.tempo(S3_TempoMax); S3_SampleInterval = ba.tempo(S3_TempoMax) + x * (S3_IntervalRange); S4_Brightness = no.noise : fi.resonlp(S4_fc,0.7,1); S4_fc = S4_fmin * pow(2,(1-x)*S4_nOct); S4_fmin = 300; S4_nOct = 3.5; S5_FluctStrength = (0.5 * os.osc(1000) + 0.5 * os.osc(1000 + 10*x)) *(0.5); S6_Synchronicity = (S6_OriginalTrain + S6_Delayed) : en.ar(0.001,0.05) : *(os.osc(1000) *(0.5)); S6_PulseFreq = 3; S6_PeriodSamples = ba.sec2samp(1/S6_PulseFreq); S6_MaxSampleDelay = 0.25 * S6_PeriodSamples; S6_CurrentDelay = S6_MaxSampleDelay * x; S6_OriginalTrain = ba.pulse(S6_PeriodSamples); S6_Delayed = S6_OriginalTrain : de.fdelay(40000,S6_CurrentDelay); S7_Inharmonicity = (os.osc(S7_F) + S7_addedPartials) * 0.15; S7_addedPartials = par(i,15,S7_InharmExp(i)) :> _; S7_InharmExp(i) = os.osc(S7_F*i*sqrt(1+ x/10*i*i)); S7_F = 200; S8_MBFM = par(i,7,os.triangle(S8_freqExp(i))) :> _ *(0.3); S8_freqExp(i) = i*S8_F + S8_I * os.osc(10*x); S8_I = 30; S8_F = 100; S9_MSB = par(k,S9_N,S9_innerLoop(k)) :> _*(0.5); S9_innerLoop(k) = par(m,S9_M,S9_innerExp(k,m)); S9_innerExp(k,m) = os.osc(S9_F * k *(1 + m*(S9_alpha(x) - 1))); S9_alpha(dist) = 1 + 0.06*(dist); S9_F = 200; S9_N = 5; S9_M = 5; tradSoniOut = S1_Pitch,S2_Loudness,S3_Tempo,S4_Brightness,S5_FluctStrength,S6_Synchronicity,S7_Inharmonicity,S8_MBFM,S9_MSB : ba.selectn(9,Soni_Choice_Trad) <: _,_; track1 = kickTrack : stereoMasterSection(1); track2 = snareTrack : stereoMasterSection(2); track3 = hhTrack : stereoMasterSection(3); track4 = chordTrack : stereoMasterSection(4); track5 = riffTrack : stereoMasterSection(5); track6 = melodyTrack : stereoMasterSection(6); track7 = chordStabTrack : stereoMasterSection(7); track8 = crashTrack : stereoMasterSection(8); stereoMasterSection(trackIndex) = stereoOut with { stereoOut = _,_ : *(trackGain),*(trackGain) : *(1-trackMute),*(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,12,0.01) : ba.db2linear : si.smoo); trackMute = trackMuteGroup(checkbox("%trackIndex") : si.smoo); }; masterGain = masterGroup(vslider("Master Gain",-12,-96,12,0.01) : ba.db2linear : si.smoo); sonificationType = masterSoniTypeToggle(checkbox("Traditional")); melBuss = track4,track5,track6,track7 :> *(Soni_B2_AmpMultiplier), *(Soni_B2_AmpMultiplier) : Soni_R2_InharmonicityFX,Soni_R2_InharmonicityFX : Soni_R3_TremoloFX,Soni_R3_TremoloFX : Soni_B4_Filter,Soni_B4_Filter : Soni_R4_Dist,Soni_R4_Dist; masterOut = track1,track2,track3,track8,melBuss :> parametricEQ(masterEQGroup) , parametricEQ(masterEQGroup) : _*(masterGain),_*(masterGain) : masterLimiter(0),masterLimiter(0) : hard_clip(1), hard_clip(1); process = masterOut,tradSoniOut : ba.select2stereo(sonificationType);
d705e20e31b0492afbe53fb5de98a2e2096956afe3656ed0e176a668ae762f52
prithviKantanAAU/mbfFrameworkV4
GaitSoni.dsp
// // // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // import("stdfaust.lib"); // Panner NUM_PANPOS = 7; // Dotted Delay DOTDEL_FC_HP = 800; DOTDEL_FC_LP = 2000; // FM Synth FM_DISTMIX = 0.05; // Piano Single Note PIANO_WAVEWIDTH1 = 33; PIANO_WAVEWIDTH2 = 10; PIANO_WAVEWIDTH3 = 66; // Full Chord Synth CS_DEL_N1 = 0.015; CS_DEL_N2 = 0.030; CS_DEL_N3 = 0.045; // MUSIC Trackwise SYNTH // // 1, 2, 3, 8 are sample-based // 4 - CHORD SYNTH PANPOS_NOTES = 3,4,5,6; AT_C = 0.001; RL_C = 1; FV_C = 1; // MALLET FM MALLET_MRATIO = 2; MALLET_I_FIXED = 2.4; MALLET_I_ENV = 6.86; MALLET_A = 0.001; MALLET_D = 0.001; MALLET_S = 0.5; MALLET_R = 0.4; MALLET_ENVTYPE = 0; // 5 - BASSLINE AT_R = 0.001; RL_R = 0.6 + (tempo < 120)*(120-tempo)*0.06; MOD_NUM_R = 5; FREQ_FACTOR_R = 3; MOD_DEPTH_R = 35; // BASSLINE FM BASSLINE_MRATIO = 2; BASSLINE_I_FIXED = 6.75; BASSLINE_I_ENV = 7.46; BASSLINE_A = 0.007; BASSLINE_D = 0.001; BASSLINE_S = 0.6553; BASSLINE_R = 0.65; BASSLINE_ENVTYPE = 1; // AGGRO FM AGGRO_MRATIO = 3; AGGRO_I_FIXED = 10; AGGRO_I_ENV = 10; AGGRO_A = 0.01; AGGRO_D = 0.0001; AGGRO_S = 0.5; AGGRO_R = 0.867; AGGRO_ENVTYPE = 1; // 6 - MAIN MELODY AT_M = 0.001; RL_M = 4; FB_DEL_M = 0.5; WET_DEL_M = 0.8; FC_LP_M = 20000; G_SIN_M = -90; G_NS_M = -90; RL_NS_M = 0.05; FC_HP_NS_M = 3000; // TRUMPETISH FM TRUMPET_MRATIO = 1; TRUMPET_I_FIXED = 10; TRUMPET_I_ENV = 10; TRUMPET_A = 0.05; TRUMPET_D = 0.0001; TRUMPET_S = 0.5; TRUMPET_R = 0.78; TRUMPET_ENVTYPE = 1; // 7 AT_CS = 0.001; RL_CS = 5; FB_DEL_CS = 0.8; WET_DEL_CS = 0.4; DMP_KS_CS = 0.99; FREQ_OFFSET_LR = 0.7; //Sonifications LIST_FREQ_DISTFACTORS = 0.05,-0.03,0.31,-0.27; // CHORD FREQ DIST FACTORS SONI_SB_Z2_ONOFF = waveform {1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1}; SONI_SB_Z2_ONOFF_RD(i) = SONI_SB_Z2_ONOFF,i : rdtable; Soni_R1_maxLevel = 0; Soni_R1_minLevel = -80; // INSTRUMENTATION Soni_R3_Fc_Max = 20000; Soni_R3_Fc_Min = 200; // BRIGHTNESS Soni_J1_MaxWarpFactor = 10; // TONIC PITCH Soni_J2_minFreq = 250; Soni_J2_maxFreq = 5000; // PITCHED WAVE Soni_J3_minFreq = 1000; Soni_J3_maxFreq = 20000; // WHOOSH NOISE Soni_J3_HPF_FC = 150; Soni_J3_LPF_Q = 5; // " // BUSS REVERB REV_MST_PDEL_MS = 10; // PRE-DELAY REV_MST_F_DC_MID = 100; // DC/MID CROSSOVER FREQ REV_MST_F_MID_HI = 2000; // MID/HI CROSSOVER FREQ REV_MST_T60_DC = 1; // RT60 - DC REV_MST_FsMax = 48000; // FS MAX REV_MST_HPF_FC = 200; // FC - LOWER REV_MST_LPF_FC = 3500; // FC - UPPER // REVERB SENDS REV_SND = -8,-10,-5,0,-5; // // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // // TABS musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); mixMasterTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); // SLIDER GROUPS // MUSIC INFO TAB pitchInfo(x) = musicInfoTab(vgroup("Pitch",x)); velocityInfo(x) = musicInfoTab(vgroup("Velocity",x)); // MIX AND MASTER TAB trackGainGroup(x) = mixMasterTab(vgroup("Track Gain",x)); trackMuteGroup(x) = mixMasterTab(vgroup("Track Mute",x)); masterGainGroup(x) = mixMasterTab(vgroup("Master Gain",x)); masterEQGroup(x) = mixMasterTab(vgroup("Master EQ",x)); variantGroup(x) = mixMasterTab(vgroup("Track Variant",x)); // EQ TAB eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); // COMP TAB compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); // Tempo tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); //Variants VAR_1 = variantGroup(nentry("Variant_1",1,1,3,1)); VAR_2 = variantGroup(nentry("Variant_2",1,1,3,1)); VAR_3 = variantGroup(nentry("Variant_3",1,1,3,1)); VAR_4 = variantGroup(nentry("Variant_4",1,1,3,1)); VAR_5 = variantGroup(nentry("Variant_5",1,1,3,1)); VAR_6 = variantGroup(nentry("Variant_6",1,1,3,1)); VAR_7 = variantGroup(nentry("Variant_7",1,1,3,1)); VAR_8 = variantGroup(nentry("Variant_8",1,1,3,1)); //Music Info // NOTE NUMBERS KEYNUM_C_1 = pitchInfo(hslider("T4_P_1",100,20,10000,0.001)); // 4-1 KEYNUM_C_2 = pitchInfo(hslider("T4_P_2",100,20,10000,0.001)); // 4-2 KEYNUM_C_3 = pitchInfo(hslider("T4_P_3",100,20,10000,0.001)); // 4-3 KEYNUM_C_4 = pitchInfo(hslider("T4_P_4",100,20,10000,0.001)); // 4-4 KEYNUM_R = pitchInfo(hslider("T5_P_1",100,20,10000,0.001)); // 5 KEYNUM_M = pitchInfo(hslider("T6_P_1",100,20,10000,0.001)); // 6 KEYNUM_CS_1 = pitchInfo(hslider("T7_P_1",100,20,10000,0.001)); // 7-1 KEYNUM_CS_2 = pitchInfo(hslider("T7_P_2",100,20,10000,0.001)); // 7-2 KEYNUM_CS_3 = pitchInfo(hslider("T7_P_3",100,20,10000,0.001)); // 7-3 KEYNUM_CS_4 = pitchInfo(hslider("T7_P_4",100,20,10000,0.001)); // 7-4 // VELOCITIES V_K = velocityInfo(hslider("T1_V_1",9,0,9,0.1)); // 1 V_S = velocityInfo(hslider("T2_V_1",9,0,9,0.1)); // 2 S_FNUM = ((V_S > 3) + (V_S > 6)) : ba.sAndH(V_S*TRG_S) : *(1 - S_isHEEL) + S_isHEEL*2; // Snare - File Number V_HH = velocityInfo(hslider("T3_V_1",9,0,9,0.1)); // 3 HH_FNUM = ((V_HH > 3) + (V_HH > 6)) : ba.sAndH(V_HH*TRG_HH); // HH - File Number V_C_1 = velocityInfo(hslider("T4_V_1",9,0,9,0.1)); // 4-1 V_C_2 = velocityInfo(hslider("T4_V_2",9,0,9,0.1)); // 4-2 V_C_3 = velocityInfo(hslider("T4_V_3",9,0,9,0.1)); // 4-3 V_C_4 = velocityInfo(hslider("T4_V_4",9,0,9,0.1)); // 4-4 V_LIST_C = V_C_1, V_C_2, V_C_3, V_C_4; // 4 - LIST V_R = velocityInfo(hslider("T5_V_1",9,1,9,0.1)); // 5 V_M = velocityInfo(hslider("T6_V_1",9,1,9,0.1)); // 6 V_CS = velocityInfo(hslider("T7_V_1",9,0,9,0.1)); // 7 V_CR = velocityInfo(hslider("T8_V_1",9,0,9,0.1)); // 8 //Sonification Sliders and Preprocessing soniSlider(idx,defaultVal) = sonificationTab(vgroup("AP Values",hslider("Soni %idx",defaultVal,0,1,0.001))); //Discrete Soni_Z_SB1 = soniSlider(1,0) : zonePreProcess; // Ambulance Soni_Z_SB2 = soniSlider(2,0) : zonePreProcess; // Instrumentation Soni_X_STS1_Bell = soniSlider(3,0) : ba.impulsify; // Bell Trigger Soni_X_STS2_MusicStop = soniSlider(4,0) : >(0.1); // Music Stop Soni_X_STS3_Wah = soniSlider(5,0) : si.smoo; // Wah Wah Soni_X_H1_TRG = soniSlider(6,0); // HS Trigger // HS Slider Cooking HS_S_TRG = (abs(Soni_X_H1_TRG - 0.8) < 0.03) : ba.impulsify; HS_K_TRG = (abs(Soni_X_H1_TRG - 0.7) < 0.03) : ba.impulsify; S_isHEEL = Soni_X_H1_TRG > 0.49; //Continuous Soni_X_P3_ChordFreqDist = soniSlider(7,0); // Chord Freq Distortion Soni_X_R3_OverallBrightness = soniSlider(8,0); // Overall Music Brightness Soni_X_J1_MelBaseFreq = soniSlider(9,0.5); // Melody Tonic Frequency Soni_X_J2_Pitched = soniSlider(10,0); // Pitched Disturbance Soni_X_J3_Whoosh = soniSlider(11,0); // Noise Disturbance Soni_X_D1_Spatialize = soniSlider(12,0.5); // Spatialization SONI_GAIN_DB = masterGainGroup(vslider("Soni Buss Gain",-8,-10,2,0.01)); masterGain = masterGainGroup(vslider("Master Gain",-6,-96,12,0.01) : ba.db2linear); // // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // UTILITY BT_SMPL = ba.tempo(tempo); stereoLinGain(gain) = _,_ : *(gain),*(gain); stereodBGain(gain) = _,_ : *(linGain),*(linGain) with { linGain = ba.db2linear(gain); }; stereoLinMult(gainPair) = _,_ : *(gainPair : select2(0)),*(gainPair : select2(1)); stereoEffect(effect) = _,_ : effect,effect; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; // CONVERT VELOCITY VALUE TO TRIGGER ON CHANGE velToTrigger(vel) = trigger with { trigger = (posTrig + negTrig)*(1 - Soni_X_STS2_MusicStop); posTrig = vel : ba.impulsify; negTrig = - 1 * (vel) : ba.impulsify : *(vel > 0); }; // CONVERT 0-10 VELOCITY VALUE TO MONO GAIN MULTIPLIER applyVelocity(velocity,trigger,maxVel) = _ : *(gainMult) with { gainMult = sampledVel * sampledVel * 0.01; sampledVel = velCooked : ba.sAndH(velSampleInstant); velCooked = velocity * 9.0 / maxVel; velSampleInstant = trigger; }; // CONVERT 0 - 1 SONI SLIDER VALUE TO 1 - 6 ZONE VALUE zonePreProcess(input) = output with { output = par(i,6,isInZone(i)) :> int; isInZone(i) = (i+1) * (input > SONI_SB_THRESH_VALS_RD(i)) * (input < SONI_SB_THRESH_VALS_RD(i+1)); }; // ZONE THRESHOLD VALUES - STORED IN READ TABLE SONI_SB_THRESH_VALS = waveform {-0.1, 0.33, 0.66, 0.8, 0.9, 0.95, 1.1}; SONI_SB_THRESH_VALS_RD(i) = SONI_SB_THRESH_VALS,i : rdtable; // TEMPO-BASED INSTRUMENT RELEASE FACTOR tempo_RelFactor = 1 + 1.5 * (120-tempo) / 40 * (tempo < 120); // MASTER LIMITER masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); // SHORT STRUM DELAY shortDelay(d_ms) = stereoEffect(de.fdelay(5000,d_ms*ma.SR)); // CHANNEL PROCESSORS - MONO AND STEREO monoChannel(trackIndex) = *(0.25) : channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)); stereoChannel(trackIndex) = stereoLinGain(0.25) : stereoEffect(channelComp(compTrackGroup(trackIndex))) : stereoEffect(parametricEQ(eqTrackGroup(trackIndex))); // PREPROCESS CHORD FREQUENCIES getChordFinalFreqs(LIST) = freqs with { freqs = par(i,4,freq(i)); // CREATE FREQ LIST freq(i) = freqs_pre(i) : Soni_J1_FreqWarpFactor : *(Soni_P3_freqDistFactor(i)); // APPLY TUNING SONIFICATIONS Soni_P3_freqDistFactor(i) = LIST_FREQ_DISTFACTORS : ba.selectn(4,i) : *(Soni_X_P3_ChordFreqDist) : +(1); // CALCULATE CHORD DIST AMOUNT freqs_pre(i) = LIST : ba.selectn(4,i); // GET INDIVIDUAL MIDI KEYS }; // GET STEREO PAN GAINS getPanFunction(panIndex) = panFunction with { panFunction = _ <: _*(L_multiplier), _*(R_multiplier); // SPLIT AND MULTIPLY L_multiplier = 1,0.95,0.3,0.9,0.8,0.6,0.4 : ba.selectn(NUM_PANPOS,panIndex); // L-MULTIPLIER R_multiplier = 1,0.3,0.95,0.4,0.6,0.8,0.9 : ba.selectn(NUM_PANPOS,panIndex); // R-MULTIPLIER }; // CHANNEL COMP channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; // CHANNEL EQ parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",2000,1500,15000,0.01))); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); }; // 3 - Effects // Dotted Delay dotted_delay(feedback,delay,wet) = +~(de.delay(100000,del) : filt)*feedback*wet :> _ with { filt = fi.bandpass(2,DOTDEL_FC_HP,DOTDEL_FC_LP); del = 0.75*delay; }; // Compressor-Limiter compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); outminusindb(level) = max(level-thresh,0)*(1/ratio - 1); // CALCULATE GAIN REDUCTION kneesmooth = si.smooth(ba.tau2pole(kneeAtt)); }; // SMOOTH KNEE // Master COMP masterComp = stereoEffect(compLimiter(0,1.01,-20,100,300,0.05)) : stereoEffect(compLimiter(0,1.1,-5,50,200,0.05)) : stereodBGain(2); //Reverb Master reverbMaster = _,_ <: re.zita_rev1_stereo(REV_MST_PDEL_MS,REV_MST_F_DC_MID,REV_MST_F_MID_HI,REV_MST_T60_DC,rt_60,REV_MST_FsMax) : filter with { rt_60 = min(0.3 + (150 - tempo) * 0.05,1.85); // TEMPO DEPENDENT RT60 filter = stereoEffect(fi.bandpass(1,REV_MST_HPF_FC,REV_MST_LPF_FC)); // OUTPUT FILTER }; stereoMasterSection(trackIndex) = stereoOut with { stereoOut = stereoLinGain(trackGain) : stereoLinGain(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,24,0.01) : ba.db2linear); trackMute = trackMuteGroup(checkbox("%trackIndex")); }; //4 - Synthesis samplePlayer(fileFunc,trigger) = fileFunc(ba.countup(96000,trigger)); K_FILES = soundfile("K_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V3.wav'}]",1) : !,!,_; S_V1_FILES = soundfile("S_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_3.wav'}]",1) : !,!,_; S_V2_FILES = soundfile("S_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_3.wav'}]",1) : !,!,_; S_V3_FILES = soundfile("S_SMPL_V3[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_3.wav'}]",1) : !,!,_; CR_FILES = soundfile("CR_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V3.wav'}]",1) : !,!,_; HH_V1_FILES = soundfile("HH_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_3.wav'}]",1) : !,!,_; HH_V2_FILES = soundfile("HH_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_3.wav'}]",1) : !,!,_; K_SMPL_V1(i) = 0,i : K_FILES; K_SMPL_V2(i) = 1,i : K_FILES; K_SMPL_V3(i) = 2,i : K_FILES; S_SMPL_V1_1(i) = 0,i : S_V1_FILES; S_SMPL_V1_2(i) = 1,i : S_V1_FILES; S_SMPL_V1_3(i) = 2,i : S_V1_FILES; S_SMPL_V2_1(i) = 0,i : S_V2_FILES; S_SMPL_V2_2(i) = 1,i : S_V2_FILES; S_SMPL_V2_3(i) = 2,i : S_V2_FILES; S_SMPL_V3_1(i) = 0,i : S_V3_FILES; S_SMPL_V3_2(i) = 1,i : S_V3_FILES; S_SMPL_V3_3(i) = 2,i : S_V3_FILES; CR_SMPL_V1(i) = 0,i : CR_FILES; CR_SMPL_V2(i) = 1,i : CR_FILES; CR_SMPL_V3(i) = 2,i : CR_FILES; HH_SMPL_V1_1(i) = 0,i : HH_V1_FILES; HH_SMPL_V1_2(i) = 1,i : HH_V1_FILES; HH_SMPL_V1_3(i) = 2,i : HH_V1_FILES; HH_SMPL_V2_1(i) = 0,i : HH_V2_FILES; HH_SMPL_V2_2(i) = 1,i : HH_V2_FILES; HH_SMPL_V2_3(i) = 2,i : HH_V2_FILES; fmSynth_Versatile(fc,modRatio,I_fixed,I_ampDependent,a,d,s,r,envType,trigger,vel) = output with { fc_cooked = fc : si.smooth(ba.tau2pole(0.005)); output = os.osc(fc_cooked + dev) * ampEnv; dev = I * ampEnv * modFreq * os.triangle(modFreq); I = I_fixed + (I_ampDependent * (0.5 + velFactor) + I_freq) * (ampEnv); I_freq = 4 * (fc - 300)/300; modFreq = (modRatio + Soni_X_P3_ChordFreqDist) * fc_cooked; release_basic = ba.tempo(ba.tempo(tempo))/ma.SR * (1 + velFactor * 2); env_basic = en.ar(a,release_basic,trigger); triggerCooked = (env_basic > 0.5) + (env_basic > env_basic'); chosenEnv = en.adsr(a,d,s,r,triggerCooked), en.adsre(a,d,s,r,triggerCooked), en.ar(a,r,trigger), en.are(a,r,trigger), en.arfe(a,r,0.3,trigger) : ba.selectn(5,envType); ampEnv = chosenEnv : si.smooth(ba.tau2pole(a)); velFactor = 1 : applyVelocity(vel,trigger,9); }; leadSynth(fundamental,synthFunc,velocity,trigger,synthRelease,synthCutoff) = output with { output = melSynth,melSynth; // OUTPUT SUMMING melSynth = synthFunc(fundamentalCooked) * env : applyVelocity(velocity,trigger,9); // MEL COMPONENT fundamentalCooked = 2 * fundamental * soniVibratoLFO * velVibrato : limit(20,5000); env = en.ar(0.001,synthRelease,trigger); // MEL ENVELOPE velVibrato = 1 + (0.02 * ((200 - tempo)/140) : applyVelocity(velocity,trigger,9)) * os.osc(tempo/15) : si.smooth(ba.tau2pole(0.001)); soniVibratoLFO = 1 + Soni_X_P3_ChordFreqDist * os.osc(tempo/15) * 0.5 : si.smoo; // CF DIST SONI - VIBRATO LFO }; fmSynth(fundamental,numMod,freqFactor,release,depth,trigger) = (fmSynth + dirtyBus) * env with { fmSynth = sy.fm(freqList,depthList); // SYNTH - FM dirtyBus = fmSynth : ef.cubicnl(0.7,0) : _ *(FM_DISTMIX); // DIST MIX freqList = par(i,numMod,fundamental * pow(freqFactor,i)); // (1)CARRIER + MOD FREQ LIST depthList = par(i,numMod-1,depthCooked); // MOD DEPTH LIST depthCooked = depth * env * 9; // COOKED DEPTH env = sqrt(en.ar(0.001,release, trigger)) : si.smooth(ba.tau2pole(0.001)); // AMP ENVELOPE }; pulseWave(freq,widthPercent) = output with { output = 2 * (ba.pulsen(duration,interval) - 0.5); // DC CORRECTED OUTPUT WAVE duration = widthPercent * interval / 100; // PULSE UP TIME interval = ma.SR / freq; // PUlSE TOTAL PERIOD }; pianoSim_singleNote(freq,trigger) = monoOut with { monoOut = pulseWave(freq,PIANO_WAVEWIDTH1),pulseWave(freq, PIANO_WAVEWIDTH2),pulseWave(freq,PIANO_WAVEWIDTH3):> fi.lowpass(2,cutoff) * ampEnv; // WAVESUMMING cutoff = (freqEnv + 0.01) * 4000 * freq / 600 * (1 - min(freq,1000)/2000) : limit(20,20000); // FC freqEnv = en.arfe(0.001,1.6,0.4,trigger) : si.smooth(ba.tau2pole(0.0001)); // FREQUENCY ENV ampEnv = pow(en.ar(0.001,4,trigger),6) : si.smooth(ba.tau2pole(0.0001)); // AMPLITUDE ENV }; voiceSynth_FormantBP(freq,vel,trigger) = pm.SFFormantModelBP(1,vowel_H,0,freq/2.0,0.04) * env with { vowel_idx = _~+(trigger) : %(4) : _ + 0.4 * (0.5 + 0.5*os.osc(0.3)); env = en.ar(0.04, 3 / tempo * 78.6, trigger); vowel_H = vowel_idx : si.smooth(ba.tau2pole(0.04)); }; fullChordSynth(freqList,synthFunc,env) = stereoChordOut with { freqSelector(n) = freqList : ba.selectn(4,n-1); // INDIVIDUAL FREQS strumDelay(dMax) = dMax * (tempo < 120) * (120 - tempo)/60; // CALCULATE DELAY freq1Bus = synthFunc(freqSelector(1)),synthFunc(freqSelector(1) + FREQ_OFFSET_LR); // F1 freq2Bus = synthFunc(freqSelector(2)),synthFunc(freqSelector(2) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N1)); // F2 freq3Bus = synthFunc(freqSelector(3)),synthFunc(freqSelector(3) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N2)); // F3 freq4Bus = synthFunc(freqSelector(4)),synthFunc(freqSelector(4) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N3)); // F4 stereoChordOut = freq1Bus,freq2Bus,freq3Bus,freq4Bus :> stereoLinGain(env); // SUM + ENVELOPE }; chordSingle_Synth(freq,panFunc,synthFunc) = noteOut with { noteOut = synthFunc(freq) : getPanFunction(panFunc); }; ks(freq,damping) = +~((de.fdelay4(1024,del)*damping) : dampingFilter) with { del = ma.SR/freqCooked - 0.5 - 1*(freqCooked > 600); // CALCULATE DELAY LENGTH + TUNING COMPENSATE dampingFilter = _ <: (_'+ _)/2; // DAMPING FB FILTER freqCooked = freq * 1.0116; }; ks_excitation(trigger) = no.noise*en.ar(0.001,0.001,trigger); // KARPLUS STRONG NOISE EXCITATION staticBalanceMult(z) = 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 5), 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 6) : stereoEffect(si.smoo); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // transientMelDip = dipON * -24 : ba.db2linear : si.smoo // J2 + J3 - MELODY DIP with { dipON = 1 * (Soni_X_J2_Pitched > 0.01) + 1 * (Soni_X_J3_Whoosh > 0.01) // JERK STRATEGY DIPS ; }; musicDuck = duckON * (-50) : ba.db2linear : si.smoo with { duckON = 1 * (Soni_Z_SB1 >= 3) + 0.5 * (Soni_Z_SB1 == 2) ; }; SB_masterPan = out with { out = _,_ : *(leftGain),*(rightGain); leftGain = 1 - ((Soni_Z_SB1 == 6) + (Soni_Z_SB2 == 6)) : si.smoo; rightGain = 1 - ((Soni_Z_SB1 == 5) + (Soni_Z_SB2 == 5)) : si.smoo; }; // AMBULANCE Soni_SB1_Signal_Ambulance = output <: stereoLinMult(Soni_SB1_StereoMult) with { output = os.triangle(frequencyCooked); frequencyCooked = (0.5 + abs(os.osc(modFreq))) * 925; modFreq = 0.15 * (Soni_Z_SB1 == 3) + 1.4 * (Soni_Z_SB1 > 3) + 0.5 * (Soni_Z_SB1 > 4); Soni_SB1_StereoMult = staticBalanceMult(Soni_Z_SB1); }; // INSTRUMENTATION Soni_SB2_Instrumentation(trackIdx) = stereoLinGain(outGain) with { outGain = SONI_SB_Z2_ONOFF_RD(max(0,((trackIdx - 1) * 6 + Soni_Z_SB2 - 1))) : si.smoo; }; // TONIC PITCH MODULATION Soni_J1_FreqWarpFactor = _* pow(Soni_J1_MaxWarpFactor,(2 * (Soni_X_J1_MelBaseFreq - 0.5))); // MASTER FILTER - LPF Soni_R3_Filter = fi.resonlp(cutoff,qCooked,1) with // R3 - BRIGHTNESS { cutoff = Soni_R3_Fc_Max - Soni_X_R3_OverallBrightness * (Soni_R3_Fc_Max - Soni_R3_Fc_Min) : si.smoo; // CALCULTE CUTOFF qCooked = 4 - 3.3 * pow(Soni_X_R3_OverallBrightness,2); // CALCULATE F-DEPENDENT Q }; // PITCHED DISTURBANCE Soni_J2_Pitched = os.sawtooth(frequency) * gain <: _,_ with // J2 - PITCHED WAVE { frequency = Soni_J2_minFreq + (Soni_J2_maxFreq - Soni_J2_minFreq) * pow(Soni_X_J2_Pitched,2); // CALCULATE WAVE FREQUENCY gain = Soni_X_J2_Pitched > 0.01 : si.smoo; // CALCULATE ON/OFF CONDITION }; // SCRAMBLE DELAY - DISTURBANCE ACCOMPANYING Soni_J_Del = de.delay(ma.SR,delSamples),de.delay(ma.SR,delSamples) : filt,filt with { jerkAP = (Soni_X_J2_Pitched + Soni_X_J3_Whoosh) : si.smooth(ba.tau2pole(30.0/tempo)); delSamples = jerkAP * ma.SR * 0.5*(1 + os.osc(tempo/30)); filt = fi.peak_eq_cq(10 * jerkAP,fc_filt,3); fc_filt = 2000 + 2000 * jerkAP; }; // NOISE WHOOSH Soni_J3_Whoosh = no.noise : filter(frequency) : _*(gain) <: _,_ with // J3 - NOISE WHOOSH { frequency = Soni_J3_minFreq + (Soni_J3_maxFreq - Soni_J3_minFreq) * Soni_X_J3_Whoosh * Soni_X_J3_Whoosh; // CALCULATE FILTER FC filter(x) = _ : fi.resonhp(Soni_J3_HPF_FC,0.7,1) : fi.resonlp(frequency,Soni_J3_LPF_Q,1); // NOISE FILTER gain = Soni_X_J3_Whoosh > 0.01 : si.smoo; // CALCULATE ON/OFF CONDITION }; // BELL TRIGGER Soni_STS1_Bell = pm.churchBell(1,10000,0.8,1,Soni_X_STS1_Bell) * en.ar(0.001,2,Soni_X_STS1_Bell) <: stereodBGain(15); // WAH WAH Soni_STS3_LFO = os.osc(tempo/60); Soni_STS3_wahMinFreq = 250; Soni_STS3_wahMaxFreq = 5000; Soni_STS3_Wah(LFO,minFreq,maxFreq) = _,_ : singleChannelWah,singleChannelWah with { singleChannelWah = _ : fi.peak_eq_cq(currentGain,currentFreq,3.1) : *(ba.db2linear(-0.4*currentGain)); LFO_unipolar = 0.5*(LFO + 1); currentFreq = (minFreq + LFO_unipolar*(maxFreq - minFreq)); currentGain = 22 * (Soni_X_STS3_Wah); }; // SPATIALIZE Soni_D1_Spatialize_PAN = _,_ : _*(M_L),_*(M_R) with { M_L = sqrt(1 - Soni_X_D1_Spatialize) * 1.414; M_R = sqrt(Soni_X_D1_Spatialize) * 1.414; }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRIGGERS TRG_K = velToTrigger(V_K) * (1 - S_isHEEL); TRG_S = velToTrigger(V_S) * (1 - S_isHEEL); TRG_HH = velToTrigger(V_HH); TRG_C_1 = velToTrigger(V_C_1); TRG_C_2 = velToTrigger(V_C_2); TRG_C_3 = velToTrigger(V_C_3); TRG_C_4 = velToTrigger(V_C_4); TRG_LIST_C = TRG_C_1,TRG_C_2,TRG_C_3,TRG_C_4; TRG_R = velToTrigger(V_R); TRG_M = velToTrigger(V_M); TRG_CS = velToTrigger(V_CS); TRG_CR = velToTrigger(V_CR); //Kick kick_V1 = samplePlayer(K_SMPL_V1,TRG_K + HS_K_TRG); kick_V2 = samplePlayer(K_SMPL_V2,TRG_K + HS_K_TRG); kick_V3 = samplePlayer(K_SMPL_V3,TRG_K + HS_K_TRG); kickSynth = kick_V1,kick_V2,kick_V3 : ba.selectn(3,VAR_1 - 1); kick_Normal = kickSynth : applyVelocity(V_K,TRG_K,9); kickTrack = kick_Normal,(kickSynth * 1.4) :> monoChannel(1) : getPanFunction(0); //Snare snare_V1 = samplePlayer(S_SMPL_V1_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V1_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V1_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V2 = samplePlayer(S_SMPL_V2_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V2_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V2_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V3 = samplePlayer(S_SMPL_V3_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V3_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V3_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snareSynth = snare_V1,snare_V2,snare_V3 : ba.selectn(3,VAR_2 - 1); snare_Normal = snareSynth : applyVelocity(V_S,TRG_S,3); snareTrack = snare_Normal,(snareSynth * 1.4) :> monoChannel(2) : getPanFunction(0) : Soni_J_Del; //HH hh_V1 = samplePlayer(HH_SMPL_V1_1,TRG_HH), samplePlayer(HH_SMPL_V1_2,TRG_HH),samplePlayer(HH_SMPL_V1_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V2 = samplePlayer(HH_SMPL_V2_1,TRG_HH), samplePlayer(HH_SMPL_V2_2,TRG_HH),samplePlayer(HH_SMPL_V2_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V3 = pm.marimba(800,0.75,5000,1,1,TRG_HH) * 10; hhSynth = hh_V1,hh_V2,hh_V3 : ba.selectn(3,VAR_3 - 1); hhTrack = hhSynth : applyVelocity(V_HH,TRG_HH,3) : monoChannel(3) : getPanFunction(1) : Soni_J_Del; //Chord KEYNUM_LIST_C = KEYNUM_C_1,KEYNUM_C_2,KEYNUM_C_3,KEYNUM_C_4; // LIST MIDI KEYS F0_LIST_HZ_C = getChordFinalFreqs(KEYNUM_LIST_C); // MIDI KEYS TO FREQ chordFreq(noteIdx) = F0_LIST_HZ_C : ba.selectn(4,noteIdx); // FREQ SELECTOR chordVel(noteIdx) = V_LIST_C : ba.selectn(4,noteIdx); // VEL SELECTOR chordTrg(noteIdx) = TRG_LIST_C : ba.selectn(4,noteIdx); // TRG SELECTOR chord_SF_V1(trigger,freq) = pianoSim_singleNote(freq,trigger); // CHORD - SF VARIANT 1 chord_SF_V2(trigger,freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, MALLET_A,MALLET_D,MALLET_S,MALLET_R,MALLET_ENVTYPE,trigger,7); // CHORD - SF VARIANT 2 chord_SF_V3(trigger,freq) = os.CZresTrap(0.5*(1+os.osc(freq)),4.54) * en.are(0.001,2,trigger); chord_notePanFunc(idx) = ba.take(idx+1,PANPOS_NOTES); chordSynthFunc(trigger,freq) = chord_SF_V1(trigger,freq), chord_SF_V2(trigger,freq), chord_SF_V3(trigger,freq) : ba.selectn(3,VAR_4 - 1); chordSum = par(i,4,chordSingle_Synth(chordFreq(i), chord_notePanFunc(i), chordSynthFunc(chordTrg(i))) : stereoEffect(applyVelocity(chordVel(i),chordTrg(i),9))) :> _,_; chordTrack = chordSum : stereoChannel(4); //Riff F0_R = KEYNUM_R : Soni_J1_FreqWarpFactor; // CALCULATE F0 HZ riff_V1 = fmSynth(F0_R,MOD_NUM_R,FREQ_FACTOR_R,RL_R,MOD_DEPTH_R,TRG_R); // RIFF VARIANT 1 riff_V2 = fmSynth_Versatile(F0_R,BASSLINE_MRATIO,BASSLINE_I_FIXED,BASSLINE_I_ENV, BASSLINE_A,BASSLINE_D,BASSLINE_S,BASSLINE_R,BASSLINE_ENVTYPE,TRG_R,V_R); // RIFF VARIANT 2 riff_V3 = fmSynth_Versatile(F0_R,AGGRO_MRATIO,AGGRO_I_FIXED,AGGRO_I_ENV, AGGRO_A,AGGRO_D,AGGRO_S,AGGRO_R,AGGRO_ENVTYPE,TRG_R,V_R); // RIFF VARIANT 2 riffSynth = riff_V1,riff_V2,riff_V3 : ba.selectn(3,VAR_5 - 1); riffTrack = riffSynth : applyVelocity(V_R,TRG_R,9) : monoChannel(5) : getPanFunction(0); //Melody Main F0_M = KEYNUM_M : Soni_J1_FreqWarpFactor; V_M_SUS = V_M : ba.sAndH(TRG_M); M_FreqFactor = (F0_M - 300)/700 : si.smooth(ba.tau2pole(0.001)); M_V1(freq) = voiceSynth_FormantBP(freq,V_M_SUS,TRG_M); // MELODY SF - VARIANT 1 M_V2(freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, MALLET_A,MALLET_D,MALLET_S,MALLET_R,MALLET_ENVTYPE,TRG_M,V_M); // MELODY SF - VARIANT 2 M_V3(freq) = fmSynth_Versatile(freq,TRUMPET_MRATIO,TRUMPET_I_FIXED,TRUMPET_I_ENV, TRUMPET_A,TRUMPET_D,TRUMPET_S,TRUMPET_R,TRUMPET_ENVTYPE,TRG_M,V_M); // MELODY SF - VARIANT 3 M_SynthFunc(freq) = M_V1(freq),M_V2(freq),M_V3(freq) : ba.selectn(3,VAR_6 - 1); M_FX1 = dotted_delay(FB_DEL_M,BT_SMPL,WET_DEL_M),dotted_delay(FB_DEL_M,2*BT_SMPL,WET_DEL_M); // DEFINE STEREO DOTTED DELAY melodySynth = leadSynth(F0_M,M_SynthFunc,V_M,TRG_M,RL_M,FC_LP_M); // SYNTHESIZE MELODY melodyTrack = melodySynth : M_FX1 : stereoChannel(6); //Chord Stabs KEYNUM_LIST_CS = KEYNUM_CS_1,KEYNUM_CS_2,KEYNUM_CS_3,KEYNUM_CS_4; F0_LIST_HZ_CS = getChordFinalFreqs(KEYNUM_LIST_CS); // GET F0 LIST ENV_CS = en.ar(AT_CS,RL_CS,TRG_CS); // GET ENV DEL_CS = stereoEffect(dotted_delay(FB_DEL_CS,BT_SMPL,WET_DEL_CS)); // DEFINE DOTTED DELAY CS_V1(freq) = ks_excitation(TRG_CS) : ks(freq,DMP_KS_CS); CS_V2(freq) = os.triangle(freq); CS_V3(freq) = os.sawtooth(freq); SynthFunc_CS(freq) = CS_V1(freq),CS_V2(freq),CS_V3(freq) : ba.selectn(3,VAR_7 - 1); CSTrack = fullChordSynth(F0_LIST_HZ_CS,SynthFunc_CS,ENV_CS) : stereoLinGain(0.3) : DEL_CS; // CS SYNTH chordStabTrack = CSTrack : stereoChannel(7); //Crash crash_V1 = samplePlayer(CR_SMPL_V1,TRG_CR); crash_V2 = samplePlayer(CR_SMPL_V2,TRG_CR); crash_V3 = samplePlayer(CR_SMPL_V3,TRG_CR); crashSynth = crash_V1,crash_V2,crash_V3 : ba.selectn(3,VAR_8 - 1); crashTrack = crashSynth : applyVelocity(V_CR,TRG_CR,9) : monoChannel(8) : getPanFunction(2) : Soni_J_Del; // // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // track1 = kickTrack : Soni_SB2_Instrumentation(1) : stereoMasterSection(1); track2 = snareTrack : Soni_SB2_Instrumentation(2) : stereoMasterSection(2); track3 = hhTrack : Soni_SB2_Instrumentation(3) : stereoMasterSection(3); track4 = chordTrack : Soni_SB2_Instrumentation(4) : stereoMasterSection(4); track5 = riffTrack : Soni_SB2_Instrumentation(5) : stereoMasterSection(5); track6 = melodyTrack : Soni_SB2_Instrumentation(6) : stereoMasterSection(6); track7 = chordStabTrack : Soni_SB2_Instrumentation(7) : stereoMasterSection(7); track8 = crashTrack : Soni_SB2_Instrumentation(8) : stereoMasterSection(8); percBus = track1,track2,track3,track8; reverbBus = track2,track3,track4,track6,track7 : par(i,5,stereodBGain(ba.take(i+1,REV_SND))) :> reverbMaster : stereoLinGain(transientMelDip); melBus = track4,track5,track6,track7,reverbBus :> Soni_STS3_Wah(Soni_STS3_LFO,Soni_STS3_wahMinFreq,Soni_STS3_wahMaxFreq) : stereoLinGain(transientMelDip); soniBus = Soni_J2_Pitched,Soni_J3_Whoosh,Soni_SB1_Signal_Ambulance,Soni_STS1_Bell :> stereodBGain(SONI_GAIN_DB); masterChannel = masterComp : stereoEffect(parametricEQ(masterEQGroup)) : stereoEffect(Soni_R3_Filter) : SB_masterPan : stereoLinGain(masterGain) : stereoEffect(masterLimiter(0)) : stereoEffect(hard_clip(1)); musicBus = melBus,percBus,reverbBus :> stereoLinGain(musicDuck); process = musicBus,soniBus :> masterChannel : Soni_D1_Spatialize_PAN;
https://raw.githubusercontent.com/prithviKantanAAU/mbfFrameworkV4/e368a9eab07f6d8c25d1ddf1051338cbcebde121/FAUST%20Code/GaitSoni.dsp
faust
// // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // Panner Dotted Delay FM Synth Piano Single Note Full Chord Synth MUSIC Trackwise SYNTH // 1, 2, 3, 8 are sample-based 4 - CHORD SYNTH MALLET FM 5 - BASSLINE BASSLINE FM AGGRO FM 6 - MAIN MELODY TRUMPETISH FM 7 Sonifications CHORD FREQ DIST FACTORS INSTRUMENTATION BRIGHTNESS TONIC PITCH PITCHED WAVE WHOOSH NOISE " BUSS REVERB PRE-DELAY DC/MID CROSSOVER FREQ MID/HI CROSSOVER FREQ RT60 - DC FS MAX FC - LOWER FC - UPPER REVERB SENDS // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // TABS SLIDER GROUPS MUSIC INFO TAB MIX AND MASTER TAB EQ TAB COMP TAB Tempo Variants Music Info NOTE NUMBERS 4-1 4-2 4-3 4-4 5 6 7-1 7-2 7-3 7-4 VELOCITIES 1 2 Snare - File Number 3 HH - File Number 4-1 4-2 4-3 4-4 4 - LIST 5 6 7 8 Sonification Sliders and Preprocessing Discrete Ambulance Instrumentation Bell Trigger Music Stop Wah Wah HS Trigger HS Slider Cooking Continuous Chord Freq Distortion Overall Music Brightness Melody Tonic Frequency Pitched Disturbance Noise Disturbance Spatialization // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // UTILITY CONVERT VELOCITY VALUE TO TRIGGER ON CHANGE CONVERT 0-10 VELOCITY VALUE TO MONO GAIN MULTIPLIER CONVERT 0 - 1 SONI SLIDER VALUE TO 1 - 6 ZONE VALUE ZONE THRESHOLD VALUES - STORED IN READ TABLE TEMPO-BASED INSTRUMENT RELEASE FACTOR MASTER LIMITER SHORT STRUM DELAY CHANNEL PROCESSORS - MONO AND STEREO PREPROCESS CHORD FREQUENCIES CREATE FREQ LIST APPLY TUNING SONIFICATIONS CALCULATE CHORD DIST AMOUNT GET INDIVIDUAL MIDI KEYS GET STEREO PAN GAINS SPLIT AND MULTIPLY L-MULTIPLIER R-MULTIPLIER CHANNEL COMP CHANNEL EQ 3 - Effects Dotted Delay Compressor-Limiter CALCULATE GAIN REDUCTION SMOOTH KNEE Master COMP Reverb Master TEMPO DEPENDENT RT60 OUTPUT FILTER 4 - Synthesis OUTPUT SUMMING MEL COMPONENT MEL ENVELOPE CF DIST SONI - VIBRATO LFO SYNTH - FM DIST MIX (1)CARRIER + MOD FREQ LIST MOD DEPTH LIST COOKED DEPTH AMP ENVELOPE DC CORRECTED OUTPUT WAVE PULSE UP TIME PUlSE TOTAL PERIOD WAVESUMMING FC FREQUENCY ENV AMPLITUDE ENV INDIVIDUAL FREQS CALCULATE DELAY F1 F2 F3 F4 SUM + ENVELOPE CALCULATE DELAY LENGTH + TUNING COMPENSATE DAMPING FB FILTER KARPLUS STRONG NOISE EXCITATION // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // J2 + J3 - MELODY DIP JERK STRATEGY DIPS AMBULANCE INSTRUMENTATION TONIC PITCH MODULATION MASTER FILTER - LPF R3 - BRIGHTNESS CALCULTE CUTOFF CALCULATE F-DEPENDENT Q PITCHED DISTURBANCE J2 - PITCHED WAVE CALCULATE WAVE FREQUENCY CALCULATE ON/OFF CONDITION SCRAMBLE DELAY - DISTURBANCE ACCOMPANYING NOISE WHOOSH J3 - NOISE WHOOSH CALCULATE FILTER FC NOISE FILTER CALCULATE ON/OFF CONDITION BELL TRIGGER WAH WAH SPATIALIZE // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRIGGERS Kick Snare HH Chord LIST MIDI KEYS MIDI KEYS TO FREQ FREQ SELECTOR VEL SELECTOR TRG SELECTOR CHORD - SF VARIANT 1 CHORD - SF VARIANT 2 Riff CALCULATE F0 HZ RIFF VARIANT 1 RIFF VARIANT 2 RIFF VARIANT 2 Melody Main MELODY SF - VARIANT 1 MELODY SF - VARIANT 2 MELODY SF - VARIANT 3 DEFINE STEREO DOTTED DELAY SYNTHESIZE MELODY Chord Stabs GET F0 LIST GET ENV DEFINE DOTTED DELAY CS SYNTH Crash // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
import("stdfaust.lib"); NUM_PANPOS = 7; DOTDEL_FC_HP = 800; DOTDEL_FC_LP = 2000; FM_DISTMIX = 0.05; PIANO_WAVEWIDTH1 = 33; PIANO_WAVEWIDTH2 = 10; PIANO_WAVEWIDTH3 = 66; CS_DEL_N1 = 0.015; CS_DEL_N2 = 0.030; CS_DEL_N3 = 0.045; PANPOS_NOTES = 3,4,5,6; AT_C = 0.001; RL_C = 1; FV_C = 1; MALLET_MRATIO = 2; MALLET_I_FIXED = 2.4; MALLET_I_ENV = 6.86; MALLET_A = 0.001; MALLET_D = 0.001; MALLET_S = 0.5; MALLET_R = 0.4; MALLET_ENVTYPE = 0; AT_R = 0.001; RL_R = 0.6 + (tempo < 120)*(120-tempo)*0.06; MOD_NUM_R = 5; FREQ_FACTOR_R = 3; MOD_DEPTH_R = 35; BASSLINE_MRATIO = 2; BASSLINE_I_FIXED = 6.75; BASSLINE_I_ENV = 7.46; BASSLINE_A = 0.007; BASSLINE_D = 0.001; BASSLINE_S = 0.6553; BASSLINE_R = 0.65; BASSLINE_ENVTYPE = 1; AGGRO_MRATIO = 3; AGGRO_I_FIXED = 10; AGGRO_I_ENV = 10; AGGRO_A = 0.01; AGGRO_D = 0.0001; AGGRO_S = 0.5; AGGRO_R = 0.867; AGGRO_ENVTYPE = 1; AT_M = 0.001; RL_M = 4; FB_DEL_M = 0.5; WET_DEL_M = 0.8; FC_LP_M = 20000; G_SIN_M = -90; G_NS_M = -90; RL_NS_M = 0.05; FC_HP_NS_M = 3000; TRUMPET_MRATIO = 1; TRUMPET_I_FIXED = 10; TRUMPET_I_ENV = 10; TRUMPET_A = 0.05; TRUMPET_D = 0.0001; TRUMPET_S = 0.5; TRUMPET_R = 0.78; TRUMPET_ENVTYPE = 1; AT_CS = 0.001; RL_CS = 5; FB_DEL_CS = 0.8; WET_DEL_CS = 0.4; DMP_KS_CS = 0.99; FREQ_OFFSET_LR = 0.7; SONI_SB_Z2_ONOFF = waveform {1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1}; SONI_SB_Z2_ONOFF_RD(i) = SONI_SB_Z2_ONOFF,i : rdtable; REV_SND = -8,-10,-5,0,-5; musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); mixMasterTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); pitchInfo(x) = musicInfoTab(vgroup("Pitch",x)); velocityInfo(x) = musicInfoTab(vgroup("Velocity",x)); trackGainGroup(x) = mixMasterTab(vgroup("Track Gain",x)); trackMuteGroup(x) = mixMasterTab(vgroup("Track Mute",x)); masterGainGroup(x) = mixMasterTab(vgroup("Master Gain",x)); masterEQGroup(x) = mixMasterTab(vgroup("Master EQ",x)); variantGroup(x) = mixMasterTab(vgroup("Track Variant",x)); eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); VAR_1 = variantGroup(nentry("Variant_1",1,1,3,1)); VAR_2 = variantGroup(nentry("Variant_2",1,1,3,1)); VAR_3 = variantGroup(nentry("Variant_3",1,1,3,1)); VAR_4 = variantGroup(nentry("Variant_4",1,1,3,1)); VAR_5 = variantGroup(nentry("Variant_5",1,1,3,1)); VAR_6 = variantGroup(nentry("Variant_6",1,1,3,1)); VAR_7 = variantGroup(nentry("Variant_7",1,1,3,1)); VAR_8 = variantGroup(nentry("Variant_8",1,1,3,1)); soniSlider(idx,defaultVal) = sonificationTab(vgroup("AP Values",hslider("Soni %idx",defaultVal,0,1,0.001))); HS_S_TRG = (abs(Soni_X_H1_TRG - 0.8) < 0.03) : ba.impulsify; HS_K_TRG = (abs(Soni_X_H1_TRG - 0.7) < 0.03) : ba.impulsify; S_isHEEL = Soni_X_H1_TRG > 0.49; SONI_GAIN_DB = masterGainGroup(vslider("Soni Buss Gain",-8,-10,2,0.01)); masterGain = masterGainGroup(vslider("Master Gain",-6,-96,12,0.01) : ba.db2linear); BT_SMPL = ba.tempo(tempo); stereoLinGain(gain) = _,_ : *(gain),*(gain); stereodBGain(gain) = _,_ : *(linGain),*(linGain) with { linGain = ba.db2linear(gain); }; stereoLinMult(gainPair) = _,_ : *(gainPair : select2(0)),*(gainPair : select2(1)); stereoEffect(effect) = _,_ : effect,effect; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; velToTrigger(vel) = trigger with { trigger = (posTrig + negTrig)*(1 - Soni_X_STS2_MusicStop); posTrig = vel : ba.impulsify; negTrig = - 1 * (vel) : ba.impulsify : *(vel > 0); }; applyVelocity(velocity,trigger,maxVel) = _ : *(gainMult) with { gainMult = sampledVel * sampledVel * 0.01; sampledVel = velCooked : ba.sAndH(velSampleInstant); velCooked = velocity * 9.0 / maxVel; velSampleInstant = trigger; }; zonePreProcess(input) = output with { output = par(i,6,isInZone(i)) :> int; isInZone(i) = (i+1) * (input > SONI_SB_THRESH_VALS_RD(i)) * (input < SONI_SB_THRESH_VALS_RD(i+1)); }; SONI_SB_THRESH_VALS = waveform {-0.1, 0.33, 0.66, 0.8, 0.9, 0.95, 1.1}; SONI_SB_THRESH_VALS_RD(i) = SONI_SB_THRESH_VALS,i : rdtable; tempo_RelFactor = 1 + 1.5 * (120-tempo) / 40 * (tempo < 120); masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); shortDelay(d_ms) = stereoEffect(de.fdelay(5000,d_ms*ma.SR)); monoChannel(trackIndex) = *(0.25) : channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)); stereoChannel(trackIndex) = stereoLinGain(0.25) : stereoEffect(channelComp(compTrackGroup(trackIndex))) : stereoEffect(parametricEQ(eqTrackGroup(trackIndex))); getChordFinalFreqs(LIST) = freqs with { }; getPanFunction(panIndex) = panFunction with { }; channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",2000,1500,15000,0.01))); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); }; dotted_delay(feedback,delay,wet) = +~(de.delay(100000,del) : filt)*feedback*wet :> _ with { filt = fi.bandpass(2,DOTDEL_FC_HP,DOTDEL_FC_LP); del = 0.75*delay; }; compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); masterComp = stereoEffect(compLimiter(0,1.01,-20,100,300,0.05)) : stereoEffect(compLimiter(0,1.1,-5,50,200,0.05)) : stereodBGain(2); reverbMaster = _,_ <: re.zita_rev1_stereo(REV_MST_PDEL_MS,REV_MST_F_DC_MID,REV_MST_F_MID_HI,REV_MST_T60_DC,rt_60,REV_MST_FsMax) : filter with { }; stereoMasterSection(trackIndex) = stereoOut with { stereoOut = stereoLinGain(trackGain) : stereoLinGain(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,24,0.01) : ba.db2linear); trackMute = trackMuteGroup(checkbox("%trackIndex")); }; samplePlayer(fileFunc,trigger) = fileFunc(ba.countup(96000,trigger)); K_FILES = soundfile("K_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V3.wav'}]",1) : !,!,_; S_V1_FILES = soundfile("S_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_3.wav'}]",1) : !,!,_; S_V2_FILES = soundfile("S_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_3.wav'}]",1) : !,!,_; S_V3_FILES = soundfile("S_SMPL_V3[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_3.wav'}]",1) : !,!,_; CR_FILES = soundfile("CR_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V3.wav'}]",1) : !,!,_; HH_V1_FILES = soundfile("HH_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_3.wav'}]",1) : !,!,_; HH_V2_FILES = soundfile("HH_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_3.wav'}]",1) : !,!,_; K_SMPL_V1(i) = 0,i : K_FILES; K_SMPL_V2(i) = 1,i : K_FILES; K_SMPL_V3(i) = 2,i : K_FILES; S_SMPL_V1_1(i) = 0,i : S_V1_FILES; S_SMPL_V1_2(i) = 1,i : S_V1_FILES; S_SMPL_V1_3(i) = 2,i : S_V1_FILES; S_SMPL_V2_1(i) = 0,i : S_V2_FILES; S_SMPL_V2_2(i) = 1,i : S_V2_FILES; S_SMPL_V2_3(i) = 2,i : S_V2_FILES; S_SMPL_V3_1(i) = 0,i : S_V3_FILES; S_SMPL_V3_2(i) = 1,i : S_V3_FILES; S_SMPL_V3_3(i) = 2,i : S_V3_FILES; CR_SMPL_V1(i) = 0,i : CR_FILES; CR_SMPL_V2(i) = 1,i : CR_FILES; CR_SMPL_V3(i) = 2,i : CR_FILES; HH_SMPL_V1_1(i) = 0,i : HH_V1_FILES; HH_SMPL_V1_2(i) = 1,i : HH_V1_FILES; HH_SMPL_V1_3(i) = 2,i : HH_V1_FILES; HH_SMPL_V2_1(i) = 0,i : HH_V2_FILES; HH_SMPL_V2_2(i) = 1,i : HH_V2_FILES; HH_SMPL_V2_3(i) = 2,i : HH_V2_FILES; fmSynth_Versatile(fc,modRatio,I_fixed,I_ampDependent,a,d,s,r,envType,trigger,vel) = output with { fc_cooked = fc : si.smooth(ba.tau2pole(0.005)); output = os.osc(fc_cooked + dev) * ampEnv; dev = I * ampEnv * modFreq * os.triangle(modFreq); I = I_fixed + (I_ampDependent * (0.5 + velFactor) + I_freq) * (ampEnv); I_freq = 4 * (fc - 300)/300; modFreq = (modRatio + Soni_X_P3_ChordFreqDist) * fc_cooked; release_basic = ba.tempo(ba.tempo(tempo))/ma.SR * (1 + velFactor * 2); env_basic = en.ar(a,release_basic,trigger); triggerCooked = (env_basic > 0.5) + (env_basic > env_basic'); chosenEnv = en.adsr(a,d,s,r,triggerCooked), en.adsre(a,d,s,r,triggerCooked), en.ar(a,r,trigger), en.are(a,r,trigger), en.arfe(a,r,0.3,trigger) : ba.selectn(5,envType); ampEnv = chosenEnv : si.smooth(ba.tau2pole(a)); velFactor = 1 : applyVelocity(vel,trigger,9); }; leadSynth(fundamental,synthFunc,velocity,trigger,synthRelease,synthCutoff) = output with { fundamentalCooked = 2 * fundamental * soniVibratoLFO * velVibrato : limit(20,5000); velVibrato = 1 + (0.02 * ((200 - tempo)/140) : applyVelocity(velocity,trigger,9)) * os.osc(tempo/15) : si.smooth(ba.tau2pole(0.001)); }; fmSynth(fundamental,numMod,freqFactor,release,depth,trigger) = (fmSynth + dirtyBus) * env with { }; pulseWave(freq,widthPercent) = output with { }; pianoSim_singleNote(freq,trigger) = monoOut with { monoOut = pulseWave(freq,PIANO_WAVEWIDTH1),pulseWave(freq, }; voiceSynth_FormantBP(freq,vel,trigger) = pm.SFFormantModelBP(1,vowel_H,0,freq/2.0,0.04) * env with { vowel_idx = _~+(trigger) : %(4) : _ + 0.4 * (0.5 + 0.5*os.osc(0.3)); env = en.ar(0.04, 3 / tempo * 78.6, trigger); vowel_H = vowel_idx : si.smooth(ba.tau2pole(0.04)); }; fullChordSynth(freqList,synthFunc,env) = stereoChordOut with { }; chordSingle_Synth(freq,panFunc,synthFunc) = noteOut with { noteOut = synthFunc(freq) : getPanFunction(panFunc); }; ks(freq,damping) = +~((de.fdelay4(1024,del)*damping) : dampingFilter) with { freqCooked = freq * 1.0116; }; staticBalanceMult(z) = 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 5), 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 6) : stereoEffect(si.smoo); with { ; }; musicDuck = duckON * (-50) : ba.db2linear : si.smoo with { duckON = 1 * (Soni_Z_SB1 >= 3) + 0.5 * (Soni_Z_SB1 == 2) ; }; SB_masterPan = out with { out = _,_ : *(leftGain),*(rightGain); leftGain = 1 - ((Soni_Z_SB1 == 6) + (Soni_Z_SB2 == 6)) : si.smoo; rightGain = 1 - ((Soni_Z_SB1 == 5) + (Soni_Z_SB2 == 5)) : si.smoo; }; Soni_SB1_Signal_Ambulance = output <: stereoLinMult(Soni_SB1_StereoMult) with { output = os.triangle(frequencyCooked); frequencyCooked = (0.5 + abs(os.osc(modFreq))) * 925; modFreq = 0.15 * (Soni_Z_SB1 == 3) + 1.4 * (Soni_Z_SB1 > 3) + 0.5 * (Soni_Z_SB1 > 4); Soni_SB1_StereoMult = staticBalanceMult(Soni_Z_SB1); }; Soni_SB2_Instrumentation(trackIdx) = stereoLinGain(outGain) with { outGain = SONI_SB_Z2_ONOFF_RD(max(0,((trackIdx - 1) * 6 + Soni_Z_SB2 - 1))) : si.smoo; }; Soni_J1_FreqWarpFactor = _* pow(Soni_J1_MaxWarpFactor,(2 * (Soni_X_J1_MelBaseFreq - 0.5))); { }; { }; Soni_J_Del = de.delay(ma.SR,delSamples),de.delay(ma.SR,delSamples) : filt,filt with { jerkAP = (Soni_X_J2_Pitched + Soni_X_J3_Whoosh) : si.smooth(ba.tau2pole(30.0/tempo)); delSamples = jerkAP * ma.SR * 0.5*(1 + os.osc(tempo/30)); filt = fi.peak_eq_cq(10 * jerkAP,fc_filt,3); fc_filt = 2000 + 2000 * jerkAP; }; { }; Soni_STS1_Bell = pm.churchBell(1,10000,0.8,1,Soni_X_STS1_Bell) * en.ar(0.001,2,Soni_X_STS1_Bell) <: stereodBGain(15); Soni_STS3_LFO = os.osc(tempo/60); Soni_STS3_wahMinFreq = 250; Soni_STS3_wahMaxFreq = 5000; Soni_STS3_Wah(LFO,minFreq,maxFreq) = _,_ : singleChannelWah,singleChannelWah with { singleChannelWah = _ : fi.peak_eq_cq(currentGain,currentFreq,3.1) : *(ba.db2linear(-0.4*currentGain)); LFO_unipolar = 0.5*(LFO + 1); currentFreq = (minFreq + LFO_unipolar*(maxFreq - minFreq)); currentGain = 22 * (Soni_X_STS3_Wah); }; Soni_D1_Spatialize_PAN = _,_ : _*(M_L),_*(M_R) with { M_L = sqrt(1 - Soni_X_D1_Spatialize) * 1.414; M_R = sqrt(Soni_X_D1_Spatialize) * 1.414; }; TRG_K = velToTrigger(V_K) * (1 - S_isHEEL); TRG_S = velToTrigger(V_S) * (1 - S_isHEEL); TRG_HH = velToTrigger(V_HH); TRG_C_1 = velToTrigger(V_C_1); TRG_C_2 = velToTrigger(V_C_2); TRG_C_3 = velToTrigger(V_C_3); TRG_C_4 = velToTrigger(V_C_4); TRG_LIST_C = TRG_C_1,TRG_C_2,TRG_C_3,TRG_C_4; TRG_R = velToTrigger(V_R); TRG_M = velToTrigger(V_M); TRG_CS = velToTrigger(V_CS); TRG_CR = velToTrigger(V_CR); kick_V1 = samplePlayer(K_SMPL_V1,TRG_K + HS_K_TRG); kick_V2 = samplePlayer(K_SMPL_V2,TRG_K + HS_K_TRG); kick_V3 = samplePlayer(K_SMPL_V3,TRG_K + HS_K_TRG); kickSynth = kick_V1,kick_V2,kick_V3 : ba.selectn(3,VAR_1 - 1); kick_Normal = kickSynth : applyVelocity(V_K,TRG_K,9); kickTrack = kick_Normal,(kickSynth * 1.4) :> monoChannel(1) : getPanFunction(0); snare_V1 = samplePlayer(S_SMPL_V1_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V1_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V1_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V2 = samplePlayer(S_SMPL_V2_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V2_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V2_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V3 = samplePlayer(S_SMPL_V3_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V3_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V3_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snareSynth = snare_V1,snare_V2,snare_V3 : ba.selectn(3,VAR_2 - 1); snare_Normal = snareSynth : applyVelocity(V_S,TRG_S,3); snareTrack = snare_Normal,(snareSynth * 1.4) :> monoChannel(2) : getPanFunction(0) : Soni_J_Del; hh_V1 = samplePlayer(HH_SMPL_V1_1,TRG_HH), samplePlayer(HH_SMPL_V1_2,TRG_HH),samplePlayer(HH_SMPL_V1_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V2 = samplePlayer(HH_SMPL_V2_1,TRG_HH), samplePlayer(HH_SMPL_V2_2,TRG_HH),samplePlayer(HH_SMPL_V2_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V3 = pm.marimba(800,0.75,5000,1,1,TRG_HH) * 10; hhSynth = hh_V1,hh_V2,hh_V3 : ba.selectn(3,VAR_3 - 1); hhTrack = hhSynth : applyVelocity(V_HH,TRG_HH,3) : monoChannel(3) : getPanFunction(1) : Soni_J_Del; chord_SF_V2(trigger,freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, chord_SF_V3(trigger,freq) = os.CZresTrap(0.5*(1+os.osc(freq)),4.54) * en.are(0.001,2,trigger); chord_notePanFunc(idx) = ba.take(idx+1,PANPOS_NOTES); chordSynthFunc(trigger,freq) = chord_SF_V1(trigger,freq), chord_SF_V2(trigger,freq), chord_SF_V3(trigger,freq) : ba.selectn(3,VAR_4 - 1); chordSum = par(i,4,chordSingle_Synth(chordFreq(i), chord_notePanFunc(i), chordSynthFunc(chordTrg(i))) : stereoEffect(applyVelocity(chordVel(i),chordTrg(i),9))) :> _,_; chordTrack = chordSum : stereoChannel(4); riff_V2 = fmSynth_Versatile(F0_R,BASSLINE_MRATIO,BASSLINE_I_FIXED,BASSLINE_I_ENV, riff_V3 = fmSynth_Versatile(F0_R,AGGRO_MRATIO,AGGRO_I_FIXED,AGGRO_I_ENV, riffSynth = riff_V1,riff_V2,riff_V3 : ba.selectn(3,VAR_5 - 1); riffTrack = riffSynth : applyVelocity(V_R,TRG_R,9) : monoChannel(5) : getPanFunction(0); F0_M = KEYNUM_M : Soni_J1_FreqWarpFactor; V_M_SUS = V_M : ba.sAndH(TRG_M); M_FreqFactor = (F0_M - 300)/700 : si.smooth(ba.tau2pole(0.001)); M_V2(freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, M_V3(freq) = fmSynth_Versatile(freq,TRUMPET_MRATIO,TRUMPET_I_FIXED,TRUMPET_I_ENV, M_SynthFunc(freq) = M_V1(freq),M_V2(freq),M_V3(freq) : ba.selectn(3,VAR_6 - 1); melodyTrack = melodySynth : M_FX1 : stereoChannel(6); KEYNUM_LIST_CS = KEYNUM_CS_1,KEYNUM_CS_2,KEYNUM_CS_3,KEYNUM_CS_4; CS_V1(freq) = ks_excitation(TRG_CS) : ks(freq,DMP_KS_CS); CS_V2(freq) = os.triangle(freq); CS_V3(freq) = os.sawtooth(freq); SynthFunc_CS(freq) = CS_V1(freq),CS_V2(freq),CS_V3(freq) : ba.selectn(3,VAR_7 - 1); chordStabTrack = CSTrack : stereoChannel(7); crash_V1 = samplePlayer(CR_SMPL_V1,TRG_CR); crash_V2 = samplePlayer(CR_SMPL_V2,TRG_CR); crash_V3 = samplePlayer(CR_SMPL_V3,TRG_CR); crashSynth = crash_V1,crash_V2,crash_V3 : ba.selectn(3,VAR_8 - 1); crashTrack = crashSynth : applyVelocity(V_CR,TRG_CR,9) : monoChannel(8) : getPanFunction(2) : Soni_J_Del; track1 = kickTrack : Soni_SB2_Instrumentation(1) : stereoMasterSection(1); track2 = snareTrack : Soni_SB2_Instrumentation(2) : stereoMasterSection(2); track3 = hhTrack : Soni_SB2_Instrumentation(3) : stereoMasterSection(3); track4 = chordTrack : Soni_SB2_Instrumentation(4) : stereoMasterSection(4); track5 = riffTrack : Soni_SB2_Instrumentation(5) : stereoMasterSection(5); track6 = melodyTrack : Soni_SB2_Instrumentation(6) : stereoMasterSection(6); track7 = chordStabTrack : Soni_SB2_Instrumentation(7) : stereoMasterSection(7); track8 = crashTrack : Soni_SB2_Instrumentation(8) : stereoMasterSection(8); percBus = track1,track2,track3,track8; reverbBus = track2,track3,track4,track6,track7 : par(i,5,stereodBGain(ba.take(i+1,REV_SND))) :> reverbMaster : stereoLinGain(transientMelDip); melBus = track4,track5,track6,track7,reverbBus :> Soni_STS3_Wah(Soni_STS3_LFO,Soni_STS3_wahMinFreq,Soni_STS3_wahMaxFreq) : stereoLinGain(transientMelDip); soniBus = Soni_J2_Pitched,Soni_J3_Whoosh,Soni_SB1_Signal_Ambulance,Soni_STS1_Bell :> stereodBGain(SONI_GAIN_DB); masterChannel = masterComp : stereoEffect(parametricEQ(masterEQGroup)) : stereoEffect(Soni_R3_Filter) : SB_masterPan : stereoLinGain(masterGain) : stereoEffect(masterLimiter(0)) : stereoEffect(hard_clip(1)); musicBus = melBus,percBus,reverbBus :> stereoLinGain(musicDuck); process = musicBus,soniBus :> masterChannel : Soni_D1_Spatialize_PAN;
bde5a542c766ded5d1a5adaebf27e69a6ae124659dcac882f862f94fcca8e683
prithviKantanAAU/sliderSoniFinal
SliderSoniFinal.dsp
// // // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // import("stdfaust.lib"); // Panner NUM_PANPOS = 7; // Dotted Delay DOTDEL_FC_HP = 800; DOTDEL_FC_LP = 2000; // FM Synth FM_DISTMIX = 0.05; // Piano Single Note PIANO_WAVEWIDTH1 = 33; PIANO_WAVEWIDTH2 = 10; PIANO_WAVEWIDTH3 = 66; // Full Chord Synth CS_DEL_N1 = 0.015; CS_DEL_N2 = 0.030; CS_DEL_N3 = 0.045; // MUSIC Trackwise SYNTH // // 1, 2, 3, 8 are sample-based // 4 - CHORD SYNTH PANPOS_NOTES = 3,4,5,6; AT_C = 0.001; RL_C = 1; FV_C = 1; // MALLET FM MALLET_MRATIO = 2; MALLET_I_FIXED = 2.4; MALLET_I_ENV = 6.86; MALLET_A = 0.001; MALLET_D = 0.001; MALLET_S = 0.5; MALLET_R = 0.4; MALLET_ENVTYPE = 0; // 5 - BASSLINE AT_R = 0.001; RL_R = 0.6 + (tempo < 120)*(120-tempo)*0.06; MOD_NUM_R = 5; FREQ_FACTOR_R = 3; MOD_DEPTH_R = 35; // BASSLINE FM BASSLINE_MRATIO = 2; BASSLINE_I_FIXED = 6.75; BASSLINE_I_ENV = 7.46; BASSLINE_A = 0.007; BASSLINE_D = 0.001; BASSLINE_S = 0.6553; BASSLINE_R = 0.65; BASSLINE_ENVTYPE = 1; // AGGRO FM AGGRO_MRATIO = 3; AGGRO_I_FIXED = 10; AGGRO_I_ENV = 10; AGGRO_A = 0.01; AGGRO_D = 0.0001; AGGRO_S = 0.5; AGGRO_R = 0.867; AGGRO_ENVTYPE = 1; // 6 - MAIN MELODY AT_M = 0.001; RL_M = 4; FB_DEL_M = 0.5; WET_DEL_M = 0.8; FC_LP_M = 20000; G_SIN_M = -90; G_NS_M = -90; RL_NS_M = 0.05; FC_HP_NS_M = 3000; // TRUMPETISH FM TRUMPET_MRATIO = 1; TRUMPET_I_FIXED = 10; TRUMPET_I_ENV = 10; TRUMPET_A = 0.05; TRUMPET_D = 0.0001; TRUMPET_S = 0.5; TRUMPET_R = 0.78; TRUMPET_ENVTYPE = 1; // 7 AT_CS = 0.001; RL_CS = 5; FB_DEL_CS = 0.8; WET_DEL_CS = 0.4; DMP_KS_CS = 0.99; FREQ_OFFSET_LR = 0.7; //Sonifications LIST_FREQ_DISTFACTORS = 0.05,-0.03,0.31,-0.27; // CHORD FREQ DIST FACTORS SONI_SB_Z2_ONOFF = waveform {1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1}; Soni_R1_MaxDelSec(trackIndex) = 0.1,0.17,0.23,0.29,0.37,0.47,0.59,0.71 : ba.selectn(8,trackIndex); SONI_SB_Z2_ONOFF_RD(i) = SONI_SB_Z2_ONOFF,i : rdtable; Soni_R1_maxLevel = 0; Soni_R1_minLevel = -80; // INSTRUMENTATION Soni_R3_1_Fc_Max = 10000; Soni_R3_1_Fc_Min = 200; // BRIGHTNESS Soni_R3_2_Fc_Max = 3000; Soni_R3_2_Fc_Min = 200; // BRIGHTNESS Soni_J1_MaxWarpFactor = 10; // TONIC PITCH Soni_J2_minFreq = 250; Soni_J2_maxFreq = 5000; // PITCHED WAVE Soni_J3_minFreq = 1000; Soni_J3_maxFreq = 20000; // WHOOSH NOISE Soni_J3_HPF_FC = 150; Soni_J3_LPF_Q = 5; // " // BUSS REVERB REV_MST_PDEL_MS = 10; // PRE-DELAY REV_MST_F_DC_MID = 100; // DC/MID CROSSOVER FREQ REV_MST_F_MID_HI = 2000; // MID/HI CROSSOVER FREQ REV_MST_T60_DC = 1; // RT60 - DC REV_MST_FsMax = 48000; // FS MAX REV_MST_HPF_FC = 200; // FC - LOWER REV_MST_LPF_FC = 3500; // FC - UPPER // REVERB SENDS REV_SND = -8,-10,-5,0,-5; // // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // // TABS musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); mixMasterTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); traditionalSoni(x) = sonificationTab(vgroup("Traditional_Strategies",x)); // SLIDER GROUPS // MUSIC INFO TAB pitchInfo(x) = musicInfoTab(vgroup("Pitch",x)); accentInfo(x) = musicInfoTab(vgroup("Accent",x)); velocityInfo(x) = musicInfoTab(vgroup("Velocity",x)); // MIX AND MASTER TAB trackGainGroup(x) = mixMasterTab(vgroup("Track Gain",x)); trackMuteGroup(x) = mixMasterTab(vgroup("Track Mute",x)); masterGainGroup(x) = mixMasterTab(vgroup("Master Gain",x)); masterEQGroup(x) = mixMasterTab(vgroup("Master EQ",x)); variantGroup(x) = mixMasterTab(vgroup("Track Variant",x)); // EQ TAB eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); // COMP TAB compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); // Tempo and Fluidity tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); fluidity = musicInfoTab(vslider("Fluidity",1,0.05,10,0.01)) : limit(0.2,5); // Traditional Soni sonificationType = checkbox("Traditional"); Soni_X_Trad = traditionalSoni(hslider("x_Traditional",0,0,1,0.001)) : si.smoo; Soni_Choice_Trad = traditionalSoni(hslider("Choice_Traditional",0,0,4,1)); //Variants VAR_1 = variantGroup(nentry("Variant_1",1,1,3,1)); VAR_2 = variantGroup(nentry("Variant_2",1,1,3,1)); VAR_3 = variantGroup(nentry("Variant_3",1,1,3,1)); VAR_4 = variantGroup(nentry("Variant_4",1,1,3,1)); VAR_5 = variantGroup(nentry("Variant_5",1,1,3,1)); VAR_6 = variantGroup(nentry("Variant_6",1,1,3,1)); VAR_7 = variantGroup(nentry("Variant_7",1,1,3,1)); VAR_8 = variantGroup(nentry("Variant_8",1,1,3,1)); //Music Info // NOTE NUMBERS KEYNUM_C_1 = pitchInfo(hslider("T4_P_1",100,20,10000,0.001)); // 4-1 KEYNUM_C_2 = pitchInfo(hslider("T4_P_2",100,20,10000,0.001)); // 4-2 KEYNUM_C_3 = pitchInfo(hslider("T4_P_3",100,20,10000,0.001)); // 4-3 KEYNUM_C_4 = pitchInfo(hslider("T4_P_4",100,20,10000,0.001)); // 4-4 KEYNUM_R = pitchInfo(hslider("T5_P_1",100,20,10000,0.001)); // 5 KEYNUM_M = pitchInfo(hslider("T6_P_1",100,20,10000,0.001)); // 6 KEYNUM_CS_1 = pitchInfo(hslider("T7_P_1",100,20,10000,0.001)); // 7-1 KEYNUM_CS_2 = pitchInfo(hslider("T7_P_2",100,20,10000,0.001)); // 7-2 KEYNUM_CS_3 = pitchInfo(hslider("T7_P_3",100,20,10000,0.001)); // 7-3 KEYNUM_CS_4 = pitchInfo(hslider("T7_P_4",100,20,10000,0.001)); // 7-4 //Accent Info ACC_M = accentInfo(hslider("T6_A_1",5,0,9,0.01)); // 6 ACC_C_1 = accentInfo(hslider("T4_A_1",5,0,9,0.01)); // 4-1 ACC_C_2 = accentInfo(hslider("T4_A_2",5,0,9,0.01)); // 4-2 ACC_C_3 = accentInfo(hslider("T4_A_3",5,0,9,0.01)); // 4-3 ACC_C_4 = accentInfo(hslider("T4_A_4",5,0,9,0.01)); // 4-4 ACC_R = accentInfo(hslider("T5_A_1",5,0,9,0.01)); // 5 // VELOCITIES V_K = velocityInfo(hslider("T1_V_1",9,0,9,0.1)); // 1 V_S = velocityInfo(hslider("T2_V_1",9,0,9,0.1)); // 2 S_FNUM = ((V_S > 3) + (V_S > 6)) : ba.sAndH(V_S*TRG_S); // Snare - File Number V_HH = velocityInfo(hslider("T3_V_1",9,0,9,0.1)); // 3 HH_FNUM = ((V_HH > 3) + (V_HH > 6)) : ba.sAndH(V_HH*TRG_HH); // HH - File Number V_C_1 = velocityInfo(hslider("T4_V_1",9,0,9,0.1)); // 4-1 V_C_2 = velocityInfo(hslider("T4_V_2",9,0,9,0.1)); // 4-2 V_C_3 = velocityInfo(hslider("T4_V_3",9,0,9,0.1)); // 4-3 V_C_4 = velocityInfo(hslider("T4_V_4",9,0,9,0.1)); // 4-4 V_LIST_C = V_C_1, V_C_2, V_C_3, V_C_4; // 4 - LIST V_R = velocityInfo(hslider("T5_V_1",9,1,9,0.1)); // 5 V_M = velocityInfo(hslider("T6_V_1",9,1,9,0.1)); // 6 V_CS = velocityInfo(hslider("T7_V_1",9,0,9,0.1)); // 7 V_CR = velocityInfo(hslider("T8_V_1",9,0,9,0.1)); // 8 //Sonification Sliders and Preprocessing soniSlider(idx,defaultVal) = sonificationTab(vgroup("AP Values",hslider("Soni %idx",defaultVal,0,1,0.001))); // TRADITIONAL X_T_Pitch = soniSlider(1,0); X_T_Tempo = soniSlider(2,0); X_T_Synchronicity = soniSlider(3,0); X_T_Harmonicity = soniSlider(4,0); X_T_Brightness = soniSlider(5,0); // MUSICAL X_M_MelDegree = soniSlider(6,0); X_M_Tempo = soniSlider(7,0); X_M_Synchronicity = soniSlider(8,0); X_M_Harmonicity = soniSlider(9,0); X_M_Brightness = soniSlider(10,0); SONI_GAIN_DB = masterGainGroup(vslider("Soni Buss Gain",-8,-10,2,0.01)); masterGain = masterGainGroup(vslider("Master Gain",-6,-96,12,0.01) : ba.db2linear); // // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // UTILITY BT_SMPL = ba.tempo(tempo); stereoLinGain(gain) = _,_ : *(gain),*(gain); stereodBGain(gain) = _,_ : *(linGain),*(linGain) with { linGain = ba.db2linear(gain); }; stereoLinMult(gainPair) = _,_ : *(gainPair : select2(0)),*(gainPair : select2(1)); stereoEffect(effect) = _,_ : effect,effect; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; // CONVERT VELOCITY VALUE TO TRIGGER ON CHANGE velToTrigger(vel) = trigger with { trigger = (posTrig + negTrig); posTrig = vel : ba.impulsify; negTrig = - 1 * (vel) : ba.impulsify : *(vel > 0); }; // CONVERT 0-10 VELOCITY VALUE TO MONO GAIN MULTIPLIER applyVelocity(velocity,trigger,maxVel) = _ : *(gainMult) with { sampledVel = velocity : ba.sAndH(trigger); dBGain = (sampledVel - 10) * 26.0 / 9.0; gainMult = ba.db2linear(dBGain); }; // TEMPO-BASED INSTRUMENT RELEASE FACTOR tempo_RelFactor = fluidity + 1.5 * (120-tempo) / 40 * (tempo < 120); // MASTER LIMITER masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); // SHORT STRUM DELAY shortDelay(d_ms) = stereoEffect(de.fdelay(5000,d_ms*ma.SR)); // CHANNEL PROCESSORS - MONO AND STEREO monoChannel(trackIndex) = *(0.25) : channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)); stereoChannel(trackIndex) = stereoLinGain(0.25) : stereoEffect(channelComp(compTrackGroup(trackIndex))) : stereoEffect(parametricEQ(eqTrackGroup(trackIndex))); // PREPROCESS CHORD FREQUENCIES getChordFinalFreqs(LIST) = freqs with { freqs = par(i,4,freq(i)); // CREATE FREQ LIST freq(i) = freqs_pre(i) : *(Soni_P3_freqDistFactor(i)); // APPLY TUNING SONIFICATIONS Soni_P3_freqDistFactor(i) = LIST_FREQ_DISTFACTORS : ba.selectn(4,i) : *(X_M_Harmonicity) : +(1); // CALCULATE CHORD DIST AMOUNT freqs_pre(i) = LIST : ba.selectn(4,i); // GET INDIVIDUAL MIDI KEYS }; // GET STEREO PAN GAINS getPanFunction(panIndex) = panFunction with { panFunction = _ <: _*(L_multiplier), _*(R_multiplier); // SPLIT AND MULTIPLY L_multiplier = 1,0.95,0.3,0.9,0.8,0.6,0.4 : ba.selectn(NUM_PANPOS,panIndex); // L-MULTIPLIER R_multiplier = 1,0.3,0.95,0.4,0.6,0.8,0.9 : ba.selectn(NUM_PANPOS,panIndex); // R-MULTIPLIER }; // CHANNEL COMP channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; // CHANNEL EQ parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",2000,1500,15000,0.01))); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); }; // 3 - Effects // Dotted Delay dotted_delay(feedback,delay,wet) = +~(de.delay(100000,del) : filt)*feedback*wet :> _ with { filt = fi.bandpass(2,DOTDEL_FC_HP,DOTDEL_FC_LP); del = 0.75*delay; }; // Compressor-Limiter compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); outminusindb(level) = max(level-thresh,0)*(1/ratio - 1); // CALCULATE GAIN REDUCTION kneesmooth = si.smooth(ba.tau2pole(kneeAtt)); }; // SMOOTH KNEE // Master COMP masterComp = stereoEffect(compLimiter(0,1.01,-20,100,300,0.05)) : stereoEffect(compLimiter(0,1.1,-5,50,200,0.05)) : stereodBGain(2); //Reverb Master reverbMaster = _,_ <: re.zita_rev1_stereo(REV_MST_PDEL_MS,REV_MST_F_DC_MID,REV_MST_F_MID_HI,REV_MST_T60_DC,rt_60,REV_MST_FsMax) : filter with { rt_60 = min(0.3 + (150 - tempo) * 0.05,1.85); // TEMPO DEPENDENT RT60 filter = stereoEffect(fi.bandpass(1,REV_MST_HPF_FC,REV_MST_LPF_FC)); // OUTPUT FILTER }; stereoMasterSection(trackIndex) = stereoOut with { stereoOut = stereoLinGain(trackGain) : stereoLinGain(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,24,0.01) : ba.db2linear); trackMute = trackMuteGroup(checkbox("%trackIndex")); }; //4 - Synthesis samplePlayer(fileFunc,trigger) = fileFunc(ba.countup(96000,trigger)); K_FILES = soundfile("K_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V3.wav'}]",1) : !,!,_; S_V1_FILES = soundfile("S_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_3.wav'}]",1) : !,!,_; S_V2_FILES = soundfile("S_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_3.wav'}]",1) : !,!,_; S_V3_FILES = soundfile("S_SMPL_V3[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_3.wav'}]",1) : !,!,_; CR_FILES = soundfile("CR_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V3.wav'}]",1) : !,!,_; HH_V1_FILES = soundfile("HH_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_3.wav'}]",1) : !,!,_; HH_V2_FILES = soundfile("HH_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_3.wav'}]",1) : !,!,_; K_SMPL_V1(i) = 0,i : K_FILES; K_SMPL_V2(i) = 1,i : K_FILES; K_SMPL_V3(i) = 2,i : K_FILES; S_SMPL_V1_1(i) = 0,i : S_V1_FILES; S_SMPL_V1_2(i) = 1,i : S_V1_FILES; S_SMPL_V1_3(i) = 2,i : S_V1_FILES; S_SMPL_V2_1(i) = 0,i : S_V2_FILES; S_SMPL_V2_2(i) = 1,i : S_V2_FILES; S_SMPL_V2_3(i) = 2,i : S_V2_FILES; S_SMPL_V3_1(i) = 0,i : S_V3_FILES; S_SMPL_V3_2(i) = 1,i : S_V3_FILES; S_SMPL_V3_3(i) = 2,i : S_V3_FILES; CR_SMPL_V1(i) = 0,i : CR_FILES; CR_SMPL_V2(i) = 1,i : CR_FILES; CR_SMPL_V3(i) = 2,i : CR_FILES; HH_SMPL_V1_1(i) = 0,i : HH_V1_FILES; HH_SMPL_V1_2(i) = 1,i : HH_V1_FILES; HH_SMPL_V1_3(i) = 2,i : HH_V1_FILES; HH_SMPL_V2_1(i) = 0,i : HH_V2_FILES; HH_SMPL_V2_2(i) = 1,i : HH_V2_FILES; HH_SMPL_V2_3(i) = 2,i : HH_V2_FILES; fmSynth_Versatile(fc,modRatio,I_fixed,I_ampDependent,a,d,s,r,envType,trigger,vel,acc) = output with { fc_cooked = fc : si.smooth(ba.tau2pole(0.005)); acc_cooked = 1 + (acc-5.0)/5.0; output = os.osc(fc_cooked + dev) * ampEnv; dev = I * ampEnv * modFreq * os.triangle(modFreq); I = I_fixed + (I_ampDependent * acc_cooked * (0.5 + velFactor) + I_freq) * (ampEnv); I_freq = 4 * (fc - 300)/300; modFreq = (modRatio + X_M_Harmonicity) * fc_cooked; release_basic = ba.tempo(ba.tempo(tempo))/ma.SR * (1 + velFactor * 2); env_basic = en.ar(a,release_basic,trigger); triggerCooked = (env_basic > 0.5) + (env_basic > env_basic'); chosenEnv = en.adsr(a,d,s,r*tempo_RelFactor,triggerCooked), en.adsre(a,d,s,r*tempo_RelFactor,triggerCooked), en.ar(a,r*tempo_RelFactor,trigger), en.are(a,r*tempo_RelFactor,trigger), en.arfe(a,r*tempo_RelFactor,0.3,trigger) : ba.selectn(5,envType); ampEnv = chosenEnv : si.smooth(ba.tau2pole(a)); velFactor = 1 : applyVelocity(vel,trigger,9); }; leadSynth(fundamental,synthFunc,velocity,trigger,synthRelease,synthCutoff,acc) = output with { output = melSynth,melSynth; // OUTPUT SUMMING melSynth = synthFunc(fundamentalCooked) * env : applyVelocity(velocity,trigger,9); // MEL COMPONENT fundamentalCooked = 2 * fundamental * soniVibratoLFO * accVibrato : limit(20,5000); env = en.ar(0.001,synthRelease * tempo_RelFactor,trigger); // MEL ENVELOPE vibLFO = os.osc(tempo/15); accVibrato = 1 + (0.00045 * acc * vibLFO) : si.smooth(ba.tau2pole(0.001)); soniVibratoLFO = 1 + X_M_Harmonicity * vibLFO * 0.5 : si.smoo; // CF DIST SONI - VIBRATO LFO }; fmSynth(fundamental,numMod,freqFactor,release,depth,trigger) = (fmSynth + dirtyBus) * env with { fmSynth = sy.fm(freqList,depthList); // SYNTH - FM dirtyBus = fmSynth : ef.cubicnl(0.7,0) : _ *(FM_DISTMIX); // DIST MIX freqList = par(i,numMod,fundamental * pow(freqFactor,i)); // (1)CARRIER + MOD FREQ LIST depthList = par(i,numMod-1,depthCooked); // MOD DEPTH LIST depthCooked = depth * env * 9; // COOKED DEPTH env = sqrt(en.ar(0.001,release * tempo_RelFactor, trigger)) : si.smooth(ba.tau2pole(0.001)); // AMP ENVELOPE }; pulseWave(freq,widthPercent) = output with { output = 2 * (ba.pulsen(duration,interval) - 0.5); // DC CORRECTED OUTPUT WAVE duration = widthPercent * interval / 100; // PULSE UP TIME interval = ma.SR / freq; // PUlSE TOTAL PERIOD }; pianoSim_singleNote(freq,trigger,acc) = monoOut with { monoOut = pulseWave(freq,PIANO_WAVEWIDTH1),pulseWave(freq, PIANO_WAVEWIDTH2),pulseWave(freq,PIANO_WAVEWIDTH3):> fi.lowpass(2,cutoff) * ampEnv; // WAVESUMMING cutoff = (freqEnv + 0.01) * 4000 * freq / 600 * (1 - min(freq,1000)/2000) : limit(20,20000); // FC freqEnv = (1 + (acc - 5.0)/5.0) * en.arfe(0.001,1.6,0.4 * tempo_RelFactor,trigger) : si.smooth(ba.tau2pole(0.0001)); // FREQUENCY ENV ampEnv = pow(en.ar(0.001,4 * tempo_RelFactor,trigger),6) : si.smooth(ba.tau2pole(0.0001)); // AMPLITUDE ENV }; voiceSynth_FormantBP(freq,vel,trigger,acc) = pm.SFFormantModelBP(2,vowel_H,fric,freqLow,0.04) * env : fi.resonlp(8000,3,1) with { fric = 0.13 - acc/10.0 * 0.13 : max(0); freqLow = freq / 2.0; vowel_idx = 0; env = en.ar(0.02, 1.5 / tempo * 78.6 * tempo_RelFactor * (1 + acc/5.0), trigger); vowel_H = vowel_idx : si.smooth(ba.tau2pole(0.01)); }; fullChordSynth(freqList,synthFunc,env) = stereoChordOut with { freqSelector(n) = freqList : ba.selectn(4,n-1); // INDIVIDUAL FREQS strumDelay(dMax) = dMax * (tempo < 120) * (120 - tempo)/60; // CALCULATE DELAY freq1Bus = synthFunc(freqSelector(1)),synthFunc(freqSelector(1) + FREQ_OFFSET_LR); // F1 freq2Bus = synthFunc(freqSelector(2)),synthFunc(freqSelector(2) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N1)); // F2 freq3Bus = synthFunc(freqSelector(3)),synthFunc(freqSelector(3) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N2)); // F3 freq4Bus = synthFunc(freqSelector(4)),synthFunc(freqSelector(4) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N3)); // F4 stereoChordOut = freq1Bus,freq2Bus,freq3Bus,freq4Bus :> stereoLinGain(env); // SUM + ENVELOPE }; chordSingle_Synth(freq,acc,synthFunc) = noteOut with { noteOut = synthFunc(freq,acc),synthFunc(freq + 0.5,acc); }; ks(freq,damping) = +~((de.fdelay4(1024,del)*damping) : dampingFilter) with { del = ma.SR/freqCooked - 0.5 - 1*(freqCooked > 600); // CALCULATE DELAY LENGTH + TUNING COMPENSATE dampingFilter = _ <: (_'+ _)/2; // DAMPING FB FILTER freqCooked = freq * 1.0116; }; ks_excitation(trigger) = no.noise*en.ar(0.001,0.001,trigger); // KARPLUS STRONG NOISE EXCITATION staticBalanceMult(z) = 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 5), 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 6) : stereoEffect(si.smoo); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // MASTER FILTER - LPF Soni_R3_Filter_1 = fi.resonlp(cutoff,qCooked,1) with // R3 - BRIGHTNESS { cutoff = (Soni_R3_1_Fc_Max - X_M_Brightness * (Soni_R3_1_Fc_Max - Soni_R3_1_Fc_Min)), 20000 : select2(X_M_Brightness < 0.001) : si.smoo; qCooked = 1; }; Soni_R3_Filter_2 = fi.resonlp(cutoff,qCooked,1) with // R3 - BRIGHTNESS { cutoff = (Soni_R3_2_Fc_Max - X_M_Brightness * (Soni_R3_2_Fc_Max - Soni_R3_2_Fc_Min)), 20000 : select2(X_M_Brightness < 0.001) : si.smoo; qCooked = 4 - 3.3*X_M_Brightness; }; Soni_SyncMusic(maxDelay) = _,_ : de.fdelay(50000,cookedDelaySamples),de.fdelay(50000,cookedDelaySamples) with { cookedDelaySamples = maxDelay * X_M_Synchronicity * ma.SR : si.smoo; // : ba.sAndH(ba.pulse(ma.SR/5)); }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRIGGERS TRG_K = velToTrigger(V_K); TRG_S = velToTrigger(V_S); TRG_HH = velToTrigger(V_HH); TRG_C_1 = velToTrigger(V_C_1); TRG_C_2 = velToTrigger(V_C_2); TRG_C_3 = velToTrigger(V_C_3); TRG_C_4 = velToTrigger(V_C_4); TRG_LIST_C = TRG_C_1,TRG_C_2,TRG_C_3,TRG_C_4; TRG_R = velToTrigger(V_R); TRG_M = velToTrigger(V_M); TRG_CS = velToTrigger(V_CS); TRG_CR = velToTrigger(V_CR); //Kick kick_V1 = samplePlayer(K_SMPL_V1,TRG_K); kick_V2 = samplePlayer(K_SMPL_V2,TRG_K); kick_V3 = samplePlayer(K_SMPL_V3,TRG_K); kickSynth = kick_V1,kick_V2,kick_V3 : ba.selectn(3,VAR_1 - 1); kick_Normal = kickSynth : applyVelocity(V_K,TRG_K,9); kickTrack = kick_Normal,(kickSynth * 1.4) :> monoChannel(1) : getPanFunction(0); //Snare snare_V1 = samplePlayer(S_SMPL_V1_1,TRG_S), samplePlayer(S_SMPL_V1_2,TRG_S),samplePlayer(S_SMPL_V1_3,TRG_S) : ba.selectn(3,S_FNUM); snare_V2 = samplePlayer(S_SMPL_V2_1,TRG_S), samplePlayer(S_SMPL_V2_2,TRG_S),samplePlayer(S_SMPL_V2_3,TRG_S) : ba.selectn(3,S_FNUM); snare_V3 = samplePlayer(S_SMPL_V3_1,TRG_S), samplePlayer(S_SMPL_V3_2,TRG_S),samplePlayer(S_SMPL_V3_3,TRG_S) : ba.selectn(3,S_FNUM); snareSynth = snare_V1,snare_V2,snare_V3 : ba.selectn(3,VAR_2 - 1); snare_Normal = snareSynth : applyVelocity(V_S,TRG_S,3); snareTrack = snare_Normal,(snareSynth * 1.4) :> monoChannel(2) : getPanFunction(0); //HH hh_V1 = samplePlayer(HH_SMPL_V1_1,TRG_HH), samplePlayer(HH_SMPL_V1_2,TRG_HH),samplePlayer(HH_SMPL_V1_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V2 = samplePlayer(HH_SMPL_V2_1,TRG_HH), samplePlayer(HH_SMPL_V2_2,TRG_HH),samplePlayer(HH_SMPL_V2_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V3 = pm.marimba(800,0.75,5000,1,1,TRG_HH) * 10; hhSynth = hh_V1,hh_V2,hh_V3 : ba.selectn(3,VAR_3 - 1); hhTrack = hhSynth : applyVelocity(V_HH,TRG_HH,3) : monoChannel(3) : getPanFunction(1); //Chord KEYNUM_LIST_C = KEYNUM_C_1,KEYNUM_C_2,KEYNUM_C_3,KEYNUM_C_4; // LIST MIDI KEYS F0_LIST_HZ_C = getChordFinalFreqs(KEYNUM_LIST_C); // MIDI KEYS TO FREQ ACC_LIST_C = ACC_C_1,ACC_C_2,ACC_C_3,ACC_C_4; // ACCENTS chordFreq(noteIdx) = F0_LIST_HZ_C : ba.selectn(4,noteIdx); // FREQ SELECTOR chordVel(noteIdx) = V_LIST_C : ba.selectn(4,noteIdx); // VEL SELECTOR chordTrg(noteIdx) = TRG_LIST_C : ba.selectn(4,noteIdx); // TRG SELECTOR chordAcc(noteIdx) = ACC_LIST_C : ba.selectn(4,noteIdx); // ACC SELECTOR chord_SF_V1(trigger,freq,acc) = pianoSim_singleNote(freq,trigger,acc); // CHORD - SF VARIANT 1 chord_SF_V2(trigger,freq,acc) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, MALLET_A,MALLET_D,MALLET_S,MALLET_R,MALLET_ENVTYPE,trigger,7,acc); // CHORD - SF VARIANT 2 chord_SF_V3(trigger,freq,acc) = os.CZresTrap(0.5*(1+os.osc(freq)),4.54 * (1 + pow(acc/5,2))) * en.are(0.001,2 * tempo_RelFactor,trigger); chord_notePanFunc(idx) = ba.take(idx+1,PANPOS_NOTES); chordSynthFunc(trigger,freq,acc) = chord_SF_V1(trigger,freq,acc), chord_SF_V2(trigger,freq,acc), chord_SF_V3(trigger,freq,acc) : ba.selectn(3,VAR_4 - 1); chordSum = par(i,4,chordSingle_Synth(chordFreq(i), chordAcc(i), chordSynthFunc(chordTrg(i))) : stereoEffect(applyVelocity(chordVel(i),chordTrg(i),9))) :> _,_; chordTrack = chordSum : stereoChannel(4); //Riff F0_R = KEYNUM_R; // CALCULATE F0 HZ riff_V1 = fmSynth(F0_R,MOD_NUM_R,FREQ_FACTOR_R,RL_R,MOD_DEPTH_R,TRG_R); // RIFF VARIANT 1 riff_V2 = fmSynth_Versatile(F0_R,BASSLINE_MRATIO,BASSLINE_I_FIXED,BASSLINE_I_ENV, BASSLINE_A,BASSLINE_D,BASSLINE_S,BASSLINE_R,BASSLINE_ENVTYPE,TRG_R,V_R,ACC_R); // RIFF VARIANT 2 riff_V3 = fmSynth_Versatile(F0_R,AGGRO_MRATIO,AGGRO_I_FIXED,AGGRO_I_ENV, AGGRO_A,AGGRO_D,AGGRO_S,AGGRO_R,AGGRO_ENVTYPE,TRG_R,V_R,ACC_R); // RIFF VARIANT 2 riffSynth = riff_V1,riff_V2,riff_V3 : ba.selectn(3,VAR_5 - 1); riffTrack = riffSynth : applyVelocity(V_R,TRG_R,9) : monoChannel(5) : getPanFunction(0); //Melody Main F0_M = KEYNUM_M; V_M_SUS = V_M : ba.sAndH(TRG_M); M_FreqFactor = (F0_M - 300)/700 : si.smooth(ba.tau2pole(0.001)); M_V1(freq) = voiceSynth_FormantBP(freq,V_M_SUS,TRG_M,ACC_M); // MELODY SF - VARIANT 1 M_V2(freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, MALLET_A,MALLET_D,MALLET_S,MALLET_R,MALLET_ENVTYPE,TRG_M,V_M,ACC_M); // MELODY SF - VARIANT 2 M_V3(freq) = fmSynth_Versatile(freq,TRUMPET_MRATIO,TRUMPET_I_FIXED,TRUMPET_I_ENV, TRUMPET_A,TRUMPET_D,TRUMPET_S,TRUMPET_R,TRUMPET_ENVTYPE,TRG_M,V_M,ACC_M); // MELODY SF - VARIANT 3 M_SynthFunc(freq) = M_V1(freq),M_V2(freq),M_V3(freq) : ba.selectn(3,VAR_6 - 1); M_FX1 = dotted_delay(FB_DEL_M,BT_SMPL,WET_DEL_M),dotted_delay(FB_DEL_M,2*BT_SMPL,WET_DEL_M); // DEFINE STEREO DOTTED DELAY melodySynth = leadSynth(F0_M,M_SynthFunc,V_M,TRG_M,RL_M,FC_LP_M,ACC_M); // SYNTHESIZE MELODY melodyTrack = melodySynth : M_FX1 : stereoChannel(6); //Chord Stabs KEYNUM_LIST_CS = KEYNUM_CS_1,KEYNUM_CS_2,KEYNUM_CS_3,KEYNUM_CS_4; F0_LIST_HZ_CS = getChordFinalFreqs(KEYNUM_LIST_CS); // GET F0 LIST ENV_CS = en.ar(AT_CS,RL_CS,TRG_CS); // GET ENV DEL_CS = stereoEffect(dotted_delay(FB_DEL_CS,BT_SMPL,WET_DEL_CS)); // DEFINE DOTTED DELAY CS_V1(freq) = ks_excitation(TRG_CS) : ks(freq,DMP_KS_CS); CS_V2(freq) = os.triangle(freq); CS_V3(freq) = os.sawtooth(freq); SynthFunc_CS(freq) = CS_V1(freq),CS_V2(freq),CS_V3(freq) : ba.selectn(3,VAR_7 - 1); CSTrack = fullChordSynth(F0_LIST_HZ_CS,SynthFunc_CS,ENV_CS) : stereoLinGain(0.3) : DEL_CS; // CS SYNTH chordStabTrack = CSTrack : stereoChannel(7); //Crash crash_V1 = samplePlayer(CR_SMPL_V1,TRG_CR); crash_V2 = samplePlayer(CR_SMPL_V2,TRG_CR); crash_V3 = samplePlayer(CR_SMPL_V3,TRG_CR); crashSynth = crash_V1,crash_V2,crash_V3 : ba.selectn(3,VAR_8 - 1); crashTrack = crashSynth : applyVelocity(V_CR,TRG_CR,9) : monoChannel(8) : getPanFunction(2); // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRADITIONAL STRATEGIES // // // // // // // // // // // // // // // // // // // // // // // // // // // // S1_Pitch = os.osc(S1_freq) *(0.5); S1_freq = S1_fmin * pow(2,X_T_Pitch*S1_nOct); S1_fmin = 300; S1_nOct = 3.5; S2_Tempo = os.osc(1000) * en.ar(0.001,0.05,S2_PulseTrain) *(0.5); S2_PulseTrain = ba.pulse(S2_SampleInterval); S2_TempoMax = 20*60; S2_TempoMin = 2*60; S2_IntervalRange = ba.tempo(S2_TempoMin) - ba.tempo(S2_TempoMax); S2_SampleInterval = ba.tempo(S2_TempoMax) + X_T_Tempo * (S2_IntervalRange); S3_Synchronicity = (S3_OriginalTrain + S3_Delayed) : en.ar(0.001,0.05) : *(os.osc(1000) *(0.5)); S3_PulseFreq = 3; S3_PeriodSamples = ba.sec2samp(1/S3_PulseFreq); S3_MaxSampleDelay = 0.25 * S3_PeriodSamples; S3_CurrentDelay = S3_MaxSampleDelay * X_T_Synchronicity; S3_OriginalTrain = ba.pulse(S3_PeriodSamples); S3_Delayed = S3_OriginalTrain : de.fdelay(40000,S3_CurrentDelay); S4_Inharmonicity = (os.osc(S4_F) + S4_addedPartials) * 0.1; S4_addedPartials = par(i,15,S4_InharmExp(i)) :> _; S4_InharmExp(i) = os.osc(S4_F*i*sqrt(1+ X_T_Harmonicity/10*i*i)); S4_F = 200; S5_Brightness = no.noise : fi.resonlp(S5_fc,0.7,1); S5_fc = S5_fmin * pow(2,(1-X_T_Brightness)*S5_nOct); S5_fmin = 300; S5_nOct = 3.5; tradSoniOut = S1_Pitch,S2_Tempo,S3_Synchronicity,S4_Inharmonicity,S5_Brightness : ba.selectn(5,Soni_Choice_Trad) <: _,_; // // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // track1 = kickTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(0)) : stereoMasterSection(1); track2 = snareTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(1)) : stereoMasterSection(2); track3 = hhTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(2)) : stereoMasterSection(3); track4 = chordTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(3)) : stereoMasterSection(4); track5 = riffTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(4)) : stereoMasterSection(5); track6 = melodyTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(5)) : stereoMasterSection(6); track7 = chordStabTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(6)) : stereoMasterSection(7); track8 = crashTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(7)) : stereoMasterSection(8); percBus = track1,track2,track3,track8 :> stereoEffect(Soni_R3_Filter_1); reverbBus = track2,track3,track4,track6,track7 : par(i,5,stereodBGain(ba.take(i+1,REV_SND))) :> reverbMaster; melBus = track4,track5,track6,track7,reverbBus :> stereoEffect(Soni_R3_Filter_2); masterChannel = masterComp : stereoEffect(parametricEQ(masterEQGroup)) : stereoLinGain(masterGain) : stereoEffect(masterLimiter(0)) : stereoEffect(hard_clip(1)); musicBus = melBus,percBus,reverbBus :> masterChannel; process = musicBus,tradSoniOut : ba.select2stereo(sonificationType);
https://raw.githubusercontent.com/prithviKantanAAU/sliderSoniFinal/571109d221f5eadc4d6cc410c1220e5fa387b47e/SliderSoniFinal.dsp
faust
// // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // Panner Dotted Delay FM Synth Piano Single Note Full Chord Synth MUSIC Trackwise SYNTH // 1, 2, 3, 8 are sample-based 4 - CHORD SYNTH MALLET FM 5 - BASSLINE BASSLINE FM AGGRO FM 6 - MAIN MELODY TRUMPETISH FM 7 Sonifications CHORD FREQ DIST FACTORS INSTRUMENTATION BRIGHTNESS BRIGHTNESS TONIC PITCH PITCHED WAVE WHOOSH NOISE " BUSS REVERB PRE-DELAY DC/MID CROSSOVER FREQ MID/HI CROSSOVER FREQ RT60 - DC FS MAX FC - LOWER FC - UPPER REVERB SENDS // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // TABS SLIDER GROUPS MUSIC INFO TAB MIX AND MASTER TAB EQ TAB COMP TAB Tempo and Fluidity Traditional Soni Variants Music Info NOTE NUMBERS 4-1 4-2 4-3 4-4 5 6 7-1 7-2 7-3 7-4 Accent Info 6 4-1 4-2 4-3 4-4 5 VELOCITIES 1 2 Snare - File Number 3 HH - File Number 4-1 4-2 4-3 4-4 4 - LIST 5 6 7 8 Sonification Sliders and Preprocessing TRADITIONAL MUSICAL // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // UTILITY CONVERT VELOCITY VALUE TO TRIGGER ON CHANGE CONVERT 0-10 VELOCITY VALUE TO MONO GAIN MULTIPLIER TEMPO-BASED INSTRUMENT RELEASE FACTOR MASTER LIMITER SHORT STRUM DELAY CHANNEL PROCESSORS - MONO AND STEREO PREPROCESS CHORD FREQUENCIES CREATE FREQ LIST APPLY TUNING SONIFICATIONS CALCULATE CHORD DIST AMOUNT GET INDIVIDUAL MIDI KEYS GET STEREO PAN GAINS SPLIT AND MULTIPLY L-MULTIPLIER R-MULTIPLIER CHANNEL COMP CHANNEL EQ 3 - Effects Dotted Delay Compressor-Limiter CALCULATE GAIN REDUCTION SMOOTH KNEE Master COMP Reverb Master TEMPO DEPENDENT RT60 OUTPUT FILTER 4 - Synthesis OUTPUT SUMMING MEL COMPONENT MEL ENVELOPE CF DIST SONI - VIBRATO LFO SYNTH - FM DIST MIX (1)CARRIER + MOD FREQ LIST MOD DEPTH LIST COOKED DEPTH AMP ENVELOPE DC CORRECTED OUTPUT WAVE PULSE UP TIME PUlSE TOTAL PERIOD WAVESUMMING FC FREQUENCY ENV AMPLITUDE ENV INDIVIDUAL FREQS CALCULATE DELAY F1 F2 F3 F4 SUM + ENVELOPE CALCULATE DELAY LENGTH + TUNING COMPENSATE DAMPING FB FILTER KARPLUS STRONG NOISE EXCITATION // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // MASTER FILTER - LPF R3 - BRIGHTNESS R3 - BRIGHTNESS : ba.sAndH(ba.pulse(ma.SR/5)); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRIGGERS Kick Snare HH Chord LIST MIDI KEYS MIDI KEYS TO FREQ ACCENTS FREQ SELECTOR VEL SELECTOR TRG SELECTOR ACC SELECTOR CHORD - SF VARIANT 1 CHORD - SF VARIANT 2 Riff CALCULATE F0 HZ RIFF VARIANT 1 RIFF VARIANT 2 RIFF VARIANT 2 Melody Main MELODY SF - VARIANT 1 MELODY SF - VARIANT 2 MELODY SF - VARIANT 3 DEFINE STEREO DOTTED DELAY SYNTHESIZE MELODY Chord Stabs GET F0 LIST GET ENV DEFINE DOTTED DELAY CS SYNTH Crash // // // // // // // // // // // // // // // // // // // // // // // // // // // TRADITIONAL STRATEGIES // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
import("stdfaust.lib"); NUM_PANPOS = 7; DOTDEL_FC_HP = 800; DOTDEL_FC_LP = 2000; FM_DISTMIX = 0.05; PIANO_WAVEWIDTH1 = 33; PIANO_WAVEWIDTH2 = 10; PIANO_WAVEWIDTH3 = 66; CS_DEL_N1 = 0.015; CS_DEL_N2 = 0.030; CS_DEL_N3 = 0.045; PANPOS_NOTES = 3,4,5,6; AT_C = 0.001; RL_C = 1; FV_C = 1; MALLET_MRATIO = 2; MALLET_I_FIXED = 2.4; MALLET_I_ENV = 6.86; MALLET_A = 0.001; MALLET_D = 0.001; MALLET_S = 0.5; MALLET_R = 0.4; MALLET_ENVTYPE = 0; AT_R = 0.001; RL_R = 0.6 + (tempo < 120)*(120-tempo)*0.06; MOD_NUM_R = 5; FREQ_FACTOR_R = 3; MOD_DEPTH_R = 35; BASSLINE_MRATIO = 2; BASSLINE_I_FIXED = 6.75; BASSLINE_I_ENV = 7.46; BASSLINE_A = 0.007; BASSLINE_D = 0.001; BASSLINE_S = 0.6553; BASSLINE_R = 0.65; BASSLINE_ENVTYPE = 1; AGGRO_MRATIO = 3; AGGRO_I_FIXED = 10; AGGRO_I_ENV = 10; AGGRO_A = 0.01; AGGRO_D = 0.0001; AGGRO_S = 0.5; AGGRO_R = 0.867; AGGRO_ENVTYPE = 1; AT_M = 0.001; RL_M = 4; FB_DEL_M = 0.5; WET_DEL_M = 0.8; FC_LP_M = 20000; G_SIN_M = -90; G_NS_M = -90; RL_NS_M = 0.05; FC_HP_NS_M = 3000; TRUMPET_MRATIO = 1; TRUMPET_I_FIXED = 10; TRUMPET_I_ENV = 10; TRUMPET_A = 0.05; TRUMPET_D = 0.0001; TRUMPET_S = 0.5; TRUMPET_R = 0.78; TRUMPET_ENVTYPE = 1; AT_CS = 0.001; RL_CS = 5; FB_DEL_CS = 0.8; WET_DEL_CS = 0.4; DMP_KS_CS = 0.99; FREQ_OFFSET_LR = 0.7; SONI_SB_Z2_ONOFF = waveform {1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1}; Soni_R1_MaxDelSec(trackIndex) = 0.1,0.17,0.23,0.29,0.37,0.47,0.59,0.71 : ba.selectn(8,trackIndex); SONI_SB_Z2_ONOFF_RD(i) = SONI_SB_Z2_ONOFF,i : rdtable; REV_SND = -8,-10,-5,0,-5; musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); mixMasterTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); traditionalSoni(x) = sonificationTab(vgroup("Traditional_Strategies",x)); pitchInfo(x) = musicInfoTab(vgroup("Pitch",x)); accentInfo(x) = musicInfoTab(vgroup("Accent",x)); velocityInfo(x) = musicInfoTab(vgroup("Velocity",x)); trackGainGroup(x) = mixMasterTab(vgroup("Track Gain",x)); trackMuteGroup(x) = mixMasterTab(vgroup("Track Mute",x)); masterGainGroup(x) = mixMasterTab(vgroup("Master Gain",x)); masterEQGroup(x) = mixMasterTab(vgroup("Master EQ",x)); variantGroup(x) = mixMasterTab(vgroup("Track Variant",x)); eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); fluidity = musicInfoTab(vslider("Fluidity",1,0.05,10,0.01)) : limit(0.2,5); sonificationType = checkbox("Traditional"); Soni_X_Trad = traditionalSoni(hslider("x_Traditional",0,0,1,0.001)) : si.smoo; Soni_Choice_Trad = traditionalSoni(hslider("Choice_Traditional",0,0,4,1)); VAR_1 = variantGroup(nentry("Variant_1",1,1,3,1)); VAR_2 = variantGroup(nentry("Variant_2",1,1,3,1)); VAR_3 = variantGroup(nentry("Variant_3",1,1,3,1)); VAR_4 = variantGroup(nentry("Variant_4",1,1,3,1)); VAR_5 = variantGroup(nentry("Variant_5",1,1,3,1)); VAR_6 = variantGroup(nentry("Variant_6",1,1,3,1)); VAR_7 = variantGroup(nentry("Variant_7",1,1,3,1)); VAR_8 = variantGroup(nentry("Variant_8",1,1,3,1)); soniSlider(idx,defaultVal) = sonificationTab(vgroup("AP Values",hslider("Soni %idx",defaultVal,0,1,0.001))); X_T_Pitch = soniSlider(1,0); X_T_Tempo = soniSlider(2,0); X_T_Synchronicity = soniSlider(3,0); X_T_Harmonicity = soniSlider(4,0); X_T_Brightness = soniSlider(5,0); X_M_MelDegree = soniSlider(6,0); X_M_Tempo = soniSlider(7,0); X_M_Synchronicity = soniSlider(8,0); X_M_Harmonicity = soniSlider(9,0); X_M_Brightness = soniSlider(10,0); SONI_GAIN_DB = masterGainGroup(vslider("Soni Buss Gain",-8,-10,2,0.01)); masterGain = masterGainGroup(vslider("Master Gain",-6,-96,12,0.01) : ba.db2linear); BT_SMPL = ba.tempo(tempo); stereoLinGain(gain) = _,_ : *(gain),*(gain); stereodBGain(gain) = _,_ : *(linGain),*(linGain) with { linGain = ba.db2linear(gain); }; stereoLinMult(gainPair) = _,_ : *(gainPair : select2(0)),*(gainPair : select2(1)); stereoEffect(effect) = _,_ : effect,effect; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; velToTrigger(vel) = trigger with { trigger = (posTrig + negTrig); posTrig = vel : ba.impulsify; negTrig = - 1 * (vel) : ba.impulsify : *(vel > 0); }; applyVelocity(velocity,trigger,maxVel) = _ : *(gainMult) with { sampledVel = velocity : ba.sAndH(trigger); dBGain = (sampledVel - 10) * 26.0 / 9.0; gainMult = ba.db2linear(dBGain); }; tempo_RelFactor = fluidity + 1.5 * (120-tempo) / 40 * (tempo < 120); masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); shortDelay(d_ms) = stereoEffect(de.fdelay(5000,d_ms*ma.SR)); monoChannel(trackIndex) = *(0.25) : channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)); stereoChannel(trackIndex) = stereoLinGain(0.25) : stereoEffect(channelComp(compTrackGroup(trackIndex))) : stereoEffect(parametricEQ(eqTrackGroup(trackIndex))); getChordFinalFreqs(LIST) = freqs with { }; getPanFunction(panIndex) = panFunction with { }; channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",2000,1500,15000,0.01))); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); }; dotted_delay(feedback,delay,wet) = +~(de.delay(100000,del) : filt)*feedback*wet :> _ with { filt = fi.bandpass(2,DOTDEL_FC_HP,DOTDEL_FC_LP); del = 0.75*delay; }; compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); masterComp = stereoEffect(compLimiter(0,1.01,-20,100,300,0.05)) : stereoEffect(compLimiter(0,1.1,-5,50,200,0.05)) : stereodBGain(2); reverbMaster = _,_ <: re.zita_rev1_stereo(REV_MST_PDEL_MS,REV_MST_F_DC_MID,REV_MST_F_MID_HI,REV_MST_T60_DC,rt_60,REV_MST_FsMax) : filter with { }; stereoMasterSection(trackIndex) = stereoOut with { stereoOut = stereoLinGain(trackGain) : stereoLinGain(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,24,0.01) : ba.db2linear); trackMute = trackMuteGroup(checkbox("%trackIndex")); }; samplePlayer(fileFunc,trigger) = fileFunc(ba.countup(96000,trigger)); K_FILES = soundfile("K_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V3.wav'}]",1) : !,!,_; S_V1_FILES = soundfile("S_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_3.wav'}]",1) : !,!,_; S_V2_FILES = soundfile("S_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_3.wav'}]",1) : !,!,_; S_V3_FILES = soundfile("S_SMPL_V3[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_3.wav'}]",1) : !,!,_; CR_FILES = soundfile("CR_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V3.wav'}]",1) : !,!,_; HH_V1_FILES = soundfile("HH_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_3.wav'}]",1) : !,!,_; HH_V2_FILES = soundfile("HH_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_3.wav'}]",1) : !,!,_; K_SMPL_V1(i) = 0,i : K_FILES; K_SMPL_V2(i) = 1,i : K_FILES; K_SMPL_V3(i) = 2,i : K_FILES; S_SMPL_V1_1(i) = 0,i : S_V1_FILES; S_SMPL_V1_2(i) = 1,i : S_V1_FILES; S_SMPL_V1_3(i) = 2,i : S_V1_FILES; S_SMPL_V2_1(i) = 0,i : S_V2_FILES; S_SMPL_V2_2(i) = 1,i : S_V2_FILES; S_SMPL_V2_3(i) = 2,i : S_V2_FILES; S_SMPL_V3_1(i) = 0,i : S_V3_FILES; S_SMPL_V3_2(i) = 1,i : S_V3_FILES; S_SMPL_V3_3(i) = 2,i : S_V3_FILES; CR_SMPL_V1(i) = 0,i : CR_FILES; CR_SMPL_V2(i) = 1,i : CR_FILES; CR_SMPL_V3(i) = 2,i : CR_FILES; HH_SMPL_V1_1(i) = 0,i : HH_V1_FILES; HH_SMPL_V1_2(i) = 1,i : HH_V1_FILES; HH_SMPL_V1_3(i) = 2,i : HH_V1_FILES; HH_SMPL_V2_1(i) = 0,i : HH_V2_FILES; HH_SMPL_V2_2(i) = 1,i : HH_V2_FILES; HH_SMPL_V2_3(i) = 2,i : HH_V2_FILES; fmSynth_Versatile(fc,modRatio,I_fixed,I_ampDependent,a,d,s,r,envType,trigger,vel,acc) = output with { fc_cooked = fc : si.smooth(ba.tau2pole(0.005)); acc_cooked = 1 + (acc-5.0)/5.0; output = os.osc(fc_cooked + dev) * ampEnv; dev = I * ampEnv * modFreq * os.triangle(modFreq); I = I_fixed + (I_ampDependent * acc_cooked * (0.5 + velFactor) + I_freq) * (ampEnv); I_freq = 4 * (fc - 300)/300; modFreq = (modRatio + X_M_Harmonicity) * fc_cooked; release_basic = ba.tempo(ba.tempo(tempo))/ma.SR * (1 + velFactor * 2); env_basic = en.ar(a,release_basic,trigger); triggerCooked = (env_basic > 0.5) + (env_basic > env_basic'); chosenEnv = en.adsr(a,d,s,r*tempo_RelFactor,triggerCooked), en.adsre(a,d,s,r*tempo_RelFactor,triggerCooked), en.ar(a,r*tempo_RelFactor,trigger), en.are(a,r*tempo_RelFactor,trigger), en.arfe(a,r*tempo_RelFactor,0.3,trigger) : ba.selectn(5,envType); ampEnv = chosenEnv : si.smooth(ba.tau2pole(a)); velFactor = 1 : applyVelocity(vel,trigger,9); }; leadSynth(fundamental,synthFunc,velocity,trigger,synthRelease,synthCutoff,acc) = output with { fundamentalCooked = 2 * fundamental * soniVibratoLFO * accVibrato : limit(20,5000); vibLFO = os.osc(tempo/15); accVibrato = 1 + (0.00045 * acc * vibLFO) : si.smooth(ba.tau2pole(0.001)); }; fmSynth(fundamental,numMod,freqFactor,release,depth,trigger) = (fmSynth + dirtyBus) * env with { }; pulseWave(freq,widthPercent) = output with { }; pianoSim_singleNote(freq,trigger,acc) = monoOut with { monoOut = pulseWave(freq,PIANO_WAVEWIDTH1),pulseWave(freq, }; voiceSynth_FormantBP(freq,vel,trigger,acc) = pm.SFFormantModelBP(2,vowel_H,fric,freqLow,0.04) * env : fi.resonlp(8000,3,1) with { fric = 0.13 - acc/10.0 * 0.13 : max(0); freqLow = freq / 2.0; vowel_idx = 0; env = en.ar(0.02, 1.5 / tempo * 78.6 * tempo_RelFactor * (1 + acc/5.0), trigger); vowel_H = vowel_idx : si.smooth(ba.tau2pole(0.01)); }; fullChordSynth(freqList,synthFunc,env) = stereoChordOut with { }; chordSingle_Synth(freq,acc,synthFunc) = noteOut with { noteOut = synthFunc(freq,acc),synthFunc(freq + 0.5,acc); }; ks(freq,damping) = +~((de.fdelay4(1024,del)*damping) : dampingFilter) with { freqCooked = freq * 1.0116; }; staticBalanceMult(z) = 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 5), 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 6) : stereoEffect(si.smoo); { cutoff = (Soni_R3_1_Fc_Max - X_M_Brightness * (Soni_R3_1_Fc_Max - Soni_R3_1_Fc_Min)), 20000 : select2(X_M_Brightness < 0.001) : si.smoo; qCooked = 1; }; { cutoff = (Soni_R3_2_Fc_Max - X_M_Brightness * (Soni_R3_2_Fc_Max - Soni_R3_2_Fc_Min)), 20000 : select2(X_M_Brightness < 0.001) : si.smoo; qCooked = 4 - 3.3*X_M_Brightness; }; Soni_SyncMusic(maxDelay) = _,_ : de.fdelay(50000,cookedDelaySamples),de.fdelay(50000,cookedDelaySamples) with { cookedDelaySamples = maxDelay * X_M_Synchronicity * ma.SR : si.smoo; }; TRG_K = velToTrigger(V_K); TRG_S = velToTrigger(V_S); TRG_HH = velToTrigger(V_HH); TRG_C_1 = velToTrigger(V_C_1); TRG_C_2 = velToTrigger(V_C_2); TRG_C_3 = velToTrigger(V_C_3); TRG_C_4 = velToTrigger(V_C_4); TRG_LIST_C = TRG_C_1,TRG_C_2,TRG_C_3,TRG_C_4; TRG_R = velToTrigger(V_R); TRG_M = velToTrigger(V_M); TRG_CS = velToTrigger(V_CS); TRG_CR = velToTrigger(V_CR); kick_V1 = samplePlayer(K_SMPL_V1,TRG_K); kick_V2 = samplePlayer(K_SMPL_V2,TRG_K); kick_V3 = samplePlayer(K_SMPL_V3,TRG_K); kickSynth = kick_V1,kick_V2,kick_V3 : ba.selectn(3,VAR_1 - 1); kick_Normal = kickSynth : applyVelocity(V_K,TRG_K,9); kickTrack = kick_Normal,(kickSynth * 1.4) :> monoChannel(1) : getPanFunction(0); snare_V1 = samplePlayer(S_SMPL_V1_1,TRG_S), samplePlayer(S_SMPL_V1_2,TRG_S),samplePlayer(S_SMPL_V1_3,TRG_S) : ba.selectn(3,S_FNUM); snare_V2 = samplePlayer(S_SMPL_V2_1,TRG_S), samplePlayer(S_SMPL_V2_2,TRG_S),samplePlayer(S_SMPL_V2_3,TRG_S) : ba.selectn(3,S_FNUM); snare_V3 = samplePlayer(S_SMPL_V3_1,TRG_S), samplePlayer(S_SMPL_V3_2,TRG_S),samplePlayer(S_SMPL_V3_3,TRG_S) : ba.selectn(3,S_FNUM); snareSynth = snare_V1,snare_V2,snare_V3 : ba.selectn(3,VAR_2 - 1); snare_Normal = snareSynth : applyVelocity(V_S,TRG_S,3); snareTrack = snare_Normal,(snareSynth * 1.4) :> monoChannel(2) : getPanFunction(0); hh_V1 = samplePlayer(HH_SMPL_V1_1,TRG_HH), samplePlayer(HH_SMPL_V1_2,TRG_HH),samplePlayer(HH_SMPL_V1_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V2 = samplePlayer(HH_SMPL_V2_1,TRG_HH), samplePlayer(HH_SMPL_V2_2,TRG_HH),samplePlayer(HH_SMPL_V2_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V3 = pm.marimba(800,0.75,5000,1,1,TRG_HH) * 10; hhSynth = hh_V1,hh_V2,hh_V3 : ba.selectn(3,VAR_3 - 1); hhTrack = hhSynth : applyVelocity(V_HH,TRG_HH,3) : monoChannel(3) : getPanFunction(1); chord_SF_V2(trigger,freq,acc) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, chord_SF_V3(trigger,freq,acc) = os.CZresTrap(0.5*(1+os.osc(freq)),4.54 * (1 + pow(acc/5,2))) * en.are(0.001,2 * tempo_RelFactor,trigger); chord_notePanFunc(idx) = ba.take(idx+1,PANPOS_NOTES); chordSynthFunc(trigger,freq,acc) = chord_SF_V1(trigger,freq,acc), chord_SF_V2(trigger,freq,acc), chord_SF_V3(trigger,freq,acc) : ba.selectn(3,VAR_4 - 1); chordSum = par(i,4,chordSingle_Synth(chordFreq(i), chordAcc(i), chordSynthFunc(chordTrg(i))) : stereoEffect(applyVelocity(chordVel(i),chordTrg(i),9))) :> _,_; chordTrack = chordSum : stereoChannel(4); riff_V2 = fmSynth_Versatile(F0_R,BASSLINE_MRATIO,BASSLINE_I_FIXED,BASSLINE_I_ENV, riff_V3 = fmSynth_Versatile(F0_R,AGGRO_MRATIO,AGGRO_I_FIXED,AGGRO_I_ENV, riffSynth = riff_V1,riff_V2,riff_V3 : ba.selectn(3,VAR_5 - 1); riffTrack = riffSynth : applyVelocity(V_R,TRG_R,9) : monoChannel(5) : getPanFunction(0); F0_M = KEYNUM_M; V_M_SUS = V_M : ba.sAndH(TRG_M); M_FreqFactor = (F0_M - 300)/700 : si.smooth(ba.tau2pole(0.001)); M_V2(freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, M_V3(freq) = fmSynth_Versatile(freq,TRUMPET_MRATIO,TRUMPET_I_FIXED,TRUMPET_I_ENV, M_SynthFunc(freq) = M_V1(freq),M_V2(freq),M_V3(freq) : ba.selectn(3,VAR_6 - 1); melodyTrack = melodySynth : M_FX1 : stereoChannel(6); KEYNUM_LIST_CS = KEYNUM_CS_1,KEYNUM_CS_2,KEYNUM_CS_3,KEYNUM_CS_4; CS_V1(freq) = ks_excitation(TRG_CS) : ks(freq,DMP_KS_CS); CS_V2(freq) = os.triangle(freq); CS_V3(freq) = os.sawtooth(freq); SynthFunc_CS(freq) = CS_V1(freq),CS_V2(freq),CS_V3(freq) : ba.selectn(3,VAR_7 - 1); chordStabTrack = CSTrack : stereoChannel(7); crash_V1 = samplePlayer(CR_SMPL_V1,TRG_CR); crash_V2 = samplePlayer(CR_SMPL_V2,TRG_CR); crash_V3 = samplePlayer(CR_SMPL_V3,TRG_CR); crashSynth = crash_V1,crash_V2,crash_V3 : ba.selectn(3,VAR_8 - 1); crashTrack = crashSynth : applyVelocity(V_CR,TRG_CR,9) : monoChannel(8) : getPanFunction(2); S1_Pitch = os.osc(S1_freq) *(0.5); S1_freq = S1_fmin * pow(2,X_T_Pitch*S1_nOct); S1_fmin = 300; S1_nOct = 3.5; S2_Tempo = os.osc(1000) * en.ar(0.001,0.05,S2_PulseTrain) *(0.5); S2_PulseTrain = ba.pulse(S2_SampleInterval); S2_TempoMax = 20*60; S2_TempoMin = 2*60; S2_IntervalRange = ba.tempo(S2_TempoMin) - ba.tempo(S2_TempoMax); S2_SampleInterval = ba.tempo(S2_TempoMax) + X_T_Tempo * (S2_IntervalRange); S3_Synchronicity = (S3_OriginalTrain + S3_Delayed) : en.ar(0.001,0.05) : *(os.osc(1000) *(0.5)); S3_PulseFreq = 3; S3_PeriodSamples = ba.sec2samp(1/S3_PulseFreq); S3_MaxSampleDelay = 0.25 * S3_PeriodSamples; S3_CurrentDelay = S3_MaxSampleDelay * X_T_Synchronicity; S3_OriginalTrain = ba.pulse(S3_PeriodSamples); S3_Delayed = S3_OriginalTrain : de.fdelay(40000,S3_CurrentDelay); S4_Inharmonicity = (os.osc(S4_F) + S4_addedPartials) * 0.1; S4_addedPartials = par(i,15,S4_InharmExp(i)) :> _; S4_InharmExp(i) = os.osc(S4_F*i*sqrt(1+ X_T_Harmonicity/10*i*i)); S4_F = 200; S5_Brightness = no.noise : fi.resonlp(S5_fc,0.7,1); S5_fc = S5_fmin * pow(2,(1-X_T_Brightness)*S5_nOct); S5_fmin = 300; S5_nOct = 3.5; tradSoniOut = S1_Pitch,S2_Tempo,S3_Synchronicity,S4_Inharmonicity,S5_Brightness : ba.selectn(5,Soni_Choice_Trad) <: _,_; track1 = kickTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(0)) : stereoMasterSection(1); track2 = snareTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(1)) : stereoMasterSection(2); track3 = hhTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(2)) : stereoMasterSection(3); track4 = chordTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(3)) : stereoMasterSection(4); track5 = riffTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(4)) : stereoMasterSection(5); track6 = melodyTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(5)) : stereoMasterSection(6); track7 = chordStabTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(6)) : stereoMasterSection(7); track8 = crashTrack : Soni_SyncMusic(Soni_R1_MaxDelSec(7)) : stereoMasterSection(8); percBus = track1,track2,track3,track8 :> stereoEffect(Soni_R3_Filter_1); reverbBus = track2,track3,track4,track6,track7 : par(i,5,stereodBGain(ba.take(i+1,REV_SND))) :> reverbMaster; melBus = track4,track5,track6,track7,reverbBus :> stereoEffect(Soni_R3_Filter_2); masterChannel = masterComp : stereoEffect(parametricEQ(masterEQGroup)) : stereoLinGain(masterGain) : stereoEffect(masterLimiter(0)) : stereoEffect(hard_clip(1)); musicBus = melBus,percBus,reverbBus :> masterChannel; process = musicBus,tradSoniOut : ba.select2stereo(sonificationType);
91b036f1448b033d510612d435faa2deab64f49b35939254d7885a738039d4f7
prithviKantanAAU/GaitSoni-PostThesis
GaitSoni.dsp
// // // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // import("stdfaust.lib"); // Panner NUM_PANPOS = 7; // Dotted Delay DOTDEL_FC_HP = 800; DOTDEL_FC_LP = 2000; // FM Synth FM_DISTMIX = 0.05; // Piano Single Note PIANO_WAVEWIDTH1 = 33; PIANO_WAVEWIDTH2 = 10; PIANO_WAVEWIDTH3 = 66; // Full Chord Synth CS_DEL_N1 = 0.015; CS_DEL_N2 = 0.030; CS_DEL_N3 = 0.045; // MUSIC Trackwise SYNTH // // 1, 2, 3, 8 are sample-based // 4 - CHORD SYNTH PANPOS_NOTES = 3,4,5,6; AT_C = 0.001; RL_C = 1; FV_C = 1; // MALLET FM MALLET_MRATIO = 2; MALLET_I_FIXED = 2.4; MALLET_I_ENV = 6.86; MALLET_A = 0.001; MALLET_D = 0.001; MALLET_S = 0.5; MALLET_R = 0.4; MALLET_ENVTYPE = 0; // 5 - BASSLINE AT_R = 0.001; RL_R = 0.6 + (tempo < 120)*(120-tempo)*0.06; MOD_NUM_R = 5; FREQ_FACTOR_R = 3; MOD_DEPTH_R = 35; // BASSLINE FM BASSLINE_MRATIO = 2; BASSLINE_I_FIXED = 6.75; BASSLINE_I_ENV = 7.46; BASSLINE_A = 0.007; BASSLINE_D = 0.001; BASSLINE_S = 0.6553; BASSLINE_R = 0.65; BASSLINE_ENVTYPE = 1; // AGGRO FM AGGRO_MRATIO = 3; AGGRO_I_FIXED = 10; AGGRO_I_ENV = 10; AGGRO_A = 0.01; AGGRO_D = 0.0001; AGGRO_S = 0.5; AGGRO_R = 0.867; AGGRO_ENVTYPE = 1; // 6 - MAIN MELODY AT_M = 0.001; RL_M = 4; FB_DEL_M = 0.5; WET_DEL_M = 0.8; FC_LP_M = 20000; G_SIN_M = -90; G_NS_M = -90; RL_NS_M = 0.05; FC_HP_NS_M = 3000; // TRUMPETISH FM TRUMPET_MRATIO = 1; TRUMPET_I_FIXED = 10; TRUMPET_I_ENV = 10; TRUMPET_A = 0.05; TRUMPET_D = 0.0001; TRUMPET_S = 0.5; TRUMPET_R = 0.78; TRUMPET_ENVTYPE = 1; // 7 AT_CS = 0.001; RL_CS = 5; FB_DEL_CS = 0.8; WET_DEL_CS = 0.4; DMP_KS_CS = 0.99; FREQ_OFFSET_LR = 0.7; //Sonifications LIST_FREQ_DISTFACTORS = 0.05,-0.03,0.31,-0.27; // CHORD FREQ DIST FACTORS SONI_SB_Z2_ONOFF = waveform {1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1}; SONI_SB_Z2_ONOFF_RD(i) = SONI_SB_Z2_ONOFF,i : rdtable; Soni_R1_maxLevel = 0; Soni_R1_minLevel = -80; // INSTRUMENTATION Soni_R3_Fc_Max = 20000; Soni_R3_Fc_Min = 200; // BRIGHTNESS Soni_J1_MaxWarpFactor = 10; // TONIC PITCH Soni_J2_minFreq = 250; Soni_J2_maxFreq = 5000; // PITCHED WAVE Soni_J3_minFreq = 1000; Soni_J3_maxFreq = 20000; // WHOOSH NOISE Soni_J3_HPF_FC = 150; Soni_J3_LPF_Q = 5; // " // BUSS REVERB REV_MST_PDEL_MS = 10; // PRE-DELAY REV_MST_F_DC_MID = 100; // DC/MID CROSSOVER FREQ REV_MST_F_MID_HI = 2000; // MID/HI CROSSOVER FREQ REV_MST_T60_DC = 1; // RT60 - DC REV_MST_FsMax = 48000; // FS MAX REV_MST_HPF_FC = 200; // FC - LOWER REV_MST_LPF_FC = 3500; // FC - UPPER // REVERB SENDS REV_SND = -8,-10,-5,0,-5; // // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // // TABS musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); mixMasterTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); // SLIDER GROUPS // MUSIC INFO TAB pitchInfo(x) = musicInfoTab(vgroup("Pitch",x)); accentInfo(x) = musicInfoTab(vgroup("Accent",x)); velocityInfo(x) = musicInfoTab(vgroup("Velocity",x)); // MIX AND MASTER TAB trackGainGroup(x) = mixMasterTab(vgroup("Track Gain",x)); trackMuteGroup(x) = mixMasterTab(vgroup("Track Mute",x)); masterGainGroup(x) = mixMasterTab(vgroup("Master Gain",x)); masterEQGroup(x) = mixMasterTab(vgroup("Master EQ",x)); variantGroup(x) = mixMasterTab(vgroup("Track Variant",x)); // EQ TAB eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); // COMP TAB compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); // Tempo and Fluidity tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); fluidity = musicInfoTab(vslider("Fluidity",1,0.05,10,0.01)) : limit(0.2,5); //Variants VAR_1 = variantGroup(nentry("Variant_1",1,1,3,1)); VAR_2 = variantGroup(nentry("Variant_2",1,1,3,1)); VAR_3 = variantGroup(nentry("Variant_3",1,1,3,1)); VAR_4 = variantGroup(nentry("Variant_4",1,1,3,1)); VAR_5 = variantGroup(nentry("Variant_5",1,1,3,1)); VAR_6 = variantGroup(nentry("Variant_6",1,1,3,1)); VAR_7 = variantGroup(nentry("Variant_7",1,1,3,1)); VAR_8 = variantGroup(nentry("Variant_8",1,1,3,1)); //Music Info // NOTE NUMBERS KEYNUM_C_1 = pitchInfo(hslider("T4_P_1",100,20,10000,0.001)); // 4-1 KEYNUM_C_2 = pitchInfo(hslider("T4_P_2",100,20,10000,0.001)); // 4-2 KEYNUM_C_3 = pitchInfo(hslider("T4_P_3",100,20,10000,0.001)); // 4-3 KEYNUM_C_4 = pitchInfo(hslider("T4_P_4",100,20,10000,0.001)); // 4-4 KEYNUM_R = pitchInfo(hslider("T5_P_1",100,20,10000,0.001)); // 5 KEYNUM_M = pitchInfo(hslider("T6_P_1",100,20,10000,0.001)); // 6 KEYNUM_CS_1 = pitchInfo(hslider("T7_P_1",100,20,10000,0.001)); // 7-1 KEYNUM_CS_2 = pitchInfo(hslider("T7_P_2",100,20,10000,0.001)); // 7-2 KEYNUM_CS_3 = pitchInfo(hslider("T7_P_3",100,20,10000,0.001)); // 7-3 KEYNUM_CS_4 = pitchInfo(hslider("T7_P_4",100,20,10000,0.001)); // 7-4 //Accent Info ACC_M = accentInfo(hslider("T6_A_1",5,0,9,0.01)); // 6 ACC_C_1 = accentInfo(hslider("T4_A_1",5,0,9,0.01)); // 4-1 ACC_C_2 = accentInfo(hslider("T4_A_2",5,0,9,0.01)); // 4-2 ACC_C_3 = accentInfo(hslider("T4_A_3",5,0,9,0.01)); // 4-3 ACC_C_4 = accentInfo(hslider("T4_A_4",5,0,9,0.01)); // 4-4 ACC_R = accentInfo(hslider("T5_A_1",5,0,9,0.01)); // 5 // VELOCITIES V_K = velocityInfo(hslider("T1_V_1",9,0,9,0.1)); // 1 V_S = velocityInfo(hslider("T2_V_1",9,0,9,0.1)); // 2 S_FNUM = ((V_S > 3) + (V_S > 6)) : ba.sAndH(V_S*TRG_S) : *(1 - S_isHEEL) + S_isHEEL*2; // Snare - File Number V_HH = velocityInfo(hslider("T3_V_1",9,0,9,0.1)); // 3 HH_FNUM = ((V_HH > 3) + (V_HH > 6)) : ba.sAndH(V_HH*TRG_HH); // HH - File Number V_C_1 = velocityInfo(hslider("T4_V_1",9,0,9,0.1)); // 4-1 V_C_2 = velocityInfo(hslider("T4_V_2",9,0,9,0.1)); // 4-2 V_C_3 = velocityInfo(hslider("T4_V_3",9,0,9,0.1)); // 4-3 V_C_4 = velocityInfo(hslider("T4_V_4",9,0,9,0.1)); // 4-4 V_LIST_C = V_C_1, V_C_2, V_C_3, V_C_4; // 4 - LIST V_R = velocityInfo(hslider("T5_V_1",9,1,9,0.1)); // 5 V_M = velocityInfo(hslider("T6_V_1",9,1,9,0.1)); // 6 V_CS = velocityInfo(hslider("T7_V_1",9,0,9,0.1)); // 7 V_CR = velocityInfo(hslider("T8_V_1",9,0,9,0.1)); // 8 //Sonification Sliders and Preprocessing soniSlider(idx,defaultVal) = sonificationTab(vgroup("AP Values",hslider("Soni %idx",defaultVal,0,1,0.001))); //Discrete Soni_Z_SB1 = soniSlider(1,0) : zonePreProcess; // Ambulance Soni_Z_SB2 = soniSlider(2,0) : zonePreProcess; // Instrumentation Soni_X_STS1_Bell = soniSlider(3,0) : ba.impulsify; // Bell Trigger Soni_X_STS2_MusicStop = soniSlider(4,0) : >(0.1); // Music Stop Soni_X_STS3_Wah = soniSlider(5,0) : si.smoo; // Wah Wah Soni_X_H1_TRG = soniSlider(6,0); // HS Trigger // HS Slider Cooking HS_S_TRG = (abs(Soni_X_H1_TRG - 0.8) < 0.03) : ba.impulsify; HS_K_TRG = (abs(Soni_X_H1_TRG - 0.7) < 0.03) : ba.impulsify; S_isHEEL = Soni_X_H1_TRG > 0.49; //Continuous Soni_X_P3_ChordFreqDist = soniSlider(7,0); // Chord Freq Distortion Soni_X_R3_OverallBrightness = soniSlider(8,0); // Overall Music Brightness Soni_X_J1_MelBaseFreq = soniSlider(9,0.5); // Melody Tonic Frequency Soni_X_J2_Pitched = soniSlider(10,0); // Pitched Disturbance Soni_X_J3_Whoosh = soniSlider(11,0); // Noise Disturbance Soni_X_D1_Spatialize = soniSlider(12,0.5); // Spatialization Soni_X_D1_Vowel = soniSlider(13,0); // Vowel SONI_GAIN_DB = masterGainGroup(vslider("Soni Buss Gain",-8,-10,2,0.01)); masterGain = masterGainGroup(vslider("Master Gain",-6,-96,12,0.01) : ba.db2linear); // // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // UTILITY BT_SMPL = ba.tempo(tempo); stereoLinGain(gain) = _,_ : *(gain),*(gain); stereodBGain(gain) = _,_ : *(linGain),*(linGain) with { linGain = ba.db2linear(gain); }; stereoLinMult(gainPair) = _,_ : *(gainPair : select2(0)),*(gainPair : select2(1)); stereoEffect(effect) = _,_ : effect,effect; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; // CONVERT VELOCITY VALUE TO TRIGGER ON CHANGE velToTrigger(vel) = trigger with { trigger = (posTrig + negTrig)*(1 - Soni_X_STS2_MusicStop); posTrig = vel : ba.impulsify; negTrig = - 1 * (vel) : ba.impulsify : *(vel > 0); }; // CONVERT 0-10 VELOCITY VALUE TO MONO GAIN MULTIPLIER applyVelocity(velocity,trigger,maxVel) = _ : *(gainMult) with { sampledVel = velocity : ba.sAndH(trigger); dBGain = (sampledVel - 10) * 26.0 / 9.0; gainMult = ba.db2linear(dBGain); }; // CONVERT 0 - 1 SONI SLIDER VALUE TO 1 - 6 ZONE VALUE zonePreProcess(input) = output with { output = par(i,6,isInZone(i)) :> int; isInZone(i) = (i+1) * (input > SONI_SB_THRESH_VALS_RD(i)) * (input < SONI_SB_THRESH_VALS_RD(i+1)); }; // ZONE THRESHOLD VALUES - STORED IN READ TABLE SONI_SB_THRESH_VALS = waveform {-0.1, 0.33, 0.66, 0.8, 0.9, 0.95, 1.1}; SONI_SB_THRESH_VALS_RD(i) = SONI_SB_THRESH_VALS,i : rdtable; // TEMPO-BASED INSTRUMENT RELEASE FACTOR tempo_RelFactor = fluidity + 1.5 * (120-tempo) / 40 * (tempo < 120); // MASTER LIMITER masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); // SHORT STRUM DELAY shortDelay(d_ms) = stereoEffect(de.fdelay(5000,d_ms*ma.SR)); // CHANNEL PROCESSORS - MONO AND STEREO monoChannel(trackIndex) = *(0.25) : channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)); stereoChannel(trackIndex) = stereoLinGain(0.25) : stereoEffect(channelComp(compTrackGroup(trackIndex))) : stereoEffect(parametricEQ(eqTrackGroup(trackIndex))); // PREPROCESS CHORD FREQUENCIES getChordFinalFreqs(LIST) = freqs with { freqs = par(i,4,freq(i)); // CREATE FREQ LIST freq(i) = freqs_pre(i) : Soni_J1_FreqWarpFactor : *(Soni_P3_freqDistFactor(i)); // APPLY TUNING SONIFICATIONS Soni_P3_freqDistFactor(i) = LIST_FREQ_DISTFACTORS : ba.selectn(4,i) : *(Soni_X_P3_ChordFreqDist) : +(1); // CALCULATE CHORD DIST AMOUNT freqs_pre(i) = LIST : ba.selectn(4,i); // GET INDIVIDUAL MIDI KEYS }; // GET STEREO PAN GAINS getPanFunction(panIndex) = panFunction with { panFunction = _ <: _*(L_multiplier), _*(R_multiplier); // SPLIT AND MULTIPLY L_multiplier = 1,0.95,0.3,0.9,0.8,0.6,0.4 : ba.selectn(NUM_PANPOS,panIndex); // L-MULTIPLIER R_multiplier = 1,0.3,0.95,0.4,0.6,0.8,0.9 : ba.selectn(NUM_PANPOS,panIndex); // R-MULTIPLIER }; // CHANNEL COMP channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; // CHANNEL EQ parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",2000,1500,15000,0.01))); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); }; // 3 - Effects // Dotted Delay dotted_delay(feedback,delay,wet) = +~(de.delay(100000,del) : filt)*feedback*wet :> _ with { filt = fi.bandpass(2,DOTDEL_FC_HP,DOTDEL_FC_LP); del = 0.75*delay; }; // Compressor-Limiter compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); outminusindb(level) = max(level-thresh,0)*(1/ratio - 1); // CALCULATE GAIN REDUCTION kneesmooth = si.smooth(ba.tau2pole(kneeAtt)); }; // SMOOTH KNEE // Master COMP masterComp = stereoEffect(compLimiter(0,1.01,-20,100,300,0.05)) : stereoEffect(compLimiter(0,1.1,-5,50,200,0.05)) : stereodBGain(2); //Reverb Master reverbMaster = _,_ <: re.zita_rev1_stereo(REV_MST_PDEL_MS,REV_MST_F_DC_MID,REV_MST_F_MID_HI,REV_MST_T60_DC,rt_60,REV_MST_FsMax) : filter with { rt_60 = min(0.3 + (150 - tempo) * 0.05,1.85); // TEMPO DEPENDENT RT60 filter = stereoEffect(fi.bandpass(1,REV_MST_HPF_FC,REV_MST_LPF_FC)); // OUTPUT FILTER }; stereoMasterSection(trackIndex) = stereoOut with { stereoOut = stereoLinGain(trackGain) : stereoLinGain(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,24,0.01) : ba.db2linear); trackMute = trackMuteGroup(checkbox("%trackIndex")); }; //4 - Synthesis samplePlayer(fileFunc,trigger) = fileFunc(ba.countup(96000,trigger)); K_FILES = soundfile("K_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V3.wav'}]",1) : !,!,_; S_V1_FILES = soundfile("S_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_3.wav'}]",1) : !,!,_; S_V2_FILES = soundfile("S_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_3.wav'}]",1) : !,!,_; S_V3_FILES = soundfile("S_SMPL_V3[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_3.wav'}]",1) : !,!,_; CR_FILES = soundfile("CR_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V3.wav'}]",1) : !,!,_; HH_V1_FILES = soundfile("HH_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_3.wav'}]",1) : !,!,_; HH_V2_FILES = soundfile("HH_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_3.wav'}]",1) : !,!,_; K_SMPL_V1(i) = 0,i : K_FILES; K_SMPL_V2(i) = 1,i : K_FILES; K_SMPL_V3(i) = 2,i : K_FILES; S_SMPL_V1_1(i) = 0,i : S_V1_FILES; S_SMPL_V1_2(i) = 1,i : S_V1_FILES; S_SMPL_V1_3(i) = 2,i : S_V1_FILES; S_SMPL_V2_1(i) = 0,i : S_V2_FILES; S_SMPL_V2_2(i) = 1,i : S_V2_FILES; S_SMPL_V2_3(i) = 2,i : S_V2_FILES; S_SMPL_V3_1(i) = 0,i : S_V3_FILES; S_SMPL_V3_2(i) = 1,i : S_V3_FILES; S_SMPL_V3_3(i) = 2,i : S_V3_FILES; CR_SMPL_V1(i) = 0,i : CR_FILES; CR_SMPL_V2(i) = 1,i : CR_FILES; CR_SMPL_V3(i) = 2,i : CR_FILES; HH_SMPL_V1_1(i) = 0,i : HH_V1_FILES; HH_SMPL_V1_2(i) = 1,i : HH_V1_FILES; HH_SMPL_V1_3(i) = 2,i : HH_V1_FILES; HH_SMPL_V2_1(i) = 0,i : HH_V2_FILES; HH_SMPL_V2_2(i) = 1,i : HH_V2_FILES; HH_SMPL_V2_3(i) = 2,i : HH_V2_FILES; fmSynth_Versatile(fc,modRatio,I_fixed,I_ampDependent,a,d,s,r,envType,trigger,vel,acc) = output with { fc_cooked = fc : si.smooth(ba.tau2pole(0.005)); acc_cooked = 1 + (acc-5.0)/5.0; output = os.osc(fc_cooked + dev) * ampEnv; dev = I * ampEnv * modFreq * os.triangle(modFreq); I = I_fixed + (I_ampDependent * acc_cooked * (0.5 + velFactor) + I_freq) * (ampEnv); I_freq = 4 * (fc - 300)/300; modFreq = (modRatio + Soni_X_P3_ChordFreqDist) * fc_cooked; release_basic = ba.tempo(ba.tempo(tempo))/ma.SR * (1 + velFactor * 2); env_basic = en.ar(a,release_basic,trigger); triggerCooked = (env_basic > 0.5) + (env_basic > env_basic'); chosenEnv = en.adsr(a,d,s,r*tempo_RelFactor,triggerCooked), en.adsre(a,d,s,r*tempo_RelFactor,triggerCooked), en.ar(a,r*tempo_RelFactor,trigger), en.are(a,r*tempo_RelFactor,trigger), en.arfe(a,r*tempo_RelFactor,0.3,trigger) : ba.selectn(5,envType); ampEnv = chosenEnv : si.smooth(ba.tau2pole(a)); velFactor = 1 : applyVelocity(vel,trigger,9); }; leadSynth(fundamental,synthFunc,velocity,trigger,synthRelease,synthCutoff,acc) = output with { output = melSynth,melSynth; // OUTPUT SUMMING melSynth = synthFunc(fundamentalCooked) * env : applyVelocity(velocity,trigger,9); // MEL COMPONENT fundamentalCooked = 2 * fundamental * soniVibratoLFO * accVibrato : limit(20,5000); env = en.ar(0.001,synthRelease * tempo_RelFactor,trigger); // MEL ENVELOPE vibLFO = os.osc(tempo/15); accVibrato = 1 + (0.00045 * acc * vibLFO) : si.smooth(ba.tau2pole(0.001)); soniVibratoLFO = 1 + Soni_X_P3_ChordFreqDist * vibLFO * 0.5 : si.smoo; // CF DIST SONI - VIBRATO LFO }; fmSynth(fundamental,numMod,freqFactor,release,depth,trigger) = (fmSynth + dirtyBus) * env with { fmSynth = sy.fm(freqList,depthList); // SYNTH - FM dirtyBus = fmSynth : ef.cubicnl(0.7,0) : _ *(FM_DISTMIX); // DIST MIX freqList = par(i,numMod,fundamental * pow(freqFactor,i)); // (1)CARRIER + MOD FREQ LIST depthList = par(i,numMod-1,depthCooked); // MOD DEPTH LIST depthCooked = depth * env * 9; // COOKED DEPTH env = sqrt(en.ar(0.001,release * tempo_RelFactor, trigger)) : si.smooth(ba.tau2pole(0.001)); // AMP ENVELOPE }; pulseWave(freq,widthPercent) = output with { output = 2 * (ba.pulsen(duration,interval) - 0.5); // DC CORRECTED OUTPUT WAVE duration = widthPercent * interval / 100; // PULSE UP TIME interval = ma.SR / freq; // PUlSE TOTAL PERIOD }; pianoSim_singleNote(freq,trigger,acc) = monoOut with { monoOut = pulseWave(freq,PIANO_WAVEWIDTH1),pulseWave(freq, PIANO_WAVEWIDTH2),pulseWave(freq,PIANO_WAVEWIDTH3):> fi.lowpass(2,cutoff) * ampEnv; // WAVESUMMING cutoff = (freqEnv + 0.01) * 4000 * freq / 600 * (1 - min(freq,1000)/2000) : limit(20,20000); // FC freqEnv = (1 + (acc - 5.0)/5.0) * en.arfe(0.001,1.6,0.4 * tempo_RelFactor,trigger) : si.smooth(ba.tau2pole(0.0001)); // FREQUENCY ENV ampEnv = pow(en.ar(0.001,4 * tempo_RelFactor,trigger),6) : si.smooth(ba.tau2pole(0.0001)); // AMPLITUDE ENV }; voiceSynth_FormantBP(freq,vel,trigger,acc) = pm.SFFormantModelBP(2,vowel_H,fric,freqLow,0.04) * env : fi.resonlp(8000,3,1) with { fric = 0.13 - acc/10.0 * 0.13 : max(0); freqLow = freq / 2.0; //vowel_idx = _~+(trigger) : %(4) : _ + 0.2; vowel_idx = Soni_X_D1_Vowel; env = en.ar(0.02, 1.5 / tempo * 78.6 * tempo_RelFactor * (1 + acc/5.0), trigger); vowel_H = vowel_idx : si.smooth(ba.tau2pole(0.01)); }; fullChordSynth(freqList,synthFunc,env) = stereoChordOut with { freqSelector(n) = freqList : ba.selectn(4,n-1); // INDIVIDUAL FREQS strumDelay(dMax) = dMax * (tempo < 120) * (120 - tempo)/60; // CALCULATE DELAY freq1Bus = synthFunc(freqSelector(1)),synthFunc(freqSelector(1) + FREQ_OFFSET_LR); // F1 freq2Bus = synthFunc(freqSelector(2)),synthFunc(freqSelector(2) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N1)); // F2 freq3Bus = synthFunc(freqSelector(3)),synthFunc(freqSelector(3) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N2)); // F3 freq4Bus = synthFunc(freqSelector(4)),synthFunc(freqSelector(4) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N3)); // F4 stereoChordOut = freq1Bus,freq2Bus,freq3Bus,freq4Bus :> stereoLinGain(env); // SUM + ENVELOPE }; chordSingle_Synth(freq,acc,synthFunc) = noteOut with { noteOut = synthFunc(freq,acc),synthFunc(freq + 0.5,acc); }; ks(freq,damping) = +~((de.fdelay4(1024,del)*damping) : dampingFilter) with { del = ma.SR/freqCooked - 0.5 - 1*(freqCooked > 600); // CALCULATE DELAY LENGTH + TUNING COMPENSATE dampingFilter = _ <: (_'+ _)/2; // DAMPING FB FILTER freqCooked = freq * 1.0116; }; ks_excitation(trigger) = no.noise*en.ar(0.001,0.001,trigger); // KARPLUS STRONG NOISE EXCITATION staticBalanceMult(z) = 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 5), 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 6) : stereoEffect(si.smoo); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // transientMelDip = dipON * -24 : ba.db2linear : si.smoo // J2 + J3 - MELODY DIP with { dipON = 1 * (Soni_X_J2_Pitched > 0.01) + 1 * (Soni_X_J3_Whoosh > 0.01) // JERK STRATEGY DIPS ; }; musicDuck = duckON * (-50) : ba.db2linear : si.smoo with { duckON = 1 * (Soni_Z_SB1 >= 3) + 0.5 * (Soni_Z_SB1 == 2) ; }; SB_masterPan = out with { out = _,_ : *(leftGain),*(rightGain); leftGain = 1 - ((Soni_Z_SB1 == 6) + (Soni_Z_SB2 == 6)) : si.smoo; rightGain = 1 - ((Soni_Z_SB1 == 5) + (Soni_Z_SB2 == 5)) : si.smoo; }; // AMBULANCE Soni_SB1_Signal_Ambulance = output <: stereoLinMult(Soni_SB1_StereoMult) with { output = os.triangle(frequencyCooked); frequencyCooked = (0.5 + abs(os.osc(modFreq))) * 925; modFreq = 0.15 * (Soni_Z_SB1 == 3) + 1.4 * (Soni_Z_SB1 > 3) + 0.5 * (Soni_Z_SB1 > 4); Soni_SB1_StereoMult = staticBalanceMult(Soni_Z_SB1); }; // INSTRUMENTATION Soni_SB2_Instrumentation(trackIdx) = stereoLinGain(outGain) with { outGain = SONI_SB_Z2_ONOFF_RD(max(0,((trackIdx - 1) * 6 + Soni_Z_SB2 - 1))) : si.smoo; }; // TONIC PITCH MODULATION Soni_J1_FreqWarpFactor = _* pow(Soni_J1_MaxWarpFactor,(2 * (Soni_X_J1_MelBaseFreq - 0.5))); // MASTER FILTER - LPF Soni_R3_Filter = fi.resonlp(cutoff,qCooked,1) with // R3 - BRIGHTNESS { cutoff = Soni_R3_Fc_Max - Soni_X_R3_OverallBrightness * (Soni_R3_Fc_Max - Soni_R3_Fc_Min) : si.smoo; // CALCULTE CUTOFF qCooked = 4 - 3.3 * pow(Soni_X_R3_OverallBrightness,2); // CALCULATE F-DEPENDENT Q }; // PITCHED DISTURBANCE Soni_J2_Pitched = os.sawtooth(frequency) * gain <: _,_ with // J2 - PITCHED WAVE { frequency = Soni_J2_minFreq + (Soni_J2_maxFreq - Soni_J2_minFreq) * pow(Soni_X_J2_Pitched,2); // CALCULATE WAVE FREQUENCY gain = Soni_X_J2_Pitched > 0.01 : si.smoo; // CALCULATE ON/OFF CONDITION }; // SCRAMBLE DELAY - DISTURBANCE ACCOMPANYING Soni_J_Del = de.delay(ma.SR,delSamples),de.delay(ma.SR,delSamples) : filt,filt with { jerkAP = (Soni_X_J2_Pitched + Soni_X_J3_Whoosh) : si.smooth(ba.tau2pole(30.0/tempo)); delSamples = jerkAP * ma.SR * 0.5*(1 + os.osc(tempo/30)); filt = fi.peak_eq_cq(10 * jerkAP,fc_filt,3); fc_filt = 2000 + 2000 * jerkAP; }; // NOISE WHOOSH Soni_J3_Whoosh = no.noise : filter(frequency) : _*(gain) <: _,_ with // J3 - NOISE WHOOSH { frequency = Soni_J3_minFreq + (Soni_J3_maxFreq - Soni_J3_minFreq) * Soni_X_J3_Whoosh * Soni_X_J3_Whoosh; // CALCULATE FILTER FC filter(x) = _ : fi.resonhp(Soni_J3_HPF_FC,0.7,1) : fi.resonlp(frequency,Soni_J3_LPF_Q,1); // NOISE FILTER gain = Soni_X_J3_Whoosh > 0.01 : si.smoo; // CALCULATE ON/OFF CONDITION }; // BELL TRIGGER Soni_STS1_Bell = pm.churchBell(1,10000,0.8,1,Soni_X_STS1_Bell) * en.ar(0.001,2,Soni_X_STS1_Bell) <: stereodBGain(15); // WAH WAH Soni_STS3_LFO = os.osc(tempo/60); Soni_STS3_wahMinFreq = 250; Soni_STS3_wahMaxFreq = 5000; Soni_STS3_Wah(LFO,minFreq,maxFreq) = _,_ : singleChannelWah,singleChannelWah with { singleChannelWah = _ : fi.peak_eq_cq(currentGain,currentFreq,3.1) : *(ba.db2linear(-0.4*currentGain)); LFO_unipolar = 0.5*(LFO + 1); currentFreq = (minFreq + LFO_unipolar*(maxFreq - minFreq)); currentGain = 22 * (Soni_X_STS3_Wah); }; // SPATIALIZE Soni_D1_Spatialize_PAN = _,_ : _*(M_L),_*(M_R) with { M_L = sqrt(1 - Soni_X_D1_Spatialize) * 1.414; M_R = sqrt(Soni_X_D1_Spatialize) * 1.414; }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRIGGERS TRG_K = velToTrigger(V_K) * (1 - S_isHEEL); TRG_S = velToTrigger(V_S) * (1 - S_isHEEL); TRG_HH = velToTrigger(V_HH); TRG_C_1 = velToTrigger(V_C_1); TRG_C_2 = velToTrigger(V_C_2); TRG_C_3 = velToTrigger(V_C_3); TRG_C_4 = velToTrigger(V_C_4); TRG_LIST_C = TRG_C_1,TRG_C_2,TRG_C_3,TRG_C_4; TRG_R = velToTrigger(V_R); TRG_M = velToTrigger(V_M); TRG_CS = velToTrigger(V_CS); TRG_CR = velToTrigger(V_CR); //Kick kick_V1 = samplePlayer(K_SMPL_V1,TRG_K + HS_K_TRG); kick_V2 = samplePlayer(K_SMPL_V2,TRG_K + HS_K_TRG); kick_V3 = samplePlayer(K_SMPL_V3,TRG_K + HS_K_TRG); kickSynth = kick_V1,kick_V2,kick_V3 : ba.selectn(3,VAR_1 - 1); kick_Normal = kickSynth : applyVelocity(V_K,TRG_K,9); kickTrack = kick_Normal,(kickSynth * 1.4) :> monoChannel(1) : getPanFunction(0); //Snare snare_V1 = samplePlayer(S_SMPL_V1_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V1_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V1_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V2 = samplePlayer(S_SMPL_V2_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V2_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V2_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V3 = samplePlayer(S_SMPL_V3_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V3_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V3_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snareSynth = snare_V1,snare_V2,snare_V3 : ba.selectn(3,VAR_2 - 1); snare_Normal = snareSynth : applyVelocity(V_S,TRG_S,3); snareTrack = snare_Normal,(snareSynth * 1.4) :> monoChannel(2) : getPanFunction(0) : Soni_J_Del; //HH hh_V1 = samplePlayer(HH_SMPL_V1_1,TRG_HH), samplePlayer(HH_SMPL_V1_2,TRG_HH),samplePlayer(HH_SMPL_V1_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V2 = samplePlayer(HH_SMPL_V2_1,TRG_HH), samplePlayer(HH_SMPL_V2_2,TRG_HH),samplePlayer(HH_SMPL_V2_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V3 = pm.marimba(800,0.75,5000,1,1,TRG_HH) * 10; hhSynth = hh_V1,hh_V2,hh_V3 : ba.selectn(3,VAR_3 - 1); hhTrack = hhSynth : applyVelocity(V_HH,TRG_HH,3) : monoChannel(3) : getPanFunction(1) : Soni_J_Del; //Chord KEYNUM_LIST_C = KEYNUM_C_1,KEYNUM_C_2,KEYNUM_C_3,KEYNUM_C_4; // LIST MIDI KEYS F0_LIST_HZ_C = getChordFinalFreqs(KEYNUM_LIST_C); // MIDI KEYS TO FREQ ACC_LIST_C = ACC_C_1,ACC_C_2,ACC_C_3,ACC_C_4; // ACCENTS chordFreq(noteIdx) = F0_LIST_HZ_C : ba.selectn(4,noteIdx); // FREQ SELECTOR chordVel(noteIdx) = V_LIST_C : ba.selectn(4,noteIdx); // VEL SELECTOR chordTrg(noteIdx) = TRG_LIST_C : ba.selectn(4,noteIdx); // TRG SELECTOR chordAcc(noteIdx) = ACC_LIST_C : ba.selectn(4,noteIdx); // ACC SELECTOR chord_SF_V1(trigger,freq,acc) = pianoSim_singleNote(freq,trigger,acc); // CHORD - SF VARIANT 1 chord_SF_V2(trigger,freq,acc) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, MALLET_A,MALLET_D,MALLET_S,MALLET_R,MALLET_ENVTYPE,trigger,7,acc); // CHORD - SF VARIANT 2 chord_SF_V3(trigger,freq,acc) = os.CZresTrap(0.5*(1+os.osc(freq)),4.54 * (1 + pow(acc/5,2))) * en.are(0.001,2 * tempo_RelFactor,trigger); chord_notePanFunc(idx) = ba.take(idx+1,PANPOS_NOTES); chordSynthFunc(trigger,freq,acc) = chord_SF_V1(trigger,freq,acc), chord_SF_V2(trigger,freq,acc), chord_SF_V3(trigger,freq,acc) : ba.selectn(3,VAR_4 - 1); chordSum = par(i,4,chordSingle_Synth(chordFreq(i), chordAcc(i), chordSynthFunc(chordTrg(i))) : stereoEffect(applyVelocity(chordVel(i),chordTrg(i),9))) :> _,_; chordTrack = chordSum : stereoChannel(4); //Riff F0_R = KEYNUM_R : Soni_J1_FreqWarpFactor; // CALCULATE F0 HZ riff_V1 = fmSynth(F0_R,MOD_NUM_R,FREQ_FACTOR_R,RL_R,MOD_DEPTH_R,TRG_R); // RIFF VARIANT 1 riff_V2 = fmSynth_Versatile(F0_R,BASSLINE_MRATIO,BASSLINE_I_FIXED,BASSLINE_I_ENV, BASSLINE_A,BASSLINE_D,BASSLINE_S,BASSLINE_R,BASSLINE_ENVTYPE,TRG_R,V_R,ACC_R); // RIFF VARIANT 2 riff_V3 = fmSynth_Versatile(F0_R,AGGRO_MRATIO,AGGRO_I_FIXED,AGGRO_I_ENV, AGGRO_A,AGGRO_D,AGGRO_S,AGGRO_R,AGGRO_ENVTYPE,TRG_R,V_R,ACC_R); // RIFF VARIANT 2 riffSynth = riff_V1,riff_V2,riff_V3 : ba.selectn(3,VAR_5 - 1); riffTrack = riffSynth : applyVelocity(V_R,TRG_R,9) : monoChannel(5) : getPanFunction(0); //Melody Main F0_M = KEYNUM_M : Soni_J1_FreqWarpFactor; V_M_SUS = V_M : ba.sAndH(TRG_M); M_FreqFactor = (F0_M - 300)/700 : si.smooth(ba.tau2pole(0.001)); M_V1(freq) = voiceSynth_FormantBP(freq,V_M_SUS,TRG_M,ACC_M); // MELODY SF - VARIANT 1 M_V2(freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, MALLET_A,MALLET_D,MALLET_S,MALLET_R,MALLET_ENVTYPE,TRG_M,V_M,ACC_M); // MELODY SF - VARIANT 2 M_V3(freq) = fmSynth_Versatile(freq,TRUMPET_MRATIO,TRUMPET_I_FIXED,TRUMPET_I_ENV, TRUMPET_A,TRUMPET_D,TRUMPET_S,TRUMPET_R,TRUMPET_ENVTYPE,TRG_M,V_M,ACC_M); // MELODY SF - VARIANT 3 M_SynthFunc(freq) = M_V1(freq),M_V2(freq),M_V3(freq) : ba.selectn(3,VAR_6 - 1); M_FX1 = dotted_delay(FB_DEL_M,BT_SMPL,WET_DEL_M),dotted_delay(FB_DEL_M,2*BT_SMPL,WET_DEL_M); // DEFINE STEREO DOTTED DELAY melodySynth = leadSynth(F0_M,M_SynthFunc,V_M,TRG_M,RL_M,FC_LP_M,ACC_M); // SYNTHESIZE MELODY melodyTrack = melodySynth : M_FX1 : stereoChannel(6); //Chord Stabs KEYNUM_LIST_CS = KEYNUM_CS_1,KEYNUM_CS_2,KEYNUM_CS_3,KEYNUM_CS_4; F0_LIST_HZ_CS = getChordFinalFreqs(KEYNUM_LIST_CS); // GET F0 LIST ENV_CS = en.ar(AT_CS,RL_CS,TRG_CS); // GET ENV DEL_CS = stereoEffect(dotted_delay(FB_DEL_CS,BT_SMPL,WET_DEL_CS)); // DEFINE DOTTED DELAY CS_V1(freq) = ks_excitation(TRG_CS) : ks(freq,DMP_KS_CS); CS_V2(freq) = os.triangle(freq); CS_V3(freq) = os.sawtooth(freq); SynthFunc_CS(freq) = CS_V1(freq),CS_V2(freq),CS_V3(freq) : ba.selectn(3,VAR_7 - 1); CSTrack = fullChordSynth(F0_LIST_HZ_CS,SynthFunc_CS,ENV_CS) : stereoLinGain(0.3) : DEL_CS; // CS SYNTH chordStabTrack = CSTrack : stereoChannel(7); //Crash crash_V1 = samplePlayer(CR_SMPL_V1,TRG_CR); crash_V2 = samplePlayer(CR_SMPL_V2,TRG_CR); crash_V3 = samplePlayer(CR_SMPL_V3,TRG_CR); crashSynth = crash_V1,crash_V2,crash_V3 : ba.selectn(3,VAR_8 - 1); crashTrack = crashSynth : applyVelocity(V_CR,TRG_CR,9) : monoChannel(8) : getPanFunction(2) : Soni_J_Del; // // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // track1 = kickTrack : Soni_SB2_Instrumentation(1) : stereoMasterSection(1); track2 = snareTrack : Soni_SB2_Instrumentation(2) : stereoMasterSection(2); track3 = hhTrack : Soni_SB2_Instrumentation(3) : stereoMasterSection(3); track4 = chordTrack : Soni_SB2_Instrumentation(4) : stereoMasterSection(4); track5 = riffTrack : Soni_SB2_Instrumentation(5) : stereoMasterSection(5); track6 = melodyTrack : Soni_SB2_Instrumentation(6) : stereoMasterSection(6); track7 = chordStabTrack : Soni_SB2_Instrumentation(7) : stereoMasterSection(7); track8 = crashTrack : Soni_SB2_Instrumentation(8) : stereoMasterSection(8); percBus = track1,track2,track3,track8; reverbBus = track2,track3,track4,track6,track7 : par(i,5,stereodBGain(ba.take(i+1,REV_SND))) :> reverbMaster : stereoLinGain(transientMelDip); melBus = track4,track5,track6,track7,reverbBus :> Soni_STS3_Wah(Soni_STS3_LFO,Soni_STS3_wahMinFreq,Soni_STS3_wahMaxFreq) : stereoLinGain(transientMelDip); soniBus = Soni_J2_Pitched,Soni_J3_Whoosh,Soni_SB1_Signal_Ambulance,Soni_STS1_Bell :> stereodBGain(SONI_GAIN_DB); masterChannel = masterComp : stereoEffect(parametricEQ(masterEQGroup)) : stereoEffect(Soni_R3_Filter) : SB_masterPan : stereoLinGain(masterGain) : stereoEffect(masterLimiter(0)) : stereoEffect(hard_clip(1)); musicBus = melBus,percBus,reverbBus :> stereoLinGain(musicDuck); process = musicBus,soniBus :> masterChannel : Soni_D1_Spatialize_PAN;
https://raw.githubusercontent.com/prithviKantanAAU/GaitSoni-PostThesis/7f24bcb98b690473e2528e7aeaa855ea11fb4a29/DSP/GaitSoni.dsp
faust
// // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // Panner Dotted Delay FM Synth Piano Single Note Full Chord Synth MUSIC Trackwise SYNTH // 1, 2, 3, 8 are sample-based 4 - CHORD SYNTH MALLET FM 5 - BASSLINE BASSLINE FM AGGRO FM 6 - MAIN MELODY TRUMPETISH FM 7 Sonifications CHORD FREQ DIST FACTORS INSTRUMENTATION BRIGHTNESS TONIC PITCH PITCHED WAVE WHOOSH NOISE " BUSS REVERB PRE-DELAY DC/MID CROSSOVER FREQ MID/HI CROSSOVER FREQ RT60 - DC FS MAX FC - LOWER FC - UPPER REVERB SENDS // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // TABS SLIDER GROUPS MUSIC INFO TAB MIX AND MASTER TAB EQ TAB COMP TAB Tempo and Fluidity Variants Music Info NOTE NUMBERS 4-1 4-2 4-3 4-4 5 6 7-1 7-2 7-3 7-4 Accent Info 6 4-1 4-2 4-3 4-4 5 VELOCITIES 1 2 Snare - File Number 3 HH - File Number 4-1 4-2 4-3 4-4 4 - LIST 5 6 7 8 Sonification Sliders and Preprocessing Discrete Ambulance Instrumentation Bell Trigger Music Stop Wah Wah HS Trigger HS Slider Cooking Continuous Chord Freq Distortion Overall Music Brightness Melody Tonic Frequency Pitched Disturbance Noise Disturbance Spatialization Vowel // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // UTILITY CONVERT VELOCITY VALUE TO TRIGGER ON CHANGE CONVERT 0-10 VELOCITY VALUE TO MONO GAIN MULTIPLIER CONVERT 0 - 1 SONI SLIDER VALUE TO 1 - 6 ZONE VALUE ZONE THRESHOLD VALUES - STORED IN READ TABLE TEMPO-BASED INSTRUMENT RELEASE FACTOR MASTER LIMITER SHORT STRUM DELAY CHANNEL PROCESSORS - MONO AND STEREO PREPROCESS CHORD FREQUENCIES CREATE FREQ LIST APPLY TUNING SONIFICATIONS CALCULATE CHORD DIST AMOUNT GET INDIVIDUAL MIDI KEYS GET STEREO PAN GAINS SPLIT AND MULTIPLY L-MULTIPLIER R-MULTIPLIER CHANNEL COMP CHANNEL EQ 3 - Effects Dotted Delay Compressor-Limiter CALCULATE GAIN REDUCTION SMOOTH KNEE Master COMP Reverb Master TEMPO DEPENDENT RT60 OUTPUT FILTER 4 - Synthesis OUTPUT SUMMING MEL COMPONENT MEL ENVELOPE CF DIST SONI - VIBRATO LFO SYNTH - FM DIST MIX (1)CARRIER + MOD FREQ LIST MOD DEPTH LIST COOKED DEPTH AMP ENVELOPE DC CORRECTED OUTPUT WAVE PULSE UP TIME PUlSE TOTAL PERIOD WAVESUMMING FC FREQUENCY ENV AMPLITUDE ENV vowel_idx = _~+(trigger) : %(4) : _ + 0.2; INDIVIDUAL FREQS CALCULATE DELAY F1 F2 F3 F4 SUM + ENVELOPE CALCULATE DELAY LENGTH + TUNING COMPENSATE DAMPING FB FILTER KARPLUS STRONG NOISE EXCITATION // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // J2 + J3 - MELODY DIP JERK STRATEGY DIPS AMBULANCE INSTRUMENTATION TONIC PITCH MODULATION MASTER FILTER - LPF R3 - BRIGHTNESS CALCULTE CUTOFF CALCULATE F-DEPENDENT Q PITCHED DISTURBANCE J2 - PITCHED WAVE CALCULATE WAVE FREQUENCY CALCULATE ON/OFF CONDITION SCRAMBLE DELAY - DISTURBANCE ACCOMPANYING NOISE WHOOSH J3 - NOISE WHOOSH CALCULATE FILTER FC NOISE FILTER CALCULATE ON/OFF CONDITION BELL TRIGGER WAH WAH SPATIALIZE // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRIGGERS Kick Snare HH Chord LIST MIDI KEYS MIDI KEYS TO FREQ ACCENTS FREQ SELECTOR VEL SELECTOR TRG SELECTOR ACC SELECTOR CHORD - SF VARIANT 1 CHORD - SF VARIANT 2 Riff CALCULATE F0 HZ RIFF VARIANT 1 RIFF VARIANT 2 RIFF VARIANT 2 Melody Main MELODY SF - VARIANT 1 MELODY SF - VARIANT 2 MELODY SF - VARIANT 3 DEFINE STEREO DOTTED DELAY SYNTHESIZE MELODY Chord Stabs GET F0 LIST GET ENV DEFINE DOTTED DELAY CS SYNTH Crash // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
import("stdfaust.lib"); NUM_PANPOS = 7; DOTDEL_FC_HP = 800; DOTDEL_FC_LP = 2000; FM_DISTMIX = 0.05; PIANO_WAVEWIDTH1 = 33; PIANO_WAVEWIDTH2 = 10; PIANO_WAVEWIDTH3 = 66; CS_DEL_N1 = 0.015; CS_DEL_N2 = 0.030; CS_DEL_N3 = 0.045; PANPOS_NOTES = 3,4,5,6; AT_C = 0.001; RL_C = 1; FV_C = 1; MALLET_MRATIO = 2; MALLET_I_FIXED = 2.4; MALLET_I_ENV = 6.86; MALLET_A = 0.001; MALLET_D = 0.001; MALLET_S = 0.5; MALLET_R = 0.4; MALLET_ENVTYPE = 0; AT_R = 0.001; RL_R = 0.6 + (tempo < 120)*(120-tempo)*0.06; MOD_NUM_R = 5; FREQ_FACTOR_R = 3; MOD_DEPTH_R = 35; BASSLINE_MRATIO = 2; BASSLINE_I_FIXED = 6.75; BASSLINE_I_ENV = 7.46; BASSLINE_A = 0.007; BASSLINE_D = 0.001; BASSLINE_S = 0.6553; BASSLINE_R = 0.65; BASSLINE_ENVTYPE = 1; AGGRO_MRATIO = 3; AGGRO_I_FIXED = 10; AGGRO_I_ENV = 10; AGGRO_A = 0.01; AGGRO_D = 0.0001; AGGRO_S = 0.5; AGGRO_R = 0.867; AGGRO_ENVTYPE = 1; AT_M = 0.001; RL_M = 4; FB_DEL_M = 0.5; WET_DEL_M = 0.8; FC_LP_M = 20000; G_SIN_M = -90; G_NS_M = -90; RL_NS_M = 0.05; FC_HP_NS_M = 3000; TRUMPET_MRATIO = 1; TRUMPET_I_FIXED = 10; TRUMPET_I_ENV = 10; TRUMPET_A = 0.05; TRUMPET_D = 0.0001; TRUMPET_S = 0.5; TRUMPET_R = 0.78; TRUMPET_ENVTYPE = 1; AT_CS = 0.001; RL_CS = 5; FB_DEL_CS = 0.8; WET_DEL_CS = 0.4; DMP_KS_CS = 0.99; FREQ_OFFSET_LR = 0.7; SONI_SB_Z2_ONOFF = waveform {1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1}; SONI_SB_Z2_ONOFF_RD(i) = SONI_SB_Z2_ONOFF,i : rdtable; REV_SND = -8,-10,-5,0,-5; musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); mixMasterTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); pitchInfo(x) = musicInfoTab(vgroup("Pitch",x)); accentInfo(x) = musicInfoTab(vgroup("Accent",x)); velocityInfo(x) = musicInfoTab(vgroup("Velocity",x)); trackGainGroup(x) = mixMasterTab(vgroup("Track Gain",x)); trackMuteGroup(x) = mixMasterTab(vgroup("Track Mute",x)); masterGainGroup(x) = mixMasterTab(vgroup("Master Gain",x)); masterEQGroup(x) = mixMasterTab(vgroup("Master EQ",x)); variantGroup(x) = mixMasterTab(vgroup("Track Variant",x)); eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); fluidity = musicInfoTab(vslider("Fluidity",1,0.05,10,0.01)) : limit(0.2,5); VAR_1 = variantGroup(nentry("Variant_1",1,1,3,1)); VAR_2 = variantGroup(nentry("Variant_2",1,1,3,1)); VAR_3 = variantGroup(nentry("Variant_3",1,1,3,1)); VAR_4 = variantGroup(nentry("Variant_4",1,1,3,1)); VAR_5 = variantGroup(nentry("Variant_5",1,1,3,1)); VAR_6 = variantGroup(nentry("Variant_6",1,1,3,1)); VAR_7 = variantGroup(nentry("Variant_7",1,1,3,1)); VAR_8 = variantGroup(nentry("Variant_8",1,1,3,1)); soniSlider(idx,defaultVal) = sonificationTab(vgroup("AP Values",hslider("Soni %idx",defaultVal,0,1,0.001))); HS_S_TRG = (abs(Soni_X_H1_TRG - 0.8) < 0.03) : ba.impulsify; HS_K_TRG = (abs(Soni_X_H1_TRG - 0.7) < 0.03) : ba.impulsify; S_isHEEL = Soni_X_H1_TRG > 0.49; SONI_GAIN_DB = masterGainGroup(vslider("Soni Buss Gain",-8,-10,2,0.01)); masterGain = masterGainGroup(vslider("Master Gain",-6,-96,12,0.01) : ba.db2linear); BT_SMPL = ba.tempo(tempo); stereoLinGain(gain) = _,_ : *(gain),*(gain); stereodBGain(gain) = _,_ : *(linGain),*(linGain) with { linGain = ba.db2linear(gain); }; stereoLinMult(gainPair) = _,_ : *(gainPair : select2(0)),*(gainPair : select2(1)); stereoEffect(effect) = _,_ : effect,effect; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; velToTrigger(vel) = trigger with { trigger = (posTrig + negTrig)*(1 - Soni_X_STS2_MusicStop); posTrig = vel : ba.impulsify; negTrig = - 1 * (vel) : ba.impulsify : *(vel > 0); }; applyVelocity(velocity,trigger,maxVel) = _ : *(gainMult) with { sampledVel = velocity : ba.sAndH(trigger); dBGain = (sampledVel - 10) * 26.0 / 9.0; gainMult = ba.db2linear(dBGain); }; zonePreProcess(input) = output with { output = par(i,6,isInZone(i)) :> int; isInZone(i) = (i+1) * (input > SONI_SB_THRESH_VALS_RD(i)) * (input < SONI_SB_THRESH_VALS_RD(i+1)); }; SONI_SB_THRESH_VALS = waveform {-0.1, 0.33, 0.66, 0.8, 0.9, 0.95, 1.1}; SONI_SB_THRESH_VALS_RD(i) = SONI_SB_THRESH_VALS,i : rdtable; tempo_RelFactor = fluidity + 1.5 * (120-tempo) / 40 * (tempo < 120); masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); shortDelay(d_ms) = stereoEffect(de.fdelay(5000,d_ms*ma.SR)); monoChannel(trackIndex) = *(0.25) : channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)); stereoChannel(trackIndex) = stereoLinGain(0.25) : stereoEffect(channelComp(compTrackGroup(trackIndex))) : stereoEffect(parametricEQ(eqTrackGroup(trackIndex))); getChordFinalFreqs(LIST) = freqs with { }; getPanFunction(panIndex) = panFunction with { }; channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",2000,1500,15000,0.01))); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))); }; dotted_delay(feedback,delay,wet) = +~(de.delay(100000,del) : filt)*feedback*wet :> _ with { filt = fi.bandpass(2,DOTDEL_FC_HP,DOTDEL_FC_LP); del = 0.75*delay; }; compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); masterComp = stereoEffect(compLimiter(0,1.01,-20,100,300,0.05)) : stereoEffect(compLimiter(0,1.1,-5,50,200,0.05)) : stereodBGain(2); reverbMaster = _,_ <: re.zita_rev1_stereo(REV_MST_PDEL_MS,REV_MST_F_DC_MID,REV_MST_F_MID_HI,REV_MST_T60_DC,rt_60,REV_MST_FsMax) : filter with { }; stereoMasterSection(trackIndex) = stereoOut with { stereoOut = stereoLinGain(trackGain) : stereoLinGain(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,24,0.01) : ba.db2linear); trackMute = trackMuteGroup(checkbox("%trackIndex")); }; samplePlayer(fileFunc,trigger) = fileFunc(ba.countup(96000,trigger)); K_FILES = soundfile("K_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\K_V3.wav'}]",1) : !,!,_; S_V1_FILES = soundfile("S_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V1_3.wav'}]",1) : !,!,_; S_V2_FILES = soundfile("S_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V2_3.wav'}]",1) : !,!,_; S_V3_FILES = soundfile("S_SMPL_V3[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\S_V3_3.wav'}]",1) : !,!,_; CR_FILES = soundfile("CR_SMPL[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\CR_V3.wav'}]",1) : !,!,_; HH_V1_FILES = soundfile("HH_SMPL_V1[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V1_3.wav'}]",1) : !,!,_; HH_V2_FILES = soundfile("HH_SMPL_V2[url:{'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_1.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_2.wav'; 'D:\\\\GaitSonification\\\\Drum Samples\\\\Final Library\\\\HH_V2_3.wav'}]",1) : !,!,_; K_SMPL_V1(i) = 0,i : K_FILES; K_SMPL_V2(i) = 1,i : K_FILES; K_SMPL_V3(i) = 2,i : K_FILES; S_SMPL_V1_1(i) = 0,i : S_V1_FILES; S_SMPL_V1_2(i) = 1,i : S_V1_FILES; S_SMPL_V1_3(i) = 2,i : S_V1_FILES; S_SMPL_V2_1(i) = 0,i : S_V2_FILES; S_SMPL_V2_2(i) = 1,i : S_V2_FILES; S_SMPL_V2_3(i) = 2,i : S_V2_FILES; S_SMPL_V3_1(i) = 0,i : S_V3_FILES; S_SMPL_V3_2(i) = 1,i : S_V3_FILES; S_SMPL_V3_3(i) = 2,i : S_V3_FILES; CR_SMPL_V1(i) = 0,i : CR_FILES; CR_SMPL_V2(i) = 1,i : CR_FILES; CR_SMPL_V3(i) = 2,i : CR_FILES; HH_SMPL_V1_1(i) = 0,i : HH_V1_FILES; HH_SMPL_V1_2(i) = 1,i : HH_V1_FILES; HH_SMPL_V1_3(i) = 2,i : HH_V1_FILES; HH_SMPL_V2_1(i) = 0,i : HH_V2_FILES; HH_SMPL_V2_2(i) = 1,i : HH_V2_FILES; HH_SMPL_V2_3(i) = 2,i : HH_V2_FILES; fmSynth_Versatile(fc,modRatio,I_fixed,I_ampDependent,a,d,s,r,envType,trigger,vel,acc) = output with { fc_cooked = fc : si.smooth(ba.tau2pole(0.005)); acc_cooked = 1 + (acc-5.0)/5.0; output = os.osc(fc_cooked + dev) * ampEnv; dev = I * ampEnv * modFreq * os.triangle(modFreq); I = I_fixed + (I_ampDependent * acc_cooked * (0.5 + velFactor) + I_freq) * (ampEnv); I_freq = 4 * (fc - 300)/300; modFreq = (modRatio + Soni_X_P3_ChordFreqDist) * fc_cooked; release_basic = ba.tempo(ba.tempo(tempo))/ma.SR * (1 + velFactor * 2); env_basic = en.ar(a,release_basic,trigger); triggerCooked = (env_basic > 0.5) + (env_basic > env_basic'); chosenEnv = en.adsr(a,d,s,r*tempo_RelFactor,triggerCooked), en.adsre(a,d,s,r*tempo_RelFactor,triggerCooked), en.ar(a,r*tempo_RelFactor,trigger), en.are(a,r*tempo_RelFactor,trigger), en.arfe(a,r*tempo_RelFactor,0.3,trigger) : ba.selectn(5,envType); ampEnv = chosenEnv : si.smooth(ba.tau2pole(a)); velFactor = 1 : applyVelocity(vel,trigger,9); }; leadSynth(fundamental,synthFunc,velocity,trigger,synthRelease,synthCutoff,acc) = output with { fundamentalCooked = 2 * fundamental * soniVibratoLFO * accVibrato : limit(20,5000); vibLFO = os.osc(tempo/15); accVibrato = 1 + (0.00045 * acc * vibLFO) : si.smooth(ba.tau2pole(0.001)); }; fmSynth(fundamental,numMod,freqFactor,release,depth,trigger) = (fmSynth + dirtyBus) * env with { }; pulseWave(freq,widthPercent) = output with { }; pianoSim_singleNote(freq,trigger,acc) = monoOut with { monoOut = pulseWave(freq,PIANO_WAVEWIDTH1),pulseWave(freq, }; voiceSynth_FormantBP(freq,vel,trigger,acc) = pm.SFFormantModelBP(2,vowel_H,fric,freqLow,0.04) * env : fi.resonlp(8000,3,1) with { fric = 0.13 - acc/10.0 * 0.13 : max(0); freqLow = freq / 2.0; vowel_idx = Soni_X_D1_Vowel; env = en.ar(0.02, 1.5 / tempo * 78.6 * tempo_RelFactor * (1 + acc/5.0), trigger); vowel_H = vowel_idx : si.smooth(ba.tau2pole(0.01)); }; fullChordSynth(freqList,synthFunc,env) = stereoChordOut with { }; chordSingle_Synth(freq,acc,synthFunc) = noteOut with { noteOut = synthFunc(freq,acc),synthFunc(freq + 0.5,acc); }; ks(freq,damping) = +~((de.fdelay4(1024,del)*damping) : dampingFilter) with { freqCooked = freq * 1.0116; }; staticBalanceMult(z) = 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 5), 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 6) : stereoEffect(si.smoo); with { ; }; musicDuck = duckON * (-50) : ba.db2linear : si.smoo with { duckON = 1 * (Soni_Z_SB1 >= 3) + 0.5 * (Soni_Z_SB1 == 2) ; }; SB_masterPan = out with { out = _,_ : *(leftGain),*(rightGain); leftGain = 1 - ((Soni_Z_SB1 == 6) + (Soni_Z_SB2 == 6)) : si.smoo; rightGain = 1 - ((Soni_Z_SB1 == 5) + (Soni_Z_SB2 == 5)) : si.smoo; }; Soni_SB1_Signal_Ambulance = output <: stereoLinMult(Soni_SB1_StereoMult) with { output = os.triangle(frequencyCooked); frequencyCooked = (0.5 + abs(os.osc(modFreq))) * 925; modFreq = 0.15 * (Soni_Z_SB1 == 3) + 1.4 * (Soni_Z_SB1 > 3) + 0.5 * (Soni_Z_SB1 > 4); Soni_SB1_StereoMult = staticBalanceMult(Soni_Z_SB1); }; Soni_SB2_Instrumentation(trackIdx) = stereoLinGain(outGain) with { outGain = SONI_SB_Z2_ONOFF_RD(max(0,((trackIdx - 1) * 6 + Soni_Z_SB2 - 1))) : si.smoo; }; Soni_J1_FreqWarpFactor = _* pow(Soni_J1_MaxWarpFactor,(2 * (Soni_X_J1_MelBaseFreq - 0.5))); { }; { }; Soni_J_Del = de.delay(ma.SR,delSamples),de.delay(ma.SR,delSamples) : filt,filt with { jerkAP = (Soni_X_J2_Pitched + Soni_X_J3_Whoosh) : si.smooth(ba.tau2pole(30.0/tempo)); delSamples = jerkAP * ma.SR * 0.5*(1 + os.osc(tempo/30)); filt = fi.peak_eq_cq(10 * jerkAP,fc_filt,3); fc_filt = 2000 + 2000 * jerkAP; }; { }; Soni_STS1_Bell = pm.churchBell(1,10000,0.8,1,Soni_X_STS1_Bell) * en.ar(0.001,2,Soni_X_STS1_Bell) <: stereodBGain(15); Soni_STS3_LFO = os.osc(tempo/60); Soni_STS3_wahMinFreq = 250; Soni_STS3_wahMaxFreq = 5000; Soni_STS3_Wah(LFO,minFreq,maxFreq) = _,_ : singleChannelWah,singleChannelWah with { singleChannelWah = _ : fi.peak_eq_cq(currentGain,currentFreq,3.1) : *(ba.db2linear(-0.4*currentGain)); LFO_unipolar = 0.5*(LFO + 1); currentFreq = (minFreq + LFO_unipolar*(maxFreq - minFreq)); currentGain = 22 * (Soni_X_STS3_Wah); }; Soni_D1_Spatialize_PAN = _,_ : _*(M_L),_*(M_R) with { M_L = sqrt(1 - Soni_X_D1_Spatialize) * 1.414; M_R = sqrt(Soni_X_D1_Spatialize) * 1.414; }; TRG_K = velToTrigger(V_K) * (1 - S_isHEEL); TRG_S = velToTrigger(V_S) * (1 - S_isHEEL); TRG_HH = velToTrigger(V_HH); TRG_C_1 = velToTrigger(V_C_1); TRG_C_2 = velToTrigger(V_C_2); TRG_C_3 = velToTrigger(V_C_3); TRG_C_4 = velToTrigger(V_C_4); TRG_LIST_C = TRG_C_1,TRG_C_2,TRG_C_3,TRG_C_4; TRG_R = velToTrigger(V_R); TRG_M = velToTrigger(V_M); TRG_CS = velToTrigger(V_CS); TRG_CR = velToTrigger(V_CR); kick_V1 = samplePlayer(K_SMPL_V1,TRG_K + HS_K_TRG); kick_V2 = samplePlayer(K_SMPL_V2,TRG_K + HS_K_TRG); kick_V3 = samplePlayer(K_SMPL_V3,TRG_K + HS_K_TRG); kickSynth = kick_V1,kick_V2,kick_V3 : ba.selectn(3,VAR_1 - 1); kick_Normal = kickSynth : applyVelocity(V_K,TRG_K,9); kickTrack = kick_Normal,(kickSynth * 1.4) :> monoChannel(1) : getPanFunction(0); snare_V1 = samplePlayer(S_SMPL_V1_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V1_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V1_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V2 = samplePlayer(S_SMPL_V2_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V2_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V2_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V3 = samplePlayer(S_SMPL_V3_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V3_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V3_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snareSynth = snare_V1,snare_V2,snare_V3 : ba.selectn(3,VAR_2 - 1); snare_Normal = snareSynth : applyVelocity(V_S,TRG_S,3); snareTrack = snare_Normal,(snareSynth * 1.4) :> monoChannel(2) : getPanFunction(0) : Soni_J_Del; hh_V1 = samplePlayer(HH_SMPL_V1_1,TRG_HH), samplePlayer(HH_SMPL_V1_2,TRG_HH),samplePlayer(HH_SMPL_V1_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V2 = samplePlayer(HH_SMPL_V2_1,TRG_HH), samplePlayer(HH_SMPL_V2_2,TRG_HH),samplePlayer(HH_SMPL_V2_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V3 = pm.marimba(800,0.75,5000,1,1,TRG_HH) * 10; hhSynth = hh_V1,hh_V2,hh_V3 : ba.selectn(3,VAR_3 - 1); hhTrack = hhSynth : applyVelocity(V_HH,TRG_HH,3) : monoChannel(3) : getPanFunction(1) : Soni_J_Del; chord_SF_V2(trigger,freq,acc) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, chord_SF_V3(trigger,freq,acc) = os.CZresTrap(0.5*(1+os.osc(freq)),4.54 * (1 + pow(acc/5,2))) * en.are(0.001,2 * tempo_RelFactor,trigger); chord_notePanFunc(idx) = ba.take(idx+1,PANPOS_NOTES); chordSynthFunc(trigger,freq,acc) = chord_SF_V1(trigger,freq,acc), chord_SF_V2(trigger,freq,acc), chord_SF_V3(trigger,freq,acc) : ba.selectn(3,VAR_4 - 1); chordSum = par(i,4,chordSingle_Synth(chordFreq(i), chordAcc(i), chordSynthFunc(chordTrg(i))) : stereoEffect(applyVelocity(chordVel(i),chordTrg(i),9))) :> _,_; chordTrack = chordSum : stereoChannel(4); riff_V2 = fmSynth_Versatile(F0_R,BASSLINE_MRATIO,BASSLINE_I_FIXED,BASSLINE_I_ENV, riff_V3 = fmSynth_Versatile(F0_R,AGGRO_MRATIO,AGGRO_I_FIXED,AGGRO_I_ENV, riffSynth = riff_V1,riff_V2,riff_V3 : ba.selectn(3,VAR_5 - 1); riffTrack = riffSynth : applyVelocity(V_R,TRG_R,9) : monoChannel(5) : getPanFunction(0); F0_M = KEYNUM_M : Soni_J1_FreqWarpFactor; V_M_SUS = V_M : ba.sAndH(TRG_M); M_FreqFactor = (F0_M - 300)/700 : si.smooth(ba.tau2pole(0.001)); M_V2(freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, M_V3(freq) = fmSynth_Versatile(freq,TRUMPET_MRATIO,TRUMPET_I_FIXED,TRUMPET_I_ENV, M_SynthFunc(freq) = M_V1(freq),M_V2(freq),M_V3(freq) : ba.selectn(3,VAR_6 - 1); melodyTrack = melodySynth : M_FX1 : stereoChannel(6); KEYNUM_LIST_CS = KEYNUM_CS_1,KEYNUM_CS_2,KEYNUM_CS_3,KEYNUM_CS_4; CS_V1(freq) = ks_excitation(TRG_CS) : ks(freq,DMP_KS_CS); CS_V2(freq) = os.triangle(freq); CS_V3(freq) = os.sawtooth(freq); SynthFunc_CS(freq) = CS_V1(freq),CS_V2(freq),CS_V3(freq) : ba.selectn(3,VAR_7 - 1); chordStabTrack = CSTrack : stereoChannel(7); crash_V1 = samplePlayer(CR_SMPL_V1,TRG_CR); crash_V2 = samplePlayer(CR_SMPL_V2,TRG_CR); crash_V3 = samplePlayer(CR_SMPL_V3,TRG_CR); crashSynth = crash_V1,crash_V2,crash_V3 : ba.selectn(3,VAR_8 - 1); crashTrack = crashSynth : applyVelocity(V_CR,TRG_CR,9) : monoChannel(8) : getPanFunction(2) : Soni_J_Del; track1 = kickTrack : Soni_SB2_Instrumentation(1) : stereoMasterSection(1); track2 = snareTrack : Soni_SB2_Instrumentation(2) : stereoMasterSection(2); track3 = hhTrack : Soni_SB2_Instrumentation(3) : stereoMasterSection(3); track4 = chordTrack : Soni_SB2_Instrumentation(4) : stereoMasterSection(4); track5 = riffTrack : Soni_SB2_Instrumentation(5) : stereoMasterSection(5); track6 = melodyTrack : Soni_SB2_Instrumentation(6) : stereoMasterSection(6); track7 = chordStabTrack : Soni_SB2_Instrumentation(7) : stereoMasterSection(7); track8 = crashTrack : Soni_SB2_Instrumentation(8) : stereoMasterSection(8); percBus = track1,track2,track3,track8; reverbBus = track2,track3,track4,track6,track7 : par(i,5,stereodBGain(ba.take(i+1,REV_SND))) :> reverbMaster : stereoLinGain(transientMelDip); melBus = track4,track5,track6,track7,reverbBus :> Soni_STS3_Wah(Soni_STS3_LFO,Soni_STS3_wahMinFreq,Soni_STS3_wahMaxFreq) : stereoLinGain(transientMelDip); soniBus = Soni_J2_Pitched,Soni_J3_Whoosh,Soni_SB1_Signal_Ambulance,Soni_STS1_Bell :> stereodBGain(SONI_GAIN_DB); masterChannel = masterComp : stereoEffect(parametricEQ(masterEQGroup)) : stereoEffect(Soni_R3_Filter) : SB_masterPan : stereoLinGain(masterGain) : stereoEffect(masterLimiter(0)) : stereoEffect(hard_clip(1)); musicBus = melBus,percBus,reverbBus :> stereoLinGain(musicDuck); process = musicBus,soniBus :> masterChannel : Soni_D1_Spatialize_PAN;
921db8c41d05c06672afe902b18c920fcccce0d6b1b81772a58a0d9c12648f6a
prithviKantanAAU/GaitSoni-PostThesis
GaitSoni - 2020-08-06T151306.895.dsp
// // // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // import("stdfaust.lib"); // FX Params // // Panner NUM_PANPOS = 7; // Dotted Delay DOTDEL_FC_HP = 800; DOTDEL_FC_LP = 2000; // FM Synth FM_DISTMIX = 0.05; // Piano Single Note PIANO_WAVEWIDTH1 = 33; PIANO_WAVEWIDTH2 = 10; PIANO_WAVEWIDTH3 = 66; // Full Chord Synth CS_DEL_N1 = 0.015; CS_DEL_N2 = 0.030; CS_DEL_N3 = 0.045; // MUSIC Trackwise SYNTH // // 4 PANPOS_NOTES = 3,4,5,6; AT_C = 0.001; RL_C = 1; FV_C = 1; // MALLET FM MALLET_MRATIO = 2; MALLET_I_FIXED = 2.4; MALLET_I_ENV = 6.86; MALLET_A = 0.001; MALLET_D = 0.001; MALLET_S = 0.5; MALLET_R = 0.4; MALLET_ENVTYPE = 0; // TRUMPETISH FM TRUMPET_MRATIO = 1; TRUMPET_I_FIXED = 10; TRUMPET_I_ENV = 10; TRUMPET_A = 0.05; TRUMPET_D = 0.0001; TRUMPET_S = 0.5; TRUMPET_R = 0.78; TRUMPET_ENVTYPE = 1; // BASSLINE FM BASSLINE_MRATIO = 2; BASSLINE_I_FIXED = 6.75; BASSLINE_I_ENV = 7.46; BASSLINE_A = 0.007; BASSLINE_D = 0.001; BASSLINE_S = 0.6553; BASSLINE_R = 0.65; BASSLINE_ENVTYPE = 1; // AGGRO FM AGGRO_MRATIO = 3; AGGRO_I_FIXED = 10; AGGRO_I_ENV = 10; AGGRO_A = 0.01; AGGRO_D = 0.0001; AGGRO_S = 0.5; AGGRO_R = 0.867; AGGRO_ENVTYPE = 1; // 5 MOD_NUM_R = 5; FREQ_FACTOR_R = 3; MOD_DEPTH_R = 35; AT_R = 0.001; RL_R = 0.6 + (tempo < 120)*(120-tempo)*0.06; // 6 AT_M = 0.001; RL_M = 4; FB_DEL_M = 0.5; WET_DEL_M = 0.8; FC_LP_M = 20000; G_SIN_M = -90; G_NS_M = -90; RL_NS_M = 0.05; FC_HP_NS_M = 3000; // 7 AT_CS = 0.001; RL_CS = 5; FB_DEL_CS = 0.8; WET_DEL_CS = 0.4; DMP_KS_CS = 0.99; FREQ_OFFSET_LR = 0.7; //Sonifications SONI_GAIN_DB = -8; LIST_FREQ_DISTFACTORS = 0.05,-0.03,0.31,-0.27; // CHORD FREQ DIST FACTORS SONI_SB_Z2_ONOFF = waveform {1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1}; SONI_SB_Z2_ONOFF_RD(i) = SONI_SB_Z2_ONOFF,i : rdtable; Soni_SB3_maxLevel = 0; Soni_SB3_minLevel = -20; // ENSEMBLE INTENSITY Soni_SB3_BPF_Fc_Kick = 400; Soni_SB3_BPF_Fc_Snare = 1000; Soni_SB3_BPF_Fc_HH = 10000; // ENSEMBLE INTENSITY Soni_SB3_Q = 20; SON_BPF_G = 20; SON_BPF_LFO_TEMPO_DIV = 97; // ENSEMBLE INTENSITY Soni_R1_maxLevel = 0; Soni_R1_minLevel = -80; // INSTRUMENTATION Soni_R3_Fc_Max = 20000; Soni_R3_Fc_Min = 200; // BRIGHTNESS Soni_J1_MaxWarpFactor = 5; // TONIC PITCH Soni_J2_minFreq = 250; Soni_J2_maxFreq = 5000; // PITCHED WAVE Soni_J3_minFreq = 1000; Soni_J3_maxFreq = 20000; // WHOOSH NOISE Soni_J3_HPF_FC = 150; Soni_J3_LPF_Q = 5; // " // BUSS REVERB REV_MST_PDEL_MS = 10; // PRE-DELAY REV_MST_F_DC_MID = 100; // DC/MID CROSSOVER FREQ REV_MST_F_MID_HI = 2000; // MID/HI CROSSOVER FREQ REV_MST_T60_DC = 1; // RT60 - DC REV_MST_FsMax = 48000; // FS MAX REV_MST_HPF_FC = 200; // FC - LOWER REV_MST_LPF_FC = 3500; // FC - UPPER // REVERB SENDS REV_SND = -8,-10,-5,0,-5; // // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); melodyInfo(x) = musicInfoTab(vgroup("Melody",x)); chordInfo(x) = musicInfoTab(vgroup("Chords",x)); drumInfo(x) = musicInfoTab(vgroup("Drums",x)); masterGainTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); trackGainGroup(x) = masterGainTab(vgroup("Track Gain",x)); trackMuteGroup(x) = masterGainTab(vgroup("Track Mute",x)); masterGroup(x) = masterGainTab(vgroup("Master Gain",x)); masterEQGroup(x) = masterGainTab(vgroup("Master EQ",x)); variantGroup(x) = masterGainTab(vgroup("Track Variant",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); // Sonification Related sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); punishmentSoni(x) = sonificationTab(vgroup("Punishment_Strategies",x)); rewardSoni(x) = sonificationTab(vgroup("Reward_Strategies",x)); jerkSoni(x) = sonificationTab(vgroup("JerkSoni_Strategies",x)); hsSoni(x) = sonificationTab(vgroup("HStrike_Strategies",x)); traditionalSoni(x) = sonificationTab(vgroup("Traditional_Strategies",x)); // Tonic + Tempo tonic = musicInfoTab(vslider("Tonic",36,30,42,1)) : limit(20,70); tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); //Variants VAR_1 = variantGroup(nentry("Variant_1",1,1,3,1)); VAR_2 = variantGroup(nentry("Variant_2",1,1,3,1)); VAR_3 = variantGroup(nentry("Variant_3",1,1,3,1)); VAR_4 = variantGroup(nentry("Variant_4",1,1,3,1)); VAR_5 = variantGroup(nentry("Variant_5",1,1,3,1)); VAR_6 = variantGroup(nentry("Variant_6",1,1,3,1)); VAR_7 = variantGroup(nentry("Variant_7",1,1,3,1)); VAR_8 = variantGroup(nentry("Variant_8",1,1,3,1)); //Music Info SWING_MS = drumInfo(hslider("Swing Ms",0,0,20,1) : limit(0,20)); // SWING // NOTE NUMBERS KEYNUM_C_1 = chordInfo(hslider("CF1 Current",48,0,99,1)) : int; // 4-1 KEYNUM_C_2 = chordInfo(hslider("CF2 Current",52,0,99,1)) : int; // 4-2 KEYNUM_C_3 = chordInfo(hslider("CF3 Current",55,0,99,1)) : int; // 4-3 KEYNUM_C_4 = chordInfo(hslider("CF4 Current",60,0,99,1)) : int; // 4-4 KEYNUM_R = melodyInfo(hslider("RF Current",36,0,99,1)) : int; // 5 KEYNUM_M = melodyInfo(hslider("MF Current",48,0,99,1)) : int; // 6 KEYNUM_CS_1 = chordInfo(hslider("CSF1 Current",60,0,99,1)) : int; // 7-1 KEYNUM_CS_2 = chordInfo(hslider("CSF2 Current",63,0,99,1)) : int; // 7-2 KEYNUM_CS_3 = chordInfo(hslider("CSF3 Current",67,0,99,1)) : int; // 7-3 KEYNUM_CS_4 = chordInfo(hslider("CSF4 Current",48,0,99,1)) : int; // 7-4 // VELOCITIES V_K = drumInfo(hslider("Kick Velocity",9,0,9,0.1) : limit(0,9)); // 1 V_S = drumInfo(hslider("Snare Velocity",9,0,9,0.1) : limit(0,9)); // 2 S_FNUM = ((V_S > 3) + (V_S > 6)) : ba.sAndH(V_S*TRG_S) : *(1 - S_isHEEL) + S_isHEEL*2; V_HH = drumInfo(hslider("HH Velocity",9,0,9,0.1) : limit(0,9)); // 3 HH_FNUM = ((V_HH > 3) + (V_HH > 6)) : ba.sAndH(V_HH*TRG_HH); V_HH_COOKED = V_HH : _%(5) : *(2); HH_OPEN = 1 + 2 * (HH_IS_OPEN); V_C_1 = chordInfo(hslider("CV1 Current",9,0,9,0.1) : limit(0,9)); // 4-1 V_C_2 = chordInfo(hslider("CV2 Current",9,0,9,0.1) : limit(0,9)); // 4-2 V_C_3 = chordInfo(hslider("CV3 Current",9,0,9,0.1) : limit(0,9)); // 4-3 V_C_4 = chordInfo(hslider("CV4 Current",9,0,9,0.1) : limit(0,9)); // 4-4 V_LIST_C = V_C_1, V_C_2, V_C_3, V_C_4; // 4 - LIST V_R = melodyInfo(hslider("RV Current",9,1,9,0.1) : limit(0,9)); // 5 V_M = melodyInfo(hslider("MV Current",9,1,9,0.1) : limit(0,9)); // 6 V_CS = chordInfo(hslider("CSV Current",9,0,9,0.1) : limit(0,9)); // 7 V_CR = drumInfo(hslider("Crash Velocity",9,0,9,0.1) : limit(0,9)); // 8 //Sonification //Zone-based Static Balance Soni_Z_SB1 = punishmentSoni(hslider("x_SB1_Ambulance",0,0,1,0.001)) : zonePreProcess; Soni_Z_SB2 = punishmentSoni(hslider("x_SB2_Instrumentation",0,0,1,0.001)) : zonePreProcess; //STS Cues Soni_X_STS1_Bell = jerkSoni(hslider("x_STS1_Bell",0,0,1,0.001)) : ba.impulsify; Soni_X_STS2_MusicStop = jerkSoni(hslider("x_STS2_MusicStop",0,0,1,0.001)) : >(0.1); Soni_X_STS3_Wah = jerkSoni(hslider("x_STS2_Wah",0,0,1,0.001)) : si.smoo; //Punishment Strategies Soni_X_P3_ChordFreqDist = punishmentSoni(hslider("x_P3_ChordFreqDist",0,0,1,0.001)) : si.smoo; //Reward Strategies Soni_X_R1_InstLevel = rewardSoni(hslider("x_R1_InstLevel",0,0,1,0.001)) : si.smoo; Soni_X_R3_OverallBrightness = rewardSoni(hslider("x_R3_OverallBrightness",0,0,1,0.001)) : si.smoo; //Jerk Strategies Soni_X_J1_MelBaseFreq = jerkSoni(hslider("x_J1_MelBaseFreq",0,0,1,0.001)) : si.smoo; Soni_X_J2_Pitched = jerkSoni(hslider("x_J2_Pitched",0,0,1,0.001)) : si.smoo; Soni_X_J3_Whoosh = jerkSoni(hslider("x_J3_Whoosh",0,0,1,0.001)) : si.smoo; //Heel Strike Strategies Soni_X_H1_TRG = hsSoni(hslider("x_H1_SnareTrigger",0,0,1,1)); HS_S_TRG = (abs(Soni_X_H1_TRG - 0.8) < 0.03) : ba.impulsify; HS_K_TRG = (abs(Soni_X_H1_TRG - 0.7) < 0.03) : ba.impulsify; S_isHEEL = Soni_X_H1_TRG > 0.49; // // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // 1 - UTILITY BT_SMPL = ba.tempo(tempo); BT_SEC = 60.0/tempo; stereoLinGain(gain) = _,_ : *(gain),*(gain); stereodBGain(gain) = _,_ : *(ba.db2linear(gain)),*(ba.db2linear(gain)); stereoLinMult(gainPair) = _,_ : *(gainPair : select2(0)),*(gainPair : select2(1)); stereoEffect(effect) = _,_ : effect,effect; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; velToTrigger(vel) = trigger with { trigger = (posTrig + negTrig)*(1 - Soni_X_STS2_MusicStop); posTrig = vel : ba.impulsify; negTrig = - 1 * (vel) : ba.impulsify : *(vel > 0); }; applyVelocity(velocity,trigger,maxVel) = _ : *(gainMult) with { gainMult = pow(sampledVel * 0.1,1.5); sampledVel = velCooked : ba.sAndH(velSampleInstant) : si.smooth(ba.tau2pole(0.0001)); velCooked = velocity * 9.0 / maxVel; velSampleInstant = trigger; }; zonePreProcess(input) = output with { output = par(i,6,isInZone(i)) :> int; isInZone(i) = (i+1) * (input > SONI_SB_THRESH_VALS_RD(i)) * (input < SONI_SB_THRESH_VALS_RD(i+1)); }; SONI_SB_THRESH_VALS = waveform {-0.1, 0.33, 0.66, 0.8, 0.9, 0.95, 1.1}; SONI_SB_THRESH_VALS_RD(i) = SONI_SB_THRESH_VALS,i : rdtable; tempo_RelFactor = 1 + 1.5 * (120-tempo) / 40 * (tempo < 120); masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); melodyFundamentalFreq(finalMidiValue) = ba.midikey2hz(finalMidiValue) : limit(20,4000) : Soni_J1_FreqWarpFactor; shortDelay(d_ms) = de.fdelay(5000,d_ms*ma.SR),de.fdelay(5000,d_ms*ma.SR); monoChannel(trackIndex) = *(ba.db2linear(-12)) : channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)); stereoChannel(trackIndex) = *(ba.db2linear(-12)),*(ba.db2linear(-12)) : channelComp(compTrackGroup(trackIndex)),channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)), parametricEQ(eqTrackGroup(trackIndex)); getChordFinalFreqs(LIST_Midi) = freqs with { freqs = par(i,4,freq(i)); // CREATE FREQ LIST freq(i) = midi(i) : ba.midikey2hz : Soni_J1_FreqWarpFactor : *(Soni_P3_freqDistFactor(i)) : limit(20,5000); // APPLY TUNING SONIFICATIONS Soni_P3_freqDistFactor(i) = LIST_FREQ_DISTFACTORS : ba.selectn(4,i) : *(Soni_X_P3_ChordFreqDist) : +(1); // CALCULATE CHORD DIST AMOUNT midi(i) = LIST_Midi : ba.selectn(4,i); // GET INDIVIDUAL MIDI KEYS }; getPanFunction(panIndex) = panFunction with { panFunction = _ <: _*(L_multiplier), _*(R_multiplier); // SPLIT AND MULTIPLY L_multiplier = 1,0.95,0.3,0.9,0.8,0.6,0.4 : ba.selectn(NUM_PANPOS,panIndex); // L-MULTIPLIER R_multiplier = 1,0.3,0.95,0.4,0.6,0.8,0.9 : ba.selectn(NUM_PANPOS,panIndex); // R-MULTIPLIER }; // 2 - CHANNEL STRIP channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))) : limit(20,20000); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))) : limit(20,20000); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))) : limit(-24,24); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))) : limit(20,20000); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))) : limit(-24,24); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",2000,1500,15000,0.01))) : limit(20,20000); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); }; // 3 - Effects // Dotted Delay dotted_delay(feedback,delay,wet) = +~(de.delay(100000,del) : filt)*feedback*wet :> _ with { filt = fi.bandpass(2,DOTDEL_FC_HP,DOTDEL_FC_LP); del = 0.75*delay; }; // Compressor-Limiter compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); outminusindb(level) = max(level-thresh,0)*(1/ratio - 1); // CALCULATE GAIN REDUCTION kneesmooth = si.smooth(ba.tau2pole(kneeAtt)); }; // SMOOTH KNEE // Master COMP masterComp = stereoEffect(compLimiter(0,1.01,-20,100,300,0.05)) : stereoEffect(compLimiter(0,1.1,-5,50,200,0.05)) : stereodBGain(2); //Reverb Master reverbMaster = _,_ <: re.zita_rev1_stereo(REV_MST_PDEL_MS,REV_MST_F_DC_MID,REV_MST_F_MID_HI,REV_MST_T60_DC,rt_60,REV_MST_FsMax) : filter with { rt_60 = min(0.3 + (150 - tempo) * 0.05,1.85); // TEMPO DEPENDENT RT60 filter = stereoEffect(fi.bandpass(1,REV_MST_HPF_FC,REV_MST_LPF_FC)); // OUTPUT FILTER }; stereoMasterSection(trackIndex) = stereoOut with { stereoOut = stereoLinGain(trackGain) : stereoLinGain(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,24,0.01) : ba.db2linear); trackMute = trackMuteGroup(checkbox("%trackIndex")); }; //4 - Synthesis samplePlayer(fileFunc,trigger) = fileFunc(ba.countup(96000,trigger)); K_FILES = soundfile("K_SMPL[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\K_V1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\K_V2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\K_V3.wav'}]",1) : !,!,_; S_V1_FILES = soundfile("S_SMPL_V1[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V1_1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V1_2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V1_3.wav'}]",1) : !,!,_; S_V2_FILES = soundfile("S_SMPL_V2[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V2_1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V2_2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V2_3.wav'}]",1) : !,!,_; S_V3_FILES = soundfile("S_SMPL_V3[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V3_1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V3_2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V3_3.wav'}]",1) : !,!,_; CR_FILES = soundfile("CR_SMPL[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\CR_V1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\CR_V2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\CR_V3.wav'}]",1) : !,!,_; HH_V1_FILES = soundfile("HH_SMPL_V1[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V1_1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V1_2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V1_3.wav'}]",1) : !,!,_; HH_V2_FILES = soundfile("HH_SMPL_V2[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V2_1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V2_2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V2_3.wav'}]",1) : !,!,_; K_SMPL_V1(i) = 0,i : K_FILES; K_SMPL_V2(i) = 1,i : K_FILES; K_SMPL_V3(i) = 2,i : K_FILES; S_SMPL_V1_1(i) = 0,i : S_V1_FILES; S_SMPL_V1_2(i) = 1,i : S_V1_FILES; S_SMPL_V1_3(i) = 2,i : S_V1_FILES; S_SMPL_V2_1(i) = 0,i : S_V2_FILES; S_SMPL_V2_2(i) = 1,i : S_V2_FILES; S_SMPL_V2_3(i) = 2,i : S_V2_FILES; S_SMPL_V3_1(i) = 0,i : S_V3_FILES; S_SMPL_V3_2(i) = 1,i : S_V3_FILES; S_SMPL_V3_3(i) = 2,i : S_V3_FILES; CR_SMPL_V1(i) = 0,i : CR_FILES; CR_SMPL_V2(i) = 1,i : CR_FILES; CR_SMPL_V3(i) = 2,i : CR_FILES; HH_SMPL_V1_1(i) = 0,i : HH_V1_FILES; HH_SMPL_V1_2(i) = 1,i : HH_V1_FILES; HH_SMPL_V1_3(i) = 2,i : HH_V1_FILES; HH_SMPL_V2_1(i) = 0,i : HH_V2_FILES; HH_SMPL_V2_2(i) = 1,i : HH_V2_FILES; HH_SMPL_V2_3(i) = 2,i : HH_V2_FILES; fmSynth_Versatile(fc,modRatio,I_fixed,I_ampDependent,a,d,s,r,envType,trigger) = output with { fc_cooked = fc : si.smooth(ba.tau2pole(0.005)); output = os.osc(fc_cooked + dev) * ampEnv; dev = I * ampEnv * modFreq * os.triangle(modFreq); I = I_fixed + (I_ampDependent + I_freq) * (ampEnv); I_freq = 4 * (fc - 300)/300; modFreq = (modRatio + Soni_X_P3_ChordFreqDist) * fc_cooked; release_basic = ba.tempo(ba.tempo(tempo))/ma.SR; env_basic = en.ar(a,release_basic,trigger); triggerCooked = (env_basic > 0.5) + (env_basic > env_basic'); chosenEnv = en.adsr(a,d,s,r,triggerCooked), en.adsre(a,d,s,r,triggerCooked), en.ar(a,r,trigger), en.are(a,r,trigger), en.arfe(a,r,0.3,trigger) : ba.selectn(5,envType); ampEnv = chosenEnv : si.smooth(ba.tau2pole(a)); }; leadSynth(fundamental,synthFunc,noiseSource,velocity,trigger,synthRelease,synthCutoff,addedSineLeveldB,noiseLeveldB,noiseRelease,noiseCutoff) = output with { output = melSynth + noiseSynth <: _,_; // OUTPUT SUMMING melSynth = synthFunc(fundamentalCooked) * env : applyVelocity(velocity,trigger,9); // MEL COMPONENT noiseSynth = noiseSource * en.ar(0.001,noiseRelease,trigger) * noiseLevel // NOISE COMPONENT : fi.resonlp(noiseCutoff,3,1) : applyVelocity(velocity,trigger,9); fundamentalCooked = 2 * fundamental * soniVibratoLFO : limit(20,5000); env = en.ar(0.001,synthRelease,trigger); // MEL ENVELOPE noiseLevel = noiseLeveldB : ba.db2linear; // LIN - NOISE LEVEL soniVibratoLFO = 1 + Soni_X_P3_ChordFreqDist * os.osc(tempo/15) * 0.5 : si.smoo; // CF DIST SONI - VIBRATO LFO }; fmSynth(fundamental,numMod,freqFactor,release,depth,trigger) = (fmSynth + dirtyBus) * env with { fmSynth = sy.fm(freqList,depthList); // SYNTH - FM dirtyBus = fmSynth : ef.cubicnl(0.7,0) : _ *(FM_DISTMIX); // DIST MIX freqList = par(i,numMod,fundamental * pow(freqFactor,i)); // (1)CARRIER + MOD FREQ LIST depthList = par(i,numMod-1,depthCooked); // MOD DEPTH LIST depthCooked = depth * env * 9; // COOKED DEPTH env = sqrt(en.ar(0.001,release, trigger)) : si.smooth(ba.tau2pole(0.001)); // AMP ENVELOPE }; pulseWave(freq,widthPercent) = output with { output = 2 * (ba.pulsen(duration,interval) - 0.5); // DC CORRECTED OUTPUT WAVE duration = widthPercent * interval / 100; // PULSE UP TIME interval = ma.SR / freq; // PUlSE TOTAL PERIOD }; pianoSim_singleNote(freq,trigger) = monoOut with { monoOut = pulseWave(freq,PIANO_WAVEWIDTH1),pulseWave(freq, PIANO_WAVEWIDTH2),pulseWave(freq,PIANO_WAVEWIDTH3):> fi.lowpass(2,cutoff) * ampEnv; // WAVESUMMING cutoff = (freqEnv + 0.01) * 4000 * freq / 600 * (1 - min(freq,1000)/2000) : limit(20,20000); // FC freqEnv = en.arfe(0.001,1.6,0.4,trigger) : si.smooth(ba.tau2pole(0.0001)); // FREQUENCY ENV ampEnv = pow(en.ar(0.001,4,trigger),6) : si.smooth(ba.tau2pole(0.0001)); // AMPLITUDE ENV }; fullChordSynth(freqList,synthFunc,env) = stereoChordOut with { freqSelector(n) = freqList : ba.selectn(4,n-1); // INDIVIDUAL FREQS strumDelay(dMax) = dMax * (tempo < 120) * (120 - tempo)/60; // CALCULATE DELAY freq1Bus = synthFunc(freqSelector(1)),synthFunc(freqSelector(1) + FREQ_OFFSET_LR); // F1 freq2Bus = synthFunc(freqSelector(2)),synthFunc(freqSelector(2) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N1)); // F2 freq3Bus = synthFunc(freqSelector(3)),synthFunc(freqSelector(3) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N2)); // F3 freq4Bus = synthFunc(freqSelector(4)),synthFunc(freqSelector(4) + FREQ_OFFSET_LR) : shortDelay(strumDelay(CS_DEL_N3)); // F4 stereoChordOut = freq1Bus,freq2Bus,freq3Bus,freq4Bus :> stereoLinGain(env); // SUM + ENVELOPE }; chordSingle_Synth(freq,panFunc,synthFunc) = noteOut with { noteOut = synthFunc(freq) : getPanFunction(panFunc); }; ks(freq,damping) = +~((de.fdelay4(1024,del)*damping) : dampingFilter) with { del = ma.SR/freqCooked - 0.5 - 1*(freqCooked > 600); // CALCULATE DELAY LENGTH + TUNING COMPENSATE dampingFilter = _ <: (_'+ _)/2; // DAMPING FB FILTER freqCooked = freq * 1.0116; }; ks_excitation(trigger) = no.noise*en.ar(0.001,0.001,trigger); // KARPLUS STRONG NOISE EXCITATION staticBalanceMult(z) = 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 5), 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 6) : stereoEffect(si.smoo); // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // transientMelDip = dipON * -24 : ba.db2linear : si.smoo // J2 + J3 - MELODY DIP with { dipON = 1 * (Soni_X_J2_Pitched > 0.01) + 1 * (Soni_X_J3_Whoosh > 0.01) // JERK STRATEGY DIPS ; }; musicDuck = duckON * (-50) : ba.db2linear : si.smoo with { duckON = 1 * (Soni_Z_SB1 >= 3) + 0.5 * (Soni_Z_SB1 == 2) ; }; SB_masterPan = out with { out = _,_ : *(leftGain),*(rightGain); leftGain = 1 - ((Soni_Z_SB1 == 6) + (Soni_Z_SB2 == 6)) : si.smoo; rightGain = 1 - ((Soni_Z_SB1 == 5) + (Soni_Z_SB2 == 5)) : si.smoo; }; // SB1 - AMBULANCE Soni_SB1_Signal_Ambulance = output <: stereoLinMult(Soni_SB1_StereoMult) with { output = os.triangle(frequencyCooked); frequencyCooked = (0.5 + abs(os.osc(modFreq))) * 925; modFreq = 0.15 * (Soni_Z_SB1 == 3) + 1.4 * (Soni_Z_SB1 > 3) + 0.5 * (Soni_Z_SB1 > 4); Soni_SB1_StereoMult = staticBalanceMult(Soni_Z_SB1); }; Soni_SB2_Instrumentation(trackIdx) = *(outGain),*(outGain) with { outGain = SONI_SB_Z2_ONOFF_RD(max(0,((trackIdx - 1) * 6 + Soni_Z_SB2 - 1))) : si.smoo; }; // P2 - CARTOON soni_BPF_mono(fc,q) = out with { out = _ <: filterBus*(filtGain),_*(1-filtGain) :> _; // MIX DRY + WET filterBus = _ : fi.resonbp(fc_Cooked,q,1); // APPLY BPF filtGain = -SON_BPF_G + SON_BPF_G : -(8) : ba.db2linear; // CALCULATE FILTER GAIN fc_Cooked = fc * (1 + 0.8*os.osc(tempo/SON_BPF_LFO_TEMPO_DIV)) : limit(200,15000); // CALCULATE CENTER FREQ }; Soni_J1_FreqWarpFactor = _*(warpFactor) with { warpFactor = Soni_J1_MaxWarpFactor * Soni_X_J1_MelBaseFreq + 1; }; // J1 - MELODY TONIC MODULATION Soni_AmpMultiplier(minLevel,maxLevel,x) = _*(linGain),_*(linGain) with // R1 - INSTRUMENTATION { linGain = -1*(ba.db2linear(maxLevel) - ba.db2linear(minLevel)) * x + ba.db2linear(maxLevel) : si.smoo; // CALCULATE LIN GAIN FROM DB }; Soni_R3_Filter = fi.resonlp(cutoff,qCooked,1) with // R3 - BRIGHTNESS { cutoff = Soni_R3_Fc_Max - Soni_X_R3_OverallBrightness * (Soni_R3_Fc_Max - Soni_R3_Fc_Min) : si.smoo; // CALCULTE CUTOFF qCooked = 4 - 3.3 * pow(Soni_X_R3_OverallBrightness,2); // CALCULATE F-DEPENDENT Q }; Soni_J2_Pitched = os.sawtooth(frequency) * gain <: _,_ with // J2 - PITCHED WAVE { frequency = Soni_J2_minFreq + (Soni_J2_maxFreq - Soni_J2_minFreq) * pow(Soni_X_J2_Pitched,2); // CALCULATE WAVE FREQUENCY gain = Soni_X_J2_Pitched > 0.01 : si.smoo; // CALCULATE ON/OFF CONDITION }; Soni_J_Del = de.delay(ma.SR,delSamples),de.delay(ma.SR,delSamples) : filt,filt with { jerkAP = (Soni_X_J1_MelBaseFreq + Soni_X_J2_Pitched + Soni_X_J3_Whoosh) : si.smooth(ba.tau2pole(30.0/tempo)); delSamples = jerkAP * ma.SR * 0.5*(1 + os.osc(tempo/30)); filt = fi.peak_eq_cq(10 * jerkAP,fc_filt,3); fc_filt = 2000 + 2000 * jerkAP; }; Soni_J3_Whoosh = no.noise : filter(frequency) : _*(gain) <: _,_ with // J3 - NOISE WHOOSH { frequency = Soni_J3_minFreq + (Soni_J3_maxFreq - Soni_J3_minFreq) * pow(Soni_X_J3_Whoosh,2); // CALCULATE FILTER FC filter(x) = _ : fi.resonhp(Soni_J3_HPF_FC,0.7,1) : fi.resonlp(frequency,Soni_J3_LPF_Q,1); // NOISE FILTER gain = Soni_X_J3_Whoosh > 0.01 : si.smoo; // CALCULATE ON/OFF CONDITION }; Soni_STS1_Bell = pm.churchBell(1,10000,0.8,1,Soni_X_STS1_Bell) * en.ar(0.001,2,Soni_X_STS1_Bell) <: stereodBGain(12); Soni_STS3_LFO = os.osc(tempo/60); Soni_STS3_wahMinFreq = 250; Soni_STS3_wahMaxFreq = 5000; Soni_STS3_Wah(LFO,minFreq,maxFreq) = _,_ : singleChannelWah,singleChannelWah with { singleChannelWah = _ : fi.peak_eq_cq(currentGain,currentFreq,3.1) : *(ba.db2linear(-0.4*currentGain)); LFO_unipolar = 0.5*(LFO + 1); currentFreq = (minFreq + LFO_unipolar*(maxFreq - minFreq)); currentGain = 22 * (Soni_X_STS3_Wah); }; // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRIGGERS - TO CHANGE MAJORLY TRG_K = velToTrigger(V_K) * (1 - S_isHEEL); TRG_S = velToTrigger(V_S) * (1 - S_isHEEL); TRG_HH = velToTrigger(V_HH_COOKED); TRG_C_1 = V_C_1; TRG_C_2 = V_C_2; TRG_C_3 = V_C_3; TRG_C_4 = V_C_4; TRG_LIST_C = TRG_C_1,TRG_C_2,TRG_C_3,TRG_C_4; TRG_R = velToTrigger(V_R); TRG_M = velToTrigger(V_M); TRG_CS = V_CS; TRG_CR = velToTrigger(V_CR); //Kick kick_V1 = samplePlayer(K_SMPL_V1,TRG_K + HS_K_TRG); kick_V2 = samplePlayer(K_SMPL_V2,TRG_K + HS_K_TRG); kick_V3 = samplePlayer(K_SMPL_V3,TRG_K + HS_K_TRG); kickSynth = kick_V1,kick_V2,kick_V3 : ba.selectn(3,VAR_1 - 1); kickSoni = _; kick_Normal = kickSynth : applyVelocity(V_K,TRG_K,9); kick_HS = kickSynth * 1.4; kickTrack = kick_Normal,kick_HS :> kickSoni : monoChannel(1) : getPanFunction(0); //Snare snare_V1 = samplePlayer(S_SMPL_V1_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V1_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V1_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V2 = samplePlayer(S_SMPL_V2_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V2_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V2_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V3 = samplePlayer(S_SMPL_V3_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V3_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V3_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snareSynth = snare_V1,snare_V2,snare_V3 : ba.selectn(3,VAR_2 - 1); snareSoni = _; snare_Normal = snareSynth : applyVelocity(V_S,TRG_S,3); snare_HS = snareSynth * 1.4; snareTrack = snare_Normal,snare_HS :> snareSoni : monoChannel(2) : getPanFunction(0) : Soni_J_Del; //HH hh_V1 = samplePlayer(HH_SMPL_V1_1,TRG_HH), samplePlayer(HH_SMPL_V1_2,TRG_HH),samplePlayer(HH_SMPL_V1_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V2 = samplePlayer(HH_SMPL_V2_1,TRG_HH), samplePlayer(HH_SMPL_V2_2,TRG_HH),samplePlayer(HH_SMPL_V2_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V3 = pm.marimba(800,0.75,5000,1,1,TRG_HH) * 10; /// ADD MARIMBA! hhSynth = hh_V1,hh_V2,hh_V3 : ba.selectn(3,VAR_3 - 1); hhSoni = _; hhTrack = hhSynth : hhSoni : applyVelocity(V_HH,TRG_HH,3) : monoChannel(3) : getPanFunction(1) : Soni_J_Del; //Chord KEYNUM_LIST_C = KEYNUM_C_1,KEYNUM_C_2,KEYNUM_C_3,KEYNUM_C_4; // LIST MIDI KEYS F0_LIST_HZ_C = getChordFinalFreqs(KEYNUM_LIST_C); // MIDI KEYS TO FREQ chordFreq(noteIdx) = F0_LIST_HZ_C : ba.selectn(4,noteIdx); // FREQ SELECTOR chordVel(noteIdx) = V_LIST_C : ba.selectn(4,noteIdx); // VEL SELECTOR chordTrg(noteIdx) = TRG_LIST_C : ba.selectn(4,noteIdx); // TRG SELECTOR chord_SF_V1(trigger,freq) = pianoSim_singleNote(freq,trigger); // CHORD - SF VARIANT 1 chord_SF_V2(trigger,freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, MALLET_A,MALLET_D,MALLET_S,MALLET_R,MALLET_ENVTYPE,trigger); // CHORD - SF VARIANT 2 chord_SF_V3(trigger,freq) = os.CZresTrap(0.5*(1+os.osc(freq)),4.54) * en.are(0.001,2,trigger); chord_notePanFunc(idx) = ba.take(idx+1,PANPOS_NOTES); chordSynthFunc(trigger,freq) = chord_SF_V1(trigger,freq), chord_SF_V2(trigger,freq), chord_SF_V3(trigger,freq) : ba.selectn(3,VAR_4 - 1); chordSum = par(i,4,chordSingle_Synth(chordFreq(i), chord_notePanFunc(i), chordSynthFunc(chordTrg(i))) : applyVelocity(chordVel(i),chordTrg(i),9),applyVelocity(chordVel(i),chordTrg(i),9)) :> _,_; // SYNTH + STEREO SUM chordTrack = chordSum : stereoChannel(4); //Riff F0_R = melodyFundamentalFreq(KEYNUM_R); // CALCULATE F0 HZ riff_V1 = fmSynth(F0_R,MOD_NUM_R,FREQ_FACTOR_R,RL_R,MOD_DEPTH_R,TRG_R); // RIFF VARIANT 1 riff_V2 = fmSynth_Versatile(F0_R,BASSLINE_MRATIO,BASSLINE_I_FIXED,BASSLINE_I_ENV, BASSLINE_A,BASSLINE_D,BASSLINE_S,BASSLINE_R,BASSLINE_ENVTYPE,TRG_R); // RIFF VARIANT 2 riff_V3 = fmSynth_Versatile(F0_R,AGGRO_MRATIO,AGGRO_I_FIXED,AGGRO_I_ENV, AGGRO_A,AGGRO_D,AGGRO_S,AGGRO_R,AGGRO_ENVTYPE,TRG_R); // RIFF VARIANT 2 riffSynth = riff_V1,riff_V2,riff_V3 : ba.selectn(3,VAR_5 - 1); riffTrack = riffSynth : applyVelocity(V_R,TRG_R,9) : monoChannel(5) : getPanFunction(0); //Melody Main F0_M = melodyFundamentalFreq(KEYNUM_M); M_FreqFactor = (F0_M - 300)/700 : si.smooth(ba.tau2pole(0.001)); M_V1(freq) = os.CZresTrap(0.5*(1+os.osc(freq)),(25 * en.are(0.001,2,TRG_M) + M_FreqFactor)) * en.are(0.001,2,TRG_M); // MELODY SF - VARIANT 1 M_V2(freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, MALLET_A,MALLET_D,MALLET_S,MALLET_R,MALLET_ENVTYPE,TRG_M); // MELODY SF - VARIANT 2 M_V3(freq) = fmSynth_Versatile(freq,TRUMPET_MRATIO,TRUMPET_I_FIXED,TRUMPET_I_ENV, TRUMPET_A,TRUMPET_D,TRUMPET_S,TRUMPET_R,TRUMPET_ENVTYPE,TRG_M); // MELODY SF - VARIANT 3 M_SynthFunc(freq) = M_V1(freq),M_V2(freq),M_V3(freq) : ba.selectn(3,VAR_6 - 1); M_FX1 = dotted_delay(FB_DEL_M,BT_SMPL,WET_DEL_M),dotted_delay(FB_DEL_M,2*BT_SMPL,WET_DEL_M); // DEFINE STEREO DOTTED DELAY melodySynth = leadSynth(F0_M,M_SynthFunc,0,V_M,TRG_M,RL_M,FC_LP_M,G_SIN_M,G_NS_M,RL_NS_M,FC_HP_NS_M); // SYNTHESIZE MELODY melodyTrack = melodySynth : M_FX1 : stereoChannel(6); //Chord Stabs KEYNUM_LIST_CS = KEYNUM_CS_1,KEYNUM_CS_2,KEYNUM_CS_3,KEYNUM_CS_4; F0_LIST_HZ_CS = getChordFinalFreqs(KEYNUM_LIST_CS); // GET F0 LIST ENV_CS = en.ar(AT_CS,RL_CS,TRG_CS); // GET ENV DEL_CS = stereoEffect(dotted_delay(FB_DEL_CS,BT_SMPL,WET_DEL_CS)); // DEFINE DOTTED DELAY CS_V1(freq) = ks_excitation(TRG_CS) : ks(freq,DMP_KS_CS); CS_V2(freq) = os.triangle(freq); CS_V3(freq) = os.sawtooth(freq); SynthFunc_CS(freq) = CS_V1(freq),CS_V2(freq),CS_V3(freq) : ba.selectn(3,VAR_7 - 1); CSTrack = fullChordSynth(F0_LIST_HZ_CS,SynthFunc_CS,ENV_CS) : stereoLinGain(0.3) : DEL_CS; // CS SYNTH chordStabTrack = CSTrack : stereoChannel(7); //Crash crash_V1 = samplePlayer(CR_SMPL_V1,TRG_CR); crash_V2 = samplePlayer(CR_SMPL_V2,TRG_CR); crash_V3 = samplePlayer(CR_SMPL_V3,TRG_CR); crashSynth = crash_V1,crash_V2,crash_V3 : ba.selectn(3,VAR_8 - 1); crashTrack = crashSynth : applyVelocity(V_CR,TRG_CR,9) : monoChannel(8) : getPanFunction(2) : Soni_J_Del; // // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // process_R1 = Soni_AmpMultiplier(Soni_R1_minLevel,Soni_R1_maxLevel,Soni_X_R1_InstLevel); track1 = kickTrack : Soni_SB2_Instrumentation(1) : stereoMasterSection(1); track2 = snareTrack : Soni_SB2_Instrumentation(2) : process_R1 : stereoMasterSection(2); track3 = hhTrack : Soni_SB2_Instrumentation(3) : process_R1 : stereoMasterSection(3); track4 = chordTrack : Soni_SB2_Instrumentation(4) : process_R1 : stereoMasterSection(4); track5 = riffTrack : Soni_SB2_Instrumentation(5) : process_R1 : stereoMasterSection(5); track6 = melodyTrack : Soni_SB2_Instrumentation(6) : process_R1 : stereoMasterSection(6); track7 = chordStabTrack : Soni_SB2_Instrumentation(7) : process_R1 : stereoMasterSection(7); track8 = crashTrack : Soni_SB2_Instrumentation(8) : process_R1 : stereoMasterSection(8); percBus = track1,track2,track3,track8; reverbBus = track2,track3,track4,track6,track7 : par(i,5,stereodBGain(ba.take(i+1,REV_SND))) :> reverbMaster : stereoLinGain(transientMelDip); masterGain = masterGroup(vslider("Master Gain",-6,-96,12,0.01) : ba.db2linear); melBus = track4,track5,track6,track7,reverbBus :> Soni_STS3_Wah(Soni_STS3_LFO,Soni_STS3_wahMinFreq,Soni_STS3_wahMaxFreq) : stereoLinGain(transientMelDip); soniBus = Soni_J2_Pitched,Soni_J3_Whoosh,Soni_SB1_Signal_Ambulance,Soni_STS1_Bell :> stereodBGain(SONI_GAIN_DB); masterChannel = masterComp : parametricEQ(masterEQGroup) , parametricEQ(masterEQGroup) : Soni_R3_Filter,Soni_R3_Filter : SB_masterPan : stereoLinGain(masterGain) : stereoEffect(masterLimiter(0)) : stereoEffect(hard_clip(1)); musicBus = melBus,percBus,reverbBus :> stereoLinGain(musicDuck); process = musicBus,soniBus :> masterChannel;
https://raw.githubusercontent.com/prithviKantanAAU/GaitSoni-PostThesis/7f24bcb98b690473e2528e7aeaa855ea11fb4a29/DSP/GaitSoni%20-%202020-08-06T151306.895.dsp
faust
// // // // // // // // // // // // // // // // // // // // // // // // // // // D E F I N I T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // FX Params // Panner Dotted Delay FM Synth Piano Single Note Full Chord Synth MUSIC Trackwise SYNTH // 4 MALLET FM TRUMPETISH FM BASSLINE FM AGGRO FM 5 6 7 Sonifications CHORD FREQ DIST FACTORS ENSEMBLE INTENSITY ENSEMBLE INTENSITY ENSEMBLE INTENSITY INSTRUMENTATION BRIGHTNESS TONIC PITCH PITCHED WAVE WHOOSH NOISE " BUSS REVERB PRE-DELAY DC/MID CROSSOVER FREQ MID/HI CROSSOVER FREQ RT60 - DC FS MAX FC - LOWER FC - UPPER REVERB SENDS // // // // // // // // // // // // // // // // // // // // // // // // // // // U S E R I N T E R F A C E // // // // // // // // // // // // // // // // // // // // // // // // // // // Sonification Related Tonic + Tempo Variants Music Info SWING NOTE NUMBERS 4-1 4-2 4-3 4-4 5 6 7-1 7-2 7-3 7-4 VELOCITIES 1 2 3 4-1 4-2 4-3 4-4 4 - LIST 5 6 7 8 Sonification Zone-based Static Balance STS Cues Punishment Strategies Reward Strategies Jerk Strategies Heel Strike Strategies // // // // // // // // // // // // // // // // // // // // // // // // // // // F U N C T I O N S // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // 1 - UTILITY CREATE FREQ LIST APPLY TUNING SONIFICATIONS CALCULATE CHORD DIST AMOUNT GET INDIVIDUAL MIDI KEYS SPLIT AND MULTIPLY L-MULTIPLIER R-MULTIPLIER 2 - CHANNEL STRIP 3 - Effects Dotted Delay Compressor-Limiter CALCULATE GAIN REDUCTION SMOOTH KNEE Master COMP Reverb Master TEMPO DEPENDENT RT60 OUTPUT FILTER 4 - Synthesis OUTPUT SUMMING MEL COMPONENT NOISE COMPONENT MEL ENVELOPE LIN - NOISE LEVEL CF DIST SONI - VIBRATO LFO SYNTH - FM DIST MIX (1)CARRIER + MOD FREQ LIST MOD DEPTH LIST COOKED DEPTH AMP ENVELOPE DC CORRECTED OUTPUT WAVE PULSE UP TIME PUlSE TOTAL PERIOD WAVESUMMING FC FREQUENCY ENV AMPLITUDE ENV INDIVIDUAL FREQS CALCULATE DELAY F1 F2 F3 F4 SUM + ENVELOPE CALCULATE DELAY LENGTH + TUNING COMPENSATE DAMPING FB FILTER KARPLUS STRONG NOISE EXCITATION // // // // // // // // // // // // // // // // // // // // // // // // // // // // // S O N I // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // J2 + J3 - MELODY DIP JERK STRATEGY DIPS SB1 - AMBULANCE P2 - CARTOON MIX DRY + WET APPLY BPF CALCULATE FILTER GAIN CALCULATE CENTER FREQ J1 - MELODY TONIC MODULATION R1 - INSTRUMENTATION CALCULATE LIN GAIN FROM DB R3 - BRIGHTNESS CALCULTE CUTOFF CALCULATE F-DEPENDENT Q J2 - PITCHED WAVE CALCULATE WAVE FREQUENCY CALCULATE ON/OFF CONDITION J3 - NOISE WHOOSH CALCULATE FILTER FC NOISE FILTER CALCULATE ON/OFF CONDITION // // // // // // // // // // // // // // // // // // // // // // // // // // // // // Generation // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // TRIGGERS - TO CHANGE MAJORLY Kick Snare HH / ADD MARIMBA! Chord LIST MIDI KEYS MIDI KEYS TO FREQ FREQ SELECTOR VEL SELECTOR TRG SELECTOR CHORD - SF VARIANT 1 CHORD - SF VARIANT 2 SYNTH + STEREO SUM Riff CALCULATE F0 HZ RIFF VARIANT 1 RIFF VARIANT 2 RIFF VARIANT 2 Melody Main MELODY SF - VARIANT 1 MELODY SF - VARIANT 2 MELODY SF - VARIANT 3 DEFINE STEREO DOTTED DELAY SYNTHESIZE MELODY Chord Stabs GET F0 LIST GET ENV DEFINE DOTTED DELAY CS SYNTH Crash // // // // // // // // // // // // // // // // // // // // // // // // // // // M A S T E R // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // //
import("stdfaust.lib"); NUM_PANPOS = 7; DOTDEL_FC_HP = 800; DOTDEL_FC_LP = 2000; FM_DISTMIX = 0.05; PIANO_WAVEWIDTH1 = 33; PIANO_WAVEWIDTH2 = 10; PIANO_WAVEWIDTH3 = 66; CS_DEL_N1 = 0.015; CS_DEL_N2 = 0.030; CS_DEL_N3 = 0.045; PANPOS_NOTES = 3,4,5,6; AT_C = 0.001; RL_C = 1; FV_C = 1; MALLET_MRATIO = 2; MALLET_I_FIXED = 2.4; MALLET_I_ENV = 6.86; MALLET_A = 0.001; MALLET_D = 0.001; MALLET_S = 0.5; MALLET_R = 0.4; MALLET_ENVTYPE = 0; TRUMPET_MRATIO = 1; TRUMPET_I_FIXED = 10; TRUMPET_I_ENV = 10; TRUMPET_A = 0.05; TRUMPET_D = 0.0001; TRUMPET_S = 0.5; TRUMPET_R = 0.78; TRUMPET_ENVTYPE = 1; BASSLINE_MRATIO = 2; BASSLINE_I_FIXED = 6.75; BASSLINE_I_ENV = 7.46; BASSLINE_A = 0.007; BASSLINE_D = 0.001; BASSLINE_S = 0.6553; BASSLINE_R = 0.65; BASSLINE_ENVTYPE = 1; AGGRO_MRATIO = 3; AGGRO_I_FIXED = 10; AGGRO_I_ENV = 10; AGGRO_A = 0.01; AGGRO_D = 0.0001; AGGRO_S = 0.5; AGGRO_R = 0.867; AGGRO_ENVTYPE = 1; MOD_NUM_R = 5; FREQ_FACTOR_R = 3; MOD_DEPTH_R = 35; AT_R = 0.001; RL_R = 0.6 + (tempo < 120)*(120-tempo)*0.06; AT_M = 0.001; RL_M = 4; FB_DEL_M = 0.5; WET_DEL_M = 0.8; FC_LP_M = 20000; G_SIN_M = -90; G_NS_M = -90; RL_NS_M = 0.05; FC_HP_NS_M = 3000; AT_CS = 0.001; RL_CS = 5; FB_DEL_CS = 0.8; WET_DEL_CS = 0.4; DMP_KS_CS = 0.99; FREQ_OFFSET_LR = 0.7; SONI_GAIN_DB = -8; SONI_SB_Z2_ONOFF = waveform {1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1}; SONI_SB_Z2_ONOFF_RD(i) = SONI_SB_Z2_ONOFF,i : rdtable; REV_SND = -8,-10,-5,0,-5; musicInfoTab(x) = tgroup("Mapping_Tabs",hgroup("Music_Info",x)); melodyInfo(x) = musicInfoTab(vgroup("Melody",x)); chordInfo(x) = musicInfoTab(vgroup("Chords",x)); drumInfo(x) = musicInfoTab(vgroup("Drums",x)); masterGainTab(x) = tgroup("Mapping_Tabs",hgroup("Mixer_And_Master",x)); trackGainGroup(x) = masterGainTab(vgroup("Track Gain",x)); trackMuteGroup(x) = masterGainTab(vgroup("Track Mute",x)); masterGroup(x) = masterGainTab(vgroup("Master Gain",x)); masterEQGroup(x) = masterGainTab(vgroup("Master EQ",x)); variantGroup(x) = masterGainTab(vgroup("Track Variant",x)); eqTab(x) = tgroup("Mapping_Tabs",vgroup("EQ_Section",x)); eqTrackGroup(i,x) = eqTab(hgroup("Track %i",x)); compTab(x) = tgroup("Mapping_Tabs",vgroup("Comp_Section",x)); compTrackGroup(i,x) = compTab(hgroup("Track %i",x)); sonificationTab(x) = tgroup("Mapping_Tabs",hgroup("Sonification Types",x)); punishmentSoni(x) = sonificationTab(vgroup("Punishment_Strategies",x)); rewardSoni(x) = sonificationTab(vgroup("Reward_Strategies",x)); jerkSoni(x) = sonificationTab(vgroup("JerkSoni_Strategies",x)); hsSoni(x) = sonificationTab(vgroup("HStrike_Strategies",x)); traditionalSoni(x) = sonificationTab(vgroup("Traditional_Strategies",x)); tonic = musicInfoTab(vslider("Tonic",36,30,42,1)) : limit(20,70); tempo = musicInfoTab(vslider("Tempo",120,50,150,0.1)) : limit(60,150); VAR_1 = variantGroup(nentry("Variant_1",1,1,3,1)); VAR_2 = variantGroup(nentry("Variant_2",1,1,3,1)); VAR_3 = variantGroup(nentry("Variant_3",1,1,3,1)); VAR_4 = variantGroup(nentry("Variant_4",1,1,3,1)); VAR_5 = variantGroup(nentry("Variant_5",1,1,3,1)); VAR_6 = variantGroup(nentry("Variant_6",1,1,3,1)); VAR_7 = variantGroup(nentry("Variant_7",1,1,3,1)); VAR_8 = variantGroup(nentry("Variant_8",1,1,3,1)); S_FNUM = ((V_S > 3) + (V_S > 6)) : ba.sAndH(V_S*TRG_S) : *(1 - S_isHEEL) + S_isHEEL*2; HH_FNUM = ((V_HH > 3) + (V_HH > 6)) : ba.sAndH(V_HH*TRG_HH); V_HH_COOKED = V_HH : _%(5) : *(2); HH_OPEN = 1 + 2 * (HH_IS_OPEN); Soni_Z_SB1 = punishmentSoni(hslider("x_SB1_Ambulance",0,0,1,0.001)) : zonePreProcess; Soni_Z_SB2 = punishmentSoni(hslider("x_SB2_Instrumentation",0,0,1,0.001)) : zonePreProcess; Soni_X_STS1_Bell = jerkSoni(hslider("x_STS1_Bell",0,0,1,0.001)) : ba.impulsify; Soni_X_STS2_MusicStop = jerkSoni(hslider("x_STS2_MusicStop",0,0,1,0.001)) : >(0.1); Soni_X_STS3_Wah = jerkSoni(hslider("x_STS2_Wah",0,0,1,0.001)) : si.smoo; Soni_X_P3_ChordFreqDist = punishmentSoni(hslider("x_P3_ChordFreqDist",0,0,1,0.001)) : si.smoo; Soni_X_R1_InstLevel = rewardSoni(hslider("x_R1_InstLevel",0,0,1,0.001)) : si.smoo; Soni_X_R3_OverallBrightness = rewardSoni(hslider("x_R3_OverallBrightness",0,0,1,0.001)) : si.smoo; Soni_X_J1_MelBaseFreq = jerkSoni(hslider("x_J1_MelBaseFreq",0,0,1,0.001)) : si.smoo; Soni_X_J2_Pitched = jerkSoni(hslider("x_J2_Pitched",0,0,1,0.001)) : si.smoo; Soni_X_J3_Whoosh = jerkSoni(hslider("x_J3_Whoosh",0,0,1,0.001)) : si.smoo; Soni_X_H1_TRG = hsSoni(hslider("x_H1_SnareTrigger",0,0,1,1)); HS_S_TRG = (abs(Soni_X_H1_TRG - 0.8) < 0.03) : ba.impulsify; HS_K_TRG = (abs(Soni_X_H1_TRG - 0.7) < 0.03) : ba.impulsify; S_isHEEL = Soni_X_H1_TRG > 0.49; BT_SMPL = ba.tempo(tempo); BT_SEC = 60.0/tempo; stereoLinGain(gain) = _,_ : *(gain),*(gain); stereodBGain(gain) = _,_ : *(ba.db2linear(gain)),*(ba.db2linear(gain)); stereoLinMult(gainPair) = _,_ : *(gainPair : select2(0)),*(gainPair : select2(1)); stereoEffect(effect) = _,_ : effect,effect; limit(lower,higher) = _ : max(lower) : min(higher); hard_clip(limit) = _ : min(limit) : max(-1*limit) : _; velToTrigger(vel) = trigger with { trigger = (posTrig + negTrig)*(1 - Soni_X_STS2_MusicStop); posTrig = vel : ba.impulsify; negTrig = - 1 * (vel) : ba.impulsify : *(vel > 0); }; applyVelocity(velocity,trigger,maxVel) = _ : *(gainMult) with { gainMult = pow(sampledVel * 0.1,1.5); sampledVel = velCooked : ba.sAndH(velSampleInstant) : si.smooth(ba.tau2pole(0.0001)); velCooked = velocity * 9.0 / maxVel; velSampleInstant = trigger; }; zonePreProcess(input) = output with { output = par(i,6,isInZone(i)) :> int; isInZone(i) = (i+1) * (input > SONI_SB_THRESH_VALS_RD(i)) * (input < SONI_SB_THRESH_VALS_RD(i+1)); }; SONI_SB_THRESH_VALS = waveform {-0.1, 0.33, 0.66, 0.8, 0.9, 0.95, 1.1}; SONI_SB_THRESH_VALS_RD(i) = SONI_SB_THRESH_VALS,i : rdtable; tempo_RelFactor = 1 + 1.5 * (120-tempo) / 40 * (tempo < 120); masterLimiter(ipGaindB) = _ : compLimiter(ipGaindB,10,0,0.001,0.05,0.050); melodyFundamentalFreq(finalMidiValue) = ba.midikey2hz(finalMidiValue) : limit(20,4000) : Soni_J1_FreqWarpFactor; shortDelay(d_ms) = de.fdelay(5000,d_ms*ma.SR),de.fdelay(5000,d_ms*ma.SR); monoChannel(trackIndex) = *(ba.db2linear(-12)) : channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)); stereoChannel(trackIndex) = *(ba.db2linear(-12)),*(ba.db2linear(-12)) : channelComp(compTrackGroup(trackIndex)),channelComp(compTrackGroup(trackIndex)) : parametricEQ(eqTrackGroup(trackIndex)), parametricEQ(eqTrackGroup(trackIndex)); getChordFinalFreqs(LIST_Midi) = freqs with { }; getPanFunction(panIndex) = panFunction with { }; channelComp(compTrackGroup) = compLimiter(0,ratio,thresh,att,rel,0.050) with { ratio = compTrackGroup(hslider("Ratio[style:knob]",1,1,10,0.1)); thresh = compTrackGroup(hslider("Threshold[style:knob]",0,-96,0,0.1)); att = compTrackGroup(hslider("Attack[style:knob]",0.1,0.001,0.5,0.001)); rel = compTrackGroup(hslider("Release[style:knob]",0.1,0.001,0.5,0.001)); }; parametricEQ(eqTrackGroup) = fi.resonhp(fc_HP,Q_HP,1) : fi.peak_eq_cq(gain_P1,f_P1,Q_P1) : fi.peak_eq_cq(gain_P2,f_P2,Q_P2) : fi.resonlp(fc_LP,Q_LP,1) with { hpGroup(x) = hgroup("1_HPF",x); p1Group(x) = hgroup("2_Parametric_1",x); p2Group(x) = hgroup("3_Parametric_2",x); lpGroup(x) = hgroup("4_LPF",x); fc_HP = eqTrackGroup(hpGroup(hslider("Freq[style:knob]",50,50,1000,0.1))) : limit(20,20000); Q_HP = eqTrackGroup(hpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); fc_LP = eqTrackGroup(lpGroup(hslider("Freq[style:knob]",20000,50,20000,0.1))) : limit(20,20000); Q_LP = eqTrackGroup(lpGroup(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); gain_P1 = eqTrackGroup(p1Group(hslider("Gain[style:knob]",0,-24,24,0.01))) : limit(-24,24); f_P1 = eqTrackGroup(p1Group(hslider("Freq[style:knob]",500,100,2000,0.01))) : limit(20,20000); Q_P1 = eqTrackGroup(p1Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); gain_P2 = eqTrackGroup(p2Group(hslider("Gain[style:knob]",0,-24,24,0.01))) : limit(-24,24); f_P2 = eqTrackGroup(p2Group(hslider("Freq[style:knob]",2000,1500,15000,0.01))) : limit(20,20000); Q_P2 = eqTrackGroup(p2Group(hslider("Q[style:knob]",0.7,0.5,10,0.01))) : limit(0.4,5); }; dotted_delay(feedback,delay,wet) = +~(de.delay(100000,del) : filt)*feedback*wet :> _ with { filt = fi.bandpass(2,DOTDEL_FC_HP,DOTDEL_FC_LP); del = 0.75*delay; }; compLimiter(inputGain_dB,ratio,thresh,att,rel,kneeAtt) = _*inputGain_lin <: _*(an.amp_follower_ud(att,rel) : ba.linear2db : outminusindb : kneesmooth : ba.db2linear) with{inputGain_lin = ba.db2linear(inputGain_dB); masterComp = stereoEffect(compLimiter(0,1.01,-20,100,300,0.05)) : stereoEffect(compLimiter(0,1.1,-5,50,200,0.05)) : stereodBGain(2); reverbMaster = _,_ <: re.zita_rev1_stereo(REV_MST_PDEL_MS,REV_MST_F_DC_MID,REV_MST_F_MID_HI,REV_MST_T60_DC,rt_60,REV_MST_FsMax) : filter with { }; stereoMasterSection(trackIndex) = stereoOut with { stereoOut = stereoLinGain(trackGain) : stereoLinGain(1-trackMute); trackGain = trackGainGroup(hslider("Track %trackIndex",0,-96,24,0.01) : ba.db2linear); trackMute = trackMuteGroup(checkbox("%trackIndex")); }; samplePlayer(fileFunc,trigger) = fileFunc(ba.countup(96000,trigger)); K_FILES = soundfile("K_SMPL[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\K_V1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\K_V2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\K_V3.wav'}]",1) : !,!,_; S_V1_FILES = soundfile("S_SMPL_V1[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V1_1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V1_2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V1_3.wav'}]",1) : !,!,_; S_V2_FILES = soundfile("S_SMPL_V2[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V2_1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V2_2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V2_3.wav'}]",1) : !,!,_; S_V3_FILES = soundfile("S_SMPL_V3[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V3_1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V3_2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\S_V3_3.wav'}]",1) : !,!,_; CR_FILES = soundfile("CR_SMPL[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\CR_V1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\CR_V2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\CR_V3.wav'}]",1) : !,!,_; HH_V1_FILES = soundfile("HH_SMPL_V1[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V1_1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V1_2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V1_3.wav'}]",1) : !,!,_; HH_V2_FILES = soundfile("HH_SMPL_V2[url:{'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V2_1.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V2_2.wav'; 'D:\\GaitSonification\\Drum Samples\\Final Library\\HH_V2_3.wav'}]",1) : !,!,_; K_SMPL_V1(i) = 0,i : K_FILES; K_SMPL_V2(i) = 1,i : K_FILES; K_SMPL_V3(i) = 2,i : K_FILES; S_SMPL_V1_1(i) = 0,i : S_V1_FILES; S_SMPL_V1_2(i) = 1,i : S_V1_FILES; S_SMPL_V1_3(i) = 2,i : S_V1_FILES; S_SMPL_V2_1(i) = 0,i : S_V2_FILES; S_SMPL_V2_2(i) = 1,i : S_V2_FILES; S_SMPL_V2_3(i) = 2,i : S_V2_FILES; S_SMPL_V3_1(i) = 0,i : S_V3_FILES; S_SMPL_V3_2(i) = 1,i : S_V3_FILES; S_SMPL_V3_3(i) = 2,i : S_V3_FILES; CR_SMPL_V1(i) = 0,i : CR_FILES; CR_SMPL_V2(i) = 1,i : CR_FILES; CR_SMPL_V3(i) = 2,i : CR_FILES; HH_SMPL_V1_1(i) = 0,i : HH_V1_FILES; HH_SMPL_V1_2(i) = 1,i : HH_V1_FILES; HH_SMPL_V1_3(i) = 2,i : HH_V1_FILES; HH_SMPL_V2_1(i) = 0,i : HH_V2_FILES; HH_SMPL_V2_2(i) = 1,i : HH_V2_FILES; HH_SMPL_V2_3(i) = 2,i : HH_V2_FILES; fmSynth_Versatile(fc,modRatio,I_fixed,I_ampDependent,a,d,s,r,envType,trigger) = output with { fc_cooked = fc : si.smooth(ba.tau2pole(0.005)); output = os.osc(fc_cooked + dev) * ampEnv; dev = I * ampEnv * modFreq * os.triangle(modFreq); I = I_fixed + (I_ampDependent + I_freq) * (ampEnv); I_freq = 4 * (fc - 300)/300; modFreq = (modRatio + Soni_X_P3_ChordFreqDist) * fc_cooked; release_basic = ba.tempo(ba.tempo(tempo))/ma.SR; env_basic = en.ar(a,release_basic,trigger); triggerCooked = (env_basic > 0.5) + (env_basic > env_basic'); chosenEnv = en.adsr(a,d,s,r,triggerCooked), en.adsre(a,d,s,r,triggerCooked), en.ar(a,r,trigger), en.are(a,r,trigger), en.arfe(a,r,0.3,trigger) : ba.selectn(5,envType); ampEnv = chosenEnv : si.smooth(ba.tau2pole(a)); }; leadSynth(fundamental,synthFunc,noiseSource,velocity,trigger,synthRelease,synthCutoff,addedSineLeveldB,noiseLeveldB,noiseRelease,noiseCutoff) = output with { : fi.resonlp(noiseCutoff,3,1) : applyVelocity(velocity,trigger,9); fundamentalCooked = 2 * fundamental * soniVibratoLFO : limit(20,5000); }; fmSynth(fundamental,numMod,freqFactor,release,depth,trigger) = (fmSynth + dirtyBus) * env with { }; pulseWave(freq,widthPercent) = output with { }; pianoSim_singleNote(freq,trigger) = monoOut with { monoOut = pulseWave(freq,PIANO_WAVEWIDTH1),pulseWave(freq, }; fullChordSynth(freqList,synthFunc,env) = stereoChordOut with { }; chordSingle_Synth(freq,panFunc,synthFunc) = noteOut with { noteOut = synthFunc(freq) : getPanFunction(panFunc); }; ks(freq,damping) = +~((de.fdelay4(1024,del)*damping) : dampingFilter) with { freqCooked = freq * 1.0116; }; staticBalanceMult(z) = 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 5), 0.5 * (z == 3) + 1.2 * (z == 4) + 1.4 * (z == 6) : stereoEffect(si.smoo); with { ; }; musicDuck = duckON * (-50) : ba.db2linear : si.smoo with { duckON = 1 * (Soni_Z_SB1 >= 3) + 0.5 * (Soni_Z_SB1 == 2) ; }; SB_masterPan = out with { out = _,_ : *(leftGain),*(rightGain); leftGain = 1 - ((Soni_Z_SB1 == 6) + (Soni_Z_SB2 == 6)) : si.smoo; rightGain = 1 - ((Soni_Z_SB1 == 5) + (Soni_Z_SB2 == 5)) : si.smoo; }; Soni_SB1_Signal_Ambulance = output <: stereoLinMult(Soni_SB1_StereoMult) with { output = os.triangle(frequencyCooked); frequencyCooked = (0.5 + abs(os.osc(modFreq))) * 925; modFreq = 0.15 * (Soni_Z_SB1 == 3) + 1.4 * (Soni_Z_SB1 > 3) + 0.5 * (Soni_Z_SB1 > 4); Soni_SB1_StereoMult = staticBalanceMult(Soni_Z_SB1); }; Soni_SB2_Instrumentation(trackIdx) = *(outGain),*(outGain) with { outGain = SONI_SB_Z2_ONOFF_RD(max(0,((trackIdx - 1) * 6 + Soni_Z_SB2 - 1))) : si.smoo; }; soni_BPF_mono(fc,q) = out with { }; Soni_J1_FreqWarpFactor = _*(warpFactor) with { warpFactor = Soni_J1_MaxWarpFactor * Soni_X_J1_MelBaseFreq + 1; { }; { }; { }; Soni_J_Del = de.delay(ma.SR,delSamples),de.delay(ma.SR,delSamples) : filt,filt with { jerkAP = (Soni_X_J1_MelBaseFreq + Soni_X_J2_Pitched + Soni_X_J3_Whoosh) : si.smooth(ba.tau2pole(30.0/tempo)); delSamples = jerkAP * ma.SR * 0.5*(1 + os.osc(tempo/30)); filt = fi.peak_eq_cq(10 * jerkAP,fc_filt,3); fc_filt = 2000 + 2000 * jerkAP; }; { }; Soni_STS1_Bell = pm.churchBell(1,10000,0.8,1,Soni_X_STS1_Bell) * en.ar(0.001,2,Soni_X_STS1_Bell) <: stereodBGain(12); Soni_STS3_LFO = os.osc(tempo/60); Soni_STS3_wahMinFreq = 250; Soni_STS3_wahMaxFreq = 5000; Soni_STS3_Wah(LFO,minFreq,maxFreq) = _,_ : singleChannelWah,singleChannelWah with { singleChannelWah = _ : fi.peak_eq_cq(currentGain,currentFreq,3.1) : *(ba.db2linear(-0.4*currentGain)); LFO_unipolar = 0.5*(LFO + 1); currentFreq = (minFreq + LFO_unipolar*(maxFreq - minFreq)); currentGain = 22 * (Soni_X_STS3_Wah); }; TRG_K = velToTrigger(V_K) * (1 - S_isHEEL); TRG_S = velToTrigger(V_S) * (1 - S_isHEEL); TRG_HH = velToTrigger(V_HH_COOKED); TRG_C_1 = V_C_1; TRG_C_2 = V_C_2; TRG_C_3 = V_C_3; TRG_C_4 = V_C_4; TRG_LIST_C = TRG_C_1,TRG_C_2,TRG_C_3,TRG_C_4; TRG_R = velToTrigger(V_R); TRG_M = velToTrigger(V_M); TRG_CS = V_CS; TRG_CR = velToTrigger(V_CR); kick_V1 = samplePlayer(K_SMPL_V1,TRG_K + HS_K_TRG); kick_V2 = samplePlayer(K_SMPL_V2,TRG_K + HS_K_TRG); kick_V3 = samplePlayer(K_SMPL_V3,TRG_K + HS_K_TRG); kickSynth = kick_V1,kick_V2,kick_V3 : ba.selectn(3,VAR_1 - 1); kickSoni = _; kick_Normal = kickSynth : applyVelocity(V_K,TRG_K,9); kick_HS = kickSynth * 1.4; kickTrack = kick_Normal,kick_HS :> kickSoni : monoChannel(1) : getPanFunction(0); snare_V1 = samplePlayer(S_SMPL_V1_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V1_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V1_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V2 = samplePlayer(S_SMPL_V2_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V2_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V2_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snare_V3 = samplePlayer(S_SMPL_V3_1,TRG_S + HS_S_TRG), samplePlayer(S_SMPL_V3_2,TRG_S + HS_S_TRG),samplePlayer(S_SMPL_V3_3,TRG_S + HS_S_TRG) : ba.selectn(3,S_FNUM); snareSynth = snare_V1,snare_V2,snare_V3 : ba.selectn(3,VAR_2 - 1); snareSoni = _; snare_Normal = snareSynth : applyVelocity(V_S,TRG_S,3); snare_HS = snareSynth * 1.4; snareTrack = snare_Normal,snare_HS :> snareSoni : monoChannel(2) : getPanFunction(0) : Soni_J_Del; hh_V1 = samplePlayer(HH_SMPL_V1_1,TRG_HH), samplePlayer(HH_SMPL_V1_2,TRG_HH),samplePlayer(HH_SMPL_V1_3,TRG_HH) : ba.selectn(3,HH_FNUM); hh_V2 = samplePlayer(HH_SMPL_V2_1,TRG_HH), samplePlayer(HH_SMPL_V2_2,TRG_HH),samplePlayer(HH_SMPL_V2_3,TRG_HH) : ba.selectn(3,HH_FNUM); hhSynth = hh_V1,hh_V2,hh_V3 : ba.selectn(3,VAR_3 - 1); hhSoni = _; hhTrack = hhSynth : hhSoni : applyVelocity(V_HH,TRG_HH,3) : monoChannel(3) : getPanFunction(1) : Soni_J_Del; chord_SF_V2(trigger,freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, chord_SF_V3(trigger,freq) = os.CZresTrap(0.5*(1+os.osc(freq)),4.54) * en.are(0.001,2,trigger); chord_notePanFunc(idx) = ba.take(idx+1,PANPOS_NOTES); chordSynthFunc(trigger,freq) = chord_SF_V1(trigger,freq), chord_SF_V2(trigger,freq), chord_SF_V3(trigger,freq) : ba.selectn(3,VAR_4 - 1); chordSum = par(i,4,chordSingle_Synth(chordFreq(i), chord_notePanFunc(i), chordTrack = chordSum : stereoChannel(4); riff_V2 = fmSynth_Versatile(F0_R,BASSLINE_MRATIO,BASSLINE_I_FIXED,BASSLINE_I_ENV, riff_V3 = fmSynth_Versatile(F0_R,AGGRO_MRATIO,AGGRO_I_FIXED,AGGRO_I_ENV, riffSynth = riff_V1,riff_V2,riff_V3 : ba.selectn(3,VAR_5 - 1); riffTrack = riffSynth : applyVelocity(V_R,TRG_R,9) : monoChannel(5) : getPanFunction(0); F0_M = melodyFundamentalFreq(KEYNUM_M); M_FreqFactor = (F0_M - 300)/700 : si.smooth(ba.tau2pole(0.001)); M_V2(freq) = fmSynth_Versatile(freq,MALLET_MRATIO,MALLET_I_FIXED,MALLET_I_ENV, M_V3(freq) = fmSynth_Versatile(freq,TRUMPET_MRATIO,TRUMPET_I_FIXED,TRUMPET_I_ENV, M_SynthFunc(freq) = M_V1(freq),M_V2(freq),M_V3(freq) : ba.selectn(3,VAR_6 - 1); melodyTrack = melodySynth : M_FX1 : stereoChannel(6); KEYNUM_LIST_CS = KEYNUM_CS_1,KEYNUM_CS_2,KEYNUM_CS_3,KEYNUM_CS_4; CS_V1(freq) = ks_excitation(TRG_CS) : ks(freq,DMP_KS_CS); CS_V2(freq) = os.triangle(freq); CS_V3(freq) = os.sawtooth(freq); SynthFunc_CS(freq) = CS_V1(freq),CS_V2(freq),CS_V3(freq) : ba.selectn(3,VAR_7 - 1); chordStabTrack = CSTrack : stereoChannel(7); crash_V1 = samplePlayer(CR_SMPL_V1,TRG_CR); crash_V2 = samplePlayer(CR_SMPL_V2,TRG_CR); crash_V3 = samplePlayer(CR_SMPL_V3,TRG_CR); crashSynth = crash_V1,crash_V2,crash_V3 : ba.selectn(3,VAR_8 - 1); crashTrack = crashSynth : applyVelocity(V_CR,TRG_CR,9) : monoChannel(8) : getPanFunction(2) : Soni_J_Del; process_R1 = Soni_AmpMultiplier(Soni_R1_minLevel,Soni_R1_maxLevel,Soni_X_R1_InstLevel); track1 = kickTrack : Soni_SB2_Instrumentation(1) : stereoMasterSection(1); track2 = snareTrack : Soni_SB2_Instrumentation(2) : process_R1 : stereoMasterSection(2); track3 = hhTrack : Soni_SB2_Instrumentation(3) : process_R1 : stereoMasterSection(3); track4 = chordTrack : Soni_SB2_Instrumentation(4) : process_R1 : stereoMasterSection(4); track5 = riffTrack : Soni_SB2_Instrumentation(5) : process_R1 : stereoMasterSection(5); track6 = melodyTrack : Soni_SB2_Instrumentation(6) : process_R1 : stereoMasterSection(6); track7 = chordStabTrack : Soni_SB2_Instrumentation(7) : process_R1 : stereoMasterSection(7); track8 = crashTrack : Soni_SB2_Instrumentation(8) : process_R1 : stereoMasterSection(8); percBus = track1,track2,track3,track8; reverbBus = track2,track3,track4,track6,track7 : par(i,5,stereodBGain(ba.take(i+1,REV_SND))) :> reverbMaster : stereoLinGain(transientMelDip); masterGain = masterGroup(vslider("Master Gain",-6,-96,12,0.01) : ba.db2linear); melBus = track4,track5,track6,track7,reverbBus :> Soni_STS3_Wah(Soni_STS3_LFO,Soni_STS3_wahMinFreq,Soni_STS3_wahMaxFreq) : stereoLinGain(transientMelDip); soniBus = Soni_J2_Pitched,Soni_J3_Whoosh,Soni_SB1_Signal_Ambulance,Soni_STS1_Bell :> stereodBGain(SONI_GAIN_DB); masterChannel = masterComp : parametricEQ(masterEQGroup) , parametricEQ(masterEQGroup) : Soni_R3_Filter,Soni_R3_Filter : SB_masterPan : stereoLinGain(masterGain) : stereoEffect(masterLimiter(0)) : stereoEffect(hard_clip(1)); musicBus = melBus,percBus,reverbBus :> stereoLinGain(musicDuck); process = musicBus,soniBus :> masterChannel;
7a48498c6020da715205c46078791033aa6720d5e36bbb56fcd62ccd2b1ce8f8
chevremaudite/zosimos
addictiveUI.dsp
//-----------------ADDICTIVE----------------// // Additive synthesis engine. //--------------PARAMETERS: // 1 - Pitch : Main pitch // 2 - Fundamental Gain : Fundamental frequency's level // 3 - Harmonics : Number of partials // 4 - Interval : Partial interval from main pitch and to each other // 5 - Offset : Nth partial offset from n*f // 6 - Oddness : Odd partials strength // 7 - High Gain : Higher partials gain // 8 - Harmonics Decay : Harmonics exponential envelope decay import("stdfaust.lib"); import("addictive.lib"); process = hgroup("Addictive", add(pitch, fGain, harms, interval, offset, oddness, highGain, harmDecay, trigger)) <: (_,_) with { trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(420), log(100), log(4200), 0.01) : si.smoo); fGain = vslider("[2]Fundamental Level[style:knob]", 0.01, 0, 1, 0.01); harms = hslider("[3]Harmonics [style:knob]", 0, 0, 32, 1) : si.smoo; interval = vslider("[4]Interval [style:knob]", 0, 0, 1000, 0.001) : si.smoo; offset = vslider("[5]Offset [style:knob]", 10, 0, 100, 0.001) : si.smoo; oddness = hslider("[6]Oddness [style:knob]", 0, 0, 1, 0.001) : si.smoo; highGain = vslider("[7]High Gain[style:knob]", 0.01, 0.01, 0.999, 0.0001); harmDecay = vslider("[8]Harmonics Decay[style:knob]", 0.01, 0, 1, 0.01); };
https://raw.githubusercontent.com/chevremaudite/zosimos/55a532489c278fa47ffd37a84322c9a27800f588/SOFTWARE/FAUST/ui/addictiveUI.dsp
faust
-----------------ADDICTIVE----------------// Additive synthesis engine. --------------PARAMETERS: 1 - Pitch : Main pitch 2 - Fundamental Gain : Fundamental frequency's level 3 - Harmonics : Number of partials 4 - Interval : Partial interval from main pitch and to each other 5 - Offset : Nth partial offset from n*f 6 - Oddness : Odd partials strength 7 - High Gain : Higher partials gain 8 - Harmonics Decay : Harmonics exponential envelope decay
import("stdfaust.lib"); import("addictive.lib"); process = hgroup("Addictive", add(pitch, fGain, harms, interval, offset, oddness, highGain, harmDecay, trigger)) <: (_,_) with { trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(420), log(100), log(4200), 0.01) : si.smoo); fGain = vslider("[2]Fundamental Level[style:knob]", 0.01, 0, 1, 0.01); harms = hslider("[3]Harmonics [style:knob]", 0, 0, 32, 1) : si.smoo; interval = vslider("[4]Interval [style:knob]", 0, 0, 1000, 0.001) : si.smoo; offset = vslider("[5]Offset [style:knob]", 10, 0, 100, 0.001) : si.smoo; oddness = hslider("[6]Oddness [style:knob]", 0, 0, 1, 0.001) : si.smoo; highGain = vslider("[7]High Gain[style:knob]", 0.01, 0.01, 0.999, 0.0001); harmDecay = vslider("[8]Harmonics Decay[style:knob]", 0.01, 0, 1, 0.01); };
bcc407ea1fd707375d309967f6329030afe64e002152d2730d5ad050bff17a59
chevremaudite/zosimos
modaldrumsUI.dsp
//-----------------MODAL DRUMS----------------// //Physical modeling engine consisting of a modal drum, a waveguide transient and a blower exciter //--------------PARAMETERS: // 1 - Pitch : Drum and transient main pitch // 2 - Brightness : Drum modes frequency offset // 3 - Transient Level : Transient volume // 4 - Transient Position : Transient's strike position // 5 - Noise Amount : Cutoff of exciter's noise // 6 - Noise Decay : exciter's noise cutoff exponential envelope's decay // 7 - Strength : Overall strike/blow strength // 8 - ???? /*TODO : Find one last interesting parameter !*/ import("stdfaust.lib"); import("modaldrums.lib"); import("volenvUI.dsp"); import("utilities.lib"); process = hgroup("Modal Drums", md(pitch, brightness, transientAmt, transientPos, noiseAmt, noiseDecay, strength, trigger))<:_,_ with{ trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(420), log(100), log(4200), 0.01) : si.smoo); brightness = vslider("[2]Brightness[style:knob]", 200, 0, 1000, 0.01):si.smoo; transientAmt = vslider("[3]Transient Amount[style:knob]",0,0,1,0.001); transientPos = vslider("[4]Transient Position[style:knob]",0,0,4,0.001); noiseAmt = vslider("[5]Noise Amount[style:knob]", 200, 100, 4200, 0.01):si.smoo; noiseDecay = vslider("[6]Noise Decay[style:knob]", 0.01, 0, 3, 0.01); strength = vslider("[7]Strength[style:knob]", 0.5, 0, 1, 0.01):si.smoo; };
https://raw.githubusercontent.com/chevremaudite/zosimos/0da322fb7df2f7a86f568cdc3dfe416a69be8b5b/SOFTWARE/FAUST/ui/modaldrumsUI.dsp
faust
-----------------MODAL DRUMS----------------// Physical modeling engine consisting of a modal drum, a waveguide transient and a blower exciter --------------PARAMETERS: 1 - Pitch : Drum and transient main pitch 2 - Brightness : Drum modes frequency offset 3 - Transient Level : Transient volume 4 - Transient Position : Transient's strike position 5 - Noise Amount : Cutoff of exciter's noise 6 - Noise Decay : exciter's noise cutoff exponential envelope's decay 7 - Strength : Overall strike/blow strength 8 - ???? TODO : Find one last interesting parameter !
import("stdfaust.lib"); import("modaldrums.lib"); import("volenvUI.dsp"); import("utilities.lib"); process = hgroup("Modal Drums", md(pitch, brightness, transientAmt, transientPos, noiseAmt, noiseDecay, strength, trigger))<:_,_ with{ trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(420), log(100), log(4200), 0.01) : si.smoo); brightness = vslider("[2]Brightness[style:knob]", 200, 0, 1000, 0.01):si.smoo; transientAmt = vslider("[3]Transient Amount[style:knob]",0,0,1,0.001); transientPos = vslider("[4]Transient Position[style:knob]",0,0,4,0.001); noiseAmt = vslider("[5]Noise Amount[style:knob]", 200, 100, 4200, 0.01):si.smoo; noiseDecay = vslider("[6]Noise Decay[style:knob]", 0.01, 0, 3, 0.01); strength = vslider("[7]Strength[style:knob]", 0.5, 0, 1, 0.01):si.smoo; };
2f90a63e2eace961a99095c26fa3167ea861d2d32575805ddc778c95b4d4a896
chevremaudite/zosimos
noisyUI.dsp
//-----------------NOISY----------------// //Filtered noise engine for hats, snares, lasers and bitcrushed percs //--------------PARAMETERS: // 1 - Pitch : Noise bandpass cutoff // 2 - Pitch Amount : Bandpassed noise mix // 3 - Pitch Tone : Noise bandpass resonance // 4 - Pitch Mod Depth : Noise bandpass cutoff modulation amount // 5 - Pitch Decay : Noise bandpass cutoff modulation envelope decay in seconds // 6 - Resolution : Sparse noise average frequency of impulses per second // 7 - TODO : Find one last interesting parameter ! // 8 - TODO : Find one last interesting parameter ! import("volenvUI.dsp"); import("stdfaust.lib"); import("utilities.lib"); import("noisy.lib"); process = hgroup("Noisy", noisy(pitch, pitchAmt, pitchTone, pitchDepth, pitchDecay, resolution, trigger))<:_,_ with{ trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(200), log(20), log(20000), 0.01):si.smoo); pitchAmt = hslider("[2]Pitch Amount [style:knob]", 0.5, 0, 1, 0.001); pitchTone = vslider("[3]Pitch Tone[style:knob]", 1,1,10,0.01):si.smoo; pitchDepth = hslider("[4]Pitch Mod Depth[style:knob]", 20, 0, 10000, 0.01); pitchDecay = vslider("[5]Pitch Decay[style:knob]", 0.01, 0, 1, 0.01); resolution = exp(hslider("[9]Resolution [style:knob]", log(1000), log(200), log(20000), 0.001) :si.smoo); };
https://raw.githubusercontent.com/chevremaudite/zosimos/0da322fb7df2f7a86f568cdc3dfe416a69be8b5b/SOFTWARE/FAUST/ui/noisyUI.dsp
faust
-----------------NOISY----------------// Filtered noise engine for hats, snares, lasers and bitcrushed percs --------------PARAMETERS: 1 - Pitch : Noise bandpass cutoff 2 - Pitch Amount : Bandpassed noise mix 3 - Pitch Tone : Noise bandpass resonance 4 - Pitch Mod Depth : Noise bandpass cutoff modulation amount 5 - Pitch Decay : Noise bandpass cutoff modulation envelope decay in seconds 6 - Resolution : Sparse noise average frequency of impulses per second 7 - TODO : Find one last interesting parameter ! 8 - TODO : Find one last interesting parameter !
import("volenvUI.dsp"); import("stdfaust.lib"); import("utilities.lib"); import("noisy.lib"); process = hgroup("Noisy", noisy(pitch, pitchAmt, pitchTone, pitchDepth, pitchDecay, resolution, trigger))<:_,_ with{ trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(200), log(20), log(20000), 0.01):si.smoo); pitchAmt = hslider("[2]Pitch Amount [style:knob]", 0.5, 0, 1, 0.001); pitchTone = vslider("[3]Pitch Tone[style:knob]", 1,1,10,0.01):si.smoo; pitchDepth = hslider("[4]Pitch Mod Depth[style:knob]", 20, 0, 10000, 0.01); pitchDecay = vslider("[5]Pitch Decay[style:knob]", 0.01, 0, 1, 0.01); resolution = exp(hslider("[9]Resolution [style:knob]", log(1000), log(200), log(20000), 0.001) :si.smoo); };
74953a622de7e0d94920c77cb86398b37b60cc0cd97a216d0e4476435485a705
chevremaudite/zosimos
fmmetalUI.dsp
//-----------------FM METAL----------------// //FM engine tailored to produce metallic percussions such as bells, hats or distorted snares //--------------PARAMETERS: // 1 - Pitch : Carrier's pitch // 2 - Mod Amount : Carrier's modulation amount // 3 - Ratio 1 : First modulator's frequency to carrier's frequency ratio // 4 - Ratio 2 : Second modulator's frequency to carrier's frequency ratio // 5 - Ratio 3 : Third modulator's frequency to carrier's frequency ratio // 6 - Feedback : First modulator's FM feedback // 7 - Mod Attack : Carrier's modulation envelope linear attack // 8 - Mod Decay : Carrier's modulation envelope linear decay import("volenvUI.dsp"); import("stdfaust.lib"); import("utilities.lib"); import("fmmetal.lib"); process = hgroup("FM Metal", fmmetal(pitch, modAmt, r1, r2, r3, fb, modAtk, modDec, trigger)) <: (_,_) with{ trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(200), log(20), log(20000), 0.01):si.smoo); modAmt = hslider("[2]Mod Amount[style:knob]", 0.01, 0, 1, 0.01); r1 = hslider("[3]Ratio 1 [style:knob]", 1, 0.5, 15, 0.001); r2 = vslider("[4]Ratio 2 [style:knob]", 1, 0.5, 15, 0.001):si.smoo; r3 = hslider("[5]Ratio 3 [style:knob]", 1, 0.5, 15, 0.001); fb = hslider("[6]Feedback [style:knob]", 0, 0, 1, 0.001); modAtk = hslider("[7]Mod Attack[style:knob]", 0.01, 0, 1, 0.01); modDec = hslider("[8]Mod Decay[style:knob]", 0.01, 0, 1, 0.01); };
https://raw.githubusercontent.com/chevremaudite/zosimos/ab0de59442ab762c5cc0b77136a609f723f7bc04/SOFTWARE/FAUST/ui/fmmetalUI.dsp
faust
-----------------FM METAL----------------// FM engine tailored to produce metallic percussions such as bells, hats or distorted snares --------------PARAMETERS: 1 - Pitch : Carrier's pitch 2 - Mod Amount : Carrier's modulation amount 3 - Ratio 1 : First modulator's frequency to carrier's frequency ratio 4 - Ratio 2 : Second modulator's frequency to carrier's frequency ratio 5 - Ratio 3 : Third modulator's frequency to carrier's frequency ratio 6 - Feedback : First modulator's FM feedback 7 - Mod Attack : Carrier's modulation envelope linear attack 8 - Mod Decay : Carrier's modulation envelope linear decay
import("volenvUI.dsp"); import("stdfaust.lib"); import("utilities.lib"); import("fmmetal.lib"); process = hgroup("FM Metal", fmmetal(pitch, modAmt, r1, r2, r3, fb, modAtk, modDec, trigger)) <: (_,_) with{ trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(200), log(20), log(20000), 0.01):si.smoo); modAmt = hslider("[2]Mod Amount[style:knob]", 0.01, 0, 1, 0.01); r1 = hslider("[3]Ratio 1 [style:knob]", 1, 0.5, 15, 0.001); r2 = vslider("[4]Ratio 2 [style:knob]", 1, 0.5, 15, 0.001):si.smoo; r3 = hslider("[5]Ratio 3 [style:knob]", 1, 0.5, 15, 0.001); fb = hslider("[6]Feedback [style:knob]", 0, 0, 1, 0.001); modAtk = hslider("[7]Mod Attack[style:knob]", 0.01, 0, 1, 0.01); modDec = hslider("[8]Mod Decay[style:knob]", 0.01, 0, 1, 0.01); };
2da8fd6fb6a76fd430d003206b66612b0876cd8dcb8cf2085612abe7516637b2
chevremaudite/zosimos
93bangbangUI.dsp
//-----------------93 BANG BANG----------------// //Classic Virtual analog kick and tom generator //--------------PARAMETERS: // 1 - Pitch : Main osc pitch // 2 - Pitch Mod Depth : Main osc pitch modulation amount // 3 - Pitch Decay : Main osc pitch modulation envelope decay in seconds // 4 - Noise Amount : Noise transient volume // 5 - Noise Pitch : Noise transient's bandpass frequency // 6 - Noise Decay : Noise transient envelope decay in seconds // 7 - Wave : Main osc waveform going from sine to tri to square with crossfade // 8 - ???? import("stdfaust.lib"); import("93bangbang.lib"); process = hgroup("93 Bang Bang", bb93(pitch, pitchDepth, pitchDecay, noiseAmt, noisePitch, noiseDecay, waveS, trigger) <: (_,_)) with { trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(50), log(20), log(500), 0.01) : si.smoo); pitchDepth = hslider("[2]Pitch Mod Depth [style:knob]", 20, 0, 500, 0.01) : si.smoo; pitchDecay = vslider("[3]Pitch Decay[style:knob]", 0.01, 0, 0.5, 0.01); noiseAmt = hslider("[4]Noise Amount[style:knob]", 0, 0, 5, 0.001) : si.smoo; noisePitch = exp(vslider("[5]Noise Pitch [style:knob]", log(200), log(100), log(4200), 0.01) : si.smoo); noiseDecay = vslider("[6]Noise Decay[style:knob]", 0.01, 0, 0.5, 0.01); waveS = hslider("[7]Wave [style:knob]", 0, 0, ma.PI/2, 0.001) : si.smoo; };
https://raw.githubusercontent.com/chevremaudite/zosimos/55a532489c278fa47ffd37a84322c9a27800f588/SOFTWARE/FAUST/ui/93bangbangUI.dsp
faust
-----------------93 BANG BANG----------------// Classic Virtual analog kick and tom generator --------------PARAMETERS: 1 - Pitch : Main osc pitch 2 - Pitch Mod Depth : Main osc pitch modulation amount 3 - Pitch Decay : Main osc pitch modulation envelope decay in seconds 4 - Noise Amount : Noise transient volume 5 - Noise Pitch : Noise transient's bandpass frequency 6 - Noise Decay : Noise transient envelope decay in seconds 7 - Wave : Main osc waveform going from sine to tri to square with crossfade 8 - ????
import("stdfaust.lib"); import("93bangbang.lib"); process = hgroup("93 Bang Bang", bb93(pitch, pitchDepth, pitchDecay, noiseAmt, noisePitch, noiseDecay, waveS, trigger) <: (_,_)) with { trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(50), log(20), log(500), 0.01) : si.smoo); pitchDepth = hslider("[2]Pitch Mod Depth [style:knob]", 20, 0, 500, 0.01) : si.smoo; pitchDecay = vslider("[3]Pitch Decay[style:knob]", 0.01, 0, 0.5, 0.01); noiseAmt = hslider("[4]Noise Amount[style:knob]", 0, 0, 5, 0.001) : si.smoo; noisePitch = exp(vslider("[5]Noise Pitch [style:knob]", log(200), log(100), log(4200), 0.01) : si.smoo); noiseDecay = vslider("[6]Noise Decay[style:knob]", 0.01, 0, 0.5, 0.01); waveS = hslider("[7]Wave [style:knob]", 0, 0, ma.PI/2, 0.001) : si.smoo; };
a120f2247fc81867d1b711955bae6f40f7164683d21d8156668dce8bd5ea7800
chevremaudite/zosimos
drummachine.dsp
/* REFACTOR : Change all the imports styles from import("xx.lib") to xx = library("xx.lib") to avoid conflits REFACTOR : Make every engine a lib and create separate instanciation .dsp files REFACTOR : Wrap all the engines in a engine environment REFACTOR : create a dryWet function to use for all the mix knobs */ declare options "[midi:on]"; import ("stdfaust.lib"); import("93bangbang.dsp"); import("noisy.dsp"); import("modal.dsp"); import("add.dsp"); import("fm.dsp"); import("bitwise.dsp"); import("input.dsp"); import("dist.dsp"); //Global masterVol=hslider("Master Volume[10]", 0.5, 0,1,0.01):si.smoo; level(i)=hslider("[9]Level[style:knob]", 0.5, 0,1,0.01):si.smoo; trig(i) = button("[0]T") : ba.impulsify; //UI drumsounds = vgroup("[1]Drum Sounds", d1,d2,d3,d4,d5,d6,d7 :> _); d1 = hgroup("[1]1", (trig(1)<:bb93,level(1)) : * : dist <: filterUI); d2 = hgroup("[2]2", (trig(2)<:md, level(2)) : * : dist <: filterUI); d3 = hgroup("[3]3", (trig(3)<:noisy, level(3)) : * : dist <: filterUI); d4 = hgroup("[4]4", (trig(4)<:add, level(4)) : * : dist <: filterUI); d5 = hgroup("[5]5", (trig(5)<:fm, level(5)) : * : dist <: filterUI); d6 = hgroup("[6]6", (trig(6)<:bitwise, level(6)) : * : dist <: filterUI); d7 = hgroup("[7]7", (_ : input(trig(7)) * level(7)) : dist <: filterUI); process = _,_ :> sp.stereoize(drumsounds*masterVol);
https://raw.githubusercontent.com/chevremaudite/zosimos/0d3dee614458cf0a7e4a18e233af4da32081770b/SOFTWARE/FAUST/libs/drummachine.dsp
faust
REFACTOR : Change all the imports styles from import("xx.lib") to xx = library("xx.lib") to avoid conflits REFACTOR : Make every engine a lib and create separate instanciation .dsp files REFACTOR : Wrap all the engines in a engine environment REFACTOR : create a dryWet function to use for all the mix knobs Global UI
declare options "[midi:on]"; import ("stdfaust.lib"); import("93bangbang.dsp"); import("noisy.dsp"); import("modal.dsp"); import("add.dsp"); import("fm.dsp"); import("bitwise.dsp"); import("input.dsp"); import("dist.dsp"); masterVol=hslider("Master Volume[10]", 0.5, 0,1,0.01):si.smoo; level(i)=hslider("[9]Level[style:knob]", 0.5, 0,1,0.01):si.smoo; trig(i) = button("[0]T") : ba.impulsify; drumsounds = vgroup("[1]Drum Sounds", d1,d2,d3,d4,d5,d6,d7 :> _); d1 = hgroup("[1]1", (trig(1)<:bb93,level(1)) : * : dist <: filterUI); d2 = hgroup("[2]2", (trig(2)<:md, level(2)) : * : dist <: filterUI); d3 = hgroup("[3]3", (trig(3)<:noisy, level(3)) : * : dist <: filterUI); d4 = hgroup("[4]4", (trig(4)<:add, level(4)) : * : dist <: filterUI); d5 = hgroup("[5]5", (trig(5)<:fm, level(5)) : * : dist <: filterUI); d6 = hgroup("[6]6", (trig(6)<:bitwise, level(6)) : * : dist <: filterUI); d7 = hgroup("[7]7", (_ : input(trig(7)) * level(7)) : dist <: filterUI); process = _,_ :> sp.stereoize(drumsounds*masterVol);
b3741365156a305ef7a1e6654658aa50ffc3da69dde55a9857cde853499586c5
chevremaudite/zosimos
bitwiseUI.dsp
//-----------------BITWISE----------------// //Bitwise operations based engine for hard kicks and digital weird percs //--------------PARAMETERS: // 1 - Pitch : Main osc pitch // 2 - Pitch Mod Depth : Main osc pitch modulation amount // 3 - Pitch Decay : Main osc pitch modulation exponential envelope decay in seconds // 4 - Modulator Offset : Modulator osc offset from main pitch // 5 - Modulator Pitch Mod Depth : Modulator osc pitch modulation amount // 6 - Modulator Pitch Mod Decay : Modulator osc pitch modulation exponential envelope decay in seconds // 7 - PMW1 : Main osc square wave PMW // 8 - PMW2 : Modulator osc offset import("stdfaust.lib"); import("volenvUI.dsp"); import("utilities.lib"); import("bitwise.lib"); process = hgroup("Bitwise", bitwise(pitch, pitchDepth, pitchDecay, offset, offsetDepth, offsetDecay, pwm1, pwm2, trigger)*2) <:_,_ with{ trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(420), log(20), log(2000), 0.01) :si.smoo); pitchDepth = hslider("[2]Pitch Mod Depth [style:knob]", 2, 0, 2000, 0.01); pitchDecay = vslider("[3]Pitch Decay[style:knob]", 1, 0, 1, 0.01); pwm1 = vslider("[4]PWM 1[style:knob]", 0.1, 0.1, 0.90, 0.001); offset = exp(vslider("[5]Modulator Offset [style:knob]", 0, 0, log(10000), 0.01) :si.smoo); offsetDepth = hslider("[6]Modulator Pitch Mod Depth [style:knob]", 2, 0, 2000, 0.01); offsetDecay = vslider("[7]Modulator Pitch Mod Decay[style:knob]", 1, 0, 1, 0.01); pwm2 = vslider("[8]PWM 2[style:knob]", 0.1, 0.1, 0.90, 0.001); };
https://raw.githubusercontent.com/chevremaudite/zosimos/55a532489c278fa47ffd37a84322c9a27800f588/SOFTWARE/FAUST/ui/bitwiseUI.dsp
faust
-----------------BITWISE----------------// Bitwise operations based engine for hard kicks and digital weird percs --------------PARAMETERS: 1 - Pitch : Main osc pitch 2 - Pitch Mod Depth : Main osc pitch modulation amount 3 - Pitch Decay : Main osc pitch modulation exponential envelope decay in seconds 4 - Modulator Offset : Modulator osc offset from main pitch 5 - Modulator Pitch Mod Depth : Modulator osc pitch modulation amount 6 - Modulator Pitch Mod Decay : Modulator osc pitch modulation exponential envelope decay in seconds 7 - PMW1 : Main osc square wave PMW 8 - PMW2 : Modulator osc offset
import("stdfaust.lib"); import("volenvUI.dsp"); import("utilities.lib"); import("bitwise.lib"); process = hgroup("Bitwise", bitwise(pitch, pitchDepth, pitchDecay, offset, offsetDepth, offsetDecay, pwm1, pwm2, trigger)*2) <:_,_ with{ trigger = button("T"):ba.impulsify; pitch = exp(vslider("[1]Pitch [style:knob]", log(420), log(20), log(2000), 0.01) :si.smoo); pitchDepth = hslider("[2]Pitch Mod Depth [style:knob]", 2, 0, 2000, 0.01); pitchDecay = vslider("[3]Pitch Decay[style:knob]", 1, 0, 1, 0.01); pwm1 = vslider("[4]PWM 1[style:knob]", 0.1, 0.1, 0.90, 0.001); offset = exp(vslider("[5]Modulator Offset [style:knob]", 0, 0, log(10000), 0.01) :si.smoo); offsetDepth = hslider("[6]Modulator Pitch Mod Depth [style:knob]", 2, 0, 2000, 0.01); offsetDecay = vslider("[7]Modulator Pitch Mod Decay[style:knob]", 1, 0, 1, 0.01); pwm2 = vslider("[8]PWM 2[style:knob]", 0.1, 0.1, 0.90, 0.001); };
00df993fc8ac36a263c92286c428dd2ae2510f2f37816be60c6d7ce452faa51b
sozbtn/physical-modelling-percussion-instrument
perc_inst_faust.dsp
import("stdfaust.lib"); import("instruments.lib"); //==================== GUI SPECIFICATION ================ freq = nentry("h:Basic_Parameters/freq [1][unit:Hz] [tooltip:Tone frequency]",100,20,20000,1); gain = nentry("h:Basic_Parameters/gain [1][tooltip:Gain (value between 0 and 1)]",1,0,1,0.01); gate = button("h:Basic_Parameters/gate [1][tooltip:noteOn = 1, noteOff = 0]"); preset = nentry("h:Basic_Parameters/v:Physical_Parameters/Preset [1][tooltip:0->BigTom]", 0, 0, nPresets-1, 1) : si.smoo; //preset = 0; detune = vslider("h:Basic_Parameters/detune [1][unit:dB] [tooltip:detune]",1,0.5,1.2,0.0001) : si.smoo; damping = vslider("h:Basic_Parameters/damping [1][tooltip:damping (value between 1 and 10)]",1,1,5,0.01); select = nentry("h:Physical_and_Nonlinearity/v:Physical_Parameters/Excitation_Selector [2][tooltip:0=Bow; 1=Strike]",1,0,1,1); integrationConstant = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/Integration_Constant [2][tooltip:A value between 0 and 1]",0,0,1,0.01); baseGain = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/Base_Gain [2][tooltip:A value between 0 and 1]",1,0,1,0.01); bowPressure = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/Bow_Pressure [2][tooltip:Bow pressure on the instrument (Value between 0 and 1)]",0.2,0,1,0.01); bowPosition = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/Bow_Position [2][tooltip:Bow position on the instrument (Value between 0 and 1)]",0,0,1,0.01); typeModulation = nentry("h:Physical_and_Nonlinearity/v:Nonlinear_Filter_Parameters/Modulation_Type [3][tooltip: 0=theta is modulated by the incoming signal; 1=theta is modulated by the averaged incoming signal; 2=theta is modulated by the squared incoming signal; 3=theta is modulated by a sine wave of frequency freqMod; 4=theta is modulated by a sine wave of frequency freq;]",0,0,4,1); nonLinearity = hslider("h:Physical_and_Nonlinearity/v:Nonlinear_Filter_Parameters/Nonlinearity [3][tooltip:Nonlinearity factor (value between 0 and 1)]",0,0,1,0.01); frequencyMod = hslider("h:Physical_and_Nonlinearity/v:Nonlinear_Filter_Parameters/Modulation_Frequency [3][unit:Hz][tooltip:Frequency of the sine wave for the modulation of theta (works if Modulation Type=3)]",220,20,1000,0.1); nonLinAttack = hslider("h:Physical_and_Nonlinearity/v:Nonlinear_Filter_Parameters/Nonlinearity_Attack [3][unit:s][Attack duration of the nonlinearity]",0.1,0,2,0.01); a = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/a [3][tooltip:attack]",0.002,0.001,0.01,0.001); d = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/d [3][tooltip:decay]",0.005,0.001,0.01,0.001); //==================== MODAL PARAMETERS ================ nPresets = 2; // number of presets // big tom drum nMode(0) = 16; // number of modes in preset 0 modes(0,0) = 1.0; // modes ratios to fundamental modes(0,1) = 1.8064; modes(0,2) = 2.2997; modes(0,3) = 2.6556; modes(0,4) = 2.9554; modes(0,5) = 3.0749; modes(0,6) = 3.5227; modes(0,7) = 4.0321; modes(0,8) = 4.2016; modes(0,9) = 4.9170; modes(0,10) = 5.3809; modes(0,11) = 6.2952; modes(0,12) = 7.1936; modes(0,13) = 9.1436; modes(0,14) = 10.1516; modes(0,15) = 11.6771; modes(1,0) = 1.0; // modes ratios to fundamental modes(1,1) = 1.148; modes(1,2) = 1.998; modes(1,3) = 2.138; modes(1,4) = 2.299; modes(1,5) = 2.451; modes(1,6) = 2.660; modes(1,7) = 2.985; modes(1,8) = 3.442; modes(1,9) = 4.013; modes(1,10) = 4.598; modes(1,11) = 4.855; modes(1,12) = 5.557; modes(1,13) = 7.482; modes(1,14) = 10.1516; modes(1,15) = 18.734; // feedback gains f_gain_fader(x) = hgroup("Feedback Gains", vslider("h:Basic_Parameters/feedback_gain_%x [%3x][tooltip: FB Gain %x] [style:knob] [size: 1]",pow(0.999,x),0,0.99999999999,0.001)) : si.smoo; f_gain(x) = -1/(f_gain_fader(x) + 0.95925)^3 + 1.13293; // better "log-like" curve // forward gains d_gain_fader(x) = hgroup("Direct Gains",vslider("h:Basic_Parameters/direct_gain_%x [%4x] [tooltip: Direct Gain %x] [style:knob]",0.8,0,1,0.001)) : si.smoo; // mode fader mode_fader(x) = hgroup("Modes", vslider("h:Basic_Parameters/mode_%x [%5x][tooltip: Mode %x] [style:knob]",1,0.5,1.5,0.001)) : si.smoo; mode(x) = modes(preset,x)*(mode_fader(x)); //==================== SIGNAL PROCESSING ================ //----------------------- Nonlinear filter ---------------------------- //nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib //nonlinear filter order nlfOrder = 6; //nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib //for using it with waveguide instruments NLFM = nonLinearModulator((nonLinearity : si.smoo),1,freq,typeModulation,(frequencyMod : si.smoo),nlfOrder); //----------------------- Synthesis parameters computing and functions declaration ---------------------------- //the number of modes depends on the preset being used nModes = 16; // nMode(preset); //bow table parameters tableOffset = 0; tableSlope = 10 - (9*bowPressure); delayLengthBase = (ma.SR/freq)*detune; //delay lengths in number of samples delayLength(x) = delayLengthBase/mode(x); //delay lines delayLine(x) = de.delay(4096,delayLength(x)); //Filter bank: bandpass filters (declared in instrument.lib) radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x) = bandPass(freq*mode(x), radius); //Delay lines feedback for bow table lookup control baseGainApp = 0.8999999999999999 + (0.1*baseGain); velocityInputApp = integrationConstant; velocityInput = velocityInputApp + _*baseGainApp,par(i,(nModes-1),(_*baseGainApp)) :> +; //Bow velocity is controled by an ADSR envelope maxVelocity = 0.03 + 0.1; bowVelocity = maxVelocity*en.adsr(a,d,90,0.01,gate); //stereoizer is declared in instrument.lib and implement a stereo spacialisation in function of //the frequency period in number of samples stereo = stereoizer(delayLengthBase); //----------------------- Algorithm implementation ---------------------------- //Bow table lookup (bow is decalred in instrument.lib) bowing = bowVelocity - velocityInput <: *(bow(tableOffset,tableSlope)): /(nModes/2); //One resonance //resonance(x) = + : delayLine(x) : *(f_gain(x)/damping) : bandPassFilter(x); // + (excitation(preset,x)*select) : resonance(x) = + : bandPassFilter(x) : delayLine(x); partial(x) = _ * (d_gain_fader(x)) : (resonance(x)~ * (f_gain(x)/damping)); process = (bowing*((select-1)*-1)+(_/nModes*select) <: par(i,nModes,(partial(i))))~par(i,nModes,_) :> + : *(nModes) : NLFM; // : stereo : instrReverb : fi.dcblockerat(60); *(nModes-(nModes-1)*select) : /* //Bowed Excitation (bowing*((select-1)*-1) <: //nModes resonances with nModes feedbacks for bow table look-up par(i,nModes,(resonance(i)~_)))~par(i,nModes,_) :> + : //Signal Scaling and stereo *(4) : NLFM : stereo : instrReverb; */
https://raw.githubusercontent.com/sozbtn/physical-modelling-percussion-instrument/ad971fd6d962c125df70662aaab9ca87230ba805/perc_inst_faust.dsp
faust
==================== GUI SPECIFICATION ================ preset = 0; ==================== MODAL PARAMETERS ================ number of presets big tom drum number of modes in preset 0 modes ratios to fundamental modes ratios to fundamental feedback gains better "log-like" curve forward gains mode fader ==================== SIGNAL PROCESSING ================ ----------------------- Nonlinear filter ---------------------------- nonlinearities are created by the nonlinear passive allpass ladder filter declared in filter.lib nonlinear filter order nonLinearModultor is declared in instrument.lib, it adapts allpassnn from filter.lib for using it with waveguide instruments ----------------------- Synthesis parameters computing and functions declaration ---------------------------- the number of modes depends on the preset being used nMode(preset); bow table parameters delay lengths in number of samples delay lines Filter bank: bandpass filters (declared in instrument.lib) Delay lines feedback for bow table lookup control Bow velocity is controled by an ADSR envelope stereoizer is declared in instrument.lib and implement a stereo spacialisation in function of the frequency period in number of samples ----------------------- Algorithm implementation ---------------------------- Bow table lookup (bow is decalred in instrument.lib) One resonance resonance(x) = + : delayLine(x) : *(f_gain(x)/damping) : bandPassFilter(x); // + (excitation(preset,x)*select) : : stereo : instrReverb : fi.dcblockerat(60); *(nModes-(nModes-1)*select) : //Bowed Excitation (bowing*((select-1)*-1) <: //nModes resonances with nModes feedbacks for bow table look-up par(i,nModes,(resonance(i)~_)))~par(i,nModes,_) :> + : //Signal Scaling and stereo *(4) : NLFM : stereo : instrReverb;
import("stdfaust.lib"); import("instruments.lib"); freq = nentry("h:Basic_Parameters/freq [1][unit:Hz] [tooltip:Tone frequency]",100,20,20000,1); gain = nentry("h:Basic_Parameters/gain [1][tooltip:Gain (value between 0 and 1)]",1,0,1,0.01); gate = button("h:Basic_Parameters/gate [1][tooltip:noteOn = 1, noteOff = 0]"); preset = nentry("h:Basic_Parameters/v:Physical_Parameters/Preset [1][tooltip:0->BigTom]", 0, 0, nPresets-1, 1) : si.smoo; detune = vslider("h:Basic_Parameters/detune [1][unit:dB] [tooltip:detune]",1,0.5,1.2,0.0001) : si.smoo; damping = vslider("h:Basic_Parameters/damping [1][tooltip:damping (value between 1 and 10)]",1,1,5,0.01); select = nentry("h:Physical_and_Nonlinearity/v:Physical_Parameters/Excitation_Selector [2][tooltip:0=Bow; 1=Strike]",1,0,1,1); integrationConstant = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/Integration_Constant [2][tooltip:A value between 0 and 1]",0,0,1,0.01); baseGain = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/Base_Gain [2][tooltip:A value between 0 and 1]",1,0,1,0.01); bowPressure = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/Bow_Pressure [2][tooltip:Bow pressure on the instrument (Value between 0 and 1)]",0.2,0,1,0.01); bowPosition = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/Bow_Position [2][tooltip:Bow position on the instrument (Value between 0 and 1)]",0,0,1,0.01); typeModulation = nentry("h:Physical_and_Nonlinearity/v:Nonlinear_Filter_Parameters/Modulation_Type [3][tooltip: 0=theta is modulated by the incoming signal; 1=theta is modulated by the averaged incoming signal; 2=theta is modulated by the squared incoming signal; 3=theta is modulated by a sine wave of frequency freqMod; 4=theta is modulated by a sine wave of frequency freq;]",0,0,4,1); nonLinearity = hslider("h:Physical_and_Nonlinearity/v:Nonlinear_Filter_Parameters/Nonlinearity [3][tooltip:Nonlinearity factor (value between 0 and 1)]",0,0,1,0.01); frequencyMod = hslider("h:Physical_and_Nonlinearity/v:Nonlinear_Filter_Parameters/Modulation_Frequency [3][unit:Hz][tooltip:Frequency of the sine wave for the modulation of theta (works if Modulation Type=3)]",220,20,1000,0.1); nonLinAttack = hslider("h:Physical_and_Nonlinearity/v:Nonlinear_Filter_Parameters/Nonlinearity_Attack [3][unit:s][Attack duration of the nonlinearity]",0.1,0,2,0.01); a = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/a [3][tooltip:attack]",0.002,0.001,0.01,0.001); d = hslider("h:Physical_and_Nonlinearity/v:Physical_Parameters/d [3][tooltip:decay]",0.005,0.001,0.01,0.001); modes(0,1) = 1.8064; modes(0,2) = 2.2997; modes(0,3) = 2.6556; modes(0,4) = 2.9554; modes(0,5) = 3.0749; modes(0,6) = 3.5227; modes(0,7) = 4.0321; modes(0,8) = 4.2016; modes(0,9) = 4.9170; modes(0,10) = 5.3809; modes(0,11) = 6.2952; modes(0,12) = 7.1936; modes(0,13) = 9.1436; modes(0,14) = 10.1516; modes(0,15) = 11.6771; modes(1,1) = 1.148; modes(1,2) = 1.998; modes(1,3) = 2.138; modes(1,4) = 2.299; modes(1,5) = 2.451; modes(1,6) = 2.660; modes(1,7) = 2.985; modes(1,8) = 3.442; modes(1,9) = 4.013; modes(1,10) = 4.598; modes(1,11) = 4.855; modes(1,12) = 5.557; modes(1,13) = 7.482; modes(1,14) = 10.1516; modes(1,15) = 18.734; f_gain_fader(x) = hgroup("Feedback Gains", vslider("h:Basic_Parameters/feedback_gain_%x [%3x][tooltip: FB Gain %x] [style:knob] [size: 1]",pow(0.999,x),0,0.99999999999,0.001)) : si.smoo; d_gain_fader(x) = hgroup("Direct Gains",vslider("h:Basic_Parameters/direct_gain_%x [%4x] [tooltip: Direct Gain %x] [style:knob]",0.8,0,1,0.001)) : si.smoo; mode_fader(x) = hgroup("Modes", vslider("h:Basic_Parameters/mode_%x [%5x][tooltip: Mode %x] [style:knob]",1,0.5,1.5,0.001)) : si.smoo; mode(x) = modes(preset,x)*(mode_fader(x)); nlfOrder = 6; NLFM = nonLinearModulator((nonLinearity : si.smoo),1,freq,typeModulation,(frequencyMod : si.smoo),nlfOrder); tableOffset = 0; tableSlope = 10 - (9*bowPressure); delayLengthBase = (ma.SR/freq)*detune; delayLength(x) = delayLengthBase/mode(x); delayLine(x) = de.delay(4096,delayLength(x)); radius = 1 - ma.PI*32/ma.SR; bandPassFilter(x) = bandPass(freq*mode(x), radius); baseGainApp = 0.8999999999999999 + (0.1*baseGain); velocityInputApp = integrationConstant; velocityInput = velocityInputApp + _*baseGainApp,par(i,(nModes-1),(_*baseGainApp)) :> +; maxVelocity = 0.03 + 0.1; bowVelocity = maxVelocity*en.adsr(a,d,90,0.01,gate); stereo = stereoizer(delayLengthBase); bowing = bowVelocity - velocityInput <: *(bow(tableOffset,tableSlope)): /(nModes/2); resonance(x) = + : bandPassFilter(x) : delayLine(x); partial(x) = _ * (d_gain_fader(x)) : (resonance(x)~ * (f_gain(x)/damping)); process = (bowing*((select-1)*-1)+(_/nModes*select) <: par(i,nModes,(partial(i))))~par(i,nModes,_) :> + : *(nModes) :
14b5cdd01fa750c13e06a41686d0c8b48c4f8f9b25d84b8ef1e4b0821d1c8258
DBraun/DawDreamer
polyphonic.dsp
declare name "MyInstrument"; declare options "[nvoices:8]"; // FaustProcessor has a property which will override this. import("stdfaust.lib"); 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 myFilter = fi.lowpass(10, hslider("cutoff", 20000., 30., 20000., 0.1)); decay = hslider("decay", .1, 0.001, 10., 0.001); envFilter = en.adsr(.002, decay, 0.0, .05, gate); envVol = 0.5*en.adsr(.002, 0.1, 0.9, .1, gate); process = os.sawtooth(freq)*gain*envVol : fi.lowpass(10, 500. + 10000.*envFilter) <: _, _; // polyphonic DSP code must declare a stereo effect, even it is simply // effect = _, _; effect = myFilter, myFilter;
https://raw.githubusercontent.com/DBraun/DawDreamer/5dc7a2abb1912841bb1f5eb834de2659c8ca3777/tests/faust_dsp/polyphonic.dsp
faust
FaustProcessor has a property which will override this. note pitch note velocity note on/off polyphonic DSP code must declare a stereo effect, even it is simply effect = _, _;
declare name "MyInstrument"; import("stdfaust.lib"); myFilter = fi.lowpass(10, hslider("cutoff", 20000., 30., 20000., 0.1)); decay = hslider("decay", .1, 0.001, 10., 0.001); envFilter = en.adsr(.002, decay, 0.0, .05, gate); envVol = 0.5*en.adsr(.002, 0.1, 0.9, .1, gate); process = os.sawtooth(freq)*gain*envVol : fi.lowpass(10, 500. + 10000.*envFilter) <: _, _; effect = myFilter, myFilter;
c4aaebacb83afb49bc5069602bb8a350a00eeb7f1ed66709932db835738c70a4
DBraun/DawDreamer
soundfile.dsp
declare name "MyInstrument"; declare options "[nvoices:8]"; // FaustProcessor has a property which will override this. import("stdfaust.lib"); // variation of hs_phasor that doesn't loop. It's like a one-shot trigger. my_phasor(inc,c) = inc*on_memory : + ~ (_*(1-start_pulse)) with { is_on = c>0; start_pulse = is_on & (1-is_on'); on_memory = is_on : max ~ (_*(1-start_pulse)); }; 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; soundChoice = nentry("soundChoice", 0, 0, 2, 1); root_midi = hslider("center_note", 60., 1., 128., 0.01); semitones = key - root_midi; ratio = semitones : ba.semi2ratio; envVol = en.adsr(.002, 0.1, 0.9, .1, gate); totalGain = gain * envVol * .5; process = soundChoice,my_phasor(ratio, gate):soundfile("mySound",2):!,!,_,_ : _*totalGain, _*totalGain; // polyphonic DSP code must declare a stereo effect effect = _, _;
https://raw.githubusercontent.com/DBraun/DawDreamer/042913a1e373fcb0fa539cb713ce41d74b077ff2/tests/faust_dsp/soundfile.dsp
faust
FaustProcessor has a property which will override this. 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"); my_phasor(inc,c) = inc*on_memory : + ~ (_*(1-start_pulse)) with { is_on = c>0; start_pulse = is_on & (1-is_on'); on_memory = is_on : max ~ (_*(1-start_pulse)); }; key = hslider("freq", 60, 1, 127, 1) : ba.hz2midikey; soundChoice = nentry("soundChoice", 0, 0, 2, 1); root_midi = hslider("center_note", 60., 1., 128., 0.01); semitones = key - root_midi; ratio = semitones : ba.semi2ratio; envVol = en.adsr(.002, 0.1, 0.9, .1, gate); totalGain = gain * envVol * .5; process = soundChoice,my_phasor(ratio, gate):soundfile("mySound",2):!,!,_,_ : _*totalGain, _*totalGain; effect = _, _;
0167cd431e1a5f069100412fa3d3db65052a4bc434e358b20cf9a217947ac3c3
DBraun/DawDreamer
soundfile_piano.dsp
declare name "MyInstrument"; declare options "[nvoices:8]"; // FaustProcessor has a property which will override this. import("stdfaust.lib"); // variation of hs_phasor that doesn't loop. It's like a one-shot trigger. my_phasor(inc,c) = inc*on_memory : + ~ (_*(1-start_pulse)) with { is_on = c>0; start_pulse = is_on & (1-is_on'); on_memory = is_on : max ~ (_*(1-start_pulse)); }; 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 : _ , -21 : +; // note that A0 is midi note 21, so we subtract 21 to get to 0 (the first file is named 0.wav) release = hslider("release",0.1,0.,2.,0.001); // note release in seconds envVol = en.adsr(0., 0., 1., release, gate); safeKey = key : min(87) : max(0); totalGain = gain * envVol * .5; process = safeKey,my_phasor(1., gate):soundfile("mySound",2):!,!,_,_ : _*totalGain, _*totalGain; // polyphonic DSP code must declare a stereo effect effect = _, _;
https://raw.githubusercontent.com/DBraun/DawDreamer/cddfd141dc5141913813cce0961501d037aeb7e1/tests/faust_dsp/soundfile_piano.dsp
faust
FaustProcessor has a property which will override this. variation of hs_phasor that doesn't loop. It's like a one-shot trigger. note velocity note on/off note that A0 is midi note 21, so we subtract 21 to get to 0 (the first file is named 0.wav) note release in seconds polyphonic DSP code must declare a stereo effect
declare name "MyInstrument"; import("stdfaust.lib"); my_phasor(inc,c) = inc*on_memory : + ~ (_*(1-start_pulse)) with { is_on = c>0; start_pulse = is_on & (1-is_on'); on_memory = is_on : max ~ (_*(1-start_pulse)); }; key = hslider("freq", 60, 1, 127, 1) : ba.hz2midikey : _ , -21 : +; envVol = en.adsr(0., 0., 1., release, gate); safeKey = key : min(87) : max(0); totalGain = gain * envVol * .5; process = safeKey,my_phasor(1., gate):soundfile("mySound",2):!,!,_,_ : _*totalGain, _*totalGain; effect = _, _;
26d38ad63b9cc26df7438f30aaccd81c9379df7b1e0424fed80e153ff4bae81b
DBraun/DawDreamer
sidechain.dsp
// https://github.com/grame-cncm/faustlibraries/blob/master/demos.lib // Author: Julius Smith // License: MIT // Revised by David Braun declare description "Compressor demo application"; import("stdfaust.lib"); compressor_demo(main_L, main_R, aux_L, aux_R) = result with{ comp_group(x) = hgroup("COMPRESSOR [tooltip: Reference: http://en.wikipedia.org/wiki/Dynamic_range_compression]", x); settings_group(x) = comp_group(hgroup("[0] Settings", x)); meter_group(x) = comp_group(hgroup("[1] Meters", x)); gain_view = _ <: attach(_,abs : ba.linear2db : meter_group(vbargraph("Level",-60,10))); cgm = makeupgain*gain_view(co.compression_gain_mono(ratio,threshold,attack,release,abs(aux_L)+abs(aux_R))); result = main_L * cgm, main_R * cgm; ratio = settings_group(hslider("[0] Ratio [style:knob] [tooltip: A compression Ratio of N means that for each N dB increase in input signal level above Threshold, the output level goes up 1 dB]", 5, 1, 20, 0.01)); threshold = settings_group(hslider("[1] Threshold [unit:dB] [style:knob] [tooltip: When the signal level exceeds the Threshold (in dB), its level is compressed according to the Ratio]", -20, -100, 10, 0.01)); attack = settings_group(hslider("[2] Attack [unit:ms] [style:knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new lower target level (the compression `kicking in')]", 20, 1, 1000, 0.1)) : *(0.001) : max(1/ma.SR); release = settings_group(hslider("[3] Release [unit:ms] [style: knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new higher target level (the compression 'releasing')]", 200, 1, 1000, 0.1)) : *(0.001) : max(1/ma.SR); makeupgain = settings_group(vslider("[4] Makeup Gain [unit:dB] [tooltip: The compressed-signal output level is increased by this amount (in dB) to make up for the level lost due to compression]", 2., -96, 96, 0.01)) : ba.db2linear; }; process = compressor_demo;
https://raw.githubusercontent.com/DBraun/DawDreamer/a2a174719b596a2f9cc9b81a11a269625144f175/tests/faust_dsp/sidechain.dsp
faust
ERROR: type should be string, got " https://github.com/grame-cncm/faustlibraries/blob/master/demos.lib\n Author: Julius Smith\n License: MIT\n Revised by David Braun\nen.wikipedia.org/wiki/Dynamic_range_compression]\", x);"
declare description "Compressor demo application"; import("stdfaust.lib"); compressor_demo(main_L, main_R, aux_L, aux_R) = result with{ comp_group(x) = hgroup("COMPRESSOR [tooltip: Reference: settings_group(x) = comp_group(hgroup("[0] Settings", x)); meter_group(x) = comp_group(hgroup("[1] Meters", x)); gain_view = _ <: attach(_,abs : ba.linear2db : meter_group(vbargraph("Level",-60,10))); cgm = makeupgain*gain_view(co.compression_gain_mono(ratio,threshold,attack,release,abs(aux_L)+abs(aux_R))); result = main_L * cgm, main_R * cgm; ratio = settings_group(hslider("[0] Ratio [style:knob] [tooltip: A compression Ratio of N means that for each N dB increase in input signal level above Threshold, the output level goes up 1 dB]", 5, 1, 20, 0.01)); threshold = settings_group(hslider("[1] Threshold [unit:dB] [style:knob] [tooltip: When the signal level exceeds the Threshold (in dB), its level is compressed according to the Ratio]", -20, -100, 10, 0.01)); attack = settings_group(hslider("[2] Attack [unit:ms] [style:knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new lower target level (the compression `kicking in')]", 20, 1, 1000, 0.1)) : *(0.001) : max(1/ma.SR); release = settings_group(hslider("[3] Release [unit:ms] [style: knob] [scale:log] [tooltip: Time constant in ms (1/e smoothing time) for the compression gain to approach (exponentially) a new higher target level (the compression 'releasing')]", 200, 1, 1000, 0.1)) : *(0.001) : max(1/ma.SR); makeupgain = settings_group(vslider("[4] Makeup Gain [unit:dB] [tooltip: The compressed-signal output level is increased by this amount (in dB) to make up for the level lost due to compression]", 2., -96, 96, 0.01)) : ba.db2linear; }; process = compressor_demo;
c87d9b9a14402b30dcb1718299da644d8281cfa57bf4de0de25cee8a65b15a7c
DBraun/DawDreamer
polyphonic_sampler.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 variable is excluded from this file because they come // from substitution with Python. // LAGRANGE_ORDER = 4; // lagrange order. [2-4] are good choices. // 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; soundfile_full = soundfile("mySample",2): _, !, _, _; S = 0, 0 : soundfile_full : _, !, !; soundfile_table_L = 0, _ : soundfile_full : !, _, !; soundfile_table_R = 0, _ : soundfile_full : !, !, _; length_sec = S / ma.SR; freq = ratio / length_sec; envVol = en.adsr(.002, 0.1, 0.9, .1, gate); ridx = my_phasor(S, freq, gate); declare lagrangeCoeffs author "Dario Sanfilippo"; declare lagrangeCoeffs copyright "Copyright (C) 2021 Dario Sanfilippo <[email protected]>"; declare lagrangeCoeffs license "MIT license"; // NOTE: this is a modification of the original it.frdtable so that // it works with a soundfile // https://github.com/grame-cncm/faustlibraries/blob/master/interpolators.lib frdtable(N, S, init, idx) = it.lagrangeN(N, f_idx, par(i, N + 1, table(i_idx - int(N / 2) + i))) with { table(j) = int(ma.modulo(j, S)) : init; f_idx = ma.frac(idx) + int(N / 2); i_idx = int(idx); }; process = frdtable(LAGRANGE_ORDER, S, soundfile_table_L, ridx), frdtable(LAGRANGE_ORDER, S, soundfile_table_R, ridx) <: _*finalGain, _*finalGain with { finalGain = gain*envVol*0.5; }; // polyphonic DSP code must declare a stereo effect effect = _, _;
https://raw.githubusercontent.com/DBraun/DawDreamer/a67f66107ae02afc8334052dd9d806dbf93b4550/tests/faust_dsp/polyphonic_sampler.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 variable is excluded from this file because they come from substitution with Python. LAGRANGE_ORDER = 4; // lagrange order. [2-4] are good choices. variation of hs_phasor that doesn't loop. It's like a one-shot trigger. note velocity note on/off NOTE: this is a modification of the original it.frdtable so that it works with a soundfile https://github.com/grame-cncm/faustlibraries/blob/master/interpolators.lib polyphonic DSP code must declare a stereo effect
declare name "MyInstrument"; import("stdfaust.lib"); 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; soundfile_full = soundfile("mySample",2): _, !, _, _; S = 0, 0 : soundfile_full : _, !, !; soundfile_table_L = 0, _ : soundfile_full : !, _, !; soundfile_table_R = 0, _ : soundfile_full : !, !, _; length_sec = S / ma.SR; freq = ratio / length_sec; envVol = en.adsr(.002, 0.1, 0.9, .1, gate); ridx = my_phasor(S, freq, gate); declare lagrangeCoeffs author "Dario Sanfilippo"; declare lagrangeCoeffs copyright "Copyright (C) 2021 Dario Sanfilippo <[email protected]>"; declare lagrangeCoeffs license "MIT license"; frdtable(N, S, init, idx) = it.lagrangeN(N, f_idx, par(i, N + 1, table(i_idx - int(N / 2) + i))) with { table(j) = int(ma.modulo(j, S)) : init; f_idx = ma.frac(idx) + int(N / 2); i_idx = int(idx); }; process = frdtable(LAGRANGE_ORDER, S, soundfile_table_L, ridx), frdtable(LAGRANGE_ORDER, S, soundfile_table_R, ridx) <: _*finalGain, _*finalGain with { finalGain = gain*envVol*0.5; }; effect = _, _;
c6e6132dfc49b56d20c5346857029b9d0ee70c996e5e4876f98eac37a9bb9ba0
goofy2k/ESP32_faust2api
yourSynth.dsp
//polyphony example from https://ccrma.stanford.edu/~rmichon/faust2api/#customizing-the-api import("stdfaust.lib"); freq = nentry("freq",200,40,2000,0.01) : si.polySmooth(gate,0.999,2); gain = nentry("gain",1,0,1,0.01) : si.polySmooth(gate,0.999,2); gate = button("gate") : si.smoo; cutoff = nentry("cutoff",500,40,2000,0.01) : si.polySmooth(gate,0.999,2); process = vgroup("synth",os.sawtooth(freq)*gain*gate : fi.lowpass(3,cutoff) <: _,_);
https://raw.githubusercontent.com/goofy2k/ESP32_faust2api/1e12506b66da095296a1f11dd1dbea4ed6bc35b0/sound_engines/faust2api/yourSynth/yourSynth.dsp
faust
polyphony example from https://ccrma.stanford.edu/~rmichon/faust2api/#customizing-the-api
import("stdfaust.lib"); freq = nentry("freq",200,40,2000,0.01) : si.polySmooth(gate,0.999,2); gain = nentry("gain",1,0,1,0.01) : si.polySmooth(gate,0.999,2); gate = button("gate") : si.smoo; cutoff = nentry("cutoff",500,40,2000,0.01) : si.polySmooth(gate,0.999,2); process = vgroup("synth",os.sawtooth(freq)*gain*gate : fi.lowpass(3,cutoff) <: _,_);
9d4e8beff4ff26d1cb42814dca518ac3a8bc152395cd47c1800d1f788e62fe5b
goofy2k/ESP32_faust2api
simpleSynth_Analog.dsp
import("stdfaust.lib"); /////////////////////////////////////////////////////////////////////////////////////////////////// // // A very simple subtractive synthesizer with 1 VCO 1 VCF. // The VCO Waveform is variable between Saw and Square // The frequency is modulated by an LFO // The envelope control volum and filter frequency // /////////////////////////////////////////////////////////////////////////////////////////////////// // ANALOG IMPLEMENTATION: // // ANALOG_0 : waveform (Saw to square) // ANALOG_1 : Filter Cutoff frequency // ANALOG_2 : Filter resonance (Q) // ANALOG_3 : Filter Envelope Modulation // // MIDI: // CC 79 : Filter keyboard tracking (0 to X2, default 1) // // Envelope // CC 73 : Attack // CC 76 : Decay // CC 77 : Sustain // CC 72 : Release // // CC 78 : LFO frequency (0.001Hz to 10Hz) // CC 1 : LFO Amplitude (Modulation) // /////////////////////////////////////////////////////////////////////////////////////////////////// // // HUI ////////////////////////////////////////////////// // Keyboard midigate = button("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 0.5, 0.01);// MIDI KEYBOARD // pitchwheel bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01)); // VCO wfFade = hslider("waveform[BELA: ANALOG_0]",0.5,0,1,0.001):si.smoo; // VCF res = hslider("resonnance[BELA: ANALOG_2]",0.5,0,1,0.001):si.smoo; fr = hslider("fc[BELA: ANALOG_1]", 15, 15, 12000, 0.001):si.smoo; track = hslider("tracking[midi:ctrl 79]", 1, 0, 2, 0.001); envMod = hslider("envMod[BELA: ANALOG_3]",50,0,100,0.01):si.smoo; // ENV att = 0.01 * (hslider("attack[midi:ctrl 73]",0.1,0.1,400,0.001)); dec = 0.01 * (hslider("decay[midi:ctrl 76]",60,0.1,400,0.001)); sust = hslider("sustain[midi:ctrl 77]",0.2,0,1,0.001); rel = 0.01 * (hslider("release[midi:ctrl 72]",100,0.1,400,0.001)); // LFO lfoFreq = hslider("lfoFreq[midi:ctrl 78]",6,0.001,10,0.001):si.smoo; modwheel = hslider("modwheel[midi:ctrl 1]",0,0,0.5,0.001):si.smoo; // PROCESS ///////////////////////////////////////////// allfreq = (midifreq * bend) + LFO; // VCF cutoff = ((allfreq * track) + fr + (envMod * midigain * env)) : min(ma.SR/8); // VCO oscillo(f) = (os.sawtooth(f)*(1-wfFade))+(os.square(f)*wfFade); // VCA volume = midigain * env; // Enveloppe env = en.adsre(att,dec,sust,rel,midigate); // LFO LFO = os.lf_triangle(lfoFreq)*modwheel*10; // SYNTH //////////////////////////////////////////////// synth = (oscillo(allfreq) :ve.moog_vcf(res,cutoff)) * volume; // PROCESS ///////////////////////////////////////////// process = synth;
https://raw.githubusercontent.com/goofy2k/ESP32_faust2api/1e12506b66da095296a1f11dd1dbea4ed6bc35b0/sound_engines/faust2api/all_engines/simpleSynth_Analog.dsp
faust
///////////////////////////////////////////////////////////////////////////////////////////////// A very simple subtractive synthesizer with 1 VCO 1 VCF. The VCO Waveform is variable between Saw and Square The frequency is modulated by an LFO The envelope control volum and filter frequency ///////////////////////////////////////////////////////////////////////////////////////////////// ANALOG IMPLEMENTATION: ANALOG_0 : waveform (Saw to square) ANALOG_1 : Filter Cutoff frequency ANALOG_2 : Filter resonance (Q) ANALOG_3 : Filter Envelope Modulation MIDI: CC 79 : Filter keyboard tracking (0 to X2, default 1) Envelope CC 73 : Attack CC 76 : Decay CC 77 : Sustain CC 72 : Release CC 78 : LFO frequency (0.001Hz to 10Hz) CC 1 : LFO Amplitude (Modulation) ///////////////////////////////////////////////////////////////////////////////////////////////// HUI ////////////////////////////////////////////////// Keyboard MIDI KEYBOARD pitchwheel VCO VCF ENV LFO PROCESS ///////////////////////////////////////////// VCF VCO VCA Enveloppe LFO SYNTH //////////////////////////////////////////////// PROCESS /////////////////////////////////////////////
import("stdfaust.lib"); midigate = button("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01)); wfFade = hslider("waveform[BELA: ANALOG_0]",0.5,0,1,0.001):si.smoo; res = hslider("resonnance[BELA: ANALOG_2]",0.5,0,1,0.001):si.smoo; fr = hslider("fc[BELA: ANALOG_1]", 15, 15, 12000, 0.001):si.smoo; track = hslider("tracking[midi:ctrl 79]", 1, 0, 2, 0.001); envMod = hslider("envMod[BELA: ANALOG_3]",50,0,100,0.01):si.smoo; att = 0.01 * (hslider("attack[midi:ctrl 73]",0.1,0.1,400,0.001)); dec = 0.01 * (hslider("decay[midi:ctrl 76]",60,0.1,400,0.001)); sust = hslider("sustain[midi:ctrl 77]",0.2,0,1,0.001); rel = 0.01 * (hslider("release[midi:ctrl 72]",100,0.1,400,0.001)); lfoFreq = hslider("lfoFreq[midi:ctrl 78]",6,0.001,10,0.001):si.smoo; modwheel = hslider("modwheel[midi:ctrl 1]",0,0,0.5,0.001):si.smoo; allfreq = (midifreq * bend) + LFO; cutoff = ((allfreq * track) + fr + (envMod * midigain * env)) : min(ma.SR/8); oscillo(f) = (os.sawtooth(f)*(1-wfFade))+(os.square(f)*wfFade); volume = midigain * env; env = en.adsre(att,dec,sust,rel,midigate); LFO = os.lf_triangle(lfoFreq)*modwheel*10; synth = (oscillo(allfreq) :ve.moog_vcf(res,cutoff)) * volume; process = synth;
80b435649aa199741c961517586fd7eb304dab46bf0c9a5ceae0aede073d869e
goofy2k/ESP32_faust2api
WaveSynth_FX.dsp
import("stdfaust.lib"); /////////////////////////////////////////////////////////////////////////////////////////////////// // // Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables. // It's possible to add more tables step. // /////////////////////////////////////////////////////////////////////////////////////////////////// // MIDI IMPLEMENTATION: // // CC 1 : LFO Depth (wave travel modulation) // CC 14 : LFO Frequency // CC 70 : Wave travelling // // CC 73 : Attack // CC 76 : Decay // CC 77 : Sustain // CC 72 : Release // /////////////////////////////////////////////////////////////////////////////////////////////////// // GENERAL midigate = button("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 1, 0.01); waveTravel = hslider("waveTravel [midi:ctrl ]",0,0,1,0.01); // pitchwheel bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01)); gFreq = midifreq * bend; // LFO lfoDepth = hslider("lfoDepth[midi:ctrl 1]",0,0.,1,0.001):si.smoo; lfoFreq = hslider("lfoFreq[midi:ctrl 14]",0.1,0.01,10,0.001):si.smoo; moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0); volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01); volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01); volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01); volR = hslider("R[midi:ctrl 72]",0.8,0.01,8,0.01); envelop = en.adsre(volA,volD,volS,volR,midigate); // Out Amplitude vol = envelop * midigain; WF(tablesize, rang) = abs((fmod ((1+(float(ba.time)*rang)/float(tablesize)), 4.0 ))-2) -1.; // 4 WF maxi with this version: scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0) with { coef = 3.14159 * ((nb-1)*0.5); soustraction = select2(position>0, 0, (position/(nb-1))); }; wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1))) + (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3))) with { tablesize = 1024; wt1 = WF(tablesize, 16); wt2 = WF(tablesize, 8); wt3 = WF(tablesize, 6); wt4 = WF(tablesize, 4); faze = int(os.phasor(tablesize,freq)); }; //#################################################################################################// //##################################### EFFECT SECTION ############################################// //#################################################################################################// // Simple FX chaine build for a mono synthesizer. // It control general volume and pan. // FX Chaine is: // Drive // Flanger // Reverberation // /////////////////////////////////////////////////////////////////////////////////////////////////// // MIDI IMPLEMENTATION: // (All are available by OSC) // // CC 7 : Volume // CC 10 : Pan // // CC 92 : Distortion Drive // // CC 13 : Flanger Delay // CC 93 : Flanger Dry/Wet // CC 94 : Flanger Feedback // // CC 12 : Reverberation Room size // CC 91 : Reverberation Dry/Wet // CC 95 : Reverberation Damp // CC 90 : Reverberation Stereo Width // /////////////////////////////////////////////////////////////////////////////////////////////////// // VOLUME: volFX = hslider("volume[midi:ctrl 7]",1,0,1,0.001);// Should be 7 according to MIDI CC norm. // EFFECTS ///////////////////////////////////////////// drive = hslider("drive[midi:ctrl 92]",0.3,0,1,0.001); // Flanger curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001); fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001); fldw = hslider("dryWetFlang[midi:ctrl 93]",0.5,0,1,0.001); flanger = efx with { fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10); efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw); }; // Pannoramique: panno = _ : sp.panner(hslider("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_; // REVERB (from freeverb_demo) reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain : re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)), *(1-g), *(1-g) :> _,_ with { scaleroom = 0.28; offsetroom = 0.7; allpassfeed = 0.5; scaledamp = 0.4; fixedgain = 0.1; origSR = 44100; damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR; combfeed = vslider("RoomSize[midi:ctrl 12]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom; spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR; g = vslider("dryWetReverb[midi:ctrl 91]", 0.4, 0, 1, 0.001); // (g = Dry/Wet) }; // Dry-Wet (from C. LEBRETON) dry_wet(dw,x,y) = wet*y + dry*x with { wet = 0.5*(dw+1.0); dry = 1.0-wet; }; // ALL effect = _ *(volFX) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb; process = wfosc(gFreq) * vol;
https://raw.githubusercontent.com/goofy2k/ESP32_faust2api/1e12506b66da095296a1f11dd1dbea4ed6bc35b0/sound_engines/faust2api/all_engines/WaveSynth_FX.dsp
faust
///////////////////////////////////////////////////////////////////////////////////////////////// Simple demo of wavetable synthesis. A LFO modulate the interpolation between 4 tables. It's possible to add more tables step. ///////////////////////////////////////////////////////////////////////////////////////////////// MIDI IMPLEMENTATION: CC 1 : LFO Depth (wave travel modulation) CC 14 : LFO Frequency CC 70 : Wave travelling CC 73 : Attack CC 76 : Decay CC 77 : Sustain CC 72 : Release ///////////////////////////////////////////////////////////////////////////////////////////////// GENERAL pitchwheel LFO Out Amplitude 4 WF maxi with this version: #################################################################################################// ##################################### EFFECT SECTION ############################################// #################################################################################################// Simple FX chaine build for a mono synthesizer. It control general volume and pan. FX Chaine is: Drive Flanger Reverberation ///////////////////////////////////////////////////////////////////////////////////////////////// MIDI IMPLEMENTATION: (All are available by OSC) CC 7 : Volume CC 10 : Pan CC 92 : Distortion Drive CC 13 : Flanger Delay CC 93 : Flanger Dry/Wet CC 94 : Flanger Feedback CC 12 : Reverberation Room size CC 91 : Reverberation Dry/Wet CC 95 : Reverberation Damp CC 90 : Reverberation Stereo Width ///////////////////////////////////////////////////////////////////////////////////////////////// VOLUME: Should be 7 according to MIDI CC norm. EFFECTS ///////////////////////////////////////////// Flanger Pannoramique: REVERB (from freeverb_demo) (g = Dry/Wet) Dry-Wet (from C. LEBRETON) ALL
import("stdfaust.lib"); midigate = button("gate"); midifreq = nentry("freq[unit:Hz]", 440, 20, 20000, 1); midigain = nentry("gain", 0.5, 0, 1, 0.01); waveTravel = hslider("waveTravel [midi:ctrl ]",0,0,1,0.01); bend = ba.semi2ratio(hslider("bend [midi:pitchwheel]",0,-2,2,0.01)); gFreq = midifreq * bend; lfoDepth = hslider("lfoDepth[midi:ctrl 1]",0,0.,1,0.001):si.smoo; lfoFreq = hslider("lfoFreq[midi:ctrl 14]",0.1,0.01,10,0.001):si.smoo; moov = ((os.lf_trianglepos(lfoFreq) * lfoDepth) + waveTravel) : min(1) : max(0); volA = hslider("A[midi:ctrl 73]",0.01,0.01,4,0.01); volD = hslider("D[midi:ctrl 76]",0.6,0.01,8,0.01); volS = hslider("S[midi:ctrl 77]",0.2,0,1,0.01); volR = hslider("R[midi:ctrl 72]",0.8,0.01,8,0.01); envelop = en.adsre(volA,volD,volS,volR,midigate); vol = envelop * midigain; WF(tablesize, rang) = abs((fmod ((1+(float(ba.time)*rang)/float(tablesize)), 4.0 ))-2) -1.; scanner(nb, position) = -(_,soustraction) : *(_,coef) : cos : max(0) with { coef = 3.14159 * ((nb-1)*0.5); soustraction = select2(position>0, 0, (position/(nb-1))); }; wfosc(freq) = (rdtable(tablesize, wt1, faze)*(moov : scanner(4,0)))+(rdtable(tablesize, wt2, faze)*(moov : scanner(4,1))) + (rdtable(tablesize, wt3, faze)*(moov : scanner(4,2)))+(rdtable(tablesize, wt4, faze)*(moov : scanner(4,3))) with { tablesize = 1024; wt1 = WF(tablesize, 16); wt2 = WF(tablesize, 8); wt3 = WF(tablesize, 6); wt4 = WF(tablesize, 4); faze = int(os.phasor(tablesize,freq)); }; drive = hslider("drive[midi:ctrl 92]",0.3,0,1,0.001); curdel = hslider("flangDel[midi:ctrl 13]",4,0.001,10,0.001); fb = hslider("flangFeedback[midi:ctrl 94]",0.7,0,1,0.001); fldw = hslider("dryWetFlang[midi:ctrl 93]",0.5,0,1,0.001); flanger = efx with { fldel = (curdel + (os.lf_triangle(1) * 2) ) : min(10); efx = _ <: _, pf.flanger_mono(10,fldel,1,fb,0) : dry_wet(fldw); }; panno = _ : sp.panner(hslider("pan[midi:ctrl 10]",0.5,0,1,0.001)) : _,_; reverb = _,_ <: (*(g)*fixedgain,*(g)*fixedgain : re.stereo_freeverb(combfeed, allpassfeed, damping, spatSpread)), *(1-g), *(1-g) :> _,_ with { scaleroom = 0.28; offsetroom = 0.7; allpassfeed = 0.5; scaledamp = 0.4; fixedgain = 0.1; origSR = 44100; damping = vslider("Damp[midi:ctrl 95]",0.5, 0, 1, 0.025)*scaledamp*origSR/ma.SR; combfeed = vslider("RoomSize[midi:ctrl 12]", 0.7, 0, 1, 0.025)*scaleroom*origSR/ma.SR + offsetroom; spatSpread = vslider("Stereo[midi:ctrl 90]",0.6,0,1,0.01)*46*ma.SR/origSR; g = vslider("dryWetReverb[midi:ctrl 91]", 0.4, 0, 1, 0.001); }; dry_wet(dw,x,y) = wet*y + dry*x with { wet = 0.5*(dw+1.0); dry = 1.0-wet; }; effect = _ *(volFX) : ef.cubicnl_nodc(drive, 0.1) : flanger : panno : reverb; process = wfosc(gFreq) * vol;
45d8219f7d529b0e681927923a8f5757b13d8a505cd2d1bb71efa3e5d71dffcf
johannphilippe/paw2022
beat_looper.dsp
import("stdfaust.lib"); amp = hslider("amp", 0.2, 0, 1, 0.01); speed = hslider("speed", 0.2, 0.1, 2, 0.01) : si.smoo; noise_amt = hslider("noise_amount", 1, 1, 4, 0.1) : si.smoo; naive_impl(fq) = (_, ma.SR/fq : fmod) ~+(1.0) : <=(1.0); accent(modulo, beat) = _~+( is ) : %(modulo) : ==(0) : &(is) with { is = beat > beat'; }; phasor_impl(fq, phase) = incr/smps with { incr = _~+(1.0) : +(offset) : _, smps : fmod; offset = (1.0 - phase) * smps; smps = ma.SR/fq; }; phasor(fq) = phasor_impl(fq, 0); phasor_ph(fq, phase) = phasor_impl(fq, phase); metro_impl(fq, phase) = incr<=1.0 with { offset = (1.0-phase) * smps; incr = _~+(1.0) : +(offset) : _,smps : fmod; smps = ma.SR/fq; }; metro(fq) = metro_impl(fq, 0); metro_swing(fq, swing) = metro_impl(fq,0) | metro_impl(fq, swing); drunk_metro_acc(fq, noise_amt) = bt, acc with { trig = metro(fq)|(fq!=fq')|os.impulse; frq = fq + (no.noise * noise_amt) : ba.sAndH(trig); bt = metro(frq); acc_mod = int(abs(no.noise*noise_amt))+1; acc = accent(acc_mod, bt); }; euclidian(onset, div, pulses, rotation, phasor) = (euclid' != euclid) & (phase' != phase) with { phase = ((phasor + rotation) * div), 1.0 : / : *(pulses) : int; euclid = int((onset/pulses) * phase); }; ph = phasor(speed); beat_looper(SIZE, record, read_speed) = looper : *(read_cond) with { looper = rwtable(SIZE, 0.0, recindex, _, readindex); recindex = (+(1) : %(SIZE)) ~ *(record); read_cond = read_speed>0; readindex = read_speed/float(ma.SR) : (+ : ma.frac) ~ _ : *(float(SIZE)) : int : *(read_cond); }; origin_beat = euclidian(3, 3, 5, 0, ph) with { ph = phasor(speed); }; rec = checkbox("record"); rspeed = hslider("read_speed", 0, 0, 4, 0.01) : si.smoo; loop = origin_beat : beat_looper(48000*5, rec, rspeed); env1 = origin_beat : en.ar(0,0.3); env2 = loop : en.ar(0,0.3); process = os.sawtooth(100) * amp * env1, os.sawtooth(150) * amp * env2;
https://raw.githubusercontent.com/johannphilippe/paw2022/d9b921a44e72bab11e457a13a1b43a4eabca53df/examples/beat_looper.dsp
faust
import("stdfaust.lib"); amp = hslider("amp", 0.2, 0, 1, 0.01); speed = hslider("speed", 0.2, 0.1, 2, 0.01) : si.smoo; noise_amt = hslider("noise_amount", 1, 1, 4, 0.1) : si.smoo; naive_impl(fq) = (_, ma.SR/fq : fmod) ~+(1.0) : <=(1.0); accent(modulo, beat) = _~+( is ) : %(modulo) : ==(0) : &(is) with { is = beat > beat'; }; phasor_impl(fq, phase) = incr/smps with { incr = _~+(1.0) : +(offset) : _, smps : fmod; offset = (1.0 - phase) * smps; smps = ma.SR/fq; }; phasor(fq) = phasor_impl(fq, 0); phasor_ph(fq, phase) = phasor_impl(fq, phase); metro_impl(fq, phase) = incr<=1.0 with { offset = (1.0-phase) * smps; incr = _~+(1.0) : +(offset) : _,smps : fmod; smps = ma.SR/fq; }; metro(fq) = metro_impl(fq, 0); metro_swing(fq, swing) = metro_impl(fq,0) | metro_impl(fq, swing); drunk_metro_acc(fq, noise_amt) = bt, acc with { trig = metro(fq)|(fq!=fq')|os.impulse; frq = fq + (no.noise * noise_amt) : ba.sAndH(trig); bt = metro(frq); acc_mod = int(abs(no.noise*noise_amt))+1; acc = accent(acc_mod, bt); }; euclidian(onset, div, pulses, rotation, phasor) = (euclid' != euclid) & (phase' != phase) with { phase = ((phasor + rotation) * div), 1.0 : / : *(pulses) : int; euclid = int((onset/pulses) * phase); }; ph = phasor(speed); beat_looper(SIZE, record, read_speed) = looper : *(read_cond) with { looper = rwtable(SIZE, 0.0, recindex, _, readindex); recindex = (+(1) : %(SIZE)) ~ *(record); read_cond = read_speed>0; readindex = read_speed/float(ma.SR) : (+ : ma.frac) ~ _ : *(float(SIZE)) : int : *(read_cond); }; origin_beat = euclidian(3, 3, 5, 0, ph) with { ph = phasor(speed); }; rec = checkbox("record"); rspeed = hslider("read_speed", 0, 0, 4, 0.01) : si.smoo; loop = origin_beat : beat_looper(48000*5, rec, rspeed); env1 = origin_beat : en.ar(0,0.3); env2 = loop : en.ar(0,0.3); process = os.sawtooth(100) * amp * env1, os.sawtooth(150) * amp * env2;
ea77d6c75e5338c8460e582d0da71bdca423c52e844f942752d5d621c6105448
johannphilippe/grame_cnsmd_2023
feedback_integrator_network.dsp
import("stdfaust.lib"); // Faust matrix N_VOICES = 8; // (x - _) * G + _) ~ (_ <: si.bus(4)) : ! , _ // output path feedback_integrator_network(nvoice) = _ : snd :> _,_ //~+(_<:si.bus(nvoice)) : (snd)) :> _,_ with { noise_mult = 1000; nz = no.multinoise(nvoice*nvoice); trig = ba.beat(60); noise(x, y) = no.noises(nvoice*nvoice, y + (x*nvoice)) : ba.sAndH(trig+os.impulse) : *(noise_mult); voice(x, sig) =( sig+_ : fi.pole(0.99) : *(sum(y, nvoice, noise(x,y))) : fi.dcblocker : aa.clip(-1, 1))~_; //snd = par(x, nvoice, _ : fi.pole(0.99) : *(sum(y, nvoice, noise(x,y))) : fi.dcblocker : aa.clip(-1, 1)) ; snd = _ <: par(x, nvoice, _ : (voice(x))) ; }; amp = hslider("amp", 0.1, 0, 1, 0.01) : si.smoo; rndosc = os.square(hslider("freq", 100, 50, 1000, 1) * (ba.beat(120) : en.are(0, 10))) * hslider("oscamp", 0, 0, 1, 0.01); process = os.impulse+rndosc : feedback_integrator_network(4) : _*(0.1 * amp), _*(0.1*amp);
https://raw.githubusercontent.com/johannphilippe/grame_cnsmd_2023/81d22fea093c46d2436874513d74a43d42212ce9/feedback_integrator_network__ne_fonctionne_pas_encore/feedback_integrator_network.dsp
faust
Faust matrix (x - _) * G + _) ~ (_ <: si.bus(4)) : ! , _ // output path ~+(_<:si.bus(nvoice)) : (snd)) :> _,_ snd = par(x, nvoice, _ : fi.pole(0.99) : *(sum(y, nvoice, noise(x,y))) : fi.dcblocker : aa.clip(-1, 1)) ;
import("stdfaust.lib"); N_VOICES = 8; feedback_integrator_network(nvoice) = _ : snd :> _,_ with { noise_mult = 1000; nz = no.multinoise(nvoice*nvoice); trig = ba.beat(60); noise(x, y) = no.noises(nvoice*nvoice, y + (x*nvoice)) : ba.sAndH(trig+os.impulse) : *(noise_mult); voice(x, sig) =( sig+_ : fi.pole(0.99) : *(sum(y, nvoice, noise(x,y))) : fi.dcblocker : aa.clip(-1, 1))~_; snd = _ <: par(x, nvoice, _ : (voice(x))) ; }; amp = hslider("amp", 0.1, 0, 1, 0.01) : si.smoo; rndosc = os.square(hslider("freq", 100, 50, 1000, 1) * (ba.beat(120) : en.are(0, 10))) * hslider("oscamp", 0, 0, 1, 0.01); process = os.impulse+rndosc : feedback_integrator_network(4) : _*(0.1 * amp), _*(0.1*amp);
6b8fb520b175954a646d2ffe465fc562baf9b21f934d464995b731ae0bcd281f
johannphilippe/grame_cnsmd_2023
feedback_integrator_network2.dsp
import("stdfaust.lib"); // Faust matrix // (x - _) * G + _) ~ (_ <: si.bus(4)) : ! , _ // output path feedback_integrator_network(nvoice) = par(x, nvoice, sum(y, nvoice, leaky_integrator : *(noise(x, y))) : post_processing) ~(si.bus(nvoice)) :> _,_ with { noise_mult = 1000; noise(x, y) = no.noises(nvoice * nvoice, y + (x * nvoice)) : ba.sAndH(os.impulse) : *(noise_mult); leaky_integrator = fi.pole(0.99); post_processing = fi.dcblocker : aa.clip(-1, 1); }; // chaque sortie est le résultat d'une somme des entrées * leurs volumes /* feedback_integrator_network(nvoice) = par(x, nvoice, _ : fi.pole(0.99) : *(sum(y, nvoice, noise(x, y))) : fi.dcblocker : aa.clip(-1, 1)) :> _,_ with { noise_mult = 1000; noise(x, y) = no.noises(nvoice*nvoice, y + (x*nvoice)) : ba.sAndH(os.impulse) : *(noise_mult); }; */ amp = hslider("amp", 0.1, 0, 1, 0.01) : si.smoo; rndosc = os.square(hslider("freq", 100, 50, 1000, 1) * (ba.beat(120) : en.are(0, 10))) * hslider("oscamp", 0, 0, 1, 0.01); process = os.impulse <: feedback_integrator_network(4) : _*(0.1 * amp), _*(0.1*amp);
https://raw.githubusercontent.com/johannphilippe/grame_cnsmd_2023/81d22fea093c46d2436874513d74a43d42212ce9/feedback_integrator_network__ne_fonctionne_pas_encore/feedback_integrator_network2.dsp
faust
Faust matrix (x - _) * G + _) ~ (_ <: si.bus(4)) : ! , _ // output path chaque sortie est le résultat d'une somme des entrées * leurs volumes feedback_integrator_network(nvoice) = par(x, nvoice, _ : fi.pole(0.99) : *(sum(y, nvoice, noise(x, y))) : fi.dcblocker : aa.clip(-1, 1)) :> _,_ with { noise_mult = 1000; noise(x, y) = no.noises(nvoice*nvoice, y + (x*nvoice)) : ba.sAndH(os.impulse) : *(noise_mult); };
import("stdfaust.lib"); feedback_integrator_network(nvoice) = par(x, nvoice, sum(y, nvoice, leaky_integrator : *(noise(x, y))) : post_processing) ~(si.bus(nvoice)) :> _,_ with { noise_mult = 1000; noise(x, y) = no.noises(nvoice * nvoice, y + (x * nvoice)) : ba.sAndH(os.impulse) : *(noise_mult); leaky_integrator = fi.pole(0.99); post_processing = fi.dcblocker : aa.clip(-1, 1); }; amp = hslider("amp", 0.1, 0, 1, 0.01) : si.smoo; rndosc = os.square(hslider("freq", 100, 50, 1000, 1) * (ba.beat(120) : en.are(0, 10))) * hslider("oscamp", 0, 0, 1, 0.01); process = os.impulse <: feedback_integrator_network(4) : _*(0.1 * amp), _*(0.1*amp);
9d5969376a4764adec9121f3bd1971fed27771e47f2d66d045015b90032fadbe
johannphilippe/grame_cnsmd_2023
feedback_integrator_network3.dsp
import("stdfaust.lib"); // Faust matrix // (x - _) * G + _) ~ (_ <: si.bus(4)) : ! , _ // output path feedback_integrator_network(nvoice) = par(x, nvoice, sum(y, nvoice, leaky_integrator : *(noise(x, y))) : post_processing) ~(si.bus(nvoice)) with { noise_mult = 1000; noise(x, y) = no.noises(nvoice * nvoice, y + (x * nvoice)) : ba.sAndH(os.impulse) : *(noise_mult); leaky_integrator = fi.pole(0.99); post_processing = fi.dcblocker : aa.clip(-1, 1); }; // chaque sortie est le résultat d'une somme des entrées * leurs volumes /* feedback_integrator_network(nvoice) = par(x, nvoice, _ : fi.pole(0.99) : *(sum(y, nvoice, noise(x, y))) : fi.dcblocker : aa.clip(-1, 1)) :> _,_ with { noise_mult = 1000; noise(x, y) = no.noises(nvoice*nvoice, y + (x*nvoice)) : ba.sAndH(os.impulse) : *(noise_mult); }; */ amp = hslider("amp", 0.1, 0, 1, 0.01) : si.smoo; rndosc = os.square(hslider("freq", 100, 50, 1000, 1) * (ba.beat(120) : en.are(0, 10))) * hslider("oscamp", 0, 0, 1, 0.01); process = os.impulse <: feedback_integrator_network(4) :> _*(0.1 * amp), _*(0.1*amp);
https://raw.githubusercontent.com/johannphilippe/grame_cnsmd_2023/81d22fea093c46d2436874513d74a43d42212ce9/feedback_integrator_network__ne_fonctionne_pas_encore/feedback_integrator_network3.dsp
faust
Faust matrix (x - _) * G + _) ~ (_ <: si.bus(4)) : ! , _ // output path chaque sortie est le résultat d'une somme des entrées * leurs volumes feedback_integrator_network(nvoice) = par(x, nvoice, _ : fi.pole(0.99) : *(sum(y, nvoice, noise(x, y))) : fi.dcblocker : aa.clip(-1, 1)) :> _,_ with { noise_mult = 1000; noise(x, y) = no.noises(nvoice*nvoice, y + (x*nvoice)) : ba.sAndH(os.impulse) : *(noise_mult); };
import("stdfaust.lib"); feedback_integrator_network(nvoice) = par(x, nvoice, sum(y, nvoice, leaky_integrator : *(noise(x, y))) : post_processing) ~(si.bus(nvoice)) with { noise_mult = 1000; noise(x, y) = no.noises(nvoice * nvoice, y + (x * nvoice)) : ba.sAndH(os.impulse) : *(noise_mult); leaky_integrator = fi.pole(0.99); post_processing = fi.dcblocker : aa.clip(-1, 1); }; amp = hslider("amp", 0.1, 0, 1, 0.01) : si.smoo; rndosc = os.square(hslider("freq", 100, 50, 1000, 1) * (ba.beat(120) : en.are(0, 10))) * hslider("oscamp", 0, 0, 1, 0.01); process = os.impulse <: feedback_integrator_network(4) :> _*(0.1 * amp), _*(0.1*amp);
a182bb44223c8174dba10d78369fc0fd7a8464b2acaf1acddd485d7d63fea15c
johannphilippe/grame_cnsmd_2023
ixa_ext_mod.dsp
import("stdfaust.lib"); round(sig) = floor(sig), ceil(sig) : select2( (sig -floor(sig)) > 0.5 ); wavefolder(sig) = 4 * (abs(0.25 * sig + 0.25 - round(0.25 * sig + 0.25))-0.25); pulse(x, t) = 0, 1 :select2( t >= (x*0.5) & t < x ); weird_wave(t) = (2 * pulse(0.5, t) - 1)*sin( 2*ma.PI * fmod(t, 0.5)) + 2 * pulse(0.5, t + 0.25) + 2 * pulse(1, t + 0.5) + 0.5; tri(t) = t, 2-t, t-4 : select3( (t > 1) + (t > 3) ); ixa_modulator(r, t) = sin(2*ma.PI*r*t); ixa(n, r, t) = tri(weird_wave(t)+n*sin(2*ma.PI*r*t)) : wavefolder; ixa_ext_mod(n, t, mod) = tri(weird_wave(t) + n * mod) : wavefolder; freq = hslider("frequency", 100, 50, 1000, 1); amp = hslider("amp", 0.1, 0, 1, 0.01) : si.smoo; index = hslider("index", 0, 0, 10, 0.001) : si.smoo; ratio = hslider("ratio", 1, 1, 10, 0.01) : si.smoo; osc = os.osc(freq); mod_fq = hslider("mod_fq", 1, 1, 100, 1); mod_index = hslider("mod_index", 1, 0, 10,0.01 ); // process = ixa_ext_mod(index, os.phasor(1, freq), ixa( mod_index, ratio, os.phasor(1, mod_fq))) * amp; //ixa( 0, ratio,os.phasor(1, freq)) * amp;
https://raw.githubusercontent.com/johannphilippe/grame_cnsmd_2023/cf7a34a36c456eef87963c584384296c8c441a27/ixa/ixa_ext_mod.dsp
faust
ixa( 0, ratio,os.phasor(1, freq)) * amp;
import("stdfaust.lib"); round(sig) = floor(sig), ceil(sig) : select2( (sig -floor(sig)) > 0.5 ); wavefolder(sig) = 4 * (abs(0.25 * sig + 0.25 - round(0.25 * sig + 0.25))-0.25); pulse(x, t) = 0, 1 :select2( t >= (x*0.5) & t < x ); weird_wave(t) = (2 * pulse(0.5, t) - 1)*sin( 2*ma.PI * fmod(t, 0.5)) + 2 * pulse(0.5, t + 0.25) + 2 * pulse(1, t + 0.5) + 0.5; tri(t) = t, 2-t, t-4 : select3( (t > 1) + (t > 3) ); ixa_modulator(r, t) = sin(2*ma.PI*r*t); ixa(n, r, t) = tri(weird_wave(t)+n*sin(2*ma.PI*r*t)) : wavefolder; ixa_ext_mod(n, t, mod) = tri(weird_wave(t) + n * mod) : wavefolder; freq = hslider("frequency", 100, 50, 1000, 1); amp = hslider("amp", 0.1, 0, 1, 0.01) : si.smoo; index = hslider("index", 0, 0, 10, 0.001) : si.smoo; ratio = hslider("ratio", 1, 1, 10, 0.01) : si.smoo; osc = os.osc(freq); mod_fq = hslider("mod_fq", 1, 1, 100, 1); mod_index = hslider("mod_index", 1, 0, 10,0.01 );
40b01455e92efa010e0dbe683b97b0399bd69dcbcbcf0c29cff68da6d47723ba
johannphilippe/grame_cnsmd_2023
fm_am.dsp
import("stdfaust.lib"); wave_oscil(freq, index) = vgroup("Modulator", mix) with { saw_amt = hslider("saw_amount_%index", 0, 0, 1, 0.01) : si.smoo; saw = os.sawtooth(freq) * saw_amt; sine_amt = hslider("sine_amount_%index", 1, 0, 1, 0.01) : si.smoo; sine = os.sawtooth(freq) * sine_amt; square_amt = hslider("square_amount_%index", 0, 0, 1, 0.01) : si.smoo; square = os.sawtooth(freq) * square_amt; mix = (saw + sine + square); }; fm_freq = hslider("fm_frequency", 0.1, 0.1, 1000, 0.01); fm_amount = hslider("fm_amount", 0, 0, 1, 0.01); fm_mod = vgroup("FM_frequency modulation", wave_oscil(fm_freq, 1) : *(fm_amount)); am_freq = hslider("am_frequency", 0.1, 0.1, 1000, 0.01); am_amp = hslider("am_amplitude", 0, 0, 1, 0.01); am_mod = vgroup("AM Amplitude modulation", wave_oscil(am_freq, 2) : *(0.5) : + (0.5) : *(am_amp)); amp = hslider("amplitude", 0.1, 0, 1, 0.01) : si.smoo; carrier_freq = hslider("carrier_frequency", 100, 50, 1000, 1); carrier = os.osc(carrier_freq + (fm_mod*carrier_freq+1) ) * am_mod; process = carrier * amp;
https://raw.githubusercontent.com/johannphilippe/grame_cnsmd_2023/ccfd6e9a5c1537097546520317c8c5beea06006f/fm/fm_am.dsp
faust
import("stdfaust.lib"); wave_oscil(freq, index) = vgroup("Modulator", mix) with { saw_amt = hslider("saw_amount_%index", 0, 0, 1, 0.01) : si.smoo; saw = os.sawtooth(freq) * saw_amt; sine_amt = hslider("sine_amount_%index", 1, 0, 1, 0.01) : si.smoo; sine = os.sawtooth(freq) * sine_amt; square_amt = hslider("square_amount_%index", 0, 0, 1, 0.01) : si.smoo; square = os.sawtooth(freq) * square_amt; mix = (saw + sine + square); }; fm_freq = hslider("fm_frequency", 0.1, 0.1, 1000, 0.01); fm_amount = hslider("fm_amount", 0, 0, 1, 0.01); fm_mod = vgroup("FM_frequency modulation", wave_oscil(fm_freq, 1) : *(fm_amount)); am_freq = hslider("am_frequency", 0.1, 0.1, 1000, 0.01); am_amp = hslider("am_amplitude", 0, 0, 1, 0.01); am_mod = vgroup("AM Amplitude modulation", wave_oscil(am_freq, 2) : *(0.5) : + (0.5) : *(am_amp)); amp = hslider("amplitude", 0.1, 0, 1, 0.01) : si.smoo; carrier_freq = hslider("carrier_frequency", 100, 50, 1000, 1); carrier = os.osc(carrier_freq + (fm_mod*carrier_freq+1) ) * am_mod; process = carrier * amp;
0d1d64a8205f14e5b735fd9bacda65c461816a58c2661dc71755e7339430e433
johannphilippe/grame_cnsmd_2023
wah.dsp
import("stdfaust.lib"); range(vmin, vmax, sig) = res with { low = vmin, sig : select2(sig >= vmin) ; res = vmax, low : select2(low <= vmax); }; /* Returns 0 if below th. */ threshold(th, sig) = sig, 0 : select2(sig <= th); /* Capture movement on a signal - outputs signal between 0 and 1 */ capture_mov(th, release_time, sig) = res letrec { 'diff = abs(sig' - sig); 'threshed = diff : threshold(th); 'inc = threshed; 'is_moving = threshed != 0; 'dec = (res / (release_time * ma.SR)) : *(-1);// : ba.sAndH(is_moving); 'mv = dec, inc : select2(is_moving); 'res = (_:range(0,1))~+(mv):range(0,1); }; amp = hslider("amp", 0.3, 0, 1, 0.01); freq = hslider("freq[knob:2]", 80, 80, 800, 0.1) : si.smoo; wah = hslider("wah[acc: 1 0 -10 0 10]", 0, 0, 1, 0.001) : si.smoo; mix_noise = hslider("mix[acc: 0 0 -10 0 10]", 0, 0, 1, 0.001) : si.smoo; drive = hslider("drive[acc: 2 3 -10 0 10]",0,0,1,0.01) : si.smoo; distortion = ef.cubicnl(drive,0); mov = wah : capture_mov(0.0001, 0.5); s1 = os.sawtooth(freq) : distortion * 0.8; s2 = os.sawtooth(freq+(freq*no.noise)) : distortion * 0.8; sig = (s1 * mix_noise) + (s2 * (1 - mix_noise)); synt = sig * mov : ve.crybaby(wah); process = synt * amp;
https://raw.githubusercontent.com/johannphilippe/grame_cnsmd_2023/cf7a34a36c456eef87963c584384296c8c441a27/complex_stuff/wah.dsp
faust
Returns 0 if below th. Capture movement on a signal - outputs signal between 0 and 1 : ba.sAndH(is_moving);
import("stdfaust.lib"); range(vmin, vmax, sig) = res with { low = vmin, sig : select2(sig >= vmin) ; res = vmax, low : select2(low <= vmax); }; threshold(th, sig) = sig, 0 : select2(sig <= th); capture_mov(th, release_time, sig) = res letrec { 'diff = abs(sig' - sig); 'threshed = diff : threshold(th); 'inc = threshed; 'is_moving = threshed != 0; 'mv = dec, inc : select2(is_moving); 'res = (_:range(0,1))~+(mv):range(0,1); }; amp = hslider("amp", 0.3, 0, 1, 0.01); freq = hslider("freq[knob:2]", 80, 80, 800, 0.1) : si.smoo; wah = hslider("wah[acc: 1 0 -10 0 10]", 0, 0, 1, 0.001) : si.smoo; mix_noise = hslider("mix[acc: 0 0 -10 0 10]", 0, 0, 1, 0.001) : si.smoo; drive = hslider("drive[acc: 2 3 -10 0 10]",0,0,1,0.01) : si.smoo; distortion = ef.cubicnl(drive,0); mov = wah : capture_mov(0.0001, 0.5); s1 = os.sawtooth(freq) : distortion * 0.8; s2 = os.sawtooth(freq+(freq*no.noise)) : distortion * 0.8; sig = (s1 * mix_noise) + (s2 * (1 - mix_noise)); synt = sig * mov : ve.crybaby(wah); process = synt * amp;
47a477f82abb77f64294f9ded9ee277959fe3b609a1ed29d6a7fb067ca32aca9
johannphilippe/hypercurve
prototype2.dsp
import("stdfaust.lib"); // MVCE diocles_curve(A, x) = process_diocles(x) * COMPENSATION with { process_diocles(x) = sqrt( (x*x*x) / (2 * A - x) ); COMPENSATION = 1.0 / process_diocles(1.0); }; cubic_curve(x) = process_cubic(x) * COMPENSATION with { process_cubic(x) = x*x*x; COMPENSATION = 1.0 / process_cubic(1.0); }; linear(x) = x; segment(frac, y_dest, algo, y_start, rel_x) = environment { abs_diff = abs(y_start - y_dest); offset = min(y_start, y_dest); scaled = (rel_x) , (1.0 - rel_x) : select2(y_start > y_dest) : algo : *(abs_diff) : +(offset) ; res = scaled; }; hypercurve(def, y_start_, seg_list, phas) = ba.tabulate(1, proc, def, 0, 1, phas).lin with { seg_count = ba.count(seg_list); // fractional_list(indx) = seg_count, gen_frac, indx : rdtable; // additional_frac_list(indx) = seg_count, gen_additional, indx : rdtable; // gen_frac(size) = ba.take(ba.time, seg_list).frac; // gen_additional(size) = sum(n, ba.time, fractional_list); fractional_list = par(n, seg_count, (seg_list : ba.selectn(seg_count,n).frac ) ); real_frac_list = par(n, seg_count, rint( seg_list : ba.selectn(seg_count, n).frac) ); additional_frac_list = par(n, seg_count, do_the_sum) with { do_the_sum(n) = sum(nn, n + 1, fractional_list : ba.selectn(seg_count, nn)); }; crossed_one(x) = 0, 1 : select2(sum_all > 0) with { sum_all = sum(n, seg_count, fc(n)); fc(n) = (x' < comp) && (x >= comp) with { comp = additional_frac_list : ba.selectn(seg_count, n ); }; }; proc(x) = which with { cur_seg_idx = ba.counter(crossed_one(x)); /* cur_frac = fractional_list : ba.selectn(seg_count, cur_seg_idx); current_seg_factor = 1.0 / cur_frac; to_deduce = additional_frac_list : ba.selectn(seg_count, cur_seg_idx ); x_deduced = (x - to_deduce); calc_x = x_deduced * current_seg_factor; cur_seg = seg_list : ba.selectn( seg_count,cur_seg_idx + 1); y_start = y_start_, old_dest : select2(cur_seg_idx > 0) with { old_dest = seg_list : ba.selectn(seg_count, cur_seg_idx).y_dest; }; which = y_start, calc_x : cur_seg; */ which = cur_seg_idx; }; }; hc = os.phasor(1, 0.5) : hypercurve(4096, 0, (segment(0.5, 1, cubic_curve), segment(0.5, 0, cubic_curve) )); process = os.osc(150) * 0.1 * hc;
https://raw.githubusercontent.com/johannphilippe/hypercurve/79e9ad752e99a884fdd3c230c6ec818a7873f081/faust_lib/prototype_pure_faust/prototype2.dsp
faust
MVCE fractional_list(indx) = seg_count, gen_frac, indx : rdtable; additional_frac_list(indx) = seg_count, gen_additional, indx : rdtable; gen_frac(size) = ba.take(ba.time, seg_list).frac; gen_additional(size) = sum(n, ba.time, fractional_list); cur_frac = fractional_list : ba.selectn(seg_count, cur_seg_idx); current_seg_factor = 1.0 / cur_frac; to_deduce = additional_frac_list : ba.selectn(seg_count, cur_seg_idx ); x_deduced = (x - to_deduce); calc_x = x_deduced * current_seg_factor; cur_seg = seg_list : ba.selectn( seg_count,cur_seg_idx + 1); y_start = y_start_, old_dest : select2(cur_seg_idx > 0) with { old_dest = seg_list : ba.selectn(seg_count, cur_seg_idx).y_dest; }; which = y_start, calc_x : cur_seg;
import("stdfaust.lib"); diocles_curve(A, x) = process_diocles(x) * COMPENSATION with { process_diocles(x) = sqrt( (x*x*x) / (2 * A - x) ); COMPENSATION = 1.0 / process_diocles(1.0); }; cubic_curve(x) = process_cubic(x) * COMPENSATION with { process_cubic(x) = x*x*x; COMPENSATION = 1.0 / process_cubic(1.0); }; linear(x) = x; segment(frac, y_dest, algo, y_start, rel_x) = environment { abs_diff = abs(y_start - y_dest); offset = min(y_start, y_dest); scaled = (rel_x) , (1.0 - rel_x) : select2(y_start > y_dest) : algo : *(abs_diff) : +(offset) ; res = scaled; }; hypercurve(def, y_start_, seg_list, phas) = ba.tabulate(1, proc, def, 0, 1, phas).lin with { seg_count = ba.count(seg_list); fractional_list = par(n, seg_count, (seg_list : ba.selectn(seg_count,n).frac ) ); real_frac_list = par(n, seg_count, rint( seg_list : ba.selectn(seg_count, n).frac) ); additional_frac_list = par(n, seg_count, do_the_sum) with { do_the_sum(n) = sum(nn, n + 1, fractional_list : ba.selectn(seg_count, nn)); }; crossed_one(x) = 0, 1 : select2(sum_all > 0) with { sum_all = sum(n, seg_count, fc(n)); fc(n) = (x' < comp) && (x >= comp) with { comp = additional_frac_list : ba.selectn(seg_count, n ); }; }; proc(x) = which with { cur_seg_idx = ba.counter(crossed_one(x)); which = cur_seg_idx; }; }; hc = os.phasor(1, 0.5) : hypercurve(4096, 0, (segment(0.5, 1, cubic_curve), segment(0.5, 0, cubic_curve) )); process = os.osc(150) * 0.1 * hc;
c57e6c86f4dc3fe9844fc0a5e6b83fcc492303513b550ce9d1f9c0547b88f98c
johannphilippe/grame_cnsmd_2023
lib.dsp
/* Quelques fonctions utiles que j'ai fabriquées */ import("stdfaust.lib"); round(sig) = floor(sig), ceil(sig) : select2( (sig -floor(sig)) > 0.5 ); /* Impulsion with a specified duration. Can be retriggered. */ mpulse(smps_dur, trig) = pulsation with { count = ba.countdown(smps_dur, trig); //count = -(1)~_, smps_dur : select2(trig); pulsation = 0, 1 : select2(count > 0); }; mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig); /* Euclidian function. Generates an euclidian rythm with 0;1 triggers */ euclidian(onset, div, pulses, rotation, phasor) = (eucval' != eucval) & (kph' != kph) with { kph = int( (( (phasor + rotation) * div) % 1) * pulses); eucval = int((onset / pulses) * kph); }; dur_smps_euclidian(onset, div, pulses, rotation, smps_dur, phasor) = euclidian(onset, div, pulses, rotation, phasor) : mpulse(smps_dur); /* Wavefolder. */ wavefolder(sig) = 4 * (abs(0.25 * sig + 0.25 - round(0.25 * sig + 0.25))-0.25) /* Limit to range */ range(vmin, vmax, sig) = res with { low = vmin, sig : select2(sig >= vmin) ; res = vmax, low : select2(low <= vmax); }; /* Returns 0 if below th. */ threshold(th, sig) = sig, 0 : select2(sig <= th); /* Capture movement on a signal - outputs signal between 0 and 1 */ capture_mov(th, release_time, sig) = res letrec { 'diff = abs(sig' - sig); 'threshed = diff : threshold(th); 'inc = threshed; 'is_moving = threshed > 0; 'dec = (res / (release_time * ma.SR)) : *(-1) : ba.sAndH(is_moving); 'mv = dec, inc : select2(is_moving); 'res = (_:range(0,1))~+(mv); }; /* Linear interpolation of a signal */ line(time, sig) = res letrec { 'changed = (sig' != sig) | (time' != time); 'steps = ma.SR * time; 'cntup = ba.countup(steps ,changed); 'diff = ( sig - res); 'inc = diff / steps : ba.sAndH(changed); 'res = res, res + inc : select2(cntup < steps); };
https://raw.githubusercontent.com/johannphilippe/grame_cnsmd_2023/cf7a34a36c456eef87963c584384296c8c441a27/lib.dsp
faust
Quelques fonctions utiles que j'ai fabriquées Impulsion with a specified duration. Can be retriggered. count = -(1)~_, smps_dur : select2(trig); Euclidian function. Generates an euclidian rythm with 0;1 triggers Wavefolder. Limit to range Returns 0 if below th. Capture movement on a signal - outputs signal between 0 and 1 Linear interpolation of a signal
import("stdfaust.lib"); round(sig) = floor(sig), ceil(sig) : select2( (sig -floor(sig)) > 0.5 ); mpulse(smps_dur, trig) = pulsation with { count = ba.countdown(smps_dur, trig); pulsation = 0, 1 : select2(count > 0); }; mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig); euclidian(onset, div, pulses, rotation, phasor) = (eucval' != eucval) & (kph' != kph) with { kph = int( (( (phasor + rotation) * div) % 1) * pulses); eucval = int((onset / pulses) * kph); }; dur_smps_euclidian(onset, div, pulses, rotation, smps_dur, phasor) = euclidian(onset, div, pulses, rotation, phasor) : mpulse(smps_dur); wavefolder(sig) = 4 * (abs(0.25 * sig + 0.25 - round(0.25 * sig + 0.25))-0.25) range(vmin, vmax, sig) = res with { low = vmin, sig : select2(sig >= vmin) ; res = vmax, low : select2(low <= vmax); }; threshold(th, sig) = sig, 0 : select2(sig <= th); capture_mov(th, release_time, sig) = res letrec { 'diff = abs(sig' - sig); 'threshed = diff : threshold(th); 'inc = threshed; 'is_moving = threshed > 0; 'dec = (res / (release_time * ma.SR)) : *(-1) : ba.sAndH(is_moving); 'mv = dec, inc : select2(is_moving); 'res = (_:range(0,1))~+(mv); }; line(time, sig) = res letrec { 'changed = (sig' != sig) | (time' != time); 'steps = ma.SR * time; 'cntup = ba.countup(steps ,changed); 'diff = ( sig - res); 'inc = diff / steps : ba.sAndH(changed); 'res = res, res + inc : select2(cntup < steps); };
cd8b5907710335f1b2f29b833dab7f361ea636fe305f0ea8b8d427318e03cabb
johannphilippe/grame_cnsmd_2023
feedback_integrator_network4.dsp
import("stdfaust.lib"); // Faust matrix // (x - _) * G + _) ~ (_ <: si.bus(4)) : ! , _ // output path // Matrix // (x - _) * G + _) ~ (_ <: si.bus(4)) : ! , _ // output path matrix(nvoice) = par(in, nvoice, _) : (mix_with_recursion <: par(out, nvoice, mixer(nvoice, out)))~(si.bus(nvoice)) with { noise_mult = 1000; noise(x) = no.noises(nvoice * nvoice, x) : ba.sAndH(os.impulse|trig) : *(noise_mult); mixer(N, out) = par(in, N, _ : fi.pole(0.99) : *(noise(in)) : fi.dcblocker : aa.clip(-1, 1)) :> _; mix_with_recursion = par(in, nvoice*2, _) : ro.interleave(nvoice, nvoice/2) : par(in, nvoice, _+_); }; recmatrix(nvoice) = matrix(nvoice); /* Fader(in) = ba.db2linear(vslider("Input %in", -10, -96, 4, 0.1)); Mixer(N,out) = hgroup("Output %out", par(in, N, *(Fader(in)) ) :> _ ); Matrix(N,M) = tgroup("Matrix %N x %M", par(in, N, _) <: par(out, M, Mixer(N, out))); process = Matrix(8, 8); */ /*matrix(nvoice) = par(n, nvoice, _) <: par(n, nvoice*nvoice, _) : par(x,nvoice, sum(y, nvoice, _ : *(noise(x*nvoice+y)))) : (par(n, nvoice, _)) */ trig = (t > t') with { t = button("trigger"); }; feedback_integrator_network(nvoice) = par(n, nvoice, _) : sum(x, nvoice, par(y, nvoice, leaky_integrator : *(noise(x, y))) : post_processing) ~(si.bus(nvoice)) with { noise_mult = 1000; noise(x, y) = no.noises(nvoice * nvoice, y + (x * nvoice)) : ba.sAndH(os.impulse|trig) : *(noise_mult); leaky_integrator = fi.pole(0.99); post_processing = fi.dcblocker : aa.clip(-1, 1); }; // chaque sortie est le résultat d'une somme des entrées * leurs volumes /* feedback_integrator_network(nvoice) = par(x, nvoice, _ : fi.pole(0.99) : *(sum(y, nvoice, noise(x, y))) : fi.dcblocker : aa.clip(-1, 1)) :> _,_ with { noise_mult = 1000; noise(x, y) = no.noises(nvoice*nvoice, y + (x*nvoice)) : ba.sAndH(os.impulse) : *(noise_mult); }; */ amp = hslider("amp", 0.1, 0, 1, 0.01) : si.smoo; oscfreq = hslider("oscfreq", 100, 1, 400, 1); oscamp = hslider("oscamp", 0.1, 0, 1, 0.01) : si.smoo; osc = os.osc(oscfreq) * oscamp; input_trig = val with { t = button("input_trig"); tt = t > t'; val = no.noise : ba.sAndH(tt) : abs : *(2.99) : floor; }; sigs = os.osc(oscfreq) , os.sawtooth(oscfreq), os.square(oscfreq) : select3(input_trig) : *(oscamp); process = os.impulse + sigs <: recmatrix(4) :> _*(0.1 * amp), _*(0.1*amp);
https://raw.githubusercontent.com/johannphilippe/grame_cnsmd_2023/81d22fea093c46d2436874513d74a43d42212ce9/feedback_integrator_network__ne_fonctionne_pas_encore/feedback_integrator_network4.dsp
faust
Faust matrix (x - _) * G + _) ~ (_ <: si.bus(4)) : ! , _ // output path Matrix (x - _) * G + _) ~ (_ <: si.bus(4)) : ! , _ // output path Fader(in) = ba.db2linear(vslider("Input %in", -10, -96, 4, 0.1)); Mixer(N,out) = hgroup("Output %out", par(in, N, *(Fader(in)) ) :> _ ); Matrix(N,M) = tgroup("Matrix %N x %M", par(in, N, _) <: par(out, M, Mixer(N, out))); process = Matrix(8, 8); matrix(nvoice) = par(n, nvoice, _) <: par(n, nvoice*nvoice, _) : par(x,nvoice, sum(y, nvoice, _ : *(noise(x*nvoice+y)))) : (par(n, nvoice, _)) chaque sortie est le résultat d'une somme des entrées * leurs volumes feedback_integrator_network(nvoice) = par(x, nvoice, _ : fi.pole(0.99) : *(sum(y, nvoice, noise(x, y))) : fi.dcblocker : aa.clip(-1, 1)) :> _,_ with { noise_mult = 1000; noise(x, y) = no.noises(nvoice*nvoice, y + (x*nvoice)) : ba.sAndH(os.impulse) : *(noise_mult); };
import("stdfaust.lib"); matrix(nvoice) = par(in, nvoice, _) : (mix_with_recursion <: par(out, nvoice, mixer(nvoice, out)))~(si.bus(nvoice)) with { noise_mult = 1000; noise(x) = no.noises(nvoice * nvoice, x) : ba.sAndH(os.impulse|trig) : *(noise_mult); mixer(N, out) = par(in, N, _ : fi.pole(0.99) : *(noise(in)) : fi.dcblocker : aa.clip(-1, 1)) :> _; mix_with_recursion = par(in, nvoice*2, _) : ro.interleave(nvoice, nvoice/2) : par(in, nvoice, _+_); }; recmatrix(nvoice) = matrix(nvoice); trig = (t > t') with { t = button("trigger"); }; feedback_integrator_network(nvoice) = par(n, nvoice, _) : sum(x, nvoice, par(y, nvoice, leaky_integrator : *(noise(x, y))) : post_processing) ~(si.bus(nvoice)) with { noise_mult = 1000; noise(x, y) = no.noises(nvoice * nvoice, y + (x * nvoice)) : ba.sAndH(os.impulse|trig) : *(noise_mult); leaky_integrator = fi.pole(0.99); post_processing = fi.dcblocker : aa.clip(-1, 1); }; amp = hslider("amp", 0.1, 0, 1, 0.01) : si.smoo; oscfreq = hslider("oscfreq", 100, 1, 400, 1); oscamp = hslider("oscamp", 0.1, 0, 1, 0.01) : si.smoo; osc = os.osc(oscfreq) * oscamp; input_trig = val with { t = button("input_trig"); tt = t > t'; val = no.noise : ba.sAndH(tt) : abs : *(2.99) : floor; }; sigs = os.osc(oscfreq) , os.sawtooth(oscfreq), os.square(oscfreq) : select3(input_trig) : *(oscamp); process = os.impulse + sigs <: recmatrix(4) :> _*(0.1 * amp), _*(0.1*amp);
6ecafb8224c7b54f14aaed99910026a0764edbe63ad9dac07cbeb19962d21694
johannphilippe/grame_cnsmd_2023
additive_test.dsp
import("stdfaust.lib"); base_freq = hslider("base_freq", 100, 50, 1000, 0.1); partiels_distance = hslider("distance", 1, 1, 10, 1); N_PARTIELS = 10; oscil(freq, amp) = os.osc(freq) * amp; overall_amp = hslider("amp", 0.1, 0, 1, 0.001) : si.smoo; simple_additive = sum(n, N_PARTIELS, oscil(base_freq*(n+1)*partiels_distance, 1.0/(n+1))) : *(overall_amp); metro(fq) = metro_impl(fq, 0); metro_swing(fq, swing) = metro_impl(fq,0) | metro_impl(fq, swing); // Better implementation metro_impl(fq, phase) = incr<=1.0 with { offset = (1.0-phase) * smps; incr = _~+(1.0) : +(offset) : _,smps : fmod; smps = ma.SR/fq; }; drunk_metro(fq, noise_amount) = metro(freq) with { trig = metro(fq)|(fq!=fq')|os.impulse; freq = fq + (no.noise*noise_amount) : ba.sAndH(trig); }; line(time, sig) = res letrec { 'changed = (sig' != sig) | (time' != time); 'steps = ma.SR * time; 'cntup = ba.countup(steps ,changed); 'diff = ( sig - res); 'inc = diff / steps : ba.sAndH(changed); 'res = res, res + inc : select2(cntup < steps); }; random_lfo(freq_bef, mul, add, static_probability) = sig * mul + add with { mod = os.osc(freq_bef / 10) : *(0.5) : +(0.5001); freq = freq_bef - (mod * 0.1); dmetro = drunk_metro(freq, 0.8); dmetro_inc = no.noise : abs : *(100) : ba.sAndH(dmetro); dmetro_cond = dmetro_inc < static_probability; static = no.noise : abs : ba.sAndH(dmetro) : ^(4); noiz = no.noise : abs; beat = ba.beat(60 * freq); pick = noiz : ba.sAndH(beat); cycle_dur = 1.0 / freq; // in seconds cycle_dur_smps = cycle_dur * ma.SR; linear = line(cycle_dur, pick); quad = linear^4; sig = quad, static : select2(dmetro_cond); }; mpulse(smps_dur, trig) = pulsation with { count = ba.countdown(smps_dur, trig); //count = -(1)~_, smps_dur : select2(trig); pulsation = 0, 1 : select2(count > 0); }; mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig); free_oscil(bfreq, amp, speed) = os.osc(bfreq + random_lfo(bfreq/1000, bfreq, 0, 0)) : *(amp) : *(env) with { env = ba.beat(speed) : mpulse_dur(0.05) : en.are(0.05, 1); }; general_speed = hslider("speed", 60, 20, 200, 1); complex_additive = sum(n, N_PARTIELS, free_oscil(base_freq * ((n+1)*0.2) , 0.1, (n+1)*(general_speed) )) : *(overall_amp); process = complex_additive <: _,_ ;
https://raw.githubusercontent.com/johannphilippe/grame_cnsmd_2023/add61da4420da3947bc2bfbf42ade68f6369b1fe/additive/additive_test.dsp
faust
Better implementation in seconds count = -(1)~_, smps_dur : select2(trig);
import("stdfaust.lib"); base_freq = hslider("base_freq", 100, 50, 1000, 0.1); partiels_distance = hslider("distance", 1, 1, 10, 1); N_PARTIELS = 10; oscil(freq, amp) = os.osc(freq) * amp; overall_amp = hslider("amp", 0.1, 0, 1, 0.001) : si.smoo; simple_additive = sum(n, N_PARTIELS, oscil(base_freq*(n+1)*partiels_distance, 1.0/(n+1))) : *(overall_amp); metro(fq) = metro_impl(fq, 0); metro_swing(fq, swing) = metro_impl(fq,0) | metro_impl(fq, swing); metro_impl(fq, phase) = incr<=1.0 with { offset = (1.0-phase) * smps; incr = _~+(1.0) : +(offset) : _,smps : fmod; smps = ma.SR/fq; }; drunk_metro(fq, noise_amount) = metro(freq) with { trig = metro(fq)|(fq!=fq')|os.impulse; freq = fq + (no.noise*noise_amount) : ba.sAndH(trig); }; line(time, sig) = res letrec { 'changed = (sig' != sig) | (time' != time); 'steps = ma.SR * time; 'cntup = ba.countup(steps ,changed); 'diff = ( sig - res); 'inc = diff / steps : ba.sAndH(changed); 'res = res, res + inc : select2(cntup < steps); }; random_lfo(freq_bef, mul, add, static_probability) = sig * mul + add with { mod = os.osc(freq_bef / 10) : *(0.5) : +(0.5001); freq = freq_bef - (mod * 0.1); dmetro = drunk_metro(freq, 0.8); dmetro_inc = no.noise : abs : *(100) : ba.sAndH(dmetro); dmetro_cond = dmetro_inc < static_probability; static = no.noise : abs : ba.sAndH(dmetro) : ^(4); noiz = no.noise : abs; beat = ba.beat(60 * freq); pick = noiz : ba.sAndH(beat); cycle_dur_smps = cycle_dur * ma.SR; linear = line(cycle_dur, pick); quad = linear^4; sig = quad, static : select2(dmetro_cond); }; mpulse(smps_dur, trig) = pulsation with { count = ba.countdown(smps_dur, trig); pulsation = 0, 1 : select2(count > 0); }; mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig); free_oscil(bfreq, amp, speed) = os.osc(bfreq + random_lfo(bfreq/1000, bfreq, 0, 0)) : *(amp) : *(env) with { env = ba.beat(speed) : mpulse_dur(0.05) : en.are(0.05, 1); }; general_speed = hslider("speed", 60, 20, 200, 1); complex_additive = sum(n, N_PARTIELS, free_oscil(base_freq * ((n+1)*0.2) , 0.1, (n+1)*(general_speed) )) : *(overall_amp); process = complex_additive <: _,_ ;
7e5c45eccf0a35ebfdcfb1121268d674b51352787fbecef152b88967128702ac
johannphilippe/grame_cnsmd_2023
noisy_impulse_superstar2.dsp
import("stdfaust.lib"); freq = hslider("freq[acc: 2 1 -10 0 10]", 20, 20, 1000, 1) : si.smoo; //freq = hslider("freq[acc: 2 1 -10 0 10]", 0, 0, 1, 0.001) : *(1000) : +(20) : si.smoo; amp = hslider("amp", 0.5, 0, 1, 0.01) : si.smoo; speed = hslider("metrospeed[acc: 1 0 -10 0 10]", 2.0, 2.0, 20.0, 0.1) : si.smoo; //drunk = hslider("drunk[acc:2 0 -10 0 10]", 4, 0, 6, 0.1); drunk = speed/2.25; diocles(a, x) = sqrt(pow(x, 3.0)/(2*a-x)); phaser(r,d) = _<: _,de.fdelay((os.osc(r)*0.5*d+0.5)*800+500,1001):>_*0.5; beat(fq) = incr<=fq with { incr = (_,smps : fmod) ~ +(1.0); smps = ma.SR/fq; }; recdel(max_smps, smps, fb) = +~de.delay(max_smps,smps) * fb; // Can be mixed with dry signal mix_recdel(mix, max_smps, smps, fb, sig) = sig : recdel(max_smps, smps, fb) : _*mix + sig * (1 - mix); // Accentuation of one on several beats (simple counter and modulo) accent(modulo, beat) = _~+( beat > beat' ) : %(modulo) : ==(0); drunk_beat(fq, noise_amt) = beat(frq) with { trig = beat(fq)|(fq!=fq')|os.impulse; frq = fq + (no.noise * noise_amt) : ba.sAndH(trig); }; bt = drunk_beat(speed, drunk); env = bt: en.are(0, 0.3); MAXDEL = 8000; del = hslider("delay[knob:2]", 1000, 500, MAXDEL/2, 1); //del = int(abs(os.osc(0.01) * 5000 + 2000)); fb = hslider("feedback", 0.9, 0, 0.99, 0.01); range(vmin, vmax, sig) = res with { low = vmin, sig : select2(sig >= vmin) ; res = vmax, low : select2(low <= vmax); }; /* Returns 0 if below th. */ threshold(th, sig) = sig, 0 : select2(sig <= th); /* Capture movement on a signal - outputs signal between 0 and 1 */ capture_mov(th, release_time, sig) = res letrec { 'diff = abs(sig' - sig); 'threshed = diff : threshold(th); 'inc = threshed; 'is_moving = threshed > 0; 'dec = (res / (release_time * ma.SR)) : *(-1) : ba.sAndH(is_moving); 'mv = dec, inc : select2(is_moving); 'res = (_:range(0,1))~+(mv); }; mov = (freq+speed+delmod_amp) : capture_mov(0.05, 0.3); mod = os.osc(speed)*0.5+1.0; delmod_amp = hslider("delmod_amp[acc: 0 0 -10 0 10]", 0, 0, 1, 0.01); dmod = mod * del * delmod_amp; synt = os.sawtooth(freq+freq*mod) * env * mov : phaser(1, 0.5) : mix_recdel(0.3, MAXDEL, del+dmod, fb) : mix_recdel(0.2, MAXDEL, del*0.5+dmod, fb) : mix_recdel(0.2, MAXDEL, del*0.75+dmod, fb) : fi.dcblocker ; process = synt * amp;
https://raw.githubusercontent.com/johannphilippe/grame_cnsmd_2023/cf7a34a36c456eef87963c584384296c8c441a27/complex_stuff/noisy_impulse_superstar2.dsp
faust
freq = hslider("freq[acc: 2 1 -10 0 10]", 0, 0, 1, 0.001) : *(1000) : +(20) : si.smoo; drunk = hslider("drunk[acc:2 0 -10 0 10]", 4, 0, 6, 0.1); Can be mixed with dry signal Accentuation of one on several beats (simple counter and modulo) del = int(abs(os.osc(0.01) * 5000 + 2000)); Returns 0 if below th. Capture movement on a signal - outputs signal between 0 and 1
import("stdfaust.lib"); freq = hslider("freq[acc: 2 1 -10 0 10]", 20, 20, 1000, 1) : si.smoo; amp = hslider("amp", 0.5, 0, 1, 0.01) : si.smoo; speed = hslider("metrospeed[acc: 1 0 -10 0 10]", 2.0, 2.0, 20.0, 0.1) : si.smoo; drunk = speed/2.25; diocles(a, x) = sqrt(pow(x, 3.0)/(2*a-x)); phaser(r,d) = _<: _,de.fdelay((os.osc(r)*0.5*d+0.5)*800+500,1001):>_*0.5; beat(fq) = incr<=fq with { incr = (_,smps : fmod) ~ +(1.0); smps = ma.SR/fq; }; recdel(max_smps, smps, fb) = +~de.delay(max_smps,smps) * fb; mix_recdel(mix, max_smps, smps, fb, sig) = sig : recdel(max_smps, smps, fb) : _*mix + sig * (1 - mix); accent(modulo, beat) = _~+( beat > beat' ) : %(modulo) : ==(0); drunk_beat(fq, noise_amt) = beat(frq) with { trig = beat(fq)|(fq!=fq')|os.impulse; frq = fq + (no.noise * noise_amt) : ba.sAndH(trig); }; bt = drunk_beat(speed, drunk); env = bt: en.are(0, 0.3); MAXDEL = 8000; del = hslider("delay[knob:2]", 1000, 500, MAXDEL/2, 1); fb = hslider("feedback", 0.9, 0, 0.99, 0.01); range(vmin, vmax, sig) = res with { low = vmin, sig : select2(sig >= vmin) ; res = vmax, low : select2(low <= vmax); }; threshold(th, sig) = sig, 0 : select2(sig <= th); capture_mov(th, release_time, sig) = res letrec { 'diff = abs(sig' - sig); 'threshed = diff : threshold(th); 'inc = threshed; 'is_moving = threshed > 0; 'dec = (res / (release_time * ma.SR)) : *(-1) : ba.sAndH(is_moving); 'mv = dec, inc : select2(is_moving); 'res = (_:range(0,1))~+(mv); }; mov = (freq+speed+delmod_amp) : capture_mov(0.05, 0.3); mod = os.osc(speed)*0.5+1.0; delmod_amp = hslider("delmod_amp[acc: 0 0 -10 0 10]", 0, 0, 1, 0.01); dmod = mod * del * delmod_amp; synt = os.sawtooth(freq+freq*mod) * env * mov : phaser(1, 0.5) : mix_recdel(0.3, MAXDEL, del+dmod, fb) : mix_recdel(0.2, MAXDEL, del*0.5+dmod, fb) : mix_recdel(0.2, MAXDEL, del*0.75+dmod, fb) : fi.dcblocker ; process = synt * amp;
0401dd468ae89d5d8eafd5ec365b362eb0f541fb2b407ddb7b83f258137507b9
johannphilippe/grame_cnsmd_2023
pulsar_complex.dsp
import("stdfaust.lib"); metro(fq) = metro_impl(fq, 0); metro_swing(fq, swing) = metro_impl(fq,0) | metro_impl(fq, swing); // Better implementation metro_impl(fq, phase) = incr<=1.0 with { offset = (1.0-phase) * smps; incr = _~+(1.0) : +(offset) : _,smps : fmod; smps = ma.SR/fq; }; drunk_metro(fq, noise_amount) = metro(freq) with { trig = metro(fq)|(fq!=fq')|os.impulse; freq = fq + (no.noise*noise_amount) : ba.sAndH(trig); }; // Pulsar synthesis from https://nathan.ho.name/posts/pulsar-synthesis/ pulsar(fq, form_fq, sine_cycles) = sine with { pulsaret_phase = os.phasor(1, fq) * form_fq / fq; gate = (pulsaret_phase < 1); window = pulsaret_phase^4,0 : select2(gate > 1); sine = sin(pulsaret_phase * 2 * ma.PI * sine_cycles) * window * gate; }; line(time, sig) = res letrec { 'changed = (sig' != sig) | (time' != time); 'steps = ma.SR * time; 'cntup = ba.countup(steps ,changed); 'diff = ( sig - res); 'inc = diff / steps : ba.sAndH(changed); 'res = res, res + inc : select2(cntup < steps); }; // From supercollider LFNoise //Generates quadratically interpolated random values at a rate given by the nearest integer division of the sample rate by the freq argument. random_lfo(freq_bef, mul, add, static_probability) = sig * mul + add with { mod = os.osc(freq_bef / 10) : *(0.5) : +(0.50001); freq = freq_bef - (mod * 0.1); dmetro = drunk_metro(freq, 0.8); dmetro_inc = no.noise : abs : *(100) : ba.sAndH(dmetro); dmetro_cond = dmetro_inc < static_probability; static = no.noise : abs : ba.sAndH(dmetro) : ^(4); noiz = no.noise : abs; beat = ba.beat(60 * freq); pick = noiz : ba.sAndH(beat); cycle_dur = 1.0 / freq; // in seconds cycle_dur_smps = cycle_dur * ma.SR; linear = line(cycle_dur, pick); quad = linear^4; sig = quad, static : select2(dmetro_cond); }; random_pulsar(fq) = pulsar(freq, formant_freq, sine_cycles) with { freq = random_lfo(fq, 1000, 1, PROB); formant_freq = random_lfo(fq, 8000, 2, PROB); sine_cycles = int(random_lfo(fq, 3, 1, PROB)); PROB = 10; }; /* freq = hslider("frequency", 100, 50, 500, 0.1) : si.smoo; formant_freq = hslider("formant_freq", 100, 50, 10000, 0.1) : si.smoo; */ amp = hslider("amp", 0.1, 0, 1, 0.001) : si.smoo; rnd_int(vmin, vmax) = no.noise : ba.sAndH(os.impulse) : *(vmax-vmin) : +(vmin) : floor; process = par(n, 3, random_pulsar( rnd_int(1,3)* (n+1) ) : sp.panner(n/2.0)) :> _*amp, _*amp ;
https://raw.githubusercontent.com/johannphilippe/grame_cnsmd_2023/add61da4420da3947bc2bfbf42ade68f6369b1fe/pulsar/pulsar_complex.dsp
faust
Better implementation Pulsar synthesis from https://nathan.ho.name/posts/pulsar-synthesis/ From supercollider LFNoise Generates quadratically interpolated random values at a rate given by the nearest integer division of the sample rate by the freq argument. in seconds freq = hslider("frequency", 100, 50, 500, 0.1) : si.smoo; formant_freq = hslider("formant_freq", 100, 50, 10000, 0.1) : si.smoo;
import("stdfaust.lib"); metro(fq) = metro_impl(fq, 0); metro_swing(fq, swing) = metro_impl(fq,0) | metro_impl(fq, swing); metro_impl(fq, phase) = incr<=1.0 with { offset = (1.0-phase) * smps; incr = _~+(1.0) : +(offset) : _,smps : fmod; smps = ma.SR/fq; }; drunk_metro(fq, noise_amount) = metro(freq) with { trig = metro(fq)|(fq!=fq')|os.impulse; freq = fq + (no.noise*noise_amount) : ba.sAndH(trig); }; pulsar(fq, form_fq, sine_cycles) = sine with { pulsaret_phase = os.phasor(1, fq) * form_fq / fq; gate = (pulsaret_phase < 1); window = pulsaret_phase^4,0 : select2(gate > 1); sine = sin(pulsaret_phase * 2 * ma.PI * sine_cycles) * window * gate; }; line(time, sig) = res letrec { 'changed = (sig' != sig) | (time' != time); 'steps = ma.SR * time; 'cntup = ba.countup(steps ,changed); 'diff = ( sig - res); 'inc = diff / steps : ba.sAndH(changed); 'res = res, res + inc : select2(cntup < steps); }; random_lfo(freq_bef, mul, add, static_probability) = sig * mul + add with { mod = os.osc(freq_bef / 10) : *(0.5) : +(0.50001); freq = freq_bef - (mod * 0.1); dmetro = drunk_metro(freq, 0.8); dmetro_inc = no.noise : abs : *(100) : ba.sAndH(dmetro); dmetro_cond = dmetro_inc < static_probability; static = no.noise : abs : ba.sAndH(dmetro) : ^(4); noiz = no.noise : abs; beat = ba.beat(60 * freq); pick = noiz : ba.sAndH(beat); cycle_dur_smps = cycle_dur * ma.SR; linear = line(cycle_dur, pick); quad = linear^4; sig = quad, static : select2(dmetro_cond); }; random_pulsar(fq) = pulsar(freq, formant_freq, sine_cycles) with { freq = random_lfo(fq, 1000, 1, PROB); formant_freq = random_lfo(fq, 8000, 2, PROB); sine_cycles = int(random_lfo(fq, 3, 1, PROB)); PROB = 10; }; amp = hslider("amp", 0.1, 0, 1, 0.001) : si.smoo; rnd_int(vmin, vmax) = no.noise : ba.sAndH(os.impulse) : *(vmax-vmin) : +(vmin) : floor; process = par(n, 3, random_pulsar( rnd_int(1,3)* (n+1) ) : sp.panner(n/2.0)) :> _*amp, _*amp ;
5dc53a50c11eaed688bb4bf75d500e30074ee80f97aa5e6fe6be19ff50d94171
johannphilippe/faust_jo
lib.dsp
declare name "faust_jo"; declare version "1.0"; declare author "Johann Philippe"; declare license "MIT"; declare copyright "(c) Johann Philippe 2022"; import("stdfaust.lib"); /* Impulsion with a specified duration. Can be retriggered. */ mpulse(smps_dur, trig) = pulsation with { count = ba.countdown(smps_dur, trig); //count = -(1)~_, smps_dur : select2(trig); pulsation = 0, 1 : select2(count > 0); }; mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig); /* Euclidian function. Generates an euclidian rythm with 0;1 triggers */ euclidian(onset, div, pulses, rotation, phasor) = (eucval' != eucval) & (kph' != kph) with { kph = int( (( (phasor + rotation) * div) % 1) * pulses); eucval = int((onset / pulses) * kph); }; dur_smps_euclidian(onset, div, pulses, rotation, smps_dur, phasor) = euclidian(onset, div, pulses, rotation, phasor) : mpulse(smps_dur); /* Wavefolder. */ wavefold(sig) = do_transform(sig), sig : select2((sig > -1) & (sig < 1)) with { abs_sig = abs(sig); decimal = abs_sig - int(abs_sig); neg_plus_decimal = -1 + decimal; pos_minus_decimal = 1 - decimal; process_value(x) = 1 - decimal, -1 + decimal : select2(x); is_even = ((int(abs_sig) %2) == 0); is_positiv = sig >= 0; do_transform(sig) = process_value( (is_even & is_positiv) | ( (is_even == 0) & (is_positiv == 0)) ); }; /* Waveshaper with wavefolder. */ nonlinear_wavefold(amount, sig) = final with { transfer_fct = waveform{-1, -1, 1, 1}; fold = wavefold(sig); fold_sig = (fold + 1) / 2; nonlinear = transfer_fct, int(fold_sig * 4) : rdtable; final = (nonlinear * amount) + ((1 - amount) * fold); }; /* Limit to range */ range(vmin, vmax, sig) = res with { low = vmin, sig : select2(sig >= vmin) ; res = vmax, low : select2(low <= vmax); }; /* Returns 0 if below th. */ threshold(th, sig) = sig, 0 : select2(sig <= th); /* Capture movement on a signal - outputs signal between 0 and 1 */ capture_mov(th, release_time, sig) = res letrec { 'inc = (abs(sig' - sig)) : threshold(th); 'is_moving = (abs(sig' - sig)) : threshold(th) > 0; 'dec = (res / (release_time * ma.SR)) : *(-1) : ba.sAndH(is_moving); 'mv = dec, inc : select2(is_moving); 'res = _~+(mv) : range(0, 1); }; /* Linear interpolation of a signal */ line(time, sig) = res letrec { 'changed = (sig' != sig) | (time' != time); 'steps = ma.SR * time; 'cntup = ba.countup(steps ,changed); 'diff = ( sig - res); 'inc = diff / steps : ba.sAndH(changed); 'res = res, res + inc : select2(cntup < steps); }; // In frequencies fq_to_bpm(fq) = 60 * fq; bpm_to_fq(bpm) = bpm / 60; metro(fq) = ba.beat(fq_to_bpm(fq)); swingmetro_par(fq, swing) = m1, m2 with { m1 = metro(fq); m2 = met with { sw = swing ; //range( 0, 1, swing); ph = os.hs_phasor(1, fq, m1); met = 0, 1 : select2(cond) : ba.impulsify with { cond = (ph >= sw) & (ph' <= sw); }; }; }; swingmetro(fq,swing) = swingmetro_par(fq, swing) :> _; // Outputs triggers on first output, and velocity (normalized) on second sequencer(t, freq) = (res > 0) * (ph != ph'), res with { sz = t : _,!; ph = int(os.phasor(sz, freq)); res = t, ph : rdtable; }; // Can choose the number of steps to read step_sequencer(t, size, freq) = (res > 0) * (ph != ph'), res with { ph = int(os.phasor(size, freq)); res = t, ph : rdtable; }; // Tempo adjusts so each step is equivalent beat_sequencer(t, size, freq) = (res > 0) * (ph != ph'), res with { ph = int(os.phasor(size, freq / size)); res = t, ph : rdtable; }; // Tempo adjusts so each step is equivalent swing_sequencer(t,tswing, size, freq) = ((res > 0) * (ph != ph')) | swing, res with { ph = int(os.phasor(size, freq / size)); sw = tswing, ph : rdtable; phstep = os.hs_phasor(1, freq, sw != sw'); swing = 0, 1 : select2(cond) : ba.impulsify with { cond = (phstep >= sw) & (phstep' <= sw); }; res = t, ph : rdtable; };
https://raw.githubusercontent.com/johannphilippe/faust_jo/635f0a967093edcec8e38de731939d6fa453ca09/lib.dsp
faust
Impulsion with a specified duration. Can be retriggered. count = -(1)~_, smps_dur : select2(trig); Euclidian function. Generates an euclidian rythm with 0;1 triggers Wavefolder. Waveshaper with wavefolder. Limit to range Returns 0 if below th. Capture movement on a signal - outputs signal between 0 and 1 Linear interpolation of a signal In frequencies range( 0, 1, swing); Outputs triggers on first output, and velocity (normalized) on second Can choose the number of steps to read Tempo adjusts so each step is equivalent Tempo adjusts so each step is equivalent
declare name "faust_jo"; declare version "1.0"; declare author "Johann Philippe"; declare license "MIT"; declare copyright "(c) Johann Philippe 2022"; import("stdfaust.lib"); mpulse(smps_dur, trig) = pulsation with { count = ba.countdown(smps_dur, trig); pulsation = 0, 1 : select2(count > 0); }; mpulse_dur(duration, trig) = mpulse(ba.sec2samp(duration), trig); euclidian(onset, div, pulses, rotation, phasor) = (eucval' != eucval) & (kph' != kph) with { kph = int( (( (phasor + rotation) * div) % 1) * pulses); eucval = int((onset / pulses) * kph); }; dur_smps_euclidian(onset, div, pulses, rotation, smps_dur, phasor) = euclidian(onset, div, pulses, rotation, phasor) : mpulse(smps_dur); wavefold(sig) = do_transform(sig), sig : select2((sig > -1) & (sig < 1)) with { abs_sig = abs(sig); decimal = abs_sig - int(abs_sig); neg_plus_decimal = -1 + decimal; pos_minus_decimal = 1 - decimal; process_value(x) = 1 - decimal, -1 + decimal : select2(x); is_even = ((int(abs_sig) %2) == 0); is_positiv = sig >= 0; do_transform(sig) = process_value( (is_even & is_positiv) | ( (is_even == 0) & (is_positiv == 0)) ); }; nonlinear_wavefold(amount, sig) = final with { transfer_fct = waveform{-1, -1, 1, 1}; fold = wavefold(sig); fold_sig = (fold + 1) / 2; nonlinear = transfer_fct, int(fold_sig * 4) : rdtable; final = (nonlinear * amount) + ((1 - amount) * fold); }; range(vmin, vmax, sig) = res with { low = vmin, sig : select2(sig >= vmin) ; res = vmax, low : select2(low <= vmax); }; threshold(th, sig) = sig, 0 : select2(sig <= th); capture_mov(th, release_time, sig) = res letrec { 'inc = (abs(sig' - sig)) : threshold(th); 'is_moving = (abs(sig' - sig)) : threshold(th) > 0; 'dec = (res / (release_time * ma.SR)) : *(-1) : ba.sAndH(is_moving); 'mv = dec, inc : select2(is_moving); 'res = _~+(mv) : range(0, 1); }; line(time, sig) = res letrec { 'changed = (sig' != sig) | (time' != time); 'steps = ma.SR * time; 'cntup = ba.countup(steps ,changed); 'diff = ( sig - res); 'inc = diff / steps : ba.sAndH(changed); 'res = res, res + inc : select2(cntup < steps); }; fq_to_bpm(fq) = 60 * fq; bpm_to_fq(bpm) = bpm / 60; metro(fq) = ba.beat(fq_to_bpm(fq)); swingmetro_par(fq, swing) = m1, m2 with { m1 = metro(fq); m2 = met with { ph = os.hs_phasor(1, fq, m1); met = 0, 1 : select2(cond) : ba.impulsify with { cond = (ph >= sw) & (ph' <= sw); }; }; }; swingmetro(fq,swing) = swingmetro_par(fq, swing) :> _; sequencer(t, freq) = (res > 0) * (ph != ph'), res with { sz = t : _,!; ph = int(os.phasor(sz, freq)); res = t, ph : rdtable; }; step_sequencer(t, size, freq) = (res > 0) * (ph != ph'), res with { ph = int(os.phasor(size, freq)); res = t, ph : rdtable; }; beat_sequencer(t, size, freq) = (res > 0) * (ph != ph'), res with { ph = int(os.phasor(size, freq / size)); res = t, ph : rdtable; }; swing_sequencer(t,tswing, size, freq) = ((res > 0) * (ph != ph')) | swing, res with { ph = int(os.phasor(size, freq / size)); sw = tswing, ph : rdtable; phstep = os.hs_phasor(1, freq, sw != sw'); swing = 0, 1 : select2(cond) : ba.impulsify with { cond = (phstep >= sw) & (phstep' <= sw); }; res = t, ph : rdtable; };
3389b5b3cca96ff4f78a42981cdbe9a8d15c6d1a1df460ce6c5df25193b2d86e
mzuther/ProtoFaust
gui.dsp
/* ---------------------------------------------------------------------------- ProtoFaust ========== DSP prototyping in Faust for VCV Rack Copyright (c) 2019-2020 Martin Zuther (http://www.mzuther.de/) and contributors This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Thank you for using free software! ---------------------------------------------------------------------------- */ import("stdfaust.lib"); main_group(x) = vgroup("ProtoFaust", x); button_group(x) = main_group(hgroup("[2] Buttons", x)); button_1 = button_group(vslider("1 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_2 = button_group(vslider("2 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_3 = button_group(vslider("3 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_4 = button_group(vslider("4 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_5 = button_group(vslider("5 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_6 = button_group(vslider("6 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_7 = button_group(vslider("7 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_8 = button_group(vslider("8 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_group(x) = main_group(hgroup("[1] Knobs", x)); knob_1 = knob_group(vslider("1 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_2 = knob_group(vslider("2 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_3 = knob_group(vslider("3 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_4 = knob_group(vslider("4 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_5 = knob_group(vslider("5 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_6 = knob_group(vslider("6 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_7 = knob_group(vslider("7 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_8 = knob_group(vslider("8 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); led_group(x) = main_group(hgroup("[3] Lights", x)); led_1_r = led_group(vbargraph("1 Red [style:led]" , 0 , 1)); led_1_g = led_group(vbargraph("1 Green [style:led]" , 0 , 1)); led_1_b = led_group(vbargraph("1 Blue [style:led]" , 0 , 1)); led_2_r = led_group(vbargraph("2 Red [style:led]" , 0 , 1)); led_2_g = led_group(vbargraph("2 Green [style:led]" , 0 , 1)); led_2_b = led_group(vbargraph("2 Blue [style:led]" , 0 , 1)); led_3_r = led_group(vbargraph("3 Red [style:led]" , 0 , 1)); led_3_g = led_group(vbargraph("3 Green [style:led]" , 0 , 1)); led_3_b = led_group(vbargraph("3 Blue [style:led]" , 0 , 1)); led_4_r = led_group(vbargraph("4 Red [style:led]" , 0 , 1)); led_4_g = led_group(vbargraph("4 Green [style:led]" , 0 , 1)); led_4_b = led_group(vbargraph("4 Blue [style:led]" , 0 , 1)); led_5_r = led_group(vbargraph("5 Red [style:led]" , 0 , 1)); led_5_g = led_group(vbargraph("5 Green [style:led]" , 0 , 1)); led_5_b = led_group(vbargraph("5 Blue [style:led]" , 0 , 1)); led_6_r = led_group(vbargraph("6 Red [style:led]" , 0 , 1)); led_6_g = led_group(vbargraph("6 Green [style:led]" , 0 , 1)); led_6_b = led_group(vbargraph("6 Blue [style:led]" , 0 , 1)); led_7_r = led_group(vbargraph("7 Red [style:led]" , 0 , 1)); led_7_g = led_group(vbargraph("7 Green [style:led]" , 0 , 1)); led_7_b = led_group(vbargraph("7 Blue [style:led]" , 0 , 1)); led_8_r = led_group(vbargraph("8 Red [style:led]" , 0 , 1)); led_8_g = led_group(vbargraph("8 Green [style:led]" , 0 , 1)); led_8_b = led_group(vbargraph("8 Blue [style:led]" , 0 , 1));
https://raw.githubusercontent.com/mzuther/ProtoFaust/1e494160cd7ba38cde27e238776a0803bef35d36/src/faust/gui.dsp
faust
---------------------------------------------------------------------------- ProtoFaust ========== DSP prototyping in Faust for VCV Rack Copyright (c) 2019-2020 Martin Zuther (http://www.mzuther.de/) and contributors This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Thank you for using free software! ----------------------------------------------------------------------------
import("stdfaust.lib"); main_group(x) = vgroup("ProtoFaust", x); button_group(x) = main_group(hgroup("[2] Buttons", x)); button_1 = button_group(vslider("1 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_2 = button_group(vslider("2 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_3 = button_group(vslider("3 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_4 = button_group(vslider("4 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_5 = button_group(vslider("5 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_6 = button_group(vslider("6 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_7 = button_group(vslider("7 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); button_8 = button_group(vslider("8 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_group(x) = main_group(hgroup("[1] Knobs", x)); knob_1 = knob_group(vslider("1 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_2 = knob_group(vslider("2 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_3 = knob_group(vslider("3 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_4 = knob_group(vslider("4 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_5 = knob_group(vslider("5 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_6 = knob_group(vslider("6 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_7 = knob_group(vslider("7 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); knob_8 = knob_group(vslider("8 [style:knob]" , 0.5 , 0 , 1 , 1e-3)); led_group(x) = main_group(hgroup("[3] Lights", x)); led_1_r = led_group(vbargraph("1 Red [style:led]" , 0 , 1)); led_1_g = led_group(vbargraph("1 Green [style:led]" , 0 , 1)); led_1_b = led_group(vbargraph("1 Blue [style:led]" , 0 , 1)); led_2_r = led_group(vbargraph("2 Red [style:led]" , 0 , 1)); led_2_g = led_group(vbargraph("2 Green [style:led]" , 0 , 1)); led_2_b = led_group(vbargraph("2 Blue [style:led]" , 0 , 1)); led_3_r = led_group(vbargraph("3 Red [style:led]" , 0 , 1)); led_3_g = led_group(vbargraph("3 Green [style:led]" , 0 , 1)); led_3_b = led_group(vbargraph("3 Blue [style:led]" , 0 , 1)); led_4_r = led_group(vbargraph("4 Red [style:led]" , 0 , 1)); led_4_g = led_group(vbargraph("4 Green [style:led]" , 0 , 1)); led_4_b = led_group(vbargraph("4 Blue [style:led]" , 0 , 1)); led_5_r = led_group(vbargraph("5 Red [style:led]" , 0 , 1)); led_5_g = led_group(vbargraph("5 Green [style:led]" , 0 , 1)); led_5_b = led_group(vbargraph("5 Blue [style:led]" , 0 , 1)); led_6_r = led_group(vbargraph("6 Red [style:led]" , 0 , 1)); led_6_g = led_group(vbargraph("6 Green [style:led]" , 0 , 1)); led_6_b = led_group(vbargraph("6 Blue [style:led]" , 0 , 1)); led_7_r = led_group(vbargraph("7 Red [style:led]" , 0 , 1)); led_7_g = led_group(vbargraph("7 Green [style:led]" , 0 , 1)); led_7_b = led_group(vbargraph("7 Blue [style:led]" , 0 , 1)); led_8_r = led_group(vbargraph("8 Red [style:led]" , 0 , 1)); led_8_g = led_group(vbargraph("8 Green [style:led]" , 0 , 1)); led_8_b = led_group(vbargraph("8 Blue [style:led]" , 0 , 1));
6f8b9b4ecc1e3d0bc1a8f4f0dbfee61ccd36ca064a289689b63ce1352f00b3fe
mzuther/ProtoFaust
main.dsp
/* ---------------------------------------------------------------------------- ProtoFaust ========== DSP prototyping in Faust for VCV Rack Copyright (c) 2019-2020 Martin Zuther (http://www.mzuther.de/) and contributors This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Thank you for using free software! ---------------------------------------------------------------------------- */ import("stdfaust.lib"); import("gui.dsp"); rack = component("rack.dsp"); vca(i_cv , in) = internal_vca with { gain = max(0 , i_cv); internal_vca = gain * in; }; vco(i_cv_pitch , btn) = internal_vco with { freq = i_cv_pitch : rack.i_cv_pitch2freq; internal_vco = freq <: os.saw2 , os.square , os.triangle : ba.selectn(3 , btn); }; vcf(i_cv_cutoff , i_cv_resonance , btn , in) = internal_vcf with { cutoff = i_cv_cutoff * 1.5 - 0.5 : rack.i_cv_pitch2freq; cutoff_limited = max(10 , min(cutoff , 20000)); resonance = max(i_cv_resonance * 5 , 0.1); gain = 1; internal_vcf = cutoff_limited , resonance , gain , in <: fi.resonhp , fi.resonlp : ba.selectn(2 , btn); }; voice(i_cv_pitch , volume, knob_coarse , knob_fine, btn_waveform) = internal_voice with { i_cv_pitch_coarse = int(knob_coarse * 48 - 12) / 60; i_cv_pitch_fine = (knob_fine - 0.5) / 30; i_cv_pitch_final = i_cv_pitch + (i_cv_pitch_coarse + i_cv_pitch_fine : si.smooth(1e-3)); internal_voice = i_cv_pitch_final , btn_waveform : volume , vco : vca; }; voices(i_cv_pitch , i_cv_cutoff , i_cv_resonance) = internal_voices with { volume = -18 : ba.db2linear; voice_1 = voice(i_cv_pitch , volume , knob_1 , knob_2 , button_1 * 2); voice_2 = voice(i_cv_pitch , volume , knob_3 , knob_4 , button_2 * 2); voice_3 = voice(i_cv_pitch , volume , knob_5 , knob_6 , button_3 * 2 + 1); i_cv_cutoff_final = i_cv_cutoff + (knob_7 : si.smooth(1e-3)); i_cv_resonance_final = i_cv_resonance + (knob_8 : si.smooth(1e-3)); internal_voices = voice_1 + voice_2 + voice_3 : i_cv_cutoff_final , i_cv_resonance_final , button_4 * 2 , _ : vcf : 0.3 , 0.1 , _ : ef.cubicnl : fi.dcblocker; }; process(in1 , in2 , in3 , in4 , in5 , in6 , in7 , in8) = internal_processor with { lfo_1 = (os.osccos(0.5) + 1) / 2; lfo_2 = 1 - lfo_1; gui_attacher = _ : attach(_ , button_1) : attach(_ , button_2) : attach(_ , button_3) : attach(_ , button_4) : attach(_ , button_5) : attach(_ , button_6) : attach(_ , button_7) : attach(_ , button_8) : attach(_ , knob_1) : attach(_ , knob_2) : attach(_ , knob_3) : attach(_ , knob_4) : attach(_ , knob_5) : attach(_ , knob_6) : attach(_ , knob_7) : attach(_ , knob_8) : attach(_ , lfo_1 : led_1_r) : attach(_ , 0 : led_1_g) : attach(_ , 0 : led_1_b) : attach(_ , 0 : led_2_r) : attach(_ , lfo_2 : led_2_g) : attach(_ , 0 : led_2_b) : attach(_ , 0 : led_3_r) : attach(_ , 0 : led_3_g) : attach(_ , lfo_1 : led_3_b) : attach(_ , lfo_2 : led_4_r) : attach(_ , lfo_2 : led_4_g) : attach(_ , lfo_2 : led_4_b) : attach(_ , lfo_1 : led_5_r) : attach(_ , lfo_1 : led_5_g) : attach(_ , lfo_1 : led_5_b) : attach(_ , lfo_1 : led_6_r) : attach(_ , lfo_2 : led_6_g) : attach(_ , 0 : led_6_b) : attach(_ , 0 : led_7_r) : attach(_ , lfo_1 : led_7_g) : attach(_ , lfo_2 : led_7_b) : attach(_ , lfo_1 : led_8_r) : attach(_ , 0 : led_8_g) : attach(_ , lfo_2 : led_8_b) : _; internal_processor = (in1 : gui_attacher) , in2 , in3 : voices : _ , in2 , in3 , in4 , in5 , in6 , in7 , in8 : si.bus(8); };
https://raw.githubusercontent.com/mzuther/ProtoFaust/1e494160cd7ba38cde27e238776a0803bef35d36/src/faust/main.dsp
faust
---------------------------------------------------------------------------- ProtoFaust ========== DSP prototyping in Faust for VCV Rack Copyright (c) 2019-2020 Martin Zuther (http://www.mzuther.de/) and contributors This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Thank you for using free software! ----------------------------------------------------------------------------
import("stdfaust.lib"); import("gui.dsp"); rack = component("rack.dsp"); vca(i_cv , in) = internal_vca with { gain = max(0 , i_cv); internal_vca = gain * in; }; vco(i_cv_pitch , btn) = internal_vco with { freq = i_cv_pitch : rack.i_cv_pitch2freq; internal_vco = freq <: os.saw2 , os.square , os.triangle : ba.selectn(3 , btn); }; vcf(i_cv_cutoff , i_cv_resonance , btn , in) = internal_vcf with { cutoff = i_cv_cutoff * 1.5 - 0.5 : rack.i_cv_pitch2freq; cutoff_limited = max(10 , min(cutoff , 20000)); resonance = max(i_cv_resonance * 5 , 0.1); gain = 1; internal_vcf = cutoff_limited , resonance , gain , in <: fi.resonhp , fi.resonlp : ba.selectn(2 , btn); }; voice(i_cv_pitch , volume, knob_coarse , knob_fine, btn_waveform) = internal_voice with { i_cv_pitch_coarse = int(knob_coarse * 48 - 12) / 60; i_cv_pitch_fine = (knob_fine - 0.5) / 30; i_cv_pitch_final = i_cv_pitch + (i_cv_pitch_coarse + i_cv_pitch_fine : si.smooth(1e-3)); internal_voice = i_cv_pitch_final , btn_waveform : volume , vco : vca; }; voices(i_cv_pitch , i_cv_cutoff , i_cv_resonance) = internal_voices with { volume = -18 : ba.db2linear; voice_1 = voice(i_cv_pitch , volume , knob_1 , knob_2 , button_1 * 2); voice_2 = voice(i_cv_pitch , volume , knob_3 , knob_4 , button_2 * 2); voice_3 = voice(i_cv_pitch , volume , knob_5 , knob_6 , button_3 * 2 + 1); i_cv_cutoff_final = i_cv_cutoff + (knob_7 : si.smooth(1e-3)); i_cv_resonance_final = i_cv_resonance + (knob_8 : si.smooth(1e-3)); internal_voices = voice_1 + voice_2 + voice_3 : i_cv_cutoff_final , i_cv_resonance_final , button_4 * 2 , _ : vcf : 0.3 , 0.1 , _ : ef.cubicnl : fi.dcblocker; }; process(in1 , in2 , in3 , in4 , in5 , in6 , in7 , in8) = internal_processor with { lfo_1 = (os.osccos(0.5) + 1) / 2; lfo_2 = 1 - lfo_1; gui_attacher = _ : attach(_ , button_1) : attach(_ , button_2) : attach(_ , button_3) : attach(_ , button_4) : attach(_ , button_5) : attach(_ , button_6) : attach(_ , button_7) : attach(_ , button_8) : attach(_ , knob_1) : attach(_ , knob_2) : attach(_ , knob_3) : attach(_ , knob_4) : attach(_ , knob_5) : attach(_ , knob_6) : attach(_ , knob_7) : attach(_ , knob_8) : attach(_ , lfo_1 : led_1_r) : attach(_ , 0 : led_1_g) : attach(_ , 0 : led_1_b) : attach(_ , 0 : led_2_r) : attach(_ , lfo_2 : led_2_g) : attach(_ , 0 : led_2_b) : attach(_ , 0 : led_3_r) : attach(_ , 0 : led_3_g) : attach(_ , lfo_1 : led_3_b) : attach(_ , lfo_2 : led_4_r) : attach(_ , lfo_2 : led_4_g) : attach(_ , lfo_2 : led_4_b) : attach(_ , lfo_1 : led_5_r) : attach(_ , lfo_1 : led_5_g) : attach(_ , lfo_1 : led_5_b) : attach(_ , lfo_1 : led_6_r) : attach(_ , lfo_2 : led_6_g) : attach(_ , 0 : led_6_b) : attach(_ , 0 : led_7_r) : attach(_ , lfo_1 : led_7_g) : attach(_ , lfo_2 : led_7_b) : attach(_ , lfo_1 : led_8_r) : attach(_ , 0 : led_8_g) : attach(_ , lfo_2 : led_8_b) : _; internal_processor = (in1 : gui_attacher) , in2 , in3 : voices : _ , in2 , in3 , in4 , in5 , in6 , in7 , in8 : si.bus(8); };
801f409da521454eca5339ac0bff1db0baa2c4390a7c3977f547d4dc1597bdba
yamitarek/silk
silk.dsp
import("stdfaust.lib"); // OSCILLATOR SYNTHESIS // Set of wave generators oscSynth = vgroup("[0]Oscillator synthesis",waveGenerator1+waveGenerator2+waveGenerator3); // Wave generators freq = hslider("[2]freq",440,50,2000,0.01); waveGenerator(wSel,wGain) = wave*wGain with{ wave = sineTimbre,triangleTimbre,squareTimbre,sawTimbre : ba.selectn(4,wSel); sineTimbre = os.osc(freq)*0.5 + os.osc(freq*2)*0.25 + os.osc(freq*3)*0.125; triangleTimbre = os.triangle(freq)*0.5 + os.triangle(freq*2)*0.25 + os.triangle(freq*3)*0.125; squareTimbre = os.square(freq)*0.5; sawTimbre = os.sawtooth(freq)*0.5; }; waveGenerator1 = hgroup("Wave generator 1",waveGenerator(waveSel,waveGain)) with{ waveSel = nentry("[0]Waveform",0,0,3,1); waveGain = hslider("[1]Gain[style:knob]",1,0,1,0.01); }; waveGenerator2 = hgroup("Wave generator 2",checkbox("[3]Gate")*waveGenerator(waveSel,waveGain)) with{ waveSel = nentry("[0]Waveform",0,0,3,1); waveGain = hslider("[1]Gain[style:knob]",1,0,1,0.01); }; waveGenerator3 = hgroup("Wave generator 3",checkbox("[3]Gate")*waveGenerator(waveSel,waveGain)) with{ waveSel = nentry("[0]Waveform",0,0,3,1); waveGain = hslider("[1]Gain[style:knob]",1,0,1,0.01); }; // AM MODULATION amMod = vgroup("[3]AM Modulation",modulator) with{ modulator = ((1-modDepth) + (wave*0.5+0.5)*modDepth); wave = os.osc(modFreq),os.triangle(modFreq),os.square(modFreq),os.sawtooth(modFreq) : ba.selectn(4,waveSel); waveSel = nentry("[0]Waveform",0,0,3,1); modFreq = hslider("[1]Modulator frequency[style:knob]",20,0.1,2000,0.01); modDepth = hslider("[2]Modulator depth[style:knob]",0,0,1,0.01); }; // ENVELOPE envelope = hgroup("[1]Envelope",en.adsr(attack,decay,sustain,release,gate)*gain) // TODO: scale with{ attack = hslider("[0]Attack[style:knob]",50,1,1000,1)*0.0001; decay = hslider("[1]Decay[style:knob]",50,1,1000,1)*0.0001; sustain = hslider("[2]Sustain[style:knob]",0.8,0.01,1,0.01); release = hslider("[3]Release[style:knob]",50,1,2000,1)*0.0001; gain = hslider("[4]gain[style:knob]",1,0,1,0.01); gate = button("[5]gate"); }; // SUBTRACTIVE FILTER // vcf vcf = vgroup("[1]Subtractive", fi.resonlp(resFreq,q,1)) with{ ctFreq = hslider("[0]Cutoff Frequency[style:knob]", 2000, 50, 10000, 0.1); q = hslider("[1]Q[style:knob]", 5, 1, 30, 0.1); lfoFreq=hslider("[2]LFO Freq[style:knob]", 10,0.1,20,0.01); lfoDepth=hslider("[3]Depth[style:knob]", 500,1,10000,1); resFreq = ctFreq + os.osc(lfoFreq)*lfoDepth : max(30); }; // PROCESS synthTypes = hgroup("[0]Synthesis", oscSynth*amMod : ba.bypass1(bypassSwitchSub,vcf)); mySynth = vgroup("Silk", synthTypes*envelope <: _,_); bypassSwitchSub = checkbox("[2]Subtractive bypass"); process = mySynth; // EFFECT effect = dm.zita_light;
https://raw.githubusercontent.com/yamitarek/silk/51f7f6c0ccd89e0045da47a43b192340cb377432/silk.dsp
faust
OSCILLATOR SYNTHESIS Set of wave generators Wave generators AM MODULATION ENVELOPE TODO: scale SUBTRACTIVE FILTER vcf PROCESS EFFECT
import("stdfaust.lib"); oscSynth = vgroup("[0]Oscillator synthesis",waveGenerator1+waveGenerator2+waveGenerator3); freq = hslider("[2]freq",440,50,2000,0.01); waveGenerator(wSel,wGain) = wave*wGain with{ wave = sineTimbre,triangleTimbre,squareTimbre,sawTimbre : ba.selectn(4,wSel); sineTimbre = os.osc(freq)*0.5 + os.osc(freq*2)*0.25 + os.osc(freq*3)*0.125; triangleTimbre = os.triangle(freq)*0.5 + os.triangle(freq*2)*0.25 + os.triangle(freq*3)*0.125; squareTimbre = os.square(freq)*0.5; sawTimbre = os.sawtooth(freq)*0.5; }; waveGenerator1 = hgroup("Wave generator 1",waveGenerator(waveSel,waveGain)) with{ waveSel = nentry("[0]Waveform",0,0,3,1); waveGain = hslider("[1]Gain[style:knob]",1,0,1,0.01); }; waveGenerator2 = hgroup("Wave generator 2",checkbox("[3]Gate")*waveGenerator(waveSel,waveGain)) with{ waveSel = nentry("[0]Waveform",0,0,3,1); waveGain = hslider("[1]Gain[style:knob]",1,0,1,0.01); }; waveGenerator3 = hgroup("Wave generator 3",checkbox("[3]Gate")*waveGenerator(waveSel,waveGain)) with{ waveSel = nentry("[0]Waveform",0,0,3,1); waveGain = hslider("[1]Gain[style:knob]",1,0,1,0.01); }; amMod = vgroup("[3]AM Modulation",modulator) with{ modulator = ((1-modDepth) + (wave*0.5+0.5)*modDepth); wave = os.osc(modFreq),os.triangle(modFreq),os.square(modFreq),os.sawtooth(modFreq) : ba.selectn(4,waveSel); waveSel = nentry("[0]Waveform",0,0,3,1); modFreq = hslider("[1]Modulator frequency[style:knob]",20,0.1,2000,0.01); modDepth = hslider("[2]Modulator depth[style:knob]",0,0,1,0.01); }; with{ attack = hslider("[0]Attack[style:knob]",50,1,1000,1)*0.0001; decay = hslider("[1]Decay[style:knob]",50,1,1000,1)*0.0001; sustain = hslider("[2]Sustain[style:knob]",0.8,0.01,1,0.01); release = hslider("[3]Release[style:knob]",50,1,2000,1)*0.0001; gain = hslider("[4]gain[style:knob]",1,0,1,0.01); gate = button("[5]gate"); }; vcf = vgroup("[1]Subtractive", fi.resonlp(resFreq,q,1)) with{ ctFreq = hslider("[0]Cutoff Frequency[style:knob]", 2000, 50, 10000, 0.1); q = hslider("[1]Q[style:knob]", 5, 1, 30, 0.1); lfoFreq=hslider("[2]LFO Freq[style:knob]", 10,0.1,20,0.01); lfoDepth=hslider("[3]Depth[style:knob]", 500,1,10000,1); resFreq = ctFreq + os.osc(lfoFreq)*lfoDepth : max(30); }; synthTypes = hgroup("[0]Synthesis", oscSynth*amMod : ba.bypass1(bypassSwitchSub,vcf)); mySynth = vgroup("Silk", synthTypes*envelope <: _,_); bypassSwitchSub = checkbox("[2]Subtractive bypass"); process = mySynth; effect = dm.zita_light;
0f2b3dca978694d4a77d79f55e37b24582d338cc23c2bec7bb61346d7f611b12
jlp6k/faust-things
Granola.dsp
import("stdfaust.lib"); declare name "Granola"; declare author "Jean-Louis Paquelin"; declare copyright "Copyright (C) 2022 Jean-Louis Paquelin <[email protected]>"; declare version "2022.3.2"; // The version number is YYYY.M.n declare license "GNU General Public License v3 or later"; // In order to test this program, please uncomment the following line by removing the initial // //process = Granola(5, 15).demo; // It will create a Granola with a 5 seconds buffer and 15 grains at most. // Feel free to test other parameter values (w/r to your computer's power). // A short documentation is available below. // Granola is a granular audio live feed processor. // Copyright (C) 2022 Jean-Louis Paquelin <[email protected]> // // Granola is a 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 // any later version. // // Granola 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 Granola. If not, see <http://www.gnu.org/licenses/>. /* Granola is a monophonic granular live feed processor. The grain processor is inspired by the Mutable Instruments Beads. The grain window shape control is inspired by the GR-1 Granular synthesizer from Tasty Chips Electronics. #### Specifications * Audio I/O - Manual input and output gain control. - Recording time: `BUFFER_DURATION`. - The FREEZE button freezes the content of the recording table. - Feedback path with attenuation and limiter (with 1 sample delay). The feedback signal comes from the grains output (it's before the dry/wet crossfader). - Dry/Wet control. - TODO: Stereo I/O with automatic level detection with a limiter. - TODO: Gate signal in sync with the grains. - TODO: Antialiased output. - TODO: Spatialized output. * Grains generation modes - The SEED button triggers a grain. - Automatically trigger grains at a periodic rate with the DENSITY parameter (at maximum density there are 1000 grains generated per second (M.I. Beads has a maximum rate of ~260 grains per second). Note: The actual number of triggered grains cannot exceed the `CONCURRENT_GRAINS` value (30 for M.I. Beads). - TODO: Automatically trigger grains at a randomized rate. - TODO: Start a chain of delayed and pitched grains instead of a single one. * Grain parameters - TIME: Controls the playback position of each grain within the table. In other words, it delays the grains. - SIZE: Grain duration from 0.03 seconds to the table length, forward or backward playback. - SHAPE: The shape of the grain envelope. The shape control allows to morph the shape from a square (in this case the grain original amplitude is maintained), to an inverted saw (slow release), to a triangle (attack and release time are the same), and finally to a saw (slow attack). - PITCH: The pitch of the grain (-2..+2 octaves). Note: The four grain parameters are latched when a grain is triggered. Hence, the grain parameters remain the same throughout the grain playback but they may differ for multiple grains. - TODO: TIME slew limiter for tape like scrubing effect. #### Usage ``` _ : Granola(BUFFER_DURATION, CONCURRENT_GRAINS).ui(uix) : _ ``` Where: * `BUFFER_DURATION`: buffer duration in seconds. * `CONCURRENT_GRAINS`: (int) number of grains allocated. * `uix`: (int) the UI instance number. A demo function of Granola with a limiter, a LPF and a reverb on the output. ``` _ : Granola(BUFFER_DURATION, CONCURRENT_GRAINS).demo : _, _ ``` #### Examples ``` // A Granola's demonstration setup with a 5 seconds buffer and an up-to-15-grains polyphony. process = Granola(5, 15).demo; ``` ``` // A Granola grain processor. // It has a 1 second audio buffer and up to 30 grains playing a the same time. process = Granola(1, 30).ui(0); ``` ``` // Two Granola instances allowing to process each channel of a stereo signal differently. // They have a 5 seconds audio buffer and up to 15 grains playing a the same time. process = Granola(5, 15).ui(0), Granola(5, 15).ui(1); ``` ``` // Two Granola instances sharing the same user interface making a stereo grain processor. // They have a 5 seconds audio buffer and up to 15 grains playing a the same time. process = Granola(5, 15).ui(0), Granola(5, 15).ui(0); ``` ``` // As the Granola grain processor is able to play many copies of the input signal simultaneously, // it may rapidly saturate its output. This could be avoided by manualy reducing the output gain, // by selecting a smoother grain-window shape and/or by placing a limiter in the circuit path. // Also note that Granola pairs well with a reverb. process = Granola(2, 30).ui(0) : co.limiter_1176_R4_mono <: dm.zita_light; ``` ``` // Granola used as a delay like effect. Parameters are taylored for the default audio file // of the Faust web IDE (wait 5 seconds to let the table be filled). Play it looped. process = Granola(5, 10).grains(0, _, 4.76, 0, 0.5, 0, 0.5, 0.5, 0.03, 0.5, 1, 0, 0, 0.5); ``` ``` // Granola used as a complex feedback effect: the most important parameter here is the 6th, // the feedback control. Feed the input with some audio (the looped default audio file, for // example). Let the feedback grow. It will gradually decrease when the sound is muted. // // __Be careful with your ears, this can get very loud.__ // process = Granola(5, 10).grains(0, _, 4.72, 0, 1, 0.4, 1, 0.6, 0.604, 3, 0.972, 0, 0, 0.5); ``` */ // The code below is organized in 2 parts: The Granola grain processor, then some // utility functions. Granola(BUFFER_DURATION, CONCURRENT_GRAINS) = environment { // (As far as I know) there is no way to get/fix the sample rate at compile time. // So the actual sample rate at run time may differ from 48k. // Tablesize must be provided at compile time and the actual buffer duration will be greater // than the one requeried if ma.SR < 48000. _tablesize = ceil(BUFFER_DURATION * 48000) : int; _table = rwtable(_tablesize, 0.0); /* The _grain function is responsible of producing a grain of sound. It has one input (+ its numerous parameters) and 2 outputs. Its input is an audio signal from which the gran is produced and 2 outputs the grain and a gate. The gate equals 1 when the _grain function produces a grain and 0 otherwise. #### Usage ``` _ : _grain(grain_number, trigger, writeIndex, g_active, time_ctrl, size_ctrl, pitch_ctrl, reverse_ctrl, plateau_width_ctrl, plateau_position_ctrl) : _, _ ``` Where: * grain_number: (int > 0) a constant number identifying each instance of the _grain function. This parameter is currently unused. * trigger: [0|1] A rising edge of the trigger parameter fires the playback of a grain. * writeIndex: (int ∈ [0, tablesize - 1]) the current position of the _table writeIndex. * g_active: (int ∈ [1, `CONCURRENT_GRAINS`]) a number used to differenciate succesive grains playback. It is increased at each triggered grain (modulo the number of _grain instances). At the moment, it is used to play a different chunck of the _table when the recording is FREEZEd. * time_ctrl: [0, 1] controls how far the grains (the play heads) are distributed across the _table from the write head/writeIndex. * size_ctrl: [0.03, `BUFFER_DURATION`] the duration of the playback. * pitch_ctrl: (float > 0) a ratio of the playback speed relative to `ma.SR`. * reverse_ctrl: [0|1] 0: forward playback, 1: backward playback. * plateau_width_ctrl: [0, 1] the width of the window envelope plateau. The window envelope has 3 parts: a rising edge, a plateau (of amplitude 1), a falling edge. When the plateau width equals 0, the rising edge is immediatly followed by the falling edge and, when the plateau width equals 1, rising and falling edge are instantaneous. * plateau_position_ctrl: [0, 1] the position of the window envelope plateau. When 0: the plateau is at the beginning of the window (it implies an instantaneous rising edge), when 1: the plateau is at the end of the window (it implies an instantaneous falling edge). */ _grain(grain_number, trigger, writeIndex, g_active, time_ctrl, size_ctrl, pitch_ctrl, reverse_ctrl, plateau_width_ctrl, plateau_position_ctrl) = (writeIndex, _, readIndex : _table : *(envelope)), gate with { // g_size: the number of samples of the grain // g_speed: the speed factor of the grain playback // g_playback_size: the duration of the playback (in samples) g_size = size_ctrl : ba.latch(trigger) : *(ma.SR) : int; g_speed = pitch_ctrl; g_playback_size = g_size / g_speed : ba.latch(trigger) : int; g_direction = select2(reverse_ctrl, 1, -1) : ba.latch(trigger); // TIME controls how far the grains (the play heads) are distributed // across the table. This way, two consecutive SEEDing produce two different grains. g_start_index = writeIndex + (_tablesize * time_ctrl * g_active / CONCURRENT_GRAINS) : ba.latch(trigger) : int; // compute window attack and sustain in proportions of the total envelope // from plateau width and position g_sustain = plateau_width_ctrl : ba.latch(trigger); g_attack = plateau_position_ctrl * (1 - g_sustain) : ba.latch(trigger); // grain clocking count = counter(g_playback_size, (g_size - 1) * g_direction, trigger); // table read index readIndex = (g_start_index + count) % _tablesize : int; // TODO? Beads stops playback when readIndex reaches/crosses writeIndex. // Window // Compute the env_gate. It has to be on during attack and sustain, then has to go // off to trigger the release of the envelope. // Compute the sample index (threshold) value at envelope release start: // When the grain is played forward, count goes from 0 to g_size - 1, while // when it is played backward, count goes from g_size - 1 to 0. forward_release_index = (g_attack + g_sustain) * (g_size - 1); backward_release_index = (1 - g_attack - g_sustain) * (g_size - 1); // As count is equals 0 when the grain is free (isn't playing), env_gate has // to be "gated". env_gate = gate & select2(g_direction < 0, count < forward_release_index, count > backward_release_index); // compute attack and release times in seconds envelopet = float(g_playback_size) / float(ma.SR); at = envelopet * g_attack; rt = envelopet * (1 - (g_attack + g_sustain)); envelope = env_gate : en.asr(at, 1, rt) : *(gate);// : ba.lin2LogGain; gate = count : >(0); }; /* The grains function gets multiple parameters in order to control grain creation. Some parameters are processed locally the rest is passed to the parallelized _grain-functions. #### Usage ``` _ : grains(freeze_ctrl, writeIndex_ctrl, density_ctrl, seed_ctrl, input_gain_ctrl, feedback_ctrl, output_gain_ctrl, wetting_ctrl, time_ctrl, size_ctrl, pitch_ctrl, reverse_ctrl, plateau_width_ctrl, plateau_position_ctrl) : _ ``` Where: * freeze_ctrl: [0|1] 0: the grains function input is continuously recorded in a looping buffer, 1: the input isn't recorded. * writeIndex_disp: a function that takes one parameter corresponding to the current position of the _table write head. The current position is an int ∈ [0, `_tablesize` - 1]. * density_ctrl: (float) period in seconds between 2 automatic triggering of a grain. Values lesser than 0.01 are ignored (doesn't trigger). * seed_ctrl: [0|1] a transition from 0 to 1 triggers a grain. * input_gain_ctrl: (float) input gain. * feedback_ctrl: [0, 1] feedback gain. * output_gain_ctrl: (float) input gain. * wetting_ctrl: [0, 1] dry/wet control value. 0: dry, 1: wet. * time_ctrl: [0, 1] this parameter is passed to the _grain function. * size_ctrl: [0.03, `BUFFER_DURATION`] this parameter is passed to the _grain function. * pitch_ctrl: (float > 0) this parameter is passed to the _grain function. * reverse_ctrl: [0|1] this parameter is passed to the _grain function. * plateau_width_ctrl: [0, 1] this parameter is passed to the _grain function. * plateau_position_ctrl: [0, 1] this parameter is passed to the _grain function. */ grains(freeze_ctrl, writeIndex_disp, density_ctrl, seed_ctrl, input_gain_ctrl, feedback_ctrl, output_gain_ctrl, wetting_ctrl, time_ctrl, size_ctrl, pitch_ctrl, reverse_ctrl, plateau_width_ctrl, plateau_position_ctrl) = // The output of the grains is fed back into the input stage. (input_stage : ((voices_parameters : g_voices), _)) ~ _ : output_stage with { // period (in samples) of the grain triggering g_density = ma.SR / max(density_ctrl, 0.01); // g_active counts the number of grains actived (modulo the total number of grains). // At each new seed, it has its value increased by 1 modulo CONCURRENT_GRAINS. // It allows the spread some behavior across the triggered grains. // For instance, passing increasing values to the grains allows them to be spread across the table. trigger = (seed_ctrl : ba.impulsify), ba.pulse(g_density) * (density_ctrl >= 0.01) :> _; g_active = trigger : (+ : %(CONCURRENT_GRAINS)) ~ _ : +(1); // The input_stage has 2 inputs (audio input and feedback) and 2 identical outputs // (one for the voices and for the dry signal) input_stage = (*(feedback_ctrl) : co.limiter_1176_R4_mono), *(input_gain_ctrl * (1 - freeze_ctrl)) : + <: si.bus(2); // The output_stage has 2 inputs (the wet and the dry one., the dry input come directly // from the input_stage) and one output (the mix of the two inputs with some gain). output_stage = *(wetting_ctrl), *(1 - wetting_ctrl) :> *(output_gain_ctrl); // The writeIndex travels the table indices continuously except when the freeze button // is engaged. writeIndex = writeIndex_counter(_tablesize, 1 - freeze_ctrl) : int <: attach(_, writeIndex_disp) with { // TODO? When frozen, smooth the transition between the the newest sample and the oldest. writeIndex_counter(size, run) = %(size) ~ +(run); }; // Voices parameters voices_parameters = writeIndex, g_active, time_ctrl, size_ctrl, pitch_ctrl, reverse_ctrl, plateau_width_ctrl, plateau_position_ctrl, _; // DC offset may appear with short grains, it is removed with the dcblockerat filter stage // grain() has 8 parameters: g_active and the audio input + 6 control signals g_voices = voices(CONCURRENT_GRAINS, _grain, 9, 1, trigger) : fi.dcblockerat(16); }; /* The ui function builds a Granola's user interface and then, pass their values to the grains function. #### Usage ``` _ : ui(uix) : _ ``` Where: * uix: (int) the id of the Granola's UI instance. Note: Multiple Granola instances share the same user interface when they have the same uix. */ ui(uix) = hgroup("granola %uix", grains(freeze_ui, writeIndex_ui, density_ui, seed_ui, input_gain_ui, feedback_ui, output_gain_ui, wetting_ui, time_ui, size_ui, pitch_ui, reverse_ui, plateau_width_ui, plateau_position_ui)) with { // FREEZE / recording freeze_ui = checkbox("v:global/v:index/[1]Freeze"); writeIndex_ui = hbargraph("v:global/v:index/[0]writeIndex", 0, _tablesize - 1); // Automatic triggering from 0.1 to 1000Hz density_ui = hslider("v:grains/[0]density[unit:Hz][scale:log]", 1, 0.01, 1000, 0.01) : si.smoo; // Manual triggering seed_ui = button("v:grains/SEED"); // Input Gain input_gain_ui = vslider("v:global/h:volumes/h:input/[0]gain", 0, -1.5, 1, 0.01) : si.smoo : bipollin2exppos(100); // Feedback feedback_ui = vslider("v:global/h:volumes/h:input/[1]feedback", 0, 0, 1, 0.01) : si.smoo; // Output gain output_gain_ui = vslider("v:global/h:volumes/h:output/[1]gain", 0, -1, 1, 0.01) : si.smoo : bipollin2exppos(100); // dry (0) / wet (1) wetting_ui = vslider("v:global/h:volumes/h:output/[0]dry/wet[tooltip:0:dry, 1:wet]", 0.5, 0, 1, 0.01) : si.smoo; // position in the table time_ui = hslider("v:grains/[0]time", 0, 0, 1, 0.001) : si.smoo; // Grain size size_ui = hslider("v:grains/[2]size[unit:s]", 0.5, 0.03, BUFFER_DURATION, 0.01) : si.smoo; // Grain pitch pitch_ui = hslider("v:grains/[5]pitch[unit:semi]", 0, -24, 24, 0.5) : ba.semi2ratio; // Backward playback reverse_ui = checkbox("v:grains/[6]REVERSE"); // Grain envelope shape shape_ui = hslider("v:grains/[7]shape", 0, 0, 1, 0.01); // In order to reduce the number of control knobs, the window plateau width and plateau position // are extrapolated from a single shape control. The shape control varies from 0 to 1, smoothly // morphing the window envelope from a constant 1, to a decreasing ramp, to a triangle and to an // increasing ramp/saw. plateau_width_ui = 1 - min(shape_ui * 3, 1); plateau_position_ui = max((3 * shape_ui / 2) - 0.5, 0); /* // Window plateau width plateau_width_ui = hslider("v:grains/v:window/[0]plateau_width", 0.5, 0, 1, 0.001); // Window plateau position plateau_position_ui = hslider("v:grains/v:window/[1]plateau_position", 0.5, 0.05, 0.95, 0.001); */ }; /* The demo function builds a Granola instance with a limiter, a low-pass filter and a reverb connected to its (stereo) output. #### Usage ``` _ : demo : _, _ ``` */ demo = ui(0) : co.limiter_1176_R4_mono : hgroup("utilities", fi.resonlp(cutoff_freq,Q,gain) <: dm.zita_light) with { cutoff_freq = hslider("v:resonlp/[0]cutoff_freq",8000,0,8000,0.01) : si.smoo; Q = hslider("v:resonlp/[1]Q",1,1,10,0.01) : si.smoo; gain = hslider("v:resonlp/[2]gain",1,0,2,0.01):si.smoo; }; }; /* --- Utility functions ---------------------------------------------------------------- */ /* The voices function implements a simple polyphony system that distributes triggers on parallel voice functions. #### Usage ``` si.bus(VOICE_PARAM_COUNT) : voices(VOICE_COUNT, voice, VOICE_PARAM_COUNT, VOICE_OUTPUT_COUNT, trigger) : _ ``` Where: * VOICE_COUNT: (int) number of simultaneous voices. * VOICE_PARAM_COUNT: (int) number of parameters routed to the voices. * VOICE_OUTPUT_COUNT: (int) number of outputs routed from the voices. * trigger: [0|1] a rising edge triggers a voice among those available. If none are available, the trigger is ignored. * voice: A function with (VOICE_PARAM_COUNT + 2) parameters and (VOICE_OUTPUT_COUNT + 1) outputs. The 2 mandatory parameters are: - _voice_number_: (int > 0) an unique id for each voice. - _trigger_: [0|1] a rising edge triggers the voice. - Other parameters depends on the voice implementation and are up to the programmer. The voice function outputs are: - VOICE_OUTPUT_COUNT signals corresponding to the actual voice output/job. - A gate equal to 1 when the voice is busy/unavailable producing the expected signal. */ voices(VOICE_COUNT, voice, VOICE_PARAM_COUNT, VOICE_OUTPUT_COUNT, trigger) = ((_ * trigger), si.bus(VOICE_PARAM_COUNT) : parallel_voices(voice)) ~ _ : !, si.bus(VOICE_OUTPUT_COUNT) with { // parallel_voices // The voices are numbered from 1 to VOICE_COUNT // inputs // The voice // A trigger with a value corresponding with an available (the last/greatest) voice // outputs // The number of the last available voice (0 meaning that there is no more voice available) // The summed outputs of the voices parallel_voices(voice, voice_trigger) = voice_trigger_bus, voice_param_bus : ro.interleave(VOICE_COUNT,VOICE_PARAM_COUNT + 1) : par(v, VOICE_COUNT, voice_wrapper(voice, v + 1)) : ro.interleave(VOICE_OUTPUT_COUNT + 1,VOICE_COUNT) : voice_output_bus, ba.parallelMax(VOICE_COUNT) : ro.crossn1(VOICE_OUTPUT_COUNT) with { voice_trigger_bus = voice_trigger <: si.bus(VOICE_COUNT); voice_param_bus = par(b, VOICE_PARAM_COUNT, _ <: si.bus(VOICE_COUNT)); voice_output_bus = par(b, VOICE_OUTPUT_COUNT, si.bus(VOICE_COUNT) :> _); // As a voice, voice_wrapper has 2 outputs, a signal and a gate. However the voice and voice_wrapper //gates behaves inversely as described in the following table: // voice gate | voice_wrapper gate // ----------------+----------------------- // 0 | v (the voice number) // 1 | 0 // When the voice gate is greater than 0, it means that the voice is busy. So when the voice_wrapper // gate is greater than 0, it means that the corresponding voice is free to be used. voice_wrapper(voice, v, called_voice) = voice(v, v == called_voice) : si.bus(VOICE_OUTPUT_COUNT), ((1 - _) * v); }; }; // value in [-1, 1] // produces results in [1/max_output, max_output] bipollin2exppos(max_output, value) = exp(value * log(max_output)); // If scale >= 0, counts from 0 to scale in (period - 1) steps then goes back to 0. // If scale < 0, counts from -scale to 0 in (period - 1) steps then goes back to 0. // The trigger is inhibited when the counter counts to prevent retriggering. counter(period, scale, trigger) = (trigger & (_ == 0) : count) ~ _ // The previous recursion allows to inhibit the trigger while the counter is active. // The trigger is passed to the counter when the counter output equals 0. with { // The counter will count in p steps then will go back to 0. Hence, the whole // process will be at the specified period. p = max(1, period - 1); // The counter will count from start in delta direction. start = select2(scale >= 0, p, 0); delta = select2(scale >= 0, -1, 1); // Resetting the counter output to 0 after the count is done with _ <: *(_ != _') // i.e. the counter doesn't change anymore so its output is multiplied by 0. // Scaling from p to scale is done with _ : /(p) : *(abs(scale)) count(trigger) = select2(trigger > trigger', +(delta) : max(0) : min(p), start) ~ _ <: *(_ != _') : /(p) : *(abs(scale)); };
https://raw.githubusercontent.com/jlp6k/faust-things/1f48711661adda919ec7661721eb195fb75154c3/Granola.dsp
faust
The version number is YYYY.M.n In order to test this program, please uncomment the following line by removing the initial // process = Granola(5, 15).demo; It will create a Granola with a 5 seconds buffer and 15 grains at most. Feel free to test other parameter values (w/r to your computer's power). A short documentation is available below. Granola is a granular audio live feed processor. Copyright (C) 2022 Jean-Louis Paquelin <[email protected]> Granola is a 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 any later version. Granola 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 Granola. If not, see <http://www.gnu.org/licenses/>. Granola is a monophonic granular live feed processor. The grain processor is inspired by the Mutable Instruments Beads. The grain window shape control is inspired by the GR-1 Granular synthesizer from Tasty Chips Electronics. #### Specifications * Audio I/O - Manual input and output gain control. - Recording time: `BUFFER_DURATION`. - The FREEZE button freezes the content of the recording table. - Feedback path with attenuation and limiter (with 1 sample delay). The feedback signal comes from the grains output (it's before the dry/wet crossfader). - Dry/Wet control. - TODO: Stereo I/O with automatic level detection with a limiter. - TODO: Gate signal in sync with the grains. - TODO: Antialiased output. - TODO: Spatialized output. * Grains generation modes - The SEED button triggers a grain. - Automatically trigger grains at a periodic rate with the DENSITY parameter (at maximum density there are 1000 grains generated per second (M.I. Beads has a maximum rate of ~260 grains per second). Note: The actual number of triggered grains cannot exceed the `CONCURRENT_GRAINS` value (30 for M.I. Beads). - TODO: Automatically trigger grains at a randomized rate. - TODO: Start a chain of delayed and pitched grains instead of a single one. * Grain parameters - TIME: Controls the playback position of each grain within the table. In other words, it delays the grains. - SIZE: Grain duration from 0.03 seconds to the table length, forward or backward playback. - SHAPE: The shape of the grain envelope. The shape control allows to morph the shape from a square (in this case the grain original amplitude is maintained), to an inverted saw (slow release), to a triangle (attack and release time are the same), and finally to a saw (slow attack). - PITCH: The pitch of the grain (-2..+2 octaves). Note: The four grain parameters are latched when a grain is triggered. Hence, the grain parameters remain the same throughout the grain playback but they may differ for multiple grains. - TODO: TIME slew limiter for tape like scrubing effect. #### Usage ``` _ : Granola(BUFFER_DURATION, CONCURRENT_GRAINS).ui(uix) : _ ``` Where: * `BUFFER_DURATION`: buffer duration in seconds. * `CONCURRENT_GRAINS`: (int) number of grains allocated. * `uix`: (int) the UI instance number. A demo function of Granola with a limiter, a LPF and a reverb on the output. ``` _ : Granola(BUFFER_DURATION, CONCURRENT_GRAINS).demo : _, _ ``` #### Examples ``` // A Granola's demonstration setup with a 5 seconds buffer and an up-to-15-grains polyphony. process = Granola(5, 15).demo; ``` ``` // A Granola grain processor. // It has a 1 second audio buffer and up to 30 grains playing a the same time. process = Granola(1, 30).ui(0); ``` ``` // Two Granola instances allowing to process each channel of a stereo signal differently. // They have a 5 seconds audio buffer and up to 15 grains playing a the same time. process = Granola(5, 15).ui(0), Granola(5, 15).ui(1); ``` ``` // Two Granola instances sharing the same user interface making a stereo grain processor. // They have a 5 seconds audio buffer and up to 15 grains playing a the same time. process = Granola(5, 15).ui(0), Granola(5, 15).ui(0); ``` ``` // As the Granola grain processor is able to play many copies of the input signal simultaneously, // it may rapidly saturate its output. This could be avoided by manualy reducing the output gain, // by selecting a smoother grain-window shape and/or by placing a limiter in the circuit path. // Also note that Granola pairs well with a reverb. process = Granola(2, 30).ui(0) : co.limiter_1176_R4_mono <: dm.zita_light; ``` ``` // Granola used as a delay like effect. Parameters are taylored for the default audio file // of the Faust web IDE (wait 5 seconds to let the table be filled). Play it looped. process = Granola(5, 10).grains(0, _, 4.76, 0, 0.5, 0, 0.5, 0.5, 0.03, 0.5, 1, 0, 0, 0.5); ``` ``` // Granola used as a complex feedback effect: the most important parameter here is the 6th, // the feedback control. Feed the input with some audio (the looped default audio file, for // example). Let the feedback grow. It will gradually decrease when the sound is muted. // // __Be careful with your ears, this can get very loud.__ // process = Granola(5, 10).grains(0, _, 4.72, 0, 1, 0.4, 1, 0.6, 0.604, 3, 0.972, 0, 0, 0.5); ``` The code below is organized in 2 parts: The Granola grain processor, then some utility functions. (As far as I know) there is no way to get/fix the sample rate at compile time. So the actual sample rate at run time may differ from 48k. Tablesize must be provided at compile time and the actual buffer duration will be greater than the one requeried if ma.SR < 48000. The _grain function is responsible of producing a grain of sound. It has one input (+ its numerous parameters) and 2 outputs. Its input is an audio signal from which the gran is produced and 2 outputs the grain and a gate. The gate equals 1 when the _grain function produces a grain and 0 otherwise. #### Usage ``` _ : _grain(grain_number, trigger, writeIndex, g_active, time_ctrl, size_ctrl, pitch_ctrl, reverse_ctrl, plateau_width_ctrl, plateau_position_ctrl) : _, _ ``` Where: * grain_number: (int > 0) a constant number identifying each instance of the _grain function. This parameter is currently unused. * trigger: [0|1] A rising edge of the trigger parameter fires the playback of a grain. * writeIndex: (int ∈ [0, tablesize - 1]) the current position of the _table writeIndex. * g_active: (int ∈ [1, `CONCURRENT_GRAINS`]) a number used to differenciate succesive grains playback. It is increased at each triggered grain (modulo the number of _grain instances). At the moment, it is used to play a different chunck of the _table when the recording is FREEZEd. * time_ctrl: [0, 1] controls how far the grains (the play heads) are distributed across the _table from the write head/writeIndex. * size_ctrl: [0.03, `BUFFER_DURATION`] the duration of the playback. * pitch_ctrl: (float > 0) a ratio of the playback speed relative to `ma.SR`. * reverse_ctrl: [0|1] 0: forward playback, 1: backward playback. * plateau_width_ctrl: [0, 1] the width of the window envelope plateau. The window envelope has 3 parts: a rising edge, a plateau (of amplitude 1), a falling edge. When the plateau width equals 0, the rising edge is immediatly followed by the falling edge and, when the plateau width equals 1, rising and falling edge are instantaneous. * plateau_position_ctrl: [0, 1] the position of the window envelope plateau. When 0: the plateau is at the beginning of the window (it implies an instantaneous rising edge), when 1: the plateau is at the end of the window (it implies an instantaneous falling edge). g_size: the number of samples of the grain g_speed: the speed factor of the grain playback g_playback_size: the duration of the playback (in samples) TIME controls how far the grains (the play heads) are distributed across the table. This way, two consecutive SEEDing produce two different grains. compute window attack and sustain in proportions of the total envelope from plateau width and position grain clocking table read index TODO? Beads stops playback when readIndex reaches/crosses writeIndex. Window Compute the env_gate. It has to be on during attack and sustain, then has to go off to trigger the release of the envelope. Compute the sample index (threshold) value at envelope release start: When the grain is played forward, count goes from 0 to g_size - 1, while when it is played backward, count goes from g_size - 1 to 0. As count is equals 0 when the grain is free (isn't playing), env_gate has to be "gated". compute attack and release times in seconds : ba.lin2LogGain; The grains function gets multiple parameters in order to control grain creation. Some parameters are processed locally the rest is passed to the parallelized _grain-functions. #### Usage ``` _ : grains(freeze_ctrl, writeIndex_ctrl, density_ctrl, seed_ctrl, input_gain_ctrl, feedback_ctrl, output_gain_ctrl, wetting_ctrl, time_ctrl, size_ctrl, pitch_ctrl, reverse_ctrl, plateau_width_ctrl, plateau_position_ctrl) : _ ``` Where: * freeze_ctrl: [0|1] 0: the grains function input is continuously recorded in a looping buffer, 1: the input isn't recorded. * writeIndex_disp: a function that takes one parameter corresponding to the current position of the _table write head. The current position is an int ∈ [0, `_tablesize` - 1]. * density_ctrl: (float) period in seconds between 2 automatic triggering of a grain. Values lesser than 0.01 are ignored (doesn't trigger). * seed_ctrl: [0|1] a transition from 0 to 1 triggers a grain. * input_gain_ctrl: (float) input gain. * feedback_ctrl: [0, 1] feedback gain. * output_gain_ctrl: (float) input gain. * wetting_ctrl: [0, 1] dry/wet control value. 0: dry, 1: wet. * time_ctrl: [0, 1] this parameter is passed to the _grain function. * size_ctrl: [0.03, `BUFFER_DURATION`] this parameter is passed to the _grain function. * pitch_ctrl: (float > 0) this parameter is passed to the _grain function. * reverse_ctrl: [0|1] this parameter is passed to the _grain function. * plateau_width_ctrl: [0, 1] this parameter is passed to the _grain function. * plateau_position_ctrl: [0, 1] this parameter is passed to the _grain function. The output of the grains is fed back into the input stage. period (in samples) of the grain triggering g_active counts the number of grains actived (modulo the total number of grains). At each new seed, it has its value increased by 1 modulo CONCURRENT_GRAINS. It allows the spread some behavior across the triggered grains. For instance, passing increasing values to the grains allows them to be spread across the table. The input_stage has 2 inputs (audio input and feedback) and 2 identical outputs (one for the voices and for the dry signal) The output_stage has 2 inputs (the wet and the dry one., the dry input come directly from the input_stage) and one output (the mix of the two inputs with some gain). The writeIndex travels the table indices continuously except when the freeze button is engaged. TODO? When frozen, smooth the transition between the the newest sample and the oldest. Voices parameters DC offset may appear with short grains, it is removed with the dcblockerat filter stage grain() has 8 parameters: g_active and the audio input + 6 control signals The ui function builds a Granola's user interface and then, pass their values to the grains function. #### Usage ``` _ : ui(uix) : _ ``` Where: * uix: (int) the id of the Granola's UI instance. Note: Multiple Granola instances share the same user interface when they have the same uix. FREEZE / recording Automatic triggering from 0.1 to 1000Hz Manual triggering Input Gain Feedback Output gain dry (0) / wet (1) position in the table Grain size Grain pitch Backward playback Grain envelope shape In order to reduce the number of control knobs, the window plateau width and plateau position are extrapolated from a single shape control. The shape control varies from 0 to 1, smoothly morphing the window envelope from a constant 1, to a decreasing ramp, to a triangle and to an increasing ramp/saw. // Window plateau width plateau_width_ui = hslider("v:grains/v:window/[0]plateau_width", 0.5, 0, 1, 0.001); // Window plateau position plateau_position_ui = hslider("v:grains/v:window/[1]plateau_position", 0.5, 0.05, 0.95, 0.001); The demo function builds a Granola instance with a limiter, a low-pass filter and a reverb connected to its (stereo) output. #### Usage ``` _ : demo : _, _ ``` --- Utility functions ---------------------------------------------------------------- The voices function implements a simple polyphony system that distributes triggers on parallel voice functions. #### Usage ``` si.bus(VOICE_PARAM_COUNT) : voices(VOICE_COUNT, voice, VOICE_PARAM_COUNT, VOICE_OUTPUT_COUNT, trigger) : _ ``` Where: * VOICE_COUNT: (int) number of simultaneous voices. * VOICE_PARAM_COUNT: (int) number of parameters routed to the voices. * VOICE_OUTPUT_COUNT: (int) number of outputs routed from the voices. * trigger: [0|1] a rising edge triggers a voice among those available. If none are available, the trigger is ignored. * voice: A function with (VOICE_PARAM_COUNT + 2) parameters and (VOICE_OUTPUT_COUNT + 1) outputs. The 2 mandatory parameters are: - _voice_number_: (int > 0) an unique id for each voice. - _trigger_: [0|1] a rising edge triggers the voice. - Other parameters depends on the voice implementation and are up to the programmer. The voice function outputs are: - VOICE_OUTPUT_COUNT signals corresponding to the actual voice output/job. - A gate equal to 1 when the voice is busy/unavailable producing the expected signal. parallel_voices The voices are numbered from 1 to VOICE_COUNT inputs The voice A trigger with a value corresponding with an available (the last/greatest) voice outputs The number of the last available voice (0 meaning that there is no more voice available) The summed outputs of the voices As a voice, voice_wrapper has 2 outputs, a signal and a gate. However the voice and voice_wrapper gates behaves inversely as described in the following table: voice gate | voice_wrapper gate ----------------+----------------------- 0 | v (the voice number) 1 | 0 When the voice gate is greater than 0, it means that the voice is busy. So when the voice_wrapper gate is greater than 0, it means that the corresponding voice is free to be used. value in [-1, 1] produces results in [1/max_output, max_output] If scale >= 0, counts from 0 to scale in (period - 1) steps then goes back to 0. If scale < 0, counts from -scale to 0 in (period - 1) steps then goes back to 0. The trigger is inhibited when the counter counts to prevent retriggering. The previous recursion allows to inhibit the trigger while the counter is active. The trigger is passed to the counter when the counter output equals 0. The counter will count in p steps then will go back to 0. Hence, the whole process will be at the specified period. The counter will count from start in delta direction. Resetting the counter output to 0 after the count is done with _ <: *(_ != _') i.e. the counter doesn't change anymore so its output is multiplied by 0. Scaling from p to scale is done with _ : /(p) : *(abs(scale))
import("stdfaust.lib"); declare name "Granola"; declare author "Jean-Louis Paquelin"; declare copyright "Copyright (C) 2022 Jean-Louis Paquelin <[email protected]>"; declare license "GNU General Public License v3 or later"; Granola(BUFFER_DURATION, CONCURRENT_GRAINS) = environment { _tablesize = ceil(BUFFER_DURATION * 48000) : int; _table = rwtable(_tablesize, 0.0); _grain(grain_number, trigger, writeIndex, g_active, time_ctrl, size_ctrl, pitch_ctrl, reverse_ctrl, plateau_width_ctrl, plateau_position_ctrl) = (writeIndex, _, readIndex : _table : *(envelope)), gate with { g_size = size_ctrl : ba.latch(trigger) : *(ma.SR) : int; g_speed = pitch_ctrl; g_playback_size = g_size / g_speed : ba.latch(trigger) : int; g_direction = select2(reverse_ctrl, 1, -1) : ba.latch(trigger); g_start_index = writeIndex + (_tablesize * time_ctrl * g_active / CONCURRENT_GRAINS) : ba.latch(trigger) : int; g_sustain = plateau_width_ctrl : ba.latch(trigger); g_attack = plateau_position_ctrl * (1 - g_sustain) : ba.latch(trigger); count = counter(g_playback_size, (g_size - 1) * g_direction, trigger); readIndex = (g_start_index + count) % _tablesize : int; forward_release_index = (g_attack + g_sustain) * (g_size - 1); backward_release_index = (1 - g_attack - g_sustain) * (g_size - 1); env_gate = gate & select2(g_direction < 0, count < forward_release_index, count > backward_release_index); envelopet = float(g_playback_size) / float(ma.SR); at = envelopet * g_attack; rt = envelopet * (1 - (g_attack + g_sustain)); gate = count : >(0); }; grains(freeze_ctrl, writeIndex_disp, density_ctrl, seed_ctrl, input_gain_ctrl, feedback_ctrl, output_gain_ctrl, wetting_ctrl, time_ctrl, size_ctrl, pitch_ctrl, reverse_ctrl, plateau_width_ctrl, plateau_position_ctrl) = (input_stage : ((voices_parameters : g_voices), _)) ~ _ : output_stage with { g_density = ma.SR / max(density_ctrl, 0.01); trigger = (seed_ctrl : ba.impulsify), ba.pulse(g_density) * (density_ctrl >= 0.01) :> _; g_active = trigger : (+ : %(CONCURRENT_GRAINS)) ~ _ : +(1); input_stage = (*(feedback_ctrl) : co.limiter_1176_R4_mono), *(input_gain_ctrl * (1 - freeze_ctrl)) : + <: si.bus(2); output_stage = *(wetting_ctrl), *(1 - wetting_ctrl) :> *(output_gain_ctrl); writeIndex = writeIndex_counter(_tablesize, 1 - freeze_ctrl) : int <: attach(_, writeIndex_disp) with { writeIndex_counter(size, run) = %(size) ~ +(run); }; voices_parameters = writeIndex, g_active, time_ctrl, size_ctrl, pitch_ctrl, reverse_ctrl, plateau_width_ctrl, plateau_position_ctrl, _; g_voices = voices(CONCURRENT_GRAINS, _grain, 9, 1, trigger) : fi.dcblockerat(16); }; ui(uix) = hgroup("granola %uix", grains(freeze_ui, writeIndex_ui, density_ui, seed_ui, input_gain_ui, feedback_ui, output_gain_ui, wetting_ui, time_ui, size_ui, pitch_ui, reverse_ui, plateau_width_ui, plateau_position_ui)) with { freeze_ui = checkbox("v:global/v:index/[1]Freeze"); writeIndex_ui = hbargraph("v:global/v:index/[0]writeIndex", 0, _tablesize - 1); density_ui = hslider("v:grains/[0]density[unit:Hz][scale:log]", 1, 0.01, 1000, 0.01) : si.smoo; seed_ui = button("v:grains/SEED"); input_gain_ui = vslider("v:global/h:volumes/h:input/[0]gain", 0, -1.5, 1, 0.01) : si.smoo : bipollin2exppos(100); feedback_ui = vslider("v:global/h:volumes/h:input/[1]feedback", 0, 0, 1, 0.01) : si.smoo; output_gain_ui = vslider("v:global/h:volumes/h:output/[1]gain", 0, -1, 1, 0.01) : si.smoo : bipollin2exppos(100); wetting_ui = vslider("v:global/h:volumes/h:output/[0]dry/wet[tooltip:0:dry, 1:wet]", 0.5, 0, 1, 0.01) : si.smoo; time_ui = hslider("v:grains/[0]time", 0, 0, 1, 0.001) : si.smoo; size_ui = hslider("v:grains/[2]size[unit:s]", 0.5, 0.03, BUFFER_DURATION, 0.01) : si.smoo; pitch_ui = hslider("v:grains/[5]pitch[unit:semi]", 0, -24, 24, 0.5) : ba.semi2ratio; reverse_ui = checkbox("v:grains/[6]REVERSE"); shape_ui = hslider("v:grains/[7]shape", 0, 0, 1, 0.01); plateau_width_ui = 1 - min(shape_ui * 3, 1); plateau_position_ui = max((3 * shape_ui / 2) - 0.5, 0); }; demo = ui(0) : co.limiter_1176_R4_mono : hgroup("utilities", fi.resonlp(cutoff_freq,Q,gain) <: dm.zita_light) with { cutoff_freq = hslider("v:resonlp/[0]cutoff_freq",8000,0,8000,0.01) : si.smoo; Q = hslider("v:resonlp/[1]Q",1,1,10,0.01) : si.smoo; gain = hslider("v:resonlp/[2]gain",1,0,2,0.01):si.smoo; }; }; voices(VOICE_COUNT, voice, VOICE_PARAM_COUNT, VOICE_OUTPUT_COUNT, trigger) = ((_ * trigger), si.bus(VOICE_PARAM_COUNT) : parallel_voices(voice)) ~ _ : !, si.bus(VOICE_OUTPUT_COUNT) with { parallel_voices(voice, voice_trigger) = voice_trigger_bus, voice_param_bus : ro.interleave(VOICE_COUNT,VOICE_PARAM_COUNT + 1) : par(v, VOICE_COUNT, voice_wrapper(voice, v + 1)) : ro.interleave(VOICE_OUTPUT_COUNT + 1,VOICE_COUNT) : voice_output_bus, ba.parallelMax(VOICE_COUNT) : ro.crossn1(VOICE_OUTPUT_COUNT) with { voice_trigger_bus = voice_trigger <: si.bus(VOICE_COUNT); voice_param_bus = par(b, VOICE_PARAM_COUNT, _ <: si.bus(VOICE_COUNT)); voice_output_bus = par(b, VOICE_OUTPUT_COUNT, si.bus(VOICE_COUNT) :> _); voice_wrapper(voice, v, called_voice) = voice(v, v == called_voice) : si.bus(VOICE_OUTPUT_COUNT), ((1 - _) * v); }; }; bipollin2exppos(max_output, value) = exp(value * log(max_output)); counter(period, scale, trigger) = (trigger & (_ == 0) : count) ~ _ with { p = max(1, period - 1); start = select2(scale >= 0, p, 0); delta = select2(scale >= 0, -1, 1); count(trigger) = select2(trigger > trigger', +(delta) : max(0) : min(p), start) ~ _ <: *(_ != _') : /(p) : *(abs(scale)); };
a4382f017eac96a2f932bc64b786942215fc4e2bcacf696cb490680f04ebb882
daniel-kelley/gac
seq_ui.dsp
import("stdfaust.lib"); gac = library("gac.lib"); // controls // sequencer controls and programming freq_c = hslider("clock",1,0.1,200,0.1); len = hslider("len",4,1,gac.N,1); widx = hslider("idx",0,0,gac.N-1,1); fval = hslider("fval",20,20,2000,1); sval = hslider("sval",0,0,1,0.01); pgmf = button("pgmf"); pgms = button("pgms"); // signal attack = hslider("attack",0.05,0,1,0.05); release = hslider("release",0.05,0,1,0.05); // final output vol = hslider("volume [unit:dB]", -96, -96, 6, 0.1) : ba.db2linear : si.smoo; // data // fixed freq_s_data = waveform{ 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 0 // dummy for write }; // "half sine wave" for size-1 entries. shape_s_func(size) = float(ba.time)*2.0*(2.0*ma.PI)/float(size-1) : sin; // // blocks // // *** sequencer clk = gac.clock(freq_c); ridx = gac.index(clk,len); freq_s = (freq_s_data, widx, fval, pgmf, ridx) : gac.lookup; shape_s = (gac.N+1, shape_s_func(gac.N+1), widx, sval, pgms, ridx) : gac.lookup; // *** signal osc = gac.osc(freq_s, shape_s); gate = gac.ar(attack,release,gac.osh(attack,clk)); process = osc * gate * vol;
https://raw.githubusercontent.com/daniel-kelley/gac/cdc00a3d467abb9c3f212ba9b60efe3df07e0385/test/seq_ui.dsp
faust
controls sequencer controls and programming signal final output data fixed dummy for write "half sine wave" for size-1 entries. blocks *** sequencer *** signal
import("stdfaust.lib"); gac = library("gac.lib"); freq_c = hslider("clock",1,0.1,200,0.1); len = hslider("len",4,1,gac.N,1); widx = hslider("idx",0,0,gac.N-1,1); fval = hslider("fval",20,20,2000,1); sval = hslider("sval",0,0,1,0.01); pgmf = button("pgmf"); pgms = button("pgms"); attack = hslider("attack",0.05,0,1,0.05); release = hslider("release",0.05,0,1,0.05); vol = hslider("volume [unit:dB]", -96, -96, 6, 0.1) : ba.db2linear : si.smoo; freq_s_data = waveform{ 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, 440.0,440.0,440.0,440.0,440.0,523.3,587.3,659.3, }; shape_s_func(size) = float(ba.time)*2.0*(2.0*ma.PI)/float(size-1) : sin; clk = gac.clock(freq_c); ridx = gac.index(clk,len); freq_s = (freq_s_data, widx, fval, pgmf, ridx) : gac.lookup; shape_s = (gac.N+1, shape_s_func(gac.N+1), widx, sval, pgms, ridx) : gac.lookup; osc = gac.osc(freq_s, shape_s); gate = gac.ar(attack,release,gac.osh(attack,clk)); process = osc * gate * vol;
6bcbd358aa592872559141f6c4cb74ee7b27be5a7224395b6d45eddc67c5eaf7
daniel-kelley/gac
seq_panel.dsp
// // Handwritten GAC panel prototype // //import("stdfaust.lib"); gac = library("gac.lib"); // Control constants and converters CONTROL_MIN = 0.0; CONTROL_MAX = 1.0; CONTROL_STEP = 0.01; CONTROL_DEFAULT = CONTROL_MIN; control2control(n) = n; FREQ_MIN = 0.0; FREQ_MAX = 20000.0; FREQ_STEP = 0.01; FREQ_DEFAULT = FREQ_MIN; freq2control(n) = n/FREQ_MAX; control2freq(n) = n*FREQ_MAX; PERIOD_MIN = 0.0; PERIOD_MAX = 1000.0; PERIOD_STEP = 0.01; PERIOD_DEFAULT = PERIOD_MIN; period2control(n) = n/PERIOD_MAX; control2period(n) = n*PERIOD_MAX; Q_MIN = 0.0; Q_MAX = 100.0; Q_STEP = 0.01; Q_DEFAULT = 1; q2control(n) = n/Q_MAX; control2q(n) = n*Q_MAX; COUNT_MIN = 0; COUNT_MAX = gac.N - 1; COUNT_STEP = 1; COUNT_DEFAULT = COUNT_MIN; count2control(n) = n/COUNT_MAX; control2count(n) = n*COUNT_MAX; // Embed description and osc/midi controls // --- // desc: // outputs: 1 // blocks: // - lookup // - lookup: freq // - index // - osc // - clock // - ar // - osh // - amp // osc: // midi: // ... /////////////////////////////////////////////////////////////////////////////// // lookup1 (freq) // // index1_out (forward reference) lookup1(index1_out) = (lookup_table, lookup_pgm_idx, lookup_pgm_val, lookup_pgm_we, lookup_idx) : gac.lookup : hbargraph("[1][style:numerical]freq",0,FREQ_MAX) with { // <block><block_idx>_<in_arg_typename> lookup_table = waveform{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0.0 // dummy for write; float to force underlying waveform type }; run = checkbox("[2]run"); lookup_pgm_val = nentry("[3]wval",FREQ_DEFAULT,FREQ_MIN,FREQ_MAX,FREQ_STEP); lookup_pgm_idx_f = nentry("[4]widx",0,0,gac.N-1,1); lookup_pgm_we = button("[5]set"); lookup_pgm_idx = int(floor(lookup_pgm_idx_f)); // no mux so run_idx is just index1_out run_idx = index1_out; lookup_idx = select2(run, lookup_pgm_idx, run_idx) : hbargraph("[0][style:numerical]idx",0,gac.N); }; /////////////////////////////////////////////////////////////////////////////// // lookup2 // // ridx=index1_out (forward reference) lookup2(index1_out) = (lookup_table, lookup_pgm_idx, lookup_pgm_val, lookup_pgm_we, lookup_idx) : gac.lookup : hbargraph("[1][style:numerical]val",0,CONTROL_MAX) with { lookup_table = waveform{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0.1 // dummy for write; float to force underlying waveform type, different to prevent waveform coelescing }; run = checkbox("[2]run"); lookup_pgm_val = nentry("[3]wval",CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); lookup_pgm_idx_f = nentry("[4]widx",0,0,gac.N-1,1); lookup_pgm_we = button("[5]set"); lookup_pgm_idx = int(floor(lookup_pgm_idx_f)); // no mux so run_idx is just index1_out run_idx = index1_out; lookup_idx = select2(run, lookup_pgm_idx, run_idx) : hbargraph("[0][style:numerical]idx",0,gac.N); }; /////////////////////////////////////////////////////////////////////////////// // index1 // // clock1_out (forward reference) // osh1_out (forward reference) index1(clock1_out,osh1_out) = (index_clk,index_len) : gac.index with { // logic selector generated index_clk_sel_clock1_clk = checkbox("[0]clock1"); index_clk_sel_osh1_clk = checkbox("[1]osh1"); index_clk = (index_clk_sel_clock1_clk & clock1_out) | (index_clk_sel_osh1_clk & osh1_out); index_len = nentry("len",COUNT_DEFAULT,COUNT_MIN,COUNT_MAX,COUNT_DEFAULT); }; /////////////////////////////////////////////////////////////////////////////// // osc1 // // lookup1_out // lookup2_out // ar1_out (forward reference) osc1(lookup1_out, lookup2_out, ar1_out) = (osc_freq, osc_shape) : gac.osc with { osc_freq_knob = nentry("[0]freq",FREQ_DEFAULT,FREQ_MIN,FREQ_MAX,FREQ_STEP); osc_lookup1_input_freq_knob = nentry("[1]lookup1_freq", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_lookup2_input_freq_knob = nentry("[2]lookup2_freq", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_ar1_input_freq_knob = nentry("[3]ar1_freq", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_freq = (lookup1_out * osc_lookup1_input_freq_knob) + (control2freq(lookup2_out) * osc_lookup2_input_freq_knob) + (control2freq(ar1_out) * osc_ar1_input_freq_knob) + osc_freq_knob ; osc_shape_knob = nentry("[4]shape", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_lookup1_input_shape_knob = nentry("[5]lookup1_shape", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_lookup2_input_shape_knob = nentry("[6]lookup2_shape", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_ar1_input_shape_knob = nentry("[7]ar1_shape", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_shape = (freq2control(lookup1_out) * osc_lookup1_input_shape_knob) + (lookup2_out * osc_lookup2_input_shape_knob) + (ar1_out * osc_ar1_input_shape_knob) + osc_shape_knob ; }; /////////////////////////////////////////////////////////////////////////////// // clock1 // // lookup1_out // lookup2_out // ar1_out (forward reference) clock1(lookup1_out, lookup2_out, ar1_out) = select2(run, step_clock, gac.clock(clock_freq)) with { run = checkbox("[0]run"); step = button("[1]step"); clock_freq_knob = nentry("[2]freq",FREQ_DEFAULT,FREQ_MIN,FREQ_MAX,FREQ_STEP); clock_lookup1_input_freq_knob = nentry("[3]lookup1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); clock_lookup2_input_freq_knob = nentry("[4]lookup2", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); clock_ar1_input_freq_knob = nentry("[5]ar1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); clock_freq = (lookup1_out * clock_lookup1_input_freq_knob) + (control2freq(lookup2_out) * clock_lookup2_input_freq_knob) + (control2freq(ar1_out) * clock_ar1_input_freq_knob) + clock_freq_knob ; step_clock = gac.osh(1.0/clock_freq_knob, step); }; /////////////////////////////////////////////////////////////////////////////// // ar1 // // ar1(lookup1_out, lookup2_out, clock1_out, osh1_out) = (ar_attack, ar_release, ar_gate) : gac.ar with { ar_lookup1_input_attack_knob = nentry("[1]lookup1_attack", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_lookup2_input_attack_knob = nentry("[2]lookup2_attack", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_attack_knob = nentry("[0]attack", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_attack = (control2period(freq2control(lookup1_out)) * ar_lookup1_input_attack_knob) + (control2period(lookup2_out) * ar_lookup2_input_attack_knob) + ar_attack_knob ; ar_lookup1_input_release_knob = nentry("[4]lookup1_release", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_lookup2_input_release_knob = nentry("[5]lookup2_release", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_release_knob = nentry("[3]release", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_release = (control2period(freq2control(lookup1_out)) * ar_lookup1_input_release_knob) + (control2period(lookup2_out) * ar_lookup2_input_release_knob) + ar_release_knob ; ar_gate_sel_clock1 = checkbox("[6]clock1_gate"); ar_gate_sel_osh1 = checkbox("[7]osh1_gate"); ar_gate = (ar_gate_sel_clock1 & clock1_out) | (ar_gate_sel_osh1 & osh1_out); }; /////////////////////////////////////////////////////////////////////////////// // osh1 osh1(lookup1_out, lookup2_out, clock1_out) = (osh_dur, osh_gate) : gac.osh with { osh_lookup1_input_dur_knob = nentry("[1]lookup1", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); osh_lookup2_input_dur_knob = nentry("[2]lookup2", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); osh_dur_knob = nentry("[0]dur", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); osh_dur = (control2period(freq2control(lookup1_out)) * osh_lookup1_input_dur_knob) + (control2period(lookup2_out) * osh_lookup2_input_dur_knob) + osh_dur_knob ; // Only one possibility osh_gate = clock1_out; }; /////////////////////////////////////////////////////////////////////////////// // amp1 amp1(osc1_out, lookup1_out, lookup2_out, ar1_out) = (amp_gain,amp_input) : gac.amp with { amp_input_enable = checkbox("[0] enable osc1"); amp_input = select2(amp_input_enable, 0, osc1_out); amp_lookup1_input_gain_knob = nentry("[1]lookup1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); amp_lookup2_input_gain_knob = nentry("[2]lookup2", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); amp_ar1_input_gain_knob = nentry("[3]ar1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); amp_gain_knob = nentry("[0]gain", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); amp_gain = (freq2control(lookup1_out) * amp_lookup1_input_gain_knob) + (lookup2_out * amp_lookup2_input_gain_knob) + (ar1_out * amp_ar1_input_gain_knob) + amp_gain_knob ; }; /////////////////////////////////////////////////////////////////////////////// // output1 output1(osc1_out, amp1_out) = out with { output_osc1_knob = nentry("[0]osc1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); output_amp1_knob = nentry("[1]amp1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); vol = nentry("[2]vol", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); in = (osc1_out * output_osc1_knob) + (amp1_out * output_amp1_knob); out = in * vol; }; panel(lookup1_out, lookup2_out, index1_out, osc1_out, clock1_out, ar1_out, osh1_out, amp1_out, output1_out) = tgroup("top", vgroup("[0]lookup1", lookup1(index1_out)), vgroup("[1]lookup2", lookup2(index1_out)), vgroup("[2]index1", index1(clock1_out, osh1_out)), vgroup("[3]osc1", osc1(lookup1_out, lookup2_out, ar1_out)), vgroup("[4]clock1", clock1(lookup1_out, lookup2_out, ar1_out)), vgroup("[5]ar1", ar1(lookup1_out, lookup2_out, clock1_out, osh1_out)), vgroup("[6]osh1", osh1(lookup1_out, lookup2_out, clock1_out)), vgroup("[7]amp1", amp1(osc1_out, lookup1_out, lookup2_out, ar1_out)), vgroup("[8]output1", output1(osc1_out,amp1_out))); // copy input to output to facilitate forward referencing copy(lookup1_out, lookup2_out, index1_out, osc1_out, clock1_out, ar1_out, osh1_out, amp1_out, output1_out) = (lookup1_out, lookup2_out, index1_out, osc1_out, clock1_out, ar1_out, osh1_out, amp1_out, output1_out); // manage final outputs output(lookup1_out, lookup2_out, index1_out, osc1_out, clock1_out, ar1_out, osh1_out, amp1_out, output1_out) = (output1_out); process = (panel ~ copy) : output;
https://raw.githubusercontent.com/daniel-kelley/gac/cdc00a3d467abb9c3f212ba9b60efe3df07e0385/test/seq_panel.dsp
faust
Handwritten GAC panel prototype import("stdfaust.lib"); Control constants and converters Embed description and osc/midi controls --- desc: outputs: 1 blocks: - lookup - lookup: freq - index - osc - clock - ar - osh - amp osc: midi: ... ///////////////////////////////////////////////////////////////////////////// lookup1 (freq) index1_out (forward reference) <block><block_idx>_<in_arg_typename> dummy for write; float to force underlying waveform type no mux so run_idx is just index1_out ///////////////////////////////////////////////////////////////////////////// lookup2 ridx=index1_out (forward reference) dummy for write; float to force underlying waveform type, different to prevent waveform coelescing no mux so run_idx is just index1_out ///////////////////////////////////////////////////////////////////////////// index1 clock1_out (forward reference) osh1_out (forward reference) logic selector generated ///////////////////////////////////////////////////////////////////////////// osc1 lookup1_out lookup2_out ar1_out (forward reference) ///////////////////////////////////////////////////////////////////////////// clock1 lookup1_out lookup2_out ar1_out (forward reference) ///////////////////////////////////////////////////////////////////////////// ar1 ///////////////////////////////////////////////////////////////////////////// osh1 Only one possibility ///////////////////////////////////////////////////////////////////////////// amp1 ///////////////////////////////////////////////////////////////////////////// output1 copy input to output to facilitate forward referencing manage final outputs
gac = library("gac.lib"); CONTROL_MIN = 0.0; CONTROL_MAX = 1.0; CONTROL_STEP = 0.01; CONTROL_DEFAULT = CONTROL_MIN; control2control(n) = n; FREQ_MIN = 0.0; FREQ_MAX = 20000.0; FREQ_STEP = 0.01; FREQ_DEFAULT = FREQ_MIN; freq2control(n) = n/FREQ_MAX; control2freq(n) = n*FREQ_MAX; PERIOD_MIN = 0.0; PERIOD_MAX = 1000.0; PERIOD_STEP = 0.01; PERIOD_DEFAULT = PERIOD_MIN; period2control(n) = n/PERIOD_MAX; control2period(n) = n*PERIOD_MAX; Q_MIN = 0.0; Q_MAX = 100.0; Q_STEP = 0.01; Q_DEFAULT = 1; q2control(n) = n/Q_MAX; control2q(n) = n*Q_MAX; COUNT_MIN = 0; COUNT_MAX = gac.N - 1; COUNT_STEP = 1; COUNT_DEFAULT = COUNT_MIN; count2control(n) = n/COUNT_MAX; control2count(n) = n*COUNT_MAX; lookup1(index1_out) = (lookup_table, lookup_pgm_idx, lookup_pgm_val, lookup_pgm_we, lookup_idx) : gac.lookup : hbargraph("[1][style:numerical]freq",0,FREQ_MAX) with { lookup_table = waveform{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; run = checkbox("[2]run"); lookup_pgm_val = nentry("[3]wval",FREQ_DEFAULT,FREQ_MIN,FREQ_MAX,FREQ_STEP); lookup_pgm_idx_f = nentry("[4]widx",0,0,gac.N-1,1); lookup_pgm_we = button("[5]set"); lookup_pgm_idx = int(floor(lookup_pgm_idx_f)); run_idx = index1_out; lookup_idx = select2(run, lookup_pgm_idx, run_idx) : hbargraph("[0][style:numerical]idx",0,gac.N); }; lookup2(index1_out) = (lookup_table, lookup_pgm_idx, lookup_pgm_val, lookup_pgm_we, lookup_idx) : gac.lookup : hbargraph("[1][style:numerical]val",0,CONTROL_MAX) with { lookup_table = waveform{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; run = checkbox("[2]run"); lookup_pgm_val = nentry("[3]wval",CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); lookup_pgm_idx_f = nentry("[4]widx",0,0,gac.N-1,1); lookup_pgm_we = button("[5]set"); lookup_pgm_idx = int(floor(lookup_pgm_idx_f)); run_idx = index1_out; lookup_idx = select2(run, lookup_pgm_idx, run_idx) : hbargraph("[0][style:numerical]idx",0,gac.N); }; index1(clock1_out,osh1_out) = (index_clk,index_len) : gac.index with { index_clk_sel_clock1_clk = checkbox("[0]clock1"); index_clk_sel_osh1_clk = checkbox("[1]osh1"); index_clk = (index_clk_sel_clock1_clk & clock1_out) | (index_clk_sel_osh1_clk & osh1_out); index_len = nentry("len",COUNT_DEFAULT,COUNT_MIN,COUNT_MAX,COUNT_DEFAULT); }; osc1(lookup1_out, lookup2_out, ar1_out) = (osc_freq, osc_shape) : gac.osc with { osc_freq_knob = nentry("[0]freq",FREQ_DEFAULT,FREQ_MIN,FREQ_MAX,FREQ_STEP); osc_lookup1_input_freq_knob = nentry("[1]lookup1_freq", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_lookup2_input_freq_knob = nentry("[2]lookup2_freq", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_ar1_input_freq_knob = nentry("[3]ar1_freq", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_freq = (lookup1_out * osc_lookup1_input_freq_knob) + (control2freq(lookup2_out) * osc_lookup2_input_freq_knob) + (control2freq(ar1_out) * osc_ar1_input_freq_knob) + osc_freq_knob ; osc_shape_knob = nentry("[4]shape", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_lookup1_input_shape_knob = nentry("[5]lookup1_shape", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_lookup2_input_shape_knob = nentry("[6]lookup2_shape", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_ar1_input_shape_knob = nentry("[7]ar1_shape", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); osc_shape = (freq2control(lookup1_out) * osc_lookup1_input_shape_knob) + (lookup2_out * osc_lookup2_input_shape_knob) + (ar1_out * osc_ar1_input_shape_knob) + osc_shape_knob ; }; clock1(lookup1_out, lookup2_out, ar1_out) = select2(run, step_clock, gac.clock(clock_freq)) with { run = checkbox("[0]run"); step = button("[1]step"); clock_freq_knob = nentry("[2]freq",FREQ_DEFAULT,FREQ_MIN,FREQ_MAX,FREQ_STEP); clock_lookup1_input_freq_knob = nentry("[3]lookup1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); clock_lookup2_input_freq_knob = nentry("[4]lookup2", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); clock_ar1_input_freq_knob = nentry("[5]ar1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); clock_freq = (lookup1_out * clock_lookup1_input_freq_knob) + (control2freq(lookup2_out) * clock_lookup2_input_freq_knob) + (control2freq(ar1_out) * clock_ar1_input_freq_knob) + clock_freq_knob ; step_clock = gac.osh(1.0/clock_freq_knob, step); }; ar1(lookup1_out, lookup2_out, clock1_out, osh1_out) = (ar_attack, ar_release, ar_gate) : gac.ar with { ar_lookup1_input_attack_knob = nentry("[1]lookup1_attack", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_lookup2_input_attack_knob = nentry("[2]lookup2_attack", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_attack_knob = nentry("[0]attack", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_attack = (control2period(freq2control(lookup1_out)) * ar_lookup1_input_attack_knob) + (control2period(lookup2_out) * ar_lookup2_input_attack_knob) + ar_attack_knob ; ar_lookup1_input_release_knob = nentry("[4]lookup1_release", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_lookup2_input_release_knob = nentry("[5]lookup2_release", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_release_knob = nentry("[3]release", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); ar_release = (control2period(freq2control(lookup1_out)) * ar_lookup1_input_release_knob) + (control2period(lookup2_out) * ar_lookup2_input_release_knob) + ar_release_knob ; ar_gate_sel_clock1 = checkbox("[6]clock1_gate"); ar_gate_sel_osh1 = checkbox("[7]osh1_gate"); ar_gate = (ar_gate_sel_clock1 & clock1_out) | (ar_gate_sel_osh1 & osh1_out); }; osh1(lookup1_out, lookup2_out, clock1_out) = (osh_dur, osh_gate) : gac.osh with { osh_lookup1_input_dur_knob = nentry("[1]lookup1", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); osh_lookup2_input_dur_knob = nentry("[2]lookup2", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); osh_dur_knob = nentry("[0]dur", PERIOD_DEFAULT,PERIOD_MIN,PERIOD_MAX,PERIOD_STEP); osh_dur = (control2period(freq2control(lookup1_out)) * osh_lookup1_input_dur_knob) + (control2period(lookup2_out) * osh_lookup2_input_dur_knob) + osh_dur_knob ; osh_gate = clock1_out; }; amp1(osc1_out, lookup1_out, lookup2_out, ar1_out) = (amp_gain,amp_input) : gac.amp with { amp_input_enable = checkbox("[0] enable osc1"); amp_input = select2(amp_input_enable, 0, osc1_out); amp_lookup1_input_gain_knob = nentry("[1]lookup1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); amp_lookup2_input_gain_knob = nentry("[2]lookup2", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); amp_ar1_input_gain_knob = nentry("[3]ar1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); amp_gain_knob = nentry("[0]gain", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); amp_gain = (freq2control(lookup1_out) * amp_lookup1_input_gain_knob) + (lookup2_out * amp_lookup2_input_gain_knob) + (ar1_out * amp_ar1_input_gain_knob) + amp_gain_knob ; }; output1(osc1_out, amp1_out) = out with { output_osc1_knob = nentry("[0]osc1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); output_amp1_knob = nentry("[1]amp1", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); vol = nentry("[2]vol", CONTROL_DEFAULT,CONTROL_MIN,CONTROL_MAX,CONTROL_STEP); in = (osc1_out * output_osc1_knob) + (amp1_out * output_amp1_knob); out = in * vol; }; panel(lookup1_out, lookup2_out, index1_out, osc1_out, clock1_out, ar1_out, osh1_out, amp1_out, output1_out) = tgroup("top", vgroup("[0]lookup1", lookup1(index1_out)), vgroup("[1]lookup2", lookup2(index1_out)), vgroup("[2]index1", index1(clock1_out, osh1_out)), vgroup("[3]osc1", osc1(lookup1_out, lookup2_out, ar1_out)), vgroup("[4]clock1", clock1(lookup1_out, lookup2_out, ar1_out)), vgroup("[5]ar1", ar1(lookup1_out, lookup2_out, clock1_out, osh1_out)), vgroup("[6]osh1", osh1(lookup1_out, lookup2_out, clock1_out)), vgroup("[7]amp1", amp1(osc1_out, lookup1_out, lookup2_out, ar1_out)), vgroup("[8]output1", output1(osc1_out,amp1_out))); copy(lookup1_out, lookup2_out, index1_out, osc1_out, clock1_out, ar1_out, osh1_out, amp1_out, output1_out) = (lookup1_out, lookup2_out, index1_out, osc1_out, clock1_out, ar1_out, osh1_out, amp1_out, output1_out); output(lookup1_out, lookup2_out, index1_out, osc1_out, clock1_out, ar1_out, osh1_out, amp1_out, output1_out) = (output1_out); process = (panel ~ copy) : output;
c9151a23f43fa93b6ff017855c1307a58852ef35f99def8c5c3789c27b94e49d
Rhoumi/myfaustplugins
fuzzii.dsp
import("stdfaust.lib"); fuzziiDepth = hslider("fuzziiDepth", 0.75, 0.75, 30, 0.01) : si.smoo; fuzziiParam = hslider("fuzziiParam", 0.4, 0.03, 0.7, 0.01) : si.smoo; fuzziitone = vslider("fuzziiTone",-7.5,-15,0,0.1); filter = fi.high_shelf(fuzziitone + 12.5, 720.0); pre_filter = fi.dcblocker : fi.lowpass(1, 2000.0); divide(input) = (((((input: pre_filter : filter )*fuzziiDepth-1)/((input: pre_filter : filter )+(0.5/fuzziiDepth + fuzziiParam) : max(0.0001)) : ef.cubicnl(0,1)))/2 + (0 : ef.cubicnl(2,-1))*0.1) ; fuzzii = (divide+0.15)/(3+0.25*fuzziiDepth); process= _: fuzzii : _;
https://raw.githubusercontent.com/Rhoumi/myfaustplugins/0d9fee23fcfd727d62973a0aad558c1e34c9af82/faust/fuzzii.dsp
faust
import("stdfaust.lib"); fuzziiDepth = hslider("fuzziiDepth", 0.75, 0.75, 30, 0.01) : si.smoo; fuzziiParam = hslider("fuzziiParam", 0.4, 0.03, 0.7, 0.01) : si.smoo; fuzziitone = vslider("fuzziiTone",-7.5,-15,0,0.1); filter = fi.high_shelf(fuzziitone + 12.5, 720.0); pre_filter = fi.dcblocker : fi.lowpass(1, 2000.0); divide(input) = (((((input: pre_filter : filter )*fuzziiDepth-1)/((input: pre_filter : filter )+(0.5/fuzziiDepth + fuzziiParam) : max(0.0001)) : ef.cubicnl(0,1)))/2 + (0 : ef.cubicnl(2,-1))*0.1) ; fuzzii = (divide+0.15)/(3+0.25*fuzziiDepth); process= _: fuzzii : _;
835e7ad7718438c09a03fb7708dbbeff08419eb35fbc925900c3b7c3cecff2e4
Rhoumi/myfaustplugins
gliitchi.dsp
import("stdfaust.lib"); declare name "gliitchi"; declare author "Rémi GEORGES"; // // // ▄████ ██▓ ██▓ ██▓▄▄▄█████▓ ▄████▄ ██░ ██ ██▓ // ██▒ ▀█▒▓██▒ ▓██▒▓██▒▓ ██▒ ▓▒▒██▀ ▀█ ▓██░ ██▒▓██▒ // ▒██░▄▄▄░▒██░ ▒██▒▒██▒▒ ▓██░ ▒░▒▓█ ▄ ▒██▀▀██░▒██▒ // ░▓█ ██▓▒██░ ░██░░██░░ ▓██▓ ░ ▒▓▓▄ ▄██▒░▓█ ░██ ░██░ // ░▒▓███▀▒░██████▒░██░░██░ ▒██▒ ░ ▒ ▓███▀ ░░▓█▒░██▓░██░ // ░▒ ▒ ░ ▒░▓ ░░▓ ░▓ ▒ ░░ ░ ░▒ ▒ ░ ▒ ░░▒░▒░▓ // ░ ░ ░ ░ ▒ ░ ▒ ░ ▒ ░ ░ ░ ▒ ▒ ░▒░ ░ ▒ ░ // ░ ░ ░ ░ ░ ▒ ░ ▒ ░ ░ ░ ░ ░░ ░ ▒ ░ // ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ // ░ // // Gliitchi is a kind of glitch reverb/echo effect. Plug and play. // Glitch effects aren't always fun to listen alone. I find Gliitchi more usefull drowned in reverb and echo, so here is it. // Gliichi doesn't have much parameters. 4 is enough. Gliitchi has a Mono Input but a stereo output o_o // ___ ____ ____ ____ _ _ ____ ___ ____ ____ ____ // |__] |__| |__/ |__| |\/| |___ | |___ |__/ [__ // | | | | \ | | | | |___ | |___ | \ ___] //[REC] : When you press it, you're recording your audio input, it will refresh every one quarter of every second, approximatly. // One usefull use, when you have found your favorite quarter of your favorite second <3, unpress the rec to make it glitchier for the rest of your life. //[Glitch] : Differents combinaisons of glitch, more than 20000, incredible :-o, very sensitive, try it out, it follow random laws, so as life. // I can't help you understand it. Well... i can do it but really boring and not needed. //[Tone] : It's written Tone but it's more like a tuning device, you can tune up or down the glitch effect, usefull to create polyphonic effect. //[Echoverb Dry/Wet] : to add the Echoverb effect to the glitch effect, very usefull. Pschit.... psch....*there's a freeverb inside* // //Mix part : it's transparent no explications needed //Yes i put the Readme into the code, i don't follow any rules. // / \--------------------, // \_,| | // | ''LE'' Looper | // | ,------------------ // \_/__________________/ leloop(recstart,dimension,readspeed) = rwtable(dimension,0.0,indexwrite,_,indexread) //This is ''LE'' Loop, the cryptic looper usually working with{ record = recstart : int; //Conforming to int to be sure, record works as an On/Off indexwrite = (+(1) : %(dimension)) ~ *(record); //Writing in the table until the dimension is full , only when the record is on ;-) speeddivcoef = readspeed/dimension; //For the readspeed to be relative to the dimension partdecimale(x)= x-int(x); //cut everything upon the coma, i don't want it phasor = speeddivcoef : (+ : partdecimale) ~ _; //Creating a phasor of one sample indexread = phasor : *(float(dimension)): int; //Reading the table following the phaser }; // / \---------------------------, // \_,| | // | Randomizer Fonction | // | ,------------------------- // \_/________________________/ //UI coefal = (vslider("[3]coefal[style:knob]",10000,1,20000, 1):si.smooth(0.001)); //Slider for the random value // Randomizer Fonction variablerandom(seed) = vnoiseout*-1 with{ partdecimale(x)= x-int(x); vnoiseout = ((1457932343)*(1103515245)) * coefal / (2147483647.0) : partdecimale; }; // / \------------------, // \_,| | // | Granulator | // | ,---------------- // \_/_______________/ grainOffset=4000*variablerandom(coefal*0.5); //randomize the granulator parameters , offeset and size grainSize=6000*variablerandom(coefal)+1000; // it's in samples SR = 44100; //Fixed samplerate at 44100 because ma.SR or other things doesen't works, need to be fix :-/ buffSize = SR; // 1sec of Buff buffCounter = + (1) % buffSize ~ _; // cycle the input buffer from 0 to bufferSize grainCounter = + (1) % grainSize ~ _; //cycle the grain from 0 to grainSize buffer(writeIndex, readIndex, _ ) = rwtable(buffSize, 0.0, writeIndex, _, readIndex); // buffer into the table fonct =par(i, 2, buffer(int(buffCounter), int(grainCounter + (i * grainOffset)), _)); //granulator fonct for 2 iterations (stereo o_o) // / \-------------------, // \_,| | // | Effect Part | // | ,----------------- // \_/________________/ echo = _* (dry_wetrvbecho) * echogain:ef.echo(maxDur,duration,feedback) with{ maxDur= 0.6; duration= 0.5; feedback= 0.6; echogain = 0.25; }; reverb = ( _* (dry_wetrvbecho) * rvbgain:re.mono_freeverb(fb1, fb2, damp, spread)) with { fb1 = 0.9; fb2 = 0.9; damp = 0.8; spread = 1; rvbgain = 0.25; }; //UI dry_wetrvbecho = (vslider(" [4]dry_wetrvbecho[style:knob]", 0.5, 0, 1, 0.001)); // _---~~(~~-_. // _{ XXX )XX) // , XX) -~~- ( ,-' )_ // ( `-,_..`.,X)--X'_,) // ( `X_)XX( -~( -_ `, X} // (_- _ X~_-~~~~`, X,' ) // `~ -^( XXX__;-,((())) // ~~~~ {_ -_(()) // `\ } // { } Broken Brain part // More UI lesloop = (leloop(recstart,12000,1*tone)*(drywet)); //This is ''Les'' Loop, just some encapsulated ''le'' loop to make it more understandable for my tired brain //UI recstart=(checkbox("[1]recstart")); tone=(vslider("[5]tone",1,0.5,2,0.0001)); drywet=hslider("[2]drywet[style:knob]",0.5,0,1,0.0001); //Groups UI //Conform + add effect leseffetsla(u,v,w)=u,v,(v:echo:reverb),w,(w:echo:reverb);//1:dry input, 2:dry effect left, 3:wet effect left, 4:dry effect right, 5:wet effect right additive(x,y,y2,z,z2)=x+y+y2,x+z+z2;//Stereoizer o_o because it's crap too many dry, wet and others things, needed to make it stereo o_o //''Le'' Process finally, "c'est la vie" :french_flag: process = ((_),(lesloop<:fonct)) :_,_,_ //1 is dry input(*gain), 2:left wet, 3:right wet :leseffetsla:additive:_,_;//Thru the fonction up there to apply effects and conform to stereo o_o
https://raw.githubusercontent.com/Rhoumi/myfaustplugins/0d9fee23fcfd727d62973a0aad558c1e34c9af82/faust/gliitchi.dsp
faust
▄████ ██▓ ██▓ ██▓▄▄▄█████▓ ▄████▄ ██░ ██ ██▓ ██▒ ▀█▒▓██▒ ▓██▒▓██▒▓ ██▒ ▓▒▒██▀ ▀█ ▓██░ ██▒▓██▒ ▒██░▄▄▄░▒██░ ▒██▒▒██▒▒ ▓██░ ▒░▒▓█ ▄ ▒██▀▀██░▒██▒ ░▓█ ██▓▒██░ ░██░░██░░ ▓██▓ ░ ▒▓▓▄ ▄██▒░▓█ ░██ ░██░ ░▒▓███▀▒░██████▒░██░░██░ ▒██▒ ░ ▒ ▓███▀ ░░▓█▒░██▓░██░ ░▒ ▒ ░ ▒░▓ ░░▓ ░▓ ▒ ░░ ░ ░▒ ▒ ░ ▒ ░░▒░▒░▓ ░ ░ ░ ░ ▒ ░ ▒ ░ ▒ ░ ░ ░ ▒ ▒ ░▒░ ░ ▒ ░ ░ ░ ░ ░ ░ ▒ ░ ▒ ░ ░ ░ ░ ░░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ Gliitchi is a kind of glitch reverb/echo effect. Plug and play. Glitch effects aren't always fun to listen alone. I find Gliitchi more usefull drowned in reverb and echo, so here is it. Gliichi doesn't have much parameters. 4 is enough. Gliitchi has a Mono Input but a stereo output o_o ___ ____ ____ ____ _ _ ____ ___ ____ ____ ____ |__] |__| |__/ |__| |\/| |___ | |___ |__/ [__ | | | | \ | | | | |___ | |___ | \ ___] [REC] : When you press it, you're recording your audio input, it will refresh every one quarter of every second, approximatly. One usefull use, when you have found your favorite quarter of your favorite second <3, unpress the rec to make it glitchier for the rest of your life. [Glitch] : Differents combinaisons of glitch, more than 20000, incredible :-o, very sensitive, try it out, it follow random laws, so as life. I can't help you understand it. Well... i can do it but really boring and not needed. [Tone] : It's written Tone but it's more like a tuning device, you can tune up or down the glitch effect, usefull to create polyphonic effect. [Echoverb Dry/Wet] : to add the Echoverb effect to the glitch effect, very usefull. Pschit.... psch....*there's a freeverb inside* Mix part : it's transparent no explications needed Yes i put the Readme into the code, i don't follow any rules. / \--------------------, \_,| | | ''LE'' Looper | | ,------------------ \_/__________________/ This is ''LE'' Loop, the cryptic looper usually working Conforming to int to be sure, record works as an On/Off Writing in the table until the dimension is full , only when the record is on ;-) For the readspeed to be relative to the dimension cut everything upon the coma, i don't want it Creating a phasor of one sample Reading the table following the phaser / \---------------------------, \_,| | | Randomizer Fonction | | ,------------------------- \_/________________________/ UI Slider for the random value Randomizer Fonction / \------------------, \_,| | | Granulator | | ,---------------- \_/_______________/ randomize the granulator parameters , offeset and size it's in samples Fixed samplerate at 44100 because ma.SR or other things doesen't works, need to be fix :-/ 1sec of Buff cycle the input buffer from 0 to bufferSize cycle the grain from 0 to grainSize buffer into the table granulator fonct for 2 iterations (stereo o_o) / \-------------------, \_,| | | Effect Part | | ,----------------- \_/________________/ UI _---~~(~~-_. _{ XXX )XX) , XX) -~~- ( ,-' )_ ( `-,_..`.,X)--X'_,) ( `X_)XX( -~( -_ `, X} (_- _ X~_-~~~~`, X,' ) `~ -^( XXX__;-,((())) ~~~~ {_ -_(()) `\ } { } Broken Brain part // More UI This is ''Les'' Loop, just some encapsulated ''le'' loop to make it more understandable for my tired brain UI Groups UI Conform + add effect 1:dry input, 2:dry effect left, 3:wet effect left, 4:dry effect right, 5:wet effect right Stereoizer o_o because it's crap too many dry, wet and others things, needed to make it stereo o_o ''Le'' Process finally, "c'est la vie" :french_flag: 1 is dry input(*gain), 2:left wet, 3:right wet Thru the fonction up there to apply effects and conform to stereo o_o
import("stdfaust.lib"); declare name "gliitchi"; declare author "Rémi GEORGES"; with{ }; variablerandom(seed) = vnoiseout*-1 with{ partdecimale(x)= x-int(x); vnoiseout = ((1457932343)*(1103515245)) * coefal / (2147483647.0) : partdecimale; }; echo = _* (dry_wetrvbecho) * echogain:ef.echo(maxDur,duration,feedback) with{ maxDur= 0.6; duration= 0.5; feedback= 0.6; echogain = 0.25; }; reverb = ( _* (dry_wetrvbecho) * rvbgain:re.mono_freeverb(fb1, fb2, damp, spread)) with { fb1 = 0.9; fb2 = 0.9; damp = 0.8; spread = 1; rvbgain = 0.25; }; dry_wetrvbecho = (vslider(" [4]dry_wetrvbecho[style:knob]", 0.5, 0, 1, 0.001)); recstart=(checkbox("[1]recstart")); tone=(vslider("[5]tone",1,0.5,2,0.0001)); drywet=hslider("[2]drywet[style:knob]",0.5,0,1,0.0001); process = ((_),(lesloop<:fonct))
a9b1f64576c1012a310a29f12a40b0ddc7bf0b2aa3b9dc860133c15d484f728b
Rhoumi/ORG-RCHBRN
Carillon.dsp
import("stdfaust.lib"); import ("music.lib"); import("filter.lib"); import("effect.lib"); //////////////////////////////////////////////////////////////////////////////////////////////// //SHIMMER //Constrols //PS controls sm_envelope = hslider("v:[1]EFFECTS/h:SHIMMER/envelope[style:knob]", 1, 0.1,3, 0.05);//parametric_controller(control, envelope, speed, depth)*shift sm_speed = hslider("v:[1]EFFECTS/h:SHIMMER/speed[style:knob]", 0.1, 0.1, 10, 0.05); sm_depth = hslider("v:[1]EFFECTS/h:SHIMMER/depth[style:knob]", 0, 0, 1, 0.05); sm_contrl = hslider("v:[1]EFFECTS/h:SHIMMER/contrl[style:knob]",0.5, 0, 1, 0.05); sm_shift = hslider("v:[1]EFFECTS/h:SHIMMER/shift[style:knob]", 0, -6, +6, 0.1)*2; //*2 needed to conform with parametric controller output //Reverb controls sm_size = hslider("v:[1]EFFECTS/h:SHIMMER/size[style:knob]", 1, 1, 3, 0.05); sm_diffusion = hslider("v:[1]EFFECTS/h:SHIMMER/diffusion[style:knob]", 0.5, 0.1, 0.7, 0.05); sm_feedback = hslider("v:[1]EFFECTS/h:SHIMMER/feedback[style:knob]", 0, 0, 0.35, 0.05); sm_hf_damping = hslider("v:[1]EFFECTS/h:SHIMMER/hf damping[style:knob]", 0.005, 0.005, 0.995, 0.005); //Global sm_dry_wet = hslider("v:[1]EFFECTS/h:SHIMMER/dry/wet[style:knob]", 0.5, 0, 1, 0.05); //Can be add to .lib mixer(mix) = _*(1 - mix),_*mix:>_; //Parametric controller, combinate signals from envelope follower and oscillator, can be added to .lib c_folower_colibration = 6; parametric_controller(mix, envelope_t, freq, depth) = (amp_follower(envelope_t):_*c_folower_colibration:_*depth,osc(freq)*0.5:_,_*depth):mixer(mix):_+0.5; //Can be moved to .lib too X = (_,_)<:(!,_,_,!); opf(a) = (_+_*(1-a)~@(1)*a); allpass_with_fdelay(dt1,coef,dt2,dt2pos) = (_,_ <: (*(coef),_:+:@(dt1):fdelay(dt2,dt2pos)), -) ~ _ : (!,_); allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_); dry_wet_mixer(c,x0,y0,x1,y1) = sel(c,x0,y0), sel(c,x1,y1) with { sel(c,x,y) = (1-c)*x + c*y; }; dry_wet_mixer_mono(c,x0,x1) = y0,y1 with { y1 = (1-c)*x0; y0 = c*x1; }; APFB(dt1,fb1,dtv,dtvpos,dt2,fb2) = _:allpass_with_fdelay(dt1,fb1,dtv,dtvpos):allpass(dt2,fb2); //PS constants, can be changed to decrease effect delay c_samples = 2048; c_xfade = 1024; //PS implementation, copy-pasted from faust repository, see ./examples/pitch_shifter.dsp transpose (w, x, s, sig) = fdelay1s(d,sig)*fmin(d/x,1) + fdelay1s(d+w,sig)*(1-fmin(d/x,1)) with { i = 1 - pow(2, s/12); d = i : (+ : +(w) : fmod(_,w)) ~ _; }; shimmer(x,y) = x,y:(_,_: (_,X,_:( (_*sm_feedback+_*0.3:>APFB(601*sm_size,0.7*sm_diffusion,50,49*(osc(1)+1)/2,613*sm_size,0.75*sm_diffusion)<:opf(sm_hf_damping)), (_*sm_feedback+_*0.3:>APFB(2043*sm_size,0.75*sm_diffusion,50,49*(osc(1.5)+1)/2,2087*sm_size,0.75*sm_diffusion)<:opf(sm_hf_damping)) ):X)~( (_*sm_feedback:dcblockerat(80) :@(4325)<: APFB(2337*sm_size,0.7*sm_diffusion,50,49*(osc(0.7)+1)/2,2377*sm_size,0.4*sm_diffusion):@(2969)<:transpose(c_samples,c_xfade, (x:parametric_controller(sm_contrl, sm_envelope, sm_speed, sm_depth):_*sm_shift))), (_*sm_feedback:dcblockerat(80) :@(4763)<: APFB(1087*sm_size,0.7*sm_diffusion,50,49*(osc(1.3)+1)/2,1113*sm_size,0.4*sm_diffusion):@(3111)<:transpose(c_samples,c_xfade, (y:parametric_controller(sm_contrl, sm_envelope, sm_speed, sm_depth):_*sm_shift))))) //:dry_wet_mixer(dry_wet,x,_,y,_) ; /* Control variables: */ // master volume, pan vol = hslider("vol", 0.5, 0, 10, 0.01); // % pan = hslider("pan", 0.5, 0, 1, 0.01); // % // excitator and resonator parameters // excitator decay time [sec] xdecay = nentry("decay", 0.01, 0, 1, 0.001); // resonator #0 hrm0 = nentry("harmonic0[style:knob]", 1, 1, 50, 0.001); // harmonic amp0 = nentry("amplitude0[style:knob]", 0.14, 0, 1, 0.001); // amplitude decay0 = nentry("decay0[style:knob]", 0.793, 0, 10, 0.001); // decay time rq0 = nentry("rq0[style:knob]", 0.002, 0.001, 1, 0.0001); // filter 1/Q // resonator #1 hrm1 = nentry("harmonic1[style:knob]", 2.004, 1, 50, 0.001); // harmonic amp1 = nentry("amplitude1[style:knob]", 0.123, 0, 1, 0.001); // amplitude decay1 = nentry("decay1[style:knob]", 2.248, 0, 10, 0.001); // decay time rq1 = nentry("rq1[style:knob]", 0.002, 0.001, 1, 0.0001); // filter 1/Q // resonator #2 hrm2 = nentry("harmonic2[style:knob]", 2.992, 1, 50, 0.001); // harmonic amp2 = nentry("amplitude2[style:knob]", 0.05, 0, 1, 0.001); // amplitude decay2 = nentry("decay2[style:knob]", 2.928, 0, 10, 0.001); // decay time rq2 = nentry("rq2[style:knob]", 0.005, 00.001, 1, 0.0001); // filter 1/Q // resonator #3 hrm3 = nentry("harmonic3[style:knob]", 12.008, 1, 50, 0.001); // harmonic amp3 = nentry("amplitude3[style:knob]", 0.083, 0, 1, 0.001); // amplitude 0.053, 0, 1, 0.001 decay3 = nentry("decay3[style:knob]", 0.2, 0, 10, 0.001); // decay time rq3 = nentry("rq3[style:knob]", 0.003, 00.001, 1, 0.0001); // filter 1/Q // resonator #4 hrm4 = nentry("harmonic4[style:knob]", 16.006, 1, 50, 0.001); // harmonic amp4 = nentry("amplitude4[style:knob]", 0.013, 0, 1, 0.001); // amplitude 0.053, 0, 1, 0.001 decay4 = nentry("decay4[style:knob]", 2, 0, 10, 0.001); // decay time rq4 = nentry("rq4[style:knob]", 0.001, 0.001, 1, 0.0001); // filter 1/Q // resonator #5 hrm5 = nentry("harmonic5[style:knob]", 3.995, 1, 50, 0.001); // harmonic amp5 = nentry("amplitude5[style:knob]", 0.06, 0, 1, 0.001); // amplitude 0.053, 0, 1, 0.001 decay5 = nentry("decay5[style:knob]", 7.5, 0, 10, 0.001); // decay time rq5 = nentry("rq5[style:knob]", 0.001, 0.001, 1, 0.0001); // filter 1/Q // frequency, gain, gate freq = nentry("freq", 440, 20, 20000, 1); // Hz gain = nentry("gain", 1, 0, 10, 0.01); // % gate = checkbox("gate"); // 0/1 /* Definition of the resonz filter. This is basically a biquad filter with pairs of poles near the desired resonance frequency and zeroes at -1 and +1. See Steiglitz for details. */ resonz(R,freq) = f : (+ ~ g) with { f(x) = a*(x-x'); // feedforward function (two zeros) g(y) = 2*R*c*y - R*R*y'; // feedback function (two poles) w = 2*PI*freq/SR; // freq in rad per sample period c = 2*R/(1+R*R)*cos(w); // cosine of pole angle s = sqrt (1-c*c); // sine of pole angle a = (1-R*R)*s; // factor to normalize resonance }; /* The excitator, a short burst of noise. */ excitator(t) = t : hgroup("1-excitator", adsr(0, xdecay, 0, 0) : *(noise)); /* Bank of 5 resonators. */ resonator(f,t,i,hrm,amp,decay,rq) = (f,t,_) : hgroup("2-resonator-%i", g) with { g(f,t) = resonz(R,h)*(amp*b*env) with { h = hrm*f; // harmonic B = rq*f/SR; // bandwidth, as fraction of sample rate R = 1-PI*B; // resonance (pole radius) b = 1/(2*B); // boost factor = Nyquist/bandwidth env = adsr(0, decay, 0, 0, t); // envelop }; }; resonators(f,t) = resonator(f,t,0,hrm0,amp0,decay0,rq0) + resonator(f,t,1,hrm1,amp1,decay1,rq1) + resonator(f,t,2,hrm2,amp2,decay2,rq2) + resonator(f,t,3,hrm3,amp3,decay3,rq3) + resonator(f,t,4,hrm4,amp4,decay4,rq4) + resonator(f,t,5,hrm5,amp5,decay5,rq5); /* The synth. */ chime = excitator(gate)*gain <: resonators(freq, gate) ;//: vgroup("3-master", *(vol) : panner(pan)); /* ETE |||| HIVER 0 |||| 0 3 semitones |||| 3 5 semitones |||| 7 8 semitones |||| 9 12 semitones |||| 10 20 semitones |||| 12 25 semitones |||| 14 29 semitones |||| 20 */ gate1 = button("v:[0]MODELES/h:[1]Gates/gate1"); gate2 = button("v:[0]MODELES/h:[1]Gates/gate2"); gate3 = button("v:[0]MODELES/h:[1]Gates/gate3"); gate4 = button("v:[0]MODELES/h:[1]Gates/gate4"); gate5 = button("v:[0]MODELES/h:[1]Gates/gate5"); gate6 = button("v:[0]MODELES/h:[1]Gates/gate6"); gate7 = button("v:[0]MODELES/h:[1]Gates/gate7"); gate8 = button("v:[0]MODELES/h:[1]Gates/gate8"); shift = hslider("v:[2]Carillon/[3]shift[unit: semitones]", 0, -5, +5, 1); strikepos = hslider("v:[2]Carillon/[1]strikepos",6,0,6,1); cutoff = hslider("v:[2]Carillon/[1]cutoff",250,20,1000,1); env = hslider("v:[2]Carillon/[2]enveloppe",0.5,0.05,2,0.01); dur = hslider("v:[1]EFFECTS/v:[5]Echo/dur",0.7,0.020,1.000,0.01); fb = hslider("v:[1]EFFECTS/v:[5]Echo/fb",0,0,1,0.01); //LPG at = hslider("v:[2]AR/attack",0.0001,0.0001,1,0.001); rt = hslider("v:[2]AR/release",13,0.001,15,0.001); //Frequences fr1 = 110; fr2 = 126; fr3 = 156; fr4 = 210; fr5 = 250; fr6 = 319; fr7 = 333; fr8 = 420; frf1 = hslider("frf1",3000,20,6000,1); frf2 = hslider("frf2",3000,20,6000,1); frf3 = hslider("frf3",3000,20,6000,1); frf4 = hslider("frf4",3000,20,6000,1); frf5 = hslider("frf5",3000,20,6000,1); frf6 = hslider("frf6",3000,20,6000,1); frf7 = hslider("frf7",3000,20,6000,1); frf8 = hslider("frf8",3000,20,6000,1); process = ///*HIVER*/ ((excitator(gate1)*gain:fi.lowpass(1,frf1) <: resonators(fr1,gate1))*0.5 <: ((_*en.ar(at,rt,gate1)),(_:fi.lowpass(1,180)))/*:> ef.echo(1.5,dur,fb)*/ :>co.limiter_1176_R4_mono /*<: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) */:>_), ((excitator(gate2)*gain:fi.lowpass(1,frf2) <: resonators(fr2,gate2))*0.5 <: ((_*en.ar(at,rt,gate2)),(_:fi.lowpass(1,180)))/*:> ef.echo(1.5,dur,fb)*/ :>co.limiter_1176_R4_mono /*<: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) */:>_), ((excitator(gate3)*gain:fi.lowpass(1,frf3) <: resonators(fr3,gate3))*0.5 <: ((_*en.ar(at,rt,gate3)),(_:fi.lowpass(1,180)))/*:> ef.echo(1.5,dur,fb)*/ :>co.limiter_1176_R4_mono /*<: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) */:>_), ((excitator(gate4)*gain:fi.lowpass(1,frf4) <: resonators(fr4,gate4))*0.5 <: ((_*en.ar(at,rt,gate4)),(_:fi.lowpass(1,180)))/*:> ef.echo(1.5,dur,fb)*/ :>co.limiter_1176_R4_mono /*<: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) */:>_), ((excitator(gate5)*gain:fi.lowpass(1,frf5) <: resonators(fr5,gate5))*0.5 <: ((_*en.ar(at,rt,gate5)),(_:fi.lowpass(1,180)))/*:> ef.echo(1.5,dur,fb)*/ :>co.limiter_1176_R4_mono /*<: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) */:>_), ((excitator(gate6)*gain:fi.lowpass(1,frf6) <: resonators(fr6,gate6))*0.5 <: ((_*en.ar(at,rt,gate6)),(_:fi.lowpass(1,180)))/*:> ef.echo(1.5,dur,fb)*/ :>co.limiter_1176_R4_mono /*<: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) */:>_), ((excitator(gate7)*gain:fi.lowpass(1,frf7) <: resonators(fr7,gate7))*0.5 <: ((_*en.ar(at,rt,gate7)),(_:fi.lowpass(1,180)))/*:> ef.echo(1.5,dur,fb)*/ :>co.limiter_1176_R4_mono /*<: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) */:>_), ((excitator(gate8)*gain:fi.lowpass(1,frf8) <: resonators(fr8,gate8))*0.5 <: ((_*en.ar(at,rt,gate8)),(_:fi.lowpass(1,180)))/*:> ef.echo(1.5,dur,fb)*/ :>co.limiter_1176_R4_mono /*<: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) */:>_) /*ETE*/ //( pm.standardBell(strikepos,cutoff,5.5,1.5,gate1)*en.smoothEnvelope(env,gate1) : ef.transpose(10000,10000,shift): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono ), //( pm.standardBell(strikepos,cutoff,5.5,1.5,gate2)*en.smoothEnvelope(env,gate2) : ef.transpose(10000,10000,shift+3) : ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono), //( pm.standardBell(strikepos,cutoff,5.5,1.5,gate3)*en.smoothEnvelope(env,gate3) : ef.transpose(10000,10000,shift+5): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono ), //( pm.standardBell(strikepos,cutoff,5.5,1.5,gate4)*en.smoothEnvelope(env,gate4) : ef.transpose(8000,2000,shift+8): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono ), //( pm.standardBell(strikepos,cutoff,5.5,1.5,gate5)*en.smoothEnvelope(env,gate5) : ef.transpose(200,100,shift+12) : fi.lowpass(3,2500): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono), //( pm.standardBell(strikepos,cutoff,5.5,1.5,gate6)*en.smoothEnvelope(env,gate6) : ef.transpose(200,100,shift+20) : fi.lowpass(3,2500): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono), //( pm.standardBell(strikepos,cutoff,5.5,1.5,gate7)*en.smoothEnvelope(env,gate7) : ef.transpose(200,200,shift+25) : fi.lowpass(3,2500) : ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono), //( pm.standardBell(strikepos,cutoff,5.5,1.5,gate8)*en.smoothEnvelope(env,gate8) : ef.transpose(200,200,shift+29) : fi.lowpass(3,2500): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono ) :_,_,_,_,_,_,_,_ :>_,_ //Stereo4IDE ;
https://raw.githubusercontent.com/Rhoumi/ORG-RCHBRN/4dcd52b79978372139534a43e4bbea58f2451b6d/Carillon/Carillon.dsp
faust
////////////////////////////////////////////////////////////////////////////////////////////// SHIMMER Constrols PS controls parametric_controller(control, envelope, speed, depth)*shift *2 needed to conform with parametric controller output Reverb controls Global Can be add to .lib Parametric controller, combinate signals from envelope follower and oscillator, can be added to .lib Can be moved to .lib too PS constants, can be changed to decrease effect delay PS implementation, copy-pasted from faust repository, see ./examples/pitch_shifter.dsp :dry_wet_mixer(dry_wet,x,_,y,_) Control variables: master volume, pan % % excitator and resonator parameters excitator decay time [sec] resonator #0 harmonic amplitude decay time filter 1/Q resonator #1 harmonic amplitude decay time filter 1/Q resonator #2 harmonic amplitude decay time filter 1/Q resonator #3 harmonic amplitude 0.053, 0, 1, 0.001 decay time filter 1/Q resonator #4 harmonic amplitude 0.053, 0, 1, 0.001 decay time filter 1/Q resonator #5 harmonic amplitude 0.053, 0, 1, 0.001 decay time filter 1/Q frequency, gain, gate Hz % 0/1 Definition of the resonz filter. This is basically a biquad filter with pairs of poles near the desired resonance frequency and zeroes at -1 and +1. See Steiglitz for details. feedforward function (two zeros) feedback function (two poles) freq in rad per sample period cosine of pole angle sine of pole angle factor to normalize resonance The excitator, a short burst of noise. Bank of 5 resonators. harmonic bandwidth, as fraction of sample rate resonance (pole radius) boost factor = Nyquist/bandwidth envelop The synth. : vgroup("3-master", *(vol) : panner(pan)); ETE |||| HIVER 0 |||| 0 3 semitones |||| 3 5 semitones |||| 7 8 semitones |||| 9 12 semitones |||| 10 20 semitones |||| 12 25 semitones |||| 14 29 semitones |||| 20 LPG Frequences /*HIVER*/ :> ef.echo(1.5,dur,fb) <: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) :> ef.echo(1.5,dur,fb) <: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) :> ef.echo(1.5,dur,fb) <: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) :> ef.echo(1.5,dur,fb) <: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) :> ef.echo(1.5,dur,fb) <: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) :> ef.echo(1.5,dur,fb) <: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) :> ef.echo(1.5,dur,fb) <: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) :> ef.echo(1.5,dur,fb) <: shimmer(_,_),_ : _,!,_ : dry_wet_mixer_mono(sm_dry_wet,_,_) ETE ( pm.standardBell(strikepos,cutoff,5.5,1.5,gate1)*en.smoothEnvelope(env,gate1) : ef.transpose(10000,10000,shift): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono ), ( pm.standardBell(strikepos,cutoff,5.5,1.5,gate2)*en.smoothEnvelope(env,gate2) : ef.transpose(10000,10000,shift+3) : ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono), ( pm.standardBell(strikepos,cutoff,5.5,1.5,gate3)*en.smoothEnvelope(env,gate3) : ef.transpose(10000,10000,shift+5): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono ), ( pm.standardBell(strikepos,cutoff,5.5,1.5,gate4)*en.smoothEnvelope(env,gate4) : ef.transpose(8000,2000,shift+8): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono ), ( pm.standardBell(strikepos,cutoff,5.5,1.5,gate5)*en.smoothEnvelope(env,gate5) : ef.transpose(200,100,shift+12) : fi.lowpass(3,2500): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono), ( pm.standardBell(strikepos,cutoff,5.5,1.5,gate6)*en.smoothEnvelope(env,gate6) : ef.transpose(200,100,shift+20) : fi.lowpass(3,2500): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono), ( pm.standardBell(strikepos,cutoff,5.5,1.5,gate7)*en.smoothEnvelope(env,gate7) : ef.transpose(200,200,shift+25) : fi.lowpass(3,2500) : ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono), ( pm.standardBell(strikepos,cutoff,5.5,1.5,gate8)*en.smoothEnvelope(env,gate8) : ef.transpose(200,200,shift+29) : fi.lowpass(3,2500): ef.echo(1.5,dur,fb) :co.limiter_1176_R4_mono ) Stereo4IDE
import("stdfaust.lib"); import ("music.lib"); import("filter.lib"); import("effect.lib"); sm_speed = hslider("v:[1]EFFECTS/h:SHIMMER/speed[style:knob]", 0.1, 0.1, 10, 0.05); sm_depth = hslider("v:[1]EFFECTS/h:SHIMMER/depth[style:knob]", 0, 0, 1, 0.05); sm_contrl = hslider("v:[1]EFFECTS/h:SHIMMER/contrl[style:knob]",0.5, 0, 1, 0.05); sm_size = hslider("v:[1]EFFECTS/h:SHIMMER/size[style:knob]", 1, 1, 3, 0.05); sm_diffusion = hslider("v:[1]EFFECTS/h:SHIMMER/diffusion[style:knob]", 0.5, 0.1, 0.7, 0.05); sm_feedback = hslider("v:[1]EFFECTS/h:SHIMMER/feedback[style:knob]", 0, 0, 0.35, 0.05); sm_hf_damping = hslider("v:[1]EFFECTS/h:SHIMMER/hf damping[style:knob]", 0.005, 0.005, 0.995, 0.005); sm_dry_wet = hslider("v:[1]EFFECTS/h:SHIMMER/dry/wet[style:knob]", 0.5, 0, 1, 0.05); mixer(mix) = _*(1 - mix),_*mix:>_; c_folower_colibration = 6; parametric_controller(mix, envelope_t, freq, depth) = (amp_follower(envelope_t):_*c_folower_colibration:_*depth,osc(freq)*0.5:_,_*depth):mixer(mix):_+0.5; X = (_,_)<:(!,_,_,!); opf(a) = (_+_*(1-a)~@(1)*a); allpass_with_fdelay(dt1,coef,dt2,dt2pos) = (_,_ <: (*(coef),_:+:@(dt1):fdelay(dt2,dt2pos)), -) ~ _ : (!,_); allpass(dt,fb) = (_,_ <: (*(fb),_:+:@(dt)), -) ~ _ : (!,_); dry_wet_mixer(c,x0,y0,x1,y1) = sel(c,x0,y0), sel(c,x1,y1) with { sel(c,x,y) = (1-c)*x + c*y; }; dry_wet_mixer_mono(c,x0,x1) = y0,y1 with { y1 = (1-c)*x0; y0 = c*x1; }; APFB(dt1,fb1,dtv,dtvpos,dt2,fb2) = _:allpass_with_fdelay(dt1,fb1,dtv,dtvpos):allpass(dt2,fb2); c_samples = 2048; c_xfade = 1024; transpose (w, x, s, sig) = fdelay1s(d,sig)*fmin(d/x,1) + fdelay1s(d+w,sig)*(1-fmin(d/x,1)) with { i = 1 - pow(2, s/12); d = i : (+ : +(w) : fmod(_,w)) ~ _; }; shimmer(x,y) = x,y:(_,_: (_,X,_:( (_*sm_feedback+_*0.3:>APFB(601*sm_size,0.7*sm_diffusion,50,49*(osc(1)+1)/2,613*sm_size,0.75*sm_diffusion)<:opf(sm_hf_damping)), (_*sm_feedback+_*0.3:>APFB(2043*sm_size,0.75*sm_diffusion,50,49*(osc(1.5)+1)/2,2087*sm_size,0.75*sm_diffusion)<:opf(sm_hf_damping)) ):X)~( (_*sm_feedback:dcblockerat(80) :@(4325)<: APFB(2337*sm_size,0.7*sm_diffusion,50,49*(osc(0.7)+1)/2,2377*sm_size,0.4*sm_diffusion):@(2969)<:transpose(c_samples,c_xfade, (x:parametric_controller(sm_contrl, sm_envelope, sm_speed, sm_depth):_*sm_shift))), (_*sm_feedback:dcblockerat(80) :@(4763)<: APFB(1087*sm_size,0.7*sm_diffusion,50,49*(osc(1.3)+1)/2,1113*sm_size,0.4*sm_diffusion):@(3111)<:transpose(c_samples,c_xfade, (y:parametric_controller(sm_contrl, sm_envelope, sm_speed, sm_depth):_*sm_shift))))) ; xdecay = nentry("decay", 0.01, 0, 1, 0.001); resonz(R,freq) = f : (+ ~ g) with { }; excitator(t) = t : hgroup("1-excitator", adsr(0, xdecay, 0, 0) : *(noise)); resonator(f,t,i,hrm,amp,decay,rq) = (f,t,_) : hgroup("2-resonator-%i", g) with { g(f,t) = resonz(R,h)*(amp*b*env) with { }; }; resonators(f,t) = resonator(f,t,0,hrm0,amp0,decay0,rq0) + resonator(f,t,1,hrm1,amp1,decay1,rq1) + resonator(f,t,2,hrm2,amp2,decay2,rq2) + resonator(f,t,3,hrm3,amp3,decay3,rq3) + resonator(f,t,4,hrm4,amp4,decay4,rq4) + resonator(f,t,5,hrm5,amp5,decay5,rq5); chime = excitator(gate)*gain <: resonators(freq, gate) gate1 = button("v:[0]MODELES/h:[1]Gates/gate1"); gate2 = button("v:[0]MODELES/h:[1]Gates/gate2"); gate3 = button("v:[0]MODELES/h:[1]Gates/gate3"); gate4 = button("v:[0]MODELES/h:[1]Gates/gate4"); gate5 = button("v:[0]MODELES/h:[1]Gates/gate5"); gate6 = button("v:[0]MODELES/h:[1]Gates/gate6"); gate7 = button("v:[0]MODELES/h:[1]Gates/gate7"); gate8 = button("v:[0]MODELES/h:[1]Gates/gate8"); shift = hslider("v:[2]Carillon/[3]shift[unit: semitones]", 0, -5, +5, 1); strikepos = hslider("v:[2]Carillon/[1]strikepos",6,0,6,1); cutoff = hslider("v:[2]Carillon/[1]cutoff",250,20,1000,1); env = hslider("v:[2]Carillon/[2]enveloppe",0.5,0.05,2,0.01); dur = hslider("v:[1]EFFECTS/v:[5]Echo/dur",0.7,0.020,1.000,0.01); fb = hslider("v:[1]EFFECTS/v:[5]Echo/fb",0,0,1,0.01); at = hslider("v:[2]AR/attack",0.0001,0.0001,1,0.001); rt = hslider("v:[2]AR/release",13,0.001,15,0.001); fr1 = 110; fr2 = 126; fr3 = 156; fr4 = 210; fr5 = 250; fr6 = 319; fr7 = 333; fr8 = 420; frf1 = hslider("frf1",3000,20,6000,1); frf2 = hslider("frf2",3000,20,6000,1); frf3 = hslider("frf3",3000,20,6000,1); frf4 = hslider("frf4",3000,20,6000,1); frf5 = hslider("frf5",3000,20,6000,1); frf6 = hslider("frf6",3000,20,6000,1); frf7 = hslider("frf7",3000,20,6000,1); frf8 = hslider("frf8",3000,20,6000,1); process = :_,_,_,_,_,_,_,_ ;
d6c1cb33ee278aa6ee37d5bab3aae7068b4001c15dfc55487a13a7d2399d8904
Rhoumi/rhoumi.github.io
GLIITCHI.dsp
import("stdfaust.lib"); declare name "Gliitchi"; declare author "Rémi GEORGES"; // // // ▄████ ██▓ ██▓ ██▓▄▄▄█████▓ ▄████▄ ██░ ██ ██▓ // ██▒ ▀█▒▓██▒ ▓██▒▓██▒▓ ██▒ ▓▒▒██▀ ▀█ ▓██░ ██▒▓██▒ // ▒██░▄▄▄░▒██░ ▒██▒▒██▒▒ ▓██░ ▒░▒▓█ ▄ ▒██▀▀██░▒██▒ // ░▓█ ██▓▒██░ ░██░░██░░ ▓██▓ ░ ▒▓▓▄ ▄██▒░▓█ ░██ ░██░ // ░▒▓███▀▒░██████▒░██░░██░ ▒██▒ ░ ▒ ▓███▀ ░░▓█▒░██▓░██░ // ░▒ ▒ ░ ▒░▓ ░░▓ ░▓ ▒ ░░ ░ ░▒ ▒ ░ ▒ ░░▒░▒░▓ // ░ ░ ░ ░ ▒ ░ ▒ ░ ▒ ░ ░ ░ ▒ ▒ ░▒░ ░ ▒ ░ // ░ ░ ░ ░ ░ ▒ ░ ▒ ░ ░ ░ ░ ░░ ░ ▒ ░ // ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ // ░ // // Gliitchi is a kind of glitch reverb/echo effect. Plug and play. // Glitch effects aren't always fun to listen alone. I find Gliitchi more usefull drowned in reverb and echo, so here is it. // Gliichi doesn't have much parameters. 4 is enough. Gliitchi has a Mono Input but a stereo output o_o // ___ ____ ____ ____ _ _ ____ ___ ____ ____ ____ // |__] |__| |__/ |__| |\/| |___ | |___ |__/ [__ // | | | | \ | | | | |___ | |___ | \ ___] //[REC] : When you press it, you're recording your audio input, it will refresh every one quarter of every second, approximatly. // One usefull use, when you have found your favorite quarter of your favorite second <3, unpress the rec to make it glitchier for the rest of your life. //[Glitch] : Differents combinaisons of glitch, more than 20000, incredible :-o, very sensitive, try it out, it follow random laws, so as life. // I can't help you understand it. Well... i can do it but really boring and not needed. //[Tone] : It's written Tone but it's more like a tuning device, you can tune up or down the glitch effect, usefull to create polyphonic effect. //[Echoverb Dry/Wet] : to add the Echoverb effect to the glitch effect, very usefull. Pschit.... psch....*there's a freeverb inside* // //Mix part : it's transparent no explications needed //Yes i put the Readme into the code, i don't follow any rules. // / \--------------------, // \_,| | // | ''LE'' Looper | // | ,------------------ // \_/__________________/ leloop(recstart,dimension,readspeed) = rwtable(dimension,0.0,indexwrite,_,indexread) //This is ''LE'' Loop, the cryptic looper usually working with{ record = recstart : int; //Conforming to int to be sure, record works as an On/Off indexwrite = (+(1) : %(dimension)) ~ *(record); //Writing in the table until the dimension is full , only when the record is on ;-) speeddivcoef = readspeed/dimension; //For the readspeed to be relative to the dimension partdecimale(x)= x-int(x); //cut everything upon the coma, i don't want it phasor = speeddivcoef : (+ : partdecimale) ~ _; //Creating a phasor of one sample indexread = phasor : *(float(dimension)): int; //Reading the table following the phaser }; // / \---------------------------, // \_,| | // | Randomizer Fonction | // | ,------------------------- // \_/________________________/ //UI coefal = uiGlitch(vslider("[0]g̷l̵i̷t̷c̷h̴[style:knob]",10000,1,20000, 1):si.smooth(0.001)); //Slider for the random value // Randomizer Fonction variablerandom(seed) = vnoiseout*-1 with{ partdecimale(x)= x-int(x); vnoiseout = ((1457932343)*(1103515245)) * coefal / (2147483647.0) : partdecimale; }; // / \------------------, // \_,| | // | Granulator | // | ,---------------- // \_/_______________/ grainOffset=4000*variablerandom(coefal*0.5); //randomize the granulator parameters , offeset and size grainSize=6000*variablerandom(coefal)+1000; // it's in samples SR = 44100; //Fixed samplerate at 44100 because ma.SR or other things doesen't works, need to be fix :-/ buffSize = SR; // 1sec of Buff buffCounter = + (1) % buffSize ~ _; // cycle the input buffer from 0 to bufferSize grainCounter = + (1) % grainSize ~ _; //cycle the grain from 0 to grainSize buffer(writeIndex, readIndex, _ ) = rwtable(buffSize, 0.0, writeIndex, _, readIndex); // buffer into the table fonct =par(i, 2, buffer(int(buffCounter), int(grainCounter + (i * grainOffset)), _)); //granulator fonct for 2 iterations (stereo o_o) // / \-------------------, // \_,| | // | Effect Part | // | ,----------------- // \_/________________/ echo = _* (dry_wetrvbecho) * echogain:ef.echo(maxDur,duration,feedback) with{ maxDur= 0.6; duration= 0.5; feedback= 0.6; echogain = 0.25; }; reverb = ( _* (dry_wetrvbecho) * rvbgain:re.mono_freeverb(fb1, fb2, damp, spread)) with { fb1 = 0.9; fb2 = 0.9; damp = 0.8; spread = 1; rvbgain = 0.25; }; //UI dry_wetrvbecho = uiEffects(vslider(" EchoVerb Dry/Wet[style:knob]", 0.5, 0, 5, 0.001)); // _---~~(~~-_. // _{ XXX )XX) // , XX) -~~- ( ,-' )_ // ( `-,_..`.,X)--X'_,) // ( `X_)XX( -~( -_ `, X} // (_- _ X~_-~~~~`, X,' ) // `~ -^( XXX__;-,((())) // ~~~~ {_ -_(()) // `\ } // { } Broken Brain part // More UI lesloop = (leloop(recstart,12000,1*tone)*(drywet)); //This is ''Les'' Loop, just some encapsulated ''le'' loop to make it more understandable for my tired brain //UI recstart=uiGlitch(checkbox("[1]Rec")); tone=uiGlitch(vslider("[9]TONE",1,0.5,2,0.0001)); gain=uiMix(hslider("[0]AudioIn[style:knob]",1,0,2,0.0001)); drywet=uiMix(hslider("[1]GlitchiMix[style:knob]",0.5,0,3,0.0001)); //Groups UI uiMix(x) = hgroup("Mix",x); uiGlitch(x) = hgroup("[2]Glitch",x); uiEffects(x)=hgroup("[9]Effects",x); //Conform + add effect leseffetsla(u,v,w)=u,v,(v:echo:reverb),w,(w:echo:reverb);//1:dry input, 2:dry effect left, 3:wet effect left, 4:dry effect right, 5:wet effect right additive(x,y,y2,z,z2)=x+y+y2,x+z+z2;//Stereoizer o_o because it's crap too many dry, wet and others things, needed to make it stereo o_o //''Le'' Process finally, "c'est la vie" :french_flag: process = ((_)*gain,(lesloop<:fonct)) :_,_,_ //1 is dry input(*gain), 2:left wet, 3:right wet :leseffetsla:additive:_,_;//Thru the fonction up there to apply effects and conform to stereo o_o
https://raw.githubusercontent.com/Rhoumi/rhoumi.github.io/66265b40236fea30ab8ca6b116372a449900e091/gliitchi/GLIITCHI.dsp
faust
▄████ ██▓ ██▓ ██▓▄▄▄█████▓ ▄████▄ ██░ ██ ██▓ ██▒ ▀█▒▓██▒ ▓██▒▓██▒▓ ██▒ ▓▒▒██▀ ▀█ ▓██░ ██▒▓██▒ ▒██░▄▄▄░▒██░ ▒██▒▒██▒▒ ▓██░ ▒░▒▓█ ▄ ▒██▀▀██░▒██▒ ░▓█ ██▓▒██░ ░██░░██░░ ▓██▓ ░ ▒▓▓▄ ▄██▒░▓█ ░██ ░██░ ░▒▓███▀▒░██████▒░██░░██░ ▒██▒ ░ ▒ ▓███▀ ░░▓█▒░██▓░██░ ░▒ ▒ ░ ▒░▓ ░░▓ ░▓ ▒ ░░ ░ ░▒ ▒ ░ ▒ ░░▒░▒░▓ ░ ░ ░ ░ ▒ ░ ▒ ░ ▒ ░ ░ ░ ▒ ▒ ░▒░ ░ ▒ ░ ░ ░ ░ ░ ░ ▒ ░ ▒ ░ ░ ░ ░ ░░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ Gliitchi is a kind of glitch reverb/echo effect. Plug and play. Glitch effects aren't always fun to listen alone. I find Gliitchi more usefull drowned in reverb and echo, so here is it. Gliichi doesn't have much parameters. 4 is enough. Gliitchi has a Mono Input but a stereo output o_o ___ ____ ____ ____ _ _ ____ ___ ____ ____ ____ |__] |__| |__/ |__| |\/| |___ | |___ |__/ [__ | | | | \ | | | | |___ | |___ | \ ___] [REC] : When you press it, you're recording your audio input, it will refresh every one quarter of every second, approximatly. One usefull use, when you have found your favorite quarter of your favorite second <3, unpress the rec to make it glitchier for the rest of your life. [Glitch] : Differents combinaisons of glitch, more than 20000, incredible :-o, very sensitive, try it out, it follow random laws, so as life. I can't help you understand it. Well... i can do it but really boring and not needed. [Tone] : It's written Tone but it's more like a tuning device, you can tune up or down the glitch effect, usefull to create polyphonic effect. [Echoverb Dry/Wet] : to add the Echoverb effect to the glitch effect, very usefull. Pschit.... psch....*there's a freeverb inside* Mix part : it's transparent no explications needed Yes i put the Readme into the code, i don't follow any rules. / \--------------------, \_,| | | ''LE'' Looper | | ,------------------ \_/__________________/ This is ''LE'' Loop, the cryptic looper usually working Conforming to int to be sure, record works as an On/Off Writing in the table until the dimension is full , only when the record is on ;-) For the readspeed to be relative to the dimension cut everything upon the coma, i don't want it Creating a phasor of one sample Reading the table following the phaser / \---------------------------, \_,| | | Randomizer Fonction | | ,------------------------- \_/________________________/ UI Slider for the random value Randomizer Fonction / \------------------, \_,| | | Granulator | | ,---------------- \_/_______________/ randomize the granulator parameters , offeset and size it's in samples Fixed samplerate at 44100 because ma.SR or other things doesen't works, need to be fix :-/ 1sec of Buff cycle the input buffer from 0 to bufferSize cycle the grain from 0 to grainSize buffer into the table granulator fonct for 2 iterations (stereo o_o) / \-------------------, \_,| | | Effect Part | | ,----------------- \_/________________/ UI _---~~(~~-_. _{ XXX )XX) , XX) -~~- ( ,-' )_ ( `-,_..`.,X)--X'_,) ( `X_)XX( -~( -_ `, X} (_- _ X~_-~~~~`, X,' ) `~ -^( XXX__;-,((())) ~~~~ {_ -_(()) `\ } { } Broken Brain part // More UI This is ''Les'' Loop, just some encapsulated ''le'' loop to make it more understandable for my tired brain UI Groups UI Conform + add effect 1:dry input, 2:dry effect left, 3:wet effect left, 4:dry effect right, 5:wet effect right Stereoizer o_o because it's crap too many dry, wet and others things, needed to make it stereo o_o ''Le'' Process finally, "c'est la vie" :french_flag: 1 is dry input(*gain), 2:left wet, 3:right wet Thru the fonction up there to apply effects and conform to stereo o_o
import("stdfaust.lib"); declare name "Gliitchi"; declare author "Rémi GEORGES"; with{ }; variablerandom(seed) = vnoiseout*-1 with{ partdecimale(x)= x-int(x); vnoiseout = ((1457932343)*(1103515245)) * coefal / (2147483647.0) : partdecimale; }; echo = _* (dry_wetrvbecho) * echogain:ef.echo(maxDur,duration,feedback) with{ maxDur= 0.6; duration= 0.5; feedback= 0.6; echogain = 0.25; }; reverb = ( _* (dry_wetrvbecho) * rvbgain:re.mono_freeverb(fb1, fb2, damp, spread)) with { fb1 = 0.9; fb2 = 0.9; damp = 0.8; spread = 1; rvbgain = 0.25; }; dry_wetrvbecho = uiEffects(vslider(" EchoVerb Dry/Wet[style:knob]", 0.5, 0, 5, 0.001)); recstart=uiGlitch(checkbox("[1]Rec")); tone=uiGlitch(vslider("[9]TONE",1,0.5,2,0.0001)); gain=uiMix(hslider("[0]AudioIn[style:knob]",1,0,2,0.0001)); drywet=uiMix(hslider("[1]GlitchiMix[style:knob]",0.5,0,3,0.0001)); uiMix(x) = hgroup("Mix",x); uiGlitch(x) = hgroup("[2]Glitch",x); uiEffects(x)=hgroup("[9]Effects",x); process = ((_)*gain,(lesloop<:fonct))
c3ea3f420b65fa0d6a0295a4decfda3e8c57863e8664b36561db9001fb116590
Rhoumi/rhoumi.github.io
Gliitchi.dsp
import("stdfaust.lib"); declare name "Gliitchi"; declare author "Rémi GEORGES"; // // // ▄████ ██▓ ██▓ ██▓▄▄▄█████▓ ▄████▄ ██░ ██ ██▓ // ██▒ ▀█▒▓██▒ ▓██▒▓██▒▓ ██▒ ▓▒▒██▀ ▀█ ▓██░ ██▒▓██▒ // ▒██░▄▄▄░▒██░ ▒██▒▒██▒▒ ▓██░ ▒░▒▓█ ▄ ▒██▀▀██░▒██▒ // ░▓█ ██▓▒██░ ░██░░██░░ ▓██▓ ░ ▒▓▓▄ ▄██▒░▓█ ░██ ░██░ // ░▒▓███▀▒░██████▒░██░░██░ ▒██▒ ░ ▒ ▓███▀ ░░▓█▒░██▓░██░ // ░▒ ▒ ░ ▒░▓ ░░▓ ░▓ ▒ ░░ ░ ░▒ ▒ ░ ▒ ░░▒░▒░▓ // ░ ░ ░ ░ ▒ ░ ▒ ░ ▒ ░ ░ ░ ▒ ▒ ░▒░ ░ ▒ ░ // ░ ░ ░ ░ ░ ▒ ░ ▒ ░ ░ ░ ░ ░░ ░ ▒ ░ // ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ // ░ // // Gliitchi is a kind of glitch reverb/echo effect. Plug and play. // Glitch effects aren't always fun to listen alone. I find Gliitchi more usefull drowned in reverb and echo, so here is it. // Gliichi doesn't have much parameters. 4 is enough. Gliitchi has a Mono Input but a stereo output o_o // ___ ____ ____ ____ _ _ ____ ___ ____ ____ ____ // |__] |__| |__/ |__| |\/| |___ | |___ |__/ [__ // | | | | \ | | | | |___ | |___ | \ ___] //[REC] : When you press it, you're recording your audio input, it will refresh every one quarter of every second, approximatly. // One usefull use, when you have found your favorite quarter of your favorite second <3, unpress the rec to make it glitchier for the rest of your life. //[Glitch] : Differents combinaisons of glitch, more than 20000, incredible :-o, very sensitive, try it out, it follow random laws, so as life. // I can't help you understand it. Well... i can do it but really boring and not needed. //[Tone] : It's written Tone but it's more like a tuning device, you can tune up or down the glitch effect, usefull to create polyphonic effect. //[Echoverb Dry/Wet] : to add the Echoverb effect to the glitch effect, very usefull. Pschit.... psch....*there's a freeverb inside* // //Mix part : it's transparent no explications needed //Yes i put the Readme into the code, i don't follow any rules. // / \--------------------, // \_,| | // | ''LE'' Looper | // | ,------------------ // \_/__________________/ leloop(recstart,dimension,readspeed) = rwtable(dimension,0.0,indexwrite,_,indexread) //This is ''LE'' Loop, the cryptic looper usually working with{ record = recstart : int; //Conforming to int to be sure, record works as an On/Off indexwrite = (+(1) : %(dimension)) ~ *(record); //Writing in the table until the dimension is full , only when the record is on ;-) speeddivcoef = readspeed/dimension; //For the readspeed to be relative to the dimension partdecimale(x)= x-int(x); //cut everything upon the coma, i don't want it phasor = speeddivcoef : (+ : partdecimale) ~ _; //Creating a phasor of one sample indexread = phasor : *(float(dimension)): int; //Reading the table following the phaser }; // / \---------------------------, // \_,| | // | Randomizer Fonction | // | ,------------------------- // \_/________________________/ //UI coefal = uiGlitch(vslider("[0]g̷l̵i̷t̷c̷h̴[style:knob]",10000,1,20000, 1):si.smooth(0.001)); //Slider for the random value // Randomizer Fonction variablerandom(seed) = vnoiseout*-1 with{ partdecimale(x)= x-int(x); vnoiseout = ((1457932343)*(1103515245)) * coefal / (2147483647.0) : partdecimale; }; // / \------------------, // \_,| | // | Granulator | // | ,---------------- // \_/_______________/ grainOffset=4000*variablerandom(coefal*0.5); //randomize the granulator parameters , offeset and size grainSize=6000*variablerandom(coefal)+1000; // it's in samples SR = 44100; //Fixed samplerate at 44100 because ma.SR or other things doesen't works, need to be fix :-/ buffSize = SR; // 1sec of Buff buffCounter = + (1) % buffSize ~ _; // cycle the input buffer from 0 to bufferSize grainCounter = + (1) % grainSize ~ _; //cycle the grain from 0 to grainSize buffer(writeIndex, readIndex, _ ) = rwtable(buffSize, 0.0, writeIndex, _, readIndex); // buffer into the table fonct =par(i, 2, buffer(int(buffCounter), int(grainCounter + (i * grainOffset)), _)); //granulator fonct for 2 iterations (stereo o_o) // / \-------------------, // \_,| | // | Effect Part | // | ,----------------- // \_/________________/ echo = _* (dry_wetrvbecho) * echogain:ef.echo(maxDur,duration,feedback) with{ maxDur= 0.6; duration= 0.5; feedback= 0.6; echogain = 0.25; }; reverb = ( _* (dry_wetrvbecho) * rvbgain:re.mono_freeverb(fb1, fb2, damp, spread)) with { fb1 = 0.9; fb2 = 0.9; damp = 0.8; spread = 1; rvbgain = 0.25; }; //UI dry_wetrvbecho = uiEffects(vslider(" EchoVerb Dry/Wet[style:knob]", 0.5, 0, 1, 0.001)); // _---~~(~~-_. // _{ XXX )XX) // , XX) -~~- ( ,-' )_ // ( `-,_..`.,X)--X'_,) // ( `X_)XX( -~( -_ `, X} // (_- _ X~_-~~~~`, X,' ) // `~ -^( XXX__;-,((())) // ~~~~ {_ -_(()) // `\ } // { } Broken Brain part // More UI lesloop = (leloop(recstart,12000,1*tone)*(drywet)); //This is ''Les'' Loop, just some encapsulated ''le'' loop to make it more understandable for my tired brain //UI recstart=uiGlitch(checkbox("[1]Rec")); tone=uiGlitch(vslider("[9]TONE",1,0.5,2,0.0001)); gain=uiMix(hslider("[0]AudioIn[style:knob]",1,0,2,0.0001)); drywet=uiMix(hslider("[1]GlitchiMix[style:knob]",0.5,0,1,0.0001)); //Groups UI uiMix(x) = hgroup("Mix",x); uiGlitch(x) = hgroup("[2]Glitch",x); uiEffects(x)=hgroup("[9]Effects",x); //Conform + add effect leseffetsla(u,v,w)=u,v,(v:echo:reverb),w,(w:echo:reverb);//1:dry input, 2:dry effect left, 3:wet effect left, 4:dry effect right, 5:wet effect right additive(x,y,y2,z,z2)=x+y+y2,x+z+z2;//Stereoizer o_o because it's crap too many dry, wet and others things, needed to make it stereo o_o //''Le'' Process finally, "c'est la vie" :french_flag: process = ((_)*gain,(lesloop<:fonct)) :_,_,_ //1 is dry input(*gain), 2:left wet, 3:right wet :leseffetsla:additive:_,_;//Thru the fonction up there to apply effects and conform to stereo o_o
https://raw.githubusercontent.com/Rhoumi/rhoumi.github.io/9d3f334f1232ca5b2519749129574a5f2f0605c0/images/Gliitchi.dsp
faust
▄████ ██▓ ██▓ ██▓▄▄▄█████▓ ▄████▄ ██░ ██ ██▓ ██▒ ▀█▒▓██▒ ▓██▒▓██▒▓ ██▒ ▓▒▒██▀ ▀█ ▓██░ ██▒▓██▒ ▒██░▄▄▄░▒██░ ▒██▒▒██▒▒ ▓██░ ▒░▒▓█ ▄ ▒██▀▀██░▒██▒ ░▓█ ██▓▒██░ ░██░░██░░ ▓██▓ ░ ▒▓▓▄ ▄██▒░▓█ ░██ ░██░ ░▒▓███▀▒░██████▒░██░░██░ ▒██▒ ░ ▒ ▓███▀ ░░▓█▒░██▓░██░ ░▒ ▒ ░ ▒░▓ ░░▓ ░▓ ▒ ░░ ░ ░▒ ▒ ░ ▒ ░░▒░▒░▓ ░ ░ ░ ░ ▒ ░ ▒ ░ ▒ ░ ░ ░ ▒ ▒ ░▒░ ░ ▒ ░ ░ ░ ░ ░ ░ ▒ ░ ▒ ░ ░ ░ ░ ░░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ Gliitchi is a kind of glitch reverb/echo effect. Plug and play. Glitch effects aren't always fun to listen alone. I find Gliitchi more usefull drowned in reverb and echo, so here is it. Gliichi doesn't have much parameters. 4 is enough. Gliitchi has a Mono Input but a stereo output o_o ___ ____ ____ ____ _ _ ____ ___ ____ ____ ____ |__] |__| |__/ |__| |\/| |___ | |___ |__/ [__ | | | | \ | | | | |___ | |___ | \ ___] [REC] : When you press it, you're recording your audio input, it will refresh every one quarter of every second, approximatly. One usefull use, when you have found your favorite quarter of your favorite second <3, unpress the rec to make it glitchier for the rest of your life. [Glitch] : Differents combinaisons of glitch, more than 20000, incredible :-o, very sensitive, try it out, it follow random laws, so as life. I can't help you understand it. Well... i can do it but really boring and not needed. [Tone] : It's written Tone but it's more like a tuning device, you can tune up or down the glitch effect, usefull to create polyphonic effect. [Echoverb Dry/Wet] : to add the Echoverb effect to the glitch effect, very usefull. Pschit.... psch....*there's a freeverb inside* Mix part : it's transparent no explications needed Yes i put the Readme into the code, i don't follow any rules. / \--------------------, \_,| | | ''LE'' Looper | | ,------------------ \_/__________________/ This is ''LE'' Loop, the cryptic looper usually working Conforming to int to be sure, record works as an On/Off Writing in the table until the dimension is full , only when the record is on ;-) For the readspeed to be relative to the dimension cut everything upon the coma, i don't want it Creating a phasor of one sample Reading the table following the phaser / \---------------------------, \_,| | | Randomizer Fonction | | ,------------------------- \_/________________________/ UI Slider for the random value Randomizer Fonction / \------------------, \_,| | | Granulator | | ,---------------- \_/_______________/ randomize the granulator parameters , offeset and size it's in samples Fixed samplerate at 44100 because ma.SR or other things doesen't works, need to be fix :-/ 1sec of Buff cycle the input buffer from 0 to bufferSize cycle the grain from 0 to grainSize buffer into the table granulator fonct for 2 iterations (stereo o_o) / \-------------------, \_,| | | Effect Part | | ,----------------- \_/________________/ UI _---~~(~~-_. _{ XXX )XX) , XX) -~~- ( ,-' )_ ( `-,_..`.,X)--X'_,) ( `X_)XX( -~( -_ `, X} (_- _ X~_-~~~~`, X,' ) `~ -^( XXX__;-,((())) ~~~~ {_ -_(()) `\ } { } Broken Brain part // More UI This is ''Les'' Loop, just some encapsulated ''le'' loop to make it more understandable for my tired brain UI Groups UI Conform + add effect 1:dry input, 2:dry effect left, 3:wet effect left, 4:dry effect right, 5:wet effect right Stereoizer o_o because it's crap too many dry, wet and others things, needed to make it stereo o_o ''Le'' Process finally, "c'est la vie" :french_flag: 1 is dry input(*gain), 2:left wet, 3:right wet Thru the fonction up there to apply effects and conform to stereo o_o
import("stdfaust.lib"); declare name "Gliitchi"; declare author "Rémi GEORGES"; with{ }; variablerandom(seed) = vnoiseout*-1 with{ partdecimale(x)= x-int(x); vnoiseout = ((1457932343)*(1103515245)) * coefal / (2147483647.0) : partdecimale; }; echo = _* (dry_wetrvbecho) * echogain:ef.echo(maxDur,duration,feedback) with{ maxDur= 0.6; duration= 0.5; feedback= 0.6; echogain = 0.25; }; reverb = ( _* (dry_wetrvbecho) * rvbgain:re.mono_freeverb(fb1, fb2, damp, spread)) with { fb1 = 0.9; fb2 = 0.9; damp = 0.8; spread = 1; rvbgain = 0.25; }; dry_wetrvbecho = uiEffects(vslider(" EchoVerb Dry/Wet[style:knob]", 0.5, 0, 1, 0.001)); recstart=uiGlitch(checkbox("[1]Rec")); tone=uiGlitch(vslider("[9]TONE",1,0.5,2,0.0001)); gain=uiMix(hslider("[0]AudioIn[style:knob]",1,0,2,0.0001)); drywet=uiMix(hslider("[1]GlitchiMix[style:knob]",0.5,0,1,0.0001)); uiMix(x) = hgroup("Mix",x); uiGlitch(x) = hgroup("[2]Glitch",x); uiEffects(x)=hgroup("[9]Effects",x); process = ((_)*gain,(lesloop<:fonct))
31e840668bfb65b50c71a19cee1db87b23aa7c2ef7857d5b1ec391e5245e9aa4
sfztools/sfizz
filters_modulable.dsp
// -*- mode: faust; -*- declare author "Jean Pierre Cimalando"; declare license "BSD-2-Clause"; import("stdfaust.lib"); rbj = library("rbj_filters.dsp"); //------------------------------------------------------------------------- // Biquad filter from normalized coefficients // b0,b1,b2,a1,a2 : normalized coefficients //------------------------------------------------------------------------- biquad(b0,b1,b2,a1,a2) = fi.iir((b0,b1,b2),(a1,a2)); biquadTf2(b0,b1,b2,a1,a2) = fi.tf22t(b0,b1,b2,a1,a2); //------------------------------------------------------------------------- // Biquad filter using smoothed coefficients // s : a smoothing function applied to each coefficient // b0,b1,b2,a1,a2 : normalized coefficients //------------------------------------------------------------------------- smoothBiquad(s,b0,b1,b2,a1,a2) = biquad(b0:s,b1:s,b2:s,a1:s,a2:s); smoothBiquadTf2(s,b0,b1,b2,a1,a2) = biquadTf2(b0:s,b1:s,b2:s,a1:s,a2:s); //------------------------------------------------------------------------- // RBJ filter of a specific type using smoothed coefficients // s : a smoothing function applied to each coefficient // f : cutoff frequency // g : gain in decibel, for peaking and shelving types only // q : height of the resonant peak in linear units //------------------------------------------------------------------------- rbjLpfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).LPF,x) : smoothBiquadTf2(s); rbjHpfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).HPF,x) : smoothBiquadTf2(s); rbjBpfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).BPF,x) : smoothBiquadTf2(s); rbjNotchSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).notch,x) : smoothBiquadTf2(s); rbjApfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).APF,x) : smoothBiquadTf2(s); rbjPeakingEqSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).peakingEQ,x) : smoothBiquadTf2(s); rbjPeakingNotchSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).peakNotch,x) : smoothBiquadTf2(s); rbjLowShelfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).lowShelf,x) : smoothBiquadTf2(s); rbjHighShelfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).highShelf,x) : smoothBiquadTf2(s); //------------------------------------------------------------------------- // 1-pole low-pass filter // s : a smoothing function applied to each coefficient // f : cutoff frequency //------------------------------------------------------------------------- lp1Smooth(s,f) = fi.iir((1-p),(0-p)) with { p = exp(-2.*ma.PI*f/ma.SR) : s; }; //------------------------------------------------------------------------- // 1-pole high-pass filter // s : a smoothing function applied to each coefficient // f : cutoff frequency //------------------------------------------------------------------------- hp1Smooth(s,f) = fi.iir((0.5*(1.+p),-0.5*(1+p)),(0.-p)) with { p = exp(-2.*ma.PI*f/ma.SR) : s; }; //------------------------------------------------------------------------- // 1-pole all-pass filter // s : a smoothing function applied to each coefficient // f : cutoff frequency //------------------------------------------------------------------------- ap1Smooth(s,f) = fi.iir((a,1.),(a)) with { a = (-1.+2.*ma.PI*f/ma.SR) : s; };
https://raw.githubusercontent.com/sfztools/sfizz/acd866fd3d247d2fc659593cac96e88e801c29e2/src/sfizz/dsp/filters/filters_modulable.dsp
faust
-*- mode: faust; -*- ------------------------------------------------------------------------- Biquad filter from normalized coefficients b0,b1,b2,a1,a2 : normalized coefficients ------------------------------------------------------------------------- ------------------------------------------------------------------------- Biquad filter using smoothed coefficients s : a smoothing function applied to each coefficient b0,b1,b2,a1,a2 : normalized coefficients ------------------------------------------------------------------------- ------------------------------------------------------------------------- RBJ filter of a specific type using smoothed coefficients s : a smoothing function applied to each coefficient f : cutoff frequency g : gain in decibel, for peaking and shelving types only q : height of the resonant peak in linear units ------------------------------------------------------------------------- ------------------------------------------------------------------------- 1-pole low-pass filter s : a smoothing function applied to each coefficient f : cutoff frequency ------------------------------------------------------------------------- ------------------------------------------------------------------------- 1-pole high-pass filter s : a smoothing function applied to each coefficient f : cutoff frequency ------------------------------------------------------------------------- ------------------------------------------------------------------------- 1-pole all-pass filter s : a smoothing function applied to each coefficient f : cutoff frequency -------------------------------------------------------------------------
declare author "Jean Pierre Cimalando"; declare license "BSD-2-Clause"; import("stdfaust.lib"); rbj = library("rbj_filters.dsp"); biquad(b0,b1,b2,a1,a2) = fi.iir((b0,b1,b2),(a1,a2)); biquadTf2(b0,b1,b2,a1,a2) = fi.tf22t(b0,b1,b2,a1,a2); smoothBiquad(s,b0,b1,b2,a1,a2) = biquad(b0:s,b1:s,b2:s,a1:s,a2:s); smoothBiquadTf2(s,b0,b1,b2,a1,a2) = biquadTf2(b0:s,b1:s,b2:s,a1:s,a2:s); rbjLpfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).LPF,x) : smoothBiquadTf2(s); rbjHpfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).HPF,x) : smoothBiquadTf2(s); rbjBpfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).BPF,x) : smoothBiquadTf2(s); rbjNotchSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).notch,x) : smoothBiquadTf2(s); rbjApfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).APF,x) : smoothBiquadTf2(s); rbjPeakingEqSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).peakingEQ,x) : smoothBiquadTf2(s); rbjPeakingNotchSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).peakNotch,x) : smoothBiquadTf2(s); rbjLowShelfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).lowShelf,x) : smoothBiquadTf2(s); rbjHighShelfSmooth(s,f,g,q,x) = (rbj.filtercoeff(f,g,q).highShelf,x) : smoothBiquadTf2(s); lp1Smooth(s,f) = fi.iir((1-p),(0-p)) with { p = exp(-2.*ma.PI*f/ma.SR) : s; }; hp1Smooth(s,f) = fi.iir((0.5*(1.+p),-0.5*(1+p)),(0.-p)) with { p = exp(-2.*ma.PI*f/ma.SR) : s; }; ap1Smooth(s,f) = fi.iir((a,1.),(a)) with { a = (-1.+2.*ma.PI*f/ma.SR) : s; };
b68cecabca94e67b189706104757d61447eb13fac738e02588fc50bae19e054c
sfztools/sfizz
sallenkey_modulable.dsp
/** Note(jpc): this is a personal edit of the Sallen-Key state-variable filter from `vaeffects.lib`. This changes: - the frequency control, now in Hz instead of 0-1 - the smooth parameter, allowing for slower parameter transitions while keeping some expensive computation out of the frame loop */ import("stdfaust.lib"); declare author "Eric Tarr"; declare license "MIT-style STK-4.3 license"; //================================Sallen Key Filters====================================== // The following filters were implemented based on VA models of synthesizer // filters. // // The modeling approach is based on a Topology Preserving Transform (TPT) to // resolve the delay-free feedback loop in the corresponding analog filters. // // The primary processing block used to build other filters (Moog, Korg, etc.) is // based on a 1st-order Sallen-Key filter. // // The filters included in this script are 1st-order LPF/HPF and 2nd-order // state-variable filters capable of LPF, HPF, and BPF. // // #### Resources: // // * Vadim Zavalishin (2018) "The Art of VA Filter Design", v2.1.0 // <https://www.native-instruments.com/fileadmin/ni_media/downloads/pdf/VAFilterDesign_2.1.0.pdf> // * Will Pirkle (2014) "Resolving Delay-Free Loops in Recursive Filters Using // the Modified Härmä Method", AES 137 <http://www.aes.org/e-lib/browse.cfm?elib=17517> // * Description and diagrams of 1st- and 2nd-order TPT filters: // <https://www.willpirkle.com/706-2/> //======================================================================================== //------------------`(fi.)sallenKey2ndOrder`----------------- // Sallen-Key generic multi-outputs 2nd order filter. // // This is a 2nd-order Sallen-Key state-variable filter. The idea is that by // "tapping" into different points in the circuit, different filters // (LPF,BPF,HPF) can be achieved. See Figure 4.6 of // <https://www.willpirkle.com/706-2/> // // This is also a good example of the next step for generalizing the Faust // programming approach used for all these VA filters. In this case, there are // three things to calculate each recursive step (y,s1,s2). For each thing, the // circuit is only calculated up to that point. // // Comparing the LPF to BPF, the output signal (y) is calculated similarly. // Except, the output of the BPF stops earlier in the circuit. Similarly, the // states (s1 and s2) only differ in that s2 includes a couple more terms // beyond what is used for s1. // // #### Usage // // ``` // _ : sallenKey2ndOrder(smooth,freq,Q) : _,_,_ // ``` // // Where: // // * `freq`: cutoff frequency // * `Q`: q //--------------------------------------------------------------------- sallenKey2ndOrder(smooth,freq,Q) = _<:(s1,s2,ylpf,ybpf,yhpf) : !,!,_,_,_ letrec{ 's1 = -(s2):-(s1*FBs1):*(alpha0):*(g*2):+(s1); 's2 = -(s2):-(s1*FBs1):*(alpha0):*(g):+(s1):*(g*2):+(s2); // Compute the LPF, BPF, HPF outputs 'ylpf = -(s2):-(s1*FBs1):*(alpha0):*(g*2):+(s1):*(g):+(s2); 'ybpf = -(s2):-(s1*FBs1):*(alpha0):*(g):+(s1); 'yhpf = -(s2):-(s1*FBs1):*(alpha0); } with{ wd = 2*ma.PI*freq; T = 1/ma.SR; wa = (2/T)*tan(wd*T/2); g = (wa*T/2):smooth; G = g/(1.0 + g); R = 1/(2*Q); FBs1 = (2*R+g):smooth; alpha0 = (1/(1 + 2*R*g + g*g)):smooth; }; //------------------`(fi.)sallenKey2ndOrderLPF`----------------- // Sallen-Key 2nd order lowpass filter (see description above). // // // #### Usage // // ``` // _ : sallenKey2ndOrderLPF(smooth,freq,Q) : _ // ``` // // Where: // // * `freq`: cutoff frequency // * `Q`: q //--------------------------------------------------------------------- // Specialize the generic implementation: keep the first LPF output, the compiler will only generate the needed code sallenKey2ndOrderLPF(smooth,freq,Q) = sallenKey2ndOrder(smooth,freq,Q) : _,!,!; //------------------`(fi.)sallenKey2ndOrderBPF`----------------- // Sallen-Key 2nd order bandpass filter (see description above). // // // #### Usage // // ``` // _ : sallenKey2ndOrderBPF(smooth,freq,Q) : _ // ``` // // Where: // // * `freq`: cutoff frequency // * `Q`: q //--------------------------------------------------------------------- // Specialize the generic implementation: keep the second BPF output, the compiler will only generate the needed code sallenKey2ndOrderBPF(smooth,freq,Q) = sallenKey2ndOrder(smooth,freq,Q) : !,_,!; //------------------`(fi.)sallenKey2ndOrderHPF`----------------- // Sallen-Key 2nd order highpass filter (see description above). // // // #### Usage // // ``` // _ : sallenKey2ndOrderHPF(smooth,freq,Q) : _ // ``` // // Where: // // * `freq`: cutoff frequency // * `Q`: q //--------------------------------------------------------------------- // Specialize the generic implementation: keep the third HPF output, the compiler will only generate the needed code sallenKey2ndOrderHPF(smooth,freq,Q) = sallenKey2ndOrder(smooth,freq,Q) : !,!,_;
https://raw.githubusercontent.com/sfztools/sfizz/acd866fd3d247d2fc659593cac96e88e801c29e2/src/sfizz/dsp/filters/sallenkey_modulable.dsp
faust
* Note(jpc): this is a personal edit of the Sallen-Key state-variable filter from `vaeffects.lib`. This changes: - the frequency control, now in Hz instead of 0-1 - the smooth parameter, allowing for slower parameter transitions while keeping some expensive computation out of the frame loop ================================Sallen Key Filters====================================== The following filters were implemented based on VA models of synthesizer filters. The modeling approach is based on a Topology Preserving Transform (TPT) to resolve the delay-free feedback loop in the corresponding analog filters. The primary processing block used to build other filters (Moog, Korg, etc.) is based on a 1st-order Sallen-Key filter. The filters included in this script are 1st-order LPF/HPF and 2nd-order state-variable filters capable of LPF, HPF, and BPF. #### Resources: * Vadim Zavalishin (2018) "The Art of VA Filter Design", v2.1.0 <https://www.native-instruments.com/fileadmin/ni_media/downloads/pdf/VAFilterDesign_2.1.0.pdf> * Will Pirkle (2014) "Resolving Delay-Free Loops in Recursive Filters Using the Modified Härmä Method", AES 137 <http://www.aes.org/e-lib/browse.cfm?elib=17517> * Description and diagrams of 1st- and 2nd-order TPT filters: <https://www.willpirkle.com/706-2/> ======================================================================================== ------------------`(fi.)sallenKey2ndOrder`----------------- Sallen-Key generic multi-outputs 2nd order filter. This is a 2nd-order Sallen-Key state-variable filter. The idea is that by "tapping" into different points in the circuit, different filters (LPF,BPF,HPF) can be achieved. See Figure 4.6 of <https://www.willpirkle.com/706-2/> This is also a good example of the next step for generalizing the Faust programming approach used for all these VA filters. In this case, there are three things to calculate each recursive step (y,s1,s2). For each thing, the circuit is only calculated up to that point. Comparing the LPF to BPF, the output signal (y) is calculated similarly. Except, the output of the BPF stops earlier in the circuit. Similarly, the states (s1 and s2) only differ in that s2 includes a couple more terms beyond what is used for s1. #### Usage ``` _ : sallenKey2ndOrder(smooth,freq,Q) : _,_,_ ``` Where: * `freq`: cutoff frequency * `Q`: q --------------------------------------------------------------------- Compute the LPF, BPF, HPF outputs ------------------`(fi.)sallenKey2ndOrderLPF`----------------- Sallen-Key 2nd order lowpass filter (see description above). #### Usage ``` _ : sallenKey2ndOrderLPF(smooth,freq,Q) : _ ``` Where: * `freq`: cutoff frequency * `Q`: q --------------------------------------------------------------------- Specialize the generic implementation: keep the first LPF output, the compiler will only generate the needed code ------------------`(fi.)sallenKey2ndOrderBPF`----------------- Sallen-Key 2nd order bandpass filter (see description above). #### Usage ``` _ : sallenKey2ndOrderBPF(smooth,freq,Q) : _ ``` Where: * `freq`: cutoff frequency * `Q`: q --------------------------------------------------------------------- Specialize the generic implementation: keep the second BPF output, the compiler will only generate the needed code ------------------`(fi.)sallenKey2ndOrderHPF`----------------- Sallen-Key 2nd order highpass filter (see description above). #### Usage ``` _ : sallenKey2ndOrderHPF(smooth,freq,Q) : _ ``` Where: * `freq`: cutoff frequency * `Q`: q --------------------------------------------------------------------- Specialize the generic implementation: keep the third HPF output, the compiler will only generate the needed code
import("stdfaust.lib"); declare author "Eric Tarr"; declare license "MIT-style STK-4.3 license"; sallenKey2ndOrder(smooth,freq,Q) = _<:(s1,s2,ylpf,ybpf,yhpf) : !,!,_,_,_ letrec{ 's1 = -(s2):-(s1*FBs1):*(alpha0):*(g*2):+(s1); 's2 = -(s2):-(s1*FBs1):*(alpha0):*(g):+(s1):*(g*2):+(s2); 'ylpf = -(s2):-(s1*FBs1):*(alpha0):*(g*2):+(s1):*(g):+(s2); 'ybpf = -(s2):-(s1*FBs1):*(alpha0):*(g):+(s1); 'yhpf = -(s2):-(s1*FBs1):*(alpha0); } with{ wd = 2*ma.PI*freq; T = 1/ma.SR; wa = (2/T)*tan(wd*T/2); g = (wa*T/2):smooth; G = g/(1.0 + g); R = 1/(2*Q); FBs1 = (2*R+g):smooth; alpha0 = (1/(1 + 2*R*g + g*g)):smooth; }; sallenKey2ndOrderLPF(smooth,freq,Q) = sallenKey2ndOrder(smooth,freq,Q) : _,!,!; sallenKey2ndOrderBPF(smooth,freq,Q) = sallenKey2ndOrder(smooth,freq,Q) : !,_,!; sallenKey2ndOrderHPF(smooth,freq,Q) = sallenKey2ndOrder(smooth,freq,Q) : !,!,_;
60f59093a0ede346389c7e4dd5a9626ca47b487318474865d8af4e91cc2a6f88
sfztools/sfizz
sfz_filters.dsp
// -*- mode: faust; -*- declare author "Jean Pierre Cimalando"; declare license "BSD-2-Clause"; import("stdfaust.lib"); fm = library("filters_modulable.dsp"); sk = library("sallenkey_modulable.dsp"); //============================================================================== // Generators // the SFZ *noise generator sfzNoise = no.noise : *(0.25); //============================================================================== // Filters // To generate a specific filter from this file, use: // faust2jack -double -pn sfzPeq src/sfizz/dsp/filters/sfz_filters.dsp // and replace sfzPeq by the filter you want // the SFZ lowpass 1-pole filter sfzLpf1p = fm.lp1Smooth(smoothCoefs,cutoff); // the SFZ lowpass 2-pole filter sfzLpf2p = fm.rbjLpfSmooth(smoothCoefs,cutoff,0.,Q); // the SFZ lowpass 4-pole filter sfzLpf4p = sfzLpf2p : sfzLpf2p; // the SFZ lowpass 6-pole filter sfzLpf6p = sfzLpf2p : sfzLpf2p : sfzLpf2p; // the SFZ highpass 1-pole filter sfzHpf1p = fm.hp1Smooth(smoothCoefs,cutoff); // the SFZ highpass 2-pole filter sfzHpf2p = fm.rbjHpfSmooth(smoothCoefs,cutoff,0.,Q); // the SFZ highpass 4-pole filter sfzHpf4p = sfzHpf2p : sfzHpf2p; // the SFZ highpass 6-pole filter sfzHpf6p = sfzHpf2p : sfzHpf2p : sfzHpf2p; // the SFZ bandpass 1-pole filter sfzBpf1p = sfzLpf1p : sfzHpf1p; // the SFZ bandpass 2-pole filter sfzBpf2p = fm.rbjBpfSmooth(smoothCoefs,cutoff,0.,Q); // the SFZ bandpass 4-pole filter // Note: bpf_4p not in specification but here anyway sfzBpf4p = sfzBpf2p : sfzBpf2p; // the SFZ bandpass 6-pole filter // Note: bpf_6p not in specification but here anyway sfzBpf6p = sfzBpf2p : sfzBpf2p : sfzBpf2p; // the SFZ allpass 1-pole filter sfzApf1p = fm.ap1Smooth(smoothCoefs,cutoff); // the SFZ notch 1-pole filter // Note: this thing is my invention, may not be correct. // in Sforzando, 1p seems implemented the same as 2p. sfzBrf1p = _ <: (_, (sfzApf1p : sfzApf1p)) :> +; // the SFZ notch 2-pole filter sfzBrf2p = fm.rbjNotchSmooth(smoothCoefs,cutoff,0.,Q); // the SFZ pink filter sfzPink = no.pink_filter; // the SFZ 2-pole state-variable lowpass filter sfzLpf2pSv = sk.sallenKey2ndOrderLPF(smoothCoefs,cutoff,Q); // the SFZ 2-pole state-variable highpass filter sfzHpf2pSv = sk.sallenKey2ndOrderHPF(smoothCoefs,cutoff,Q); // the SFZ 2-pole state-variable bandpass filter sfzBpf2pSv = sk.sallenKey2ndOrderBPF(smoothCoefs,cutoff,Q); // the SFZ 2-pole state-variable notch filter sfzBrf2pSv = _ <: (sfzLpf2pSv, sfzHpf2pSv) :> +; // the SFZ low-shelf filter sfzLsh = fm.rbjLowShelfSmooth(smoothCoefs,cutoff,pkShGain,Q); // the SFZ high-shelf filter sfzHsh = fm.rbjHighShelfSmooth(smoothCoefs,cutoff,pkShGain,Q); // the SFZ peaking EQ filter sfzPeq = fm.rbjPeakingEqSmooth(smoothCoefs,cutoff,pkShGain,Q); // the SFZ equalizer band sfzEqPeak = fm.rbjPeakingEqSmooth(smoothCoefs,cutoff,pkShGain,Q) with { Q = 1./(2.*ma.sinh(0.5*log(2)*bandwidth*w0/sin(w0))); w0 = 2*ma.PI*cutoff/ma.SR; }; // the SFZ low-shelf with EQ controls sfzEqLshelf = fm.rbjLowShelfSmooth(smoothCoefs,cutoff,pkShGain,Q) with { // Q = sfzGetQFromSlope(slope); Q = 1./(2.*ma.sinh(0.5*log(2)*bandwidth*w0/sin(w0))); w0 = 2*ma.PI*cutoff/ma.SR; }; // the SFZ high-shelf with EQ controls sfzEqHshelf = fm.rbjHighShelfSmooth(smoothCoefs,cutoff,pkShGain,Q) with { // Q = sfzGetQFromSlope(slope); Q = 1./(2.*ma.sinh(0.5*log(2)*bandwidth*w0/sin(w0))); w0 = 2*ma.PI*cutoff/ma.SR; }; //============================================================================== // Utility // a common function that computes the EQ shelf parameter sfzGetQFromSlope(slope) = 1.0/sqrt((A+1.0/A)*(1.0/S-1.0)+2.0) with { // note(jpc) slope is a 0-1 control that is reduced into a domain of validity, // and clamped to avoid the extremes at both sides. S = (slope*root) : max(1e-2) : min(root-1e-2); A = 10^(pkShGain/40); root = (A*A+1)/((A-1)*(A-1)); // the root of the expression under sqrt() }; //============================================================================== // Filters (stereo) sfz2chLpf1p = par(i,2,sfzLpf1p); sfz2chLpf2p = par(i,2,sfzLpf2p); sfz2chLpf4p = par(i,2,sfzLpf4p); sfz2chLpf6p = par(i,2,sfzLpf6p); sfz2chHpf1p = par(i,2,sfzHpf1p); sfz2chHpf2p = par(i,2,sfzHpf2p); sfz2chHpf4p = par(i,2,sfzHpf4p); sfz2chHpf6p = par(i,2,sfzHpf6p); sfz2chBpf1p = par(i,2,sfzBpf1p); sfz2chBpf2p = par(i,2,sfzBpf2p); sfz2chBpf4p = par(i,2,sfzBpf4p); sfz2chBpf6p = par(i,2,sfzBpf6p); sfz2chApf1p = par(i,2,sfzApf1p); sfz2chBrf1p = par(i,2,sfzBrf1p); sfz2chBrf2p = par(i,2,sfzBrf2p); sfz2chPink = par(i,2,sfzPink); sfz2chLpf2pSv = par(i,2,sfzLpf2pSv); sfz2chHpf2pSv = par(i,2,sfzHpf2pSv); sfz2chBpf2pSv = par(i,2,sfzBpf2pSv); sfz2chBrf2pSv = par(i,2,sfzBrf2pSv); sfz2chLsh = par(i,2,sfzLsh); sfz2chHsh = par(i,2,sfzHsh); sfz2chPeq = par(i,2,sfzPeq); sfz2chEqPeak = par(i,2,sfzEqPeak); sfz2chEqLshelf = par(i,2,sfzEqLshelf); sfz2chEqHshelf = par(i,2,sfzEqHshelf); //============================================================================== // Filter parameters cutoff = hslider("[01] Cutoff [unit:Hz] [scale:log]", 440.0, 50.0, 10000.0, 1.0) : max(1.0) : min(20000.0); Q = vslider("[02] Resonance [unit:dB]", 0.0, 0.0, 40.0, 0.1) : max(-60.0) : min(60.0) : ba.db2linear; pkShGain = vslider("[03] Peak/shelf gain [unit:dB]", 0.0, 0.0, 40.0, 0.1) : max(-120.0) : min(60.0); bandwidthOrSlope = vslider("[04] Bandwidth [unit:octave]", 1.0, 0.1, 10.0, 0.01); bandwidth = bandwidthOrSlope : max(1e-2) : min(12.0); slope = bandwidthOrSlope; // limited further down in code // smoothing function to prevent fast changes of filter coefficients // The basic si.smoo is a bit longish and creates strange modulation sounds // The smoothing coefficients seem to start at 0, and thus there's a small // time where the coefficients go e.g. from 0 to cutoff. // smoothCoefs = si.smoo; // The below line uses no smoothing at all. This could require smoothing in code // done on the filter parameters rather than directly on the biquad's coefficients. // smoothCoefs = _ ; // No smoothing applied at all // This applies a quicker smoothing but which may render the filter unstable smoothCoefs = si.smooth(ba.if(smoothEnable, pole, 0.0)) with { timeConstant = 1e-3; // time constant = 1ms pole = ba.tau2pole(timeConstant); smoothEnable = fvariable(int fSmoothEnable, <math.h>); };
https://raw.githubusercontent.com/sfztools/sfizz/0bc63e33c84ba57a266ab5f0027deb7856f4dc0e/src/sfizz/dsp/filters/sfz_filters.dsp
faust
-*- mode: faust; -*- ============================================================================== Generators the SFZ *noise generator ============================================================================== Filters To generate a specific filter from this file, use: faust2jack -double -pn sfzPeq src/sfizz/dsp/filters/sfz_filters.dsp and replace sfzPeq by the filter you want the SFZ lowpass 1-pole filter the SFZ lowpass 2-pole filter the SFZ lowpass 4-pole filter the SFZ lowpass 6-pole filter the SFZ highpass 1-pole filter the SFZ highpass 2-pole filter the SFZ highpass 4-pole filter the SFZ highpass 6-pole filter the SFZ bandpass 1-pole filter the SFZ bandpass 2-pole filter the SFZ bandpass 4-pole filter Note: bpf_4p not in specification but here anyway the SFZ bandpass 6-pole filter Note: bpf_6p not in specification but here anyway the SFZ allpass 1-pole filter the SFZ notch 1-pole filter Note: this thing is my invention, may not be correct. in Sforzando, 1p seems implemented the same as 2p. the SFZ notch 2-pole filter the SFZ pink filter the SFZ 2-pole state-variable lowpass filter the SFZ 2-pole state-variable highpass filter the SFZ 2-pole state-variable bandpass filter the SFZ 2-pole state-variable notch filter the SFZ low-shelf filter the SFZ high-shelf filter the SFZ peaking EQ filter the SFZ equalizer band the SFZ low-shelf with EQ controls Q = sfzGetQFromSlope(slope); the SFZ high-shelf with EQ controls Q = sfzGetQFromSlope(slope); ============================================================================== Utility a common function that computes the EQ shelf parameter note(jpc) slope is a 0-1 control that is reduced into a domain of validity, and clamped to avoid the extremes at both sides. the root of the expression under sqrt() ============================================================================== Filters (stereo) ============================================================================== Filter parameters limited further down in code smoothing function to prevent fast changes of filter coefficients The basic si.smoo is a bit longish and creates strange modulation sounds The smoothing coefficients seem to start at 0, and thus there's a small time where the coefficients go e.g. from 0 to cutoff. smoothCoefs = si.smoo; The below line uses no smoothing at all. This could require smoothing in code done on the filter parameters rather than directly on the biquad's coefficients. smoothCoefs = _ ; // No smoothing applied at all This applies a quicker smoothing but which may render the filter unstable time constant = 1ms
declare author "Jean Pierre Cimalando"; declare license "BSD-2-Clause"; import("stdfaust.lib"); fm = library("filters_modulable.dsp"); sk = library("sallenkey_modulable.dsp"); sfzNoise = no.noise : *(0.25); sfzLpf1p = fm.lp1Smooth(smoothCoefs,cutoff); sfzLpf2p = fm.rbjLpfSmooth(smoothCoefs,cutoff,0.,Q); sfzLpf4p = sfzLpf2p : sfzLpf2p; sfzLpf6p = sfzLpf2p : sfzLpf2p : sfzLpf2p; sfzHpf1p = fm.hp1Smooth(smoothCoefs,cutoff); sfzHpf2p = fm.rbjHpfSmooth(smoothCoefs,cutoff,0.,Q); sfzHpf4p = sfzHpf2p : sfzHpf2p; sfzHpf6p = sfzHpf2p : sfzHpf2p : sfzHpf2p; sfzBpf1p = sfzLpf1p : sfzHpf1p; sfzBpf2p = fm.rbjBpfSmooth(smoothCoefs,cutoff,0.,Q); sfzBpf4p = sfzBpf2p : sfzBpf2p; sfzBpf6p = sfzBpf2p : sfzBpf2p : sfzBpf2p; sfzApf1p = fm.ap1Smooth(smoothCoefs,cutoff); sfzBrf1p = _ <: (_, (sfzApf1p : sfzApf1p)) :> +; sfzBrf2p = fm.rbjNotchSmooth(smoothCoefs,cutoff,0.,Q); sfzPink = no.pink_filter; sfzLpf2pSv = sk.sallenKey2ndOrderLPF(smoothCoefs,cutoff,Q); sfzHpf2pSv = sk.sallenKey2ndOrderHPF(smoothCoefs,cutoff,Q); sfzBpf2pSv = sk.sallenKey2ndOrderBPF(smoothCoefs,cutoff,Q); sfzBrf2pSv = _ <: (sfzLpf2pSv, sfzHpf2pSv) :> +; sfzLsh = fm.rbjLowShelfSmooth(smoothCoefs,cutoff,pkShGain,Q); sfzHsh = fm.rbjHighShelfSmooth(smoothCoefs,cutoff,pkShGain,Q); sfzPeq = fm.rbjPeakingEqSmooth(smoothCoefs,cutoff,pkShGain,Q); sfzEqPeak = fm.rbjPeakingEqSmooth(smoothCoefs,cutoff,pkShGain,Q) with { Q = 1./(2.*ma.sinh(0.5*log(2)*bandwidth*w0/sin(w0))); w0 = 2*ma.PI*cutoff/ma.SR; }; sfzEqLshelf = fm.rbjLowShelfSmooth(smoothCoefs,cutoff,pkShGain,Q) with { Q = 1./(2.*ma.sinh(0.5*log(2)*bandwidth*w0/sin(w0))); w0 = 2*ma.PI*cutoff/ma.SR; }; sfzEqHshelf = fm.rbjHighShelfSmooth(smoothCoefs,cutoff,pkShGain,Q) with { Q = 1./(2.*ma.sinh(0.5*log(2)*bandwidth*w0/sin(w0))); w0 = 2*ma.PI*cutoff/ma.SR; }; sfzGetQFromSlope(slope) = 1.0/sqrt((A+1.0/A)*(1.0/S-1.0)+2.0) with { S = (slope*root) : max(1e-2) : min(root-1e-2); A = 10^(pkShGain/40); }; sfz2chLpf1p = par(i,2,sfzLpf1p); sfz2chLpf2p = par(i,2,sfzLpf2p); sfz2chLpf4p = par(i,2,sfzLpf4p); sfz2chLpf6p = par(i,2,sfzLpf6p); sfz2chHpf1p = par(i,2,sfzHpf1p); sfz2chHpf2p = par(i,2,sfzHpf2p); sfz2chHpf4p = par(i,2,sfzHpf4p); sfz2chHpf6p = par(i,2,sfzHpf6p); sfz2chBpf1p = par(i,2,sfzBpf1p); sfz2chBpf2p = par(i,2,sfzBpf2p); sfz2chBpf4p = par(i,2,sfzBpf4p); sfz2chBpf6p = par(i,2,sfzBpf6p); sfz2chApf1p = par(i,2,sfzApf1p); sfz2chBrf1p = par(i,2,sfzBrf1p); sfz2chBrf2p = par(i,2,sfzBrf2p); sfz2chPink = par(i,2,sfzPink); sfz2chLpf2pSv = par(i,2,sfzLpf2pSv); sfz2chHpf2pSv = par(i,2,sfzHpf2pSv); sfz2chBpf2pSv = par(i,2,sfzBpf2pSv); sfz2chBrf2pSv = par(i,2,sfzBrf2pSv); sfz2chLsh = par(i,2,sfzLsh); sfz2chHsh = par(i,2,sfzHsh); sfz2chPeq = par(i,2,sfzPeq); sfz2chEqPeak = par(i,2,sfzEqPeak); sfz2chEqLshelf = par(i,2,sfzEqLshelf); sfz2chEqHshelf = par(i,2,sfzEqHshelf); cutoff = hslider("[01] Cutoff [unit:Hz] [scale:log]", 440.0, 50.0, 10000.0, 1.0) : max(1.0) : min(20000.0); Q = vslider("[02] Resonance [unit:dB]", 0.0, 0.0, 40.0, 0.1) : max(-60.0) : min(60.0) : ba.db2linear; pkShGain = vslider("[03] Peak/shelf gain [unit:dB]", 0.0, 0.0, 40.0, 0.1) : max(-120.0) : min(60.0); bandwidthOrSlope = vslider("[04] Bandwidth [unit:octave]", 1.0, 0.1, 10.0, 0.01); bandwidth = bandwidthOrSlope : max(1e-2) : min(12.0); smoothCoefs = si.smooth(ba.if(smoothEnable, pole, 0.0)) with { pole = ba.tau2pole(timeConstant); smoothEnable = fvariable(int fSmoothEnable, <math.h>); };
be4f6f819ac24271cf27203f5c14f7c15438f601acb4d9a29e31ca34428c5789
sfztools/sfizz
fverb.dsp
// // Référence: // Dattorro, Jon. "Effect design, part 1: Reverberator and other filters." // Journal of the Audio Engineering Society 45.9 (1997): 660-684. // // Note(jpc): faust 2.27.1 lets us take advantage of -uim; // however, avoid use special chars in control names (eg. '-'). declare name "fverb"; declare author "Jean Pierre Cimalando"; declare version "0.5"; declare license "BSD-2-Clause"; import("stdfaust.lib"); ptMax = 300e-3; pt = hslider("[01] Predelay [symbol:predelay] [unit:ms]", 0., 0., ptMax*1e3, 1.) : *(1e-3) : si.smoo; ing = hslider("[02] Input amount [symbol:input] [unit:%]", 100., 0., 100., 0.01) : *(0.01) : si.smoo; tone = hslider("[03] Input low pass cutoff [symbol:input_lowpass] [unit:Hz] [scale:log]", 10000., 1., 20000., 1.); htone = hslider("[04] Input high pass cutoff [symbol:input_highpass] [unit:Hz] [scale:log]", 100., 1., 1000., 1.); id1 = hslider("[05] Input diffusion 1 [symbol:input_diffusion_1] [unit:%]", 75., 0., 100., 0.01) : *(0.01) : si.smoo; id2 = hslider("[06] Input diffusion 2 [symbol:input_diffusion_2] [unit:%]", 62.5, 0., 100., 0.01) : *(0.01) : si.smoo; dd1 = hslider("[07] Tail density [symbol:tail_density] [unit:%]", 70., 0., 100., 0.01) : *(0.01) : si.smoo; dd2 = (dr + 0.15) : max(0.25) : min(0.5); /* (cf. table 1 Reverberation parameters) */ dr = hslider("[08] Decay [symbol:decay] [unit:%]", 50., 0., 100., 0.01) : *(0.01) : si.smoo; damp = hslider("[09] Damping [symbol:damping] [unit:Hz] [scale:log]", 5500., 10., 20000., 1.); modf = /*1.0*/hslider("[10] Modulator frequency [symbol:mod_frequency] [unit:Hz]", 1., 0.01, 4., 0.01) : si.smoo; maxModt = 10e-3; modt = hslider("[11] Modulator depth [symbol:mod_depth] [unit:ms]", 0.5, 0., maxModt*1e3, 0.1) : *(1e-3) : si.smoo; dry = hslider("[12] Dry [symbol:dry] [unit:%]", 100., 0., 100., 0.01) : *(0.01) : si.smoo; wet = hslider("[13] Wet [symbol:wet] [unit:%]", 50., 0., 100., 0.01) : *(0.01) : si.smoo; /* 0:full stereo, 1:full mono */ cmix = 0.; //hslider("[12] Stereo cross mix", 0., 0., 1., 0.01) : *(0.5); /* for complete control of decay parameters */ // dd1 = hslider("[05] Decay diffusion 1 [unit:%]", 70., 0., 100., 0.01) : *(0.01) : si.smoo; // dd2 = hslider("[06] Decay diffusion 2 [unit:%]", 50., 0., 100., 0.01) : *(0.01) : si.smoo; fverb(lIn, rIn) = ((preInL : preInjectorL), (preInR : preInjectorR)) : crossInjector(ff1A, ff1B, ff1C, fb1, ff2A, ff2B, ff2C, fb2) : outputReconstruction with { // this reverb was designed for nominal rate of 29761 Hz T(x) = x/refSR with { refSR = 29761.; }; // reference time to seconds // stereo input (reference was mono downmixed) preInL = (1.-cmix)*lIn+cmix*rIn : *(ing); preInR = (1.-cmix)*rIn+cmix*lIn : *(ing); /* before entry into tank */ /* Note(jpc) different delays left and right in hope to decorrelate more. values not documented anywhere, just out of my magic hat */ preInjectorL = predelay : toneLpf(tone) : toneHpf(htone) : diffusion(id1, 1.03*T(142)) : diffusion(id1, 0.97*T(107)) : diffusion(id2, 0.97*T(379)) : diffusion(id2, 1.03*T(277)); preInjectorR = predelay : toneLpf(tone) : toneHpf(htone) : diffusion(id1, 0.97*T(142)) : diffusion(id1, 1.03*T(107)) : diffusion(id2, 1.03*T(379)) : diffusion(id2, 0.97*T(277)); /* the default for mixed down mono input */ // preInjector = predelay : toneLpf(tone) : // diffusion(id1, T(142)) : diffusion(id1, T(107)) : // diffusion(id2, T(379)) : diffusion(id2, T(277)); /* (cf. 1.3.7 Delay Modulation) Linear delay interpolation introduces undesired damping artifacts, this problem is resolved by using all-pass interpolation instead. Note(jpc) I'm told Dual Delay Interpolation aka `sdelay` works better and exhibits less artifacts. The choice of time constant is for now arbitrary, based on some hints in the documentation of `sdelay`. */ fcomb = ddi(10e-3)/*allpass*/ with { linear = fi.allpass_fcomb; lagrange = fi.allpass_fcomb5; allpass = fi.allpass_fcomb1a; ddi(it, maxdel, N, aN) = (+ <: de.sdelay(maxdel, int(ma.SR*it), N-1),*(aN)) ~ *(-aN) : mem,_ : +; }; delayDim(t) = 65536; // TODO(jpc) expression below does not work? //delayDim(t) = ma.nextpow2(t*maxSR) with { maxSR = 192000. }; predelay = de.delay(delayDim(ptMax), int(pt*ma.SR)); toneLpf(f) = fi.iir((1.-p), (0.-p)) with { p = exp(-2.*ma.PI*f/ma.SR) : si.smoo; }; toneHpf(f) = fi.iir((0.5*(1.+p),-0.5*(1.+p)), (0.-p)) with { p = exp(-2.*ma.PI*f/ma.SR) : si.smoo; }; /* note(jpc) round fixed delays to samples to make it faster */ diffusion(amt, del) = fi.allpass_comb/*fcomb*/(delayDim(del), int(del*ma.SR), amt); dd1Mod1 = dd1OscPair : (_, !); //dd1Mod2 = dd1Mod1; /* (cf. 1.3.7 Delay Modulation) A different secondary oscillator can decorrelate the signal further and create more resonances. */ dd1Mod2 = dd1OscPair : (!, _); /* prefer a quadrature oscillator if frequency is fixed */ //dd1OscPair = os.oscq(modf); /* otherwise use a phase-synchronized pair */ dd1OscPair = sine(p), cosine(p) with { sine(p) = rdtable(tablesize, os.sinwaveform(tablesize), int(p*tablesize)); cosine(p) = sine(wrap(p+0.25)); tablesize = 1 << 16; } letrec { 'p = wrap(p+modf*(1./ma.SR)); }; wrap(p) = p-int(p); fixedDelay(t) = de.delay(delayDim(t), int(ma.SR*t)); modulatedFcomb(t, tMaxExc, tMod, g) = fcomb(delayDim(t+tMaxExc), int(ma.SR*(t+tMod)), g); ff1A = modulatedFcomb(T(762), maxModt, dd1Mod1*modt, ma.neg(dd1)); ff1B = fixedDelay(T(4453)) : toneLpf(damp); ff1C = *(dr) : diffusion(ma.neg(dd2), T(1800)); fb1 = fixedDelay(T(3720)) : *(dr); ff2A = modulatedFcomb(T(908), maxModt, dd1Mod2*modt, ma.neg(dd1)); ff2B = fixedDelay(T(4217)) : toneLpf(damp); ff2C = *(dr) : diffusion(ma.neg(dd2), T(2656)); fb2 = fixedDelay(T(3163)) : *(dr); outputReconstruction(n1, n2, n3, n4, n5, n6) = 0.6*sum(i, 7, lTap(i)), 0.6*sum(i, 7, rTap(i)) with { lTap(0) = n4 : fixedDelay(T(266)); lTap(1) = n4 : fixedDelay(T(2974)); lTap(2) = n5 : fixedDelay(T(1913)) : ma.neg; lTap(3) = n6 : fixedDelay(T(1996)); lTap(4) = n1 : fixedDelay(T(1990)) : ma.neg; lTap(5) = n2 : fixedDelay(T(187)) : ma.neg; lTap(6) = n3 : fixedDelay(T(1066)) : ma.neg; // rTap(0) = n1 : fixedDelay(T(353)); rTap(1) = n1 : fixedDelay(T(3627)); rTap(2) = n2 : fixedDelay(T(1228)) : ma.neg; rTap(3) = n3 : fixedDelay(T(2673)); rTap(4) = n4 : fixedDelay(T(2111)) : ma.neg; rTap(5) = n5 : fixedDelay(T(335)) : ma.neg; rTap(6) = n6 : fixedDelay(T(121)) : ma.neg; }; /* * A1 B1 C1 * ^ ^ ^ * | | | * in1 -> [+] ----> [ . ff1 . ] >--.---. * ^ | * | | * .----< [fb1] <--- [z-1] <-------. * | | * .----< [fb2] <--- [z-1] <---. | * | | * v | * in2 -> [+] ----> [ . ff2 . ] >--.-------. * | | | * v v v * A2 B2 C2 * * note: implicit unit delay in the feedback paths */ crossInjector( ff1A, ff1B, ff1C, fb1, ff2A, ff2B, ff2C, fb2, in1, in2) = A1, B1, C1, A2, B2, C2 letrec { 'A1 = C2 : fb1 : +(in1) : ff1A; 'B1 = C2 : fb1 : +(in1) : ff1A : ff1B; 'C1 = C2 : fb1 : +(in1) : ff1A : ff1B : ff1C; 'A2 = C1 : fb2 : +(in2) : ff2A; 'B2 = C1 : fb2 : +(in2) : ff2A : ff2B; 'C2 = C1 : fb2 : +(in2) : ff2A : ff2B : ff2C; }; }; process(l, r) = fverb(l, r) : mix with { mix(rl, rr) = dry*l+wet*rl, dry*r+wet*rr; };
https://raw.githubusercontent.com/sfztools/sfizz/acd866fd3d247d2fc659593cac96e88e801c29e2/src/sfizz/effects/dsp/fverb.dsp
faust
Référence: Dattorro, Jon. "Effect design, part 1: Reverberator and other filters." Journal of the Audio Engineering Society 45.9 (1997): 660-684. Note(jpc): faust 2.27.1 lets us take advantage of -uim; however, avoid use special chars in control names (eg. '-'). (cf. table 1 Reverberation parameters) 1.0 0:full stereo, 1:full mono hslider("[12] Stereo cross mix", 0., 0., 1., 0.01) : *(0.5); for complete control of decay parameters dd1 = hslider("[05] Decay diffusion 1 [unit:%]", 70., 0., 100., 0.01) : *(0.01) : si.smoo; dd2 = hslider("[06] Decay diffusion 2 [unit:%]", 50., 0., 100., 0.01) : *(0.01) : si.smoo; this reverb was designed for nominal rate of 29761 Hz reference time to seconds stereo input (reference was mono downmixed) before entry into tank Note(jpc) different delays left and right in hope to decorrelate more. values not documented anywhere, just out of my magic hat the default for mixed down mono input preInjector = predelay : toneLpf(tone) : diffusion(id1, T(142)) : diffusion(id1, T(107)) : diffusion(id2, T(379)) : diffusion(id2, T(277)); (cf. 1.3.7 Delay Modulation) Linear delay interpolation introduces undesired damping artifacts, this problem is resolved by using all-pass interpolation instead. Note(jpc) I'm told Dual Delay Interpolation aka `sdelay` works better and exhibits less artifacts. The choice of time constant is for now arbitrary, based on some hints in the documentation of `sdelay`. allpass TODO(jpc) expression below does not work? delayDim(t) = ma.nextpow2(t*maxSR) with { maxSR = 192000. }; note(jpc) round fixed delays to samples to make it faster fcomb dd1Mod2 = dd1Mod1; (cf. 1.3.7 Delay Modulation) A different secondary oscillator can decorrelate the signal further and create more resonances. prefer a quadrature oscillator if frequency is fixed dd1OscPair = os.oscq(modf); otherwise use a phase-synchronized pair * A1 B1 C1 * ^ ^ ^ * | | | * in1 -> [+] ----> [ . ff1 . ] >--.---. * ^ | * | | * .----< [fb1] <--- [z-1] <-------. * | | * .----< [fb2] <--- [z-1] <---. | * | | * v | * in2 -> [+] ----> [ . ff2 . ] >--.-------. * | | | * v v v * A2 B2 C2 * * note: implicit unit delay in the feedback paths
declare name "fverb"; declare author "Jean Pierre Cimalando"; declare version "0.5"; declare license "BSD-2-Clause"; import("stdfaust.lib"); ptMax = 300e-3; pt = hslider("[01] Predelay [symbol:predelay] [unit:ms]", 0., 0., ptMax*1e3, 1.) : *(1e-3) : si.smoo; ing = hslider("[02] Input amount [symbol:input] [unit:%]", 100., 0., 100., 0.01) : *(0.01) : si.smoo; tone = hslider("[03] Input low pass cutoff [symbol:input_lowpass] [unit:Hz] [scale:log]", 10000., 1., 20000., 1.); htone = hslider("[04] Input high pass cutoff [symbol:input_highpass] [unit:Hz] [scale:log]", 100., 1., 1000., 1.); id1 = hslider("[05] Input diffusion 1 [symbol:input_diffusion_1] [unit:%]", 75., 0., 100., 0.01) : *(0.01) : si.smoo; id2 = hslider("[06] Input diffusion 2 [symbol:input_diffusion_2] [unit:%]", 62.5, 0., 100., 0.01) : *(0.01) : si.smoo; dd1 = hslider("[07] Tail density [symbol:tail_density] [unit:%]", 70., 0., 100., 0.01) : *(0.01) : si.smoo; dr = hslider("[08] Decay [symbol:decay] [unit:%]", 50., 0., 100., 0.01) : *(0.01) : si.smoo; damp = hslider("[09] Damping [symbol:damping] [unit:Hz] [scale:log]", 5500., 10., 20000., 1.); maxModt = 10e-3; modt = hslider("[11] Modulator depth [symbol:mod_depth] [unit:ms]", 0.5, 0., maxModt*1e3, 0.1) : *(1e-3) : si.smoo; dry = hslider("[12] Dry [symbol:dry] [unit:%]", 100., 0., 100., 0.01) : *(0.01) : si.smoo; wet = hslider("[13] Wet [symbol:wet] [unit:%]", 50., 0., 100., 0.01) : *(0.01) : si.smoo; fverb(lIn, rIn) = ((preInL : preInjectorL), (preInR : preInjectorR)) : crossInjector(ff1A, ff1B, ff1C, fb1, ff2A, ff2B, ff2C, fb2) : outputReconstruction with { preInL = (1.-cmix)*lIn+cmix*rIn : *(ing); preInR = (1.-cmix)*rIn+cmix*lIn : *(ing); preInjectorL = predelay : toneLpf(tone) : toneHpf(htone) : diffusion(id1, 1.03*T(142)) : diffusion(id1, 0.97*T(107)) : diffusion(id2, 0.97*T(379)) : diffusion(id2, 1.03*T(277)); preInjectorR = predelay : toneLpf(tone) : toneHpf(htone) : diffusion(id1, 0.97*T(142)) : diffusion(id1, 1.03*T(107)) : diffusion(id2, 1.03*T(379)) : diffusion(id2, 0.97*T(277)); linear = fi.allpass_fcomb; lagrange = fi.allpass_fcomb5; allpass = fi.allpass_fcomb1a; ddi(it, maxdel, N, aN) = (+ <: de.sdelay(maxdel, int(ma.SR*it), N-1),*(aN)) ~ *(-aN) : mem,_ : +; }; predelay = de.delay(delayDim(ptMax), int(pt*ma.SR)); toneLpf(f) = fi.iir((1.-p), (0.-p)) with { p = exp(-2.*ma.PI*f/ma.SR) : si.smoo; }; toneHpf(f) = fi.iir((0.5*(1.+p),-0.5*(1.+p)), (0.-p)) with { p = exp(-2.*ma.PI*f/ma.SR) : si.smoo; }; dd1Mod1 = dd1OscPair : (_, !); dd1Mod2 = dd1OscPair : (!, _); dd1OscPair = sine(p), cosine(p) with { sine(p) = rdtable(tablesize, os.sinwaveform(tablesize), int(p*tablesize)); cosine(p) = sine(wrap(p+0.25)); tablesize = 1 << 16; } letrec { 'p = wrap(p+modf*(1./ma.SR)); }; wrap(p) = p-int(p); fixedDelay(t) = de.delay(delayDim(t), int(ma.SR*t)); modulatedFcomb(t, tMaxExc, tMod, g) = fcomb(delayDim(t+tMaxExc), int(ma.SR*(t+tMod)), g); ff1A = modulatedFcomb(T(762), maxModt, dd1Mod1*modt, ma.neg(dd1)); ff1B = fixedDelay(T(4453)) : toneLpf(damp); ff1C = *(dr) : diffusion(ma.neg(dd2), T(1800)); fb1 = fixedDelay(T(3720)) : *(dr); ff2A = modulatedFcomb(T(908), maxModt, dd1Mod2*modt, ma.neg(dd1)); ff2B = fixedDelay(T(4217)) : toneLpf(damp); ff2C = *(dr) : diffusion(ma.neg(dd2), T(2656)); fb2 = fixedDelay(T(3163)) : *(dr); outputReconstruction(n1, n2, n3, n4, n5, n6) = 0.6*sum(i, 7, lTap(i)), 0.6*sum(i, 7, rTap(i)) with { lTap(0) = n4 : fixedDelay(T(266)); lTap(1) = n4 : fixedDelay(T(2974)); lTap(2) = n5 : fixedDelay(T(1913)) : ma.neg; lTap(3) = n6 : fixedDelay(T(1996)); lTap(4) = n1 : fixedDelay(T(1990)) : ma.neg; lTap(5) = n2 : fixedDelay(T(187)) : ma.neg; lTap(6) = n3 : fixedDelay(T(1066)) : ma.neg; rTap(0) = n1 : fixedDelay(T(353)); rTap(1) = n1 : fixedDelay(T(3627)); rTap(2) = n2 : fixedDelay(T(1228)) : ma.neg; rTap(3) = n3 : fixedDelay(T(2673)); rTap(4) = n4 : fixedDelay(T(2111)) : ma.neg; rTap(5) = n5 : fixedDelay(T(335)) : ma.neg; rTap(6) = n6 : fixedDelay(T(121)) : ma.neg; }; crossInjector( ff1A, ff1B, ff1C, fb1, ff2A, ff2B, ff2C, fb2, in1, in2) = A1, B1, C1, A2, B2, C2 letrec { 'A1 = C2 : fb1 : +(in1) : ff1A; 'B1 = C2 : fb1 : +(in1) : ff1A : ff1B; 'C1 = C2 : fb1 : +(in1) : ff1A : ff1B : ff1C; 'A2 = C1 : fb2 : +(in2) : ff2A; 'B2 = C1 : fb2 : +(in2) : ff2A : ff2B; 'C2 = C1 : fb2 : +(in2) : ff2A : ff2B : ff2C; }; }; process(l, r) = fverb(l, r) : mix with { mix(rl, rr) = dry*l+wet*rl, dry*r+wet*rr; };