Device and runtime functions
Use the verified runtime, slot, control-button, VM timing, polar output, Zen LED, and clamp device APIs.
Overview
Device functions expose VM timing, slot control, the configured device control button, high-resolution polar output, and Zen hardware LED controls.
The official function table marks set_polar, set_rgb, set_hsb, and clamp as Zen-only. Verify exact ranges and signatures on that table.
Key facts
- get_rtime returns elapsed milliseconds between main iterations.
- get_slot, load_slot, get_ctrlbutton, and vm_tctrl are listed for Zen and Plus.
- set_polar, set_rgb, set_hsb, and clamp are Zen-only.
GPC syntax examples
Examples are intentionally small. Replace identifiers only with values documented for your target.
int elapsed;
main {
elapsed = get_rtime();
}Functions, commands, and terms
Names below are catalog entries, not guessed signatures. Open the official sources for current parameter and return-value details.
get_rtimefunction · Zen and PlusReturns elapsed time between main iterations in milliseconds.
get_slotfunction · Zen and PlusReturns the active slot number.
load_slotfunction · Zen and PlusLoads a specified slot.
vm_tctrlfunction · Zen and PlusAdjusts VM timing for the next main iteration.
set_polarfunction · Zen onlySets high-resolution stick output using angle and radius.
set_rgbfunction · Zen onlySets the Cronus Zen device LED with RGB values.
set_hsbfunction · Zen onlySets the Cronus Zen device LED with HSB values.
clampfunction · Zen onlyClamps a preferred value between minimum and maximum bounds.
Common mistakes
Treating get_rtime as wall-clock time.
Changing VM timing without understanding stability implications.
Compiling a Zen-only device helper for Plus.
Official GPC sources
Use these first-party references to confirm exact syntax and runtime behavior for your installed firmware and Studio version.
Related GPC references
Know what runs once, what loops, and why blocking or one-time work belongs in the correct execution block.
ToolingCompiler errors and GPC debuggingDiagnose placement, identifier, type-range, combo-timing, and target-version problems systematically in Zen Studio.
Device APIsKeyboard and mouse functionsRead supported keyboard and mouse state and write translated output using current Zen identifiers and routing rules.