Created
April 8, 2009 15:59
-
-
Save youpy/91841 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'scissor' | |
if ARGV.size != 3 | |
puts "usage: #$0 infile textfile outfile" | |
exit | |
end | |
src, textfile, dst = ARGV | |
text = open(textfile).read | |
s = Scissor(src) | |
instruments = (?!..?~).to_a.inject({}) do |m, c| | |
m[c.chr.to_sym] = s[rand * (s.duration - 0.1), 0.1] | |
m | |
end | |
Scissor.sequence(text, 0.1).apply(instruments) >> dst |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment