Debian Codegraph @

examples/deep/room.ck

raw
1 // name: room.ck
2 // desc: Alvin Lucier's "I Am Sitting in a Room"... in ChucK
3 // author: Nick Shaheed
4 // date: Fall 2025 ChucKathon
5
6 // we need two LiSa objects: one to record the room,
7 // and one to play back the feedback loop. These will
8 // alternate the act of recording and audio playback.
9 adc => LiSa loop1 => dac;
10 adc => LiSa loop2 => dac;
11
12 // initialize
13 0.1::minute => dur loopDur => loop1.duration => loop2.duration;
14
15 // ramp-on time
16 200::ms => loop1.recRamp => loop2.recRamp;
17
18 // record first iteration of loop, this is where you speak
19 <<< "Begin recording your monologue..." >>>;
20 true => loop1.record;
21
22 // don't playback audio for the first iteration of the loop
23 loop1.duration() => now;
24 // turn off loop1 recording...
25 false => loop1.record;
26
27 // the feedback loop
28 while( true )
29 {
30 // wtate 1: loop1 will play back audio and loop2 will record
31 false => loop2.play => loop1.record;
32 true => loop1.play => loop2.record;
33 loopDur => now;
34
35 // state 2: loop2 will play back audio and loop1 will record
36 false => loop1.play => loop2.record;
37 true => loop2.play => loop1.record;
38 loopDur => now;
39 }