Music::ABC::Archive - Parse ABC music archives
0.01
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" ; }
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.
Creates the Music::ABC::Archive object. If s is given, specifies the name of the archive file.
Opens the abc archive file. Optional argument is the name of the archive file. Returns false on failure.
Specify the name of the archive file. Returns the current archive file name
@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
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) ;
Returns all of the ABC header text(any line starting with %, before any songs are found)
@header_lines = get_archive_header_lines() ;
Force immediate parsing of the ABC archive file. This will be done automatically on any other calls.
Jeff Welty (jeff@redhawk.org)
None known, but you'll be sure to tell me if you find one, won't you?
Music::ABC::SONG.pm
This program is free software. You may copy or redistribute it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
=pod directives shouldn't be over one line long! Ignoring all 25 lines of content
To install Music::ABC::Archive, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Music::ABC::Archive
CPAN shell
perl -MCPAN -e shell install Music::ABC::Archive
For more information on module installation, please visit the detailed CPAN module installation guide.