"PortMidi: `Bad pointer'" when closing mido port

655 views Asked by At

My code:

import mido
import time

mido.set_backend('mido.backends.pygame')

output = mido.open_output()
output.send(mido.Message('note_on', note=64, velocity=60))
time.sleep(3)
output.close()

After the last line, the following error is printed:

Exception Exception: "PortMidi: `Bad pointer'" in <pypm.Output object at 0x025FF0B0> ignored

Apart from that, everything seems to work fine. However I'm developing a console app and this output is annoying. How can I get rid of this error?

I am using Windows 7 and Python 2.7.

1

There are 1 answers

0
hfmanson On

You don't even have to set the RtMidi backend as it is the default, see mido backend documentation