// envelope follower with event detection // (prints "BANG!!" when sonic event detected from mic) // patch adc => Gain g => OnePole p => blackhole; // feed into g again adc => g; // tell g to multiply 3 => g.op; // set pole position 0.99 => p.pole; // loop while( true ) { // observe the output if( p.last() > .2 ) { <<< "BANG!!", p.last() >>>; 80::ms => now; } // poll rate 20::ms => now; }