wj_reset_modulation action to reset all modulation levels set in WJSendPlugin.

This commit is contained in:
Tristan Rowley
2020-02-29 17:39:57 +00:00
parent 1036bedf9d
commit 37749ffb08
2 changed files with 9 additions and 2 deletions

View File

@@ -152,7 +152,8 @@
"DEFAULT": ["switch_to_preset_7","select_preset_7"]
},
"note_on 81": {
"DEFAULT": ["","reset_selected_modulation"]
"DEFAULT": ["","reset_selected_modulation"],
"NAV_WJMX": ["","wj_reset_modulation"]
},
"note_on 82": {
"DEFAULT": ["toggle_shader_layer_0","select_shader_modulation_slot_0"]

View File

@@ -275,9 +275,14 @@ class WJSendPlugin(ActionsPlugin, SequencePlugin, DisplayPlugin, ModulationRecei
( r"^wj_select_next_command$", self.select_next_command ),
( r"^wj_select_previous_command$", self.select_previous_command ),
( r"^wj_select_next_argument$", self.select_next_argument ),
( r"^wj_select_previous_argument$", self.select_previous_argument )
( r"^wj_select_previous_argument$", self.select_previous_argument ),
( r"^wj_reset_modulation$", self.reset_modulation_levels )
]
def reset_modulation_levels(self):
for cmd,struct in self.commands.items():
struct['modulation'] = [{},{},{},{}]
def set_modulation_command_argument_level(self, command_name, argument_name, slot, level):
if self.DEBUG: print("set_modulation_command_argument_level(%s, %s, %s, %s)" % (command_name, argument_name, slot, level))
if not argument_name: self.commands[command_name]['arg_names'][0] #argument_name = 'v'
@@ -325,6 +330,7 @@ class WJSendPlugin(ActionsPlugin, SequencePlugin, DisplayPlugin, ModulationRecei
def modulate_arguments(self, command, args):
args = args.copy()
#if self.DEBUG: print("modulate_arguments passed %s and\n\t%s" % (command,args))
# TODO: rewrite this so that it combines multiple inputs and averages them
for slot in range(0,4):
modlevels = command.get('modulation',[{},{},{},{}])[slot]
#if self.DEBUG: print("\tfor modulate_arguments for slot %s got modlevels: %s" % (slot, modlevels))