sorted out some confusion with modulation parameter ranges. modulation works better now. changes to wjsendplugin so that wipe effect is at least prioritised now so looks smoother (wtf...)

This commit is contained in:
Tristan Rowley
2020-02-23 17:36:42 +00:00
parent 2fa4bac9cc
commit 8be51695e5
4 changed files with 52 additions and 26 deletions

View File

@@ -77,23 +77,23 @@ class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin):
#lfo_speed = [1.0]*MAX_LFOS
def getLFO(self, position, lfo):
lfo_value = getattr(self,self.formula[lfo])(position, self.level[lfo])
self.last_lfo_status[lfo] = " sent {:03.1f}%".format(lfo_value*100.0) #, position*self.lfo_speed[lfo])
self.last_lfo_status[lfo] = " sent {:03.1f}%".format(lfo_value*100.0)
return lfo_value
# built-in waveshapes
# outgoing values should be between 0 and 1!!
# todo: more of the these, and better!
def f_sin(self, position, level):
#return level * (( math.sin(position*math.pi)))
value = (
(math.sin(position * math.pi*2) / 2)
-0.5
) + 0.5
value = math.sin(position * math.pi * 2) / 2
value *= level
value += 0.5 # normalise to range 0 - 1
return value
def f_double_cos(self, position, level):
return self.f_sin(math.cos(position*math.pi), level)
#return self.f_sin(math.acos(position), level)
# SequencePlugin methods
def run_sequence(self, position):
@@ -106,6 +106,9 @@ class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin):
if not self.active:
return
for lfo in range(0,4):
for lfo in range(0,self.MAX_LFOS):
if self.level[lfo]>0.0:
self.pc.actions.call_method_name("modulate_param_%s_to_amount_continuous"%lfo, self.getLFO(position, lfo))
self.pc.actions.call_method_name(
"modulate_param_%s_to_amount_continuous"%lfo,
self.getLFO(position, lfo)
)