diff --git a/json_objects/midi_action_mapping_APC Key 25.json b/json_objects/midi_action_mapping_APC Key 25.json index c2c65cb..e841bc4 100644 --- a/json_objects/midi_action_mapping_APC Key 25.json +++ b/json_objects/midi_action_mapping_APC Key 25.json @@ -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"] diff --git a/plugins/WJSendPlugin.py b/plugins/WJSendPlugin.py index c7eb4c8..da4f2ec 100644 --- a/plugins/WJSendPlugin.py +++ b/plugins/WJSendPlugin.py @@ -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))