Class: MIDIFX::Transpose

Inherits:
Object
  • Object
show all
Defined in:
lib/midi-fx/transpose.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(property, factor, options = {}) ⇒ Transpose

Returns a new instance of Transpose.



7
8
9
10
11
# File 'lib/midi-fx/transpose.rb', line 7

def initialize(property, factor, options = {})
  @factor = factor
  @property = property
  @name = options[:name]
end

Instance Attribute Details

#factorObject (readonly)

Returns the value of attribute factor.



5
6
7
# File 'lib/midi-fx/transpose.rb', line 5

def factor
  @factor
end

#propertyObject (readonly)

Returns the value of attribute property.



5
6
7
# File 'lib/midi-fx/transpose.rb', line 5

def property
  @property
end

Instance Method Details

#process(message) ⇒ Object



13
14
15
16
17
# File 'lib/midi-fx/transpose.rb', line 13

def process(message)
  val = message.send(@property)
  message.send("#{@property}=", val + @factor)
  message
end