[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."


// 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.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 );

// 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


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?



More information about the chuck-users mailing list