gamepad

gamepad · utility · schema v1

Connected USB / Bluetooth game controller as CV (stick axes + triggers) and gate (face / bumper / dpad / menu buttons). Reads navigator.getGamepads() at requestAnimationFrame rate. Browser security requires the user to press a button on the gamepad once before the browser exposes it. Outputs: lx / ly / rx / ry (cv ±1, Y inverted so +1 = up, 0.08 deadzone), lt / rt (cv 0..1), lb / rb / a / b / x / y / du / dd / dl / dr / start / back (gate). Standard mapping = Xbox layout; PlayStation + generic HID controllers that report 'standard' mapping also work. Slot param picks which of up to 4 simultaneous controllers to read. LEFT-STICK CALIBRATION: "calibrate left stick" arms a calibration mode — sweep the stick through its full range several times (the card records the observed per-axis min/max live), then "complete calibration" locks the swept range in so observed-min→full-min and observed-max→full-max per axis, with the calibrated centre mapped to 0 and a radial deadzone around it (no snap-back drift). Calibration is persisted once to the patch (rides collab + undo) and applied to lx / ly; "clear" reverts to the fixed-deadzone path. This makes worn pads and non-Xbox-layout sticks (e.g. VKB Gladiator NXT flight sticks, which report a non-standard mapping with a reduced raw range) reach the full ±1 output range.

A connected USB or Bluetooth game controller turned into a bank of CV and gate signals — eighteen outputs covering the full standard Xbox-style layout (two analog sticks, two triggers, the bumpers, the four face buttons, the D-pad, and Start/Back). The card polls the controller at ~60 Hz and pushes each axis and button into its own output, so you play the rack with a gamepad: stick axes sweep filters or pan a scene, triggers ride a VCA, face buttons fire drum strikes or scene changes. Sticks come out bipolar (±1) with a small deadzone so a worn stick's rest-drift reads 0, the Y axis flipped so 'up' is +1; triggers are unipolar 0..1; every button is a 0/1 gate. The left stick can be CALIBRATED on the card (sweep it to capture its true range + rest center) for a precise, drift-free mapping. Browser security only reveals a controller after you press a button on it, so the card shows a 'press any button' prompt until a pad appears. These outputs also drive video modules through the cross-domain CV/gate bridge.

the faceplate

gamepadlxcvlycvrxcvrycvltcvrtcvlbgaterbgateagatebgatexgateygatedugateddgatedlgatedrgatestartgatebackgateaudiocvgatepitch
0 inputs · 18 outputs · 1 params

outputs

idcablewhat it does
lxcvLeft stick X as bipolar CV, −1 (left) through 0 (center) to +1 (right), after a small deadzone and re-normalization (and the left-stick calibration if you've run it).
control voltage (CV)
lycvLeft stick Y as bipolar CV, −1 (down) through 0 to +1 (up) — the axis is flipped so pushing up reads positive — with the same deadzone/calibration treatment as LX.
control voltage (CV)
rxcvRight stick X as bipolar CV, −1 (left) to +1 (right), with the stick deadzone applied.
control voltage (CV)
rycvRight stick Y as bipolar CV, −1 (down) to +1 (up), Y flipped, with the stick deadzone applied.
control voltage (CV)
ltcvLeft trigger as unipolar CV, 0 fully released to +1 fully pressed — its analog travel, useful as a swell or VCA ride.
control voltage (CV)
rtcvRight trigger as unipolar CV, 0 released to +1 pressed.
control voltage (CV)
lbgateLeft bumper as a gate: 1 while the button is held, 0 when released.
gate / trigger
rbgateRight bumper as a gate: 1 while held, 0 when released.
gate / trigger
agateThe A face button as a gate: 1 while held, 0 when released — patch it into a strike or scene trigger.
gate / trigger
bgateThe B face button as a gate: 1 while held, 0 when released.
gate / trigger
xgateThe X face button as a gate: 1 while held, 0 when released.
gate / trigger
ygateThe Y face button as a gate: 1 while held, 0 when released.
gate / trigger
dugateD-pad up as a gate: 1 while held, 0 when released.
gate / trigger
ddgateD-pad down as a gate: 1 while held, 0 when released.
gate / trigger
dlgateD-pad left as a gate: 1 while held, 0 when released.
gate / trigger
drgateD-pad right as a gate: 1 while held, 0 when released.
gate / trigger
startgateThe Start button as a gate: 1 while held, 0 when released.
gate / trigger
backgateThe Back / Select button as a gate: 1 while held, 0 when released.
gate / trigger

params

idlabelrangedefaultcurve
padIndexSlot0..30discrete

controls

controlwhat it does
SlotWhich controller slot to read, 0 to 3 (the Web Gamepad spec allows up to four pads at once). 0 is the first connected controller; raise it to read a second or third pad in a multi-controller setup.

source

gamepad.ts on GitHub.

Generated from packages/web/src/lib/{audio,video}/module-registry.ts · repo