[sc-users] GrainBuf misbehavior

Ali Bilgin Arslan alibilginarslan at gmail.com
Wed Apr 23 12:36:24 PDT 2008


Hello,
I am new to SC and it is beginning to grow on me. So I was poking around
with my 2.4 Ghz Macbook Pro on Leopard and wanted to tweak some codes to get
familiarized with things.
I noticed that besides the well-known Leopard problems, I came across a
strange problem with the GrainBuf ugen.

Here is the code that I tweaked

(
var winenv;
b = Buffer.read(s, "sounds/a11wlk01-44_1.aiff");

// a custom envelope
winenv = Env([0, 1, 0], [0.5, 0.5], [8, -8]);
z = Buffer.sendCollection(s, winenv.discretize, 1);
SynthDef(\buf_grain_test, {arg gate = 1, amp = 1, sndbuf, envbuf;
var pan, clouder, density, env, freqdev;
// use mouse x to control panning

pan = MouseX.kr(-1, 1);
density=MouseY.kr(1,400);
clouder= Dust.kr(density);
env = EnvGen.kr( Env([0, 1, 0], [1, 1], \sin, 1), gate, levelScale: amp);
Out.ar(0,
GrainBuf.ar(2, clouder, SinOsc.kr(3).range(0,1), sndbuf,
LFNoise1.kr.range(0.5, 2),
LFNoise2.kr(0.1).range(0, 1), 2, TRand.kr(-1,1, clouder), envbuf) * env)
}).send(s);
)

// use built-in env

x = Synth(\buf_grain_test, [\sndbuf, b, \envbuf, -1])


You may notice that there are some minor differences with this code and the
original one in the GrainBuf help file but they are essentially the same.
The most important difference, and the source of the problem is
"SinOsc.kr(3).range(0,1)" placed in the duration parameter of the GrainBuf.
It was initially 0.1 and I wanted to test it with a ugen.
I realized that when I increased the number of the grains (assigned to
MouseY, so beware), the sound stops and the server shuts itself. Batuhan
Bozkurt and I tried removing doneAction:2 from the envelope but it too did
not work. The sound is off around 150-200 grains and then I have to reboot
the server.
I even tried disabling AirPort, which didn't help either. I don't even see a
meaningful cpu load in the meanwhile by the way.

Any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.create.ucsb.edu/pipermail/sc-users/attachments/20080423/c7477620/attachment.html 


More information about the sc-users mailing list