Skip to content

Instantly share code, notes, and snippets.

@youpy
Created June 4, 2012 03:17
Show Gist options
  • Save youpy/2866136 to your computer and use it in GitHub Desktop.
Save youpy/2866136 to your computer and use it in GitHub Desktop.
require 'scissor'
def main
16.times.inject([[random_sequence], Scissor()]) do |memo, i|
memo[1] += (mix(memo[0], 'tracks_%i.wav' % i) * 8)
memo[0] << random_sequence
memo
end[1] >> 'result.wav'
end
def mix(tracks, filename)
Scissor.mix(tracks, filename, :overwrite => true)
end
def random_tape
# http://beatsdrummachine.com/hammerhead_drum_sounds.zip
Scissor(Dir[File.expand_path('~/Downloads/hammerhead_drum_sounds/*.wav')].sample)
end
def random_sequence
Scissor.sequence(16.times.map {|i| rand > rand ? 'x' : ' '}.join(''), 60.0 / 105 / 4).apply(:x => random_tape)
end
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment