Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding single lfo trem, wave shaper, and dist

  • Loading branch information...
commit b69f82417074c7fcb6aeaf0ef681367d30f2adef 1 parent b1f7631
@heuermh authored
View
38 Dist.ck
@@ -0,0 +1,38 @@
+/*
+
+ 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/>.
+
+*/
+
+class F extends FloatFunction
+{
+ fun float evaluate(float value)
+ {
+ // f(x) = x / (1.0 + abs(x))
+ return value / (1.0 + Math.fabs(value));
+ }
+}
+
+public class Dist extends WaveShaper
+{
+ {
+ F f;
+ f @=> shape;
+ }
+}
View
38 FrostburnDist.ck
@@ -0,0 +1,38 @@
+/*
+
+ 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/>.
+
+*/
+
+class F extends FloatFunction
+{
+ fun float evaluate(float value)
+ {
+ // f(x) = (x * abs(x) + x) / (x^2 + abs(x) + 1.0)
+ return (value * Math.fabs(value) + value) / (value * value + Math.fabs(value) + 1.0);
+ }
+}
+
+public class FrostburnDist extends WaveShaper
+{
+ {
+ F f;
+ f @=> shape;
+ }
+}
View
32 GainShaper.ck
@@ -0,0 +1,32 @@
+/*
+
+ 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 GainShaper extends Chugen
+{
+ FloatFunction shape;
+
+ fun float tick(float in)
+ {
+ shape.evaluate(gain()) => gain;
+ return in;
+ }
+}
View
38 KijjazDist.ck
@@ -0,0 +1,38 @@
+/*
+
+ 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/>.
+
+*/
+
+class F extends FloatFunction
+{
+ fun float evaluate(float value)
+ {
+ // f(x) = x / (1.0 + x^2)
+ return value / (1.0 + value * value);
+ }
+}
+
+public class KijjazDist extends WaveShaper
+{
+ {
+ F f;
+ f @=> shape;
+ }
+}
View
39 KijjazDist2.ck
@@ -0,0 +1,39 @@
+/*
+
+ 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/>.
+
+*/
+
+class F extends FloatFunction
+{
+ fun float evaluate(float value)
+ {
+ // f(x) = x^3 / (1.0 + abs(x^3))
+ (value * value * value) => float v;
+ return v / (1.0 + Math.fabs(v));
+ }
+}
+
+public class KijjazDist2 extends WaveShaper
+{
+ {
+ F f;
+ f @=> shape;
+ }
+}
View
39 KijjazDist3.ck
@@ -0,0 +1,39 @@
+/*
+
+ 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/>.
+
+*/
+
+class F extends FloatFunction
+{
+ fun float evaluate(float value)
+ {
+ // f(x) = x(1.0 + x^2) / (1.0 + abs(x(1.0 + x^2)))
+ value * (1.0 + value * value) => float v;
+ return v / (1.0 + Math.fabs(v));
+ }
+}
+
+public class KijjazDist3 extends WaveShaper
+{
+ {
+ F f;
+ f @=> shape;
+ }
+}
View
39 KijjazDist4.ck
@@ -0,0 +1,39 @@
+/*
+
+ 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/>.
+
+*/
+
+class F extends FloatFunction
+{
+ fun float evaluate(float value)
+ {
+ // f(x) = x(1.0 + x^4) / (1.0 + abs(x(1.0 + x^4)))
+ value * (1.0 + value * value * value * value) => float v;
+ return v / (1.0 + Math.fabs(v));
+ }
+}
+
+public class KijjazDist4 extends WaveShaper
+{
+ {
+ F f;
+ f @=> shape;
+ }
+}
View
53 SinTrem.ck
@@ -0,0 +1,53 @@
+/*
+
+ 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 SinTrem extends Chugen
+{
+ SinOsc lfo;
+
+ {
+ lfo => blackhole;
+ }
+
+ fun float rate(float rate)
+ {
+ rate => lfo.freq;
+ return rate;
+ }
+
+ fun float depth(float depth)
+ {
+ depth => lfo.gain;
+ return depth;
+ }
+
+ fun float tick(float in)
+ {
+ interp(lfo.last(), -1.0, 1.0, 0.0, 1.0) => gain;
+ return in;
+ }
+
+ fun float interp(float value, float sourceMin, float sourceMax, float targetMin, float targetMax)
+ {
+ return targetMin + (targetMax - targetMin) * ((value - sourceMin) / (sourceMax - sourceMin));
+ }
+}
View
53 SqrTrem.ck
@@ -0,0 +1,53 @@
+/*
+
+ 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 SqrTrem extends Chugen
+{
+ SqrOsc lfo;
+
+ {
+ lfo => blackhole;
+ }
+
+ fun float rate(float rate)
+ {
+ rate => lfo.freq;
+ return rate;
+ }
+
+ fun float depth(float depth)
+ {
+ depth => lfo.gain;
+ return depth;
+ }
+
+ fun float tick(float in)
+ {
+ interp(lfo.last(), -1.0, 1.0, 0.0, 1.0) => gain;
+ return in;
+ }
+
+ fun float interp(float value, float sourceMin, float sourceMax, float targetMin, float targetMax)
+ {
+ return targetMin + (targetMax - targetMin) * ((value - sourceMin) / (sourceMax - sourceMin));
+ }
+}
View
53 TriTrem.ck
@@ -0,0 +1,53 @@
+/*
+
+ 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 TriTrem extends Chugen
+{
+ TriOsc lfo;
+
+ {
+ lfo => blackhole;
+ }
+
+ fun float rate(float rate)
+ {
+ rate => lfo.freq;
+ return rate;
+ }
+
+ fun float depth(float depth)
+ {
+ depth => lfo.gain;
+ return depth;
+ }
+
+ fun float tick(float in)
+ {
+ interp(lfo.last(), -1.0, 1.0, 0.0, 1.0) => gain;
+ return in;
+ }
+
+ fun float interp(float value, float sourceMin, float sourceMax, float targetMin, float targetMax)
+ {
+ return targetMin + (targetMax - targetMin) * ((value - sourceMin) / (sourceMax - sourceMin));
+ }
+}
View
31 WaveShaper.ck
@@ -0,0 +1,31 @@
+/*
+
+ 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 WaveShaper extends Chugen
+{
+ FloatFunction shape;
+
+ fun float tick(float in)
+ {
+ return shape.evaluate(in);
+ }
+}
View
15 import.ck
@@ -247,6 +247,9 @@ Machine.add("RolandTr909.ck");
Machine.add("BigMono.ck");
// delay stuff
+Machine.add("SinTrem.ck");
+Machine.add("SqrTrem.ck");
+Machine.add("TriTrem.ck");
Machine.add("Trem.ck");
Machine.add("Tremolo.ck");
Machine.add("MonoDelay.ck");
@@ -264,4 +267,14 @@ Machine.add("StereoFeedbackMachines.ck");
Machine.add("StereoFeedbackMachineA.ck");
Machine.add("StereoFeedbackMachineL.ck");
-<<<"LiCK imported.">>>;
+// dist stuff
+Machine.add("GainShaper.ck");
+Machine.add("WaveShaper.ck");
+Machine.add("Dist.ck");
+Machine.add("FrostburnDist.ck");
+Machine.add("KijjazDist.ck");
+Machine.add("KijjazDist2.ck");
+Machine.add("KijjazDist3.ck");
+Machine.add("KijjazDist4.ck");
+
+<<<"LiCK imported.">>;
Please sign in to comment.
Something went wrong with that request. Please try again.