Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDI support on macOS 10.15 Catalina #20

Open
Dyddye opened this issue Jan 6, 2020 · 4 comments
Open

MIDI support on macOS 10.15 Catalina #20

Dyddye opened this issue Jan 6, 2020 · 4 comments

Comments

@Dyddye
Copy link

Dyddye commented Jan 6, 2020

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

@jwdj
Copy link
Owner

jwdj commented Jan 18, 2020 via email

@n9yty
Copy link

n9yty commented Feb 18, 2020

I am trying to look into seeing if I can help with this, but can not find a copy of the pythonmidi package. The link in the readme is not working, is there another source?

@aberg001
Copy link

I also would like to help with a working Catalina version, if possible.

@aupfred
Copy link
Contributor

aupfred commented Jan 1, 2021

Hi,
For info, I had some issue with fluidynth on my Mac. With Pygame I could not make the tempo slider taken into account while playing and was difficult to set up also the progress bar.
So I tried another mechanism that could work also on other platforms however only tested on Catalina so I've activated only on Mac.
This is available here: https://github.com/aupfred/EasyABC/tree/playback-mac-mplay
And I've been using the following: https://github.com/jheinen/mplay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants