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

Re: [sc-users] synth instantiation problem



Sending a synthdef is asynchronous and the server is trying to process
the s_new before it has finished receiving the synthdef.

Look into server's sync() method with Condition. Or, use the
completionMsg when sending the synthdef.

Don't worry, everybody makes this mistake a few hundred times before
getting it right :)

hjh

On Dec 17, 2007 2:36 PM, Tim Blechmann <tim@xxxxxxxxxx> wrote:
> Bug {
>     var sd_;
>
>     *new {|server|
>         ^super.new.init(server);
>     }
>
>     init {|server|
>         sd_ = SynthDef(("def" ++ UniqueId.get).asSymbol, {
>             Out.ar(0, SinOsc.ar([220, 220.3], 0.1))}
>         )
>         .send(server);
>         Synth.tail(server, sd_.name);
>     }
> }

-- 
James Harkins /// dewdrop world
jamshark70@xxxxxxxxxxxxxxxxx
http://www.dewdrop-world.net

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