MIDI::XML::Track - MIDI Tracks.
use MIDI::XML::Track; use MIDI::XML::TrackName;
$Track = MIDI::XML::Track->new(); $Track->number(0);
$Track_Name = MIDI::XML::TrackName->new(); $Track_Name->delta(0); $Track_Name->text('Silent Night'); $Track->append($Track_Name); $Track->append(MIDI::XML::TimeSignature->new(['time_signature',0,4,2,96,8]));
@xml = $Track->as_MidiXML(); print join("\n",@xml);
MIDI::XML::Track is an object oriented class for representing tracks in Standard MIDI Files.
None.
new();
This creates a new MIDI::XML::Track object.
Creates a new Track object initialized with the events in a MIDI::Track object.
Registers a subclass the for MIDI::XML::Track objects to use to represent the named event. To work properly with the array methods the subclass name should be the same as the orignal name. For example:
$Track->register_subclass('sequencer_specific', 'MIDI::Huh::SequencerSpecific');
will allow the sequencer_specifics method to identify the subclass but
$Track->register_subclass('sequencer_specific', 'MIDI::Huh::SequinsAreSpecific');
will not.
events()
Returns a reference to the array containing all the events associated with the track.
append($Event)
Appends an event to the event array in this MIDI::Xml:Track object.
append_from_track($track)
Appends the events in a MIDI::Track object to the event array in this MIDI::Xml:Track object.
make_times_absolute()
Converts the event times from delta values to absolute values.
make_times_delta()
Converts the event times from absolute values to delta values.
note_ons() or $Track->note_ons('refresh');
Returns a reference to an array of all NoteOn objects within the track. If called with any parameter the array is refreshed before the reference is returned.
note_offs() or $Track->note_offs('refresh');
Returns a reference to an array of all NoteOff objects within the track. If called with any parameter the array is refreshed before the reference is returned.
control_changes() or $Track->control_changes('refresh');
Returns a reference to an array of all ControlChange objects within the track. If called with any parameter the array is refreshed before the reference is returned.
program_changes() or $Track->program_changes('refresh');
Returns a reference to an array of all ProgramChange objects within the track. If called with any parameter the array is refreshed before the reference is returned.
key_aftertouches() or $Track->key_aftertouches('refresh');
Returns a reference to an array of all KeyAftertouch objects within the track. If called with any parameter the array is refreshed before the reference is returned.
channel_aftertouches() or $Track->channel_aftertouches('refresh');
Returns a reference to an array of all ChannelAftertouch objects within the track. If called with any parameter the array is refreshed before the reference is returned.
pitch_bend() or $Track->pitch_bend('refresh');
Returns a reference to an array of all PitchBend objects within the track. If called with any parameter the array is refreshed before the reference is returned.
sequence_numbers() or $Track->sequence_numbers('refresh');
Returns a reference to an array of all SequenceNumber objects within the track. If called with any parameter the array is refreshed before the reference is returned.
text_events() or $Track->text_events('refresh');
Returns a reference to an array of all TextEvent objects within the track. If called with any parameter the array is refreshed before the reference is returned.
copyrights() or $Track->copyrights('refresh');
Returns a reference to an array of all CopyrightNotice objects within the track. If called with any parameter the array is refreshed before the reference is returned.
track_names() or $Track->track_names('refresh');
Returns a reference to an array of all TrackName objects within the track. If called with any parameter the array is refreshed before the reference is returned.
instrument_names() or $Track->instrument_names('refresh');
Returns a reference to an array of all InstrumentName objects within the track. If called with any parameter the array is refreshed before the reference is returned.
lyrics() or $Track->lyrics('refresh');
Returns a reference to an array of all Lyric objects within the track. If called with any parameter the array is refreshed before the reference is returned.
markers() or $Track->markers('refresh');
Returns a reference to an array of all Marker objects within the track. If called with any parameter the array is refreshed before the reference is returned.
cue_points() or $Track->cue_points('refresh');
Returns a reference to an array of all CuePoint objects within the track. If called with any parameter the array is refreshed before the reference is returned.
program_names() or $Track->program_names('refresh');
Returns a reference to an array of all ProgramName objects within the track. If called with any parameter the array is refreshed before the reference is returned.
device_names() or $Track->device_names('refresh');
Returns a reference to an array of all DeviceName objects within the track. If called with any parameter the array is refreshed before the reference is returned.
ports() or $Track->ports('refresh');
Returns a reference to an array of all Port objects within the track. If called with any parameter the array is refreshed before the reference is returned.
channel_prefixes() or $Track->channel_prefixes('refresh');
Returns a reference to an array of all MidiChannelPrefix objects within the track. If called with any parameter the array is refreshed before the reference is returned.
ends_of_tracks() or $Track->ends_of_tracks('refresh');
Returns a reference to an array of all EndOfTrack objects within the track. If called with any parameter the array is refreshed before the reference is returned.
set_tempi() or $Track->set_tempi('refresh');
Returns a reference to an array of all SetTempo objects within the track. If called with any parameter the array is refreshed before the reference is returned.
smpte_offsets() or $Track->smpte_offsets('refresh');
Returns a reference to an array of all SmpteOffset objects within the track. If called with any parameter the array is refreshed before the reference is returned.
time_signatures() or $Track->time_signatures('refresh');
Returns a reference to an array of all TimeSignature objects within the track. If called with any parameter the array is refreshed before the reference is returned.
key_signatures() or $Track->key_signatures('refresh');
Returns a reference to an array of all KeySignature objects within the track. If called with any parameter the array is refreshed before the reference is returned.
sequencer_specifics() or $Track->sequencer_specifics('refresh');
Returns a reference to an array of all SequencerSpecific objects within the track. If called with any parameter the array is refreshed before the reference is returned.
meta_events() or $Track->meta_events('refresh');
Returns a reference to an array of all Port objects within the track. If called with any parameter the array is refreshed before the reference is returned.
system_exclusives() or $Track->system_exclusives('refresh');
Returns a reference to an array of all SystemExclusive objects within the track. If called with any parameter the array is refreshed before the reference is returned.
ends_of_exclusives() or $Track->ends_of_exclusives('refresh');
Returns a reference to an array of all EndOfExclusive objects within the track. If called with any parameter the array is refreshed before the reference is returned.
end() or $Track->end('refresh');
Returns the absolute time for the end of the track. If called with any parameter the value is refreshed before it is returned.
as_midi_track();
Returns a reference to an array of all objects within the track.
as_MidiXML();
Returns an array of elements formatted according to the MidiXML DTD. These elements may be assembled by track into entire documents with the following suggested DOCTYPE declaration:
<!DOCTYPE MIDI PUBLIC
"-//Recordare//DTD MusicXML 0.7 MIDI//EN"
"http://www.musicxml.org/dtds/midixml.dtd">
Brian M. Ames, <bmames@apk.net>
the MIDI::Track manpage, the MIDI::Event manpage.
Copyright 2002 Brian M. Ames. This software may be used under the terms of the GPL and Artistic licenses, the same as Perl itself.