Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions mod/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -4913,6 +4913,20 @@ def address(self, instance, portsymbol, actuator_uri, label, minimum, maximum, v
# MIDI learn is not saved until a MIDI controller is moved.
# So we need special casing for unlearn.
if actuator_uri == kMidiUnlearnURI:
old_addressing = pluginData['addressings'].pop(portsymbol, None)
if old_addressing is not None:
self.addressings.remove(old_addressing)
self.pedalboard_modified = True

if portsymbol == ":bypass":
pluginData['bypassCC'] = (-1, -1)
else:
pluginData['midiCCs'][portsymbol] = (-1, -1, 0.0, 1.0)

# Clients other than the one that unlearned have no other signal that
# the mapping is gone; -1:-1 is the same form mod-host reports.
self.msg_callback("midi_map %s %s -1 -1 0.0 1.0" % (instance, portsymbol))

self.send_modified("midi_unmap %d %s" % (instance_id, portsymbol), callback, datatype='boolean')
return

Expand All @@ -4934,6 +4948,11 @@ def address(self, instance, portsymbol, actuator_uri, label, minimum, maximum, v
else:
pluginData['midiCCs'][portsymbol] = (-1, -1, 0.0, 1.0)

# Clients other than the one that removed the addressing have no
# other signal that the mapping is gone; -1:-1 is the same form
# mod-host reports.
self.msg_callback("midi_map %s %s -1 -1 0.0 1.0" % (instance, portsymbol))

else:
# Changing ranges without changing MIDI CC
if -1 in (channel, controller):
Expand Down