Skip to content

Euclidean & probability rhythms per part #6

Description

@philoking

Summary

Per-part Euclidean and trigger-probability rhythm options: distribute K hits across N steps as evenly as possible, and/or give each step a chance of firing. Applied as a rhythmic mask over whatever the part already generates.

Why it fits

"K of N" Euclidean patterns and per-step probability are the most modular-native rhythm tools there are, and they pair perfectly with per-part clock divide — a 3-of-8 arp at 1/8 against a 5-of-16 bass at 1/16 is instant generative interplay. It's also a tiny, well-bounded addition that adds a lot of life.

Proposed scope

Rhythm mask (js/generator.js)

  • Per part: euclid: { k, n } (off when unset) producing a boolean trigger mask via the standard Bjorklund/Bresenham distribution, with a rotation offset.
  • Per part: triggerProb (0–1) — each otherwise-active step fires with this probability, using the seeded PRNG so it's reproducible.
  • The mask gates the part's existing note stream: a masked-out step is a rest, and the note pool advances using the same rest semantics as the step editor, so the two features agree.

UI (js/app.js)

  • In each part's ⚙: K, N, rotation, and a probability knob. Show the resulting pattern as a small dotted readout.
  • Persist in state.

Where

js/generator.js (mask generation + application), js/app.js (controls + state).

Done when

  • Each part can take a K-of-N Euclidean mask with rotation.
  • Per-step trigger probability works and is seed-deterministic.
  • Masks compose cleanly with per-part clock divide.
  • Settings persist in presets / JSON.

Open questions

  • Should the Euclidean mask count in the part's own divided steps, or absolute 16ths?
  • Default to off for all parts so existing songs are unchanged?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions