Skip to content

Instantly share code, notes, and snippets.

View hecanjog's full-sized avatar

hecanjog hecanjog

View GitHub Profile
from pippi import dsp
def spray(snd, bar, numlayers):
# Transpose original sound up an octave
snd = dsp.transpose(snd, 2)
# Choose a set of time offsets in the source sample
offsets = [ dsp.randint(0, dsp.flen(snd) - dsp.stf(1)) for i in range(numlayers) ]
# Possible divisions of a 'bar'