Class MIDI::Event
In: lib/midilib/event.rb
Parent: Object

The abstract superclass of all MIDI events.

Methods

Attributes

delta_time  [RW]  Modifying delta_time does not affect time_from_start. You need to call the event‘s track‘s recalc_time method.
print_channel_numbers_from_one  [RW]  Determines if to_s outputs MIDI channel numbers from 1-16 instead of the default 0-15.
print_decimal_numbers  [RW]  Determines if to_s outputs numbers as hex (false, the default) or decimal # (true). Delta times are always printed as decimal.
print_note_names  [RW]  Determines if to_s outputs hex note numbers (false, the default) or decimal note names (true).
status  [R]  The MIDI status byte. Never includes the channel, which is held separately by MIDI::ChannelEvent.
time_from_start  [RW]  The start time of this event from the beginning of the track. This value is held here but is maintained by the track.

Public Class methods

Public Instance methods

For sorting. Uses @time_from_start, which is maintained by this event‘s track. I‘m not sure this is necessary, since each track has to maintain its events’ time-from-start values anyway.

Returns true if this is a channel event.

Returns val as a decimal or hex string, depending upon the value of @print_decimal_numbers.

Returns the raw bytes that are written to a MIDI file or output to a MIDI stream. In MIDI::EVENT this raises a "subclass responsibility" exception.

Returns true if this is a key signature event.

Returns true if this is a meta event.

Returns true if this is a note on, note off, or polyphonic pressure event.

Returns true if this is a note off event.

Returns true if this is a note on event.

Returns val as a decimal or hex string, depending upon the value of @print_decimal_numbers.

Returns true if this is a program change.

Quantize this event‘s time_from_start by moving it to the nearest multiple of boundary. See MIDI::Track#quantize. Note: does not modify the event‘s delta_time, though MIDI::Track#quantize calls recalc_delta_from_times after it asks each event to quantize itself.

Returns true if this is a realtime status byte.

Returns true if this is a system message event.

Returns true if this is a time signature event.

[Validate]