soundbank-oscillator

Oscillator AudioNode source extended with automatable amplitude and midi note params.

soundbank-oscillator

Oscillator AudioNode source extended with automatable amplitude and midi note params.

Intended for use as a source in soundbank, but it is compatible with any Web Audio API AudioNode set up.

$ npm install soundbank-oscillator
var Oscillator = require('soundbank-oscillator')

Returns a source AudioNode.

AudioParams: frequency, note (higher notes rolloff amplitude), detune, amp

Set the waveform shape of the audio node: 'sine', 'triangle', 'sawtooth', 'square'

Schedule note start. Can only be called once. For each event, create a new instance of oscillator.

Schedule note stop.

var Oscillator = require('soundbank-oscillator')
 
var audioContext = new AudioContext()
var oscillator = Oscillator(audioContext)
 
oscillator.note.value = 60 // middle C (midi) 
oscillator.start(0)