Skip to content

Commit

Permalink
dattorro tank
Browse files Browse the repository at this point in the history
  • Loading branch information
grammaton committed May 2, 2024
1 parent d46d8fd commit 50b17cc
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 2 deletions.
68 changes: 68 additions & 0 deletions src/seam.dattorro.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import("seam.lib");

// funzione per l'adattamento dei valori
adapt(val) = sre.adaptSR(sre.jdSR,val);

/*SLIDER-----------------------------------------------*/

mymax = 96000;
pdly = vslider("[0]preDelay", 0, 0, mymax, 1); //si può impostare SR
decay = vslider("[1]decay", 0.5, 0, 0.99999, 0.00001) : si.smoo;
dDgroup(x) = hgroup("[2]Decay diffusion", x) : si.smoo;
ddiff1 = dDgroup(vslider("1", 0.7, 0, 0.999, 0.001));
ddiff2 = dDgroup(vslider("2", 0.5, 0.25, 0.5, 0.001)) : si.smoo;
iDgroup(x) = hgroup("[3]Input diffusion", x);
idif1 = iDgroup(vslider("1", 0.75, 0, 0.999, 0.001));
idif2 = iDgroup(vslider("2", 0.625, 0, 1, 0.001));
bw = vslider("[4]bandWidth", 0.7, 0, 0.9999999, 0.01);
damp = 1-vslider("[5]damping", 0.0005, 0, 1, 0.0001);
exgroup(x) = hgroup("[6]Excursion", x);
oscRadio = exgroup(vslider("Osc[style:radio{'Sine':0;'Tri':1;'Sqare':2}]",0, 0, 2, 1));
oscS = select3(oscRadio,os.osc(0.07),os.triangle(0.07),os.square(0.07));
exui = exgroup(vslider("Amp", 16, 0, 100, 0.001));
dattorro = hgroup("Dattorro Reverb",
inputDiffusion : tank : tap : accumulator);

/*FILTRI-----------------------------------------------*/
//lp1p(a) = _*(a) : +~*(1-a);
//apf(idif, t) = (+ <: de.delay(mymax, t),*(idif) : _,_)~*(-idif) : mem,_ : +;
//process = os.impulse <: apf(1/sqrt(2),1),sjm.apf(1,1/sqrt(2));

//apf2(idif, t) = (ma.sub <: (de.delay(mymax, t) <: _,_,_),*(idif) : *(idif),_,+)~_ : !,_,_;
apf3(t,g,x) = (x+_ : *(-g) <: _+x, _ : del(t-1),_)~(0-_) : mx
with{
del(t,x) = de.delay(ma.SR,t,x),x;
mx(a,b,c) = b,mem(a),mem(a)+c;
};
//process = os.impulse <: apf2(1/sqrt(2),2656), apf2o(2656,1/sqrt(2)),sjm.apf(2656,1/sqrt(2));

apfm(idif, t, ex) = (+ : (*(idif) <: de.sdelay(mymax, 512, t+(oscS*ex)), _))~*(idif) : -;

/*-----------------------------------------------------*/

inputDiffusion = +/2 : de.delay(mymax, pdly) : sfi.eavg2(bw) : sjm.apf(adapt(142),idif1) : sjm.apf(adapt(107),idif1) : sjm.apf(adapt(379),idif2) : sjm.apf(adapt(277),idif2);
//process = os.impulse <: inputDiffusion;

r = apfm(ddiff1, adapt(908), exui) <: _, (de.delay(mymax, adapt(4217)) : sfi.eavg2(damp) : *(decay) : apf3(adapt(2656),ddiff2) : _,_, de.delay(mymax, adapt(3163)));
//process = r;

l = apfm(ddiff1, adapt(672), exui) <: _, (de.delay(mymax, adapt(4453)) : sfi.eavg2(damp) : *(decay) : apf3(adapt(1800),ddiff2) : _,_, de.delay(mymax, adapt(3720)));
//process = l;
//process = l,r;

//tank = _ <: (ro.cross(2),_,_ : _,ro.cross(2),_ : +,+ : r,l : mat)~(_*(decay),_*(decay)) : !,!,_,_,_,_,_,_;
tank = (ro.cross(2),si.bus(2) :> (l : ro.crossNM(3,1)), r : _, ro.crossNM(6,1))~(par(i,2,*(decay)));
process = _ <: tank;

mat = route(8,8,(1,3),(2,4),(3,5),(4,1),(5,6),(6,7),(7,8),(8,2));

tap = (_<: de.delay(mymax,adapt(266)),de.delay(mymax,adapt(2974)),de.delay(mymax,adapt(2111))),
(_ <: de.delay(mymax,adapt(1913)),de.delay(mymax,adapt(335))),
(_ <: de.delay(mymax,adapt(1996)),de.delay(mymax,adapt(121))),
(_ <: de.delay(mymax,adapt(1990)),de.delay(mymax,adapt(353)),de.delay(mymax,adapt(3627))),
(_ <: de.delay(mymax,adapt(187)),de.delay(mymax,adapt(1228))),
(_ <: de.delay(mymax,adapt(1066)),de.delay(mymax,adapt(2673)));

accumulator = route(14,4,(1,3),(2,3),(3,2),(4,4),(5,2),(6,3),(7,2),(8,4),(9,1),(10,1),(11,4),(12,2),(13,4),(14,1)) : par(i,4,*(0.6)) : -,- : ro.cross(2);

//process = dattorro;
2 changes: 1 addition & 1 deletion src/seam.lib
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ san = library("seam.analyzers.lib");
sba = library("seam.basic.lib");
sma = library("seam.math.lib");
sfi = library("seam.filters.lib");
// sre = library("seam.reverbs.lib");
sre = library("seam.reverbs.lib");
sno = library("seam.noises.lib");
// ### general ambisonic teory
// sam = library("seam.ambisonic.lib");
Expand Down
26 changes: 26 additions & 0 deletions src/seam.reverbs.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
declare name "SEAM Reverbs - Library";
declare version "0.2";
declare author "Daniele Annese";
declare author "Anthony Di Furia";
declare author "Giuseppe Silvi";
declare author "Francesco Vitucci";
declare license "CC3";

import("seam.lib");

//==============================================================================
//============= SCHROEDER - NATURAL SOUNDING ARTIFICIAL REVERBERATION - 1962 ===
//==============================================================================

sre = library("seam.reverbs.lib");

//------------------------------------------------------------ T60 EQUATIONS ---
tau(t60,g) = (-20*log10(abs(g))*t60)/60;
gain(t60,t) = 10^((60*t)/(-20*t60));
//----------------------------------------------------------- OLD SAMPLERATE ---
jcSR = 25000;
imSR = 25000;
jdSR = 29761;
//------------------------------------- OLD Samplerate to Current Samplerate ---
adaptSR(oldSR,samples) = samples * ma.SR / oldSR;
//process = adaptSR(oldSR,101);
Empty file added src/seam.roads.lib
Empty file.
3 changes: 2 additions & 1 deletion src/seam.schroeder.lib
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ apfdfl = apf(173,1/sqrt(2)) : apf(229,1/sqrt(2)) <:
dflc(673,0.89), dflc(1447,0.78), dflc(1811,0.74), dflc(2111,0.63);

//----------------------------------- FREQUENCY-DEPENDENT REVERBERATION TIME ---
dflf(t,g,fc) = (+ : de.delay(ma.SR/2, int(t-1)))~scy.onepole(fc)*(g) : mem;
//dflf(t,g,fc) = (+ : de.delay(ma.SR/2, int(t-1)))~scy.onepole(fc)*(g) : mem;
dflf(md,t,g,d) = (+ : de.delay(md,t-1))~sfi.eavg2(d)*(g) : mem;
//process = os.impulse : dflf(1,1/sqrt(2),1000);

//------------------------------------------------ AMBIOPHONIC-REVERBERATION ---
Expand Down

0 comments on commit 50b17cc

Please sign in to comment.