Skip to content
Snippets Groups Projects
Commit bd658412 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Support for real multi-measure rests (with correct length explicitly specified in XML)

parent 247fe6f1
No related branches found
No related tags found
No related merge requests found
...@@ -193,8 +193,6 @@ sub parse_notes { ...@@ -193,8 +193,6 @@ 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/(\.|\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/(xx|x|bb|b|n)qq/qq$1/gs; # qq first, then parts of notes
$notes =~ s/\=(\d)/$1/gs; # replace multibar rests #n with just n
while ($notes ne "") { while ($notes ne "") {
if ($notes =~ /^(\'+|\,+)(.*)$/) { # Octave marks if ($notes =~ /^(\'+|\,+)(.*)$/) { # Octave marks
($oct, $notes) = ($1, $2); ($oct, $notes) = ($1, $2);
...@@ -205,13 +203,23 @@ sub parse_notes { ...@@ -205,13 +203,23 @@ sub parse_notes {
} elsif ($notes =~ /^r(.*)$/) { # End grace } elsif ($notes =~ /^r(.*)$/) { # End grace
$notes = $1; $notes = $1;
$qq = 0; $qq = 0;
} elsif ($notes =~ /^(\d+|\=)(\/.*)$/) { # normal and multi-measure rests } elsif ($notes =~ /^\=(\d*)(\/.*)$/) { # multi-measure rests
$measrest = $1; $measrest = $1;
$notes = $2; $notes = $2;
if ($measrest eq '=') { if ($measrest eq '') {
$measrest = 1; $measrest = 1;
} }
$toprint .= "$measrest measures of rest.\n"; $toprint .= "$measrest measures of rest.\n";
if ($measrest > 0) {
# Create a real multi-bar rest
print OUT ' <attributes>
<measure-style>
<multiple-rest>'.$measrest.'</multiple-rest>
</measure-style>
</attributes>
';
}
# Now create the measures
for $n (1..$measrest) { for $n (1..$measrest) {
print OUT ' <note> print OUT ' <note>
<rest /> <rest />
......
Test Composer
Test case for multi-measure rests
1.1.1: S Multi-measure rests
plain&easy: %C-1@c$bB '=/2AB/=3/=/2AB/=15/2AB/
Test Library
00000000
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment