[chuck-users] multi-channel issues

robin.escalation robin.escalation at acm.org
Sun Sep 2 17:30:15 EDT 2007


I started with the pan example with a gain setting added to prevent
my head from getting blown off:

// white noise pan
Noise n => Pan2 p => dac;
.4 => n.gain;

while(true) {
  Math.sin( now / 3::second * 2 * pi ) => p.pan;
  10::ms => now;
}

I wanted to generalise this to several outputs, so I recoded it:

// white noise pan without using Pan2
Noise n;
n => Gain gleft => dac.left;
n => Gain gright => dac.right;

.4 => n.gain;
5::second => dur period;

while(true) {
  (Math.sin( now / period * 2 * pi ) +1) / 2 => float amount;
  amount => gleft.gain;
  1-amount => gright.gain;
  10::ms => now;
}

I made sure I had all 8 outputs turned on my soundcard by running
this in one window:
chuck --out(8) --loop

Then, in a second window I fed it the shreds. The two above worked
fine. So, I tried this:

// white noise four-channel "pan"
Noise n;
n => Gain gfl => dac.chan(1);
n => Gain gfr => dac.chan(2);
n => Gain grl => dac.chan(3);
n => Gain grr => dac.chan(4);

.4 => n.gain;
5::second => dur panperiod;
6::second => dur fadeperiod;

while(true) {
  (Math.sin( now / panperiod * 2 * pi ) +1) / 2 => float panamount;
  (Math.sin( now / fadeperiod * 2 * pi ) +1) / 2 => float fadeamount;

  panamount * fadeamount => gfl.gain;
  (1-panamount) * fadeamount => gfr.gain;

  panamount * (1-fadeamount) => grl.gain;
  (1-panamount) * (1-fadeamount) => grr.gain;

  10::ms => now;
}

And got this:
NullPointerException: (UGen link) in shred[id=1:x.ck], PC=[33]

I have no idea how to use this to diagnose the issue. I am using the
latest win32 ASIO build.

-- robin



More information about the chuck-users mailing list