somewhat finished analog nomad

This commit is contained in:
severak 2020-03-22 21:50:56 +01:00
parent 7dedec1c48
commit e9425e5ac2
1 changed files with 32 additions and 24 deletions

View File

@ -5,26 +5,35 @@
; (s) Severák 2019-20 ; (s) Severák 2019-20
; licensed with MIT license ; licensed with MIT license
<Cabbage> <Cabbage>
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) keyboard bounds(8, 220, 381, 95)
combobox bounds(8, 10, 61, 25) channel("offset") text("-24", "-12", "+0", "+12", "+24") value(3) 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(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(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, 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, 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") 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") hslider bounds(152, 138, 135, 29) range(0, 0.3, 0, 1, 0.001) channel("noise") text("noise")
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") hslider bounds(292, 40, 150, 25) range(0.01, 0.99, 0.5, 1, 0.001) channel("pulse_kpw") text("width")
label bounds(74, 8, 208, 27) text("Analog NOMAD") hslider bounds(292, 68, 150, 27) range(0.01, 0.99, 0.5, 1, 0.001) channel("saw_kpw") text("angle")
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(292, 102, 150, 28) range(-100, 100, 0, 1, 1) channel("det") text("det") 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")
</Cabbage> </Cabbage>
<CsoundSynthesizer> <CsoundSynthesizer>
<CsOptions> <CsOptions>
@ -76,12 +85,6 @@ instr 1
ibite chnget "bite" ibite chnget "bite"
if ibite==1 then
ires = 0.5
else
ires = 0
endif
if isustain == 1 then if isustain == 1 then
kEnv madsr iattack, 0.0001, 1, idecay kEnv madsr iattack, 0.0001, 1, idecay
else else
@ -92,22 +95,27 @@ instr 1
kSaw chnget "saw" kSaw chnget "saw"
kPulse chnget "pulse" kPulse chnget "pulse"
kSub chnget "sub" kSub chnget "sub"
kNoise chnget "noise"
kPulseKpw chnget "pulse_kpw" kPulseKpw chnget "pulse_kpw"
kSawKpw chnget "saw_kpw" kSawKpw chnget "saw_kpw"
aSaw vco2 kSaw, kcps, 4, kSawKpw aSaw vco2 kSaw, kcps, 4, kSawKpw
aPulse vco2 kPulse, kcps, 2, kPulseKpw 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 if iquack==1 then
aOutFilter moogladder2 aOsc, kfilter * kEnv, ires aOutFilter moogladder2 aOsc, kfilter * kEnv, ibite
else else
aOutFilter moogladder2 aOsc, kfilter, ires aOutFilter moogladder2 aOsc, kfilter, ibite
endif endif
aOut clip aOutFilter * kVol, 0, 1 aOut clip aOutFilter * kVol, 0, 1