NAME MIDI::Tab - generate MIDI music from ascii tablature TO DO Try to make it so that from_guitar_tab etc can be called as a normal method or function call (instead of passing object as first parameter) SYNOPSIS use MIDI::Tab; use MIDI::Simple; new_score; # From MIDI::Simple my $drums = <<"EOF"; CYM: 8------------------------------- BD: 8-4---8-2-8-----8-4---8-2-8----- SD: ----8-------8-------8-------8--- HH: 66--6-6-66--6-6-66--6-6-66--6-6- OHH: --6-------6-------6-------6----- EOF my $bass = <<"EOF"; G3: -------------------------------- D3: -------------------------------- A2: 5--53-4-5--53-1----------------- E2: ----------------3--31-2-3--23-4- EOF for(1..4){ synch( # From MIDI::Simple sub { from_drum_tab($_[0], $drums, 'sn'); }, sub { from_guitar_tab($_[0], $bass, 'sn'); }, ) } write_score('demo.mid'); # From MIDI::Simple DESCRIPTION MIDI::Tab allows you to create MIDI files from ascii tablature. It is designed to work alongside Sean M Burke's MIDI::Simple. There are currently three types of tablature supported: Drum Tab Each horizontal line represents a different drum, and time runs from left to right. Minus or plus characters represent rest intervals. As many or as few drums as required can be specified, each drum having a two or three letter code. Currently supported are: BD - Bass Drum, SD - Snare Drum, HH - Hi-Hat, OHH - Open Hi-Hat, CYM - Crash Cymbal. More can be added by writing to the hash %MIDI::Tab::drum_notes (see source for example). The numbers on the tablature represents the volume of the drum hit (from 1 to 9, where 9 is the loudest). Any parameters to from_drum_tab specified after the tablature string are passed to a call to 'noop' at the start of the tab rendering, so for example the length of each unit of time can be specified by passing a standard MIDI::Simple duration value (eg 'sn'). The channel that is used to play the drum notes can be changed by altering $MIDI::Tab::drum_channel (defaults to 'c9'). Guitar Tab Notes here are specified on an ascii representation of a guitar with each horizontal line of ascii characters representing one string on the guitar (as if the guitar were laid face-up in front of you). Time runs from left to right. You can 'tune' the guitar by specifying different root notes for the strings. These should be specified as a MIDI::Simple alphanumeric absolute note value (eg 'A2'). The numbers in the tablature represent the fret at which the note is played. Any parameters to from_guitar_tab specified after the tablature string are passed to a call to 'noop' at the start of the tab rendering, so for example the length of each unit of time can be specified by passing a standard MIDI::Simple duration value (eg 'sn') and the instrument can be selected (eg 'c3'). Piano Tab Here, each horizonal line represents a different note on the piano and time runs from left to right.