Skip to content
Browse files

Somewhat hacky but working support for chords in abc2ly.

  • Loading branch information...
1 parent 1df5084 commit af1612c9bf6ec7ce7e6a356974d34fc1bd8572a7 @colomon committed May 2, 2012
Showing with 6 additions and 2 deletions.
  1. +1 −1 bin/abc2ly.pl
  2. +5 −1 lib/ABC/Chord.pm
View
2 bin/abc2ly.pl
@@ -280,7 +280,7 @@ (ABC::Header $header)
for @($element.value) -> $chord_or_text {
$*ERR.say: :$chord_or_text.perl;
if $chord_or_text ~~ ABC::Chord {
- $*ERR.say: "Chord found but not processed";
+ $suffix ~= '^"' ~ $chord_or_text ~ '"';
} else {
given $element.value {
when /^ '^'(.*)/ { $suffix ~= '^"' ~ $0 ~ '" ' }
View
6 lib/ABC/Chord.pm
@@ -12,6 +12,10 @@ class ABC::Chord {
}
method Str() {
- $.main-type ~ $.main-accidental ~ $.main-type ~ ($.bass-note ?? '/' ~ $.bass-note ~ $.bass-accidental !! "");
+ $.main-note ~ $.main-accidental ~ $.main-type ~ ($.bass-note ?? '/' ~ $.bass-note ~ $.bass-accidental !! "");
+ }
+
+ method perl() {
+ "ABC::Chord.new({ $.main-note.perl }, { $.main-accidental.perl }, { $.main-type.perl }, { $.bass-note.perl }, { $.bass-accidental.perl })";
}
}

0 comments on commit af1612c

Please sign in to comment.
Something went wrong with that request. Please try again.