ChucK - Code Example

Code Example

The following is a simple ChucK program that generates sound and music:

// our signal graph (patch) SinOsc s => JCRev r => dac; // set gain .2 => s.gain; // set dry/wet mix .1 => r.mix; // an array of pitch classes (in half steps) @=> int hi; // infinite time loop while( true ) { // choose a note, shift registers, convert to frequency Std.mtof( 45 + Std.rand2(0,3) * 12 + hi ) => s.freq; // advance time by 120 ms 120::ms => now; }

Read more about this topic:  ChucK

Famous quotes containing the word code:

    Many people will say to working mothers, in effect, “I don’t think you can have it all.” The phrase for “have it all” is code for “have your cake and eat it too.” What these people really mean is that achievement in the workplace has always come at a price—usually a significant personal price; conversely, women who stayed home with their children were seen as having sacrificed a great deal of their own ambition for their families.
    Anne C. Weisberg (20th century)

    ... the self respect of individuals ought to make them demand of their leaders conformity with an agreed-upon code of ethics and moral conduct.
    Mary Barnett Gilson (1877–?)