Skip to content

Commit

Permalink
v0.8.2
Browse files Browse the repository at this point in the history
- Bugfix in class `meico.msm.Msm`: If the MSM provided a `programChangeMap` for each `part`, only the first was correctly rendered to MIDI. This has been fixed.
  • Loading branch information
axelberndt committed Apr 20, 2020
1 parent 33107d0 commit 5081df9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 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.2
- Bugfix in class `meico.msm.Msm`: If the MSM provided a `programChangeMap` for each `part`, only the first was correctly rendered to MIDI. This has been fixed.


#### v0.8.1
- New functionality added to class `meico.msm.Msm`: method `addIds()` adds `xml:id` to each `note` and `rest` element that does not have one. MeicoApp has been updated accordingly.

Expand Down
4 changes: 2 additions & 2 deletions src/meico/Meico.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package meico;

/**
* This class provides the current version number of meico and a convenient way to launch meico's desktop application.
* This class provides the current version number of meico.
* @author Axel Berndt
*/
public class Meico {
public static final String version = "0.8.1";
public static final String version = "0.8.2";

public static void main(String[] args) {
System.out.println("meico v" + Meico.version);
Expand Down
12 changes: 8 additions & 4 deletions src/meico/msm/Msm.java
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,12 @@ private Midi renderMidi(double bpm, boolean generateProgramChanges, boolean expo
track.add(channelPrefix); // add the event to the track

// parse the score, keySignatureMap, timeSignatureMap, markerMap to midi
if (generateProgramChanges)
generateProgramChanges = !this.parseProgramChangeMap(part, track, chan, exportExpressiveMidi);
this.processPartName(part, track, chan, generateProgramChanges); // scan the part attribute name for a known string to create a gm program change and instrument name event ... but only if there is no programChangeMap providing an initial program change number
boolean reallyGenerateProgramChanges = generateProgramChanges;
if (reallyGenerateProgramChanges) {
reallyGenerateProgramChanges = !this.parseProgramChangeMap(part, track, chan, exportExpressiveMidi);
}
this.processPartName(part, track, chan, reallyGenerateProgramChanges); // scan the part attribute name for a known string to create a gm program change and instrument name event ... but only if there is no programChangeMap providing an initial program change number


// if there are local meta events to be generated
this.parseKeySignatureMap(part, track, exportExpressiveMidi); // parse keySignatureMap
Expand Down Expand Up @@ -916,8 +919,9 @@ private void processPartName(Element part, Track track, short channel, boolean g

String name = part.getAttributeValue("name");

if (generateProgramChanges)
if (generateProgramChanges) {
track.add(EventMaker.createProgramChange(channel, 0, name)); // add program change event
}
track.add(EventMaker.createTrackName(0, name)); // add track name event to the track
}

Expand Down

0 comments on commit 5081df9

Please sign in to comment.