Module: MIDIMessage::SystemExclusive::Builder

Extended by:
Builder
Included in:
Builder
Defined in:
lib/midi-message/system_exclusive.rb

Instance Method Summary collapse

Instance Method Details

#build(*bytes) ⇒ Object

Convert raw MIDI data to a SysEx message object


188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/midi-message/system_exclusive.rb', line 188

def build(*bytes)
  if is_sysex?(bytes)

    # if the 4th byte isn't status, we will just make this a Message object
    #   -- this may need some tweaking
    message_class = get_message_class(bytes)

    if message_class.nil?
      Message.new(bytes)
    else
      build_typed_message(message_class, bytes)
    end
  end

end