Class: MIDIMessage::SystemExclusive::Message
- Inherits:
-
Object
- Object
- MIDIMessage::SystemExclusive::Message
- Includes:
- InstanceMethods
- Defined in:
- lib/midi-message/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
-
#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.
98 99 100 101 102 103 104 105 |
# File 'lib/midi-message/system_exclusive.rb', line 98 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.
96 97 98 |
# File 'lib/midi-message/system_exclusive.rb', line 96 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
108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/midi-message/system_exclusive.rb', line 108 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 |