chrislo / brain

Use a Raspberry Pi to control my "studio"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate euclidean rhythms

chrislo opened this issue · comments

It'd be interesting to have a euclidean rhythm sequencer. I think we could add that to the existing step sequencer, or have it as an additional "mode", where three knobs were mapped to three euclidean rhythm parameters for each note (drum sound in a drum sequencer):

  • Number of 16th notes in the pattern (1-16)
  • density of the fill
  • "rotation" of the pattern

Introducing some randomness (eg occasionally shifting the rotation)
would generate some interesting variation.

I've now implemented a euclidean sequencing mode accessed by pressing . Knobs 1-3 control the onsets, pulses and rotation of the sequence for the currently active note. The note can be changed with and . sequencer/src/euclidean_sequencer.rs has the bulk of the code for calculating the sequences.