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

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



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