Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update Einsielden Octaves #8

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,281 changes: 3,281 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_024r.mei

Large diffs are not rendered by default.

3,114 changes: 3,114 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_024v.mei

Large diffs are not rendered by default.

3,121 changes: 3,121 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_025v.mei

Large diffs are not rendered by default.

3,237 changes: 3,237 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_026r.mei

Large diffs are not rendered by default.

3,201 changes: 3,201 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_026v.mei

Large diffs are not rendered by default.

3,073 changes: 3,073 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_027v.mei

Large diffs are not rendered by default.

2,819 changes: 2,819 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_028r.mei

Large diffs are not rendered by default.

3,026 changes: 3,026 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_028v.mei

Large diffs are not rendered by default.

3,159 changes: 3,159 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_029v.mei

Large diffs are not rendered by default.

2,859 changes: 2,859 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_030r.mei

Large diffs are not rendered by default.

3,181 changes: 3,181 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_031r.mei

Large diffs are not rendered by default.

3,254 changes: 3,254 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_031v.mei

Large diffs are not rendered by default.

3,259 changes: 3,259 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_032r.mei

Large diffs are not rendered by default.

2,788 changes: 2,788 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_033r.mei

Large diffs are not rendered by default.

3,021 changes: 3,021 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_033v.mei

Large diffs are not rendered by default.

3,118 changes: 3,118 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_034r.mei

Large diffs are not rendered by default.

2,725 changes: 2,725 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_035r.mei

Large diffs are not rendered by default.

3,111 changes: 3,111 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_035v.mei

Large diffs are not rendered by default.

3,103 changes: 3,103 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_036r.mei

Large diffs are not rendered by default.

3,295 changes: 3,295 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_036v.mei

Large diffs are not rendered by default.

3,071 changes: 3,071 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_037v.mei

Large diffs are not rendered by default.

3,073 changes: 3,073 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_038v.mei

Large diffs are not rendered by default.

3,627 changes: 3,627 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_039v.mei

Large diffs are not rendered by default.

3,507 changes: 3,507 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_040r.mei

Large diffs are not rendered by default.

2,890 changes: 2,890 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_042r.mei

Large diffs are not rendered by default.

3,233 changes: 3,233 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_044r.mei

Large diffs are not rendered by default.

3,037 changes: 3,037 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_044v.mei

Large diffs are not rendered by default.

3,185 changes: 3,185 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_046r.mei

Large diffs are not rendered by default.

3,320 changes: 3,320 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_046v.mei

Large diffs are not rendered by default.

3,188 changes: 3,188 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_048r.mei

Large diffs are not rendered by default.

3,493 changes: 3,493 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_048v.mei

Large diffs are not rendered by default.

3,083 changes: 3,083 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_050r.mei

Large diffs are not rendered by default.

3,059 changes: 3,059 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_050v.mei

Large diffs are not rendered by default.

3,335 changes: 3,335 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_052r.mei

Large diffs are not rendered by default.

3,397 changes: 3,397 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_052v.mei

Large diffs are not rendered by default.

3,495 changes: 3,495 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_054r.mei

Large diffs are not rendered by default.

3,344 changes: 3,344 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_054v.mei

Large diffs are not rendered by default.

2,829 changes: 2,829 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_056r.mei

Large diffs are not rendered by default.

3,057 changes: 3,057 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_057v.mei

Large diffs are not rendered by default.

3,201 changes: 3,201 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_058r.mei

Large diffs are not rendered by default.

3,122 changes: 3,122 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_058v.mei

Large diffs are not rendered by default.

2,910 changes: 2,910 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_060r.mei

Large diffs are not rendered by default.

3,101 changes: 3,101 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_060v.mei

Large diffs are not rendered by default.

3,070 changes: 3,070 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_061v.mei

Large diffs are not rendered by default.

3,132 changes: 3,132 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_062r.mei

Large diffs are not rendered by default.

3,031 changes: 3,031 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_062v.mei

Large diffs are not rendered by default.

2,776 changes: 2,776 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_064r.mei

Large diffs are not rendered by default.

3,297 changes: 3,297 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_064v.mei

Large diffs are not rendered by default.

3,015 changes: 3,015 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_066r.mei

Large diffs are not rendered by default.

3,238 changes: 3,238 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_066v.mei

Large diffs are not rendered by default.

2,939 changes: 2,939 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_068r.mei

Large diffs are not rendered by default.

3,091 changes: 3,091 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_070r.mei

Large diffs are not rendered by default.

2,962 changes: 2,962 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_070v.mei

Large diffs are not rendered by default.

2,532 changes: 2,532 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_072r.mei

Large diffs are not rendered by default.

2,819 changes: 2,819 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_072v.mei

Large diffs are not rendered by default.

2,929 changes: 2,929 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_074r.mei

Large diffs are not rendered by default.

3,108 changes: 3,108 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_074v.mei

Large diffs are not rendered by default.

2,975 changes: 2,975 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_076r.mei

Large diffs are not rendered by default.

2,882 changes: 2,882 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_076v.mei

Large diffs are not rendered by default.

3,025 changes: 3,025 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_078r.mei

Large diffs are not rendered by default.

2,904 changes: 2,904 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_078v.mei

Large diffs are not rendered by default.

3,252 changes: 3,252 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_080r.mei

Large diffs are not rendered by default.

2,924 changes: 2,924 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_080v.mei

Large diffs are not rendered by default.

2,905 changes: 2,905 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_082r.mei

Large diffs are not rendered by default.

3,034 changes: 3,034 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_082v.mei

Large diffs are not rendered by default.

2,986 changes: 2,986 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_084r.mei

Large diffs are not rendered by default.

3,008 changes: 3,008 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_084v.mei

Large diffs are not rendered by default.

2,929 changes: 2,929 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_086r.mei

Large diffs are not rendered by default.

2,611 changes: 2,611 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_086v.mei

Large diffs are not rendered by default.

3,077 changes: 3,077 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_088r.mei

Large diffs are not rendered by default.

2,559 changes: 2,559 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_088v.mei

Large diffs are not rendered by default.

3,338 changes: 3,338 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_090r.mei

Large diffs are not rendered by default.

3,460 changes: 3,460 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_090v.mei

Large diffs are not rendered by default.

3,168 changes: 3,168 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_092r.mei

Large diffs are not rendered by default.

3,253 changes: 3,253 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_092v.mei

Large diffs are not rendered by default.

2,962 changes: 2,962 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_094r.mei

Large diffs are not rendered by default.

2,777 changes: 2,777 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_094v.mei

Large diffs are not rendered by default.

2,835 changes: 2,835 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_096r.mei

Large diffs are not rendered by default.

3,571 changes: 3,571 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_096v.mei

Large diffs are not rendered by default.

3,422 changes: 3,422 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_098r.mei

Large diffs are not rendered by default.

3,293 changes: 3,293 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_100r.mei

Large diffs are not rendered by default.

3,266 changes: 3,266 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_102r.mei

Large diffs are not rendered by default.

3,091 changes: 3,091 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_102v.mei

Large diffs are not rendered by default.

3,560 changes: 3,560 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_104r.mei

Large diffs are not rendered by default.

3,488 changes: 3,488 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_106r.mei

Large diffs are not rendered by default.

3,149 changes: 3,149 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_106w.mei

Large diffs are not rendered by default.

3,228 changes: 3,228 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_106x.mei

Large diffs are not rendered by default.

3,144 changes: 3,144 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_108r.mei

Large diffs are not rendered by default.

3,079 changes: 3,079 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_110r.mei

Large diffs are not rendered by default.

3,168 changes: 3,168 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_110v.mei

Large diffs are not rendered by default.

2,843 changes: 2,843 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_112r.mei

Large diffs are not rendered by default.

2,851 changes: 2,851 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_112v.mei

Large diffs are not rendered by default.

3,067 changes: 3,067 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_114r.mei

Large diffs are not rendered by default.

3,125 changes: 3,125 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_114v.mei

Large diffs are not rendered by default.

2,633 changes: 2,633 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_116r.mei

Large diffs are not rendered by default.

2,736 changes: 2,736 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_116v.mei

Large diffs are not rendered by default.

3,166 changes: 3,166 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_118r.mei

Large diffs are not rendered by default.

3,316 changes: 3,316 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_118v.mei

Large diffs are not rendered by default.

3,032 changes: 3,032 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_120r.mei

Large diffs are not rendered by default.

3,483 changes: 3,483 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_120v.mei

Large diffs are not rendered by default.

3,082 changes: 3,082 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_122r.mei

Large diffs are not rendered by default.

2,956 changes: 2,956 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_122v.mei

Large diffs are not rendered by default.

3,300 changes: 3,300 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_124r.mei

Large diffs are not rendered by default.

3,542 changes: 3,542 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_130r.mei

Large diffs are not rendered by default.

3,267 changes: 3,267 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_130v.mei

Large diffs are not rendered by default.

3,521 changes: 3,521 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_131r.mei

Large diffs are not rendered by default.

3,447 changes: 3,447 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_131v.mei

Large diffs are not rendered by default.

3,276 changes: 3,276 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_132r.mei

Large diffs are not rendered by default.

3,101 changes: 3,101 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_133r.mei

Large diffs are not rendered by default.

2,984 changes: 2,984 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_133v.mei

Large diffs are not rendered by default.

3,145 changes: 3,145 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_134v.mei

Large diffs are not rendered by default.

2,839 changes: 2,839 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_135r.mei

Large diffs are not rendered by default.

3,221 changes: 3,221 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_135v.mei

Large diffs are not rendered by default.

3,314 changes: 3,314 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_136r.mei

Large diffs are not rendered by default.

3,803 changes: 3,803 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_136v.mei

Large diffs are not rendered by default.

3,636 changes: 3,636 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_137r.mei

Large diffs are not rendered by default.

3,124 changes: 3,124 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_137v.mei

Large diffs are not rendered by default.

3,156 changes: 3,156 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_137w.mei

Large diffs are not rendered by default.

3,354 changes: 3,354 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_137x.mei

Large diffs are not rendered by default.

3,215 changes: 3,215 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_138r.mei

Large diffs are not rendered by default.

2,758 changes: 2,758 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_140r.mei

Large diffs are not rendered by default.

3,102 changes: 3,102 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_141r.mei

Large diffs are not rendered by default.

3,173 changes: 3,173 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_141v.mei

Large diffs are not rendered by default.

3,093 changes: 3,093 additions & 0 deletions resulting_mei_files/Einsiedeln/Reviewed_once/updated_octave/CH-E_611_142r.mei

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
import custupdate

"""
Updates MEI files in the current directory by incrementing octave values
based on the presence of a clef element with shape="C".

This script iterates over all files in the current directory, checks if the
file is an MEI file (not already updated) and updates it using the
octupdate module. It then prints a message indicating that the file
has been updated.
"""

for mefile in os.listdir("."):
# Get the filename as a string
filename = os.fsdecode(mefile)

# Check if the file is an MEI file and not already updated
if filename.endswith(".mei") and not filename.endswith("NEW.mei"):
# Update the MEI file using the octupdate module
custupdate.main(filename)
# Print a message indicating that the file has been updated
print(filename + " has been updated")
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import lxml.etree as ET

# Register the MEI namespace with the prefix "mei"
#ET.register_namespace("", "http://www.music-encoding.org/ns/mei")

def main(filename):
"""
Modifies an MEI file by updating the octave values of nc elements
based on the presence of a clef element with shape="C".

Parameters:
filename (str): The path to the MEI file to be modified

Returns:
None

The function parses the MEI file, iterates over its elements, and
checks for clef elements with shape="C". When such an element is found,
it sets a flag to True. Then, it iterates over the nc elements and
increments their octave values by 1 if the flag is True. Finally,
it writes the modified XML tree to a new file with the same name
but with "NEW" appended.
"""
# Parse the XML file using ElementTree
tree = ET.parse(filename)
root = tree.getroot()

# Initialize a flag to track whether we've found a clef element with shape="C"
flag = False

# Iterate over all elements in the XML tree
for child in root.iter("*"):
child.tag = ET.QName(child).localname
# Check if the current element is a clef element
if child.tag.endswith("clef"):
# Reset the flag
flag = False

# Check if the "shape" attribute has the value "C"
# If so, set flag to True and add or update the "oct" attribute to "4"
for attr, value in child.attrib.items():

if attr.endswith("shape") and value == "C":
flag = True
child.attrib["dis"] = "8"
child.attrib["dis.place"] = "above"

break

# Check if the current element is an nc element
if child.tag.endswith("custos"):

for attr, value in child.attrib.items():

# Increment the oct value by 1 if flag is true
if attr.endswith("oct") and flag:
oct = int(value) + 1
child.attrib[attr] = str(oct)
break


# Create a new ElementTree instance with the modified root element
new_tree = ET.ElementTree(root)

# Write the modified XML tree to a new file with the same name but with "NEW" appended
new_tree.write(filename[:-4] + "NEW.mei", encoding="utf8", xml_declaration=True)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
import octupdate

"""
Updates MEI files in the current directory by incrementing octave values
based on the presence of a clef element with shape="C".

This script iterates over all files in the current directory, checks if the
file is an MEI file (not already updated) and updates it using the
octupdate module. It then prints a message indicating that the file
has been updated.
"""

for mefile in os.listdir("."):
# Get the filename as a string
filename = os.fsdecode(mefile)

# Check if the file is an MEI file and not already updated
if filename.endswith(".mei") and not filename.endswith("NEW.mei"):
# Update the MEI file using the octupdate module
octupdate.main(filename)
# Print a message indicating that the file has been updated
print(filename + " has been updated")
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import lxml.etree as ET

# Register the MEI namespace with the prefix "mei"
#ET.register_namespace("", "http://www.music-encoding.org/ns/mei")

def main(filename):
"""
Modifies an MEI file by updating the octave values of nc elements
based on the presence of a clef element with shape="C".

Parameters:
filename (str): The path to the MEI file to be modified

Returns:
None

The function parses the MEI file, iterates over its elements, and
checks for clef elements with shape="C". When such an element is found,
it sets a flag to True. Then, it iterates over the nc elements and
increments their octave values by 1 if the flag is True. Finally,
it writes the modified XML tree to a new file with the same name
but with "NEW" appended.
"""
# Parse the XML file using ElementTree
tree = ET.parse(filename)
root = tree.getroot()

# Initialize a flag to track whether we've found a clef element with shape="C"
flag = False

# Iterate over all elements in the XML tree
for child in root.iter("*"):
child.tag = ET.QName(child).localname
# Check if the current element is a clef element
if child.tag.endswith("clef"):
# Reset the flag
flag = False

# Check if the "shape" attribute has the value "C"
# If so, set flag to True and add or update the "oct" attribute to "4"
for attr, value in child.attrib.items():

if attr.endswith("shape") and value == "C":
flag = True
child.attrib["dis"] = "8"
child.attrib["dis.place"] = "above"

break

# Check if the current element is an nc element
if child.tag.endswith("nc"):

for attr, value in child.attrib.items():

# Increment the oct value by 1 if flag is true
if attr.endswith("oct") and flag:
oct = int(value) + 1
child.attrib[attr] = str(oct)
break


# Create a new ElementTree instance with the modified root element
new_tree = ET.ElementTree(root)

# Write the modified XML tree to a new file with the same name but with "NEW" appended
new_tree.write(filename[:-4] + "NEW.mei", encoding="utf8", xml_declaration=True)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import os

"""
Renames MEI files in the current directory to remove the "NEW" prefix.

This script iterates over all files in the current directory, checks if the
file is an MEI file with the "NEW" prefixb and renames it to remove the "NEW" prefix.
"""

for filename in os.listdir("."):
# Check if the file is an MEI file with the "NEW" prefix
if filename.endswith("NEW.mei"):
# Create a new filename without the "NEW" prefix
new_filename = filename.replace("NEW", "")

# Rename the file
os.rename(filename, new_filename)