The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

MIDI::XML::SystemExclusive - MIDI System Exclusive messages.

SYNOPSIS

  use MIDI::XML::SystemExclusive;
  use MIDI::Track;

  $Sys_Excl = MIDI::XML::SystemExclusive->new();
  $Sys_Excl->delta(384);
  $Sys_Excl->data(pack('C*',65,16,66,18,64,0,127,0,65,247));
  @event = $Sys_Excl->as_event();
  $midi_track = MIDI::Track->new();
  push( @{$midi_track->events_r},\@event;
  @xml = $Sys_Excl->as_MidiXML();
  print join("\n",@xml);

DESCRIPTION

MIDI::XML::SystemExclusive is a class encapsulating MIDI System Exclusive messages. A System Exclusive message includes either a delta time or absolute time as implemented by MIDI::XML::Message and the MIDI System Exclusive event encoded as follows:

11110000 0mmmmmmm data 11110111

mmmmmmm = Manufacturer ID/Universal ID

EXPORT

None.

METHODS AND ATTRIBUTES

$Sys_Excl = MIDI::XML::SystemExclusive->new();

This creates a new MIDI::XML::SystemExclusive object.

$Sys_Excl = MIDI::XML::SystemExclusive->new($event);

Creates a new SystemExclusive object initialized with the values of a MIDI::Event sysex_f0 array.

$delta_time = $Sys_Excl->delta() or $Sys_Excl->delta($delta_time);

Returns the message time as a delta time or undef if it is an absolute time. Optionally sets the message time to the specified delta time. To avoid contradictory times, the absolute time is set to undef when a delta time is set.

This functionality is provided by the MIDI::XML::Message base class.

$absolute_time = $Sys_Excl->absolute() or $Sys_Excl->absolute($absolute_time);

Returns the message time as an absolute time or undef if it is a delta time. Optionally sets the message time to the specified absolute time. To avoid contradictory times, the delta time is set to undef when an absolute time is set.

This functionality is provided by the MIDI::XML::Message base class.

$time = $Sys_Excl->time();

Returns the message time, absolute or delta, whichever was last set.

This functionality is provided by the MIDI::XML::Message base class.

$data = $Sys_Excl->data() or $Sys_Excl->data($data);

Returns and optionally sets the data content.

@event = $Sys_Excl->as_event();

Returns a MIDI::Event sysex_f0 array initialized with the values of the System Exclusive object. MIDI::Event does not expect absolute times and will interpret them as delta times. Calling this method when the time is absolute will not generate a warning or error but it is unlikely that the results will be satisfactory.

@xml = $Sys_Excl->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">

AUTHOR

Brian M. Ames, <bmames@apk.net>

SEE ALSO

MIDI::Event.

COPYRIGHT and LICENSE

Copyright 2002 Brian M. Ames. This software may be used under the terms of the GPL and Artistic licenses, the same as Perl itself.