File: blit4.ck

package info (click to toggle)
chuck 1.5.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 40,904 kB
  • sloc: cpp: 120,943; ansic: 35,893; javascript: 2,111; yacc: 609; makefile: 456; python: 174; perl: 86
file content (56 lines) | stat: -rw-r--r-- 1,242 bytes parent folder | download | duplicates (3)
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
46
47
48
49
50
51
52
53
54
55
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;