Skip to content

Commit

Permalink
v0.8.16
Browse files Browse the repository at this point in the history
- Little tweak in method `meico.mpm.maps.DynamicsMap.renderDynamicsToMap()`: If a `dynamicsMap` does not have a `dynamics` element at date 0.0 but there are `notes` to be performed before the first `dynamics` instruction, they now get a default velocity value.
  • Loading branch information
axelberndt committed Sep 3, 2020
1 parent 091fa6d commit 746d04b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 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.16
- Little tweak in method `meico.mpm.maps.DynamicsMap.renderDynamicsToMap()`: If a `dynamicsMap` does not have a `dynamics` element at date 0.0 but there are `notes` to be performed before the first `dynamics` instruction, they now get a default velocity value.


#### v0.8.15
- Little tweak in method `meico.mei.Mei.processMeasure()` as it struggled to remove and inserting `timeSignature` elements from `timeSignatureMap` when the measure does not comply with the given time signature.
- Indexing correction in method `meico.mpm.elements.styles.defs.AccentuationPatternDef.addAccentuationToArrayList()` so accentuations are added in the correct order to patterns.
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.15";
public static final String version = "0.8.16";

public static void main(String[] args) {
System.out.println("meico v" + Meico.version);
Expand Down
7 changes: 5 additions & 2 deletions src/meico/mpm/elements/maps/DynamicsMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,12 @@ public GenericMap renderDynamicsToMap(GenericMap map) {
// apply dynamics to the map elements' velocity
for (; mapIndex < map.size(); ++mapIndex) { // traverse the map elements
KeyValue<Double, Element> mapEntry = map.elements.get(mapIndex); // get the current map entry
if ((mapEntry.getKey() < dd.startDate) // if this map entry is before the current dynamics
|| !mapEntry.getValue().getLocalName().equals("note")) // or if the map entry is no note element
if (!mapEntry.getValue().getLocalName().equals("note")) // if the map entry is no note element
continue; // leave it unaltered and go on until we are at or after the dynamics' date and it is a note element
if (mapEntry.getKey() < dd.startDate) { // if the map entry is before the current dynamics instruction
mapEntry.getValue().addAttribute(new Attribute("velocity", "100.0")); // create and set attribute velocity at the note element with a default value
continue;
}
if (mapEntry.getKey() >= dd.endDate) // if the current map element is out of the scope of the current dynamics data
break; // stop here and find the next dynamics element first before continuing
mapEntry.getValue().addAttribute(new Attribute("velocity", Double.toString(dd.getDynamicsAt(mapEntry.getKey())))); // create and set attribute velocity at the note element
Expand Down

0 comments on commit 746d04b

Please sign in to comment.