Skip to content

Commit 7f2a4fc

Browse files
committed
Novation_ZeRO_SL_MkII.py: changed "Global View" button assignment
1 parent d44988d commit 7f2a4fc

File tree

4 files changed

+60
-19
lines changed

4 files changed

+60
-19
lines changed
2.79 KB
Binary file not shown.

doc/assignments/novation/zero_sl_mkii/zero_sl_mkii.svg

Lines changed: 16 additions & 12 deletions
Loading

src/PythonMcu/Hardware/Novation_ZeRO_SL_MkII.py

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ def receive_midi(self, status, message):
278278
'self._change_mode_transport(%d & 0x01)',
279279
}
280280

281+
# make sure that no submenu disturbs toggling the "Global
282+
# View" mode
283+
if self._mode_other == self._MODE_OTHER_GLOBAL_VIEW:
284+
del cc_selector[self._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 1]
285+
281286
if status == (MidiConnection.CONTROL_CHANGE + \
282287
self._MIDI_DEVICE_CHANNEL):
283288
cc_number = message[1]
@@ -602,7 +607,7 @@ def _change_mode_edit(self, status):
602607

603608
menu_strings = \
604609
('Track', 'Send', 'Panning', 'EQ', \
605-
'Plug-In', 'Instrum.', 'Switch 1', 'Switch 2')
610+
'Plug-In', 'Instrum.', 'Switch A', 'Switch B')
606611
self._set_menu_string(menu_strings)
607612

608613
self.register_control( \
@@ -754,6 +759,9 @@ def _change_mode_bank(self, status):
754759
# leave other modes as is in order to return to the old one!
755760

756761
if status == 1:
762+
if self._mode_other != self._MODE_OTHER_OFF:
763+
return
764+
757765
self._mode_other = self._MODE_OTHER_BANK
758766
self._set_led(self._MIDI_CC_BUTTONS_RIGHT_BOTTOM, 1)
759767

@@ -780,6 +788,9 @@ def _change_mode_bank(self, status):
780788
self.withdraw_control(self._MIDI_CC_BUTTONS_LEFT_BOTTOM + 6)
781789
self.withdraw_control(self._MIDI_CC_BUTTONS_LEFT_BOTTOM + 7)
782790
else:
791+
if self._mode_other != self._MODE_OTHER_BANK:
792+
return
793+
783794
self._mode_other = self._MODE_OTHER_OFF
784795
self._set_led(self._MIDI_CC_BUTTONS_RIGHT_BOTTOM, 0)
785796

@@ -791,12 +802,15 @@ def _change_mode_automation(self, status):
791802
# leave other modes as is in order to return to the old one!
792803

793804
if status == 1:
805+
if self._mode_other != self._MODE_OTHER_OFF:
806+
return
807+
794808
self._mode_other = self._MODE_OTHER_AUTOMATION
795809
self._set_led(self._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 1, 1)
796810

797811
menu_strings = \
798812
('Read/Off', 'Write', 'Trim', 'Touch', \
799-
'Latch', '', 'Global', 'Group')
813+
'Latch', '', '', 'Group')
800814
self._set_menu_string(menu_strings)
801815

802816
self.register_control( \
@@ -811,13 +825,14 @@ def _change_mode_automation(self, status):
811825
'automation_latch', self._MIDI_CC_BUTTONS_LEFT_BOTTOM + 4)
812826

813827
self.withdraw_control(self._MIDI_CC_BUTTONS_LEFT_BOTTOM + 5)
828+
self.withdraw_control(self._MIDI_CC_BUTTONS_LEFT_BOTTOM + 6)
814829

815-
self.register_control( \
816-
'global_view', self._MIDI_CC_BUTTONS_LEFT_BOTTOM + 6, \
817-
self._MIDI_CC_LED_AUTOMAP_LEARN)
818830
self.register_control( \
819831
'group', self._MIDI_CC_BUTTONS_LEFT_BOTTOM + 7)
820832
else:
833+
if self._mode_other != self._MODE_OTHER_AUTOMATION:
834+
return
835+
821836
self._mode_other = self._MODE_OTHER_OFF
822837
self._set_led(self._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 1, 0)
823838

@@ -829,6 +844,9 @@ def _change_mode_global_view(self, status):
829844
# leave other modes as is in order to return to the old one!
830845

831846
if status == 1:
847+
if self._mode_other != self._MODE_OTHER_OFF:
848+
return
849+
832850
self._mode_other = self._MODE_OTHER_GLOBAL_VIEW
833851
self._set_led(self._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 2, 1)
834852

@@ -861,10 +879,19 @@ def _change_mode_global_view(self, status):
861879
self.register_control( \
862880
'global_view_user', \
863881
self._MIDI_CC_BUTTONS_LEFT_BOTTOM + 7)
882+
883+
self.register_control( \
884+
'global_view', self._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 1, \
885+
self._MIDI_CC_LED_AUTOMAP_LEARN)
864886
else:
887+
if self._mode_other != self._MODE_OTHER_GLOBAL_VIEW:
888+
return
889+
865890
self._mode_other = self._MODE_OTHER_OFF
866891
self._set_led(self._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 2, 0)
867892

893+
self.withdraw_control(self._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 1)
894+
868895
self._clear_menu_string()
869896
self._restore_previous_mode()
870897

@@ -873,6 +900,9 @@ def _change_mode_utility(self, status):
873900
# leave other modes as is in order to return to the old one!
874901

875902
if status == 1:
903+
if self._mode_other != self._MODE_OTHER_OFF:
904+
return
905+
876906
self._mode_other = self._MODE_OTHER_UTILITY
877907
self._set_led(self._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 3, 1)
878908

@@ -898,6 +928,9 @@ def _change_mode_utility(self, status):
898928
self.register_control( \
899929
'utilities_save', self._MIDI_CC_BUTTONS_LEFT_BOTTOM + 7)
900930
else:
931+
if self._mode_other != self._MODE_OTHER_UTILITY:
932+
return
933+
901934
self._mode_other = self._MODE_OTHER_OFF
902935
self._set_led(self._MIDI_CC_BUTTONS_RIGHT_BOTTOM + 3, 0)
903936

src/PythonMcu/McuInterconnector/McuInterconnector.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ def withdraw_control(self, midi_switch):
235235
if midi_switch in self._led__hardware_to_mcu:
236236
mcu_command = self._led__hardware_to_mcu[midi_switch]
237237
midi_led = self._led__mcu_to_hardware[mcu_command]['midi_led']
238-
self._hardware_controller.set_led(midi_led, 0)
238+
239+
if type(midi_led) != types.NoneType:
240+
self._hardware_controller.set_led(midi_led, 0)
239241

240242
del self._led__hardware_to_mcu[midi_switch]
241243
self._led__mcu_to_hardware[mcu_command]['midi_switch'] = None
@@ -246,7 +248,9 @@ def withdraw_all_controls(self):
246248
for midi_switch in self._led__hardware_to_mcu.keys():
247249
mcu_command = self._led__hardware_to_mcu[midi_switch]
248250
midi_led = self._led__mcu_to_hardware[mcu_command]['midi_led']
249-
self._hardware_controller.set_led(midi_led, 0)
251+
252+
if type(midi_led) != types.NoneType:
253+
self._hardware_controller.set_led(midi_led, 0)
250254

251255
self._led__hardware_to_mcu = {}
252256
self._led__mcu_to_hardware = {}

0 commit comments

Comments
 (0)