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

Re: [sc-dev] Re: calling the stream upon EventStreamPlayer-stop

Hi James,

What are you doing, exactly?

Can you give an example of where using Prout breaks?

If you are defining a pattern that can sequence event patterns, it has to pass the nil
on to its child streams.

If not,  I don't think it should have to test for nil at all.


On Dec 27, 2005, at 2:14 PM, James Harkins wrote:

On 12/27/05, James Harkins <jamshark70@xxxxxxxxx> wrote:
        stop { stream.next(nil); stream = nextBeat = nil;  }

Can we provide a way to override the stream.next(nil)? This is causing
me major trouble in some new stuff I'm developing. If the stream is a
routine instead of a Pbind, I will have to write a nil check into every
routine I write. Not fun.

OK, I'm working around this for now by wrapping the routine in a FuncStream:

Prt : Prout {
	asStream {
		var	stream = super.asStream;
		^FuncStream({ |inval|
			inval.notNil.if({ stream.next(inval) });

It would be nice to leverage the cleanliness of embedInStream, though.

Can anyone think of a better solution?

James Harkins /// dewdrop world

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman

sc-dev mailing list