Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 39 lines (31 sloc) 0.862 kb
7e4ae77 @LastOfTheCarelessMen Copy file.
LastOfTheCarelessMen authored
1 use v6;
2
3 BEGIN { push @*INC, "lib" }
4 use ABC;
5
89dd07d @LastOfTheCarelessMen Actually picks out the notes not present on a one-row G accordion.
LastOfTheCarelessMen authored
6 my @matches = $*IN.slurp.comb(m/ <ABC::tune> /, :match);
7
8 my %dg_notes = {
9 'g' => 1,
10 'a' => 1,
11 'b' => 1,
12 'c' => 1,
13 'd' => 1,
14 'e' => 1,
15 '^f' => 1
16 }
7e4ae77 @LastOfTheCarelessMen Copy file.
LastOfTheCarelessMen authored
17
1e422a3 @LastOfTheCarelessMen Add file with sample ABCs.
LastOfTheCarelessMen authored
18 for @matches {
19 my %header = header_hash(.<ABC::tune><header>);
ffafa4b @LastOfTheCarelessMen Simplify input, work old note handling code into new match loop.
LastOfTheCarelessMen authored
20 say %header<T> ~ ":";
21
22 my @notes = gather for .<ABC::tune><music><line_of_music> -> $line
23 {
24 for $line<bar> -> $bar
25 {
26 for $bar<element>
27 {
28 when .<broken_rhythm> { take .<broken_rhythm><note>[0]; take .<broken_rhythm><note>[1]; }
29 when .<note> { take .<note>; }
30 }
31 }
32 }
7e4ae77 @LastOfTheCarelessMen Copy file.
LastOfTheCarelessMen authored
33
ffafa4b @LastOfTheCarelessMen Simplify input, work old note handling code into new match loop.
LastOfTheCarelessMen authored
34 my %key_signature = key_signature(%header<K>);
35
89dd07d @LastOfTheCarelessMen Actually picks out the notes not present on a one-row G accordion.
LastOfTheCarelessMen authored
36 my @trouble = @notes.map({apply_key_signature(%key_signature, .<pitch>)}).grep({!%dg_notes.exists(lc($_))});
37 say @trouble.perl;
ffafa4b @LastOfTheCarelessMen Simplify input, work old note handling code into new match loop.
LastOfTheCarelessMen authored
38 }
Something went wrong with that request. Please try again.