Class: Deftones::Core::Gain
Instance Attribute Summary collapse
-
#gain ⇒ Object
Returns the value of attribute gain.
Instance Method Summary collapse
-
#initialize(gain: 1.0, context: Deftones.context) ⇒ Gain
constructor
A new instance of Gain.
- #multichannel_process? ⇒ Boolean
- #process(input_block, num_frames, start_frame, _cache) ⇒ Object
Constructor Details
Instance Attribute Details
#gain ⇒ Object
Returns the value of attribute gain.
6 7 8 |
# File 'lib/deftones/core/gain.rb', line 6 def gain @gain end |
Instance Method Details
#multichannel_process? ⇒ Boolean
17 18 19 |
# File 'lib/deftones/core/gain.rb', line 17 def multichannel_process? true end |
#process(input_block, num_frames, start_frame, _cache) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/deftones/core/gain.rb', line 21 def process(input_block, num_frames, start_frame, _cache) gain_values = @gain.process(num_frames, start_frame) AudioBlock.from_channel_data( input_block.channel_data.map do |channel| Array.new(num_frames) { |index| channel[index] * gain_values[index] } end ) end |