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:

    Faultless honesty is a sine qua non of business life. Not alone the honesty according to the moral code and the Bible. When I speak of honesty I refer to the small, hidden, evasive meannesses of our natures. I speak of the honesty of ourselves to ourselves.
    Alice Foote MacDougall (1867–1945)

    Wise Draco comes, deep in the midnight roll
    Of black artillery; he comes, though late;
    In code corroborating Calvin’s creed
    And cynic tyrannies of honest kings;
    He comes, nor parlies; and the Town, redeemed,
    Gives thanks devout; nor, being thankful, heeds
    The grimy slur on the Republic’s faith implied,
    Which holds that Man is naturally good,
    And—more—is Nature’s Roman, never to be
    scourged.
    Herman Melville (1819–1891)