Hi everybody,

i have some osc-triggered synth shreds like the one attached, and tried to spice things up using pan control (basic, i know ...).

Now, for the music i have in my mind, the respective shred is triggered about 10 - 15 times per second via OSC, and there are multiple of those
shreds, including some granulation shreds.

Now, even when i only trigger the attached shred with different pan values, ChucK crashes after a few seconds ... so i don't know, is the
shred faulty, or is chuck simply not capable for what i have in mind ?

Btw, i'm using Arch linux on a pretty recent laptop with plenty of ram and a fast processor, so resources should not be an issue ...

ChucK error message:
(JACK) the JACK server is shutting down this client...
... stream stopped and closed!
[chuck]: cleaning up...
terminate called after throwing an instance of 'RtError'
  what():  RtApi:: a stream is not open!


JACK error message
subgraph starting at ChucK timed out (subgraph_wait_fd=9, status = 0, state = Running, pollret = 0 revents = 0x0)

Regards,
nik


class MyBuzzer {

        SawOsc saw => LPF lp => ADSR e => Dyno dyn => Pan2 p;
        
        ADSR filt => Gain fg => blackhole;
        10 => fg.gain;

        p.left => JCRev lrev => dac.left;
        p.right => JCRev rrev => dac.right;
        
        Step s;
        s => filt;
        1 => s.next;

        // one-shot buzz spork
        fun void buzz(float freq, float gain, int a, int d, int sus, int r, 
float rev, float cutoff, float pan)
        {       
                                
                a + d + sus + r => int overall;
                freq => saw.freq;

                pan => p.pan;
                rev => lrev.mix;
                rev => rrev.mix;
        

                e.set( a::ms, d::ms, gain, r::ms );
                filt.set( a::ms, (sus - r)::ms, gain, r::ms );

                dyn.limit;
                gain / 4 => dyn.thresh;
                
                if(d == 0){
                        0 => e.decayRate;
                        0 => filt.decayRate;
                }
                
                now + overall::ms => time then; 
                spork ~ filteradsr(then, freq, cutoff);
                e.keyOn();
                filt.keyOn();
                sus::ms => now;
                e.keyOff();
                filt.keyOff();  
                r::ms => now;

                if(rev > 0.0){
                        2000::ms => now;
            }

        }

        fun void filteradsr (time then, float freq, float cutoff)
        {
                while (now < then)
                {
                        float currfilt;
                        (filt.last() * 800 + 100) * cutoff => currfilt;
                        currfilt => lp.freq;            
                        1::ms => now;
                }
        }
}

fun void sporkBuzzer(float freq, float gain, int a, int d, int sus, int r, 
float rev, float cutoff, float pan){
        MyBuzzer buzzer;
        buzzer.buzz(freq, gain, a, d, sus, r, rev, cutoff, pan);
}

// create our OSC receiver
OscRecv recv;
// use port 6449 (or whatever)
6449 => recv.port;
// start listening (launch thread)
recv.listen();

// create an address in the receiver, store in new variable
recv.event( "/buzz, f f i i i i f f f ") @=> OscEvent @ oe;

// infinite event loop
while( true )
{
    // wait for event to arrive
    oe => now;
        
    // grab the next message from the queue. 
    while( oe.nextMsg() )
    {           
                oe.getFloat() => float freq;
                oe.getFloat() => float gain;    
                oe.getInt() => int a;
                oe.getInt() => int d;
                oe.getInt() => int s;
                oe.getInt() => int r;
                oe.getFloat() => float rev;
                oe.getFloat() => float cutoff;
                oe.getFloat() => float pan;
                
                
                spork ~ sporkBuzzer(freq, gain, a, d, s, r, rev, cutoff, pan);
    }
}
_______________________________________________
chuck-users mailing list
[email protected]
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

Reply via email to