RGB Sunglasses Animation Extension API fw-v3.8.1-1-geacf2f0
rgbx ABI + C++ wrapper for sandboxed .llext animations
Loading...
Searching...
No Matches
rgbx_inputs Struct Reference

Per-tick input snapshot. More...

#include <rgbx_api.h>

Data Fields

uint32_t dt_ms
 nominal ms since the previous tick
 
uint32_t params [RGBX_MAX_PARAMS]
 current scalar parameter values (UINT32/COLOR/BOOL), in manifest declaration order
 
char param_strings [RGBX_MAX_STRING_PARAMS][RGBX_PARAM_STRING_MAX]
 current string parameter values, always NUL-terminated; slot i = the i-th STRING-typed param in declaration order
 
float accel [3]
 IMU accelerometer x/y/z, m/s^2.
 
float gyro [3]
 IMU gyroscope x/y/z, rad/s.
 
float audio_band_energy [RGBX_AUDIO_NUM_BANDS]
 smoothed energy per coarse band, low frequencies first
 
uint8_t audio_beat [RGBX_AUDIO_NUM_BANDS]
 1 if a beat was detected in that band this frame, else 0
 
float audio_display_bucket [RGBX_AUDIO_NUM_DISPLAY_BUCKETS]
 fine-grained spectrum buckets for bar-graph visualisation, low frequencies first (62 Hz–3 kHz).
 
uint32_t buttons_pressed
 bit i set = button i was pressed since the previous tick.
 

Detailed Description

Per-tick input snapshot.

The host (kernel mode) fills this in before signalling a tick; the extension must treat it as read-only and must not assume values persist across ticks. Absent sources (no IMU, no audio, no buttons on the build) read as zeros.

String parameter values do NOT use params[]: the i-th STRING-typed parameter (counting only string params, in manifest declaration order) lives in param_strings[i]. params[i] is unspecified for string params.

Field Documentation

◆ audio_display_bucket

float rgbx_inputs::audio_display_bucket[RGBX_AUDIO_NUM_DISPLAY_BUCKETS]

fine-grained spectrum buckets for bar-graph visualisation, low frequencies first (62 Hz–3 kHz).

Each is the mean |X_k|^2 over the bucket's bins of an unscaled 512-pt Hann FFT of the ±1-normalised PCM — NOT normalised to 0..1: bass buckets reach ~1 on loud music while treble buckets sit near 1e-5, a ~60 dB tilt. Map through log10 (a dB window) before drawing bars; the built-in FFT Bars animation uses a 36 dB window ending at 0 dB (E = 1.0) plus a 3 dB/octave treble lift.

◆ buttons_pressed

uint32_t rgbx_inputs::buttons_pressed

bit i set = button i was pressed since the previous tick.

proto0 mapping: 0=Up, 1=Left, 2=Right, 3=Down, 4=Wake


The documentation for this struct was generated from the following file: