Skip to content

Instantly share code, notes, and snippets.

@youpy
Created April 8, 2009 15:59
Show Gist options
  • Save youpy/91841 to your computer and use it in GitHub Desktop.
Save youpy/91841 to your computer and use it in GitHub Desktop.
#!/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