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)

    ...I had grown up in a world that was dominated by immature age. Not by vigorous immaturity, but by immaturity that was old and tired and prudent, that loved ritual and rubric, and was utterly wanting in curiosity about the new and the strange. Its era has passed away, and the world it made has crumbled around us. Its finest creation, a code of manners, has been ridiculed and discarded.
    Ellen Glasgow (1873–1945)