mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-12 11:20:15 +01:00
LFOModulation has sane sin and cos generators now
This commit is contained in:
@@ -67,9 +67,9 @@ class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin):
|
|||||||
# TODO: save & load this to config file, make editable
|
# TODO: save & load this to config file, make editable
|
||||||
formula = [
|
formula = [
|
||||||
"f_sin",
|
"f_sin",
|
||||||
"f_double_sin",
|
"f_double_cos",
|
||||||
"f_sin",
|
"f_sin",
|
||||||
"f_double_sin"
|
"f_double_cos"
|
||||||
]
|
]
|
||||||
|
|
||||||
# run the formula for the stored lfo configuration
|
# run the formula for the stored lfo configuration
|
||||||
@@ -83,10 +83,17 @@ class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin):
|
|||||||
# built-in waveshapes
|
# built-in waveshapes
|
||||||
# todo: more of the these, and better!
|
# todo: more of the these, and better!
|
||||||
def f_sin(self, position, level):
|
def f_sin(self, position, level):
|
||||||
return 0.5+(0.5*level * math.sin(position*math.pi))
|
#return level * (( math.sin(position*math.pi)))
|
||||||
|
value = (
|
||||||
|
(math.sin(position * math.pi*2) / 2)
|
||||||
|
-0.5
|
||||||
|
) + 0.5
|
||||||
|
value *= level
|
||||||
|
|
||||||
def f_double_sin(self, position, level):
|
return value
|
||||||
return self.f_sin(position, math.sin(level+0.5*math.pi))
|
|
||||||
|
def f_double_cos(self, position, level):
|
||||||
|
return self.f_sin(math.cos(position*math.pi), level)
|
||||||
|
|
||||||
# SequencePlugin methods
|
# SequencePlugin methods
|
||||||
def run_sequence(self, position):
|
def run_sequence(self, position):
|
||||||
|
|||||||
Reference in New Issue
Block a user