Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
69 lines (54 sloc) 1.53 KB
/*
LiCK Library for ChucK.
Copyright (c) 2007-2020 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/>.
*/
//
// eq. 1 from https://www.desmos.com/calculator/kcdu7jnzsn
public class Folder extends Chugen
{
0 => int _i;
0.0 => float _a;
1.0 => float _freq;
fun float tick(float f)
{
1::samp * _i => dur partial;
1::second / _freq => dur wavelength;
partial / wavelength => float _x;
_i++;
if (partial >= wavelength)
{
0 => _i;
}
// sin(sin(pi*x) * 8 * (a + 0.125))
return Math.sin(Math.sin(Math.PI * _x) * 8 * (_a + 0.125));
}
fun float freq()
{
return _freq;
}
fun float freq(float f)
{
f => _freq;
return _freq;
}
fun float a()
{
return _a;
}
fun float a(float f)
{
f => _a;
return _a;
}
}
You can’t perform that action at this time.