Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demos Broken on LP2 #15

Closed
Miserlou opened this issue Jan 11, 2017 · 9 comments
Closed

Demos Broken on LP2 #15

Miserlou opened this issue Jan 11, 2017 · 9 comments

Comments

@Miserlou
Copy link

I just updated to master and tried to run the examples/hello, and it looks like it's not working any more on my LP2.

It used to flash crazy colors, now there's nothing and it ends with this:

Traceback (most recent call last):
  File "examples/hello.py", line 97, in <module>
    main()
  File "examples/hello.py", line 92, in main
    lp.Reset() # turn all LEDs off
AttributeError: 'LaunchpadMk2' object has no attribute 'Reset'
Exception Exception: Exception("PortMidi: `Bad pointer'",) in <pypm.Input object at 0x1056cd4b8> ignored
Exception Exception: Exception("PortMidi: `Bad pointer'",) in <pypm.Output object at 0x1056cd468> ignored
Exception AttributeError: "'NoneType' object has no attribute 'quit'" in <bound method __Midi.__del__ of <launchpad_py.launchpad.__Midi instance at 0x1050bd5f0>> ignored

Any thoughts?

@Miserlou
Copy link
Author

Which hardware do you do your testing on, btw?

@FMMT666
Copy link
Owner

FMMT666 commented Jan 12, 2017

Yep, overlooked that Reset() wasn't in the Mk2.
Fixed, but that should have no impact on the demo!

So you don't see the scrolling text and the flickering lights?
Does it work after 30..60s?
Does a power cycle (USB unplug) help?

The Mk2 has some buffer issues and as there is no (documented)
method to reset it, it sometimes (very rarely seen here) does indeed
strange stuff. Usually a manual "reset" helps...

Or maybe just some issues with an "old" installation.
I only saw that "python setup.py install" and "pip install ..."
behave differently...

I test(ed) the code with Mk1/S/Mini/Mk2 and Pro on 64 bit Linux,
Python2 2.7.10-13, PyGame 1.9.1release.

Btw, you are aware of the Windoze 10 restrictions, right?

@Miserlou
Copy link
Author

Tried on a clean install, still no lights from hello.py.

Launchpad Mk2
---
Random madness. Stop by creating 10 button events.
Notice that sometimes, old Mk1 units don't recognize any button
events before you press one of the (top) automap buttons
(or power-cycle the unit...).
(1, ' button: ', [33, 127])
(2, ' button: ', [33, 0])
(3, ' button: ', [34, 127])
(4, ' button: ', [34, 0])
(5, ' button: ', [34, 127])
(6, ' button: ', [34, 0])
(7, ' button: ', [33, 127])
(8, ' button: ', [35, 127])
(9, ' button: ', [33, 0])
(10, ' button: ', [33, 127])
(11, ' button: ', [35, 0])

Now let's crash PyGame...
Don't worry, that's just a bug in PyGame's MIDI implementation.
Exception AttributeError: "'NoneType' object has no attribute 'quit'" in <bound method __Midi.__del__ of <launchpad_py.launchpad.__Midi instance at 0x107cf35a8>> ignored

I'd also suggest adding pygame to the setup.py as it won't work without it and has to be installed manually.

I'm on OSX - could that be related?

Thanks for your help here!

@FMMT666
Copy link
Owner

FMMT666 commented Jan 12, 2017

Yep, confirmed :-/

That's the same SysEx issue as the Windoze 10 one.
You can only use

  • LedCtrlRawByCode()
  • LedCtrlXYByCode()

The previous "flickering lights" demo used those (because they're faster)...

@Miserlou
Copy link
Author

Miserlou commented Jan 13, 2017

Hm. Well, maybe that's okay.

Using a slightly modified version of the code linked from #8, I can get some lights to show, but I eventually get:

Exception AttributeError: "'NoneType' object has no attribute 'quit'" in <bound method __Midi.__del__ of <launchpad_py.launchpad.__Midi instance at 0x10d718fc8>> ignored

@Miserlou
Copy link
Author

Where in the stack is LedCtrlXYByRGB broken for LP2 on OSX?

@FMMT666
Copy link
Owner

FMMT666 commented Jan 13, 2017

His code was for the Pro, you have the Mk2, right, but
I guess you already changed that to LaunchpadMk2()

Yep, that exit error is known and ugly, but doesn't hurt.
It's just related to another PyGame MIDI issue...

Currently testing a new MIDI lib...

@FMMT666
Copy link
Owner

FMMT666 commented Jan 13, 2017

LedCtrlXYByRGB() also uses system exclusive MIDI messages via LedCtrlRaw().

@FMMT666
Copy link
Owner

FMMT666 commented Apr 10, 2017

Fixed.

@FMMT666 FMMT666 closed this as completed Apr 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants