[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] loop in routine, causes SC hang
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: Re: [sc-users] loop in routine, causes SC hang
- From: James Harkins <jamshark70@xxxxxxxxx>
- Date: Tue, 3 Mar 2009 18:05:38 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=R3nZBARxN/uTGD85AUOfoqfGj/sJUA4aBkDXuwFGx1g=; b=d9H1ug4dy3kj1IpM2caK3zcl3fYeCnwRsvryXzFCVYMthsoeO34cXiB2s2uz33aste 45GLypLY5RHq1e1WanOi/7LpDQhNHFaT3N34naOymVeHOzuZx7Cdzk2MjJf+RqMDLySw V7Zuzm6ZtxsL/DvfvOP6wEKRGtakH1OJEZJ6w=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; b=N60M9q8daoYW8wpDsE5tOl778Iwmc62OkQ7GOtEEGqmVz1b7jS8RLM/Lzies0E7pyu a1oHIS+9CeAYIocmtm72GbzKB9CbEefdaLyDcy/QcUKCGV6xXoy/XNBlcACQhhuodjJ7 5At7daDYAw8fQtZw8zS72SgfEJwhLdCx6ey+Y=
- In-reply-to: <C08403D1-B8D6-4570-8C9B-2ECF0DC03B2D@xxxxxxxxxxx>
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- References: <C08403D1-B8D6-4570-8C9B-2ECF0DC03B2D@xxxxxxxxxxx>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
Your .wait statement is outside the loop, so it never runs.
hjh
On Tue, Mar 3, 2009 at 6:01 PM, Aaron Gervais <aaron.gervais@xxxxxxxxxxx> wrote:
> Hi everyone,
> I'm back on the list after being away for a few years... enjoying getting
> back into supercollider. :)
> I'm having trouble with a loop in a routine (below). It causes SC to hang
> and I'm not sure why. I basically want the loop to automatically start a new
> synth, and then eventually kill that synth and start another one after a
> time value chosen from a range. The function works if I take out the loop
> (but obviously it doesn't loop). I figure I'm probably missing something
> simple but I can't find it.
> Thanks,
> Aaron
> (
> ~myFunction = { arg buf, pan_range=0.6, pitch_range=0.2, grain_rate=25;
> // buf is an array of buffers formatted as [ [buffer, length], [buffer,
> length] ]
> var r, waitTime, thisBuf;
> r = Routine.new({
> loop {
> waitTime = 10.0.linrand;
> thisBuf = buf.choose;
> Synth.new(\sample_granulator, [
> \out_bus, 0,
> \sound_buf, thisBuf[0].bufnum,
> \pan_rng, pan_range,
> \pitch_rng, pitch_range,
> \trig_rate, grain_rate,
> \length, waitTime
> ]);
> };
> waitTime.yield;
> });
> SystemClock.play(r);
> };
> )
--
James Harkins /// dewdrop world
jamshark70@xxxxxxxxxxxxxxxxx
http://www.dewdrop-world.net
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/