bufferSource
now supports offsetTime
virtual-audio-graph no longer has any external dependencies
Breaking API change - defineNodes
removed. virtual-audio-graph
no longer internally remembers the custom node creator functions and these must be passed directly. This is more inline with how virtual-dom libraries handle component abstractions and keeps virtual-audio-graph
's internal state management to the audio graph alone
// old API
virtualAudioGraph.defineNodes({ coolCustomNode });
virtualAudioGraph.update({ 0: ["coolCustomNode", "output", { someParams }] });
// new API
virtualAudioGraph.update({ 0: [coolCustomNode, "output", { someParams }] });
Using Rollup for bundling ES5 dist.
Added jsnext:main
(more info) to package.json
Breaking API change - defineNode
replaced by defineNodes
:
// old API
virtualAudioGraph.defineNode(coolEffect, "coolEffect");
virtualAudioGraph.defineNode(someOscillators, "someOscillators");
// new API
virtualAudioGraph.defineNodes({ coolEffect, someOscillators });
Added support for AudioParam methods
virtual-audio-graph
now exports a factory instead of a constructor
// pre 0.13.x
import VirtualAudioGraph from "virtual-audio-graph";
const virtualAudioGraph = new VirtualAudioGraph();
// 0.13.x
import createVirtualAudioGraph from "virtual-audio-graph";
const virtualAudioGraph = createVirtualAudioGraph();
Because of the way the new operator works this is not a breaking change
Breaking API change:
const newAPI = {
0: ["oscillator", "output"],
1: ["gain", { key: 0, destination: "detune" }, { gain: 0.5 }, "input"],
2: ["oscillator", 1, { frequency: 110 }],
};
const oldAPI = {
0: {
node: "oscillator",
output: "output",
},
1: {
input: "input",
node: "gain",
output: { key: 0, destination: "detune" },
params: {
gain: 0.5,
},
},
2: {
node: "oscillator",
output: 1,
params: {
frequency: 110,
},
},
};
- Added support for:
- ChannelMergerNode
- ChannelSplitterNode
- Added support for:
- MediaStreamAudioDestinationNode
- MediaStreamAudioSourceNode
- Added support for:
- ConvolverNode
- DynamicsCompressorNode
- WaveShaperNode
-
Added getAudioNodeById method to virtualAudioGraph
-
Added support for:
- AnalyserNode
- AudioBufferSourceNode
Prior to version 0.7.x virtual-audio-graph parameters were an array of objects with id properties representing nodes like this:
[
{
id: 0,
node: "oscillator",
output: "output",
params: {
frequency: 220,
},
},
{
id: 1,
node: "oscillator",
output: { id: 0, destination: "detune" },
params: {
frequency: 110,
},
},
];
Now the parameters are a single object with keys which represent the node ids:
{
0: {
node: 'oscillator',
output: 'output',
params: {
frequency: 220,
},
},
1: {
node: 'oscillator',
output: {key: 0, destination: 'detune'}, // NB. "key" property used to be "id"
params: {
frequency: 110,
},
},
}
The new notation automatically ensures the id of each node exists and is unique. It is also more concise and allows for greater performance.