Music::ABC::Archive - Parse ABC music archives


Music-ABC-Archive documentation  | view source Contained in the Music-ABC-Archive distribution.

Index


NAME

Top

Music::ABC::Archive - Parse ABC music archives

VERSION

Top

0.01

SYNOPSIS

Top

 use Music::ABC::Archive ;

 $abcfile = "Some_ABC_file.abc" ;
 $songnum = 6 ;

 $abc_obj = Music::ABC::Archive->new($abcfile) ;

 $abc_obj->openabc($abcfile) || die("failed to open $abcfile") ;

 print "-----------------------------\n" ;
 my @lines = $abc_obj->print_song_summary($songnum) ;

 foreach (@lines) {
     print "$_\n" ;
 }

 my @files = $abc_archive->list_by_title() ;

 foreach (@files) {
     my ($display_name, $sn, $type, $meter, $key, $titles_aref) = @{$_} ;
     my $name = "$display_name - $type - Key of $key" ;
     print "<option value=\"$sn\">$name</option>\n" ;
 }

DESCRIPTION

Top

ABC music archives (http://www.gre.ac.uk/~walshaw/abc/index.html) contain songs in the ABC format. They are a very quick way for entering music in a text format, and there are numerous publishable quality renderers for ABC music. This module encapsulates the ABC archive, and individual songs so they may more easily be managed by perl front-ends.

ABSTRACT

Top

    ABC music archives (http://www.gre.ac.uk/~walshaw/abc/index.html) contain songs in the ABC format.
    They are a very quick way for entering music in a text format, and there are numerous publishable quality
    renderers for ABC music.  This module encapsulates the ABC archive, and individual songs so they may
    more easily be managed by perl front-ends.

CONSTRUCTOR

Top

new([s])

Creates the Music::ABC::Archive object. If s is given, specifies the name of the archive file.

METHODS

Top

openabc([s])

Opens the abc archive file. Optional argument is the name of the archive file. Returns false on failure.

filename([s])

Specify the name of the archive file. Returns the current archive file name

list_by_title()

@song_numbers = list_by_title() ;

Returns list of array references for songs in the archive, sorted by title, which contain (in this order):

display_name - a song title for display to the user

song number - an integer

song type - Reel, Jig, Waltz, etc

key - Key of the song

titles - a reference to an array holding all titles for the song

get_song(n)

Returns all of the ABC text for song number n. There is no trailing "\n" ;

@lines = get_song($songnum) ;

Returns a list of lines, giving a description of the song as found in the headers of the song text for song number n. if the second argument is false, or missing, then no html markup is included, otherwise the lines include basic html markup for displaying the song on a WWW browser. There is no trailing "\n" ;

@lines = print_song_summary($song_number) ; @lines = print_song_summary($song_number, $use_html_tags) ;

get_archive_header_lines()

Returns all of the ABC header text(any line starting with %, before any songs are found)

@header_lines = get_archive_header_lines() ;

parse()

Force immediate parsing of the ABC archive file. This will be done automatically on any other calls.

AUTHOR

Top

Jeff Welty (jeff@redhawk.org)

BUGS

Top

None known, but you'll be sure to tell me if you find one, won't you?

SEE ALSO

Top

Music::ABC::SONG.pm

COPYRIGHT

Top


Music-ABC-Archive documentation  | view source Contained in the Music-ABC-Archive distribution.