Hi Eric,
sorry for the late reply - I've been insanely busy of late.
On 21 May 2013, at 02:10, Eric Vogler <
ericv...@gmail.com> wrote:
> Is there a default way to trigger an event whenever a value in a buffer changes?
There's currently no system in place to do this for you. The main issue is that buffer changes can happen server-side and there's no hooks in SuperCollider to use to get notifications of buffer modifications.
The only way you can do it is to poll the buffer, read its contents and compare to a stored value and create an event if things have changed.
> Or in general, to trigger events from within synths?
Unfortunately there's no way of directly triggering events from within synths. The only side effects you can enact within a synth is the :action arg of certain ugens which allow for killing the current synth and other defined events. There's no general system for running arbitrary code.
As Roger pointed out, you can tap any arbitrary ugen and get a constant stream of latest values. It is possible to attach watchers to the atoms storing the latest values and your code *does* work - it's just that the println happens on a non-main thread, so the output is wherever the stdout of the lein process is. I tend to start lein manually from a console so I always have a window displaying this output.
> So I was just now looking for a way to trigger an overtone even using onsets. Add-watch would've been one way to do it, but is there another? (Besides polling an atom myself many times /sec)...
What do you mean by "trigger an overtone event using onsets"? Can you give me an example?
Sam
---
http://sam.aaron.name