From b0fbf4e64f4eb0df2461a6b29e0628694ab9b548 Mon Sep 17 00:00:00 2001 From: Miguel Guthridge Date: Fri, 7 Oct 2022 03:08:07 +1100 Subject: [PATCH] Fix bug where some Launchkey devices weren't detected on MacOS --- src/devices/novation/launchkey/mk3/lk_25_37.py | 8 +++++++- src/devices/novation/launchkey/mk3/lk_49_61.py | 8 +++++++- src/devices/novation/launchkey/mk3_mini/mini.py | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/devices/novation/launchkey/mk3/lk_25_37.py b/src/devices/novation/launchkey/mk3/lk_25_37.py index 24141fd0..eb8681ce 100644 --- a/src/devices/novation/launchkey/mk3/lk_25_37.py +++ b/src/devices/novation/launchkey/mk3/lk_25_37.py @@ -100,7 +100,13 @@ def getDrumPadSize(cls) -> tuple[int, int]: return 2, 8 def getDeviceNumber(self) -> int: - return 2 if '2' in device.getName() else 1 + if ( + 'MIDIIN2' in device.getName() + or 'DAW' in device.getName() + ): + return 2 + else: + return 1 @classmethod def create(cls, event: FlMidiMsg = None, id: str = None) -> 'Device': diff --git a/src/devices/novation/launchkey/mk3/lk_49_61.py b/src/devices/novation/launchkey/mk3/lk_49_61.py index a4ac30c5..63738ba6 100644 --- a/src/devices/novation/launchkey/mk3/lk_49_61.py +++ b/src/devices/novation/launchkey/mk3/lk_49_61.py @@ -112,7 +112,13 @@ def getDrumPadSize(cls) -> tuple[int, int]: return 2, 8 def getDeviceNumber(self) -> int: - return 2 if '2' in device.getName() else 1 + if ( + 'MIDIIN2' in device.getName() + or 'DAW' in device.getName() + ): + return 2 + else: + return 1 @classmethod def create(cls, event: FlMidiMsg = None, id: str = None) -> 'Device': diff --git a/src/devices/novation/launchkey/mk3_mini/mini.py b/src/devices/novation/launchkey/mk3_mini/mini.py index 559506fc..9c0b4179 100644 --- a/src/devices/novation/launchkey/mk3_mini/mini.py +++ b/src/devices/novation/launchkey/mk3_mini/mini.py @@ -70,7 +70,13 @@ def getDrumPadSize(cls) -> tuple[int, int]: return 2, 8 def getDeviceNumber(self) -> int: - return 2 if '2' in device.getName() else 1 + if ( + 'MIDIIN2' in device.getName() + or 'DAW' in device.getName() + ): + return 2 + else: + return 1 @classmethod def create(cls, event: FlMidiMsg = None, id: str = None) -> 'Device':