Class: MIDIEvents::SystemExclusive::Message
- Inherits:
-
Object
- Object
- MIDIEvents::SystemExclusive::Message
- Includes:
- InstanceMethods
- Defined in:
- lib/midi-events/system_exclusive.rb
Overview
A SysEx message with no implied type
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Attributes included from InstanceMethods
Instance Method Summary collapse
- #==(other_message) ⇒ Object
-
#initialize(data, options = {}) ⇒ Message
constructor
A new instance of Message.
-
#to_a(options = {}) ⇒ Object
an array of message parts.
Methods included from InstanceMethods
#end_byte, #name, #start_byte, #to_hex_s, #to_numeric_byte_array, #type_byte
Constructor Details
#initialize(data, options = {}) ⇒ Message
Returns a new instance of Message.
95 96 97 98 99 100 101 102 |
# File 'lib/midi-events/system_exclusive.rb', line 95 def initialize(data, = {}) @data = if data.kind_of?(Array) && data.length == 1 data.first else data end initialize_sysex(nil, ) end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
93 94 95 |
# File 'lib/midi-events/system_exclusive.rb', line 93 def data @data end |
Instance Method Details
#==(other_message) ⇒ Object
118 119 120 121 |
# File 'lib/midi-events/system_exclusive.rb', line 118 def ==() self.class == .class && to_a == .to_a end |
#to_a(options = {}) ⇒ Object
an array of message parts. multiple byte parts will be represented as an array of bytes
105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/midi-events/system_exclusive.rb', line 105 def to_a( = {}) omit = [:omit] || [] node = @node.to_a() unless @node.nil? || omit.include?(:node) # this may need to be cached when properties are updated # might be worth benchmarking [ start_byte, node, @data, end_byte ].compact end |