- Lid sinds
- 12 oktober 2016
- Berichten
- 5.608
Dat loopt ook niet goed, maar het is een oud beestje waar het op moet draaien.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature currently requires accessing the site using the built-in Safari browser.
declare name "ChaosSynth7";
declare options "[midi:on]";
declare options "[nvoices:8]";
import("maths.lib");
import("reverbs.lib");
import("filters.lib");
import("stdfaust.lib");
import("oscillators.lib");
//-----general controls-----------
gate = button("v:chaos/[1]gate[style:button]");
freq = hslider("v:chaos/h:[2]control/[1]freq[style:knob]",200,50,5000,0.01) : si.smoo;
gain = hslider("v:chaos/h:[2]control/[2]gain[style:knob]",0.1,0,1,0.01) si.smoo;
bend = ba.semi2ratio(hslider("v:chaos/h:[2]control/[3]bend[midi:pitchwheel][style:knob]",0,-20,20,0.01)) : si.smoo;
oct = hslider("v:chaos/h:[2]control/[4]octave[style:knob]", 1, 1, 2, 0.01) : si.smoo;
att = hslider("v:chaos/h:[2]control/[5]attack[style:knob]", 0.01, 0, 1, 0.01) : si.smoo;
dec = hslider("v:chaos/h:[2]control/[6]decay[style:knob]", 0.01, 0, 1, 0.01) : si.smoo;
sus = hslider("v:chaos/h:[2]control/[7]sustain[style:knob]", 0.8, 0.1, 1, 0.01) : si.smoo;
rel = hslider("v:chaos/h:[2]control/[8]release[style:knob]", 1, 0, 5, 0.01) : si.smoo;
vol = hslider("v:chaos/h:[2]control/[9]volume[style:knob]", 0.5, 0, 1, 0.0001) : si.smoo;
//------------------------------
//-----connections--------------
add(x,y) = x,y : +;
block(x,y) = x,y :_*(1-_);
leak(x) = x*(1-le);
C = ((add,_) : (block:leak)) ~ _;
A(x,y) = x,y,y;
AA(x,y) = x,x,y,y;
AAA(x,y) = x,x,y;
//------------------------------
//-----chaos control-------------
le = hslider("v:chaos/v:[3]chaos/[1]leak[scale:log]", 0.00000000001,0.00000000001,1,0.00000000001) : si.smoo;
pa = hslider("v:chaos/v:[3]chaos/[2]parameter", 0.6, 0.55,1,0.001) : si.smoo;
//-------------------------------
//-----chaos tweaking------------
tw1 = hslider("v:chaos/v:[4]tweaking/[1]tweak1", 0, -0.1,0.01,0.00001) : si.smoo;
tw2 = hslider("v:chaos/v:[4]tweaking/[2]tweak2[scale:log]", 100, 1,200,0.001) : si.smoo ;
tw3 = hslider("v:chaos/v:[4]tweaking/[3]tweak3", 0,0,0.08,0.00001) : si.smoo;
//-------------------------------
//-----modulation-----------------
modisin = hslider("v:chaos/v:[5]modulation/[1]sine modulation index", 0,0,8,0.00001) : si.smoo;
moddsin = hslider("v:chaos/v:[5]modulation/[2]sine modulation depth", 0,0,5,0.00001) : si.smoo;
modisquar = hslider("v:chaos/v:[5]modulation/[3]square modulation index", 0,0,8,0.00001) : si.smoo;
moddsquar = hslider("v:chaos/v:[5]modulation/[4]square modulation depth", 0,0,5,0.00001) : si.smoo;
modisaw = hslider("v:chaos/v:[5]modulation/[5]saw modulation index", 0,0,8,0.00001) : si.smoo;
moddsaw = hslider("v:chaos/v:[5]modulation/[6]saw modulation depth", 0,0,5,0.00001) : si.smoo;
modulationsin = moddsin*oscsin((1+modisin)*freq);
modulationsquar = moddsquar*square((1+modisquar)*freq);
modulationsaw = moddsaw*sawtooth((1+modisaw)*freq);
modulationsum = modulationsin + modulationsquar + modulationsaw;
modulation = 1 + atan(modulationsum); //tempered total modulation
//--------------------------------
//----timeconstant integrators----
timeconstant = 1.6*10^(-5) + 0.1585/(freq*bend*oct*modulation); //with added offset blocking disallowed (too small) time constant values
//--------------------------------
//----- R ------------------------
B = _ : _/SR : _/timeconstant : _ ;
Integrator = A : B,_,_ : block,_ : C;
P = _,_,_ : add,_ : A : Integrator,_ : AA : _,Integrator,_ : _,AAA : _,_, Integrator : _,_,_;
Q(x,y,z) = -1*pa*x - (1 + tw1)*y + abs(tw2*atan(z/tw2))^(1 + tw3) - 1;
R = (P : Q) ~ _;
//-------------------------------
//-----envelope-----------------
envelope = en.adsr(att,dec,sus,rel,gate)*gain;
//------------------------------
//-----reverb-------------------
t60 = hslider("v:chaos/h:[6]reverb/reverberation time[style:knob]", 10, 0.1, 60, 0.01) : si.smoo;
damp = hslider("v:chaos/h:[6]reverb/damping[style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
size = hslider("v:chaos/h:[6]reverb/size[style:knob]", 3, 0.5, 5, 0.01) : si.smoo;
early = hslider("v:chaos/h:[6]reverb/early reflections[style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
mod_depth = hslider("v:chaos/h:[6]reverb/modulation depth[style:knob]", 0.1, 0, 1, 0.01) : si.smoo;
mod_freq = hslider("v:chaos/h:[6]reverb/modulation frequency[style:knob]", 1, 0, 10, 0.01) : si.smoo;
low = hslider("v:chaos/h:[6]reverb/low band[style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
mid = hslider("v:chaos/h:[6]reverb/mid band[style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
high = hslider("v:chaos/h:[6]reverb/high band[style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
low_cutoff = hslider("v:chaos/h:[6]reverb/low cutoff[style:knob]", 500, 100, 6000, 1) : si.smoo;
high_cutoff = hslider("v:chaos/h:[6]reverb/high cutoff[style:knob]", 5000, 1000, 10000, 1) : si.smoo;
V = re.jpverb(t60, damp, size, early, mod_depth, mod_freq, low, mid, high, low_cutoff, high_cutoff);
//------------------------------
//-----audio safety-------------
safe(x) = atan(x)/5; //suppression of extreme output values
//------------------------------
process = R*vol : _*envelope <: _ , zero(1) : V : dcblocker,dcblocker : safe,safe;
Bijbehorende geluidsfragmenten volgen later als mijn hoofdpijn weg is.
declare name "ChaosSynth7";
declare options "[midi:on]";
declare options "[nvoices:8]";
import("maths.lib");
import("reverbs.lib");
import("filters.lib");
import("stdfaust.lib");
import("oscillators.lib");
//-----general controls-----------
gate = button("v:chaos/[1]gate[style:button]");
freq = hslider("v:chaos/h:[2]control/[1]freq[style:knob]",200,50,5000,0.01) : si.smoo;
gain = hslider("v:chaos/h:[2]control/[2]gain[style:knob]",0.1,0,1,0.01) : si.smoo;
bend = ba.semi2ratio(hslider("v:chaos/h:[2]control/[3]bend[midi:pitchwheel][style:knob]",0,-20,20,0.01)) : si.smoo;
oct = hslider("v:chaos/h:[2]control/[4]octave[style:knob]", 1, 1, 2, 0.01) : si.smoo;
att = hslider("v:chaos/h:[2]control/[5]attack[style:knob]", 0.01, 0, 1, 0.01) : si.smoo;
dec = hslider("v:chaos/h:[2]control/[6]decay[style:knob]", 0.01, 0, 1, 0.01) : si.smoo;
sus = hslider("v:chaos/h:[2]control/[7]sustain[style:knob]", 0.8, 0.1, 1, 0.01) : si.smoo;
rel = hslider("v:chaos/h:[2]control/[8]release[style:knob]", 1, 0, 5, 0.01) : si.smoo;
vol = hslider("v:chaos/h:[2]control/[9]volume[style:knob]", 0.5, 0, 1, 0.0001) : si.smoo;
//------------------------------
//-----connections--------------
add(x,y) = x,y : +;
block(x,y) = x,y :_*(1-_);
leak(x) = x*(1-le);
C = ((add,_) : (block:leak)) ~ _;
A(x,y) = x,y,y;
AA(x,y) = x,x,y,y;
AAA(x,y) = x,x,y;
//------------------------------
//-----chaos control-------------
le = hslider("v:chaos/v:[3]chaos/[1]leak[scale:log]", 0.00000000001,0.00000000001,1,0.00000000001) : si.smoo;
pa = hslider("v:chaos/v:[3]chaos/[2]parameter", 0.6, 0.55,1,0.001) : si.smoo;
//-------------------------------
//-----chaos tweaking------------
tw1 = hslider("v:chaos/v:[4]tweaking/[1]tweak1", 0, -0.1,0.01,0.00001) : si.smoo;
tw2 = hslider("v:chaos/v:[4]tweaking/[2]tweak2[scale:log]", 100, 1,200,0.001) : si.smoo ;
tw3 = hslider("v:chaos/v:[4]tweaking/[3]tweak3", 0,0,0.08,0.00001) : si.smoo;
//-------------------------------
//-----modulation-----------------
modisin = hslider("v:chaos/v:[5]modulation/[1]sine modulation index", 0,0,8,0.00001) : si.smoo;
moddsin = hslider("v:chaos/v:[5]modulation/[2]sine modulation depth", 0,0,5,0.00001) : si.smoo;
modisquar = hslider("v:chaos/v:[5]modulation/[3]square modulation index", 0,0,8,0.00001) : si.smoo;
moddsquar = hslider("v:chaos/v:[5]modulation/[4]square modulation depth", 0,0,5,0.00001) : si.smoo;
modisaw = hslider("v:chaos/v:[5]modulation/[5]saw modulation index", 0,0,8,0.00001) : si.smoo;
moddsaw = hslider("v:chaos/v:[5]modulation/[6]saw modulation depth", 0,0,5,0.00001) : si.smoo;
modulationsin = moddsin*oscsin((1+modisin)*freq);
modulationsquar = moddsquar*square((1+modisquar)*freq);
modulationsaw = moddsaw*sawtooth((1+modisaw)*freq);
modulationsum = modulationsin + modulationsquar + modulationsaw;
modulation = 1 + atan(modulationsum); //tempered total modulation
//--------------------------------
//----timeconstant integrators----
timeconstant = 1.6*10^(-5) + 0.1585/(freq*bend*oct*modulation); //with added offset blocking disallowed (too small) time constant values
//--------------------------------
//----- R ------------------------
B = _ : _/SR : _/timeconstant : _ ;
Integrator = A : B,_,_ : block,_ : C;
P = _,_,_ : add,_ : A : Integrator,_ : AA : _,Integrator,_ : _,AAA : _,_, Integrator : _,_,_;
Q(x,y,z) = -1*pa*x - (1 + tw1)*y + abs(tw2*atan(z/tw2))^(1 + tw3) - 1;
R = (P : Q) ~ _;
//-------------------------------
//-----envelope-----------------
envelope = en.adsr(att,dec,sus,rel,gate)*gain;
//------------------------------
//-----reverb-------------------
t60 = hslider("v:chaos/h:[6]reverb/reverberation time[style:knob]", 10, 0.1, 60, 0.01) : si.smoo;
damp = hslider("v:chaos/h:[6]reverb/damping[style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
size = hslider("v:chaos/h:[6]reverb/size[style:knob]", 3, 0.5, 5, 0.01) : si.smoo;
early = hslider("v:chaos/h:[6]reverb/early reflections[style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
mod_depth = hslider("v:chaos/h:[6]reverb/modulation depth[style:knob]", 0.1, 0, 1, 0.01) : si.smoo;
mod_freq = hslider("v:chaos/h:[6]reverb/modulation frequency[style:knob]", 1, 0, 10, 0.01) : si.smoo;
low = hslider("v:chaos/h:[6]reverb/low band[style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
mid = hslider("v:chaos/h:[6]reverb/mid band[style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
high = hslider("v:chaos/h:[6]reverb/high band[style:knob]", 0.5, 0, 1, 0.01) : si.smoo;
low_cutoff = hslider("v:chaos/h:[6]reverb/low cutoff[style:knob]", 500, 100, 6000, 1) : si.smoo;
high_cutoff = hslider("v:chaos/h:[6]reverb/high cutoff[style:knob]", 5000, 1000, 10000, 1) : si.smoo;
V = re.jpverb(t60, damp, size, early, mod_depth, mod_freq, low, mid, high, low_cutoff, high_cutoff);
//------------------------------
//-----audio safety-------------
safe(x) = atan(x)/5; //suppression of extreme output values
//------------------------------
process = R*vol : _*envelope <: _ , zero(1) : V : dcblocker,dcblocker : safe,safe;