form caption("Untitled") size(400, 300), guiMode("queue") pluginId("def1")
button bounds(10,30,100,15) text("Change String") channel("change")
button bounds(10,10,100,15) text("Save String") channel("save")
label bounds(10,50,100,14) text("ABC") channel("label") colour("black")
image bounds(10,100,50,50) channel("box");colour(0,50,30)
-n -d
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
instr StoreData
SData = p4
SPointer = p5
prints "\n S T O R E D A T A <--- %s | %s",SPointer,SData
cabbageSetStateValue SPointer, SData
endin
instr 1
String init "ABC"
if(changed(cabbageGet:k("save"))==1)then
SInstrCall sprintfk " i \"StoreData\" 0 0 \"%s\" \"name(1)\"",String
scoreline SInstrCall, 1
endif
kchange cabbageGet "change"
if(changed(kchange)==1)then
if(kchange==1)then
String sprintfk "%cBC",196
endif
if(kchange==0)then
String sprintfk "%s","ABC"
endif
cabbageSet 1,"label","text",String
endif
cabbageSet metro(4),"box","colour",rand(255)
endin
;causes Csound to run for about 7000 years...
f0 z
;starts instrument 1 and runs it for a week
i1 0 [60*60*24*7]