MIDI::XML - Module for representing MIDI-XML objects.
use MIDI::XML; $document = MIDI::XML->parsefile($file);
None by default.
This method is used to parse an existing MIDI XML file and create a DOM tree. Calls XML::Parser->parse with the given string and the MIDI::XML handlers. A DOM Document containing a tree of DOM objects is returned. Comments, processing instructions, and notations, are discarded. White space is retained.
This method is used to parse an existing MIDI XML file and create a DOM tree. Calls XML::Parser->parsefile with the given path and the MIDI::XML handlers. A DOM Document containing a tree of DOM objects is returned. Comments, processing instructions, and notations, are discarded. White space is retained.
This method is used to read an existing Standard MIDI XML file and create a DOM tree. It reads the file at the given path and creates SAX events which are directed to the MIDI::XML handlers. A DOM Document containing a tree of DOM objects is returned. White space is inserted to produce "pretty" output if the optional $pretty argument is non-zero.
MIDI::XML::Document - Module for representing Document objects.
Create a new MIDI::XML::Document object.
Returns a reference to an array of measures. If called with any parameter the array is refreshed before the reference is returned.
This method is used to write an Standard MIDI file.
Set or get element text content.
MIDI::XML::MetaEvent is used for representing MetaEvent objects
MIDI::XML::CopyrightNotice is used for representing CopyrightNotice objects
MIDI::XML::CuePoint is used for representing CuePoint objects
MIDI::XML::DeviceName is used for representing DeviceName objects.
FF 09 len text DEVICE NAME
The Device Name is the name of the device that this track is intended to address. It will often be the model name of a synthesizer, but can be any string which uniquely identifies a particular device in a given setup. There should only be one Device Name (Meta Event 09) per track, and it should appear at the beginning of a track before any events which are sendable (i.e., it should be grouped with the text events before the proposed Program Name [Meta Event 08 - see below] and before bank select and program change messages). This will ensure that each track can only address one device.
Each track of a MIDI File can contain one MIDI stream, including SysEx and up to 16 channels. The Device Name Meta Event is used to label each track in a MIDI File with a text label.
If a Type 1 Standard MIDI File contains MIDI data for several devices, the data for each device is contained in a separate track, each with a different Device Name Meta Event. It is possible to have any number of tracks which address the same Device Name; however, each track can only address one device, as noted above.
Since a Type 0 Standard MIDI File has only one track, it can have only one Device Name Meta Event.
MIDI::XML::EndOfTrack is used for representing EndOfTrack objects
MIDI::XML::InstrumentName is used for representing InstrumentName objects
MIDI::XML::KeySignature is used for representing KeySignature objects
Set or get value of the Fifths attribute.
Type: int Lower: 1 Upper: 1
Set or get value of the Mode attribute.
MIDI::XML::Lyric is used for representing Lyric objects
MIDI::XML::Marker is used for representing Marker objects
MIDI::XML::MIDIChannelPrefix is used for representing MIDIChannelPrefix objects
Set or get value of the Value attribute.
MIDI::XML::OtherMetaEvent is used for representing OtherMetaEvent objects
Set or get value of the Number attribute.
MIDI::XML::Port is used for representing Port objects
MIDI::XML::ProgramName is used for representing ProgramName objects FF 08 len text PROGRAM NAME
One purpose of this event is to aid in reorchestration; since one non-General-MIDI device's piano can be another one's drum kit; knowing the intended program name can be an important clue.
The Program Name is the name of the program called up by the immediately following sequence of bank select and program change messages. The channel for the program change is identified by the bank select and program change messages. The Program Name Meta Event may appear anywhere in a track, but should only be used in conjunction with optional bank selects and a program change. There may be more than one Program Name Meta Events in a track.
MIDI::XML::SequenceNumber is used for representing SequenceNumber objects
MIDI::XML::SequencerSpecific is used for representing SequencerSpecific objects
MIDI::XML::SetTempo is used for representing SetTempo objects
MIDI::XML::SMPTEOffset is used for representing SMPTEOffset objects
Set or get value of the TimeCodeType attribute.
Set or get value of the Hour attribute.
Set or get value of the Minute attribute.
Set or get value of the Second attribute.
Set or get value of the Frame attribute.
Set or get value of the FractionalFrame attribute.
MIDI::XML::TextEvent is used for representing TextEvent objects
MIDI::XML::TimeSignature is used for representing TimeSignature objects
Set or get value of the Numerator attribute.
Set or get value of the LogDenominator attribute.
Set or get value of the MIDIClocksPerMetronomeClick attribute.
Set or get value of the ThirtySecondsPer24Clocks attribute.
MIDI::XML::TrackName is used for representing TrackName objects
MIDI::XML::XMFPatchTypePrefix is used for representing XMFPatchTypePrefix objects The XMFPatchTypePrefix meta-event is described in RP-032 from the MMA. It allows specification of using General MIDI 1, General MIDI 2, or DLS to interpret subsequent program change and bank select messages in the same track.
Type: NMTOKEN Lower: 1 Upper: 1
MIDI::XML::ChannelMessage is used for representing ChannelMessage objects MIDI::XML::Channel is the base class from which MIDI Channel objects are derived.
Set or get value of the Channel attribute.
Type: nybble Lower: 1 Upper: 1
MIDI::XML::NoteOff is used for representing NoteOff objects MIDI::XML::NoteOff is a class encapsulating MIDI Note Off messages. A Note Off message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Note Off event encoded in 3 bytes as follows:
1000cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = note number vvvvvvv = velocity
The classes for MIDI Note Off messages and the other six channel messages are derived from MIDI::XML::Channel.
Set or get value of the Note attribute.
Type: byte Lower: 1 Upper: 1
Set or get value of the Velocity attribute.
MIDI::XML::NoteOn is used for representing NoteOn objects MIDI::XML::NoteOn is a class encapsulating MIDI Note On messages. A Note On message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Note On event encoded in 3 bytes as follows:
1001cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = note number vvvvvvv = velocity
The classes for MIDI Note On messages and the other six channel messages are derived from MIDI::XML::Channel.
MIDI::XML::PolyKeyPressure is used for representing PolyKeyPressure objects MIDI::XML::PolyKeyPressure is a class encapsulating MIDI Poly Key Pressure messages. A Poly Key Pressure message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Poly Key Pressure event encoded in 3 bytes as follows:
1010cccc 0nnnnnnn 0ppppppp cccc = channel; nnnnnnn = note number ppppppp = pressure
The classes for MIDI Poly Key Pressure messages and the other six channel messages are derived from MIDI::XML::Channel.
Set or get value of the Pressure attribute.
MIDI::XML::ControlChangeMessage is used for representing ControlChangeMessage objects MIDI::XML::ControlChangeMessage is a class encapsulating MIDI Control Change messages. A Control Change message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Control Change event encoded in 3 bytes as follows:
1011cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = control number vvvvvvv = value
The classes for MIDI Control Change messages and the other six channel messages are derived from MIDI::XML::Channel.
MIDI::XML::ProgramChange is used for representing ProgramChange objects MIDI::XML::ProgramChange is a class encapsulating MIDI Program Change messages. A Program_Change message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Program Change event encoded in 2 bytes as follows:
1100cccc 0nnnnnnn cccc = channel; nnnnnnn = program number
The classes for MIDI Program Change messages and the other six channel messages are derived from MIDI::XML::Channel.
MIDI::XML::ChannelKeyPressure is used for representing ChannelKeyPressure objects MIDI::XML::ChannelKeyPressure is a class encapsulating MIDI Channel Key Pressure messages. A Channel Key Pressure message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Channel Key Pressure event encoded in 2 bytes as follows:
1101cccc 0ppppppp cccc = channel; ppppppp = pressure
The classes for MIDI Channel Key Pressure messages and the other six channel messages are derived from MIDI::XML::Channel.
MIDI::XML::PitchBendChange is used for representing PitchBendChange objects MIDI::XML::PitchBendChange is a class encapsulating MIDI Pitch Bend Change messages. A Pitch Bend Change message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Pitch Bend Change event encoded in 3 bytes as follows:
1110cccc 0xxxxxxx 0yyyyyyy cccc = channel; xxxxxxx = least significant bits yyyyyyy = most significant bits
The classes for MIDI Pitch Bend messages and the other six channel messages are derived from MIDI::XML::Channel.
Type: short Lower: 1 Upper: 1
MIDI::XML::AllSoundOff is used for representing AllSoundOff objects MIDI::XML::AllSoundOff is a class encapsulating MIDI All Sound Off messages. An All Sound Off message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI All Sound Off event encoded in 3 bytes as follows:
1011cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = control number (120) vvvvvvv = value (0)
MIDI::XML::ResetAllControllers is used for representing ResetAllControllers objects MIDI::XML::ResetAllControllers is a class encapsulating MIDI Reset All Controllers messages. A Reset All Controllers message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Reset All Controllers event encoded in 3 bytes as follows:
1011cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = control number (121) vvvvvvv = value (0)
MIDI::XML::LocalControl is used for representing LocalControl objects MIDI::XML::LocalControl is a class encapsulating MIDI Local Control messages. A Local Control message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Local Control event encoded in 3 bytes as follows:
1011cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = control number (122) vvvvvvv = value
MIDI::XML::AllNotesOff is used for representing AllNotesOff objects MIDI::XML::AllNotesOff is a class encapsulating MIDI All Notes Off messages. An All Notes Off message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI All Notes Off event encoded in 3 bytes as follows:
1011cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = control number (123) vvvvvvv = value (0)
MIDI::XML::OmniOff is used for representing OmniOff objects MIDI::XML::OmniOff is a class encapsulating MIDI Omni Off messages. An Omni Off message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Omni Off event encoded in 3 bytes as follows:
1011cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = control number (124) vvvvvvv = value (0)
MIDI::XML::OmniOn is used for representing OmniOn objects MIDI::XML::OmniOn is a class encapsulating MIDI Omni On messages. An Omni On message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Omni On event encoded in 3 bytes as follows:
1011cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = control number (125) vvvvvvv = value (0)
MIDI::XML::MonoMode is used for representing MonoMode objects MIDI::XML::MonoMode is a class encapsulating MIDI Mono Mode messages. A Mono Mode message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Mono Mode event encoded in 3 bytes as follows:
1011cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = control number (126) vvvvvvv = value
MIDI::XML::PolyMode is used for representing PolyMode objects MIDI::XML::PolyMode is a class encapsulating MIDI Poly Mode messages. A Poly Mode message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Poly Mode event encoded in 3 bytes as follows:
1011cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = control number (127) vvvvvvv = value (0)
MIDI::XML::ControlChange is used for representing ControlChange objects MIDI::XML::ControlChange is a class encapsulating MIDI Control Change messages. A Control Change message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Control Change event encoded in 3 bytes as follows:
Set or get value of the Control attribute.
MIDI::XML::ControlChange14 is used for representing ControlChange14 objects MIDI::XML::ControlChange14 is a class encapsulating MIDI Control Change messages. A Control Change message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Control Change event encoded in 6 bytes as follows:
1011cccc 0nnnnnnn 0vvvvvvv cccc = channel; nnnnnnn = control number vvvvvvv = value MSB
1011cccc 0nnnnnnn 0vvvvvvv
cccc = channel; nnnnnnn = control number + 32 vvvvvvv = value LSB
MIDI::XML::RPNChange is used for representing RPNChange objects
Set or get value of the RPN attribute.
MIDI::XML::NRPNChange is used for representing NRPNChange objects
Set or get value of the NRPN attribute.
MIDI::XML::SysEx is used for representing SysEx objects
MIDI::XML::SysExDeviceID is used for representing SysExDeviceID objects
Set or get value of the Multiplier attribute.
Set or get value of the Offset attribute.
MIDI::XML::SysExChannel is used for representing SysExChannel objects
MIDI::XML::MTCQuarterFrame is used for representing MTCQuarterFrame objects
Set or get value of the MessageType attribute.
Type: mtc_category Lower: 1 Upper: 1
Set or get value of the DataNibble attribute.
MIDI::XML::SongPositionPointer is used for representing SongPositionPointer objects
Set or get value of the Position attribute.
MIDI::XML::SongSelect is used for representing SongSelect objects
MIDI::XML::TuneRequest is a class encapsulating MIDI Tune Request messages. A Tune Request message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Tune Request event encoded in 1 byte as follows:
11110110
The class for MIDI Tune Request messages is derived from MIDI::XML::MIDISystemMessage.
MIDI::XML::TimingClock is a class encapsulating MIDI Timing Clock messages. A Timing Clock message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Timing Clock event encoded in 1 byte as follows:
11111000
The class for MIDI Timing Clock messages is derived from MIDI::XML::MIDISystemMessage.
MIDI::XML::Start is a class encapsulating MIDI Start messages. A Start message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Start event encoded in 1 byte as follows:
11111010
The class for MIDI Start messages is derived from MIDI::XML::MIDISystemMessage.
MIDI::XML::Continue is a class encapsulating MIDI Continue messages. A Continue message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Continue event encoded in 1 byte as follows:
11111011
The class for MIDI Continue messages is derived from MIDI::XML::MIDISystemMessage.
MIDI::XML::Stop is a class encapsulating MIDI Stop messages. A Stop message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Stop event encoded in 1 byte as follows:
11111100
The class for MIDI Stop messages is derived from MIDI::XML::MIDISystemMessage.
MIDI::XML::ActiveSensing is a class encapsulating MIDI Active Sensing messages. An Active Sensing message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI Active Sensing event encoded in 1 byte as follows:
11111110
The class for MIDI Active Sensing messages is derived from MIDI::XML::MIDISystemMessage.
MIDI::XML::SystemReset is a class encapsulating MIDI System Reset messages. A System Reset message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI System Reset event encoded in 1 byte as follows:
11111111
The class for MIDI System Reset messages is derived from MIDI::XML::MIDISystemMessage.
MIDI::XML::MIDISystemMessage is used for representing MIDISystemMessage objects
MIDI::XML::MIDIfile is used for representing MIDIfile objects
Set or get value of the Format attribute.
Format indicates MIDI format 0, 1, or 2. So far only types 0 and 1 are explicitly supported by the MIDI XML format. Type: int Lower: 1 Upper: 1
Set or get value of the TrackCount attribute.
TrackCount indicate the number of tracks in a file: 1 for type 0, usually more for types 1 and 2. The TrackCount matches the number of Track elements in the MIDI XML file. Type: int Lower: 1 Upper: 1
Set or get value of the TicksPerBeat attribute.
How many ticks in a beat (MIDI quarter note). Type: int Lower: 1 Upper: 1
Set or get value of the FrameRate attribute.
Frame rate and ticks per frame are used with SMPTE time codes. Type: int Lower: 1 Upper: 1
Set or get value of the TicksPerFrame attribute.
Set or get value of the TimestampType attribute.
TimestampType should be Delta or Absolute. Indicates the element name to look for in the initial timestamp in each MIDI event.
Type: timestamp_type Lower: 1 Upper: 1
Returns a reference to an array of the contained Track objects. Get values of the track property.
Type:
Set or get value of the track attribute.
MIDI::XML::Format is used for representing Format objects Format indicates MIDI format 0, 1, or 2. So far only types 0 and 1 are explicitly supported by the MIDI XML format.
MIDI::XML::TrackCount is used for representing TrackCount objects TrackCount indicate the number of tracks in a file: 1 for type 0, usually more for types 1 and 2. The TrackCount matches the number of Track elements in the MIDI XML file.
MIDI::XML::TicksPerBeat is used for representing TicksPerBeat objects How many ticks in a beat (MIDI quarter note).
MIDI::XML::FrameRate is used for representing FrameRate objects Frame rate and ticks per frame are used with SMPTE time codes.
MIDI::XML::TicksPerFrame is used for representing TicksPerFrame objects Frame rate and ticks per frame are used with SMPTE time codes.
MIDI::XML::TimestampType is used for representing TimestampType objects TimestampType should be Delta or Absolute. Indicates the element name to look for in the initial timestamp in each MIDI event.
MIDI::XML::Track is used for representing Track objects
Returns a reference to an array of the contained Event objects. Get values of the event property.
Type: ArrayRef
Set or get value of the event attribute.
Return Type: ArrayRef
Returns a the value of the first TrackName object in the Track.
Type: String
Returns the absolute time for the end of the track. If called with any parameter the value is refreshed before it is returned.
MIDI::XML::Event is used for representing Event objects
Set or get value of the Timestamp attribute.
Type: Timestamp Lower: 1 Upper: 1
Set or get value of the SmfEvent attribute.
Type: SmfEvent Lower: 1 Upper: 1
MIDI::XML::Timestamp is used for representing Timestamp objects
Set or get value of the Absolute attribute.
Set or get value of the Delta attribute.
MIDI::XML::Absolute is used for representing Absolute objects
Set or get value of the Absolute element.
MIDI::XML::Delta is used for representing Delta objects
Set or get value of the Delta element.
MIDI::XML::SmfEvent is used for representing SmfEvent objects
Set or get value of the ChannelMessage attribute.
Type: ChannelMessage Lower: 1 Upper: 1
Set or get value of the MetaEvent attribute.
Type: MetaEvent Lower: 1 Upper: 1
Set or get value of the SysExEvent attribute.
Type: SysExEvent Lower: 1 Upper: 1
MIDI::XML::SysExEvent is used for representing SysExEvent objects
MIDI::XML::SystemExclusive is used for representing SystemExclusive objects
MIDI::XML::EndOfExclusive is used for representing EndOfExclusive objects
MIDI::XML::timestamp_type - Module representing the timestamp_type enumeration.
Absolute => 'Absolute' Delta => 'Delta'
Returns an array of literal name-value pairs.
Returns a hash of literal name-value pairs.
MIDI::XML::control_change_enum - Module representing the control_change_enum enumeration.
BankSelectMSB => 0 ModulationWheelMSB => 1 BreathControllerMSB => 2 FootControllerMSB => 4 PortamentoTimeMSB => 5 DataEntryMSB => 6 ChannelVolumeMSB => 7 BalanceMSB => 8 PanMSB => 10 ExpressionControllerMSB => 11 EffectControl1MSB => 12 EffectControl2MSB => 13 GeneralPurposeController1MSB => 16 GeneralPurposeController2MSB => 17 GeneralPurposeController3MSB => 18 GeneralPurposeController4MSB => 19 BankSelectLSB => 32 ModulationWheelLSB => 33 BreathControllerLSB => 34 FootControllerLSB => 36 PortamentoTimeLSB => 37 DataEntryLSB => 38 ChannelVolumeLSB => 39 BalanceLSB => 40 PanLSB => 42 ExpressionControllerLSB => 43 EffectControl1LSB => 44 EffectControl2LSB => 45 GeneralPurposeController1LSB => 48 GeneralPurposeController2LSB => 49 GeneralPurposeController3LSB => 50 GeneralPurposeController4LSB => 51 DamperPedal => 64 Portamento => 65 Sostenuto => 66 SoftPedal => 67 LegatoFootswitch => 68 Hold2 => 69 SoundVariation => 70 Timbre => 71 ReleaseTime => 72 AttackTime => 73 Brightness => 74 DecayTime => 75 VibratoRate => 76 VibratoDepth => 77 VibratoDelay => 78 SoundController10 => 79 GeneralPurposeController5 => 80 GeneralPurposeController6 => 81 GeneralPurposeController7 => 87 GeneralPurposeController8 => 83 PortamentoControl => 84 ReverbSendLevel => 91 TremoloDepth => 92 ChorusSendLevel => 93 Effects4Depth => 94 Effects5Depth => 95 DataIncrement => 96 DataDecrement => 97 NonRegisteredParameterNumberLSB => 98 NonRegisteredParameterNumberMSB => 99 RegisteredParameterNumberLSB => 100 RegisteredParameterNumberMSB => 101
MIDI::XML::mtc_category - Module representing the mtc_category enumeration.
FrameLSNibble => 0 FrameMSNibble => 1 SecsLSNibble => 2 SecsMSNibble => 3 MinsLSNibble => 4 MinsMSNibble => 5 HrsLSNibble => 6 HrsMSNibbleSMPTEType => 7
Brian M. Ames, <bmames@apk.net>
XML::Parser.
Copyright 2008 Brian M. Ames. This software may be used under the terms of the GPL and Artistic licenses, the same as Perl itself.
8 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
You forgot a '=back' before '=head2'
To install MIDI::XML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MIDI::XML
CPAN shell
perl -MCPAN -e shell install MIDI::XML
For more information on module installation, please visit the detailed CPAN module installation guide.