FMMT666 / launchpad.py

Novation Launchpad (and Midi Fighter) control suite for Python
Other
355 stars 63 forks source link

Can't read button events on launchpad mini mk3 #86

Closed ToGamingYT closed 1 week ago

ToGamingYT commented 2 weeks ago

Hello, so I have a launchpad mini mk3 and wanted to set it up as kind of an audio controller for OBS. The connection is working (I can see the mic volume in real time on the launchpad) but I never get a button event, if I press something. Am I doing something wrong? (I don't get anything in the console and OBS doesn't react)

event = lp.ButtonStateXY() if event: print("Button event from ButtonStateXY:", event) x, y, state = event if (x, y) == (7, 8) and state == 1: print("Button at (7, 8) pressed. Executing toggle...") await toggle_input_mute(client) await asyncio.sleep(0.5)

I can't find a documentation, that I could use to check, how the library is supposed to work. just how to connect.

(Yes, the code is running in a loop)

FMMT666 commented 2 weeks ago

I had no idea OBS can do that; maybe I want that too, hehe.

At a glance, this seems correct, for the Launchpad.py code.
So you're using Windoze, I assume.
Which Python version are you using and which PyGame did you install?

Also, PyGame via pip?

ToGamingYT commented 2 weeks ago

I installed everything via pip yesterday and if I didn't do anything wrong, I should be running python 3.11.9.

I am pretty new to python. Is Windoze a library or do you mean Windows (OS)? (I am using windows.) (If it is a library, that I need, that might be, why it is not working.)

(If you want to do this yourself: The library, I am using for the OBS connection is obsws_python. It uses OBS's websocket and has (in my opinion) great documentation.)

FMMT666 commented 1 week ago

PyPi's Lauchpad.py version might be outdated for you.

Use this one here.

Did you run the "hello.py" or "launchpad_rgb.py" demo?
Do they work?

ToGamingYT commented 1 week ago

Oh found the solution: the launchpad has to be in legacy mode. (For people, who don't know:) For the Launchpad mini mk3, that means holding down the "session" button, until the seetings pop up and then pressing the purple button in the right side bar.

This is definetly somewhere on the github page and I just forgot about it...

Edit: Oh, you answered, sorry, github didn't update, until I posted this comment. Thank you for trying to help.