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

[sc-users] synth instantiation problem



hi all,

i'm trying to instantiate the following class:

UniqueId {
    classvar id_;

    *get {
        var ret;
        if (id_ == nil,
            { id_ = 0 });
        ret = id_;
        id_ = ret + 1;
        ^ret
    }
}

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);
    }
}

like this:

s.boot
b = Bug.new(s)

i can't create the synth, though ... the terminal output is:
booting 57110
localhost
jack_set_sample_rate_callback: deprecated
Using vector unit: yes
JackDriver: client name is 'SuperCollider'
JackDriver: connected  alsa_pcm:capture_1 to SuperCollider:in_1
JackDriver: connected  alsa_pcm:capture_2 to SuperCollider:in_2
JackDriver: connected  SuperCollider:out_1 to alsa_pcm:playback_1
JackDriver: connected  SuperCollider:out_2 to alsa_pcm:playback_2
SuperCollider 3 server ready..
JackDriver: max output latency 23.2 ms
Zeroconf: registered service 'SuperCollider'

localhost

a Bug
*** ERROR: SynthDef def0 not found
FAILURE /s_new SynthDef not found
notification is on



any idea, what i am doing wrong?

thnx, tim

-- 
tim@xxxxxxxxxx
http://tim.klingt.org

I must say I find television very educational. The minute somebody
turns it on, I go to the library and read a good book.
  Groucho Marx