[chuck-users] shred references (bug?)

mike clemow gelfmuse at gmail.com
Sun Oct 12 15:46:51 EDT 2008


Dear list,

I've decided to give "bus error" a proper kenning: "Clemow's Bane."

Observe:

//-------------------------------------------------------------
// GrainDef version of tableMusic

SinOsc s;

fun void trig( float f ) {
    f => s.freq;
}

//-------------------------------------------------------------

// osc event creator function
fun OscEvent createOscEvent( string address, int port ) {
    OscRecv recv;
    port => recv.port;
    recv.listen();
    recv.event( address ) @=> OscEvent oe;
    return oe;
}

// shred reference
Shred ltrig;
// chfreq shred definition
fun void listenTrig() {
    createOscEvent( "/test, f", 12345 ) @=> OscEvent oe;

    while( oe => now ) {
        if( oe.nextMsg() ) {
            oe.getFloat() => float f;
            spork ~ trig( f );
        }
        me.yield();
    }
}

// this is the interesting bit...
//-------------------------------------------------------------
spork ~ listenTrig() @=> ltrig;   // I KILL CHUCK V1.2.1.2
// spork ~ listenTrig();            // I DO NOT KILL CHUCK V1.2.1.2


me.yield();

while( true ) {
    1::second => now;
}
//-------------------------------------------------------------

This is generally how I do OSC servers in Chuck.  I have to remove the
shred reference in the latest version, however, or else my code
crashes chuck hard.  I haven't been able to test this out on a Linux
box yet, but my guess is that someone should be able to make it barf
something more helpful than "bus error."

Kas, do you think that this is related to the bus errors we were
getting assigning objects in that GrainPattern class?

Cheers,
Mike



-- 
http://semiotech.org
http://semiotech.org/michael


More information about the chuck-users mailing list