2

i'm a newbie with Raspberry PI (my model is B+). I'm tryng to write a script in python that read a midi file and switch on/off leds... My code for reading midi file is this one:

import mido
output = mido.open_output()
from mido import MidiFile

mid = MidiFile('stan.mid')

for message in MidiFile(mid).play():
    output.send(message)

but when i execute the script i have this error:

OSError: libportmidi.so: cannot open shared object file: No such file or directory

looking into raspberry i find the library into /user/lib folder under libportmidi.so.0 name.

What's wrong??

mpromonet
  • 1,124
  • 1
  • 19
  • 38
ntrax
  • 121
  • 1
  • 2

2 Answers2

2

Try to sim link to the .0 copy of the library.

sudo ln -s /usr/lib/libportmidi.so.0 /usr/lib/libportmidi.so

user33384
  • 21
  • 2
2

I had similar problems using mido on Ubuntu. Just fixing the symbolic link 'libportmidi.so' ws not sufficient. Removing Timidity++ and re-installing plain old Timidity fixed it for me.

By the way, 'mido' really is a bona fide quality python package with good documentation available form the 'site formerly known as the cheese shop'. see:

https://pypi.python.org/pypi/mido/1.1.14

I can provide samples on how I got mido working for my own purposes on request.