Say, I want a sine to be played forever and have sg like
function valueRn(){
return Math.sin(Date.now())*desiredAmplitude;
}
Obviously, it makes little sense as I don't take advantage of the signal being generated in real-time, but it might be the most straightforward example of how it'd work.
This function can be accessed from the document and I want it to be played. Preferably without using any external library. Is there a simple way to do it?