soundbank-oscillator

1.1.1 • Public • Published

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.

Install

$ npm install soundbank-oscillator

API

var Oscillator = require('soundbank-oscillator')

Oscillator(audioContext)

Returns a source AudioNode.

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

source.shape (get/set)

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

source.start(at)

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

source.stop(at)

Schedule note stop.

Standalone Example

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.110latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.110
1.1.00
1.0.00
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i soundbank-oscillator

Weekly Downloads

10

Version

1.1.1

License

ISC

Last publish

Collaborators

  • mmckegg