Widgets
TextEditor
textEditor creates a multi-line text area inside the instrument. The initial text is set with the label.text property.
Properties
Section titled “Properties”Active
Section titled “Active”"active": trueWill 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
Section titled “Bounds”"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 asgroupBox,rotarySliderandnumberSlider.numberSlideralso acceptsleftandrightto 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
Section titled “Persistence”"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: Whentrue, the widget's current value/state is included when using Csound'scabbageSaveStateopcode to save preset data. Set tofalsefor widgets that should not persist in Csound preset files (e.g., widgets that load presets).session: Whentrue, the widget's state is included when the DAW saves a preset. Set tofalsefor 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
Section titled “Visible”"visible": trueA 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
Section titled “ZIndex”"zIndex": 0Sets 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.
fontSizeis set in pixels. The special value"auto"scales the text from the widget height.textAlignacceptsleft,center, orright.
Example
Section titled “Example”{ "type": "textEditor", "bounds": { "left": 10, "top": 10, "width": 400, "height": 240 }, "label": { "text": "Initial text shown in the editor" }}