Skip to content

Instantly share code, notes, and snippets.

@jpcima
Created December 4, 2020 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpcima/53d0c31fd935e964ff735d3f913da4c3 to your computer and use it in GitHub Desktop.
Save jpcima/53d0c31fd935e964ff735d3f913da4c3 to your computer and use it in GitHub Desktop.
import("stdfaust.lib");
numkeys = 88;
depth = hslider("[1] Depth", 1, 0, 1, 0.01);
pitches(i) = hslider("[%n] Resonance frequency %j [unit:Hz]", 1, 0, 22000, 1) with { n = i*10+100; j = i+1; };
feedbacks(i) = hslider("[%n] Resonance feedback %j", 0, 0, 1, 0.001) with { n = i*10+101; j = i+1; };
bandwidths(i) = hslider("[%n] Bandwidth %j [unit:Hz]", 1, 0, 10, 0.01) with { n = i*10+102; j = i+1; };
gains(i) = hslider("[%n] Gain %j", 0, 0, 1, 0.01) with { n = i*10+103; j = i+1; };
resonator(f,r,g,b) = fi.bandpass(1, f-0.5*b, f+0.5*b) : fi.nlf2(f, r) : (_,!) : *(g);
process = _ <: (_, (sympathetic_resonance : *(depth))) :> + with {
sympathetic_resonance = _ <: par(i, numkeys, band(i)) :> +;
band(i) = resonator(pitches(i), feedbacks(i), bandwidths(i), gains(i));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment