If for any reason we want to translate into a modern notation **kern file (considering all notes as imperfect), unless you want to avoid this conversion and prepare a mei2mens conversion, the code below be used that converts the mensural figures and processed individual dots located just after the note or rests.
End of method Tool_mei2hum::parseLayer:
HumNum starting = starttime;
string dummy;
// drizo - before processing convert mensural dots that appear after a note or rest as attributes
// e.g. <note> .... </note> <dot...>
// is converted into
// <note dots="1">
// end drizo
int nchildren = (int)children.size(); // drizo
bool skipNextDot = false; // drizo
for (int i=0; i<nchildren; i++) {
string nodename = children[i].name();
if (nodename == "note" ||nodename == "rest") { // drizo
skipNextDot = false;// drizo
if (i<nchildren-1 && strcmp(children[i+1].name(), "dot")==0) {// drizo
xml_attribute dotattr = children[i].append_attribute("dots");// drizo
dotattr.set_value("1");// drizo
skipNextDot = true;// drizo
}// drizo
} // drizo
if (nodename == "note") {
starttime = parseNote(children[i], xml_node(NULL), dummy, starttime, 0);
} else if (nodename == "chord") {
starttime = parseChord(children[i], starttime, 0);
} else if (nodename == "rest") {
starttime = parseRest(children[i], starttime);
} else if (nodename == "space") {
starttime = parseRest(children[i], starttime);
} else if (nodename == "mRest") {
starttime = parseMRest(children[i], starttime);
//} else if (nodename == "multiRest") { // drizo
// parseMultiRest(children[i], starttime); // drizo
} else if (nodename == "beam") {
starttime = parseBeam(children[i], starttime);
} else if (nodename == "tuplet") {
starttime = parseTuplet(children[i], starttime);
} else if (nodename == "clef") {
parseClef(children[i], starttime);
} else if (nodename == "meterSig") { // drizo
parseMeterSig(children[i], starttime); // drizo
} else if (nodename == "dot") { // drizo
if (!skipNextDot) {// drizo
cerr << "Dot found after an element other than note or rest" <<
layer.name() << "/" << nodename << CURRLOC << endl;// drizo
}// drizo
skipNextDot = false;// drizo
} else {
cerr << DKHTP << layer.name() << "/" << nodename << CURRLOC << endl;
}
}
When converting from PAEC, Verovio can export mensural notation into files such as:
If for any reason we want to translate into a modern notation **kern file (considering all notes as imperfect), unless you want to avoid this conversion and prepare a mei2mens conversion, the code below be used that converts the mensural figures and processed individual dots located just after the note or rests.
End of method Tool_mei2hum::parseLayer:
And in HumNum Tool_mei2hum::getDuration:
I've added
// drizo
comments just to show the changed lines