Skip to main content
torq.py is a multi-domain strongly timed library. Audio/synth, MIDI/DMX cues, deterministic sim ticks, and lab protocols share the same rational Time / Dur timeline. now advances only when shreds yield a duration (or you advance / run / SimClock.step / frame). Logical waits never call wall-clock sleep.

Install

Pure-Python timing out of the box; optional native wheels for audio.

Quickstart

Four-hit metronome and a meow on the same clock.

API reference

Types, clock, shreds, Shared, operators, and every domain.

Domains

How audio, MIDI/DMX, sim, and lab share one timeline.

Mental model

  • One logical now (Time) across domains.
  • Concurrent shreds are ordinary Python generators or async def driven by torq.py — not asyncio.run.
  • Cross-domain coordination uses a thin Shared value/event bus and shared patching operators (>>, @, .to, .send).
  • Prefer shred ergonomics (join, cancel / unspork, ShredGroup) over a second process API.
Status: research / alpha. APIs may evolve. The next planned PyPI cut is 0.4.0 — not published from this docs work.