Skip to content

Commit

Permalink
add examples/basic/blit4.ck
Browse files Browse the repository at this point in the history
  • Loading branch information
gewang committed Jan 27, 2025
1 parent 1868909 commit a9d8f30
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ChucK VERSIONS log
// or displayed, for example:
Foo.help();
----------------------------------------
(added) examples/basic/blit4.ck


1.5.4.4 (January 2025)
Expand Down
56 changes: 56 additions & 0 deletions examples/basic/blit4.ck
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// name: blit4.ck
// desc: rising fizzing blit
// date: made during ChucK Hackathon Winter 2025, Stanford CCRMA

// base duration
300::ms => dur T;

//-------- audio setup ------------
Blit s => LPF lpf => PoleZero dcb => ADSR e => Gain g => JCRev r => dac;
// feedback
g => DelayL eicho => g; .65 => eicho.gain;
// block zero
.99 => dcb.blockZero;
// lower the volume a bit
.65 => s.gain;
// delay settings
T/2*3 => eicho.max => eicho.delay;
// reverb mix
.15 => r.mix;
// lowpass cutoff
8000 => lpf.freq;
// set adsr
e.set( 15::ms, 13::ms, .5, T/3 );
//---------------------------------

// time loop
while( true )
{
// set value
55 * Math.pow(2,Math.random2(0,3)) => float N => float inc;
// print marker
<<< "--------", "" >>>;
// repeat
repeat( Math.random2(3,12) )
{
// set frequency
N => s.freq;
// harmonics
Math.random2( 1, 6 ) => s.harmonics;
// print
<<< "frequency:", s.freq() >>>;
// key on
e.keyOn();
// advance time
T - e.releaseTime() => now;
// key off
e.keyOff();
// advance time
e.releaseTime() => now;
// increment
inc +=> N;
}
}

// let it ring
500::ms => now;

0 comments on commit a9d8f30

Please sign in to comment.