New musical #Python package in the house! Today it's pypi.org/project/music-creatin… ported from the c code, that is a companion to the book, abrazol.com/books/rhythm1/ "Creating Rhythms" by Stefan and Richard Hollos.
With it, you can do a bunch of combinatorial things to make rhythmic patterns, like the `euclid(m, n)` method, for instance.
Woo! 😁
Gene Boggs
in reply to Gene Boggs • • •```python
from music_creatingrhythms import Rhythms
from music_drummer import Drummer
r = Rhythms()
beats = 16
kick = ''.join([str(n) for n in r.euclid(2, beats)])
snare = ''.join([str(n) for n in r.rotate_n(4, r.euclid(2, beats))])
hihat = ''.join([str(n) for n in r.euclid(11, beats)])
d = Drummer()
d.set_bpm(100)
d.set_ts()
for _ in range(8):
d.pattern(patterns={ 'kick': kick, 'snare': snare, 'hihat': hihat })
d.sync_parts()
d.show(format='midi')
```
#Python #MIDI Euclidean #drums