Created
January 2, 2010 14:42
-
-
Save youpy/267514 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/echonest' | |
| require 'pit' | |
| config = Pit.get('echonest.com', :require => { | |
| 'api_key' => 'your Echo Nest API key' | |
| }) | |
| Scissor.echonest_api_key = config['api_key'] | |
| def main | |
| if ARGV.size != 2 | |
| puts "usage: #$0 infile outfile" | |
| exit | |
| end | |
| infile, outfile = ARGV | |
| results = [] | |
| Scissor(infile).beats.each_with_index do |beat, index| | |
| results << beat if index % 4 != 3 | |
| end | |
| Scissor.join(results) >> outfile | |
| end | |
| main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment