Module: MIDIEvents::ChannelMessage
- Includes:
- MIDIEvents
- Included in:
- ChannelAftertouch, Message, ControlChange, PitchBend, PolyphonicAftertouch, ProgramChange
- Defined in:
- lib/midi-events/channel_message.rb
Overview
Common behavior amongst Channel Message types
Defined Under Namespace
Modules: ClassMethods Classes: Accessors, Message
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
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
6 7 8 |
# File 'lib/midi-events/channel_message.rb', line 6 def data @data end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/midi-events/channel_message.rb', line 6 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)
13 14 15 |
# File 'lib/midi-events/channel_message.rb', line 13 def self.new(*data, &block) Message.new(*data, &block) end |
Instance Method Details
#initialize(*data) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/midi-events/channel_message.rb', line 18 def initialize(*data) data = data.dup = data.last.is_a?(Hash) ? data.pop : {} add_constant_value([:const], data) unless [:const].nil? (self.class.type_for_status, *data) end |