From 172b44521494d02b5ed3535f50956c451584fbfa Mon Sep 17 00:00:00 2001 From: Tristan Rowley Date: Sun, 23 Feb 2020 14:46:02 +0000 Subject: [PATCH] LFOModulation has sane sin and cos generators now --- plugins/LFOModulation.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins/LFOModulation.py b/plugins/LFOModulation.py index 45b304a..8f68b01 100644 --- a/plugins/LFOModulation.py +++ b/plugins/LFOModulation.py @@ -67,9 +67,9 @@ class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin): # TODO: save & load this to config file, make editable formula = [ "f_sin", - "f_double_sin", + "f_double_cos", "f_sin", - "f_double_sin" + "f_double_cos" ] # run the formula for the stored lfo configuration @@ -83,10 +83,17 @@ class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin): # built-in waveshapes # todo: more of the these, and better! 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 self.f_sin(position, math.sin(level+0.5*math.pi)) + return value + + def f_double_cos(self, position, level): + return self.f_sin(math.cos(position*math.pi), level) # SequencePlugin methods def run_sequence(self, position):