form caption("LCDynamite") size(400, 300), pluginid("def1")
image bounds(0, 1, 263, 115)
image bounds(6, 6, 52, 101) file("LCDImage.png") identchannel("letter1")
image bounds(56, 6, 52, 101) file("LCDImage.png") identchannel("letter2")
image bounds(106, 6, 52, 101) file("LCDImage.png") identchannel("letter3")
image bounds(156, 6, 52, 101) file("LCDImage.png") identchannel("letter4")
image bounds(206, 6, 52, 101) file("LCDImage.png") identchannel("letter5")
button bounds(270, 12, 80, 31), channel("trigger"), text("Change")
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
;instrument will be triggered by keyboard widget
instr updateGUI
iWords[][] init 4, 5
iWords fillarray 27, 20, 8, 9, 19,
23, 15, 18, 11, 19,
27, 18, 5, 1, 12,
27, 23, 5, 12, 12
kCount init 0
kdeb init 0
kTrig metro 4
if changed:k(chnget:k("trigger")) == 1 then
Sletter sprintfk "crop(%d,0,52,101)", (iWords[kCount][0]- 1) * 51
chnset Sletter, "letter1"
Sletter sprintfk "crop(%d,0,52,101)", (iWords[kCount][1]- 1) * 51
chnset Sletter, "letter2"
Sletter sprintfk "crop(%d,0,52,101)", (iWords[kCount][2]- 1) * 51
chnset Sletter, "letter3"
Sletter sprintfk "crop(%d,0,52,101)", (iWords[kCount][3]- 1) * 51
chnset Sletter, "letter4"
Sletter sprintfk "crop(%d,0,52,101)", (iWords[kCount][4]- 1) * 51
chnset Sletter, "letter5"
kdeb = kdeb<25 ? kdeb+1 : 0
kCount = kCount < 3 ? kCount+1 : 0
endif
endin
;causes Csound to run for about 7000 years...
f0 z
i 1 0 [3600*24*7] ;read var stored in instr1