// ----------------------------------------------------------------- // invert_delay_sound.ck -- realtime scanner noise cancellation // for fMRI paradigms. // Written by: Patryk Laurent, University of Pittsburgh, 2009. // ----------------------------------------------------------------- 2000.042::ms => dur delayLength; // Based on duration of TR, fine tuned for computer. // Set up input-output copy through a virtual y-plug, and a path for a delayed input. adc.left => Gain half1 => Gain yPlug => dac; adc.left => Gain half2 => Gain phaseInverter => DelayL delay => yPlug; 0.5 => half1.gain; 0.5 => half2.gain; 1.0 => yPlug.gain; // Set up inverted, delayed copy. -1 => phaseInverter.gain; delayLength => delay.max => delay.delay; while(true) { 100::ms => now; }