Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
adding full double effect
  • Loading branch information
heuermh committed Jun 28, 2016
1 parent 5e5d715 commit 3898585
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 0 deletions.
76 changes: 76 additions & 0 deletions examples/fullDoublePedal.ck
@@ -0,0 +1,76 @@
/*
LiCK Library for ChucK.
Copyright (c) 2007-2016 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/>.
*/

FullDouble fullDouble;

class Toggle extends Procedure
{
fun void run()
{
fullDouble.toggle();
<<<"running", fullDouble.running()>>>;
}
}

class Short extends Procedure
{
fun void run()
{
fullDouble.short();
<<<"short">>>;
}
}

class Long extends Procedure
{
fun void run()
{
fullDouble.long();
<<<"long">>>;
}
}

class Slam extends Procedure
{
fun void run()
{
<<<"slam!", fullDouble.slam()>>>;
}
}

adc => fullDouble => dac;

0.8 => fullDouble.mix;

Toggle toggle;
Short short;
Long long;
Slam slam;

StompKeyboard stomp;

toggle @=> stomp.button0Down;
short @=> stomp.button1Down;
long @=> stomp.button2Down;
slam @=> stomp.button3Down;

stomp.open(0);
1 change: 1 addition & 0 deletions import.ck
Expand Up @@ -376,6 +376,7 @@ Machine.add("lick/effect/DualRect.ck");
Machine.add("lick/effect/EnvelopeTremolo.ck");
Machine.add("lick/effect/Flutter.ck");
Machine.add("lick/effect/Freeze.ck");
Machine.add("lick/effect/FullDouble.ck");
Machine.add("lick/effect/Harmonizer.ck");
Machine.add("lick/effect/Harmonizers.ck");
Machine.add("lick/effect/LoopReverb.ck");
Expand Down
100 changes: 100 additions & 0 deletions lick/effect/FullDouble.ck
@@ -0,0 +1,100 @@
/*
LiCK Library for ChucK.
Copyright (c) 2007-2016 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 FullDouble extends Feedback
{
LPF _lpf1;
LPF _lpf2;
Delay _delay;

0 => static int SHORT;
1 => static int LONG;
SHORT => int _mode;

0 => static int OFF;
1 => static int ON;
OFF => static int _slam;

0.0 => float _lastFeedback;

/*
pre --> lpf 7238.0 Hz --> delay --> lpf 10266.6 Hz --> post
*/
pre => _lpf1 => _delay => _lpf2 => post;
feedbackOut => feedbackIn;

{
7238.0 => _lpf1.freq;
10266.6 => _lpf2.freq;
100::ms => _delay.max;

0.0 => feedback;
SHORT => mode;
}

fun void short()
{
mode(SHORT);
}

fun void long()
{
mode(LONG);
}

fun int mode()
{
return _mode;
}

fun int mode(int i)
{
i => _mode;
if (SHORT == _mode)
{
50::ms => _delay.delay;
}
else if (LONG == _mode)
{
100::ms => _delay.delay;
}
return _mode;
}

fun int slam()
{
if (ON == _slam)
{
_lastFeedback => feedback;
OFF => _slam;
}
else
{
feedback() => _lastFeedback;
0.998 => feedback;
ON => _slam;
}
return _slam;
}
}

0 comments on commit 3898585

Please sign in to comment.