shithub: neindaw

ref: 7afee3728457100711a544d74ef9c18829bf1a8b
dir: /dsp/kick_drum.dsp/

View raw version
// Simple kick drum
declare name "Kick Drum";
declare group "Synthesis";
import("stdfaust.lib");

aFreq = hslider("v:A/[0]Frequency[unit:Hz]", 100, 5, 200, 1);
aA = hslider("v:A/[1]Attack[unit:s]", 0.001, 0.00001, 0.2, 0.001);
aR = hslider("v:A/[3]Release[unit:s]", 0.001, 0.00001, 1.0, 0.001);
bA = hslider("v:B/[1]Attack[unit:s]", 0.001, 0.00001, 0.2, 0.001);
bR = hslider("v:B/[2]Release[unit:s]", 0.001, 0.00001, 1, 0.001);
bFreq = checkbox("v:B/[3]Enable") * hslider("v:B/[0]Frequency[unit:Hz]", -5, -200, 200, 1);

gain = hslider("v:Control/[0]Gain[style:knob]", 1, 0, 1, 0.01);
gate = button("v:Control/[1]Gate[autovoice]");

process = os.hs_oscsin(aFreq + bFreq*en.ar(bA, bR, gate), gate : ba.impulsify) * gain * en.ar(aA, aR, gate);