Graphing and Audio connection issues

61 views
Skip to first unread message

John Seales

unread,
Jun 30, 2020, 2:47:41 PM6/30/20
to music21
Hi all -- 

I just installed music21. A couple of things in the first tutorial failed. First, the attempt to play some midi through Quicktime 7. I actually have Quicktime X installed, so maybe that's why. But how do I fix it?

>>> littleMelody.show('midi')
FSPathMakeRef(/Applications/Utilities/QuickTime Player 7.app) failed with error -43.

Also, trying to show a histogram on Preview had a similar error message:

>>> dicant.plot('histogram', 'pitch')

FSPathMakeRef(/Applications/Preview.app) failed with error -43.


I welcome any insight into how to get these things working.  

Torsten Anders

unread,
Feb 27, 2024, 6:54:06 AMFeb 27
to music21
I just ran into a similar problem.

With Python 3.11 on MacOS Ventura 13.4.1 I get the following error message when trying to plot something (I ensured that the variable s in indeed bound to a score):

>>> s.plot("histogram", "pitch")
Unable to revert mtime: /Library/Fonts
The application /Applications/Preview.app cannot be opened for an unexpected reason, error=Error Domain=NSCocoaErrorDomain Code=260 "The file “Preview.app” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///Applications/Preview.app, NSFilePath=/Applications/Preview.app, NSUnderlyingError=0x15af08960 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
<music21.graph.plot.HistogramPitchSpace for <music21.stream.Score 0x105503b90>>


The problem here is that for MacOS Ventura these applications still show in the Finder under /Applications, but they are actually stored in /System/Applications, as can be checked in the terminal.  

$ ls /System/Applications

App Store.app FindMy.app Music.app Siri.app

Automator.app Font Book.app News.app Stickies.app

Books.app Freeform.app Notes.app Stocks.app

Calculator.app Home.app Photo Booth.app System Settings.app

Calendar.app Image Capture.app Photos.app TV.app

Chess.app Launchpad.app Podcasts.app TextEdit.app

Clock.app Mail.app Preview.app Time Machine.app

Contacts.app Maps.app QuickTime Player.app Utilities

Dictionary.app Messages.app Reminders.app VoiceMemos.app

FaceTime.app Mission Control.app Shortcuts.app


So, the question is: how can I update for music21 paths to applications like Preview.app?

Thanks! 

Torsten Anders

unread,
Feb 28, 2024, 6:10:11 AMFeb 28
to music21
Note that the following works on this platform, directly plotting with Python (i.e. Preview.app is not involved).

import matplotlib.pyplot as plt

xs = [1, 2, 1, 2, 1]

plt.hist(xs)
plt.xlabel("weight")
plt.ylabel("count")
plt.show()

Reply all
Reply to author
Forward
0 new messages