diff --git a/main.ck b/main.ck index e5c9ef3..ca4f989 100644 --- a/main.ck +++ b/main.ck @@ -11,8 +11,6 @@ adc => LiSa sample => mixer; // Sampler // Levels //0 => adc.gain; -1 => sample.feedback; -.5 => sample.gain; .5 => adcThru.gain; // Start recording and playing in a loop diff --git a/run.sh b/run.sh index aa0cace..c62451a 100755 --- a/run.sh +++ b/run.sh @@ -1,6 +1,6 @@ #!/bin/bash -#chuck --bufsize64 scratch.ck -chuck --bufsize64 main.ck & -python ./main.py -pkill -SIGINT chuck +chuck --bufsize64 scratch.ck +#chuck --bufsize64 main.ck & +#python ./main.py +#pkill -SIGINT chuck diff --git a/scratch.ck b/scratch.ck index 881362d..e362bca 100644 --- a/scratch.ck +++ b/scratch.ck @@ -1,27 +1,48 @@ -// Effects chain -Gain mixer => dac; // Main mixer -adc => Gain adcThru => mixer; // Monitor the input -adc => LiSa sample => mixer; // Sampler -// TODO: turn off adcThru when recording +public class SampleChan +{ + // Chain + LiSa sample => LPF filter; + + // Setup + UGen @ mySource; + 10::second => sample.duration; //This is the max duration + 0::second => sample.recPos => sample.playPos; + 1.0 => sample.feedback; + 1 => sample.loop; + setLoopPoint(1::second); + filter.set(10000, 1); -//Times -10::second => sample.duration; -0::second => sample.recPos; -0::second => sample.playPos; -1::second => sample.loopEnd => sample.loopEndRec; + public void setLoopPoint( dur length ) { + length => sample.loopEnd => sample.loopEndRec; + } -// Start recording and playing in a loop -1 => sample.loop => sample.record => sample.play; + public void outputTo(UGen ugen) { + 1 => sample.play; + filter => ugen; + } -// Levels -//0 => adc.gain; -1 => sample.feedback; -.5 => sample.gain; -.5 => adcThru.gain; + public void recordFrom(UGen ugen) { + 1 => sample.record; + ugen => sample; + ugen @=> mySource; + } -.5::second => now; -2::second => sample.loopEnd => sample.loopEndRec; + public void stopRecording() { + 0 => sample.record; + mySource =< sample; + } +} + +// Effects chain +Gain mixer => dac; // Main mixer +//adc => Gain adcThru => mixer; // Monitor the input +SampleChan sample; // Sampler +sample.outputTo(mixer); +sample.recordFrom(adc); +2::second => now; +sample.stopRecording(); +5::second=>now; -while(true) { 1::second => now; } +/*while(true) { 1::second => now; }*/