Class: MIDIMessage::RawChannelMessage

Inherits:
Object
  • Object
show all
Includes:
ChannelMessage, ShortMessage
Defined in:
lib/midi-message/channel_message.rb

Overview

use this if you want to instantiate a raw channel message

example = ChannelMessage.new(0x9, 0x0, 0x40, 0x57) # creates a raw note-on message

Instance Attribute Summary

Attributes included from ChannelMessage

#data, #name

Attributes included from ShortMessage

#name, #status, #verbose_name

Instance Method Summary collapse

Methods included from ChannelMessage

#initialize_properties, new

Methods included from ShortMessage

#initialize_short_message, #to_a, #to_hex_s

Constructor Details

#initialize(*a) ⇒ RawChannelMessage

Returns a new instance of RawChannelMessage.



96
97
98
# File 'lib/midi-message/channel_message.rb', line 96

def initialize(*a)
  initialize_channel_message(*a)
end

Instance Method Details

#to_typeObject



100
101
102
103
# File 'lib/midi-message/channel_message.rb', line 100

def to_type
  status = (@status[0] << 4) + (@status[1])
  MIDIMessage.parse(status, *@data)
end