add some default wavetables
This commit is contained in:
BIN
config/wavetables/saw.wt
Normal file
BIN
config/wavetables/saw.wt
Normal file
Binary file not shown.
BIN
config/wavetables/sharkFin.wt
Normal file
BIN
config/wavetables/sharkFin.wt
Normal file
Binary file not shown.
BIN
config/wavetables/square.wt
Normal file
BIN
config/wavetables/square.wt
Normal file
Binary file not shown.
BIN
config/wavetables/triangle.wt
Normal file
BIN
config/wavetables/triangle.wt
Normal file
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
WAVETABLE_FILE_NAME = "triangle"
|
WAVETABLE_FILE_NAME = "sharkFin"
|
||||||
|
|
||||||
def sine(phase):
|
def sine(phase):
|
||||||
return math.sin(phase)
|
return math.sin(phase)
|
||||||
@@ -26,7 +26,12 @@ def triangle(phase):
|
|||||||
return sample
|
return sample
|
||||||
|
|
||||||
def sharkFin(phase):
|
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):
|
def sphere(phase):
|
||||||
return 1
|
return 1
|
||||||
@@ -35,4 +40,4 @@ def sphere(phase):
|
|||||||
# it calculates a single sample at a specified phase
|
# it calculates a single sample at a specified phase
|
||||||
# normalization is handled by generate_wavetable.py
|
# normalization is handled by generate_wavetable.py
|
||||||
def process(phase):
|
def process(phase):
|
||||||
return triangle(phase)
|
return sharkFin(phase)
|
||||||
|
|||||||
Reference in New Issue
Block a user