[chuck-users] help understanding lisa
eduard
eaylon at gmail.com
Wed Nov 5 19:33:56 EST 2008
Ok, got the answer:
lisa.valueAt(Math.sin(2.0*pi*60*i/(size-1)), i::samp);
should be put into lisa and not
lisa.valueAt(Math.sin(2.0*pi*60*i/size), i::samp);
the difference is in using size or size-1. This seems not right
though...
eduard
Begin forwarded message:
> From: eduard aylon <eduard.aylon at gmail.com>
> Date: November 6, 2008 1:20:56 AM GMT+01:00
> To: ChucK Users Mailing List <chuck-users at lists.cs.princeton.edu>
> Subject: help understanding lisa
>
> Hello list,
>
> I am trying to build a granular patch with lisa, but for some reason
> I am getting clicks every time lisa repeats the buffer. Maybe it has
> to do with lisa's duration? Hope someone can explain me what I am
> doing wrong. Following I attach two examples one uses lisa the other
> uses an array. The one that runs with lisa has clicks, the other
> sounds pristine, why? (even if rampup and rampdown were set for
> lisa). The strange thing is that if recorded to file and checked
> with an audio editor I can't see any strange artifacts in the
> waveform.
>
> thanks for any help,
>
> eduard
>
> // the patch that uses lisa:
>
> LiSa lisa => dac;
> 1024 => int size;
> size::samp => lisa.duration;
>
> for (int i; i < size; i++)
> {
> lisa.valueAt(Math.sin(2.0*pi*60*i/size), i::samp);
> }
>
> 1 => lisa.play;
> while(true)
> {
> lisa.rampUp(10::samp);
> lisa.duration() - 20::samp => now;
> lisa.rampDown(10::samp);
> }
>
>
>
> // the other patch with a simple buffer:
>
> Impulse imp => dac;
> 1024 => int size;
> float buffer[size];
> size - 1 => int bitmask;
>
> for (int i; i < size; i++)
> {
> Math.sin(2.0*pi*60*i/size) => buffer[i];
> }
>
> 0 => int pos;
>
> while(true)
> {
> buffer[pos&bitmask] => imp.next;
> pos++;
> 1::samp => now;
> }
>
More information about the chuck-users
mailing list