[Alsa-user] Trying to send single MIDI packets from Python
Brought to you by:
perex
From: David P. <da...@ze...> - 2013-12-27 09:56:13
|
As per the subject I'm attempting to send single packets to, actually, a Novation Launchpad S. So not something that conveniently makes a noise when it receives a packet but, in theory, it can make it's switches light up. (http://global.novationmusic.com/support/downloads/launchpad-programmers-reference-guide) I'm using the pyalsa wrappers (https://pypi.python.org/pypi/pyalsa) and can find the cid and pid just fine. What I can't get to work is anything else: > cid, pid = findmidiport() > event = alsaseq.SeqEvent(alsaseq.SEQ_EVENT_NOTEON, alsaseq.SEQ_TIME_STAMP_REAL, alsaseq.SEQ_TIME_MODE_REL) > event.dest = (cid, pid) > event.queue = alsaseq.SEQ_QUEUE_DIRECT > event.set_data({'note.note': 0x70, 'note.velocity': 0x3c}) > > sequencer.output_event(event) > sequencer.drain_output() It runs and nothing happens on the Launchpad. Is this code actually working? I was using a sniffer (one of the command line alsa apps but I can't remember which, sorry) but it didn't seem to show anything outgoing. Am I missing the point here? Thanks, Dave |