0.0.23 • Published 9 years ago

scsynth v0.0.23

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

scsynth

Build Status NPM Version License

sound processing like SuperCollider in JavaScript

:construction_worker: :zzz:

Installation

npm install --save scsynth

Example

const scsynth = require("scsynth");

const context = new scsynth.SCContext();
const synth = context.createSynth({
  name: "sine",
  consts: [ 0 ],
  paramValues: [ 0.5, 440 ],
  paramIndices: { amp: { index: 0, length: 1 }, freq: { index: 1, length: 1 } },
  units: [
    [ "Control"     , 1, 0, [                                ], [ 1, 1 ] ],
    [ "SinOsc"      , 2, 0, [ [  0, 1 ], [ -1, 0 ]           ], [ 2    ] ],
    [ "BinaryOpUGen", 2, 2, [ [  1, 0 ], [  0, 0 ]           ], [ 2    ] ],
    [ "Out"         , 2, 0, [ [ -1, 0 ], [  2, 0 ], [ 2, 0 ] ], [      ] ]
  ]
});

context.append(synth);

for (let i = 0; i < 256; i++) {
  synth.$freq = 440 * Math.pow(2, i / 256);
  synth.$amp = 1 - (i / 256);
  synth.process();

  console.log("L:", context.outputs[0]);
  console.log("R:", context.outputs[1]);
}

See Also

License

MIT

0.0.23

9 years ago

0.0.22

9 years ago

0.0.21

9 years ago

0.0.20

9 years ago

0.0.19

9 years ago

0.0.18

9 years ago

0.0.17

9 years ago

0.0.16

9 years ago

0.0.15

9 years ago

0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago