pong

pong · games

Interactive Pong game module (single-user research prototype). Two CV inputs (paddle_left / paddle_right) set each paddle's Y position; two gate outputs (score_left / score_right) fire one 5 ms pulse per scoring event, sample-accurate on the audio thread. The deterministic state stepper runs at visual cadence on the main thread (no audio worklet). Drive the paddles from LFOs / envelopes / joysticks and use the score gates as triggers — the game becomes a generative modulation source. Multiplayer is a planned additive follow-up (the design doc lays out the SyncedModuleDef path). See docs/design/game-modules.md.

A playable two-paddle Pong game wrapped as a CV/gate module — the rally drives the patch. A ball bounces between a left and right paddle; you position each paddle with a CV input (so an LFO, sequencer, envelope follower, or a JOYSTICK CV plays it — wire one side to a slow LFO for an auto-rally, or two players each on their own CV), and the game emits a gate pulse whenever a side scores (the ball gets past the opposite paddle). So Pong becomes a generative trigger source whose pulse timing depends on the back-and-forth. The court renders on the card's 2D canvas; since the module is vizPassthrough, that canvas can be portaled into a containing GROUP card for cross-domain video. SPEED scales the ball velocity, PADDLE sets paddle height, and SERVE sets how wide the serve angle varies.

the faceplate

pongpaddle_leftcvpaddle_rightcvscore_leftgatescore_rightgateaudiocvgatepitch
2 inputs · 2 outputs · 4 params

inputs

idcablewhat it does
paddle_leftcvBipolar CV (−1..+1) setting the LEFT paddle's vertical position — −1 = top, 0 = center, +1 = bottom. Read at scheduler-tick rate (it's a continuous position, not a gate). Drive it with an LFO for an auto-rally, a sequencer for stepped jumps, or a JOYSTICK/MIDI CV to play by hand.
control voltage (CV)
paddle_rightcvBipolar CV (−1..+1) setting the RIGHT paddle's vertical position (−1 top, 0 center, +1 bottom). The opponent's paddle — drive it the same way as the left.
control voltage (CV)

outputs

idcablewhat it does
score_leftgateFires a 5 ms pulse each time the LEFT side scores (the ball passes the RIGHT paddle). A trigger you can route to a sound, counter, or scene change to sonify the rally's outcome.
gate / trigger; trigger — fires once per rising edge
score_rightgateFires a 5 ms pulse each time the RIGHT side scores (the ball passes the LEFT paddle).
gate / trigger; trigger — fires once per rising edge

params

idlabelrangedefaultcurve
speedSpeed0.25..41log
paddleHPaddle0.05..0.50.2linear
serveAngleServe0..10.3linear
freezeFreeze0..10linear

controls

controlwhat it does
FreezeA determinism hold for visual regression capture, not a performance control — it is declared noUserControl, so no faceplate, Push encoder or group instrument bar offers it. At 0.5 and above the scheduler tick returns before stepping the game, so the ball, the paddles and the score all hold and the court repaints an identical frame; below 0.5 the game runs normally. Nothing in the product writes it except the VRT face-scene harness.
PaddlePaddle height as a fraction of the court (0.05..0.5, default 0.2) — taller paddles are easier to defend with (longer rallies, fewer scores); shorter paddles miss more often.
ServeServe-angle variance (0..1, default 0.3) — how much the launch angle randomly varies on each serve. 0 = nearly flat, predictable serves; 1 = wide, steep, unpredictable serves.
SpeedBall speed multiplier (0.25..4, log, default 1) — scales how fast the ball travels, so faster = quicker rallies and a denser stream of SCORE pulses.

source

pong.ts on GitHub.

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