[sc-users] Embedded routines and Conditions

Scott Carver scott at artificia.org
Wed Oct 17 20:17:44 PDT 2007


The following works as expected:

	c = Condition(false);

	r = Routine({
		"before".postln;
		c.wait;
		"after".postln;
	}).play

	c.test_(true).signal;

The Routine advances only when the Condition is changed. However, in  
a situation where the above Routine is embedded in another Routine,  
it behaves strangely:

	c.test_(false); // reset the condition

	Routine({
		"before1".postln;
		r.embedInStream;
		"after1".postln;
	}).play

	c.test_(true).signal;

will yield:
	before1
	before
	after1

and then, after changing the Condition:
	after

The outside Routine is continuing on, instead of waiting for the  
Condition, though the inside routine is still waiting.

So, what am I doing wrong here? Is there another way I can approach  
this? Help would be much appreciated!

- Scott


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.create.ucsb.edu/pipermail/sc-users/attachments/20071017/9e93ab73/attachment-0001.htm


More information about the sc-users mailing list