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

Re: [sc-users] State of a pattern / EventStreamPlayer



Thank's James,

you're so very helpfull :)

I agree that the scheme is quite clean, and your example is just what I was looking for. But this only works for the toppattern (the EventStreamPlayer), and I think it would be cool if it were possible the get notification when an embedded pattern has ended...

I know to little about Streams and Events to really know what is possible here, but it would nice to have something to put into a pattern itself. Maybe a pattern object like Pfunc, but Pended, so if the stream containing it ends it evaluates...

i.e.

a = Pbind(\degree, Pseries(0, 1, 8), \dur, 0.25);
b = Pbind(\degree, Pseries(0, 1, 8), \dur, 0.5);

Pseq([a,b], inf).play

Id like to know when the internal patterns end...

Best,
Hjalte

2009/7/21 James Harkins <jamshark70@xxxxxxxxx>
On Jul 21, 2009, at 11:25 AM, Hjalte Møller wrote:

mjallo list,

I'm wondering what the easiest way to receive notification that an EventStreamPlayer has stopped playing ?

The reason is that I need to switch the button back off on my Interface to have it reflect it's state properly,
the problem is only with non infinite patterns...

Do I have to use the .changed / .update scheme ? and will that even work ?

Yes -

(
var eventStreamPlayer, updater;
eventStreamPlayer = Pbind(\degree, Pseries(0, 1, 8), \dur, 0.25).play;
updater = Updater(eventStreamPlayer, { |esp, msg|
[thisThread.clock.beats, msg].postln;
if(msg == \stopped) { updater.remove }
});
)

Is there an easier way ?

Not sure how it could get much easier than that :)  -- this mechanism is pretty clean as it is.

--- and now even worse,- is it possible if the pattern is playing inside a PbindPatternProxy or Pdef ?
--- Then it is always playing a resting pattern and will always return true to .isPlaying

I don't know about the jitlib proxies...
hjh


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

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