[chuck-users] record and play multiple LiSa objects on multiple channels

Harald Gutsche hg42 at gmx.net
Fri Apr 8 13:24:30 EDT 2011

Hi chuckers,

>Fortunately that's not correct. You can use quite a few, if you like;
>LiSa a => dac;
>LiSa b => dac;
>If this gave you trouble there is likely something else that went wrong. If you send a (minimal) example that demonstrates the trouble you had we can look at it and try to help.

ok, I tried again to do the following (as a beginning):

- record stereo sound
- play it back in loops
- save it in parallel


I tried many variations and until now didn't find a way to do this all together.
Please use a fast panning stereo sound for all examples (e.g. one
panning cycle in 1 second). I could simulate this in chuck, but then
this would make everything less clear.

Let's start with a first problem. LiSa as you said above can be
instantiated multiple times, you are right, this works (and there are
examples for that).
The chuck crashes I mentioned in a former mail can be reduced to the
following code:

LiSa looper;
// this works: adc => looper => dac;
adc.chan(0) => looper.chan(0) => dac.chan(0);
adc.chan(1) => looper.chan(1) => dac.chan(1);

when running on chuck (which was my first contact with chuck).
Now I compiled (from the posted svn repo), which doesn't
crash, "fine" you say.


So next thing coming to mind is:

2000::ms => dur record_time;
//1 => int nchannels;
2 => int nchannels;

LiSa looper;

record_time => looper.duration;

for(0 => int c; c < nchannels; c++) { adc.chan(c) => looper.chan(c) =>
dac.chan(c); }

adc => dac;

<<<"record", "">>>;
1 => looper.record;
record_time => now;
0 => looper.record;

adc =< dac;

<<<"play", "">>>;
//for(0 => int c; c < nchannels; c++) { looper.chan(c) => dac.chan(c); }

// go
while( true ){ 1000::ms => now; }

this seems to record only one channel which is played on both dac channels.


Ok, lets try another one, multiple LiSa objects connected to the
adc/dac channels:

20::ms => dur crossfade;
2000::ms => dur record_time;

fun void loop_sampler(int c)
  LiSa looper;
  adc.chan(c) => looper => dac.chan(c);
  adc.chan(c) => dac.chan(c);

  record_time => looper.duration;

  <<<"record", c>>>;
  1 => looper.record;
  record_time => now;
  0 => looper.record;

  adc.chan(c) =< dac.chan(c);

  <<<"play", c>>>;
  looper => dac.chan(c);

  2 * record_time => now;

spork ~ loop_sampler(0);
spork ~ loop_sampler(1);

// go
while( true ){ 1000::ms => now; }

surprisingly, this doesn't play back anything in  chuck
I checked the general logic by simply replacing all occurencies of
".chan(c)" with nothing in the editor, which works, but is mono.

But in chuck it works unchanged!

More information about the chuck-users mailing list