Hello,
Following up on my last email about panning at sample rate in a
chubgraph, the following does not seg fault and sounds reasonable
$ chuck --loop
[chuck](VM): sporking incoming shred: 1 (panExample.ck)...
dump 1.000000 1.000000 0.000000 1.000000 -0.019955 1.000000
...
dump -1.000000 -1.000000 -0.019955 1.000000 0.000000 1.000000
panExample.ck:
TriOsc osc;
220.0 => osc.freq;
1.0 => osc.gain;
SqrOsc lfo => blackhole;
0.4 => lfo.freq;
1.0 => lfo.gain;
osc => Pan2 pan => dac;
spork ~ applyCv();
spork ~ dump();
20::second => now;
<<<"done">>>;
fun void applyCv()
{
while (true)
{
1::samp => now;
lfo.last() => pan.pan;
}
}
fun void dump()
{
while (true)
{
50::ms => now;
<<<"dump", lfo.last(), pan.pan(), pan.left.last(),
pan.left.gain(), pan.right.last(), pan.right.gain()>>>;
}
}
But when constructed as a chubgraph as follows, the panning is not heard
$ chuck --loop
...
[chuck](VM): sporking incoming shred: 240 (Pan2Module.ck)...
"LiCK imported." : (string)
[chuck](VM): sporking incoming shred: 1 (pan2ModuleExample.ck)...
dump 1.000000 1.000000 0.000000 1.000000 -0.019955 1.000000
...
dump -1.000000 -1.000000 -0.019955 1.000000 0.000000 1.000000
pan2ModuleExample.ck:
TriOsc osc;
220.0 => osc.freq;
1.0 => osc.gain;
SqrOsc lfo;
0.4 => lfo.freq;
1.0 => lfo.gain;
Pan2Module pan;
lfo => pan._cv;
osc => pan => dac;
spork ~ dump();
20::second => now;
<<<"done">>>;
fun void dump()
{
while (true)
{
50::ms => now;
<<<"dump", lfo.last(), pan.pan.pan(), pan.pan.left.last(),
pan.pan.left.gain(), pan.pan.right.last(), pan.pan.right.gain()>>>;
}
}
Pan2Module.ck:
public class Pan2Module extends Chubgraph
{
Gain _cv;
inlet => Pan2 pan => outlet;
{
_cv => blackhole;
spork ~ _tickAtSampleRate();
}
fun void _tickAtSampleRate()
{
while (true)
{
1::samp => now;
_cv.last() => pan.pan;
}
}
}
If I use a different LFO, say
SinOsc lfo;
0.1 => lfo.freq;
1.0 => lfo.gain;
I hear some panning, but it is not as distinct as in the non-chubgraph
version. Is there some issue with channel routing between outlet and
dac in a chubgraph?
michael