Create phrase-locked cue engine
create_phrase_locked_cue_engineQueue incoming trigger pulses and fire them on the next phrase boundary derived from the global tempo. Supports configurable phrase length, active gate, and queue management for DJ/VJ cue locking.
Instructions
Build a DJ/VJ phrase-quantized cue-lock engine. Any incoming pulse CHOP (Button, MIDI In, OSC In, composeCueList trigger) is queued FIFO and fired on the next 1/2/4/8/16/32/64-bar phrase boundary derived from the global project tempo. Live controls: Active (on/off gate), PhraseLength (live retune), Flush (clear queue), QueueDepth (display). Mode 'next' fires on the first upcoming boundary; 'aligned' locks to the project-start phrase grid. Pairs with create_tempo_sync upstream and bind_to_channel / manage_cue downstream. Output is a 0/1 trigger Null CHOP at /out.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pending_chop_path | Yes | Path to a CHOP whose first channel is the 'pending cue' pulse. Every time it rises 0→1 a cue is enqueued; the gated trigger fires it on the next phrase boundary. Wire a Button COMP, OSC In CHOP, MIDI In CHOP, or composeCueList trigger into this channel. | |
| phrase_length_bars | No | Phrase length in bars. 16 is the DJ/VJ standard for builds/drops. Restricted to powers of 2 (1/2/4/8/16/32/64) — the canonical phrase grid; arbitrary values break the modulo lock. | |
| quantize_mode | No | 'next' (default): fire on the NEXT bar where (bar % phrase_length == 0), which is the upcoming phrase downbeat. 'aligned': only fire at a phrase downbeat that is also bar 1 of the bar-1-anchored phrase grid (bar % phrase_length == 0 AND bar >= phrase_length) — strict alignment from project start. For most live use, 'next' is what you want. | next |
| queue_capacity | No | Max queued pending cues. Extra pulses while at capacity are dropped (warning logged in storage). | |
| expose_controls | No | Expose live PhraseLength / Active / Flush / QueueDepth controls on the engine container. | |
| name | No | Engine container name. | phrase_lock |
| parent_path | No | Parent COMP. Self-contained engine container is created here. | /project1 |