问题
so I looked into Audiolib.js and can make some basic stuff but what I don't know and can't figure out by searching through the internet.
The question is how I can change specific values of some "objects" without "re-appending" it. For example:
var osc;
osc = audioLib.Oscillator(44100 /*or some other samplerate */ , 400 );
function changefrequency(freq)
osc.frequency = freq; /* is there a way to do stuff like this? */
(Btw. with "objects" I mean oscillators, lfo's, filters and so on.) Since there are many other situations where I would like to change values without interrupting the whole process, I would realy like to do stuff like this.
回答1:
It looks like this library allows you to modify the properties of its objects. For example, this tutorial is modifying the "frequency" property of the Oscillator to change notes. It also uses the "reset" method to reset its phase when changing notes.
来源:https://stackoverflow.com/questions/19773237/audiolib-js-changing-values-of-existing-objects