Permalink
Browse files

First pass graincloud refactor, soundpipe build issue fixes, etc

  • Loading branch information...
hecanjog committed Oct 20, 2018
1 parent 193ff41 commit 05d1ee4a2e8913ad6cc03d4fd3d23d38f5c6cea8
@@ -63,18 +63,16 @@ def make_note(freq, amp, length):
d = random.triangular(0.1, 20)
s = random.triangular(0.01, 0.1)
r = random.triangular(5, 10)
minlength = (note.dur/50)*1000
maxlength = (note.dur/3)*1000
arp = note.cloud(length * random.triangular(1.5, 3),
win=dsp.HANN,
minlength=(note.dur/50)*1000,
maxlength=(note.dur/3)*1000,
grainlength_lfo=wavetables.randline(random.randint(10, 100)),
mindensity=0.1,
maxdensity=random.triangular(0.25, 0.75),
window=dsp.HANN,
grainlength=wavetables.randline(random.randint(10, 100), lowvalue=minlength, highvalue=maxlength),
spread=1,
speed=random.choice([1, 1.5, 2]),
jitter=random.triangular(0, 0.05),
density_lfo=wavetables.randline(random.randint(5, 50)),
grid=wavetables.randline(random.randint(5, 50), lowvalue=0.1, highvalue=random.triangular(0.25, 0.75)),
).adsr(a,d,s,r)
note.dub(arp, 0)
@@ -7,33 +7,28 @@
print(__file__)
start_time = time.time()
snd = dsp.read('%s/sounds/linus.wav' % PATH)
def makecloud():
snd = dsp.read('%s/sounds/linus.wav' % PATH)
grainlength = wavetables.randline(random.randint(50, 500), lowvalue=0.001, highvalue=random.triangular(0.02, 0.1))
grid = grainlength * 0.5
speed = wavetables.randline(random.randint(10, 100), lowvalue=0.25, highvalue=random.triangular(0.25, 10))
amp = wavetables.randline(random.randint(10, 500), lowvalue=0.125, highvalue=random.triangular(0.5, 1))
def makecloud(density):
print('cloud density', density)
return grains.GrainCloud(snd * 0.125,
win=dsp.HANN,
read_lfo=dsp.PHASOR,
speed_lfo=wavetables.randline(random.randint(10, 1000)),
density_lfo=wavetables.randline(random.randint(10, 1000)),
grainlength_lfo=wavetables.randline(random.randint(10, 500)),
minspeed=0.25,
maxspeed=random.triangular(0.25, 10),
density=density,
minlength=1,
maxlength=random.triangular(60, 100),
return grains.Cloud(snd,
window=dsp.HANN,
position=dsp.PHASOR,
speed=speed,
grid=grid,
amp=amp,
grainlength=grainlength,
spread=random.random(),
jitter=random.triangular(0, 0.1),
).play(30)
numclouds = 10
densities = [ (random.triangular(0.1, 2),) for _ in range(numclouds) ]
#clouds = dsp.pool(makecloud, numclouds, densities)
numclouds = 30
out = dsp.buffer(length=30)
#for cloud in clouds:
for i in range(numclouds):
cloud = makecloud(*densities[i])
cloud = makecloud()
out.dub(cloud, 0)
out.write('%s/swarmy_graincloud.wav' % PATH)
Oops, something went wrong.

0 comments on commit 05d1ee4

Please sign in to comment.