From 5f734c2439d463425f24274885a6d0880b7d2d6c Mon Sep 17 00:00:00 2001 From: Joan Duat Date: Fri, 25 Oct 2024 16:52:50 +0200 Subject: [PATCH] fix scale mode enable/disable --- Reface_CP/ScaleModeController.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Reface_CP/ScaleModeController.py b/Reface_CP/ScaleModeController.py index 1e05dc6..68c6874 100644 --- a/Reface_CP/ScaleModeController.py +++ b/Reface_CP/ScaleModeController.py @@ -78,9 +78,6 @@ def _update_play_mode_key_listeners(self): """Updates the note key listeners so notes not corresponding to the current scale mode are captured by the script (thus silenced)""" root_note = self._song.root_note scale_intervals = self._song.scale_intervals - if self._current_root_note == root_note and self._current_scale_intervals == scale_intervals: - return - # self._logger.log(f"intervals: {list(scale_intervals)}") for midi_note in range(128): button = self._note_key_buttons[midi_note] @@ -123,11 +120,15 @@ def _on_scale_mode_button_changed(self, value): def _on_root_note_changed(self): if self._enabled: + if self._current_root_note == self._song.root_note and self._current_scale_intervals == self._song.scale_intervals: + return self._update_play_mode_key_listeners() self._current_root_note = self._song.root_note def _on_scale_intervals_changed(self): if self._enabled: + if self._current_root_note == self._song.root_note and self._current_scale_intervals == self._song.scale_intervals: + return self._update_play_mode_key_listeners() self._current_scale_intervals = self._song.scale_intervals