Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pae2xml
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kainhofer
pae2xml
Commits
f7514785
Commit
f7514785
authored
14 years ago
by
Reinhold Kainhofer
Browse files
Options
Downloads
Patches
Plain Diff
Fix acciaccatura: Use slash, eigth note; general input order, etc.
parent
d9546686
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pae2xml.pl
+18
-13
18 additions, 13 deletions
pae2xml.pl
sample_files/Grace-acciaccatura.pae
+7
-0
7 additions, 0 deletions
sample_files/Grace-acciaccatura.pae
with
25 additions
and
13 deletions
pae2xml.pl
+
18
−
13
View file @
f7514785
...
...
@@ -253,6 +253,7 @@ sub parse_notes {
$notes
=~
s/(\.|\d|\,|\')qq/qq$1/gs
;
# pull beginning mark of group of grace notes in front of corresponding notes
$notes
=~
s/(xx|x|bb|b|n)qq/qq$1/gs
;
# qq first, then parts of notes
$notes
=~
s/([\.\d,'xbn])+(q|g)/$2$1/gs
;
# q and g first, then parts of notes
while
(
$notes
ne
"")
{
if
(
$notes
=~
/^(\'+|\,+)(.*)$/
)
{
# Octave marks
...
...
@@ -299,23 +300,23 @@ sub parse_notes {
}
}
}
} elsif ($notes =~ /^((\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(
g|q)?(
\-|A|B|C|D|E|F|G)t?\+?)(.*)$/) { # a note
} elsif ($notes =~ /^((
g|q)?(
\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?)(.*)$/) { # a note
($note, $notes) = ($1,$6);
parse_note($note, $keysig, "", "", $qq);
} elsif ($notes =~ /^(\((\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(
g|q)?(
\-|A|B|C|D|E|F|G)[t\+]*\)[t\+]*)(.*)$/) { # one note with a fermata
} 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 =~ /^(\(((\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(
g|q)?(
\-|A|B|C|D|E|F|G)t?\+?){3}\))(.*)$/) { # a triplet
} 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);
# print "TRIPLET: ".$triplet." -> ";
$triplet =~ /^\(((\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(
g|q)?(
\-|A|B|C|D|E|F|G)t?\+?)(.*)\)$/gs;
$triplet =~ /^\(((
g|q)?(
\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?)(.*)\)$/gs;
($note, $triplet) = ($1,$6);
#print "$note $triplet\n";
parse_note($note, $keysig,
'
<
tuplet
type
=
"
start
"
/>
'
,
'
<
time
-
modification
>
<
actual
-
notes
>
3
</
actual
-
notes
>
<
normal
-
notes
>
2
</
normal
-
notes
>
</
time
-
modification
>
'
, $qq);
$triplet =~ /^((\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(
g|q)?(
\-|A|B|C|D|E|F|G)t?\+?)(.*)$/gs;
$triplet =~ /^((
g|q)?(
\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?)(.*)$/gs;
($note, $triplet) = ($1,$6);
#print "$note $triplet\n";
parse_note($note, $keysig,
''
,
'
<
time
-
modification
>
...
...
@@ -326,7 +327,7 @@ sub parse_notes {
<
actual
-
notes
>
3
</
actual
-
notes
>
<
normal
-
notes
>
2
</
normal
-
notes
>
</
time
-
modification
>
'
, $qq);
} elsif ($notes =~ /^((\d+)\(((\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(
g|q)?(
\-|A|B|C|D|E|F|G)t?\+?)+\;(\d+)\))(.*)$/) { # an n-tuplet
} 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);
# print "N-TUPLET: ".$tuplet." -> ";
$tuplet =~ /^(\d+)\(((\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(g|q)?(\-|A|B|C|D|E|F|G)t?\+?)(.*);(\d)\)$/gs;
...
...
@@ -339,7 +340,7 @@ sub parse_notes {
<
actual
-
notes
>
'
.$act_notes.
'
</
actual
-
notes
>
<
normal
-
notes
>
1
</
normal
-
notes
>
</
time
-
modification
>
'
, $qq);
while ($tuplet =~ /^((\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(
g|q)?(
\-|A|B|C|D|E|F|G)t?\+?)(.+)$/gs) {
while ($tuplet =~ /^((
g|q)?(
\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?)(.+)$/gs) {
($note, $tuplet) = ($1,$6);
#print "$note / $tuplet\n";
parse_note($note, $keysig,
''
,
'
<
time
-
modification
>
...
...
@@ -434,7 +435,7 @@ sub parse_notes {
</
note
>
'
;
}
elsif ($notes =~ s/(\d+\.*)\(((\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(
g|q)?(
\-|A|B|C|D|E|F|G)t?\+?)\)/\($1$2\)/gs) { # pull duration into fermata parentheses
elsif ($notes =~ s/(\d+\.*)\(((
g|q)?(
\,|
\'
)*(x|xx|b|bb|n)?\d*\.*(\-|A|B|C|D|E|F|G)t?\+?)\)/\($1$2\)/gs) { # pull duration into fermata parentheses
# print "after replacement: $notes\n"; exit;
}
elsif ($notes =~ /^ +(.*)$/) {
...
...
@@ -468,13 +469,13 @@ sub parse_note {
$fermata = 1;
}
$note =~ /^((\,|
\'
)*)(x|xx|b|bb|n)?(\d*)(\.*)(
g|q)?(
\-|A|B|C|D|E|F|G)(t?)(\+?)$/;
my ($oct, $acc, $dur, $dot,
$gracecue,
$pitch, $trill, $tie) = ($1, $
3
, $4, $5, $6, $7, $8, $9);
$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);
print OUT
'
<
note
>
'
;
if ($gracecue eq "g") {
print OUT
'
<
grace
steal
-
time
-
following
=
"
33
"
/>
print OUT
'
<
grace
slash
=
"
yes
"
steal
-
time
-
following
=
"
33
"
/>
'
;
}
if ($gracecue eq "q" || $in_qq_group) {
...
...
@@ -516,8 +517,12 @@ sub parse_note {
}
}
# Determine graphic notehead:
print OUT notehead ($dur, $dot);
# Determine graphic notehead: acciaccaturas are always 8th, otherwise use duration
if ($gracecue eq "g") {
print OUT " <type>eighth</type>\n";
} else {
print OUT notehead ($dur, $dot);
}
# If we have an explicit accidental on the note, print the <accidental> tag
print OUT accidental_explicit ($acc);
...
...
This diff is collapsed.
Click to expand it.
sample_files/Grace-acciaccatura.pae
0 → 100644
+
7
−
0
View file @
f7514785
Test Composer
Test case for acciaccatura
1.1.1: S acciaccatura
plain&easy: %G-2@c '2Ag''C{8D'B}''4C/'2A''xgC{8D'B}''4C/
Test Library
00000000
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment