Skip to content

Commit

Permalink
v0.8.11
Browse files Browse the repository at this point in the history
- Another bugfix: The `endid` of MEI `tie` elements was not properly resolved.
  • Loading branch information
axelberndt committed Jul 9, 2020
1 parent ea037cd commit c5aa61b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
4 changes: 4 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
### Version History


#### v0.8.11
- Another bugfix: The `endid` of MEI `tie` elements was not properly resolved.


#### v0.8.10
- Bugfix: If an MEI `space` element was in a `layer` environment, it was falsely interpreted as textual gap. However, it is a musical gap and should be interpreted as rest.

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.8.10";
public static final String version = "0.8.11";

public static void main(String[] args) {
System.out.println("meico v" + Meico.version);
Expand Down
4 changes: 2 additions & 2 deletions src/meico/mei/Helper.java
Original file line number Diff line number Diff line change
Expand Up @@ -915,15 +915,15 @@ private int getTie(String id) {
protected void checkTies(Element e) {
String id = "#" + Helper.getAttributeValue("id", e); // get id of the current element
for (int j = this.getTie(id); j >= 0; j = this.getTie(id)) { // find all pending elements in the ties list to be finished at this element
Attribute a = this.ties.get(j).getAttribute("tie"); // get its tie attribute if it has one
Attribute a = e.getAttribute("tie"); // get its tie attribute if it has one
if (a != null) { // if the note has already a tie attribute
if (a.getValue().equals("i")) // but it says that the tie is initial
a.setValue("m"); // make an intermediate tie out of it
else if (a.getValue().equals("n")) // but it says "no tie"
a.setValue("t"); // make a terminal tie out of it
}
else { // otherwise the element had no tie attribute
this.ties.get(j).addAttribute(new Attribute("tie", "t")); // hence, we add a terminal tie attribute
e.addAttribute(new Attribute("tie", "t")); // hence, we add a terminal tie attribute
}
this.ties.remove(j); // remove element from list, it is finished
}
Expand Down
19 changes: 17 additions & 2 deletions src/meico/mei/Mei.java
Original file line number Diff line number Diff line change
Expand Up @@ -2671,8 +2671,23 @@ else if (a.getValue().equals("n")) // but it says "no tie"
note.addAttribute(new Attribute("tie", "i")); // hence, we add an initial tie attribute
}

this.helper.ties.add(tie); // add the tie to the ties list
}
this.helper.ties.add(tie); // add the tie to the ties list
}

// // find the endid note and set its tie attribute
// note = this.helper.allNotesAndChords.get(tie.getAttributeValue("endid").trim().replace("#", ""));
// if (note != null) {
// Attribute a = note.getAttribute("tie"); // get its tie attribute if it has one
// if (a != null) { // if the note has already a tie attribute
// if (a.getValue().equals("i")) // but it says that the tie starts here
// a.setValue("m"); // make an intermediate tie out of it
// else if (a.getValue().equals("n")) // but it says "no tie"
// a.setValue("t"); // make a terminal tie out of it
// }
// else { // otherwise the element had no tie attribute
// note.addAttribute(new Attribute("tie", "t")); // hence, we add an terminal tie attribute
// }
// }
}

/**
Expand Down

0 comments on commit c5aa61b

Please sign in to comment.