Browse files

Start to implement notes.

  • Loading branch information...
1 parent 40667a5 commit 32c2cbc5d2ecf56ffe3e86972331395bea9a2957 @LastOfTheCarelessMen LastOfTheCarelessMen committed Dec 16, 2009
Showing with 19 additions and 3 deletions.
  1. +19 −3 playing.pl
View
22 playing.pl
@@ -11,13 +11,29 @@
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 abc_header_field { ^^ \w ':' \N* $$ }
+regex abc_header_field_name { \w }
+regex abc_header_field_data { \N* }
+regex abc_header_field { ^^ <abc_header_field_name> ':' \s* <abc_header_field_data> $$ }
regex abc_header { [<abc_header_field> \n]+ }
+regex abc_basenote { <[a..g]+[A..G]> }
+regex abc_octave { \'+ | \,+ }
+regex abc_accidental { '^' | '^^' | '_' | '__' | '=' }
+regex abc_pitch { <abc_accidental>? <abc_basenote> <abc_octave>? }
+
+regex abc_tie { '-' }
+regex abc_note_length { [\d* ['/' \d*] ] | '/' }
+regex abc_note { <abc_pitch> <abc_note_length>? <abc_tie>? }
+
if $abc ~~ m/ <abc_header> /
{
for $<abc_header><abc_header_field> -> $line
{
- say "header: $line";
+ say "header: {$line<abc_header_field_name>}: {$line<abc_header_field_data>}";
}
-}
+}
+
+if "^^A/3" ~~ m/ <abc_note> /
+{
+ say $<abc_note>.perl;
+}

0 comments on commit 32c2cbc

Please sign in to comment.