Class: StepSequencer::SoundBuilder::DefaultEffects::Loop

Inherits:
Object
  • Object
show all
Defined in:
lib/step_sequencer/sound_builder/default_effects/loop.rb

Class Method Summary collapse

Class Method Details

.build(sources:, times:) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/step_sequencer/sound_builder/default_effects/loop.rb', line 5

def self.build(sources:, times:)
  num_full_loops = times.to_i # rounds down
  num_partial_loops = times - num_full_loops.to_f
  outfiles = build_full_loops(sources, num_full_loops)
  if num_partial_loops > 0
    outfiles = build_partial_loops(sources, outfiles, num_partial_loops)
  end
  outfiles
end