Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #17002 > unrolled thread

Outputting raw MIDI in realtime on Linux

Started byNick Irvine <nfirvine@nfirvine.com>
First post2011-12-11 18:14 -0800
Last post2011-12-13 09:53 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Outputting raw MIDI in realtime on Linux Nick Irvine <nfirvine@nfirvine.com> - 2011-12-11 18:14 -0800
    Re: Outputting raw MIDI in realtime on Linux alex23 <wuwei23@gmail.com> - 2011-12-11 19:17 -0800
      Re: Outputting raw MIDI in realtime on Linux Peter Billam <peter@www.pjb.com.au> - 2011-12-13 09:53 +0000

#17002 — Outputting raw MIDI in realtime on Linux

FromNick Irvine <nfirvine@nfirvine.com>
Date2011-12-11 18:14 -0800
SubjectOutputting raw MIDI in realtime on Linux
Message-ID<77fe6b9f-b148-4855-b238-9089678908de@n22g2000prh.googlegroups.com>
I'm trying to output raw, realtime MIDI data (as in note on, note off,
etc) in Linux from Python, and I want the easiest way to do it.  I've
been banging my head on the wall about this for quite some time.  The
reason for this is to reinvent the old vkeybd application, but it's
just me screwing around, so not worth the time doing it in C or
creating a whole whack of supporting libraries.

What I have so far is vkeybd outputting to Qsynth (via an ALSA
VirMidi) to pulseaudio, playing some lovely grand piano.  I want to
replace vkeybd with a Python program of my own design.  Using Qsynth's
Messages window, I can monitor the rawish MIDI signals flowing.

According to http://www.tldp.org/HOWTO/MIDI-HOWTO-10.html , I should
be able to just dump MIDI bytes into /dev/snd/midiC3D0.  However, this
yields nothing: Qsynth does not show receiving it.  I even tried this
C example from the OSS docs, with the same result:

http://manuals.opensound.com/developer/midi.c.html

(I updated the /dev line.)

What do people use to output live MIDI on Linux, assuming it's
possible?

Thanks,
Nick Irvine

[toc] | [next] | [standalone]


#17003

Fromalex23 <wuwei23@gmail.com>
Date2011-12-11 19:17 -0800
Message-ID<1683c805-7e4a-4ab4-8b6b-e825b09a9252@v24g2000prn.googlegroups.com>
In reply to#17002
On Dec 12, 12:14 pm, Nick Irvine <nfirv...@nfirvine.com> wrote:
> What do people use to output live MIDI on Linux, assuming it's
> possible?

Hey Nick,

I've yet to try this myself although it's long been on my to-do list.

There are a couple of packages on PyPI that emit MIDI:
http://pypi.python.org/pypi?%3Aaction=search&term=midi

There is also an older project that provides a basic midi step
sequencer. I can't find a proper package or installer, but you might
find something useful in the 'midi_functions.py' file here:
http://www.akjmusic.com/software/

[toc] | [prev] | [next] | [standalone]


#17115

FromPeter Billam <peter@www.pjb.com.au>
Date2011-12-13 09:53 +0000
Message-ID<slrnjee84r.7a5.peter@box8.pjb.com.au>
In reply to#17003
On 2011-12-12, alex23 <wuwei23@gmail.com> wrote:
> On Dec 12, 12:14 pm, Nick Irvine <nfirv...@nfirvine.com> wrote:
>> What do people use to output live MIDI on Linux, assuming it's
>> possible?
> I've yet to try this myself although it's long been on my to-do list.
> There are a couple of packages on PyPI that emit MIDI:
> http://pypi.python.org/pypi?%3Aaction=search&term=midi

Check out
  http://www.pjb.com.au/midi/index.html
  http://www.pjb.com.au/midi/MIDI.html
but what you _really_ want is Patricio Paez' alsaseq and alsamidi
   http://pp.com.mx/python/alsaseq
which I translated into Lua and Perl:
  http://www.pjb.com.au/comp/lua/midialsa.html
  http://search.cpan.org/perldoc?MIDI::ALSA
although by now my translations have developed slightly
more features and fewer quirks than the original...

Hope this helps,
Peter

-- 
Peter Billam    www.pjb.com.au    www.pjb.com.au/comp/contact.html

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web