From 45814baa03816ee9a4ffa155591bb20911219d77 Mon Sep 17 00:00:00 2001
From: Reinhold Kainhofer <reinhold@kainhofer.com>
Date: Sat, 17 Jul 2010 16:56:23 +0200
Subject: [PATCH] Also write out the graphic notehead instead of only the
 duration

---
 pae2xml.pl                        | 18 ++++++++++++++++++
 sample_files/Durations-dotted.pae |  7 +++++++
 sample_files/Durations.pae        |  7 +++++++
 3 files changed, 32 insertions(+)
 create mode 100644 sample_files/Durations-dotted.pae
 create mode 100644 sample_files/Durations.pae

diff --git a/pae2xml.pl b/pae2xml.pl
index 6345108..0e8de94 100755
--- a/pae2xml.pl
+++ b/pae2xml.pl
@@ -60,6 +60,7 @@ handle_options ();
 
 $divisions = 960;
 $old_duration = $divisions;
+$old_type = "";
 $old_octave = 4;
 
 ($mday, $mon, $year) = (localtime()) [3..5];
@@ -514,6 +515,9 @@ sub parse_note {
     }
   }
 
+  # Determine graphic notehead:
+  print OUT notehead ($dur, $dot);
+
   print OUT $addition;
 
   my $notationbracket = $fermata || $tienotation || ($trill eq "t") || ($notation ne "");
@@ -568,6 +572,20 @@ sub alter {
   return "";
 }
 
+sub notehead {
+  my ($duration, $dots) = @_;
+  if ($duration.$dots ne "") {
+    my %du=("0", "long", "9", "breve", "1", "whole", "2", "half", "4", "quarter",
+            "8", "eighth", "6", "16th", "3", "32nd", "5", "64th", "7", "128th");
+    my $res = "				<type>$du{$duration}</type>\n";
+    $res .= repeat ("					<dot/>\n", length ($dots));
+    $old_type = $res;
+  }
+  return $old_type;
+}
+
+
+
 sub duration {
   my ($duration, $dots) = @_;
 
diff --git a/sample_files/Durations-dotted.pae b/sample_files/Durations-dotted.pae
new file mode 100644
index 0000000..c2ddfbc
--- /dev/null
+++ b/sample_files/Durations-dotted.pae
@@ -0,0 +1,7 @@
+Test Composer
+Test case for dotted durations
+1.1.1: S dotted durations
+plain&easy: %G-2@8/2$� '1.CD1-/1..CD2-/2.EF2..EF4-2-/4.GA4..GA4...GA6-4.-1-/8.BA8..BA6.DE6..DE3.FG3..FG3.-6.-8.-2.-1.-/1C
+
+Test Library
+00000000
\ No newline at end of file
diff --git a/sample_files/Durations.pae b/sample_files/Durations.pae
new file mode 100644
index 0000000..2dcf303
--- /dev/null
+++ b/sample_files/Durations.pae
@@ -0,0 +1,7 @@
+Test Composer
+Test case for durations
+1.1.1: S durations
+plain&easy: %G-2@8/2$� '1CD2EF4GA8BC6DE3FG5AB7CD5-/1-2-4-8-6-3-5-7--1--/0C/0-/9D-/
+
+Test Library
+00000000
\ No newline at end of file
-- 
GitLab