tur-tidal

A Tidal Cycles-inspired mini-notation parser and pattern library for Turmeric. tur-tidal parses the compact mini-notation used by Tidal Cycles into an in-memory pattern tree, evaluates that tree at any cycle number to produce a flat list of timed events, and renders the result as a plain-text event table, a raw sclang Pbind.new(...) expression, or a scscm pbind form for use with the tur-scscm spice.

Mini-notation reference

Syntax Meaning
bd sd cp Sequence: three equal-duration steps per cycle
[bd sd] cp Subsequence: bd and sd share the first half-cycle slot
<60 62 64> Alternating: one value per cycle, advancing each cycle
bd*2 Repeat: bd twice within its slot
bd/2 Slow: bd spans 2 cycles
bd(3,8) Euclidean rhythm: 3 pulses distributed across 8 steps
bd@2 Weight: bd takes twice as much time in a sequence
~ Rest: empty slot (no event produced)

Note names (c4, d#3, bb5) are resolved to MIDI numbers by note->midi. Raw integers (60, 72) pass through as MIDI directly. Drum names (bd, sd, cp) pass through as string values in events and are not converted to MIDI (their note->midi result is -1, so they are filtered out of render-sclang / render-pbind MIDI arrays).

Quick example

(let [r (parse-notation "c4 [d4 e4] f4")]
  (let [p (ok-val r)]
    (println (render-sclang p "piano"))
    (notation-free p)))

Output:

(Pbind.new([\instrument, "piano", \midinote, Pseq.new([60,62,64,65],inf), \dur, Pseq.new([0.250,0.125,0.125,0.250],inf)])).play;

Modules

tidal/event

Low-level event struct (onset, dur, value) and the note->midi parser.

tidal/notation

Mini-notation parser and evaluator.

tidal/pattern

Higher-level combinators that wrap an existing pattern handle.

tidal/render

Render a pattern to text.

Dependencies

Building

just build
just test

License

MIT