If you're interested in this, there's a good chance you would enjoy the TidalCycles language for generating music. It's been a mind-expanding experience for me, particularly w/r/t polyrhythms. The landing page: https://tidalcycles.org/ An example of some music made live with it: https://www.youtube.com/watch?v=mlUOWjC5fpY
Strudel REPL: https://strudel.tidalcycles.org/
One interesting feature of Tidalcycles is Euclidean Sequences, where various 'natural' ways of distributing X notes over Y durations are easily expressed: [1] https://tidalcycles.org/docs/reference/mini_notation/#euclid... [2] https://strudel.tidalcycles.org/learn/mini-notation#euclidia...