Skip to content

Commit

Permalink
Fix issue 334.
Browse files Browse the repository at this point in the history
  • Loading branch information
sciurius committed Dec 25, 2023
1 parent d48a94c commit b5b0bae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
- Fix comment labels for delegates (issue 329.3).
- (Wx) Filter configs on prp ans json.
- Fix memorize/recall/transpose issue 333.
- Fix issue 334.
- !Internal
- (ABC) ABC embedding use tohtml instead of toxhtml.
- (PDF) Enhance assets (wip), labels; move grid to separate module.
Expand Down
10 changes: 8 additions & 2 deletions lib/ChordPro/Chords/Parser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ sub new {
my $self = bless { chord_cache => {} } => $pkg;
$self->{system} = "nashville";
$self->{target} = 'ChordPro::Chord::Nashville';
$self->{intervals} = 12;
warn("Chords: Created parser for ", $self->{system}, "\n")
if $::options->{verbose} && $::options->{verbose} > 1;
return $parsers{$self->{system}} = $self;
Expand Down Expand Up @@ -655,6 +656,7 @@ sub new {
my $self = bless { chord_cache => {} } => $pkg;
$self->{system} = "roman";
$self->{target} = 'ChordPro::Chord::Roman';
$self->{intervals} = 12;
warn("Chords: Created parser for ", $self->{system}, "\n")
if $::options->{verbose} && $::options->{verbose} > 1;
return $parsers{$self->{system}} = $self;
Expand Down Expand Up @@ -1003,7 +1005,9 @@ sub transcode ( $self, $xcode, $key_ord = 0 ) {
my $p = $self->{parser}->get_parser($xcode);
die("OOPS ", $p->{system}, " $xcode") unless $p->{system} eq $xcode;
$info->{parser} = $p;
$info->{root_ord} -= $key_ord if $key_ord && $p->movable;
if ( $key_ord && $p->movable ) {
$info->{root_ord} -= $key_ord % $p->intervals;
}
# $info->{$_} = $p->{$_} for qw( ns_tbl nf_tbl ns_canon nf_canon );
$info->{root_canon} = $info->{root} =
$p->root_canon( $info->{root_ord},
Expand All @@ -1014,7 +1018,9 @@ sub transcode ( $self, $xcode, $key_ord = 0 ) {
$info->{qual_canon} = $info->{qual} = "";
}
if ( $self->{bass} && $self->{bass} ne "" ) {
$info->{bass_ord} -= $key_ord if $key_ord && $p->movable;
if ( $key_ord && $p->movable ) {
$info->{bass_ord} -= $key_ord % $p->intervals;
}
$info->{bass_canon} = $info->{bass} =
$p->root_canon( $info->{bass_ord}, $info->{bass_mod} >= 0 );
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ChordPro/Version.pm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is generated. Do not edit!
package ChordPro::Version;
our $VERSION = "6.030_063";
our $VERSION = "6.030_064";
print "$VERSION\n" unless caller;

0 comments on commit b5b0bae

Please sign in to comment.