Por ese Techno que todo llevamos en programación con chuck

rennovatio on November 14, 2013 07:20

Play
0.00 / 0.31
Hide the comments

Stats for this track

This Week Total
Plays 1 9
Downloads 1

Uploaded by

  • Report copyright infringement

    More tracks by rennovatio

    Pandicornios comiendo números multisabor

    Conversaciones vacías

    La flauta que estaba dentro del hoyo negro

    Pensamiento que se convierte en house

    Código mutando a techno

    View all

    Introduction to Programming for Musicians and Digital Artists
    Calarts, California Institute of the Arts at Coursera
    Teacher: Dr. California Institute of the Arts
    Code,

    / File: Assignment_3_SlowTechno.ck
    // Date: 10.11.2013

    //sound chain
    Gain master => dac;
    SndBuf kick => master;
    SndBuf kick2 => master;
    SndBuf hithat => master;
    SndBuf snare => master;
    SndBuf fx => master;

    // time
    now + 30::second => time t_end;

    .9 => master.gain;

    //load soundfiles into sndbuf

    // kick
    me.dir() + "/audio/kick_01.wav" => kick.read;

    //kick02
    me.dir () + "/audio/cowbell_01.wav" => string filename;
    filename => kick2.read;
    //find number of samples
    kick2.samples() => int numSamples;

    //Hithat
    me.dir() + "/audio/hithat_03.wav" => hithat.read;

    //Snare
    me.dir() + "/audio/snare_02.wav" => snare.read;

    // fx
    me.dir() + "/audio/stereo_fx_01.wav" => fx.read;

    // set all playheads to end so no sound is made

    kick.samples() => kick.pos;
    kick2.samples() => kick2.pos;
    hithat.samples() => hithat.pos;
    snare.samples() => snare.pos;
    fx.samples() => fx.pos;

    // initialize counter variable
    0 => int counter;

    //loop 30 seconds
    while (now < t_end )

    {

    // Cowbell with -1
    counter % 8 => int beat;

    if (( beat == 0 ) || (beat == 2) || (beat == 4) || (beat == 6) || (beat == 8) )
    {
    0 => kick2.pos;
    Math.random2f(.2, 1.9) => kick2.rate;
    .25::second => now;
    // reverse sound
    numSamples => kick2.pos;
    -1.0 => kick2.rate;
    .01::second => now;

    }


    if (( beat == 0 ) || (beat == 4) || (beat == 8) )
    {
    0 => snare.pos;
    Math.random2f(.6, 1.4) => snare.rate;
    }



    // snare drum on 2 and 6
    if (( beat == 2 ) || (beat == 6) )
    {
    0 => kick.pos;
    Math.random2f(.6, 1.4) => kick.rate;

    }




    if (( beat == 2 ) || (beat == 6) )
    {
    0 => hithat.pos;
    .9 => hithat.gain;
    Math.random2f(.2, 1.8) => hithat.rate;

    }


    // fx on 4
    if (( beat == 0 ) || (beat == 2) )
    {
    0 => fx.pos;
    Math.random2f(.6, 1.4) => fx.rate;

    }



    <<>>;
    counter++; // counter + 1 => counter
    250::ms => now;

    }

    1::second => now;

    "Por ese Techno que todo llevamos en programación con chuck" by rennovatio is licensed under a Creative Commons License

    Add a new comment

    You need to be logged in to post a comment. If you're already a member, please or sign up for a free account.

    Share to WordPress.com

    If you are using self-hosted WordPress, please use our standard embed code or install the plugin to use shortcodes.
    Add a comment 0 comments at 0.00
      Click to enter a
      comment at
      0.00