i'm trying to use the sunvox curve generator script to generate
chebyshev polynomials. i already have it set to generate an arbitrary number of curves, where the variable "$j" is the current curve number. i'm currently stuck on trying to define the function to generate the curves (which by nature must be recursive).
here's my code (pretend this is inside the curve_function):
Code: Select all
fn chebyshev ($x, $j) {
if ($j == 0) { ret(1) }
if ($j == 1) { ret($x) }
else {$y = ret(((2 * $x) * chebyshev($x, ($j - 1))) - chebyshev($x, ($j - 2))) }
}
$y = chebyshev($x, $j)
ret($y)
when i try to run this, pixilang says there's a syntax error on the line with the else statement
might be a typo, but i'm wondering whether this is even possible with pixilang
thank you in advance!