|
@@ -1,7 +1,6 @@ |
|
|
//TODO: turn off adcThru when recording, and turn it back on afterwards |
|
|
//TODO: turn off adcThru when recording, and turn it back on afterwards |
|
|
//TODO: Effects break panning for some unknown reason |
|
|
//TODO: Effects break panning for some unknown reason |
|
|
//TODO varying number of bars |
|
|
//TODO varying number of bars |
|
|
//TODO: Subdivide metronome (still a bit wierd) |
|
|
|
|
|
NRev reverb => LPF lpf => HPF hpf => Dyno outputLimiter => dac; |
|
|
NRev reverb => LPF lpf => HPF hpf => Dyno outputLimiter => dac; |
|
|
outputLimiter.limit(); |
|
|
outputLimiter.limit(); |
|
|
reverb @=> UGen @ outputWet; // Reference to wet output |
|
|
reverb @=> UGen @ outputWet; // Reference to wet output |
|
@@ -14,7 +13,7 @@ inputLimiter.limit(); |
|
|
inputLimiter @=> UGen @ mainInput; |
|
|
inputLimiter @=> UGen @ mainInput; |
|
|
|
|
|
|
|
|
// Default parameters |
|
|
// Default parameters |
|
|
.5 => float adcThruLevel; |
|
|
|
|
|
|
|
|
1 => float adcThruLevel; |
|
|
1 => int adcThruMute; |
|
|
1 => int adcThruMute; |
|
|
adcThruLevel * adcThruMute => adcThru.gain; |
|
|
adcThruLevel * adcThruMute => adcThru.gain; |
|
|
10000 => lpf.freq; |
|
|
10000 => lpf.freq; |
|
@@ -105,11 +104,7 @@ class LoopPedal |
|
|
public void setWet( float ratio ) { ratio => wet.gain; 1-ratio => dry.gain;} |
|
|
public void setWet( float ratio ) { ratio => wet.gain; 1-ratio => dry.gain;} |
|
|
public void clear() { sample.clear(); } |
|
|
public void clear() { sample.clear(); } |
|
|
public void recordFrom(UGen ugen) { ugen => sample; } |
|
|
public void recordFrom(UGen ugen) { ugen => sample; } |
|
|
public int beat() { return Math.round(4 * sample.playPos() / sample.loopEnd()) $ int; } |
|
|
|
|
|
public dur remaining() { |
|
|
|
|
|
sample.loopEnd() => dur ltime; |
|
|
|
|
|
return (ltime - sample.playPos()) % (ltime/4.); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public dur remaining() { return sample.loopEnd() - sample.playPos(); } |
|
|
|
|
|
|
|
|
public void outputTo(UGen wetSink, UGen drySink) { |
|
|
public void outputTo(UGen wetSink, UGen drySink) { |
|
|
1 => sample.play; |
|
|
1 => sample.play; |
|
@@ -130,17 +125,28 @@ class Metronome |
|
|
SinOsc s => ADSR a; |
|
|
SinOsc s => ADSR a; |
|
|
0.5 => s.gain; |
|
|
0.5 => s.gain; |
|
|
a.set(0.001, .1, .5, .05); |
|
|
a.set(0.001, .1, .5, .05); |
|
|
0.01::second => dur plipTime; |
|
|
|
|
|
|
|
|
10::ms => dur plipTime; |
|
|
|
|
|
|
|
|
fun void mute(int value) { |
|
|
fun void mute(int value) { |
|
|
if (value){ a => dac; } else { a =< dac; } |
|
|
if (value){ a => dac; } else { a =< dac; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
fun void run() { |
|
|
fun void run() { |
|
|
while(true){ |
|
|
|
|
|
500 + 500*(pedals[0].beat()==1) => s.freq; |
|
|
|
|
|
a.keyOn(); plipTime => now; a.keyOff(); |
|
|
|
|
|
pedals[0].remaining() => now; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
while(true) { |
|
|
|
|
|
// Compute the beat time |
|
|
|
|
|
pedals[0].sample.loopEnd()/4. - plipTime => dur beatTime; |
|
|
|
|
|
|
|
|
|
|
|
// Beep four times |
|
|
|
|
|
1000 => s.freq; |
|
|
|
|
|
a.keyOn(); plipTime => now; a.keyOff(); |
|
|
|
|
|
beatTime => now; |
|
|
|
|
|
500 => s.freq; |
|
|
|
|
|
a.keyOn(); plipTime => now; a.keyOff(); |
|
|
|
|
|
beatTime => now; |
|
|
|
|
|
a.keyOn(); plipTime => now; a.keyOff(); |
|
|
|
|
|
beatTime => now; |
|
|
|
|
|
a.keyOn(); plipTime => now; a.keyOff(); |
|
|
|
|
|
pedals[0].remaining() => now; // Sync |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |