Skip to content

Commit

Permalink
adding engage/disengage methods to feedback machines, updating four m…
Browse files Browse the repository at this point in the history
…ono pedal example
  • Loading branch information
heuermh committed Dec 22, 2012
1 parent 938989a commit f9b53d0
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 8 deletions.
27 changes: 27 additions & 0 deletions FeedbackMachine.ck
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public class FeedbackMachine
MonoDelay delay3;
MonoDelay delay4;

// engaged by default
true => int engaged;

{
0.0 => route1to2.gain;
0.0 => route1to3.gain;
Expand Down Expand Up @@ -115,4 +118,28 @@ public class FeedbackMachine
f => route4to2.gain;
f => route4to3.gain;
}

fun void engage()
{
if (!engaged)
{
input => delay1.input;
input => delay2.input;
input => delay3.input;
input => delay4.input;
true => engaged;
}
}

fun void disengage()
{
if (engaged)
{
input =< delay1.input;
input =< delay2.input;
input =< delay3.input;
input =< delay4.input;
false => engaged;
}
}
}
27 changes: 27 additions & 0 deletions FeedbackMachineA.ck
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public class FeedbackMachineA
MonoDelayA delay3;
MonoDelayA delay4;

// engaged by default
true => int engaged;

{
0.0 => route1to2.gain;
0.0 => route1to3.gain;
Expand Down Expand Up @@ -115,4 +118,28 @@ public class FeedbackMachineA
f => route4to2.gain;
f => route4to3.gain;
}

fun void engage()
{
if (!engaged)
{
input => delay1.input;
input => delay2.input;
input => delay3.input;
input => delay4.input;
true => engaged;
}
}

fun void disengage()
{
if (engaged)
{
input =< delay1.input;
input =< delay2.input;
input =< delay3.input;
input =< delay4.input;
false => engaged;
}
}
}
27 changes: 27 additions & 0 deletions FeedbackMachineL.ck
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public class FeedbackMachineL
MonoDelayL delay3;
MonoDelayL delay4;

// engaged by default
true => int engaged;

{
0.0 => route1to2.gain;
0.0 => route1to3.gain;
Expand Down Expand Up @@ -115,4 +118,28 @@ public class FeedbackMachineL
f => route4to2.gain;
f => route4to3.gain;
}

fun void engage()
{
if (!engaged)
{
input => delay1.input;
input => delay2.input;
input => delay3.input;
input => delay4.input;
true => engaged;
}
}

fun void disengage()
{
if (engaged)
{
input =< delay1.input;
input =< delay2.input;
input =< delay3.input;
input =< delay4.input;
false => engaged;
}
}
}
39 changes: 39 additions & 0 deletions StereoFeedbackMachine.ck
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public class StereoFeedbackMachine
StereoDelay delay3;
StereoDelay delay4;

// engaged by default
true => int engaged;

{
// setup left channel
0.0 => route1Lto2L.gain;
Expand Down Expand Up @@ -190,4 +193,40 @@ public class StereoFeedbackMachine
f => route4Rto2R.gain;
f => route4Rto3R.gain;
}

fun void engage()
{
if (!engaged)
{
inputL =< delay1.inputL;
inputL =< delay2.inputL;
inputL =< delay3.inputL;
inputL =< delay4.inputL;

inputR => delay1.inputR;
inputR => delay2.inputR;
inputR => delay3.inputR;
inputR => delay4.inputR;

true => engaged;
}
}

fun void disengage()
{
if (engaged)
{
inputL => delay1.inputL;
inputL => delay2.inputL;
inputL => delay3.inputL;
inputL => delay4.inputL;

inputR => delay1.inputR;
inputR => delay2.inputR;
inputR => delay3.inputR;
inputR => delay4.inputR;

false => engaged;
}
}
}
39 changes: 39 additions & 0 deletions StereoFeedbackMachineA.ck
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public class StereoFeedbackMachineA
StereoDelayA delay3;
StereoDelayA delay4;

// engaged by default
true => int engaged;

{
// setup left channel
0.0 => route1Lto2L.gain;
Expand Down Expand Up @@ -190,4 +193,40 @@ public class StereoFeedbackMachineA
f => route4Rto2R.gain;
f => route4Rto3R.gain;
}

fun void engage()
{
if (!engaged)
{
inputL =< delay1.inputL;
inputL =< delay2.inputL;
inputL =< delay3.inputL;
inputL =< delay4.inputL;

inputR => delay1.inputR;
inputR => delay2.inputR;
inputR => delay3.inputR;
inputR => delay4.inputR;

true => engaged;
}
}

fun void disengage()
{
if (engaged)
{
inputL => delay1.inputL;
inputL => delay2.inputL;
inputL => delay3.inputL;
inputL => delay4.inputL;

inputR => delay1.inputR;
inputR => delay2.inputR;
inputR => delay3.inputR;
inputR => delay4.inputR;

false => engaged;
}
}
}
39 changes: 39 additions & 0 deletions StereoFeedbackMachineL.ck
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public class StereoFeedbackMachineL
StereoDelayL delay3;
StereoDelayL delay4;

// engaged by default
true => int engaged;

{
// setup left channel
0.0 => route1Lto2L.gain;
Expand Down Expand Up @@ -190,4 +193,40 @@ public class StereoFeedbackMachineL
f => route4Rto2R.gain;
f => route4Rto3R.gain;
}

fun void engage()
{
if (!engaged)
{
inputL =< delay1.inputL;
inputL =< delay2.inputL;
inputL =< delay3.inputL;
inputL =< delay4.inputL;

inputR => delay1.inputR;
inputR => delay2.inputR;
inputR => delay3.inputR;
inputR => delay4.inputR;

true => engaged;
}
}

fun void disengage()
{
if (engaged)
{
inputL => delay1.inputL;
inputL => delay2.inputL;
inputL => delay3.inputL;
inputL => delay4.inputL;

inputR => delay1.inputR;
inputR => delay2.inputR;
inputR => delay3.inputR;
inputR => delay4.inputR;

false => engaged;
}
}
}
15 changes: 7 additions & 8 deletions examples/fourMonoPedal.ck
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ FeedbackMachines.fourMono(0.95) @=> FeedbackMachine fm;
700::ms => fm.delay4.delay.delay;

adc => fm.input;
1.0 => fm.dry.gain;
0.0 => fm.wet.gain;
0.4 => fm.dry.gain;
0.6 => fm.wet.gain;
fm.dry => dac;
fm.wet => dac;

fm.disengage();

class Toggle extends Procedure
{
0 => int state;
Expand All @@ -45,18 +47,15 @@ class Toggle extends Procedure
{
if (state)
{
// todo: spork a fade from wet to dry
1.0 => fm.dry.gain;
0.0 => fm.wet.gain;
fm.disengage();
0 => state;
}
else
{
0.2 => fm.dry.gain;
0.8 => fm.wet.gain;
fm.engage();
1 => state;
}
<<<fm.dry.gain(), fm.wet.gain()>>>;
<<<fm.dry.gain(), fm.wet.gain(), state>>>;
}
}

Expand Down

0 comments on commit f9b53d0

Please sign in to comment.