Changeset 31199

Show
Ignore:
Timestamp:
03/14/09 20:59:14 (5 years ago)
Author:
bayashi
Message:

lil fix

Location:
lang/perl/Text-Chord-Piano/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Text-Chord-Piano/trunk/Changes

    r31056 r31199  
    11Revision history for Text-Chord-Piano 
     2 
     30.0.5  Sat Mar 14 20:20:20 2009 
     4       removed code. it was no need. 
    25 
    360.0.4  Tue Mar 10 22:10:00 2009 
  • lang/perl/Text-Chord-Piano/trunk/META.yml

    r31057 r31199  
    11--- 
    22name: Text-Chord-Piano 
    3 version: 0.0.4 
     3version: 0.0.5 
    44author: 
    55  - 'Dai Okabayashi <bayashi@cpan.org>' 
     
    1717  Text::Chord::Piano: 
    1818    file: lib/Text/Chord/Piano.pm 
    19     version: 0.0.4 
     19    version: 0.0.5 
    2020generated_by: Module::Build version 0.3 
    2121meta-spec: 
  • lang/perl/Text-Chord-Piano/trunk/lib/Text/Chord/Piano.pm

    r31056 r31199  
    1010__PACKAGE__->mk_accessors( qw(finger) ); 
    1111 
    12 use version; our $VERSION = qv('0.0.4'); 
     12use version; our $VERSION = qv('0.0.5'); 
    1313 
    1414my $cn = Music::Chord::Note->new(); 
     
    2020 
    2121my @white_keys = ( 
    22 #       C   C#  D   D#  E   F   F#  G   G#  A   A#  B 
    23         2,  4,  6,  8, 10, 14, 16, 18, 20, 22, 24, 26, 
    24         30, 32, 34, 36, 38, 42, 44, 46, 48, 50, 52, 54, 
     22#   C   C#  D   D#  E   F   F#  G   G#  A   A#  B 
     23    2,  4,  6,  8, 10, 14, 16, 18, 20, 22, 24, 26, 
     24    30, 32, 34, 36, 38, 42, 44, 46, 48, 50, 52, 54, 
    2525); 
    2626 
     
    4444sub generate { 
    4545    my ($self, $chord_name, @keys) = @_; 
    46         my $keyboard = $self->_draw_keyboard; 
     46    my $keyboard = $self->_draw_keyboard; 
    4747    for my $key (0..23){ 
    4848        my $play = 0; 
     
    5151        } 
    5252        if($play){ 
    53                         my $y = $black_keys->{$key} || 5; 
    54                         $keyboard->[$y]->[$white_keys[$key]] = $self->finger; 
     53            my $y = $black_keys->{$key} || 5; 
     54            $keyboard->[$y]->[$white_keys[$key]] = $self->finger; 
    5555        } 
    5656    } 
     
    6060sub put_keyboard { 
    6161    my $self     = shift; 
    62         my $keyboard = shift; 
    63         $keyboard = $self->_draw_keyboard if ref $keyboard ne 'ARRAY'; 
    64         my $text; 
    65         for my $line (@{$keyboard}){ 
    66                 for my $char (@{$line}){ 
    67                         $text .= $char; 
    68                 } 
    69         } 
    70         return $text; 
     62    my $keyboard = shift; 
     63    $keyboard = $self->_draw_keyboard if ref $keyboard ne 'ARRAY'; 
     64    my $text; 
     65    for my $line (@{$keyboard}){ 
     66        for my $char (@{$line}){ 
     67            $text .= $char; 
     68        } 
     69    } 
     70    return $text; 
    7171} 
    7272 
     
    8383    croak "undefined chord $chord_name" unless defined $tonic; 
    8484    my $scalic = $cn->scale($tonic); 
    85     croak "undefined kind of chord $chord_name ($kind)" 
    86         unless defined $cn->chord_num($kind); 
    8785    my @keys; 
    8886    for my $scale ( $cn->chord_num($kind) ){