falco/cabbages/velofix.csd

64 lines
1.7 KiB
Plaintext
Raw Normal View History

2019-12-03 19:26:20 +00:00
;
; WARNING: DO NOT USE THIS, IT'S BROKEN FOR NOW
;
2019-10-29 23:03:43 +00:00
; VELOFIX
; (c) Severak 2019
; MIT licensed
2019-10-31 21:30:16 +00:00
<Cabbage>
2019-11-08 00:46:59 +00:00
form caption("VeloFix") size(250, 120), colour(58, 110, 182), pluginid("vefi"), bounds(0, 0, 250, 120)
2019-11-07 21:52:02 +00:00
checkbox bounds(132, 4, 100, 30) text("by volume") channel("byvol")
2019-11-08 00:46:59 +00:00
label bounds(0, 4, 134, 31) text("VeloFix")
hslider bounds(4, 36, 245, 43) range(0, 127, 0, 1, 1) channel("vol")
button bounds(134, 80, 80, 37) text("Silence!") colour:1(255, 0, 0, 255) colour:0(0, 0, 255, 255) channel("silence")
hslider bounds(6, 82, 124, 31) range(0, 16, 0, 1, 1) channel("channel")
2019-10-29 23:03:43 +00:00
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-dm0 -+rtmidi=NULL -Q0 -M0 --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
2019-10-31 21:30:16 +00:00
ksmps = 64
2019-10-29 23:03:43 +00:00
;instrument will be triggered by keyboard widget
instr 1
kstatus, kchan, kdata1, kdata2 midiin
kvol chnget "vol"
kbyvol chnget "byvol"
2019-10-31 21:30:16 +00:00
if changed(kstatus, kchan, kdata1, kdata2)==1 then
2019-10-29 23:03:43 +00:00
if kstatus==144 then
midiout kstatus, kchan, kdata1, kvol
2019-11-08 00:46:59 +00:00
elseif kstatus==128 then
midiout kstatus, kchan, kdata1, 0
2019-10-29 23:03:43 +00:00
elseif kstatus==176 && kdata1=7 then
if kbyvol==1 then
chnset kdata2, "vol"
endif
elseif kstatus>0 then
midiout kstatus, kchan, kdata1, kdata2
endif
endif
2019-11-08 00:46:59 +00:00
kSilence chnget "silence"
kChannel chnget "channel"
if changed(kSilence)==1 then
kCnt init 21
until kCnt > 108 do
printks "OFF %d", 0, kCnt
midiout 128, kChannel, kCnt, 0
kCnt = kCnt + 1
enduntil
endif
2019-10-29 23:03:43 +00:00
endin
</CsInstruments>
<CsScore>
i 1 0 [3600*24*7]
</CsScore>
</CsoundSynthesizer>