Pass your audio context, and your DSP function to the constructor.
It will return a Web Audio Script Processing Node, which can be connected to any other Web Audio Node on the graph.

Simple use, generate a tone:

var master =newwebkitAudioContext();

var jsynth =require('jsynth')

, tau =Math.PI*2

, frequency =555

;

varsineGenerator=function(time,index,input){

returnMath.sin(time * tau * frequency)

}

var synth =jsynth(master, sineGenerator);// returns a web audio node

synth.connect(master.destination)

Your function will be called with the following arguments:

Time, in seconds (float)

Sample index (integer)

Input sample (float), MONO, this will be zero if there is no input. Use this if you are connecting other web Audio Api Nodes to this one. In the near future this will be a an array, for multiple input channels.

You function should return a float between [-1, 1]. See examples below.