chorus 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +37 -0
- data/Rakefile +1 -0
- data/bin/chorus +49 -0
- data/chorus.gemspec +19 -0
- data/lib/chorus/version.rb +3 -0
- data/lib/chorus.rb +18 -0
- metadata +55 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Stephen Schor
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Chorus
|
2
|
+
|
3
|
+
Chorus is a very simple way to turn your mac into a chorus of [throat singers.](http://www.youtube.com/watch?v=zwi6gF-0mP4)
|
4
|
+
It uses the `say` command.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
$ gem install chorus
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
$ chorus "I just met you. This is crazy. Here's my number. Call me maybe?"
|
13
|
+
$ chorus -h
|
14
|
+
Usage: chorus [options] "your lyrics go here"
|
15
|
+
-v Voices,You,Want,To,Sing, takes a comma-separated list of voices to use.
|
16
|
+
--voices
|
17
|
+
-d, --delay SECONDSOFDELAY The number of seconds in delay
|
18
|
+
--version Show version
|
19
|
+
-h, --help Show this message
|
20
|
+
|
21
|
+
$ chorus -d .0125 -v Kathy,Princess "Hey I just met you, This is crazy. Here's my number. Call me maybe?"
|
22
|
+
|
23
|
+
# Or Go Crazy....
|
24
|
+
|
25
|
+
bundle exec chorus -d .25 -v Fred,Fred,Fred,Fred,Fred,Fred,Fred,Fred,Fred,Fred,Fred,Fred,Fred,Fred,Fred,Fred,Fred,Fred "Echo Chamber Dub"
|
26
|
+
|
27
|
+
## Future Features
|
28
|
+
|
29
|
+
* Passing say commands in.
|
30
|
+
|
31
|
+
## Contributing
|
32
|
+
|
33
|
+
1. Fork it
|
34
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
35
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
36
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
37
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/chorus
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'chorus'
|
4
|
+
require 'optparse'
|
5
|
+
|
6
|
+
options = {}
|
7
|
+
|
8
|
+
opt_parser = OptionParser.new do |opts|
|
9
|
+
opts.banner = 'Usage: chorus [options] "your lyrics go here"'
|
10
|
+
|
11
|
+
opts.on('-v', '--voices Voices,You,Want,To,Sing', Array, 'takes a comma-separated list of voices to use.') do |voices|
|
12
|
+
options[:voices] = voices
|
13
|
+
end
|
14
|
+
|
15
|
+
opts.on('-d', '--delay SECONDSOFDELAY', 'The number of seconds in delay') do |delay|
|
16
|
+
options[:delay] = delay.to_f
|
17
|
+
end
|
18
|
+
|
19
|
+
opts.on_tail('-v', '--version', 'Show version') do
|
20
|
+
puts 'Chorus version ' + Chorus::VERSION
|
21
|
+
exit
|
22
|
+
end
|
23
|
+
|
24
|
+
# opts.on('-r', '--repeat TIMES', 'Number of times you repeat the lyrics') do |repeat|
|
25
|
+
# options[:repeat] = repeat.to_i
|
26
|
+
# end
|
27
|
+
|
28
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
29
|
+
puts opts
|
30
|
+
exit
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
begin
|
36
|
+
opt_parser.parse!
|
37
|
+
rescue OptionParser::MissingArgument => e
|
38
|
+
puts "ERROR: #{e.message.capitalize}\n#{opt_parser}"
|
39
|
+
exit
|
40
|
+
end
|
41
|
+
|
42
|
+
if ARGV.length == 0
|
43
|
+
puts 'Hmmmm - I don\'t know that song - try "chorus -h" for help'
|
44
|
+
exit
|
45
|
+
end
|
46
|
+
|
47
|
+
options.merge!(:text => ARGV.join(" "))
|
48
|
+
|
49
|
+
Chorus.new(options)
|
data/chorus.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'chorus/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "chorus"
|
8
|
+
gem.version = Chorus::VERSION
|
9
|
+
gem.authors = ["nodanaonlyzuul"]
|
10
|
+
gem.email = ["beholdthepanda@gmail.com"]
|
11
|
+
gem.description = %q{Using Ruby threads and mac's "say" command to make delay and chorus effects'}
|
12
|
+
gem.summary = %q{Using Ruby threads and mac's "say" command to make delay and chorus effects'}
|
13
|
+
gem.homepage = "https://github.com/nodanaonlyzuul/chorus"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
end
|
data/lib/chorus.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'chorus/version'
|
2
|
+
|
3
|
+
class Chorus
|
4
|
+
|
5
|
+
def initialize(options = {})
|
6
|
+
default_options = {:voices => ["Fred", "Kathy"]}
|
7
|
+
_options = default_options.merge!(options)
|
8
|
+
|
9
|
+
_options[:voices].each_with_index do |voice, i|
|
10
|
+
Thread.new do
|
11
|
+
`say -v #{voice} "#{_options[:text]}"`
|
12
|
+
end
|
13
|
+
sleep _options[:delay] if _options[:delay] && _options[:voices].length != i+1
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: chorus
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- nodanaonlyzuul
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-22 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Using Ruby threads and mac's "say" command to make delay and chorus effects'
|
15
|
+
email:
|
16
|
+
- beholdthepanda@gmail.com
|
17
|
+
executables:
|
18
|
+
- chorus
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- Gemfile
|
24
|
+
- LICENSE.txt
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- bin/chorus
|
28
|
+
- chorus.gemspec
|
29
|
+
- lib/chorus.rb
|
30
|
+
- lib/chorus/version.rb
|
31
|
+
homepage: https://github.com/nodanaonlyzuul/chorus
|
32
|
+
licenses: []
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
requirements: []
|
50
|
+
rubyforge_project:
|
51
|
+
rubygems_version: 1.8.24
|
52
|
+
signing_key:
|
53
|
+
specification_version: 3
|
54
|
+
summary: Using Ruby threads and mac's "say" command to make delay and chorus effects'
|
55
|
+
test_files: []
|