Cabbage Logo
Back to Cabbage Site

Multi page

@rorywalsh Well here a multi page (with plants) I made, starting from the toogle example, but with three buttons that call three plants. The buttons code is in the “Instr 1” section, but in that way also the plants are triggered by the keyboard widget :confused: Where am I failing?

` bounds(0, 0, 0, 0)
form caption(“MultiPage”) size(800, 600), colour(86, 76, 56), pluginid(“def1”)
button bounds(500, 2, 60, 25), channel(“but1”), text(“Osc”, “Osc”), value(1)
button bounds(570, 2, 60, 25), channel(“but2”), text(“Fx”, “Fx”), value(0)
button bounds(640, 2, 60, 25), channel(“but3”), text(“Arp”, “Arp”), value(0)

groupbox bounds(0, 40, 800, 560), text(“White Sliders”), visible(0), identchannel(“sliders1”), plant(“GUIabst_1”){
image bounds(0, 0, 800, 560) file(“atke.png”)
rslider bounds( 0, 100, 80, 80), valuetextbox(1), textbox(1), text(“Att.”), channel(“AAtt”), range(0, 5, 0.05), $SLIDER_STYLE
rslider bounds( 60, 100, 80, 80), valuetextbox(1), textbox(1), text(“Dec.”), channel(“ADec”), range(0, 5, 0.5), $SLIDER_STYLE
rslider bounds(120, 100, 80, 80), valuetextbox(1), textbox(1), text(“Sus.”), channel(“ASus”), range(0, 1, 1), $SLIDER_STYLE
rslider bounds(180, 100, 80, 80), valuetextbox(1), textbox(1), text(“Rel.”), channel(“ARel”), range(0, 5, 0.2), $SLIDER_STYLE

;hslider bounds(0, 30, 200, 30), channel(“hslider1”), range(0, 100, 55), colour(“white”)
;hslider bounds(0, 60, 200, 30), channel(“hslider2”), range(0, 100, 23), colour(“white”)
;hslider bounds(0, 90, 200, 30), channel(“hslider3”), range(0, 100, 45), colour(“white”)
;hslider bounds(0, 120, 200, 30), channel(“hslider4”), range(0, 100, 56), colour(“white”)
}

groupbox bounds(0, 40, 800, 560), text(“Red Sliders”), visible(0), identchannel(“sliders2”), plant(“GUIabst_2”){
image bounds(0, 0, 800, 560) file(“bente.png”)
hslider bounds(0, 30, 200, 30), channel(“hslider5”), range(0, 100, 25), colour(“red”)
hslider bounds(0, 60, 200, 30), channel(“hslider6”), range(0, 100, 63), colour(“red”)
hslider bounds(0, 90, 200, 30), channel(“hslider7”), range(0, 100, 15), colour(“red”)
hslider bounds(0, 120, 200, 30), channel(“hslider8”), range(0, 100, 16), colour(“red”)
}

groupbox bounds(0, 40, 800, 560), text(“Yellow Sliders”), visible(0), identchannel(“sliders3”), plant(“GUIabst_3”){
image bounds(0, 0, 800, 560) file(“dutdu.png”)
hslider bounds(0, 30, 200, 30), channel(“hslider9”), range(0, 100, 5, 1, 0.001), colour(255, 255, 0, 255) value(5)
hslider bounds(0, 60, 200, 30), channel(“hslider10”), range(0, 100, 63, 1, 0.001), colour(255, 255, 0, 255) value(63)
hslider bounds(0, 90, 200, 30), channel(“hslider11”), range(0, 100, 25, 1, 0.001), colour(255, 255, 0, 255) value(25)
hslider bounds(0, 120, 200, 30), channel(“hslider12”), range(0, 100, 96, 1, 0.001), colour(255, 255, 0, 255) value(96)
}

-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 1

kEnv madsr .1, .2, .6, .4
aOut vco2 p5, p4
outs aOutkEnv, aOutkEnv

gkAAtt chnget “AAtt”
gkADec chnget “ADec”
gkASus chnget “ASus”
gkARel chnget “ARel”

gkbut1 chnget “but1”
gkbut2 chnget “but2”
gkbut3 chnget “but3”

if changed(gkbut1) == 1 then
 ;if gkbut1==1 then
 chnset "visible(1)", "sliders1"
 chnset "visible(0)", "sliders2"
 chnset "visible(0)", "sliders3"
endif



if changed(gkbut2) == 1 then
 ;if gkbut2==1 then
 chnset "visible(1)", "sliders2"
 chnset "visible(0)", "sliders1"
 chnset "visible(0)", "sliders3"
endif



if changed(gkbut3) == 1 then
 ;if gkbut3==1 then
 chnset "visible(1)", "sliders3"
 chnset "visible(0)", "sliders1"
 chnset "visible(0)", "sliders2"
endif

endin

;causes Csound to run for about 7000 years... f0 z

f1 0 2048 10 1
i1 0 1000

`
1 Like

PAGES.rar (348.0 KB)

I didn’t get a chance to look at this yet, but it sounds like you should put all the GUI stuff into an instrument with a number higher than 16 so it doesn’t get triggered with incoming midi messages? I’ll take a look at it later when I get a chance.

Thank you :slight_smile:

Yeah, that’s the issue. If you put all that chnset and chnget stuff into another instrument with a high number and start it to run forever with

<CsScore>
iN 0 z

where N is the instrument number it will work fine.

It works fine, thank you! :slight_smile:

1 Like