EasyABC
EasyABC copied to clipboard
MIDI support on macOS 10.15 Catalina
It looks like playing MIDI isn't working on macOS 10.15 (Catalina) anymore. Everything was fine until macOS 10.14. I think, the problem is, that QuickTime itself doesn't support MIDI anymore, which is set as default backend for WxMediaPlayer. At least I couldn't open any MIDI file with QuickTime, but with VLC for example. I made some local tests with pygame.mixer, which were sucessful.
You have to create a MIDI device on macOS according to this guide: https://stackoverflow.com/a/49543687
Then you can use pygame like this:
import pygame.midi as pypm
import pygame.mixer
pypm.init()
pygame.mixer.init()
pygame.mixer.load("PATH_TO_MIDI")
pygame.mixer.play()
pygame.mixer.stop()
Maybe you can create another backend out of this.
To fix the errors to show the MIDI settings dialog, I had to change:
diff --git a/easy_abc.py b/easy_abc.py
index cf979f8..98200b9 100644
--- a/easy_abc.py
+++ b/easy_abc.py
@@ -2724,11 +2724,11 @@ class MidiSettingsFrame(wx.Dialog):
outputDevices = [_('None')]
outputDeviceIDs = [None]
if 'pypm' in globals():
- n = pypm.CountDevices()
+ n = pypm.get_count()
else:
n = 0
for i in range(n):
- interface, name, input, output, opened = pypm.GetDeviceInfo(i)
+ interface, name, input, output, opened = pypm.get_device_info(i)
if input:
inputDevices.append(name)
inputDeviceIDs.append(i)
macOS 10.15 Catalina Python 2.7.17 pygame 1.9.6