felix
2014-08-07 10:41:05 UTC
http://supercolliderjs.readthedocs.org/en/latest/index.html
This is a node js package for working with sclang and scsynth
what's new: much improved interpreting of supercollider code
node js javascript:
var scjs = require('supercolliderjs');
scjs.sclang.boot()
.then(function(sclang) {
sclang.interpret('(1..8).pyramid')
.then(function(result) {
// result is a native javascript array
console.log('= ' + result);
}, function(error) {
// syntax or runtime errors
// are returned as javascript objects
console.log(error);
});
});
Example result:
[ 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2,
3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8 ]
Example error:
{ type: 'Error',
error:
{ selector: 'pleaseDontDoThisToMe',
what: 'DoesNotUnderstandError',
args: [],
receiver: { asString: '1', class: 'Integer' },
class: 'DoesNotUnderstandError',
path: '5f4b9581-1c83-11e4-bff4-77673f16fd9d',
errorString: 'ERROR: Message \'pleaseDontDoThisToMe\' not
understood by Integer 1' } }
This is a node js package for working with sclang and scsynth
what's new: much improved interpreting of supercollider code
node js javascript:
var scjs = require('supercolliderjs');
scjs.sclang.boot()
.then(function(sclang) {
sclang.interpret('(1..8).pyramid')
.then(function(result) {
// result is a native javascript array
console.log('= ' + result);
}, function(error) {
// syntax or runtime errors
// are returned as javascript objects
console.log(error);
});
});
Example result:
[ 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2,
3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8 ]
Example error:
{ type: 'Error',
error:
{ selector: 'pleaseDontDoThisToMe',
what: 'DoesNotUnderstandError',
args: [],
receiver: { asString: '1', class: 'Integer' },
class: 'DoesNotUnderstandError',
path: '5f4b9581-1c83-11e4-bff4-77673f16fd9d',
errorString: 'ERROR: Message \'pleaseDontDoThisToMe\' not
understood by Integer 1' } }
--
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.
..
http://soundcloud.com/crucialfelix
http://github.com/crucialfelix
.