[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pygame.midi not working on Ubuntu Jaunty?



Hi,

The instructions I found for Timidity, http://koti.mbnet.fi/bstrom/filedata/en/my-timidity-howto.html, claim that the Alsa virtual midi port module must also be installed:

modprobe vir_midi

With it in place and the Timidity virtual server started I get this listing from pygame.examples.midi:

~$ python -m pygame.examples.midi --list
0: interface :ALSA:, name :Midi Through Port-0:, opened :0:  (output)
1: interface :ALSA:, name :Midi Through Port-0:, opened :0:  (input)
2: interface :ALSA:, name :VirMIDI 1-0:, opened :0:  (output)
3: interface :ALSA:, name :VirMIDI 1-0:, opened :0:  (input)
4: interface :ALSA:, name :VirMIDI 1-1:, opened :0:  (output)
5: interface :ALSA:, name :VirMIDI 1-1:, opened :0:  (input)
6: interface :ALSA:, name :VirMIDI 1-2:, opened :0:  (output)
7: interface :ALSA:, name :VirMIDI 1-2:, opened :0:  (input)
8: interface :ALSA:, name :VirMIDI 1-3:, opened :0:  (output)
9: interface :ALSA:, name :VirMIDI 1-3:, opened :0:  (input)
10: interface :ALSA:, name :TiMidity port 0:, opened :0:  (output)
11: interface :ALSA:, name :TiMidity port 1:, opened :0:  (output)
12: interface :ALSA:, name :TiMidity port 2:, opened :0:  (output)
13: interface :ALSA:, name :TiMidity port 3:, opened :0:  (output)

I tried it with port 10 and it works, though sounds lousy on my slow machine. With some Timidity tweaks for interactive playback the sound becomes better.

Lenard Lindstrom


Gary Bishop wrote:
More details on what I am seeing:

$ pmidi -l
 Port     Client name                       Port name
 14:0     Midi Through                      Midi Through Port-0
128:0     TiMidity                          TiMidity port 0
128:1     TiMidity                          TiMidity port 1
128:2     TiMidity                          TiMidity port 2
128:3     TiMidity                          TiMidity port 3

pmidi shows I have midi ports.

$ vkeybd --addr 128:0

Works and sounds fine.

$ python midi.py --list
 0: interface :ALSA:, name :Midi Through Port-0:, opened :0:  (output)
 1: interface :ALSA:, name :Midi Through Port-0:, opened :0:  (input)
 2: interface :ALSA:, name :TiMidity port 0:, opened :0:  (output)
 3: interface :ALSA:, name :TiMidity port 1:, opened :0:  (output)
 4: interface :ALSA:, name :TiMidity port 2:, opened :0:  (output)
 5: interface :ALSA:, name :TiMidity port 3:, opened :0:  (output)

The pygame midi test can see all the midi ports.

$ python midi.py --output 2
 0: interface :ALSA:, name :Midi Through Port-0:, opened :0:  (output)
 1: interface :ALSA:, name :Midi Through Port-0:, opened :0:  (input)
 2: interface :ALSA:, name :TiMidity port 0:, opened :0:  (output)
 3: interface :ALSA:, name :TiMidity port 1:, opened :0:  (output)
 4: interface :ALSA:, name :TiMidity port 2:, opened :0:  (output)
 5: interface :ALSA:, name :TiMidity port 3:, opened :0:  (output)
using output_id :2:

Running midi.py with --output 2 looks great but no sound.

Still looking for ideas.
Thanks
gb



Gary Bishop wrote:
Yes, timidity is in the list and as I said, works fine from the vkeybd app connects to it and works fine.
gb

Lenard Lindstrom wrote:
Gary Bishop wrote:
I'm trying out the new pygame.midi on Ubuntu Jaunty. I'm running
examples/midi.py in output mode on Python 2.6.2 with pygame 1.9.1 built from source without errors. portmidi and porttime were found during the
build.

The vkeybd app works so I know midi output (timidity) works fine.

examples/midi.py displays properly and does not produce any error
messages but it produces no sound.

Any ideas?

Thanks
gb

Hi Gary,

Try the --list option on examples/midi.py to see if a virtual timidity output port is present. Getting some form of midi working with alsa is a hassel.

Lenard Lindstrom