web-audio-automation-timeline
v1.0.3
Published
Calculate automation values for the web audio API
Downloads
17
Readme
web-audio-automation-timeline
Timeline utility for calculating values of web audio automation parameters over time. Based off of Firefox's AudioEventTimeline implementation for the Web Audio API.
Installation
$ npm install web-audio-automation-timeline
Build
You can build a browserified version via gulp
, created in the ./build
directory, or
just use this in a script tag. You can view an example page that renders automation values in a d3 graph in ./example/index.html
.
API
new Timeline(defaultValue)
timeline.getEventCount()
Returns number of events currently modifying the value.
timeline.value(), timeline.getValue()
Returns the value set on the automation timeline.
timeline.setValue()
Sets the value for this parameter timeline. Like setting a value directly on a parameter, with no events.
timeline.getValueAtTime(t)
Returns the value of the parameter at time t
.
timeline.setValueAtTime(value, startTime)
Creates a setValueAtTime event.
timeline.linearRampToValueAtTime(value, endTime)
Creates a linearRampToValueAtTime event.
timeline.exponentialRampToValueAtTime(value, endTime)
Creates a exponentialRampToValueAtTime event.
timeline.setTargetAtTime(value, startTime, timeConstant)
Creates a setTargetAtTime event.
timeline.setValueCurveAtTime(value, startTime, duration)
Creates a setValueCurveAtTime event.
timeline.cancelScheduledValues(time)
Clears events according to cancelScheduledValues.
timeline.cancelAllEvents()
Clears out all events.
Testing
npm test
License
MIT License, Copyright (c) 2014 Jordan Santell