Skip to content

Commit

Permalink
v0.9.1
Browse files Browse the repository at this point in the history
- Some minor preparations in class `meico.mei.Mei2MusicXmlConverter` for MEI to MusicXML conversion.
  • Loading branch information
axelberndt committed Jun 14, 2024
1 parent 63d4596 commit e221db5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
### Version History


#### v0.9.1
- Some minor preparations in class `meico.mei.Mei2MusicXmlConverter` for MEI to MusicXML conversion.

#### v0.9.0
- Added basic MusicXML integration to meico and meicoApp. Both MusicXML file formats, raw (`.musicxml`, `.xml`) and compressed (`.mxl`) are supported for reading and writing.
- While the ProxyMusic framework does not support marshalling and demarshalling of MusicXML `score-timewise`, class `meico.musicxml.MusicXml` supports conversion of `score-timewise` to `score-partwise` and vice versa.
Expand Down
2 changes: 1 addition & 1 deletion src/meico/Meico.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author Axel Berndt
*/
public class Meico {
public static final String version = "0.9.0";
public static final String version = "0.9.1";

public static void main(String[] args) {
System.out.println("meico v" + Meico.version);
Expand Down
17 changes: 13 additions & 4 deletions src/meico/mei/Mei2MusicXmlConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
public class Mei2MusicXmlConverter {
private Mei mei = null; // the MEI to be converted
private boolean ignoreExpansions = false; // set this true to have a 1:1 conversion of MEI to MSM without the rearrangement that MEI's expansion elements produce
private boolean ignoreExpansions = false; // set this true to have a 1:1 conversion of MEI to MusicXML without the rearrangement that MEI's expansion elements produce

/**
* constructor
Expand All @@ -27,7 +27,7 @@ public Mei2MusicXmlConverter(boolean ignoreExpansions) {

/**
* start the conversion process
* @param mei
* @param mei the Mei object to be converted
* @return
*/
public List<MusicXml> convert(Mei mei) {
Expand All @@ -45,9 +45,18 @@ public List<MusicXml> convert(Mei mei) {

LinkedList<MusicXml> out = new LinkedList<>();

// TODO ...
System.err.println("MEI to MusicXML conversion is not yet implemented.");
// TODO: convert Mei header

// convert Mei music
if (this.mei.isEmpty() || (this.mei.getMusic() == null) || (this.mei.getMusic().getFirstChildElement("body", this.mei.getMusic().getNamespaceURI()) == null)) // if no mei music data available
return out;

this.mei.resolveCopyofsAndSameas(); // replace the slacker elements with copyof and sameas attributes by copies of the referred elements
if (!this.ignoreExpansions) this.mei.resolveExpansions(); // if expansions should be realized, render expansion elements in the MEI score to a "through-composed"/regularized score without expansions

// TODO: convert Mei music

System.err.println("MEI to MusicXML conversion is not yet implemented.");

// cleanup
this.mei.setDocument(orig); // restore the unaltered version of the mei data
Expand Down

0 comments on commit e221db5

Please sign in to comment.