Expand description
Euclidean rhythm generator (Bjorklund-style) + step-grid helpers.
Distributes hits events as evenly as possible across steps and
rotates by rotation. Encodes the result as a u32 bitmask where
bit i is 1 if step i is an active hit. 16-step resolution (4 per
beat, 4 beats per bar) is plenty for drum machines.
Constants§
Functions§
- euclidean_
bits - Packed 16-step pattern as a u32 bitmask. Bit 0 = step 0.
- step_
is_ active - Check if the pattern has a hit at
(t * bpm / 60 * 4) mod 16. - step_
position - Returns (global_step_index, phase_within_step) given time in seconds.