[chuck-users] one-liners

Tom Lieber tom at alltom.com
Wed Oct 12 02:37:11 EDT 2011


On Tue, Oct 11, 2011 at 6:52 PM, Lucas Zawacki <lfzawacki at gmail.com> wrote:
> Step s => dac;
> 0 => int t;
>
> while (true) {
>    // your one-liner here
>    t++; t*((t>>12|t>>8)&63&t>>4) $ float => s.next;
>    6::samp => now;
> }
>
> The result resembles the ones shown in the video (the code above is
> the first tune from the first video in the post) but is not so nice to
> my ears.

Either they did some filtering for the video, or it happened as a
result of the compression… listening to the output of these programs
directly is much more painful. ;)

> Advancing time by 6 samples is the way I found to emulate a 8Khz
> sample rate, because I couldnt set it using the --srate parameter, but
> I dunno if this is correct at all. Also the Step ugen seems to want
> input between -1 and 1 and I don't know what's really happening to it
> when I feed him these absurd values... all I know is that it seems to
> work.
>
> Any suggestion on making this code better?

This just puts it within range:

  Step s => dac;
  0 => int t;

  while (true) {
      t++;
      (t*(t>>5|t>>8))>>(t>>16) => int sa;
      (sa & 0xff) / 128. - 1. => s.next;
      6::samp => now;
  }

-- 
Tom Lieber
http://AllTom.com/
http://infinite-sketchpad.com/


More information about the chuck-users mailing list