Commit 247fe6f1 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Repetitions: Use correct repeat count indicated by f+ after the !

parent 7f7eca12
......@@ -154,6 +154,16 @@ REST: $rest\n";
close OUT;
}
# Repeat $1 by a count of $2
sub repeat {
(my $e, my $count) = @_;
my $res = "";
for (my $i=1; $i <= $count; ++$i)
{
$res .= $e;
}
return $res;
}
sub parse_notes {
my ($notes, $keysig) = @_;
......@@ -166,7 +176,7 @@ sub parse_notes {
$notes = $1;
}
$notes =~ s/!([^!]*)!/$1$1/gs; # write out repetitions
$notes =~ s/!([^!]*)!(f*)/repeat($1, length($2)+1)/gse; # write out repetitions
$notes =~ s/\{([^\}]*)\}/$1/gs; # ignore beamings
while ( $notes =~ s/(:?\/+:?|^)([^\/:]*)(:?\/+:?)i(:?\/+:?)/$1$2$3$2$4/gs) {}; # replace whole-measure repeats (i notation)
......
Test Composer
Test case for repetitions
1.1.1: S repetitions
plain&easy: %C-1@c$bBü '4A!'6BG!fff4A/
Test Library
00000000
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment