Permalink
Browse files

adding feedback machine utility classes, example

  • Loading branch information...
1 parent 55dfc2c commit a24a778dca91fb917d522381f13d5f68ba64102a Michael Heuer committed Aug 16, 2012
View
@@ -85,4 +85,34 @@ public class FeedbackMachine
delay3.output => wet;
delay4.output => wet;
}
+
+ fun void panic()
+ {
+ feedback(0.0);
+ route(0.0);
+ }
+
+ fun void feedback(float f)
+ {
+ f => delay1.feedback.gain;
+ f => delay2.feedback.gain;
+ f => delay3.feedback.gain;
+ f => delay4.feedback.gain;
+ }
+
+ fun void route(float f)
+ {
+ f => route1to2.gain;
+ f => route1to3.gain;
+ f => route1to4.gain;
+ f => route2to1.gain;
+ f => route2to3.gain;
+ f => route2to4.gain;
+ f => route3to1.gain;
+ f => route3to2.gain;
+ f => route3to4.gain;
+ f => route4to1.gain;
+ f => route4to2.gain;
+ f => route4to3.gain;
+ }
}
View
@@ -85,4 +85,34 @@ public class FeedbackMachineA
delay3.output => wet;
delay4.output => wet;
}
+
+ fun void panic()
+ {
+ feedback(0.0);
+ route(0.0);
+ }
+
+ fun void feedback(float f)
+ {
+ f => delay1.feedback.gain;
+ f => delay2.feedback.gain;
+ f => delay3.feedback.gain;
+ f => delay4.feedback.gain;
+ }
+
+ fun void route(float f)
+ {
+ f => route1to2.gain;
+ f => route1to3.gain;
+ f => route1to4.gain;
+ f => route2to1.gain;
+ f => route2to3.gain;
+ f => route2to4.gain;
+ f => route3to1.gain;
+ f => route3to2.gain;
+ f => route3to4.gain;
+ f => route4to1.gain;
+ f => route4to2.gain;
+ f => route4to3.gain;
+ }
}
View
@@ -85,4 +85,34 @@ public class FeedbackMachineL
delay3.output => wet;
delay4.output => wet;
}
+
+ fun void panic()
+ {
+ feedback(0.0);
+ route(0.0);
+ }
+
+ fun void feedback(float f)
+ {
+ f => delay1.feedback.gain;
+ f => delay2.feedback.gain;
+ f => delay3.feedback.gain;
+ f => delay4.feedback.gain;
+ }
+
+ fun void route(float f)
+ {
+ f => route1to2.gain;
+ f => route1to3.gain;
+ f => route1to4.gain;
+ f => route2to1.gain;
+ f => route2to3.gain;
+ f => route2to4.gain;
+ f => route3to1.gain;
+ f => route3to2.gain;
+ f => route3to4.gain;
+ f => route4to1.gain;
+ f => route4to2.gain;
+ f => route4to3.gain;
+ }
}
View
@@ -0,0 +1,141 @@
+/*
+
+ LiCK Library for ChucK.
+ Copyright (c) 2007-2012 held jointly by the individual authors.
+
+ This file is part of LiCK.
+
+ LiCK is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ LiCK is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with LiCK. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+public class FeedbackMachines
+{
+ fun static FeedbackMachine fourMono(float f)
+ {
+ FeedbackMachine fm;
+ fm.feedback(f);
+ return fm;
+ }
+
+ fun static FeedbackMachine dualPingpong(float f)
+ {
+ FeedbackMachine fm;
+ fm.feedback(0.0);
+ f => fm.route1to2.gain;
+ f => fm.route2to1.gain;
+ f => fm.route3to4.gain;
+ f => fm.route4to3.gain;
+ return fm;
+ }
+
+ fun static FeedbackMachine quadPingpong(float f)
+ {
+ FeedbackMachine fm;
+ fm.feedback(0.0);
+ f => fm.route1to2.gain;
+ f => fm.route2to3.gain;
+ f => fm.route3to4.gain;
+ fm.input =< fm.delay2.input;
+ fm.input =< fm.delay3.input;
+ fm.input =< fm.delay4.input;
+ return fm;
+ }
+
+ /*
+ fun static FeedbackMachine quadPermute(float f)
+ {
+ }
+ */
+
+ fun static FeedbackMachine quadNetwork(float f)
+ {
+ FeedbackMachine fm;
+ fm.feedback(0.0);
+ f => fm.route1to2.gain;
+ f => fm.route1to3.gain;
+ f => fm.route1to4.gain;
+ f => fm.route2to1.gain;
+ f => fm.route2to3.gain;
+ f => fm.route2to4.gain;
+ f => fm.route3to1.gain;
+ f => fm.route3to2.gain;
+ f => fm.route3to4.gain;
+ f => fm.route4to1.gain;
+ f => fm.route4to2.gain;
+ f => fm.route4to3.gain;
+ return fm;
+ }
+
+ fun static FeedbackMachine oneTwoIntoThreeFour(float f)
+ {
+ FeedbackMachine fm;
+ 0.0 => fm.delay1.feedback.gain;
+ 0.0 => fm.delay2.feedback.gain;
+ f => fm.delay3.feedback.gain;
+ f => fm.delay4.feedback.gain;
+ f => fm.route1to3.gain;
+ f => fm.route2to4.gain;
+ return fm;
+ }
+
+ fun static FeedbackMachine cascade(float f)
+ {
+ FeedbackMachine fm;
+ fm.feedback(0.0);
+ f => fm.route1to2.gain;
+ f => fm.route1to3.gain;
+ f => fm.route1to4.gain;
+ f => fm.route2to3.gain;
+ f => fm.route2to4.gain;
+ f => fm.route3to4.gain;
+ return fm;
+ }
+
+ fun static FeedbackMachine sink(float f)
+ {
+ FeedbackMachine fm;
+ fm.feedback(0.0);
+ f => fm.route1to4.gain;
+ f => fm.route2to4.gain;
+ f => fm.route3to4.gain;
+ f => fm.delay4.feedback.gain;
+ return fm;
+ }
+
+ fun static FeedbackMachine lambda(float f)
+ {
+ FeedbackMachine fm;
+ fm.feedback(0.0);
+ f => fm.route1to2.gain;
+ f => fm.route2to3.gain;
+ f => fm.route2to4.gain;
+ f => fm.delay3.feedback.gain;
+ f => fm.delay4.feedback.gain;
+ return fm;
+ }
+
+ fun static FeedbackMachine diamond(float f)
+ {
+ FeedbackMachine fm;
+ fm.feedback(0.0);
+ f => fm.route1to2.gain;
+ f => fm.route1to3.gain;
+ f => fm.route2to4.gain;
+ f => fm.route3to4.gain;
+ f => fm.delay2.feedback.gain;
+ f => fm.delay3.feedback.gain;
+ return fm;
+ }
+}
@@ -143,4 +143,51 @@ public class StereoFeedbackMachine
delay3.outputR => wetR;
delay4.outputR => wetR;
}
+
+ fun void panic()
+ {
+ feedback(0.0);
+ route(0.0);
+ }
+
+ fun void feedback(float f)
+ {
+ f => delay1.feedbackL.gain;
+ f => delay2.feedbackL.gain;
+ f => delay3.feedbackL.gain;
+ f => delay4.feedbackL.gain;
+ f => delay1.feedbackR.gain;
+ f => delay2.feedbackR.gain;
+ f => delay3.feedbackR.gain;
+ f => delay4.feedbackR.gain;
+ }
+
+ fun void route(float f)
+ {
+ f => route1Lto2L.gain;
+ f => route1Lto3L.gain;
+ f => route1Lto4L.gain;
+ f => route2Lto1L.gain;
+ f => route2Lto3L.gain;
+ f => route2Lto4L.gain;
+ f => route3Lto1L.gain;
+ f => route3Lto2L.gain;
+ f => route3Lto4L.gain;
+ f => route4Lto1L.gain;
+ f => route4Lto2L.gain;
+ f => route4Lto3L.gain;
+
+ f => route1Rto2R.gain;
+ f => route1Rto3R.gain;
+ f => route1Rto4R.gain;
+ f => route2Rto1R.gain;
+ f => route2Rto3R.gain;
+ f => route2Rto4R.gain;
+ f => route3Rto1R.gain;
+ f => route3Rto2R.gain;
+ f => route3Rto4R.gain;
+ f => route4Rto1R.gain;
+ f => route4Rto2R.gain;
+ f => route4Rto3R.gain;
+ }
}
@@ -143,4 +143,51 @@ public class StereoFeedbackMachineA
delay3.outputR => wetR;
delay4.outputR => wetR;
}
+
+ fun void panic()
+ {
+ feedback(0.0);
+ route(0.0);
+ }
+
+ fun void feedback(float f)
+ {
+ f => delay1.feedbackL.gain;
+ f => delay2.feedbackL.gain;
+ f => delay3.feedbackL.gain;
+ f => delay4.feedbackL.gain;
+ f => delay1.feedbackR.gain;
+ f => delay2.feedbackR.gain;
+ f => delay3.feedbackR.gain;
+ f => delay4.feedbackR.gain;
+ }
+
+ fun void route(float f)
+ {
+ f => route1Lto2L.gain;
+ f => route1Lto3L.gain;
+ f => route1Lto4L.gain;
+ f => route2Lto1L.gain;
+ f => route2Lto3L.gain;
+ f => route2Lto4L.gain;
+ f => route3Lto1L.gain;
+ f => route3Lto2L.gain;
+ f => route3Lto4L.gain;
+ f => route4Lto1L.gain;
+ f => route4Lto2L.gain;
+ f => route4Lto3L.gain;
+
+ f => route1Rto2R.gain;
+ f => route1Rto3R.gain;
+ f => route1Rto4R.gain;
+ f => route2Rto1R.gain;
+ f => route2Rto3R.gain;
+ f => route2Rto4R.gain;
+ f => route3Rto1R.gain;
+ f => route3Rto2R.gain;
+ f => route3Rto4R.gain;
+ f => route4Rto1R.gain;
+ f => route4Rto2R.gain;
+ f => route4Rto3R.gain;
+ }
}
Oops, something went wrong.

0 comments on commit a24a778

Please sign in to comment.