omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Music21 Package

    Pythonista
    4
    12
    7248
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scj643
      scj643 last edited by

      Wondering if it is possible to get http://web.mit.edu/music21/ working in pythonista. Been wanting to process music data in python and have pythonista be part of my music production workflow.

      1 Reply Last reply Reply Quote 0
      • dgelessus
        dgelessus last edited by

        It looks like it's pure Python. Why not try installing it and see if it works for you?

        1 Reply Last reply Reply Quote 0
        • scj643
          scj643 last edited by

          There are a bunch of issues when trying to import it

          1 Reply Last reply Reply Quote 0
          • dgelessus
            dgelessus last edited by

            What exactly? If you get an error message or traceback, please copy and paste it here, otherwise it's a little hard to tell what the problem is. ;)

            1 Reply Last reply Reply Quote 0
            • scj643
              scj643 last edited by

              Traceback (most recent call last):
              File "<string>", line 1, in <module>
              File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/init.py", line 139, in <module>
              from music21 import base
              File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/base.py", line 80, in <module>
              from music21.sites import SitesException
              File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/sites.py", line 19, in <module>
              from music21 import common
              File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/common/init.py", line 45, in <module>
              from music21.common.misc import * # most are deprecated!
              File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/common/misc.py", line 31, in <module>
              import multiprocessing
              ImportError: No module named multiprocessing

              1 Reply Last reply Reply Quote 0
              • scj643
                scj643 last edited by

                Multiprocessing is supposed to be in the standard library iirc

                1 Reply Last reply Reply Quote 0
                • omz
                  omz last edited by

                  @scj643 multiprocessing isn't supported in Pythonista because iOS apps can't spawn child processes (App Store / sandboxing rules). I'm not sure how much music21 actually depends on it. You may be able to fake it by putting an empty multiprocessing.py file in the site-packages folder...

                  1 Reply Last reply Reply Quote 0
                  • dgelessus
                    dgelessus last edited by

                    I only looked at the music21 source code very briefly, but apparently it supports multiple "backends" for the work it does, and one of them uses multiprocessing. As @omz said, it might be enough to put a fake multiprocessing.py into site-packages (or download the real one from the Python Mercurial repo). You might need to check how you can switch the backend, the multiprocessing one might be the default.

                    @omz Since you've already included subprocess even though it can't be used, wouldn't it make sense to also include the other standard modules that depend on forking? Then importing them will work at least.

                    1 Reply Last reply Reply Quote 0
                    • scj643
                      scj643 last edited by

                      adding a fake multiprocessing then reveals a new issue

                      Traceback (most recent call last):
                      File "<string>", line 1, in <module>
                      File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/init.py", line 139, in <module>
                      from music21 import base
                      File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/base.py", line 76, in <module>
                      from music21 import exceptions21
                      ImportError: cannot import name exceptions21猀

                      1 Reply Last reply Reply Quote 0
                      • omz
                        omz last edited by

                        @scj643 I haven't tried this, but what's with the '猀' character at the end there? Was that actually in the traceback?

                        Webmaster4o 1 Reply Last reply Reply Quote 0
                        • Webmaster4o
                          Webmaster4o @omz last edited by

                          @omz Doubt it, because that's not in the line before.

                          1 Reply Last reply Reply Quote 0
                          • scj643
                            scj643 last edited by

                            New trace back error log

                            Traceback (most recent call last):
                            File "<string>", line 1, in <module>
                            File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/init.py", line 167, in <module>
                            from music21 import * # @UnresolvedImport # pylint: disable=wildcard-import
                            File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/abcFormat/init.py", line 47, in <module>
                            from music21.abcFormat import translate
                            File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/abcFormat/translate.py", line 32, in <module>
                            from music21 import stream
                            File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/stream/init.py", line 44, in <module>
                            from music21 import metadata
                            File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/metadata/init.py", line 51, in <module>
                            from music21.metadata import caching
                            File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/metadata/caching.py", line 414, in <module>
                            class WorkerProcess(multiprocessing.Process): # @UndefinedVariable pylint: disable=inherit-non-class
                            AttributeError: 'module' object has no attribute 'Process'

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Powered by NodeBB Forums | Contributors