Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
adding full double effect
- Loading branch information
Showing
3 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |