trig:<object> — cues fired by a moving object

Any cue that can be fired by the playhead can instead be fired by another object passing over it: give the cue trig:<uid> naming the object. The object becomes a playhead of its own — a trans() or o2p() mover, a drag()-able shape, a controlXY point — and nothing has to be declared on it; it is found by its uid.

trans(uid:readPH, to:[w1e, w2s, w2e], dur:[6, 0.15, 6], trig:auto)   ← the "playhead"
synth(uid:n1, wave:sine, freq:m67, dur:0.3, trig:readPH)             ← fired when readPH crosses it
audio(file:hit.flac, trig:readPH)
rotate(uid:r1, dur:1, trig:hand)                                     ← fired by drag(uid:hand, …)
notation(…, trig:readPH)                                             ← notes play one by one

How it fires

Where it is useful

Page mode has no transport playhead, so page cues are otherwise limited to trig:auto and clicks. A trans() line following the staves of a notation page, with trig:<uid> targets on the notes, turns the page into a playable score — see the demo-score-follow project: the reading line readPH on the Bach page fires a small synth on every note it crosses.

Scroll mode gains a second, free-roaming playhead: an o2p() object circling a path can fire cues on each lap while the transport playhead does its own work. A cue has one trig:, so nothing fires twice.

Demo project

demo-trig-object walks through the four shapes of it on one scrolling score: an o2p disc circling a path fires colour, rotation, scale and a synth every lap (A); a trans bar in mode:alternate plays five notes forwards and, because they re-arm on leave, again on the way back (B); a drag() disc you move by hand fires whatever you cross, with one target on once:1 (C); and a notation() stave is played note by note by a reading line (D). Rehearsal marks A–D jump between the sections.

In the DSL editor

The trig selector has an object… entry that reveals a box for the uid; the cue serialises as trig:<uid>.

Notes

Tip: use ← → or ↑ ↓ to navigate the docs