cemfi / meico

A converter framework with support for MEI, MSM, MPM, MIDI, WAV, MP3, chroma, and XSLT
GNU General Public License v3.0
67 stars 12 forks source link

Portato #24

Closed pfefferniels closed 2 years ago

pfefferniels commented 2 years ago

The combination of legato and staccato should result in a portato articulation.

I achieved this in my local copy by inserting here the following piece of code:

// Check if there is a staccato articulation at the same time. If yes, do not continue 
// with a slur, but insert a portato articulation instead and remove
// the already existing staccato.
ArrayList<KeyValue<Double, Element>> simultaneousElements = map.getAllElementsAt(date);
for (int i=0; i<simultaneousElements.size(); i++) {
  Element otherEl = simultaneousElements.get(i).getValue();
  if (otherEl.getAttribute("name.ref").getValue().equals("stacc")) {
    map.removeElement(otherEl);
    this.addArticulationToMap(date, "port", slurid, noteId, map, articulationStyle);
    return;
  }
}

I'm not really familiar with the way things are being handled in Meico. If this is the way, I'll be happy to do a PR …

axelberndt commented 2 years ago

The rule in MPM is that multiple articulations are successively applied to the note. Depending on how you defined these articulations the result is not necessarily an interpolation. Articulations with absolute modifiers simply overwrite the effect of previous articulations.

Thus, articulation combinations are not reinterpreted as a totally new articulation as this would be, basically, undefined behaviour. The problem is, it is not generalizable. If you wish a combination of articulation signs be interpreted as a different articulation, than you better use a dedicated articulation instruction here (either in your MEI source or later in the MPM) and replace the others with it.

axelberndt commented 2 years ago

After looking into the MEI guidelines, here is my advice: If you wish a note in MEI be performed with a specific articulation that is not unambigously indicated by articulation symbols (the visual information), use the gestural attribute @artic.ges. In the presence of gestural data, meico will ignore the non-gestural counterpart and your MEI-to-MSM/MPM export will do what you wish.

<note dur="4" oct="4" pname="c" artic.ges="portato"/>

Side note: The "portato" value in the above example is not exactly valid MEI code. According to this MEI has no portato. However, meico understands it, see this overview. If you wish to stay MEI-valid, then use "marc"; it is interpreted as a slightly louder portato. Once you have your MPM export you can change its definition in the articulation style.

A general advice: When converting MEI to MPM meico has to use default definitions for articulations, tempo and dynamics instructions. Meico's MEI Coverage Documentation gives you a detailed insight into those. But do not take them as ground truth. Each musical style and genre has its own conventions, not to speak of individual musicians. Editing the style definitions in the MPM output should be common practice when you are deeper into musical performance.