├── .gitignore ├── LICENSE.md ├── MrsWatson └── bin │ ├── darwin │ ├── mrswatson │ ├── mrswatson64 │ ├── mrswatsontest │ └── mrswatsontest64 │ ├── linux │ ├── mrswatson │ ├── mrswatson64 │ ├── mrswatsontest │ └── mrswatsontest64 │ └── win32 │ ├── mrswatson.exe │ ├── mrswatson64.exe │ ├── mrswatsontest.exe │ └── mrswatsontest64.exe ├── README.md ├── node-vst-host.js ├── package.json └── test.js /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT license 2 | 3 | Copyright (c) 2013 Michael Vegeto (michael.vegeto@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and 6 | associated documentation files (the "Software"), to deal in the Software without restriction, 7 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 8 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all copies or 12 | substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 15 | NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 16 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 17 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | Code for MrsWatson and dependencies are subject to their own licenses, 21 | which can be found at: https://github.com/teragonaudio/MrsWatson/blob/master/LICENSE.txt -------------------------------------------------------------------------------- /MrsWatson/bin/darwin/mrswatson: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/darwin/mrswatson -------------------------------------------------------------------------------- /MrsWatson/bin/darwin/mrswatson64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/darwin/mrswatson64 -------------------------------------------------------------------------------- /MrsWatson/bin/darwin/mrswatsontest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/darwin/mrswatsontest -------------------------------------------------------------------------------- /MrsWatson/bin/darwin/mrswatsontest64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/darwin/mrswatsontest64 -------------------------------------------------------------------------------- /MrsWatson/bin/linux/mrswatson: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/linux/mrswatson -------------------------------------------------------------------------------- /MrsWatson/bin/linux/mrswatson64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/linux/mrswatson64 -------------------------------------------------------------------------------- /MrsWatson/bin/linux/mrswatsontest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/linux/mrswatsontest -------------------------------------------------------------------------------- /MrsWatson/bin/linux/mrswatsontest64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/linux/mrswatsontest64 -------------------------------------------------------------------------------- /MrsWatson/bin/win32/mrswatson.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/win32/mrswatson.exe -------------------------------------------------------------------------------- /MrsWatson/bin/win32/mrswatson64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/win32/mrswatson64.exe -------------------------------------------------------------------------------- /MrsWatson/bin/win32/mrswatsontest.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/win32/mrswatsontest.exe -------------------------------------------------------------------------------- /MrsWatson/bin/win32/mrswatsontest64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZECTBynmo/node-vst-host/f8fef21b89b9a98ed6dd8bac099d584b5c0df2c0/MrsWatson/bin/win32/mrswatsontest64.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # node-vst-host 2 | 3 | https://github.com/ZECTBynmo/node-vst-host 4 | 5 | A (thin) wrapper for [MrsWatson] (https://github.com/teragonaudio/MrsWatson) that allows you to process audio files using VST plugins 6 | 7 | ### Installation 8 | 9 | ``` 10 | npm install node-vst-host 11 | ``` 12 | 13 | ### Usage 14 | 15 | ```javascript 16 | var VSTHost = require("./node-vst-host").host; 17 | 18 | var host = new VSTHost(); 19 | 20 | // Print our a list of the available plugins 21 | host.listPlugins( function(names) { 22 | console.log( "Available Plugins"); 23 | console.log( names ); 24 | }); 25 | 26 | // Process an audio file with a VST plugin 27 | host.processAudio( "C:/inputFile.wav", "C:/outputFile.wav", ["plugin1", "plugin2"] ); 28 | ``` -------------------------------------------------------------------------------- /node-vst-host.js: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // node-vst-host - main module 3 | ////////////////////////////////////////////////////////////////////////// 4 | // 5 | // Main javascript API 6 | /* ---------------------------------------------------------------------- 7 | Object Structures 8 | ------------------------------------------------------------------------- 9 | 10 | */ 11 | 12 | ////////////////////////////////////////////////////////////////////////// 13 | // Namespace (lol) 14 | var SHOW_DEBUG_PRINTS = true; 15 | var log = function(a) { if(SHOW_DEBUG_PRINTS) console.log(a); }; // A log function we can turn off 16 | 17 | 18 | ////////////////////////////////////////////////////////////////////////// 19 | // Constructor 20 | var NodeVSTHost = function() { 21 | 22 | return this; 23 | } // end NodeVSTHost(); 24 | 25 | 26 | ////////////////////////////////////////////////////////////////////////// 27 | // Process some audio with some plugins 28 | NodeVSTHost.prototype.processAudio = function( inputFile, outputFile, pluginNames ) { 29 | // MrsWatson wants our plugin names in a more compact string 30 | var strPluginNames = ""; 31 | for( iPlugin in pluginNames ) { 32 | strPluginNames += pluginNames[iPlugin]; 33 | 34 | if( iPlugin != pluginNames.length - 1 ) 35 | strPluginNames += ";"; 36 | } 37 | 38 | commandArgs = [ 39 | "--input", inputFile, 40 | "--output", outputFile, 41 | "--plugin", strPluginNames 42 | ]; 43 | 44 | console.log( commandArgs ); 45 | 46 | runWatsonCommand( commandArgs, function(results) { 47 | console.log( results ); 48 | }); 49 | } // end NodeVSTHost.processAudio() 50 | 51 | 52 | ////////////////////////////////////////////////////////////////////////// 53 | // List available plugins 54 | NodeVSTHost.prototype.listPlugins = function( callback ) { 55 | 56 | arguments = [ 57 | "--list-plugins" 58 | ]; 59 | 60 | runWatsonCommand( arguments, function(results) { 61 | var lines = results.match(/[^\r\n]+/g), 62 | pluginNames = [], 63 | locations = []; 64 | 65 | // Remove the characters that aren't part of the name 66 | for( var iLine in lines ) { 67 | var thisLine = lines[iLine]; 68 | 69 | // If this is just a line telling us that we don't have any 70 | // plugins here, skip it 71 | if( thisLine.indexOf("(Empty or non") != -1 || thisLine.indexOf("(No plugins found") != -1 ) { 72 | continue; 73 | } 74 | 75 | if( thisLine.indexOf("Location '") != -1 ) { 76 | locations.push( thisLine.substr(thisLine.indexOf("Location")) ); 77 | continue; 78 | } 79 | 80 | // If we've gotten this far, this is a plugin name 81 | // Remove the junk that's there to make the prompt look good 82 | pluginNames.push( thisLine.substr(20) ); 83 | } 84 | 85 | callback( pluginNames ); 86 | }); 87 | } // end NodeVSTHost.processAudio() 88 | 89 | 90 | function runCommand( command, args, end ) { 91 | var commandContext = this, 92 | data = ""; 93 | 94 | var spawn = require('child_process').spawn, 95 | child = spawn( command, args ); 96 | 97 | child.stderr.on( 'data', function( buffer ) { 98 | data += buffer.toString(); 99 | }); 100 | 101 | child.stderr.on( 'end', function() { 102 | end( data ); 103 | }); 104 | } 105 | 106 | 107 | function runWatsonCommand( arguments, onFinished ) { 108 | var cmdPath = __dirname + "/MrsWatson/bin/" + process.platform + "/mrswatson.exe"; 109 | 110 | var foo = new runCommand( 111 | cmdPath, 112 | arguments, 113 | onFinished || function( data ) {} 114 | ); 115 | } 116 | 117 | exports.host = NodeVSTHost; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-vst-host", 3 | "version": "0.0.4", 4 | "description": "VST host for processing audio", 5 | "main": "node-vst-host.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": "", 10 | "keywords": [ 11 | "VST", 12 | "audio", 13 | "process", 14 | "batch", 15 | "effect", 16 | "AU" 17 | ], 18 | "author": "Mike Vegeto (http://mikevegeto.com)", 19 | "license": "MIT (with GPL dependencies)", 20 | "repository": { 21 | "type": "git", 22 | "url": "http://github.com/ZECTBynmo/node-vst-host.git" 23 | } 24 | } -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | var VSTHost = require("./node-vst-host").host; 2 | 3 | var host = new VSTHost(); 4 | 5 | host.listPlugins( function(names) { 6 | // console.log( "Available Plugins"); 7 | // console.log( names ); 8 | }); 9 | 10 | host.processAudio( "C:/burst1.wav", "C:/TESTOUTPUTWIN.wav", ["iZNectar2"] ); --------------------------------------------------------------------------------