diff --git a/config/wavetables/saw.wt b/config/wavetables/saw.wt new file mode 100644 index 0000000..16eb6ce Binary files /dev/null and b/config/wavetables/saw.wt differ diff --git a/config/wavetables/sharkFin.wt b/config/wavetables/sharkFin.wt new file mode 100644 index 0000000..733864b Binary files /dev/null and b/config/wavetables/sharkFin.wt differ diff --git a/config/wavetables/square.wt b/config/wavetables/square.wt new file mode 100644 index 0000000..2563e5f Binary files /dev/null and b/config/wavetables/square.wt differ diff --git a/config/wavetables/triangle.wt b/config/wavetables/triangle.wt new file mode 100644 index 0000000..2920fa5 Binary files /dev/null and b/config/wavetables/triangle.wt differ diff --git a/scripts/example_wavetable.py b/scripts/example_wavetable.py index f6ebdad..f08838b 100644 --- a/scripts/example_wavetable.py +++ b/scripts/example_wavetable.py @@ -1,7 +1,7 @@ import math -WAVETABLE_FILE_NAME = "triangle" +WAVETABLE_FILE_NAME = "sharkFin" def sine(phase): return math.sin(phase) @@ -26,7 +26,12 @@ def triangle(phase): return sample def sharkFin(phase): - return 1 + k = 10.0 + if(phase <= math.pi): + sample = 2 * (phase/math.pi) ** k - 1.0 + else: + sample = -2 * (phase/math.pi - 1.0) ** k + 1.0 + return sample def sphere(phase): return 1 @@ -35,4 +40,4 @@ def sphere(phase): # it calculates a single sample at a specified phase # normalization is handled by generate_wavetable.py def process(phase): - return triangle(phase) + return sharkFin(phase)