Device APIsUpdated 2026-07-24

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.

Read current VM timingexample.gpc
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.

NameKindPurpose
get_rtimefunction · Zen and Plus

Returns elapsed time between main iterations in milliseconds.

get_slotfunction · Zen and Plus

Returns the active slot number.

load_slotfunction · Zen and Plus

Loads a specified slot.

get_ctrlbuttonfunction · Zen and Plus

Returns the configured device control-button identifier.

vm_tctrlfunction · Zen and Plus

Adjusts VM timing for the next main iteration.

set_polarfunction · Zen only

Sets high-resolution stick output using angle and radius.

set_rgbfunction · Zen only

Sets the Cronus Zen device LED with RGB values.

set_hsbfunction · Zen only

Sets the Cronus Zen device LED with HSB values.

clampfunction · Zen only

Clamps 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