Skip to content
New issue

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

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

Already on GitHub? # to your account

Script to increase c-clef octaves by 1;tested 94r #15

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kyrieb-ekat
Copy link
Contributor

No description provided.

@@ -0,0 +1,2962 @@
<?xml version='1.0' encoding='utf-8'?>
<ns0:mei xmlns:ns0="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the namespace has changed from the original? thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is to do with how ElementTree writes XML, wherein it needs to represent namespace and creates a prefix; in this case ns0 (this is stemming from my very foundational understanding of how this works, so I may be mistaken). If you think its better to hold onto the original, adding something like ET.register_namespace('', 'http://www.music-encoding.org/ns/mei') shouldn't be too tricky? Also might be the wrong way forward, keen to hear your instinct/vibe. I don't believe the altered namespace should alter the validity of the MEI, however.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see now. Yeah, it seems cleaner to just do what was in the original which is have the mei namespace be the default.

@@ -0,0 +1,2962 @@
<?xml version='1.0' encoding='utf-8'?>
<ns0:mei xmlns:ns0="http://www.music-encoding.org/ns/mei" meiversion="5.0.0-dev">
Copy link
Contributor

@dchiller dchiller Feb 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also looks like we lose the schema information that are in the original xml files. See

<?xml-model href="https://music-encoding.org/schema/5.0/mei-all.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://music-encoding.org/schema/5.0/mei-all.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes! Will more explicitly snag the header!

preserves file format
- Fixes file duplication issue in output
- Correctly increases octaves in C-clef sections
- Maintains proper MEI header formatting
- Preserves original XML structure
@kyrieb-ekat
Copy link
Contributor Author

New test is done on 100v, removed other duplicate test files.

@dchiller
Copy link
Contributor

Ok, I think this PR is basically ready to merge. Just a few things:

  1. I think we get rid of the test files.
  2. It looks like the test files have correct octaves on the custodes, but I think that's because you used files where that had previously been updated...so we need this script to also update custodes octaves.
  3. For use on all of these files we should adjust input/output interfaces so we aren't typing each file name.

Happy for you to take these on @kyrieb-ekat, or I can update this PR with them.

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

Successfully merging this pull request may close these issues.

3 participants