We are about to switch to a new forum software. Until then we have removed the registration on this forum.
How is it possible to get the current value of an oscillator?
That is, within the draw() function, I want to sample the current value of the oscillator.
Answers
While you can getFreq and getAmp, I don't see a way of sampling output from glancing briefly at the P5.js-sound oscillator source.
For low frequency oscillators one workaround might be that you could compute a representative value using a known start time...?
Yep. I also didn't see any solution in the sound API. This is weird that it is missing. I come from Max/Msp, and it exists there. Any 'signal' can be sampled.
Computation using start-time, if problematic since the oscillation freq changes by the user moving the mouse, and I don't want to stop&start the oscillator everytime the freq changes.
Good thinking though (-:
I added a Feature request on p5 github. https://github.com/processing/p5.js/issues/1895
Correct repo: https://GitHub.com/processing/p5.js-sound/issues L-)