[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] test(4) or Env bug?



sorry to be a newbi, but where am I supposed to paste that code?

pa
Le 09-05-10 à 14:37, James Harkins a écrit :

On May 10, 2009, at 8:42 AM, Pierre Alexandre Tremblay wrote:

Dear all

I am puzzled. It used to work and does not on my machine. Taken from the Env help:

Env.new([0,1,0],[0.5,2],'linear',1).test(3).plot

now it never ends (i.e. it never releases)

I thought I fixed that... it is indeed a regression. Env:test was changed from forking a routine (for server sync) to using server.bind, and that messed it up.

I just checked in the fix. Here's the replacement method:

	test { arg releaseTime = 3.0;
		var id, def, s;
		s = Server.default;
		if(s.serverRunning.not) { "Server not running.".warn; ^this };
		id = s.nextNodeID;
		fork {
			def = { arg gate=1;
				Out.ar(0,
					SinOsc.ar(800, pi/2, 0.3) * EnvGen.ar(this, gate, doneAction:2)
				)
			}.asSynthDef;
			def.send(s);
			s.sync;
			s.sendBundle(s.latency, [9, def.name, id]);
			if(s.notified) {
OSCpathResponder(s.addr, ['/n_end', id], { |time, responder, message|
					s.sendMsg(\d_free, def.name);
					responder.remove;
				}).add;
			};
			if(this.isSustained) {
				s.sendBundle(s.latency + releaseTime, [15, id, \gate, 0])
			};
		};
	}

hjh



: H. James Harkins
: 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/