This demo passes an oscillator as the param to osc.amp, the idea being it acts as a low-frequency oscillator to modulate amplitude. It works correctly.
Passing the LFO to osc.freq instead (osc.freq(lfo) in the setup method) - which the documentation says is possible, Or, pass in an object such as an oscillator to modulate the frequency with an audio signal. - leads to this error:
RangeError: Value must be within [0, 3.4028234663852886e+38], got: NaN
which is related to rampTo.
Of course, that's possibly trying to set an osccilator to a range between 1 and -1 - fairly standard - so I thought I'd use Oscillator.add and...
osc.add is not a function. Neither is getFreq, for that matter. I'm lost; I have p5 2.0.1, sound 0.2.0, and the listed examples work correctly... but it's unclear at the minute if the error is in code, documentation, or both.
This demo passes an oscillator as the param to
osc.amp, the idea being it acts as a low-frequency oscillator to modulate amplitude. It works correctly.Passing the LFO to
osc.freqinstead (osc.freq(lfo)in the setup method) - which the documentation says is possible, Or, pass in an object such as an oscillator to modulate the frequency with an audio signal. - leads to this error:which is related to
rampTo.Of course, that's possibly trying to set an osccilator to a range between 1 and -1 - fairly standard - so I thought I'd use
Oscillator.addand...osc.add is not a function. Neither isgetFreq, for that matter. I'm lost; I have p5 2.0.1, sound 0.2.0, and the listed examples work correctly... but it's unclear at the minute if the error is in code, documentation, or both.