Skip to content

Instantly share code, notes, and snippets.

@youpy
Created November 16, 2012 12:29
Show Gist options
  • Save youpy/4086944 to your computer and use it in GitHub Desktop.
Save youpy/4086944 to your computer and use it in GitHub Desktop.
reich
require 'scissor_utils'
include ScissorUtils
filename = ARGV.shift
num = 400
src = Scissor(filename)
pitch = ((src.duration * (num - 1)) / (src.duration * num)) * 100
save(
(src * num).pan(0),
(src * (num - 1)).pitch(pitch).pan(100)
);
require 'fileutils'
require 'pathname'
require 'scissor'
module ScissorUtils
extend ScissorUtils
def save(*tapes)
executable = Pathname($0)
dst_dir = executable.dirname + ('_' + executable.basename.to_s)
unless dst_dir.exist?
dst_dir.mkdir
end
Scissor.mix(tapes, dst_dir + (Time.now.to_i.to_s + '.wav'), :overwrite => true)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment