pythonmidilaunchpadpyportmidi

Freezing with no error codes using non-standard library


I'm doing some work with a MIDI controller called the Novation Launchpad that has a python module available to import and use.

My code keeps getting stuck on the line LP = launchpad.Launchpad(). So here is how I've attempted to de-bug:

import launchpad
print "I've started"
LP = launchpad.Launchpad()
LP.Open()
print "I worked!"

The programme never prints I've worked so I know my issue is in the creation of the Launchpad instance.

Using a friends laptop we've had no issues. I've had intermittent issues with it working and not working and really don't even know where to start looking!


Solution

  • So, after finding a programme that would run with those commands, it became clear quickly that I hadn't initiated pygame and pygame.midi.

    import pygame, pygame.midi, launchpad
    
    pygame.init()
    pygame.midi.init()
    print "I've started"
    LP = launchpad.Launchpad()
    LP.Open()
    print "I've worked"
    

    Will run just fine.