/usr/share/doc/chuck/examples/shred/powerup.ck is in chuck 1.2.0.8.dfsg-1.4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | // power up!
// - philipd
// global noise source
Noise n;
// sweep shred
fun void sweep( float st, float inc, time end)
{
//set up the audio chain
n => TwoPole z => dac;
1 => z.norm;
0.1 => z.gain;
st => z.freq;
//store the time we entered the thread
now => time my_start;
0.0 => float my_seconds;
Std.rand2f ( 0.94, 0.99 ) => z.radius;
// keep going until we've passed the end time sent in by the control thread.
while ( now < end )
{
( now - my_start ) / 1.0::second => my_seconds;
Math.max( my_seconds * 4.0, 1.0 ) * 0.1 => z.gain;
z.freq() + inc * -0.02 => z.freq;
10::ms => now;
}
n =< z;
z =< dac;
}
// time loop
while ( true )
{
500::ms => dur d;
if ( Std.rand2 ( 0, 10 ) > 3 ) d * 2.0 => d;
if ( Std.rand2 ( 0, 10 ) > 6 ) d * 3.0 => d;
spork ~ sweep( 220.0 * Std.rand2(1,8),
880.0 + Std.rand2f(100.0, 880.0),
now + Std.rand2f(1.0, 3.0)::second );
d => now;
}
|