-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Milestone
Description
From Felix -
rather than use exec I think you should use spawn.
this is how I spawn scsynth from inside supercollider.js
I will do the same thing for sclang when I get around to it.
then it should be easy to use this from other projects.
something like
scjs = requires("supercolliderjs");
sclang = new new SCLang();
sclang.start(function() {
// language is started now
});
sclang.on("quit",function() { });
etc.
here's the version for a local scsynth: LocalServer()
https://github.com/crucialfelix/supercolliderjs/blob/master/lib/localserver.js
var spawn = require('child_process').spawn;
console.log( this.options.cwd + this.options.cmd );
this.process = spawn(this.options.cwd + this.options.cmd,this.args(),
{
stdio: ['pipe', 'pipe', 'pipe'],
cwd: this.options.cwd
});
console.log("spawned " + this.process.pid);
this.process.on('exit',function(code){
console.log("Server exited " + code);
});
this.process.stdout.on('data',function(data){
console.log(" " + data);
});
this.process.stderr.on('data',function(data){
console.log("! " + data);
});
Reactions are currently unavailable