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 ?
(
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 }
});
)
Not sure how it could get much easier than that :) -- this mechanism is pretty clean as it is.