diff --git a/pae2xml.pl b/pae2xml.pl index 9ac3d5059f0084875777f857d82d2ef5f9ae1310..25efe3ef65ddc34f7e671e9226e783ffd5c2a151 100755 --- a/pae2xml.pl +++ b/pae2xml.pl @@ -519,6 +519,8 @@ sub parse_note { # Determine graphic notehead: print OUT notehead ($dur, $dot); + # If we have an explicit accidental on the note, print the <accidental> tag + print OUT accidental_explicit ($acc); print OUT $addition; @@ -588,6 +590,17 @@ sub alter { return ""; } +sub accidental_explicit { + my ($acc) = @_; + my %accidentals = ("xx", "double-sharp", "x", "sharp", "n", "natural", "b", "flat", "bb", "flat-flat"); + my $this_acc = $accidentals{$acc}; + if ($this_acc) { + return "\t\t\t\t<accidental>$this_acc</accidental>\n"; + } else { + return ""; + } +} + sub notehead { my ($duration, $dots) = @_; if ($duration.$dots ne "") {