NexusUI is a collection of HTML5 interfaces and Javascript helper functions to assist with building web audio instruments in the browser.
In addition to interfaces, it offers a few helper methods for tuning and timing. It does not provide any sound-making capabilities –– for that, check out the Web Audio API or web audio libraries such as Tone.js, WebPD, or Gibber.
<div id="power"><div>
<div id="gain"><div>
// Create interfaces
var power = new Nexus.Toggle("#power");
var gain = new Nexus.Slider("#gain");
// Create a sound source
var volume = new Tone.Volume(-Infinity).toMaster();
var synth = new Tone.Oscillator(300,"sine").connect(volume);
// Listen for interface events
power.on('change',function(v) {
v ? synth.start() : synth.stop();
});
gain.on('change',function(v) {
volume.volume.rampTo(v,.1)
});
gain.min = -100;
gain.max = 0;
gain.value = -30;