Module: MIDIMessage::ChannelMessage
- Includes:
- MIDIMessage
- Included in:
- ChannelAftertouch, Message, ControlChange, PitchBend, PolyphonicAftertouch, ProgramChange
- Defined in:
- lib/midi-message/channel_message.rb
Overview
Common behavior amongst Channel Message types
Defined Under Namespace
Modules: ClassMethods Classes: Accessors, Message
Constant Summary
Constants included from MIDIMessage
ChannelPressure, Controller, PolyAftertouch, PolyPressure, PolyphonicPressure, VERSION
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
-
.new(*data, &block) ⇒ RawChannelMessage
Shortcut to RawChannelMessage.new aka build a ChannelMessage from raw nibbles and bytes eg ChannelMessage.new(0x9, 0x0, 0x40, 0x40).
Instance Method Summary collapse
Methods included from MIDIMessage
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/midi-message/channel_message.rb', line 8 def data @data end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/midi-message/channel_message.rb', line 8 def name @name end |
Class Method Details
.new(*data, &block) ⇒ RawChannelMessage
Shortcut to RawChannelMessage.new aka build a ChannelMessage from raw nibbles and bytes eg ChannelMessage.new(0x9, 0x0, 0x40, 0x40)
15 16 17 |
# File 'lib/midi-message/channel_message.rb', line 15 def self.new(*data, &block) Message.new(*data, &block) end |
Instance Method Details
#initialize(*data) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/midi-message/channel_message.rb', line 20 def initialize(*data) data = data.dup = data.last.kind_of?(Hash) ? data.pop : {} add_constant_value([:const], data) unless [:const].nil? (self.class.type_for_status, *data) end |