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

Mei export v2 #347

Merged
merged 15 commits into from
Feb 13, 2024
Merged

Mei export v2 #347

merged 15 commits into from
Feb 13, 2024

Conversation

manoskary
Copy link
Member

MEI export (first simple version)

This method exports mei without full support for all elements as musicxml supports.

  • Necessary to have a single part, or use partitura.merge_parts (maybe can this be changed)
  • It supports clef, roman numerals (only for visualization), notes, grace notes, global elements (Time signature, key signature, cleff, staff)
  • It supports clef changes
  • It supports key and time signature changes only on the beginning of a measure
  • It does not support beams unless a beam element is present.
  • When note ids are available it assigns them otherwise it uses a unique xml:id

@manoskary manoskary added the enhancement New feature or request label Jan 31, 2024
@manoskary manoskary self-assigned this Jan 31, 2024
Copy link
Member

@fosfrancesco fosfrancesco left a comment

Choose a reason for hiding this comment

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

Good job for a first export! I left some comments

partitura/__init__.py Outdated Show resolved Hide resolved
partitura/io/mei_export_v2.py Outdated Show resolved Hide resolved
partitura/io/mei_export_v2.py Outdated Show resolved Hide resolved
with TemporaryDirectory() as tmpdir:
tmp_mei = os.path.join(tmpdir, "test.mei")
save_mei(import_score, tmp_mei)

Copy link
Member

Choose a reason for hiding this comment

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

I approve this way of testing, but I would add at least one extra test with a different more standard score from our musicxml test scores. The EXAMPLE_MEI is somehow a very weird score

Copy link
Member Author

Choose a reason for hiding this comment

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

I had some problems with making more tests in particular I got some conflicts from MEI import. More of them are related to renaming of the IDs during import. Although the note IDs are consistent in the exported MEI, the IDs during the MEI import change based on a namespace variable (self.ns). I will leave it to you if you want to make some changes in the import function.

Copy link
Member Author

Choose a reason for hiding this comment

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

Test is added with commit e108dc9. However, note id checking is omitted.

Copy link
Member

Choose a reason for hiding this comment

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

uhm...ok I will look into that!

@codecov-commenter
Copy link

Codecov Report

Attention: 74 lines in your changes are missing coverage. Please review.

Comparison is base (87585a2) 85.23% compared to head (e108dc9) 84.96%.
Report is 9 commits behind head on develop.

Files Patch % Lines
partitura/io/exportmei.py 70.51% 74 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #347      +/-   ##
===========================================
- Coverage    85.23%   84.96%   -0.27%     
===========================================
  Files           81       82       +1     
  Lines        13921    14236     +315     
===========================================
+ Hits         11865    12096     +231     
- Misses        2056     2140      +84     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@manoskary manoskary merged commit 018f264 into develop Feb 13, 2024
3 checks passed
@manoskary manoskary mentioned this pull request Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants