modtris
modtris · games · schema v1Interactive Tetris-clone game module (single-user research prototype). Five gate inputs (rotate_l / rotate_r / drop_fast / move_l / move_r) are rising-edge triggered to play the game; two gate outputs fire one 5 ms pulse per event — line_cleared (a Tetris emits four separate staggered pulses, one per line) and overfill (game over). Game logic runs at visual cadence on the main thread (no audio worklet), with a deterministic, tested state stepper. Patch a sequencer or controller into the inputs and route the cleared-line / overfill gates as triggers, turning gameplay into a modulation source. See docs/design/game-modules.md.
the faceplate
5 inputs · 2 outputs · 2 params
inputs
| id | cable | what it does |
|---|---|---|
rotate_l | gate | Rotate the current piece counter-clockwise on each rising edge — one quarter-turn per pulse (acts on the leading edge only, so a held gate rotates once). gate / trigger |
rotate_r | gate | Rotate the current piece clockwise on each rising edge — one quarter-turn per pulse. gate / trigger |
drop_fast | gate | Hard/fast-drop the current piece on each rising edge — slams it down a step (or to the bottom) per pulse, locking it sooner. gate / trigger |
move_l | gate | Move the current piece one column LEFT on each rising edge — one cell per pulse. gate / trigger |
move_r | gate | Move the current piece one column RIGHT on each rising edge — one cell per pulse. gate / trigger |
outputs
| id | cable | what it does |
|---|---|---|
line_cleared | gate | Fires a 5 ms pulse for each line cleared — a single clear is one pulse, a Tetris (four lines at once) emits FOUR distinct staggered pulses so a downstream counter or envelope sees each line. Patch into a drum/envelope trigger to sonify clears. gate / trigger |
overfill | gate | Fires a single 5 ms pulse when the well overfills (a piece locks above the top = game over). Use it as an end-of-run trigger — fire a sound, reset a scene, or restart another module. gate / trigger |
params
| id | label | range | default | curve |
|---|---|---|---|---|
gravityBpm | Drop | 30..240 | 60 | log |
levelStep | Lvl | 1..20 | 10 | linear |
controls
| control | what it does |
|---|---|
| Drop | DROP gravity tempo in BPM (30..240, log, default 60) — how fast pieces fall on their own. Higher = faster, more frantic stacking (and a denser stream of LINE/OVERFILL pulses). |
| Lvl | LVL threshold (1..20, default 10) — how many cleared lines it takes to advance a level and ramp the difficulty (gravity speeds up each level). Lower = a steeper difficulty curve. |
source
modtris.ts on GitHub.