From 8a15c6ae4f2a6179e24a59c003aff6474228ad6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Emonet?= Date: Fri, 22 Apr 2022 20:59:02 +0200 Subject: [PATCH 1/3] feat: add support for launchpad mini mk3 (pretty much like X but smaller) --- .../devices/known-devices/known-devices.ts | 2 ++ .../novation-launchpad-mini-mk3.ts | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/app/devices/known-devices/novation-launchpad-mini-mk3.ts diff --git a/src/app/devices/known-devices/known-devices.ts b/src/app/devices/known-devices/known-devices.ts index 2e19415..79bfc98 100644 --- a/src/app/devices/known-devices/known-devices.ts +++ b/src/app/devices/known-devices/known-devices.ts @@ -2,6 +2,7 @@ import { Controller, Selector } from '../device/device.types'; import { novationLaunchpadX } from './novation-launchpad-x'; import { novationLaunchControlXl } from './novation-launch-control-xl'; import { novationLaunchpadMini } from './novation-launchpad-mini'; +import { novationLaunchpadMiniMk3 } from './novation-launchpad-mini-mk3'; /** * List of known devices. @@ -10,4 +11,5 @@ export const knownDevices: (Selector | Controller)[] = [ novationLaunchpadX, novationLaunchControlXl, novationLaunchpadMini, + novationLaunchpadMiniMk3, ]; diff --git a/src/app/devices/known-devices/novation-launchpad-mini-mk3.ts b/src/app/devices/known-devices/novation-launchpad-mini-mk3.ts new file mode 100644 index 0000000..60b5780 --- /dev/null +++ b/src/app/devices/known-devices/novation-launchpad-mini-mk3.ts @@ -0,0 +1,21 @@ +import { Selector, DeviceCategory } from '../device/device.types'; +import { novationLaunchpadX } from './novation-launchpad-x'; + +/** + * Novation Launchpad Mini Mk3 + * + * @see Novation resources https://downloads.novationmusic.com/novation/launchpad-mk3/launchpad-mini-mk3-0 + */ +export const novationLaunchpadMiniMk3 = { + ...novationLaunchpadX, // shallow copy but it is probably not meant to be mutated anyway + name: 'Launchpad Mini MK3', // https://github.com/rienheuver/launchpad-mini-mk3/blob/master/index.js#L7 , mine is 'Launchpad Mini MK3 LPMiniMK3 MI' + get bootSequence () { + return { + color: novationLaunchpadX.colors.red, + sysex: { + manufacturer: 0, + data: [32, 41, 2, 13, 14, 1], // https://github.com/FMMT666/launchpad.py/blob/master/launchpad_py/launchpad.py#L2375 + }, + }; + }, +} as Selector; From 8db0adbb48c91070cd14128daf6b498fe1d7125f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Emonet?= Date: Fri, 22 Apr 2022 20:59:33 +0200 Subject: [PATCH 2/3] refactor: rename LP Mini to LP Mini Mk2 to avoid confusion with mk3 --- src/app/devices/known-devices/known-devices.ts | 4 ++-- ...ion-launchpad-mini.ts => novation-launchpad-mini-mk2.ts} | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename src/app/devices/known-devices/{novation-launchpad-mini.ts => novation-launchpad-mini-mk2.ts} (93%) diff --git a/src/app/devices/known-devices/known-devices.ts b/src/app/devices/known-devices/known-devices.ts index 79bfc98..32f5e48 100644 --- a/src/app/devices/known-devices/known-devices.ts +++ b/src/app/devices/known-devices/known-devices.ts @@ -1,7 +1,7 @@ import { Controller, Selector } from '../device/device.types'; import { novationLaunchpadX } from './novation-launchpad-x'; import { novationLaunchControlXl } from './novation-launch-control-xl'; -import { novationLaunchpadMini } from './novation-launchpad-mini'; +import { novationLaunchpadMiniMk2 } from './novation-launchpad-mini-mk2'; import { novationLaunchpadMiniMk3 } from './novation-launchpad-mini-mk3'; /** @@ -10,6 +10,6 @@ import { novationLaunchpadMiniMk3 } from './novation-launchpad-mini-mk3'; export const knownDevices: (Selector | Controller)[] = [ novationLaunchpadX, novationLaunchControlXl, - novationLaunchpadMini, + novationLaunchpadMiniMk2, novationLaunchpadMiniMk3, ]; diff --git a/src/app/devices/known-devices/novation-launchpad-mini.ts b/src/app/devices/known-devices/novation-launchpad-mini-mk2.ts similarity index 93% rename from src/app/devices/known-devices/novation-launchpad-mini.ts rename to src/app/devices/known-devices/novation-launchpad-mini-mk2.ts index 9abee34..f2f3e8e 100644 --- a/src/app/devices/known-devices/novation-launchpad-mini.ts +++ b/src/app/devices/known-devices/novation-launchpad-mini-mk2.ts @@ -1,14 +1,14 @@ import { Selector, DeviceCategory } from '../device/device.types'; /** - * Novation Launchpad Mini + * Novation Launchpad Mini Mk2 * * @see http://leemans.ch/latex/doc_launchpad-programmers-reference.pdf */ -export const novationLaunchpadMini: Selector = { +export const novationLaunchpadMiniMk2: Selector = { category: DeviceCategory.selector, manufacturer: 'Focusrite A.E. Ltd', - name: 'Launchpad Mini', + name: 'Launchpad Mini MK2', channels: { input: 'all', output: 1, From f7593d5a1e14a403901a60a83354ed6fd7339506 Mon Sep 17 00:00:00 2001 From: Bamdad Sabbagh Date: Fri, 22 Apr 2022 22:39:56 +0200 Subject: [PATCH 3/3] fix(novationLaunchpadMiniMk2): Set narrower name to catch device --- .../devices/known-devices/novation-launchpad-mini-mk2.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/devices/known-devices/novation-launchpad-mini-mk2.ts b/src/app/devices/known-devices/novation-launchpad-mini-mk2.ts index f2f3e8e..7e4d74a 100644 --- a/src/app/devices/known-devices/novation-launchpad-mini-mk2.ts +++ b/src/app/devices/known-devices/novation-launchpad-mini-mk2.ts @@ -1,4 +1,4 @@ -import { Selector, DeviceCategory } from '../device/device.types'; +import {Selector, DeviceCategory} from '../device/device.types'; /** * Novation Launchpad Mini Mk2 @@ -8,7 +8,7 @@ import { Selector, DeviceCategory } from '../device/device.types'; export const novationLaunchpadMiniMk2: Selector = { category: DeviceCategory.selector, manufacturer: 'Focusrite A.E. Ltd', - name: 'Launchpad Mini MK2', + name: 'Launchpad Mini MIDI', channels: { input: 'all', output: 1, @@ -41,7 +41,7 @@ export const novationLaunchpadMiniMk2: Selector = { yellow: 62, green: 60, }, - get colorByState () { + get colorByState() { return { inputOn: this.colors.red, inputOff: this.colors.black, @@ -61,7 +61,7 @@ export const novationLaunchpadMiniMk2: Selector = { defaultDuration: 500, longClick: 400, }, - get bootSequence () { + get bootSequence() { return { color: this.colors.red, sysex: {