Skip to content
Cabbage
Install

Widgets

TextEditor

textEditor creates a multi-line text area inside the instrument. The initial text is set with the label.text property.

"active": true

Will deactivate a control if false is set (use 0/1 to update from Csound). Controls which are deactivated can still be updated from Csound. Any widget that has its active property set to false will allow all mouse-clicks to pass through it.

"bounds": {"left":0, "top":0, "width":100, "height":100}

Integer values that set position and size on screen(in pixels).

"id": "widgetId"

This optional channel can be used to define a top-level line of communication between the instrument’s UI and Csound. It is reserved for UI updates only. If omitted, it defaults to the first id from the channels array. Its primary purpose is to help produce clearer code, especially for widgets with multiple channels.

"label": {
"text": "",
"offsetY": 0,
"offsetX": 0,
"align": "center"
}

Configures the widget label displayed near the control.

  • text: the label text.
  • offsetY: vertical offset applied when the label is rendered outside the control (pixels).
  • offsetX: horizontal offset applied when the label is rendered outside the control (pixels).
  • align: label alignment for widgets that support it, such as groupBox, rotarySlider and numberSlider. numberSlider also accepts left and right to place the label beside the value.

For the slider widgets with a nested style.label object (horizontalSlider, verticalSlider, rotarySlider and numberSlider), typography is set under style.label.*. Other widgets use style.fontFamily, style.fontSize, style.fontColor and style.textAlign.

"persistence": {
"preset": true,
"session": true
}

Controls whether a widget's state is saved in DAW presets and Csound session files. Both properties default to true.

  • preset: When true, the widget's current value/state is included when using Csound's cabbageSaveState opcode to save preset data. Set to false for widgets that should not persist in Csound preset files (e.g., widgets that load presets).
  • session: When true, the widget's state is included when the DAW saves a preset. Set to false for widgets that should not have their values loaded/saved when a DAW session loads (e.g., widgets that load presets).

Auto-cascade behavior: If you set preset to false without explicitly setting session, the system automatically sets session to false as well. This prevents state from being saved anywhere unless explicitly requested.

"visible": true

A value of true shows the widget; set it to false to hide it (use 0/1 to update from Csound). Widgets are visible by default.

"zIndex": 0

Sets the stacking order of the widget. Widgets with higher zIndex values will appear in front of widgets with lower values. Default is 0.

"style": {
"opacity": 1,
"borderRadius": 4,
"backgroundColor": "#0295cf",
"fontFamily": "Verdana",
"fontSize": 14,
"fontColor": "#222222",
"textAlign": "left"
},
  • Colors accept named CSS colors, hex (e.g., #RRGGBB or #RRGGBBAA), or rgb/rgba strings.
  • fontSize is set in pixels. The special value "auto" scales the text from the widget height.
  • textAlign accepts left, center, or right.
{
"type": "textEditor",
"bounds": { "left": 10, "top": 10, "width": 400, "height": 240 },
"label": { "text": "Initial text shown in the editor" }
}