Skip to content

Commit

Permalink
Update MidiVCO10.csd
Browse files Browse the repository at this point in the history
  • Loading branch information
Djack13 authored Jul 8, 2018
1 parent c3c62ca commit 2e1fea0
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions csd/MidiVCO10.csd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ nchnls = 1
0dbfs = 1
;channel init
chn_k "Waveform", 1
chn_k "Octave", 1
chn_k "Semitone", 1
chn_k "Harmonics", 1
chn_k "PulseWidth", 1
chn_k "PhaseDepth", 1
chn_k "PhaseRate", 1
chn_k "NoiseBW", 1
gisine ftgen 0, 0, 4096, 10, 1 ;Sine wave
itmp ftgen 1, 0, 16384, 7, 0, 2048, 1, 4096, 1, 4096, -1, 4096, -1, 2048, 0 ;user defined waveform: trapezoid wave
Expand All @@ -32,6 +42,11 @@ instr 1 ;GUI
gkphsRte chnget "PhaseRate"
gkbw chnget "NoiseBW"
gkmode = gkWave * 2
if gkphsDep > 0.01 then
gkmode = gkmode + 16
endif
kgate active 2
chnset kgate, "Gate"
endin
Expand Down Expand Up @@ -60,17 +75,12 @@ instr 2 ;Poly Midi Instrument
asig pinkish 4*iamp
asig butbp asig, kcps, kcps * gkbw
else ;vco2
kmode = gkWave * 2
if gkphsDep > 0.01 then
kmode = kmode + 16
endif
kphs poscil gkphsDep*0.5, gkphsRte, gisine ;Phase mod
kphs = kphs + 0.5
;*** All this to reduce click during reinit !!!
kinit init 0
kChanged changed gknyx, kmode
kChanged changed gknyx, gkmode
if kChanged==1 then
kinit = 1
endif
Expand All @@ -92,7 +102,7 @@ instr 2 ;Poly Midi Instrument
;***
Reinit_vco:
asig vco2 kenv*kfade*iamp, kcps, i(kmode), kpw, kphs, i(gknyx)/2
asig vco2 kenv*kfade*iamp, kcps, i(gkmode), kpw, kphs, i(gknyx)/2
rireturn
endif
out asig
Expand Down

0 comments on commit 2e1fea0

Please sign in to comment.