Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 37 lines (29 sloc) 0.965 kb
7e3eca2 @LastOfTheCarelessMen First "working" playing.pl.
LastOfTheCarelessMen authored
1 use v6;
2
c08cd27 @LastOfTheCarelessMen Move the grammar to the ABC.pm file.
LastOfTheCarelessMen authored
3 BEGIN { push @*INC, "lib" }
4 use ABC;
5
7e3eca2 @LastOfTheCarelessMen First "working" playing.pl.
LastOfTheCarelessMen authored
6 my $abc = q«X:64
7 T:Cuckold Come Out o' the Amrey
8 S:Northumbrian Minstrelsy
9 M:4/4
10 L:1/8
11 K:D
12 A/B/c/A/ +trill+c>d e>deg | GG +trill+B>c d/B/A/G/ B/c/d/B/ |
13 A/B/c/A/ c>d e>deg | dB/A/ gB +trill+A2 +trill+e2 ::
a326b88 @LastOfTheCarelessMen Working early key signature framework.
LastOfTheCarelessMen authored
14 g>ecg ec e/=f/g/e/ | d/c/B/A/ Gd BG B/c/d/B/ |
7e3eca2 @LastOfTheCarelessMen First "working" playing.pl.
LastOfTheCarelessMen authored
15 g/f/e/d/ c/d/e/f/ gc e/f/g/e/ | dB/A/ gB +trill+A2 +trill+e2 :|»;
16
0aaec06 @LastOfTheCarelessMen playing.pl now has test code to go through a matched tune and pull ou…
LastOfTheCarelessMen authored
17 my $match = $abc ~~ m/ <ABC::tune> /;
18
19 die "Tune not matched\n" unless $match ~~ Match;
20
21 my @notes = gather for $match<ABC::tune><music><line_of_music> -> $line
7e3eca2 @LastOfTheCarelessMen First "working" playing.pl.
LastOfTheCarelessMen authored
22 {
0aaec06 @LastOfTheCarelessMen playing.pl now has test code to go through a matched tune and pull ou…
LastOfTheCarelessMen authored
23 for $line<bar> -> $bar
40667a5 @LastOfTheCarelessMen Successfully match and dump ABC header.
LastOfTheCarelessMen authored
24 {
0aaec06 @LastOfTheCarelessMen playing.pl now has test code to go through a matched tune and pull ou…
LastOfTheCarelessMen authored
25 for $bar<element>
26 {
9613195 @colomon Switch from ABC to ABC::Grammar in preparation for further goodness.
authored
27 when .<broken_rhythm> { take .<broken_rhythm><mnote>[0]; take .<broken_rhythm><mnote>[1]; }
28 when .<mnote> { take .<mnote>; }
0aaec06 @LastOfTheCarelessMen playing.pl now has test code to go through a matched tune and pull ou…
LastOfTheCarelessMen authored
29 }
40667a5 @LastOfTheCarelessMen Successfully match and dump ABC header.
LastOfTheCarelessMen authored
30 }
32c2cbc @LastOfTheCarelessMen Start to implement notes.
LastOfTheCarelessMen authored
31 }
32
a326b88 @LastOfTheCarelessMen Working early key signature framework.
LastOfTheCarelessMen authored
33 my %header = header_hash($match<ABC::tune><header>);
34 my %key_signature = key_signature(%header<K>);
9b8264b @LastOfTheCarelessMen Closer to having working key signature code.
LastOfTheCarelessMen authored
35
a326b88 @LastOfTheCarelessMen Working early key signature framework.
LastOfTheCarelessMen authored
36 @notes.map({say .<pitch> ~ " => " ~ apply_key_signature(%key_signature, .<pitch>)});
Something went wrong with that request. Please try again.