The AudioParam to wrap
Optional
units: TypeNameThe unit name
Optional
convert: booleanWhether or not to convert the value to the target units
Readonly
contextThe context belonging to the node.
Set this debug flag to log all events that happen in this class.
Readonly
inputReadonly
nameReadonly
unitsStatic
versionThe version number semver
The number of seconds of 1 processing block (128 samples)
console.log(Tone.Destination.blockTime);
Indicates if the instance was disposed. 'Disposing' an instance means that all of the Web Audio nodes that were created for the instance are disconnected and freed for garbage collection.
The duration in seconds of one sample.
Apply all of the previously scheduled events to the passed in Param or AudioParam. The applied values will start at the context's current time and schedule all of the events which are scheduled on this Param onto the passed in param.
Get the object's attributes.
const osc = new Tone.Oscillator();
console.log(osc.get());
Set multiple properties at once with an object.
const filter = new Tone.Filter().toDestination();
// set values using an object
filter.set({
frequency: "C6",
type: "highpass"
});
const player = new Tone.Player("https://tonejs.github.io/audio/berklee/Analogsynth_octaves_highmid.mp3").connect(filter);
player.autostart = true;
Convert the incoming time to seconds. This is calculated against the current TransportClass bpm
const gain = new Tone.Gain();
setInterval(() => console.log(gain.toSeconds("4n")), 100);
// ramp the tempo to 60 bpm over 30 seconds
Tone.getTransport().bpm.rampTo(60, 30);
Static
get
Param wraps the native Web Audio's AudioParam to provide additional unit conversion functionality. It also serves as a base-class for classes which have a single, automatable parameter.