Permalink
Browse files

Actually picks out the notes not present on a one-row G accordion.

  • Loading branch information...
1 parent ffafa4b commit 89dd07d4c0441e74f2595ae73a4df91fa4424398 @LastOfTheCarelessMen committed Jan 9, 2010
Showing with 13 additions and 3 deletions.
  1. +13 −3 dg-check.pl
View
@@ -3,7 +3,17 @@
BEGIN { push @*INC, "lib" }
use ABC;
-my @matches = $*IN.lines.join("\n").comb(m/ <ABC::tune> /, :match);
+my @matches = $*IN.slurp.comb(m/ <ABC::tune> /, :match);
+
+my %dg_notes = {
+ 'g' => 1,
+ 'a' => 1,
+ 'b' => 1,
+ 'c' => 1,
+ 'd' => 1,
+ 'e' => 1,
+ '^f' => 1
+}
for @matches {
my %header = header_hash(.<ABC::tune><header>);
@@ -21,8 +31,8 @@
}
}
- my %header = header_hash(.<ABC::tune><header>);
my %key_signature = key_signature(%header<K>);
- @notes.map({say .<pitch> ~ " => " ~ apply_key_signature(%key_signature, .<pitch>)});
+ my @trouble = @notes.map({apply_key_signature(%key_signature, .<pitch>)}).grep({!%dg_notes.exists(lc($_))});
+ say @trouble.perl;
}

0 comments on commit 89dd07d

Please sign in to comment.