Skip to content
Cabbage
Install

Using Cabbage 3

Reserved Csound Channels

Cabbage 3 will initialise a set of named Csound channels when it first loads. Some provide system-specific directory paths, while others convey environmental or system information, such as window dimensions or plugin status. These channels provide a cross-platform way to access common system directories or runtime data without hardcoding values. Cabbage 3 works with absolute file paths, so be sure to derive all file paths from known locations where appropriate.

The directory path where the current CSD file is located. Useful for loading resources relative to your CSD file location.

Returns 1 if the instrument is running inside a DAW, otherwise returns 0.

Returns 1 if the instrument has support for ARA.

The user’s home directory. On Windows, this is typically C:\Users\<username>. On macOS and Linux, this is /Users/<username> or /home/<username> respectively.

The user’s Documents folder. On Windows, this is C:\Users\<username>\Documents. On macOS, this is /Users/<username>/Documents. On Linux, this defaults to the home directory since Linux doesn’t have a standard Documents folder.

The user’s Desktop folder. On Windows, this is C:\Users\<username>\Desktop. On macOS, this is /Users/<username>/Desktop. On Linux, this is /home/<username>/Desktop.

The user’s Music folder. On Windows, this is C:\Users\<username>\Music. On macOS, this is /Users/<username>/Music. On Linux, this is /home/<username>/Music.

The user’s Movies/Videos folder. On Windows, this is C:\Users\<username>\Videos. On macOS, this is /Users/<username>/Movies. On Linux, this is /home/<username>/Videos.

The user’s Pictures folder. On Windows, this is C:\Users\<username>\Pictures. On macOS, this is /Users/<username>/Pictures. On Linux, this is /home/<username>/Pictures.

The user’s application data directory for storing application-specific data. On Windows, this is C:\Users\<username>\AppData\Local. On macOS, this is /Users/<username>/Library/Application Support. On Linux, this is /home/<username>/.config.

The system-wide application data directory for shared application data. On Windows, this is C:\ProgramData. On macOS, this is /Library/Application Support. On Linux, this is /opt.

The system-wide shared documents directory. On Windows, this is C:\Users\Public\Documents. On macOS, this is /Users/Shared. On Linux, this is /usr/share.

The Windows system directory. On Windows, this is C:\Windows\System32. Not applicable on macOS and Linux (returns empty string).

The system-wide applications directory. On Windows, this is C:\Program Files. On macOS, this is /Applications. On Linux, this is /usr.

The width in pixels of the current Cabbage UI window. This reflects the window size available to the UI and can be used to scale or position widgets.

The height in pixels of the current Cabbage UI window. Use together with WINDOW_WIDTH to determine available drawing area.

instr 1
home:S = chnget("USER_HOME_DIRECTORY")
desktop:S = chnget("USER_DESKTOP_DIRECTORY")
prints("Home: %s\n", home)
prints("Desktop: %s\n", desktop)
endin
  • All paths use forward slashes (/) as directory separators, even on Windows
  • Empty strings are returned for channels that don’t apply to the current platform. For example WINDOWS_SYSTEM_DIRECTORY will return an empty string on macOS/Linux.
  • These channels should be treated as read-only and are automatically set by Cabbage at startup
  • The actual paths may vary depending on system configuration and user settings