Skip to content

Commit 190cd44

Browse files
author
arne
committed
Make MIDI device detection more robust
1 parent ea38fe1 commit 190cd44

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Classes/LaunchpadMiniMk1.sc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ LaunchpadMiniMk1 {
4444
var <channel = 0;
4545
var <verbose = true;
4646

47-
classvar <midiDeviceName = "Launchpad Mini", midiPortName = "Launchpad Mini";
47+
classvar <midiDeviceName = "Launchpad Mini";
4848
classvar <deviceButtonNotes, <sideButtonNotes, <topButtonCCNums;
4949

5050
*new{
@@ -124,8 +124,7 @@ LaunchpadMiniMk1 {
124124
if(devices.size < 1, {
125125
"No device found - may only be used with GUI".warn;
126126
}, {
127-
128-
deviceMidiOut = MIDIOut.newByName(midiDeviceName, midiPortName).latency_(0);
127+
deviceMidiOut = MIDIOut.newByName(devices[0].device, devices[0].name).latency_(0);
129128

130129
// A dirty hack to connect the device
131130
MIDIClient.sources.do{|src, srcNum|

0 commit comments

Comments
 (0)