cabbageGet
Gets the widget identifier value, for example the current colour, size, position, etc. You can add an optional trigger output argument. This will send a trigger signal of 1 whenever the value has changed.
Syntax
iIdent cabbageGet SChannel, SIdentifier
kIdent cabbageGet SChannel, SIdentifier
SIdent cabbageGet SChannel, SIdentifier
kIdent [, kTrig] cabbageGet SChannel, SIdentifier
SIdent [, kTrig] cabbageGet SChannel, SIdentifier
iIdent[] cabbageGet SChannel, SIdentifier
kIdent[] cabbageGet SChannel, SIdentifier
SIdent[] cabbageGet SChannel, SIdentifier
kIdent[] [, kTrig] cabbageGet SChannel, SIdentifier
SIdent[] [, kTrig] cabbageGet SChannel, SIdentifier
kIdent cabbageGet SChannel
SIdent cabbageGet SChannel
kIdent [, kTrig] cabbageGet SChannel
SIdent [, kTrig] cabbageGet SChannel
The versions of cabbageGet that only take a single channel string are typically used to query reserved channels.
Initialization
SChannel
-- widget's channel nameSIdentifier
-- widget's identifier you wish to query. This should be passed without any parenthesis.
Performance
kIdent/iIdent
-- the value of a widget's numeric identifier, i.e,visible()
,velocity()
,corners()
etc.kIdent[]/iIdent[]
-- an array that holds the value of a widget's numeric identifier in case where more that one parameter is passed, , i.e,bounds()
,range()
,colour()
etc.SIdent
-- the value of a widget's string identifier, i.e,shape()
,text()
,channel()
etc.SIdent[]
-- an array that holds the value of a widget's string identifier in case where more that one parameter is passed, , i.e,text()
in buttons,channel()
for xypads, range sliders, etc.kTrig
-- an optional trigger output. Will be 1 for a single k-cycle whenever the widget value has changed. Otherwise it will remain 0.
Example
<Cabbage>
form caption("Test") size(350, 200), colour(58, 110, 182), guiMode("queue"), pluginId("sfi1")
rslider bounds(20, 8, 60, 60) range(0, 1, 0, 1, 0.001), colour(255, 0, 0), channel("gain"), text("Gain")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
instr 1
kColour[] cabbageGet "gain", "colour"
printarray kColour, metro(1)
endin
</CsInstruments>
<CsScore>
i1 0 z
</CsScore>
</CsoundSynthesizer>
Added in Cabbage v2.5.44