Exemplo n.º 1
0
 def _gui_select_ioport(self):
     ioport_names = get_ioport_names()
     for i in range(len(ioport_names)):
         print('%.2i:\t%s' % (i, ioport_names[i]))
     ioport_num = int(input('Enter number of MIDI interface: '))
     try:
         return ioport_names[ioport_num]
     except OSError as errmsg:
         print(errmsg)
Exemplo n.º 2
0
def main():
    if len(sys.argv) > 1:
        portname = sys.argv[1]
    else:
        try:
            portname = next(name for name in mido.get_ioport_names() if name.startswith("APC MINI MIDI"))
        except StopIteration:
            portname = None  # Use default port

    app = ApcMiniApp(light_behaviour=TOGGLE)
    app.open_input(portname)
    app.run()
Exemplo n.º 3
0
        pygame.event.pump()

        if pygame.event.peek():
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    running = False
                if event.type == pygame.KEYDOWN:
                    running = False 

        self.clock.tick(self.fps)
        return running

cb = False

devices = mido.get_ioport_names()
numark_devname = None
print('MIDI devices:')
for device in devices:
    print('* ' + device)
    if device.startswith('Numark Mix Track'):
      print('  Mix Track found!')
      numark_devname = device

if numark_devname is None:
    print("Couldn't find a Mix Track, exiting.")
    exit(1)

# For PC:
opts = pygame.HWSURFACE | pygame.FULLSCREEN | pygame.DOUBLEBUF
# For other
Exemplo n.º 4
0
import mido
from mido import Message as M

m_out = mido.open_ioport(mido.get_ioport_names()[0])

while True:
    for i in m_out.iter_pending():
        print i
Exemplo n.º 5
0
def get_ports():
    return mido.get_ioport_names()