Skip to content

Commit

Permalink
v0.8.6
Browse files Browse the repository at this point in the history
- Another bugfix in method `meico.mpm.elements.styles.defs.ArticulationDef.articulateNote()` so style switches with no attribute `defaultArticulation` (it is optional) are supported.
  • Loading branch information
axelberndt committed Jun 2, 2020
1 parent 658d25d commit 6922c00
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 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.6
- Another bugfix in method `meico.mpm.elements.styles.defs.ArticulationDef.articulateNote()` so style switches with no attribute `defaultArticulation` (it is optional) are supported.


#### v0.8.5
- New methods in class `meico.mei.Helper`: `pulseDuration2decimal()`, `decimalDuration2HtmlUnicode()`, `durationRemainder2UnicodeDots()`, `accidDecimal2unicodeString()`. These can beused to generate Unicode strings from note value and pitch information.
- Bugfix in method `meico.mei.Mei.makeMovement()`. It checks for the file to be not null before accessing it.
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.5";
public static final String version = "0.8.6";

public static void main(String[] args) {
System.out.println("meico v" + Meico.version);
Expand Down
21 changes: 14 additions & 7 deletions src/meico/mpm/elements/maps/ArticulationMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,19 @@ public void renderArticulationToMap_noMillisecondModifiers(GenericMap map) {
ArrayList<KeyValue<Double, Element>> styleSwitchList = this.getAllElementsOfType("style"); // collect all style switches and put them into the list
for (KeyValue<Double, Element> styleEntry : styleSwitchList) {
ArticulationStyle aStyle = (ArticulationStyle) this.getStyle(Mpm.ARTICULATION_STYLE, Helper.getAttributeValue("name.ref", styleEntry.getValue()));
if (aStyle != null) {
ArticulationDef aDef = aStyle.getArticulationDef(Helper.getAttributeValue("defaultArticulation", styleEntry.getValue()));
if (aDef == null)
System.err.println("Warning: attribute " + Helper.getAttribute("defaultArticulation", this.getXml()).toXML() + " in style element refers to an unknown articulationDef.");
defaultArticulations.add(new KeyValue<>(styleEntry.getKey(), aDef));
if (aStyle == null)
continue;

Attribute defaultArticulationAtt = Helper.getAttribute("defaultArticulation", styleEntry.getValue());
if (defaultArticulationAtt == null) { // if no default articulation is specified (it is optional)
defaultArticulations.add(new KeyValue<>(styleEntry.getKey(), null)); // set the list entry for this date to null so it will not attempt to use the previous entry during rendering from the style's date on
continue;
}

ArticulationDef aDef = aStyle.getArticulationDef(defaultArticulationAtt.getValue());
if (aDef == null)
System.err.println("Warning: attribute " + Helper.getAttribute("defaultArticulation", this.getXml()).toXML() + " in style element refers to an unknown articulationDef.");
defaultArticulations.add(new KeyValue<>(styleEntry.getKey(), aDef));
}

// articulate the map elements
Expand All @@ -420,15 +427,15 @@ public void renderArticulationToMap_noMillisecondModifiers(GenericMap map) {
continue; // go on with the next element

ArrayList<ArticulationData> artics = noteArtics.get(mapEntry.getValue());
if (artics != null) { // apply the articulations to the associated note
if (artics != null) { // apply the articulations (if there is one or more) to the associated note
for (ArticulationData artic : artics) { // each articulation that is associated with this note element
mapTimingChanged |= artic.articulateNote(mapEntry.getValue()); // apply articulation
}
continue;
}

// otherwise apply the default articulation
if (defaultArticulations.isEmpty()) // if we have such data
if (defaultArticulations.isEmpty()) // if we have no such data
continue;

// make sure we use the latest default articulation
Expand Down

0 comments on commit 6922c00

Please sign in to comment.