From e9425e5ac21a706afbaf34307d2874cbc4cb0b88 Mon Sep 17 00:00:00 2001 From: severak Date: Sun, 22 Mar 2020 21:50:56 +0100 Subject: [PATCH] somewhat finished analog nomad --- cabbages/analog_nomad.csd | 56 ++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/cabbages/analog_nomad.csd b/cabbages/analog_nomad.csd index a840dc4..3edbc4a 100644 --- a/cabbages/analog_nomad.csd +++ b/cabbages/analog_nomad.csd @@ -5,26 +5,35 @@ ; (s) Severák 2019-20 ; licensed with MIT license -form caption("Analog NOMAD (by Severák)") size(500, 330), colour(0, 51, 153), pluginid("anod") +form caption("NOMAD") size(500, 330), colour(0, 51, 153), pluginid("anod") keyboard bounds(8, 220, 381, 95) combobox bounds(8, 10, 61, 25) channel("offset") text("-24", "-12", "+0", "+12", "+24") value(3) -checkbox bounds(22, 102, 117, 30) channel("hold") text("hold") hslider bounds(4, 42, 136, 22) range(0.01, 1, 0.01, 1, 0.001) channel("attack") text("attack") hslider bounds(3, 74, 138, 23) range(0.01, 1, 0.5, 1, 0.001) channel("decay") text("decay") -hslider bounds(6, 176, 485, 34) range(0, 22000, 22000, 0.5, 0.001) channel("traveller") +checkbox bounds(22, 102, 117, 30) channel("hold") text("hold") +checkbox bounds(22, 136, 117, 30) channel("mono") text("mono") + + hslider bounds(152, 40, 132, 24) range(0, 0.3, 0, 1, 0.001) channel("pulse") text("pulse") hslider bounds(152, 68, 133, 26) range(0, 0.3, 0.3, 1, 0.001) channel("saw") text("saw") hslider bounds(152, 102, 135, 29) range(0, 0.3, 0, 1, 0.001) channel("sub") text("sub") -checkbox bounds(292, 138, 92, 30) channel("quack") text("quack") -checkbox bounds(152, 138, 92, 30) channel("bite") text("bite") -rslider bounds(404, 238, 60, 60) range(0, 3, 1, 1, 0.001) channel("vol") -label bounds(74, 8, 208, 27) text("Analog NOMAD") -hslider bounds(292, 40, 150, 25) range(0, 1, 0.5, 1, 0.001) channel("pulse_kpw") text("kpw") -hslider bounds(292, 68, 150, 27) range(0.01, 0.99, 0.5, 1, 0.001) channel("saw_kpw") text("kpw") -checkbox bounds(22, 138, 117, 30) channel("mono") text("mono") -combobox bounds(292, 10, 122, 24) channel("preset") populate("*.snaps") -filebutton bounds(424, 10, 65, 24) mode("snapshot") text("SNAP") channel("snapshot") +hslider bounds(152, 138, 135, 29) range(0, 0.3, 0, 1, 0.001) channel("noise") text("noise") + +hslider bounds(292, 40, 150, 25) range(0.01, 0.99, 0.5, 1, 0.001) channel("pulse_kpw") text("width") +hslider bounds(292, 68, 150, 27) range(0.01, 0.99, 0.5, 1, 0.001) channel("saw_kpw") text("angle") hslider bounds(292, 102, 150, 28) range(-100, 100, 0, 1, 1) channel("det") text("det") + +hslider bounds(6, 176, 485, 34) range(0, 22000, 22000, 0.5, 0.001) channel("traveller") +checkbox bounds(292, 138, 75, 30) channel("quack") text("quack") +hslider bounds(374, 138, 70, 30) range(0, 0.5, 0, 1, 0.1) channel("bite") + +rslider bounds(404, 236, 60, 60) range(0, 3, 1, 1, 0.001) channel("vol") + +label bounds(74, 8, 208, 27) text("Analog NOMAD") + +combobox bounds(292, 10, 122, 24) populate("*.snaps") +filebutton bounds(424, 10, 65, 24) mode("snapshot") text("SNAP") + @@ -76,12 +85,6 @@ instr 1 ibite chnget "bite" - if ibite==1 then - ires = 0.5 - else - ires = 0 - endif - if isustain == 1 then kEnv madsr iattack, 0.0001, 1, idecay else @@ -92,22 +95,27 @@ instr 1 kSaw chnget "saw" kPulse chnget "pulse" kSub chnget "sub" + kNoise chnget "noise" kPulseKpw chnget "pulse_kpw" kSawKpw chnget "saw_kpw" - - aSaw vco2 kSaw, kcps, 4, kSawKpw aPulse vco2 kPulse, kcps, 2, kPulseKpw - aSub vco2 kSub, kcpsSub, 10 + aSub vco2 kSub, kcpsSub, 10, kPulseKpw + aNoise noise kNoise, 0.5 - aOsc = (aSaw + aPulse + aSub) * kEnv + if kcpsSaw != kcps then + aSaw2 vco2 kSaw, kcpsSaw, 4, kSawKpw + aSaw = (aSaw/2) + (aSaw2/2) + endif + + aOsc = (aSaw + aPulse + aSub + aNoise) * kEnv if iquack==1 then - aOutFilter moogladder2 aOsc, kfilter * kEnv, ires + aOutFilter moogladder2 aOsc, kfilter * kEnv, ibite else - aOutFilter moogladder2 aOsc, kfilter, ires + aOutFilter moogladder2 aOsc, kfilter, ibite endif aOut clip aOutFilter * kVol, 0, 1