SpotlightKid / python-rtmidi

Python bindings for the cross-platform MIDI I/O library RtMidi
https://spotlightkid.github.io/python-rtmidi/
Other
358 stars 65 forks source link

No MIDI ports (input and output) for built-in devices are found on Mac #101

Closed AntonM030481 closed 3 years ago

AntonM030481 commented 3 years ago

/tests/test_rtmidi.py

Probe ports using the macOS (OS X) CoreMIDI API? (Y/n) y No MIDI input ports found. No MIDI output ports found.

MacOS Catalina 10.15.7 at Macbook Pro. Built-In Microphone and Output are ignored.


If IAC Driver is used according to this: https://support.apple.com/guide/audio-midi-setup/transfer-midi-information-between-apps-ams1013/3.5/mac/10.15 output ports are found, but no sound using it (according to Apple listening app is needed)

/examples/basic/midiout.py

DEBUG:rtmidi.midiutil:Creating MidiOut object. Do you want to create a virtual MIDI output port? (y/N) n Available MIDI ports: [0] IAC Driver Bus 1

Select MIDI output port (Control-C to exit): 0 INFO:rtmidi.midiutil:Opening MIDI output port #0 (IAC Driver Bus 1). Sending NoteOn event. Sending NoteOff event. Exit.

SpotlightKid commented 3 years ago

Did you compile python-rtmidi yourself?

Please check that rtmidi.get_compiled_api() returns at least rtmidi.API_MACOSX_CORE.

SpotlightKid commented 3 years ago

Built-In Microphone and Output are ignored.

These are not MIDI interfaces.

AntonM030481 commented 3 years ago

Did you compile python-rtmidi yourself?

Please check that rtmidi.get_compiled_api() returns at least rtmidi.API_MACOSX_CORE.

No, I didn't compile it by myself. rtmidi.get_compiled_api() [1]

SpotlightKid commented 3 years ago

So, which MIDI interface do you expect to be listed? Which MIDI interfaces do you have connected (or defined in the Audio and MIDI connections configuration)?

AntonM030481 commented 3 years ago

I am newbie in MIDI world. Looks like described behaviour (no ports if no physical MIDI devices) is OK for MacOS. I found an answer here: https://stackoverflow.com/questions/58191627/no-sound-from-midi-program-in-python-on-mac VMPK solved an issue for me. Output port appeared and produces sound.

SpotlightKid commented 3 years ago

Yes, macOS has no built-in MIDI instruments. You either need to connect a hardware MIDI interface, define a virtual MIDI interface in the Audio and MIDI settings or run a program, e.g. software synthesizer, which has MIDI input ports. Alternatively, you can create virtual MIDI output ports in python-rtmidi, which you can then connect to other MIDI input ports by other means.