• Archives

Nothing Special

Instead of working on the blog today I spent today day dreaming about the electro-music festival. Should be a lot of fun! Also be sure to check out the electro-music radio for a sample of what will be at the music festival. The ChucK show is playing tonight. Never miss the ChucK show with inventor.

Besides that, I’ve started to learn about csound. Maybe if I can come up with something post worthy soon I will have it up.

Have a good weekend and check out electro-music.

Fibonacci Sequence with ChucK

Today we are going to be using the Fibonacci Sequence with ChucK. First let’s set up an algorithm in ChucK to generate the Fibonacci numbers.

0 => int var1;
1 => int var2;
0 => int var3;


while(true){
  <<<var3>>>; //output numbers
  var1 + var2 => var3;
  var2 => var1;
  var3 => var2;
}

Next I used ChucK’s unit generatorSinOsc to create some sound. So setting up a SinOsc and plugging the Fibonacci numbers in we get the following:

SinOsc s => dac;
.15 => s.gain;


0 => int var1;
1 => int var2;
0 => int var3;


while(true){
  <<<var3>>>; //output numbers
  var1 + var2 => var3;
  var2 => var1;
  var3 => var2;
  //create frequency
  Std.fabs(Math.sin(var3) + 1.0) * 500.0 => s.freq;
  200::ms => now;
    if(t==1134903170)//reset our integer values
    {
      0 => var1;
      1 => var2;
      0 => var3;
    }
}

There we go. Now we have it all set up and ready to try new things with. Such as we can try other unit generators besides SinOsc. Also changing the values passed into the frequency can create different sounds. Such as using Math.tan() instead of Math.sin(). The list of possibilities goes on when using ChucK.

Enjoy and have fun!

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!