Module: MIDIEvents::SystemExclusive::Builder

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(*bytes) ⇒ Object

Convert raw MIDI data to a SysEx message object



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

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

Instance Method Details

#build(*bytes) ⇒ Object

Convert raw MIDI data to a SysEx message object



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

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