mrswatson 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +68 -0
- data/Rakefile +1 -0
- data/fixtures/guitarrig4.FXP +0 -0
- data/fixtures/input.mid +0 -0
- data/fixtures/input.wav +0 -0
- data/fixtures/output.wav +0 -0
- data/fixtures/sforzando.FXP +0 -0
- data/fixtures/test.rb +30 -0
- data/lib/mrswatson.rb +8 -0
- data/lib/mrswatson/io.rb +22 -0
- data/lib/mrswatson/plugin_chain.rb +35 -0
- data/lib/mrswatson/runner.rb +22 -0
- data/lib/mrswatson/util.rb +19 -0
- data/lib/mrswatson/version.rb +3 -0
- data/mrswatson.gemspec +23 -0
- data/spec/runner_spec.rb +38 -0
- data/spec/spec_helper.rb +22 -0
- metadata +96 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: fa49e99f15a517568f80e4a2c76955afb63bf089
|
4
|
+
data.tar.gz: 1a3937dc3b45eb9d9cba4e545f64086fb3451260
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2e51544caaca3f24bf3f7657caa1e844549e1df202b693f0f34371389ba65e7611fb5d6ea3e0da6f397d027907cdd222d65c1e11fc026eb98d90ac5de599483f
|
7
|
+
data.tar.gz: e1b65db94064d41c95c72021398bd12beec2b6849029e4a98c86bc125fb139c047fe2a01091377702ccb24cae77a361ae5d4da886c1d122fdac7c1f0a3057098
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 <cheeseandpepper>
|
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,68 @@
|
|
1
|
+
# MrsWatson Ruby Gem
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
First you MUST have MrsWatson installed. Visit http://teragonaudio.com/MrsWatson.html to install it.
|
8
|
+
|
9
|
+
From the command line, type
|
10
|
+
|
11
|
+
<pre><code>$ gem install mrswatson</code></pre>
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
This is a simple wrapper for MrsWatson, a command line vst host. Not all features are supported at this time but hopefully soon. This is an early release to get it out there and get feedback. For now this is OS X only, but that should change soon as well.
|
16
|
+
|
17
|
+
|
18
|
+
Step 1:
|
19
|
+
|
20
|
+
<pre><code>
|
21
|
+
io = MrsWatson::IO.new()
|
22
|
+
io.set_input("path/to/input")
|
23
|
+
io.set_output("path/to/output")
|
24
|
+
</code></pre>
|
25
|
+
|
26
|
+
The input file must be .mid or .wav depending on usage. The output is optional and will make use of MrsWatsons default output if none is specified.
|
27
|
+
|
28
|
+
Step 2:
|
29
|
+
|
30
|
+
<pre><code>
|
31
|
+
plugin_chain = MrsWatson::PluginChain.new()
|
32
|
+
plugin_chain.add_instrument("VSTi Name", "optional.FXP")
|
33
|
+
plugin_chain.add_effect("VST Name", "optional.FXP")
|
34
|
+
</code></pre>
|
35
|
+
|
36
|
+
Next you specify your plugin chain. If processing a midi file, you must include a VSTi to render the sound. For now only FXP files are supported to set the instrument settings. You can optionally chain as many effects as you want. The order in which you chain the effects is the order in which they will process.
|
37
|
+
|
38
|
+
|
39
|
+
Step 3:
|
40
|
+
|
41
|
+
|
42
|
+
<pre><code>
|
43
|
+
mrswatson = MrsWatson::Runner.new(io, plugin_chain)
|
44
|
+
mrswatson.sanitize
|
45
|
+
mrswatson.run
|
46
|
+
</code></pre>
|
47
|
+
|
48
|
+
|
49
|
+
The Runner class is what executes the program. It takes in the previously defined IO instance and PluginChain instance. It is strongly recommended (if not required) that you sanitize the instance before running it. I should probably refactor this to be part of the run method. Soon...
|
50
|
+
|
51
|
+
|
52
|
+
Additionally you can use the Util class
|
53
|
+
|
54
|
+
<pre><code>
|
55
|
+
util = MrsWatson::Util.new()
|
56
|
+
util.version
|
57
|
+
util.plugin_list
|
58
|
+
</code></pre>
|
59
|
+
|
60
|
+
The Util class currently supports version, and plugin_list which will give you the MrsWatson version installed and the list of plugins you have installed respectively. More Util methods to come in the future.
|
61
|
+
|
62
|
+
## Contributing
|
63
|
+
|
64
|
+
1. Fork it ( http://github.com/cheeseandpepper/mrswatson/fork )
|
65
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
66
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
67
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
68
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
Binary file
|
data/fixtures/input.mid
ADDED
Binary file
|
data/fixtures/input.wav
ADDED
Binary file
|
data/fixtures/output.wav
ADDED
Binary file
|
Binary file
|
data/fixtures/test.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require_relative 'runner'
|
2
|
+
require_relative 'plugin_chain'
|
3
|
+
require_relative 'util'
|
4
|
+
require_relative 'io'
|
5
|
+
|
6
|
+
plugin_chain = MrsWatson::PluginChain.new()
|
7
|
+
io = MrsWatson::IO.new
|
8
|
+
io.set_input("test.mid")
|
9
|
+
io.set_output("MIKE.wav")
|
10
|
+
|
11
|
+
|
12
|
+
# version = MrsWatson::Util.new()
|
13
|
+
# version.list_plugins
|
14
|
+
|
15
|
+
|
16
|
+
plugin_chain.add_instrument("sforzando", "sforzando.fxp")
|
17
|
+
plugin_chain.add_effect('Guitar Rig 4', "guitarrig4.FXP")
|
18
|
+
plugin_chain.sanitize
|
19
|
+
#puts plugin_chain.sanitize
|
20
|
+
|
21
|
+
# mrswatson.add_input("test.mid")
|
22
|
+
# mrswatson.add_output('mrswatson.wav')
|
23
|
+
# mrswatson.add_instrument("sforzando", "sforzando.FXP")
|
24
|
+
# #mrswatson.add_fxp("sforzando.FXP")
|
25
|
+
# mrswatson.add_effect('Guitar Rig 4', "guitarrig4.FXP")
|
26
|
+
# #mrswatson.add_fxp('guitarrig4.FXP')
|
27
|
+
|
28
|
+
mrswatson = MrsWatson::Runner.new(io, plugin_chain)
|
29
|
+
mrswatson.sanitize
|
30
|
+
mrswatson.run
|
data/lib/mrswatson.rb
ADDED
data/lib/mrswatson/io.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
module MrsWatson
|
2
|
+
class IO
|
3
|
+
attr_accessor :io
|
4
|
+
def initialize
|
5
|
+
@io = []
|
6
|
+
end
|
7
|
+
def set_input(input)
|
8
|
+
if input[-3..-1] == "mid"
|
9
|
+
@io << "-m #{input}"
|
10
|
+
elsif input[-3..-1] == "wav"
|
11
|
+
@io << "-i #{input}"
|
12
|
+
else
|
13
|
+
raise "Invalid Input Dude! - must be .wav or .mid"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
def set_output(output)
|
19
|
+
@io << "-o #{output}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module MrsWatson
|
2
|
+
|
3
|
+
class PluginChain
|
4
|
+
attr_accessor :plugin_chain
|
5
|
+
|
6
|
+
def initialize()
|
7
|
+
# @instrument = instrument
|
8
|
+
# @effect = effect
|
9
|
+
@plugin_chain = ["-p"]
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_instrument(instrument, fxp="")
|
13
|
+
if fxp == ""
|
14
|
+
@plugin_chain << "#{instrument};"
|
15
|
+
else
|
16
|
+
@plugin_chain << "#{instrument},#{fxp};"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
def add_effect(effect, fxp="")
|
22
|
+
if fxp == ""
|
23
|
+
@plugin_chain << "#{effect};"
|
24
|
+
else
|
25
|
+
@plugin_chain << "#{effect},#{fxp};"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def sanitize
|
30
|
+
@plugin_chain.flatten.join(" ").gsub("-p ", "-p '").gsub("; ", ";") << "'"
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module MrsWatson
|
2
|
+
class Runner
|
3
|
+
attr_accessor :plugin_chain, :io, :options
|
4
|
+
def initialize(io, plugin_chain, options="")
|
5
|
+
@command_chain = []
|
6
|
+
@plugin_chain = plugin_chain.plugin_chain
|
7
|
+
@io = io.io
|
8
|
+
@options = options
|
9
|
+
@command_chain << @io << @plugin_chain
|
10
|
+
end
|
11
|
+
|
12
|
+
def sanitize
|
13
|
+
@sanitized_chain = @command_chain.flatten.join(" ").gsub("-p ", "-p '").gsub("; ", ";") << "'"
|
14
|
+
end
|
15
|
+
|
16
|
+
def run
|
17
|
+
puts "#{@sanitized_chain}"
|
18
|
+
system("mrswatson #{@sanitized_chain}")
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module MrsWatson
|
2
|
+
class Util
|
3
|
+
def initialize()
|
4
|
+
@command = ["mrswatson"]
|
5
|
+
end
|
6
|
+
|
7
|
+
def list_plugins
|
8
|
+
@command << "--list-plugins"
|
9
|
+
system("#{@command.join(" ")}")
|
10
|
+
end
|
11
|
+
|
12
|
+
def version
|
13
|
+
@command << "-v"
|
14
|
+
system("#{@command.join(" ")}")
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
data/mrswatson.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'mrswatson/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "mrswatson"
|
8
|
+
spec.version = MrsWatson::VERSION
|
9
|
+
spec.authors = ["cheeseandpepper"]
|
10
|
+
spec.email = ["cheeseandpepper@gmail.com"]
|
11
|
+
spec.summary = %q{This is a ruby wrapper for the Mrs Watson command line utility.}
|
12
|
+
spec.description = %q{For usage and other details visit the github repo.}
|
13
|
+
spec.homepage = "http://github.com/cheeseandpepper/mrswatson-ruby"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
data/spec/runner_spec.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative 'spec_helper'
|
2
|
+
|
3
|
+
describe MrsWatson::Runner do
|
4
|
+
|
5
|
+
let(:io) { MrsWatson::IO.new() }
|
6
|
+
let(:plugin_chain) { MrsWatson::PluginChain.new() }
|
7
|
+
let(:runner) { MrsWatson::Runner.new(io, plugin_chain) }
|
8
|
+
# let(:mid_input) { "test.mid" }
|
9
|
+
# let(:wav_input) { "test.wav" }
|
10
|
+
# let(:other_input) { "test.txt" }
|
11
|
+
|
12
|
+
describe "#new" do
|
13
|
+
it 'creates a Runner object' do
|
14
|
+
runner.should be_an_instance_of MrsWatson::Runner
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# describe "input method arguments" do
|
19
|
+
# it 'can take .mid input' do
|
20
|
+
# expect { runner.add_input(mid_input) }.to_not raise_error
|
21
|
+
# end
|
22
|
+
|
23
|
+
# it 'can take .wav input' do
|
24
|
+
# expect { runner.add_input(wav_input) }.to_not raise_error
|
25
|
+
# end
|
26
|
+
|
27
|
+
# it 'raises an error for non-valid input' do
|
28
|
+
# expect { runner.add_input(other_input) }.to raise_error
|
29
|
+
# end
|
30
|
+
# end
|
31
|
+
|
32
|
+
describe "output method arguments" do
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "valid chain order" do
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require_relative '../lib/mrswatson/runner'
|
2
|
+
require_relative '../lib/mrswatson/plugin_chain'
|
3
|
+
require_relative '../lib/mrswatson/io'
|
4
|
+
require_relative '../lib/mrswatson/util'
|
5
|
+
|
6
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
7
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
8
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
9
|
+
# loaded once.
|
10
|
+
#
|
11
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
12
|
+
RSpec.configure do |config|
|
13
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
14
|
+
config.run_all_when_everything_filtered = true
|
15
|
+
config.filter_run :focus
|
16
|
+
|
17
|
+
# Run specs in random order to surface order dependencies. If you find an
|
18
|
+
# order dependency and want to debug it, you can fix the order by providing
|
19
|
+
# the seed, which is printed after each run.
|
20
|
+
# --seed 1234
|
21
|
+
config.order = 'random'
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mrswatson
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- cheeseandpepper
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: For usage and other details visit the github repo.
|
42
|
+
email:
|
43
|
+
- cheeseandpepper@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- ".rspec"
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- fixtures/guitarrig4.FXP
|
55
|
+
- fixtures/input.mid
|
56
|
+
- fixtures/input.wav
|
57
|
+
- fixtures/output.wav
|
58
|
+
- fixtures/sforzando.FXP
|
59
|
+
- fixtures/test.rb
|
60
|
+
- lib/mrswatson.rb
|
61
|
+
- lib/mrswatson/io.rb
|
62
|
+
- lib/mrswatson/plugin_chain.rb
|
63
|
+
- lib/mrswatson/runner.rb
|
64
|
+
- lib/mrswatson/util.rb
|
65
|
+
- lib/mrswatson/version.rb
|
66
|
+
- mrswatson.gemspec
|
67
|
+
- spec/runner_spec.rb
|
68
|
+
- spec/spec_helper.rb
|
69
|
+
homepage: http://github.com/cheeseandpepper/mrswatson-ruby
|
70
|
+
licenses:
|
71
|
+
- MIT
|
72
|
+
metadata: {}
|
73
|
+
post_install_message:
|
74
|
+
rdoc_options: []
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
requirements: []
|
88
|
+
rubyforge_project:
|
89
|
+
rubygems_version: 2.2.2
|
90
|
+
signing_key:
|
91
|
+
specification_version: 4
|
92
|
+
summary: This is a ruby wrapper for the Mrs Watson command line utility.
|
93
|
+
test_files:
|
94
|
+
- spec/runner_spec.rb
|
95
|
+
- spec/spec_helper.rb
|
96
|
+
has_rdoc:
|