MuPaH/mupah/__init__.py

23 lines
447 B
Python
Raw Permalink Normal View History

from mupah.euclidean import euclidean_rythm
def eighths_scale(p, scale):
hits = len(str(p.pid))
if hits < 8:
length = 8
elif hits >= 8 and hits < 16:
length = 16
rythm = euclidean_rythm(k=hits, n=length)
for i in list(str(p.pid)):
rythm = rythm.replace('X', i, 1)
phrase = [0 if i == '.'
else scale[int(i) % 8]
for i in list(rythm)]
return phrase