Form

Form creates the main application window. pluginid() is the only required identifier. The default values for size are 600x300.

form caption("string"), size(Width, Height), pluginid("plug"), guirefresh(val), import("file1", "file2", "etc.."), bundle("./folder1", "file2", "etc.."), typeface("fontFile"), colour("colour"),

Specific Identifiers

caption("string") The string passed to caption will be the string that appears on the main application window.

size(Width, Height) integer values denoted the width and height of the form.

pluginid("plug") this unique string must be four characters long. It is the ID given to your plugin when loaded by plugin hosts.

Every plugin must have a unique plugin ID. If you experience problems loading two different plugins, it could be because they use the same plugin ID. The plugin ID seems to be more relevant when working with OSX than on Linux or Windows.

guirefresh(val) Sets the rate at which Cabbage will update its GUI widgets when controlled by Csound. The value passed represents the number of k-rate cycles to be skipped before the next update. The larger this is the slower the GUI updates will take place, but the less CPU intensive the instrument will be. val should be an integer greater than 1 and is set to ksmps x 2 by default.

For best performance one should set guirefresh to be a factor of ksmps.

import("file1", "file2", "etc..") The import identifier will import the file/s specified. This can be useful when including files that contains macros definitions, or custom plant imports.

bundle("./folder1", "file2", "etc..") The bundle identifier will instruct Cabbage to copy the listed files and folders into the same folder your exported plugin goes. On OSX this will be the plugin bundle itself.

typeface("fontFile") Set a custom .ttf font to be used by all widgets. Be sure to use a relative path to the font file. And don't forget to incude the file if you share your instrument.

Common Identifiers

colour("colour") This sets the main colour. Any CSS or HTML colour string can be passed to this identifier. The colour identifier can also be passed an RBG, or RGBA value. All channel values must be between 0 and 255. For instance colour(0, 0, 255) will create a blue, while colour(0, 255, 0, 255) will create a green with an alpha channel set to full.

Example

<Cabbage>
form size(400, 500), caption("Form Example"), pluginID("plu1"), colour(39, 40, 34)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d 
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

;basic usage
instr 1 
endin

</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
;starts instrument 1 and runs it for a week
i1 0 z
</CsScore>
</CsoundSynthesizer>