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

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

Hi Ron,

The plot thickens ... calling the stream with a nil event has a side effect that I really can't live with.

<x-tad-smaller>p = </x-tad-smaller><x-tad-smaller>\number</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>Pseries</x-tad-smaller><x-tad-smaller>(0, 1, </x-tad-smaller><x-tad-smaller>inf</x-tad-smaller><x-tad-smaller>), </x-tad-smaller><x-tad-smaller>\delta</x-tad-smaller><x-tad-smaller>, 1.0).asStream;

e = </x-tad-smaller><x-tad-smaller>CleanupStream</x-tad-smaller><x-tad-smaller>(p, {
</x-tad-smaller><x-tad-smaller>"this should execute when the stream ends, not on manual stop"</x-tad-smaller><x-tad-smaller>.postln;
}), (play: { ~number.postln }));

an EventStreamPlayer


<x-tad-smaller>this should execute when the stream ends, not on manual stop
an EventStreamPlayer

an EventStreamPlayer
</x-tad-smaller><x-tad-smaller>// there is no further output from here</x-tad-smaller>

Effectively, this means EventStreamPlayer is no longer a PauseStream. It's impossible to pause the stream and resume it later, because stream.next(nil) causes the stream to abort. It can't be recovered. Part of the spec in my compositional framework is that you should be able to resume sequencing processes where they left off.

Also, in some new code I'm working on, I need the ability to stop an event stream player without triggering the CleanupStream (it sends some notifications and releases some resources).

It's easy to work around because I don't use Pmono and I personally have no need to support it in my framework. (IMHO, Pmono is an attempt to roll functionality into patterns and streams that doesn't really belong there and that these issues are evidence of that, but if we must support Pmono then I won't make a big stink about it.) I can just implement an alternate stop method and be done with it.

It's unfortunate, though, that when I release this code, I'll have to document it that Pmono won't work. I can provide some alternate techniques, though.

If you have any better ideas for how to handle Pmono as well as my requirements, I'd be glad to hear them. Thanks.


: 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