> ## Documentation Index
> Fetch the complete documentation index at: https://torqpy.itsdote.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Domain operators

> Shared patching: >>, @ / .on, .to, .send, and sim % tick grids.

Cross-domain Python-valid shortcuts. One global meaning each. Existing `with` / `while` / `yield ~d` / `await (~d)` / unary `+` stay unchanged.

```python theme={null}
from torq import (
    Clock, SimClock, Node, Bound, Flow, TickGrid, Quantized,
    second, tick, is_bind_target, as_bind_target, is_tick_grid, as_tick_grid,
)
```

## Shared forms

| Form | Meaning |
| - | - |
| `a >> b` | Stream / signal / event flow (left-associative) |
| `x @ c` / `x.on(c)` | Bind `x` to clock or engine `c` → `Bound` |
| `x.to(y)` | Explicit one-hop handoff |
| `x.send(y, z, …)` | Explicit fan-out (requires ≥1 target; returns source) |
| `x % tick(n)` / `x % sim.grid(n)` | Sim grid quantize → `Quantized` (RHS must be `TickGrid`) |

## Types

| Symbol | Meaning |
| - | - |
| `Flow` | Base class; subclasses implement `.to` |
| `Node(name="")` | Lightweight patch node that records `.outs` |
| `Bound` | Result of `@` / `.on`; delegates handoff / `*` gain / `%`; proxies attrs |
| `TickGrid` / `tick(n)` / `SimClock.grid(n)` | Every-`n`-tick grid (positive int; `bool` rejected) |
| `Quantized` | Result of `%`; `.due(sim)` / `.snap_tick` / `.snap_time` / `.fire` |
| `is_bind_target` / `as_bind_target` | Clock/engine checks |
| `is_tick_grid` / `as_tick_grid` | Grid checks |

Bind targets: `Clock` / `SimClock` / `NativeClock`, `AudioEngine`, and `LabEngine`.

Style: bind first, then route / quantize. Parenthesize mixes (`(x @ c) >> y`, `(x @ sim) % tick(4)`).

## Example

```python theme={null}
from torq import Clock, Node, SimClock, second, tick

clock = Clock()
kick = Node("kick")
midi = Node("midi")
lab = Node("lab")

bound = kick @ clock                 # same as kick.on(clock)
bound.send(midi, lab)                # fan-out; kick.outs == (midi, lab)
(kick @ clock).to(midi)              # one-hop; returns the target

sim = SimClock(second / 60)
pose = Node("bot.pose")
(pose.on(sim) >> Node("synth.cutoff"))  # sim bind + flow
impulse = Node("collision") % tick(4)   # or % sim.grid(4)
# impulse.due(sim) after step when tick in {4, 8, 12, …}
```

## Domain extras (not general)

| Domain | Extra | Notes |
| - | - | - |
| Audio | `node * g` → `Gain`; `dac << src` | AudioNode × number; `AudioSink` only for `<<` |
| MIDI/DMX | `cue \| ch(n)` / `cue \| u(n)` | Lane tags only — not general handoff |
| Lab | `.probe()` / `.mark(...)` | No `%` for sample windows |
| Sim | `% tick(n)` | Not for lab windows |

Plain `int` / `Dur` on the right of `%` raises `TypeError`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.