Skip to content

Instantly share code, notes, and snippets.

@jpcima jpcima/Phase100.dsp
Created Aug 6, 2019

Embed
What would you like to do?
declare name "Phase100";
declare author "JPC";
declare version "1.0";
declare license "CC0-1.0";
// Modélisation de la Fame Sweet TonePhaser PH-10 (un clone de la MXR Phase 100)
// Référence :
// Kiiski, R., Esqueda, F., & Välimäki, V. (2016).
// Time-variant gray-box modeling of a phaser pedal.
// In 19th International Conference on Digital Audio Effects (DAFx-16).
import("stdfaust.lib");
allpass1(f) = fi.iir((a,1.),(a)) with {
a = -1.+2.*ma.PI*f/ma.SR;
};
allpassCutoffFromPubliCoef(a) = (a+1.)*sr/(2.*ma.PI) with { sr = 44.1e3; };
process(x) = dry + wet with {
dry = x*d;
wet = (x <: (+:a1:a2:a3:a4:a5:a6:a7:a8:a9:a10)~*(fb))*w;
lfotype = checkbox("[1] Color");
ls = hslider("[2] LFO speed", 0.5, 0., 1., 0.01);
w = hslider("[3] Wet gain [unit:dB]", -6., -60.0, 20., 1.) : ba.db2linear : si.smoo;
d = hslider("[4] Dry gain [unit:dB]", -6., -60.0, 20., 1.) : ba.db2linear : si.smoo;
fb = hslider("[5] Feedback", 0., 0., 0.9, 0.01);
lf = 0.069 * exp(4. * ls);
fixedFreq = allpassCutoffFromPubliCoef(-0.89);
modLfoRangeMin = allpassCutoffFromPubliCoef(-0.84);
modLfoRangeMax = allpassCutoffFromPubliCoef(-0.39);
modLfoFreq = os.lf_trianglepos(lf) * (modLfoRangeMax-modLfoRangeMin) + modLfoRangeMin;
modNoLfoRangeMin = allpassCutoffFromPubliCoef(-0.49);
modNoLfoRangeMax = allpassCutoffFromPubliCoef(0.77);
modNoLfoFreq = abs(os.oscsin(lf)) * (modNoLfoRangeMax-modNoLfoRangeMin) + modNoLfoRangeMin;
modFreq = ba.if(lfotype, modLfoFreq, modNoLfoFreq);
a1 = allpass1(fixedFreq);
a2 = allpass1(fixedFreq);
a3 = allpass1(modFreq);
a4 = allpass1(modFreq);
a5 = allpass1(modFreq);
a6 = allpass1(modFreq);
a7 = allpass1(modFreq);
a8 = allpass1(modFreq);
a9 = allpass1(fixedFreq);
a10 = allpass1(fixedFreq);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.