Class: MIDIMessage::Process::Transpose
- Inherits:
-
Object
- Object
- MIDIMessage::Process::Transpose
- Includes:
- Processor
- Defined in:
- lib/midi-message/process/transpose.rb
Instance Attribute Summary collapse
-
#factor ⇒ Object
readonly
Returns the value of attribute factor.
-
#property ⇒ Object
readonly
Returns the value of attribute property.
Instance Method Summary collapse
-
#initialize(prop, factor, options = {}) ⇒ Transpose
constructor
A new instance of Transpose.
- #process_single(message) ⇒ Object
Methods included from Processor
Constructor Details
#initialize(prop, factor, options = {}) ⇒ Transpose
Returns a new instance of Transpose.
13 14 15 16 17 18 |
# File 'lib/midi-message/process/transpose.rb', line 13 def initialize(prop, factor, = {}) @factor = factor @property = prop initialize_processor() end |
Instance Attribute Details
#factor ⇒ Object (readonly)
Returns the value of attribute factor.
11 12 13 |
# File 'lib/midi-message/process/transpose.rb', line 11 def factor @factor end |
#property ⇒ Object (readonly)
Returns the value of attribute property.
11 12 13 |
# File 'lib/midi-message/process/transpose.rb', line 11 def property @property end |
Instance Method Details
#process_single(message) ⇒ Object
20 21 22 23 24 |
# File 'lib/midi-message/process/transpose.rb', line 20 def process_single() val = .send(@property) .send("#{@property}=", val + @factor) end |