Permalink
Browse files

adding dist pedal example

  • Loading branch information...
1 parent d4b961b commit 359702942fafdfe2aa51f07350ce96140bcfbb18 @heuermh committed Jan 12, 2013
Showing with 164 additions and 0 deletions.
  1. +164 −0 examples/distPedal.ck
View
@@ -0,0 +1,164 @@
+/*
+
+ LiCK Library for ChucK.
+ Copyright (c) 2007-2013 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/>.
+
+*/
+
+/*
+ 5
+ >-- in --+-- Gain dry --------------------------------+-- out -->
+ | |
+ +-- Dist => Gain dist0 ----------------------+ 0
+ | |
+ +-- Dist => ... => Gain dist1 ---------------+ 1
+ | |
+ +-- Dist => ... => Gain dist2 ---------------+ 2
+ | |
+ +-- Dist => ... => Gain dist3 ---------------+ 3
+ | |
+ +-- Dist => ... => Gain dist4 ---------------+ 4
+
+*/
+
+adc => Gain in;
+Gain out => dac;
+
+in => Gain dry;
+in => Dist d0 => Gain dist0;
+in => Dist d1 => Dist d2 => Gain dist1;
+in => Dist d3 => Dist d4 => Dist d5 => Gain dist2;
+in => Dist d6 => Dist d7 => Dist d8 => Dist d9 => Gain dist3;
+in => Dist d10 => Dist d11 => Dist d12 => Dist d13 => Dist d14 => Gain dist4;
+
+1.0 => in.gain;
+1.0 => dry.gain;
+1.0 => out.gain;
+0.0 => dist0.gain;
+0.0 => dist1.gain;
+0.0 => dist2.gain;
+0.0 => dist3.gain;
+0.0 => dist4.gain;
+
+dry => out;
+dist0 => out;
+dist1 => out;
+dist2 => out;
+dist3 => out;
+dist4 => out;
+
+class Dry extends Procedure
+{
+ fun void run()
+ {
+ 1.0 => dry.gain;
+ 0.0 => dist0.gain;
+ 0.0 => dist1.gain;
+ 0.0 => dist2.gain;
+ 0.0 => dist3.gain;
+ 0.0 => dist4.gain;
+ <<<"dry", dry.gain()>>>;
+ }
+}
+
+class Dist0 extends Procedure
+{
+ fun void run()
+ {
+ 0.0 => dry.gain;
+ 1.0 => dist0.gain;
+ 0.0 => dist1.gain;
+ 0.0 => dist2.gain;
+ 0.0 => dist3.gain;
+ 0.0 => dist4.gain;
+ <<<"dist0", dist0.gain()>>>;
+ }
+}
+
+class Dist1 extends Procedure
+{
+ fun void run()
+ {
+ 0.0 => dry.gain;
+ 0.0 => dist0.gain;
+ 1.0 => dist1.gain;
+ 0.0 => dist2.gain;
+ 0.0 => dist3.gain;
+ 0.0 => dist4.gain;
+ <<<"dist1", dist1.gain()>>>;
+ }
+}
+
+class Dist2 extends Procedure
+{
+ fun void run()
+ {
+ 0.0 => dry.gain;
+ 0.0 => dist0.gain;
+ 0.0 => dist1.gain;
+ 1.0 => dist2.gain;
+ 0.0 => dist3.gain;
+ 0.0 => dist4.gain;
+ <<<"dist2", dist2.gain()>>>;
+ }
+}
+
+class Dist3 extends Procedure
+{
+ fun void run()
+ {
+ 0.0 => dry.gain;
+ 0.0 => dist0.gain;
+ 0.0 => dist1.gain;
+ 0.0 => dist2.gain;
+ 1.0 => dist3.gain;
+ 0.0 => dist4.gain;
+ <<<"dist3", dist3.gain()>>>;
+ }
+}
+
+class Dist4 extends Procedure
+{
+ fun void run()
+ {
+ 0.0 => dry.gain;
+ 0.0 => dist0.gain;
+ 0.0 => dist1.gain;
+ 0.0 => dist2.gain;
+ 0.0 => dist3.gain;
+ 1.0 => dist4.gain;
+ <<<"dist4", dist4.gain()>>>;
+ }
+}
+
+Dist0 _dist0;
+Dist1 _dist1;
+Dist2 _dist2;
+Dist3 _dist3;
+Dist4 _dist4;
+Dry _dry;
+
+StompKeyboard stomp;
+_dist0 @=> stomp.button0Down;
+_dist1 @=> stomp.button1Down;
+_dist2 @=> stomp.button2Down;
+_dist3 @=> stomp.button3Down;
+_dist4 @=> stomp.button4Down;
+_dry @=> stomp.button5Down;
+
+stomp.open(0);

0 comments on commit 3597029

Please sign in to comment.