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
-
#address ⇒ Object
included
from InstanceMethods
readonly
Returns the value of attribute address.
-
#checksum ⇒ Object
included
from InstanceMethods
readonly
alternate method from http://www.2writers.com/eddie/TutSysEx.htm.
-
#data ⇒ Object
Returns the value of attribute data.
-
#node ⇒ Object
included
from InstanceMethods
Returns the value of attribute node.
Instance Method Summary collapse
- #==(other_message) ⇒ Object
- #end_byte ⇒ Object included from InstanceMethods
-
#initialize(data, options = {}) ⇒ Message
constructor
A new instance of Message.
- #name ⇒ Object (also: #verbose_name) included from InstanceMethods
- #start_byte ⇒ Object included from InstanceMethods
-
#to_a(options = {}) ⇒ Object
an array of message parts.
-
#to_hex_s ⇒ Object
(also: #to_bytestr)
included
from InstanceMethods
string representation of the object's bytes.
-
#to_numeric_byte_array(options = {}) ⇒ Object
(also: #to_numeric_bytes, #to_byte_array, #to_bytes, #to_byte_a)
included
from InstanceMethods
a flat array of message bytes.
- #type_byte ⇒ Object included from InstanceMethods
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
#address ⇒ Object (readonly) Originally defined in module InstanceMethods
Returns the value of attribute address.
#checksum ⇒ Object (readonly) Originally defined in module InstanceMethods
alternate method from http://www.2writers.com/eddie/TutSysEx.htm
#data ⇒ Object
Returns the value of attribute data.
93 94 95 |
# File 'lib/midi-events/system_exclusive.rb', line 93 def data @data end |
#node ⇒ Object Originally defined in module InstanceMethods
Returns the value of attribute node.
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 |
#end_byte ⇒ Object Originally defined in module InstanceMethods
#name ⇒ Object Also known as: verbose_name Originally defined in module InstanceMethods
#start_byte ⇒ Object Originally defined in module InstanceMethods
#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 |
#to_hex_s ⇒ Object Also known as: to_bytestr Originally defined in module InstanceMethods
string representation of the object's bytes
#to_numeric_byte_array(options = {}) ⇒ Object Also known as: to_numeric_bytes, to_byte_array, to_bytes, to_byte_a Originally defined in module InstanceMethods
a flat array of message bytes