Skip to content

Instantly share code, notes, and snippets.

@hecanjog
Created August 2, 2014 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hecanjog/58def5e6363f371766fe to your computer and use it in GitHub Desktop.
Save hecanjog/58def5e6363f371766fe to your computer and use it in GitHub Desktop.
fold_usage.py
from pippi import dsp
freq = 330.0 # pitch
foldFreq = 0.1 # speed to read through the fold factor wavetable
length = dsp.stf(10) # converted from seconds to frames
waveform = dsp.wavetable('sine2pi', 512) # sinewave wavetable
factors = [ dsp.rand(1, 10) for f in range(6) ] # a random set of 6 mult factors between 1 and 10, will be interpolated
amp = 0.25 # amplitude scale factor
out = dsp.fold(freq, foldFreq, length, waveform, factors, amp)
dsp.write(out, 'fold_usage') # will write output to fold_usage.wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment