Closed nimaid closed 5 years ago
The Launchpads are identified by their names. Please see method "Open()" in "Readme.md". They also can be overridden.
You can check the name of the attached devices with
lp = launchpad.Launchpad()
lp.ListAll()
Example output ("Mini" on a Mac):
('CoreMIDI', 'Launchpad Mini', 1, 0, 0)
('CoreMIDI', 'Launchpad Mini', 0, 1, 0)
Could you post the results here?
Here is the output of that command, run by a user on Discord:
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
(b'MMSystem', b'Microsoft MIDI Mapper', 0, 1, 0)
(b'MMSystem', b'Mbox Pro External', 1, 0, 0)
(b'MMSystem', b'Mbox Pro Control', 1, 0, 0)
(b'MMSystem', b'2- Launchpad', 1, 0, 0)
(b'MMSystem', b'Microsoft GS Wavetable Synth', 0, 1, 0)
(b'MMSystem', b'Mbox Pro External', 0, 1, 0)
(b'MMSystem', b'Mbox Pro Control', 0, 1, 0)
(b'MMSystem', b'2- Launchpad', 0, 1, 0)
Please let me know if you need anything else to help resolve this issue.
I resolved this. Here is how I fixed my detection method:
lp = launchpad.Launchpad()
if lp.Check( 0, "Launchpad MK2" ):
lp = launchpad.LaunchpadMk2()
if lp.Open( 0, "Launchpad MK2" ):
print('Connected to MkII! Yay!')
else:
raise Exception('MkII detected, but connection failed!')
elif lp.Check( 0, "Launchpad Pro" ):
lp = launchpad.LaunchpadPro()
if lp.Open( 0, "Launchpad Pro" ):
print('Connected to Pro! Yay!')
else:
raise Exception('Pro detected, but connection failed!')
elif lp.Check( 0, "control xl" ) or lp.Check( 0, "launchkey" ) or lp.Check( 0, "dicer" ):
raise Exception('Unsupported device detected!')
elif lp.Check():
if lp.Open():
print('Connected to Classic/Mini/S! Yay!')
else:
raise Exception('Classic/Mini/S detected, but connection failed!')
else:
raise Exception('Launchpad appears to be unplugged!')
Yep, maybe just looking for "Pro" was a baaad idea. Guess I will change that. Thx for reporting.
Several users of my program which uses launchpad.py have reported their Launchpad Classic being detected as a Pro, thereby causing major issues. This only appears to happen to some Launchpads.
Here is a picture of one of the offending devices Here is the sticker on the back
And here is a test program which encapsulates the Launchpad detection code in my program:
This returns "Connected to Pro! Yay!" in the situations described above.
While I personally do not own a device that is incorrectly detected, I have a user on Discord who does and is eager to provide any additional info that may help you resolve this issue. Thank you for your hard work on this fantastic project!