Skip to content

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

Open
kyrieb-ekat wants to merge 4 commits into
mainfrom
octave_updates
Open

Script to increase c-clef octaves by 1;tested 94r#15
kyrieb-ekat wants to merge 4 commits into
mainfrom
octave_updates

Conversation

@kyrieb-ekat

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread update_octave.py Outdated
@@ -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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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">

@dchiller dchiller Feb 12, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@dchiller

Copy link
Copy Markdown
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.

@kyrieb-ekat

Copy link
Copy Markdown
Contributor Author

I think we get rid of the test files.
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.
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.

If it's okay for this to take a moment (~during/after reading week), I'm happy to do this, otherwise if you have the bandwidth and also there's a want to get this up quickly/over and done with, just let me know how I can assist!

Re: custodes, I reckon that the manually changed files are also the files which had dis= and dis.place edits, which should help in at least finding all of them? An option which would need a little poking around, but would accelerate testing what we have or otherwise looping through those to knock everything out. Regardless, even without a specific search, shouldn't be a problem, I think.

@dchiller

Copy link
Copy Markdown
Contributor

Ok, I don't think it's a critical rush? So I will feel empowered but not obligated to take a crack at it if I find myself with downtime

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

Successfully merging this pull request may close these issues.

3 participants