Permalink
Browse files

Add file with sample ABCs.

  • Loading branch information...
1 parent cedd993 commit 1e422a3b34412a40ce2a9c2f1d2d5bc833bcb205 @LastOfTheCarelessMen LastOfTheCarelessMen committed Jan 6, 2010
Showing with 59 additions and 27 deletions.
  1. +24 −27 dg-check.pl
  2. +35 −0 samples.abc
View
@@ -3,34 +3,31 @@
BEGIN { push @*INC, "lib" }
use ABC;
-my $abc = q«X:64
-T:Cuckold Come Out o' the Amrey
-S:Northumbrian Minstrelsy
-M:4/4
-L:1/8
-K:D
-A/B/c/A/ +trill+c>d e>deg | GG +trill+B>c d/B/A/G/ B/c/d/B/ |
-A/B/c/A/ c>d e>deg | dB/A/ gB +trill+A2 +trill+e2 ::
-g>ecg ec e/=f/g/e/ | d/c/B/A/ Gd BG B/c/d/B/ |
-g/f/e/d/ c/d/e/f/ gc e/f/g/e/ | dB/A/ gB +trill+A2 +trill+e2 :|»;
+regex between { \v+ }
+regex file { \s* <ABC::tune> ** <between> }
-my $match = $abc ~~ m/ <ABC::tune> /;
+my $abcs = $*IN.lines.join("\n");
+my @matches = $abcs.comb(m/ <ABC::tune> /, :match);
-die "Tune not matched\n" unless $match ~~ Match;
-
-my @notes = gather for $match<ABC::tune><music><line_of_music> -> $line
-{
- for $line<bar> -> $bar
- {
- for $bar<element>
- {
- when .<broken_rhythm> { take .<broken_rhythm><note>[0]; take .<broken_rhythm><note>[1]; }
- when .<note> { take .<note>; }
- }
- }
+for @matches {
+ my %header = header_hash(.<ABC::tune><header>);
+ say %header<T>;
}
-my %header = header_hash($match<ABC::tune><header>);
-my %key_signature = key_signature(%header<K>);
-
-@notes.map({say .<pitch> ~ " => " ~ apply_key_signature(%key_signature, .<pitch>)});
+#
+# my @notes = gather for $match<ABC::tune><music><line_of_music> -> $line
+# {
+# for $line<bar> -> $bar
+# {
+# for $bar<element>
+# {
+# when .<broken_rhythm> { take .<broken_rhythm><note>[0]; take .<broken_rhythm><note>[1]; }
+# when .<note> { take .<note>; }
+# }
+# }
+# }
+#
+# my %header = header_hash($match<ABC::tune><header>);
+# my %key_signature = key_signature(%header<K>);
+#
+# @notes.map({say .<pitch> ~ " => " ~ apply_key_signature(%key_signature, .<pitch>)});
View
@@ -0,0 +1,35 @@
+X:64
+T:Cuckold Come Out o' the Amrey
+S:Northumbrian Minstrelsy
+M:4/4
+L:1/8
+K:D
+A/B/c/A/ +trill+c>d e>deg | GG +trill+B>c d/B/A/G/ B/c/d/B/ |
+A/B/c/A/ c>d e>deg | dB/A/ gB +trill+A2 +trill+e2 ::
+g>ecg ec e/=f/g/e/ | d/c/B/A/ Gd BG B/c/d/B/ |
+g/f/e/d/ c/d/e/f/ gc e/f/g/e/ | dB/A/ gB +trill+A2 +trill+e2 :|
+
+X:044
+T:Elsie Marley
+B:Robin Williamson, "Fiddle Tunes" (New York 1976)
+N:"printed by Robert Petrie in 1796 and is
+N:"described by him as a 'bumpkin'."
+Z:Nigel Gatherer
+M:6/8
+L:1/8
+K:G
+BAB G2G|G2g gdc|BAB G2G|=F2f fcA|
+BAB G2G|G2g gdB|c2a B2g|A2=f fcA:|
+
+X: 7
+T:Peacock Followed the Hen. JWDM.07
+M:9/8
+L:1/8
+S:J.Winder MS,Wyresdale,Lancs.,1789
+R:Slip Jig
+O:England
+A:Lancashire
+Z:vmp.Taz Tarry
+K:G
+cde AcA AcA|cde AcA B2G|cde AcA AcA|Bcd dgd B2G:|
+|:cde ege ege|cde ege g2e|cde ege ege|ded dgd B2 G:|

0 comments on commit 1e422a3

Please sign in to comment.