diff --git a/pae2xml.pl b/pae2xml.pl index 5749a4e0feae05ee47d4917bbea7ce6ec6106bf0..aa23e2f2c392a267e25a1e5c5d7672c2d55da9a1 100755 --- a/pae2xml.pl +++ b/pae2xml.pl @@ -300,17 +300,17 @@ sub parse_notes { } } } - } elsif ($notes =~ /^((g|q)?(\,|\')*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?)(.*)$/) { # a note - ($note, $notes) = ($1,$6); + } elsif ($notes =~ /^((\^)?(g|q)?(\,|\')*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?)(.*)$/) { # a note + ($note, $notes) = ($1,$7); parse_note($note, $keysig, "", "", $qq); } elsif ($notes =~ /^(\((g|q)?(\,|\')*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)[t\+]*\)[t\+]*)(.*)$/) { # one note with a fermata ($note, $notes) = ($1,$6); parse_note($note, $keysig, "", "", $qq); - } elsif ($notes =~ /^(\(((g|q)?(\,|\')*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?){3}\))(.*)$/) { # a triplet - ($triplet, $notes) = ($1,$7); + } elsif ($notes =~ /^(\(((\^)?(g|q)?(\,|\')*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?){3}\))(.*)$/) { # a triplet + ($triplet, $notes) = ($1,$8); # print "TRIPLET: ".$triplet." -> "; - $triplet =~ /^\(((g|q)?(\,|\')*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?)(.*)\)$/gs; - ($note, $triplet) = ($1,$6); + $triplet =~ /^\(((\^)?(g|q)?(\,|\')*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?)(.*)\)$/gs; + ($note, $triplet) = ($1,$7); #print "$note $triplet\n"; parse_note($note, $keysig, '<tuplet type="start"/>', ' <time-modification> <actual-notes>3</actual-notes> @@ -327,8 +327,8 @@ sub parse_notes { <actual-notes>3</actual-notes> <normal-notes>2</normal-notes> </time-modification>', $qq); - } elsif ($notes =~ /^((\d+)\(((g|q)?(\,|\')*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?)+\;(\d+)\))(.*)$/) { # an n-tuplet - ($tuplet, $notes) = ($1,$9); + } elsif ($notes =~ /^((\d+)\(((\^)?(g|q)?(\,|\')*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?)+\;(\d+)\))(.*)$/) { # an n-tuplet + ($tuplet, $notes) = ($1,$10); # print "N-TUPLET: ".$tuplet." -> "; $tuplet =~ /^(\d+)\(((\,|\')*(x|xx|b|bb|n)?\d*\.*(g|q)?(\-|A|B|C|D|E|F|G)t?\+?)(.*);(\d)\)$/gs; ($combdur, $note, $tuplet, $numval) = ($1,$2,$7,$8); @@ -469,8 +469,8 @@ sub parse_note { $fermata = 1; } - $note =~ /^(g|q)?((\,|\')*)(x|xx|b|bb|n)?(\d*)(\.*)(\-|A|B|C|D|E|F|G)(t?)(\+?)$/; - my ($gracecue, $oct, $acc, $dur, $dot, $pitch, $trill, $tie) = ($1, $2, $4, $5, $6, $7, $8, $9); + $note =~ /^(\^)?(g|q)?((\,|\')*)(x|xx|b|bb|n)?(\d*)(\.*)(\-|A|B|C|D|E|F|G)(t?)(\+?)$/; + my ($chord, $gracecue, $oct, $acc, $dur, $dot, $pitch, $trill, $tie) = ($1, $2, $3, $5, $6, $7, $8, $9, $10); print OUT ' <note> '; @@ -485,6 +485,9 @@ sub parse_note { if ($pitch eq "-") { print OUT " <rest />\n"; } else { + if ($chord eq "^") { + print OUT " <chord/>\n"; + } print OUT ' <pitch> <step>'.$pitch.'</step> '.alter($pitch, $acc, $keysig) diff --git a/sample_files/Chords.pae b/sample_files/Chords.pae new file mode 100644 index 0000000000000000000000000000000000000000..1939fe01bd9948730019bbb1806716ab3ae3052f --- /dev/null +++ b/sample_files/Chords.pae @@ -0,0 +1,7 @@ +Test Composer +Test case for chords +1.1.1: S Chords +plain&easy: %G-2@c$� ''2D^'A^xF''C^,G^E// + +Test Library +00000000 \ No newline at end of file