external clock for starter

This commit is contained in:
severak 2019-12-21 20:39:57 +01:00
parent 4f02f491a5
commit 5f5144b8c6
1 changed files with 16 additions and 3 deletions

View File

@ -7,7 +7,8 @@
<Cabbage>
form caption("Starter") size(150, 100), colour(58, 110, 182), pluginid("strt")
button bounds(7, 6, 136, 80) text("START", "STOP") channel("starter")
button bounds(7, 6, 136, 62) text("START", "STOP") channel("starter")
checkbox bounds(14, 70, 118, 25) channel("extclock") text("external clock")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
@ -21,15 +22,27 @@ nchnls = 2
;instrument will be triggered by keyboard widget
instr GUI
kStart chnget "starter"
kextclock chnget "extclock"
if kextclock==1 then
kStart chnget "IS_PLAYING"
else
kStart chnget "starter"
endif
if changed:k(kStart) == 1 then
if kextclock==1 then
chnset kStart, "starter"
endif
if kStart == 1 then
midiout 144, 1, 60, 60
elseif kStart == 0 then
midiout 128, 1, 60, 0
endif
printks "%d\n", 0, kStart
;printks "%d\n", 0, kStart
endif