Trying to send single MIDI packets from Python

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user




[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux