Class: MIDIMessage::SystemExclusive::Message
- Inherits:
-
Object
- Object
- MIDIMessage::SystemExclusive::Message
- Includes:
- Base
- Defined in:
- lib/midi-message/system_exclusive.rb
Overview
A SysEx message with no implied type
Constant Summary
Constants included from Base
Base::EndByte, Base::StartByte
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Attributes included from Base
Instance Method Summary collapse
-
#initialize(data, options = {}) ⇒ Message
constructor
A new instance of Message.
-
#to_a(options = {}) ⇒ Object
an array of message parts.
Methods included from Base
#name, #to_hex_s, #to_numeric_byte_array, #type_byte
Constructor Details
#initialize(data, options = {}) ⇒ Message
Returns a new instance of Message.
141 142 143 144 |
# File 'lib/midi-message/system_exclusive.rb', line 141 def initialize(data, = {}) @data = (data.kind_of?(Array) && data.length.eql?(1)) ? data[0] : data initialize_sysex(nil, ) end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
139 140 141 |
# File 'lib/midi-message/system_exclusive.rb', line 139 def data @data end |
Instance Method Details
#to_a(options = {}) ⇒ Object
an array of message parts. multiple byte parts will be represented as an array of bytes
147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/midi-message/system_exclusive.rb', line 147 def to_a( = {}) omit = [:omit] || [] # this may need to be cached when properties are updated # might be worth benchmarking [ self.class::StartByte, (@node.to_a() unless @node.nil? || omit.include?(:node)), @data, self.class::EndByte ].compact end |