modtris

modtris · games

Interactive 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.

A playable Tetris-style block-stacking game wrapped as a CV/gate module — the falling-block gameplay drives the patch. Pieces drop into a 10×20 well at a tempo you set (DROP); you steer and rotate them with five gate inputs, and the game emits gate pulses on the events it produces: every line cleared and an overfill (game over). So a sequencer or clock pattern playing the game becomes a generative trigger source whose rhythm follows the stacking — a four-line 'Tetris' fires four separate LINE pulses in quick succession. You DON'T touch a surface to play: you patch gates into MOVE L/R, ROT L/R and DROP, and the well accumulates every decision you have made, so the same input pattern produces a different output rate ten seconds later. The well + next-piece preview + line count render on a 2D canvas at the head of the module's dock faceplate, and there is no video output port — MODTRIS speaks in gates, and the well is how you read what it is saying. DROP sets the gravity tempo and LVL sets how many cleared lines it takes to speed it up.

the faceplate

modtrisrotate_lgaterotate_rgatedrop_fastgatemove_lgatemove_rgateline_clearedgateoverfillgateaudiocvgatepitch
5 inputs · 2 outputs · 2 params

inputs

idcablewhat it does
rotate_lgateRotate 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; trigger — fires once per rising edge
rotate_rgateRotate the current piece clockwise on each rising edge — one quarter-turn per pulse.
gate / trigger; trigger — fires once per rising edge
drop_fastgateHard/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; trigger — fires once per rising edge
move_lgateMove the current piece one column LEFT on each rising edge — one cell per pulse.
gate / trigger; trigger — fires once per rising edge
move_rgateMove the current piece one column RIGHT on each rising edge — one cell per pulse.
gate / trigger; trigger — fires once per rising edge

outputs

idcablewhat it does
line_clearedgateFires 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; trigger — fires once per rising edge
overfillgateFires 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; trigger — fires once per rising edge

params

idlabelrangedefaultcurve
gravityBpmDrop30..24060log
levelStepLvl1..2010linear

controls

controlwhat it does
DropDROP gravity tempo in BPM (30..240, log, default 60) — how fast pieces fall on their own before the LVL ramp is applied. Higher = faster, more frantic stacking (and a denser stream of LINE/OVERFILL pulses). It is read on every scheduler tick, so a move lands on the next drop rather than the next piece. MIDI-learnable.
LvlLVL threshold (1..20, default 10) — how many cleared lines it takes to advance a level. Each level multiplies the time between automatic drops by 0.85, so the game gets ~18% faster per level on top of whatever DROP is set to, down to a floor of 50 ms per row. Lower = a steeper difficulty curve: at LVL 1 every cleared line speeds the game up. It applies to the RUNNING game — the level is re-derived from the line count on every tick, so moving this fader mid-game re-prices the ramp immediately rather than at the next level-up — and an overfill resets the line count, and with it the level, to zero. MIDI-learnable.

source

modtris.ts on GitHub.

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