Code Monkey home page Code Monkey logo

Comments (5)

mscuthbert avatar mscuthbert commented on July 23, 2024

Priority is higher for title, composer, lower for other information that m21 can handle (except for date uncertainty, etc. which would be a good test of the m21 metadata system that goes beyond MusicXML), and lowest for things that m21 can't currently handle, such as language-specific titles, etc.

from music21.

johnMamish avatar johnMamish commented on July 23, 2024

It looks to me like the problems could originate with HumdrumDataCollection.InsertGlobalEvents(). I see two issues with this function:

  1. parseLines is called twice, so insertGlobalEvents is called twice. The first time, it is called before self.eventList has anything in it. Because self.eventList is empty, insertGlobalEvents can't do anything. The second time it is called, it exits immediately because the self.globalEventsInserted flag has already been set.

  2. While the GlobalEvents may be correctly parsed, they are not correctly inserted into a metadata object by the insertGlobalEvents function. The problem appears to be at line 709 of spineParser.py. The correctly parsed GlobalEvents are not put into a metadata object, they are just shoved into the top level of the score.

I made some quick and gross hacks to fix the above two problems. I tested my code on the bach 371 chorales humdrum repo and it appears to read in the title correctly. With this code, only the title of the humdrum piece is properly read into the metadata, not composer or any other info. These hacks can be found in my forked copy of music21. I just added about 5 lines to insertGlobalEvents(). here is the fix for bullet point 1 here is the fix for bullet point 2

Once you can confirm with me that I'm taking the right approach, I will follow up and add the other info to the metadata.

(apologies for the messed up whitespace in my commit... my emacs is not configured right. If you decide to merge in my changes, I will fix the whitespace.)

from music21.

mscuthbert avatar mscuthbert commented on July 23, 2024

these look like a great approach to the problem. Thank you! Please make a fresh branch off of the master git repository with just these changes and let's start pull request merging. :-) Thanks!

from music21.

johnMamish avatar johnMamish commented on July 23, 2024

Alright, I have a pull request pending from my own fork

I gotta say, your CI system is pretty cool. I didn't know that could be integrated so smoothly with github.

from music21.

mscuthbert avatar mscuthbert commented on July 23, 2024

Hi John! I used your method to get most metadata parsing working from humdrum to music21. I used a slightly different approach, but I'm glad for your code ideas. It's in the commit for today.

Dates are still missing, but now it's easy to add new data. It's all in the GlobalReference object.

Thanks!

from music21.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.