On Tue, 14 Aug 2007, Rohan Drape wrote:

> Henning Thielemann <[EMAIL PROTECTED]> writes:
> > I noticed it sporadicly but now I see that it is reproducable: If I send
> > the synth description and the invokation of the synth in the same
> > bundle then I get
> >  FAILURE /s_new SynthDef not found
>
> d_recv, as the manual notes, is asynchronous, you need
> to wait for it to complete - see the play implementation
> for an example (copied below)
>
> > This happens for instance in the short example I used to demonstrate
> > non-realtime rendering problems recently. However the problem does only
> > occur in realtime mode. (function 'realtime' in mentioned module)
>
> in nrt mode asynchronous commands become synchronous.
>
> regards,
> rd
>
> ++
>
> play :: Transport t => t -> UGen -> IO OSC
> play fd u = do let g = graphdef "Anonymous" (graph u)
>                send fd (d_recv g)
>                r <- wait fd "/done"
>                send fd (s_new "Anonymous" (-1) AddToTail 1 [])
>                return r

I used this implementation so far, but I hoped that sending bundles makes
this synchronous automatically. How can I know how long I must wait? Maybe
I must wait too long and I am not able to send the next message in time.
 I like to use the same data structure for realtime and non-realtime
performance. But as you said, messages with the same time stamp are
executed in unpredictable order. That is

                send fd (Bundle 0 (d_recv g))
                wait fd "/done"
                send fd (Bundle 0 (s_new "Anonymous" (-1) AddToTail 1 []))

won't work (if I omit 'wait' in non-realtime mode).
_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to