lib/beats/song_optimizer.rb
def optimize(original_song, max_pattern_length)
      # 1.) Create a new song, cloned from the original
      optimized_song = original_song.copy_ignoring_patterns_and_flow

      # 2.) Subdivide patterns
      optimized_song = subdivide_song_patterns(original_song, optimized_song, max_pattern_length)

      # 3.) Prune duplicate patterns
      optimized_song = prune_duplicate_patterns(optimized_song)

      optimized_song
    end
# Returns a Song that will produce the same output as original_song, but should be
# generated faster.
Returns a Song that will produce the same output as original_song, but should be
generated faster.
Returns a Song that will produce the same output as original_song but should be generated faster .
def optimize(original_song, max_pattern_length)
      optimized_song = original_song.copy_ignoring_patterns_and_flow
      optimized_song = subdivide_song_patterns(original_song, optimized_song, max_pattern_length)
      optimized_song = prune_duplicate_patterns(optimized_song)
      optimized_song
    end
def optimize ( original_song , max_pattern_length ) optimized_song = original_song . copy_ignoring_patterns_and_flow optimized_song = subdivide_song_patterns ( original_song , optimized_song , max_pattern_length ) optimized_song = prune_duplicate_patterns ( optimized_song ) optimized_song end
Returns a Song that will produce the same output as original_song, but should be
generated faster.
Returns a Song that will produce the same output as original_song but should be generated faster .
# 1.) Create a new song, cloned from the original # 2.) Subdivide patterns # 3.) Prune duplicate patterns
original_song
max_pattern_length