MrsWatson

NOTE: This software is unsupported and is no longer being updated or maintained. It likely will not work on newer versions of macOS.

MrsWatson is a command-line audio plugin host. It takes an audio and/or MIDI file as input, and processes it through one or more audio plugins. Currently MrsWatson only supports VST 2.x plugins, but more formats are planned in the future. MrsWatson was designed for primarily three purposes:

  • Audio plugin development and testing
  • Automated audio processing for servers or other applications
  • Unit testing audio plugins

Examples

Say you have an audio file which you would like processed through a group of mastering plugins.

mrswatson --input mysong.pcm --output out.pcm --plugin plugin1;plugin2

This will print the following output:

- 00000000 000000 Plugin 'plugin1' is of type VST2.x
- 00000000 000000 Plugin 'plugin2' is of type VST2.x
- 00000000 000000 MrsWatson version 0.1.0 initialized
- 00000000 000000 Opening VST2.x plugin 'plugin1'
- 00000000 000029 Opening VST2.x plugin 'plugin2'
- 00000000 000144 Processing with samplerate 44100, blocksize 512, 2 channels
- 03532800 000204 Total processing time 60ms, approximate breakdown by component:
- 03532800 000204   plugin1: 38ms
- 03532800 000204   plugin2: 11ms
- 03532800 000204   MrsWatson: 11ms
- 03532800 000204 Read 3528000 frames from mysong.pcm, wrote 3532800 frames to out.pcm
- 03532800 000204 Shutting down
- 03532800 000210 Closing plugin 'plugin1'
- 03532800 000212 Closing plugin 'plugin2'
- 03532800 000212 Goodbye!

To see more or less logging output, use the --verbose or --quiet options, respectively. MrsWatson generates colored output (if your terminal supports it) with two times per line, the first for the current sample and the second for the time in milliseconds since processing began. The sample time also changes colors after every 44100 samples to help visually break up processing times. This value can be changed with the --zebra-size option.

To process a MIDI file through an instrument, you’d do something like this:

mrswatson --midi-file mysong.mid --output out.pcm --plugin piano,soft.fxp

Like the first example, a list of plugins separated with semi-colons can be given here so that the audio generated by the instrument can be processed through any number of effects. Each plugin name can be followed by a comma and the location to a preset file to be loaded before processing.

Complete help for MrsWatson can be found by running the program with no arguments, or with --help. The --help switch prints quite a lot of output, so you can also use --options to see all supported options and their default values.

Loading Plugins

Currently, MrsWatson loads plugins by their short name by searching in the standard installation locations for your platform, as well as the current working directory and by absolute path. Use the --list-plugins option to see the order of locations searched and the plugins found there.

While MrsWatson has some understanding of getting and setting plugin parameters, it does not extend this functionality to the end user. Rather than passing a huge list of parameters on the command line, one should instead create a preset for the plugin and load it with the comma-separated syntax as shown above.

Limitations

As MrsWatson is a new codebase, there are lots of missing features, some more important than others. To encourage a quick initial release, the following features are not yet present in MrsWatson, but may be added at some point in the future:

  • AudioUnit plugins on Mac OSX
  • File support for compressed audio
  • Resampling of input source if desired
  • True realtime mode

I have also tried to identify incomplete areas of the code and log them to the console, which means that we are aware that this feature is missing and will be added soon. If you see some other missing functionality or experience a crash or other bug, please report an issue on the project page.

Bug Reporting

If you believe you have found a bug in MrsWatson, please try first running it with the --verbose argument. This will generate extra logging output which may help to solve the problem.

The easiest way to report a bug is to send an email to Teragon Audio’s support address: support (at) teragonaudio (dot) com. MrsWatson has a special command-line switch to aid in diagnosing runtime problems, --error-report. When enabled it will create a zipfile on the desktop containing the input, output, logs, and optionally the plugins themselves. Please include these reports for bugs resulting in incorrect behavior or crashes.

A test suite program, named mrswatsontest, can be found in the Mrswatson zipfile. If tests fail on your platform, please report this along with your bug.

MrsWatson uses GitHub issues for bug reporting, if you would like to submit an issue yourself.

Building

Instructions for building MrsWatson can be found in the file Building.txt.

History and Name

MrsWatson takes its name from a prior product from Teragon Audio called MissWatson (and the original name there, in case you were wondering, is a bit of a joke on the Dr. Watson utility).

In 2009 I sold the exclusive rights to MissWatson to a company interested in using it for server-side audio processing. As per the terms of our agreement, I made one last public release, and removed the code from my website. Since then, I have received numerous emails and inquiries regarding the project, mostly from plugin developers or people interested in VST technology. Though I have no regrets about discontinuing the original MissWatson (particularly since I didn’t have time to properly maintain it), I felt that it was a useful utility which should be made available and open-sourced.

In 2011, my NDA with the aforementioned company expired, and I started working on a new MissWatson. MrsWatson is the result of this labor.

As I no longer have the source code for MissWatson, MrsWatson is a black-box implementation. They share only the name and concept in common. The two programs are incompatible and have fundamentally different behavior. They are also written in different languages (the original in C++, MrsWatson in C), and have completely different internal architecture.

But just as wildfires usher in new growth, the rewrite of MissWatson to MrsWatson has had some advantages as well. Benchmarking the old application against the new one shows that the rewrite performs over twice as fast as the previous version! Additionally, the new version is much more portable, easier to maintain, and extensible than its predecessor.

If you have built some system which used the original MissWatson, then you will likely have to make some big changes to migrate to MrsWatson. Likewise, if you were using some of the original MissWatson code in your project, you will not be able to replace it with MrsWatson without significant work on your end. Migration to the new MrsWatson is strongly encouraged.

If you are using MrsWatson to do something cool, please send me a link to your project! If you appreciate MrsWatson and would like to donate money, please instead make a donation to a charity on our behalf, and let us know about it. The organizations which have helped us the most are:

  • EFF: Without the EFF, programs like MrsWatson would be significantly harder to create and distribute.
  • Wikipedia: Writing MrsWatson involves a lot of research as well as coding, and Wikipedia is an essential part of this.

Special Thanks

Big additional thanks to:

  • Andrew McCrea, (@thrusong)
  • Michael Pruett, (@mpruett)

Licensing

MrsWatson is made available under the BSD license. For more details, see the LICENSE.txt file distributed with the source code. MrsWatson also uses the following third-party libraries, which are licensed under the respective agreements:

  • VST: Licensed under Steinberg’s VST SDK license agreement, version 2.4. For more information, see Steinberg’s developer portal.
  • libaudiofile: Written by Michael Pruett, licensed under GNU Library General Public License.

Changelog:

Version 0.9.7:

  • New command-line option for setting parameters
  • Ensure that executable runs on 10.5 and above
  • Now have a single option for setting time signature
  • Handle key signature & proprietary MIDI meta events
  • Fix several small memory leaks
  • Fix several crashes
  • Log CPU usage overloads
  • Bugfixes, tests with 32/64 bit detection
  • Bugfixes, tests with big/little endian detection
  • New and more robust file API
  • Fix CMake project generation on Mac/Windows
  • Allow test suite to show log output from app
  • Improve internal documentation

Version 0.9.6:

  • Compatibility with VST shell plugins (including Waves plugins)
  • Compatibility fixes with plugins that declare more than 2 outputs (including Independence)
  • Compatibility fixes for Chainer and other plugins which rely on VstEvents* struct to remain in memory during processReplacing()
  • MrsWatson now sends correct musical time in PPQ/Bars when asked by plugin
  • Add 64-bit binaries to distribution zipfile (experimental)
  • Fix tons of memory leaks; test suite now runs with 0 bytes leaked
  • Fix several memory corruption bugs, valgrind now runs test suite with no errors
  • Windows build migrated to cmake
  • Several other bugfixes and small improvements

Version 0.9.5:

  • Better support for MIDI meta events. Tempo and time signature are now correctly read from MIDI files.
  • Fix a bug where MrsWatson would not know when to stop processing an instrument plugin chain.
  • Fix a bug where some monophonic VSTi’s would not receive notes data in an expected format.
  • Fix some memory corruption bugs.
  • Improved application test suite.

Version 0.9.4:

  • Fix several heap corruption bugs
  • Fix build on linux
  • Organizing code into packages
  • Various small bugfixes
  • Improve test coverage

Version 0.9.3:

  • Introduce CMake as build system for unix platforms (Linux & Mac OSX)
  • Several crash fixes reported by users
  • Ability to generate diagnostic error reports
  • Improved logging
  • Improved test coverage
  • More accurate time recording on all platforms
  • Other small improvements
  • FXP presets with chunks now supported

Version 0.9.2:

  • Using Visual Studio to build on Windows
  • Introduced test suite, though test coverage is current small
  • Experimental native support for writing WAVE data (only active for the Windows build right now).
  • Update to audiofile 0.3.4
  • Fix a number of Windows bugs
  • Improved log formatting
  • Can send time in PPQ
  • Command line option for manually setting MIDI time division

Version 0.9.1:

  • Switching from libaiff to audiofile (provides WAV support)

Version 0.9.0: (No comment)