Adjusts the frequency of the oscillator. Frequency is measured int Hertz (Hz) and determines the amount of cycles a waveform (square, sawtooth, etc...) will repeat in a second. The amount of repetitions will result in a change in perceived 'pitch.' You can lookup corresponding frequency values for 'notes' if you would like to play a scale. For example, 'middle C' on the keyboard has a frequency of 261.63 Hz.
Examples
Syntax
freq(frequency, [rampTime])
Parameters
frequency
Number: frequency of the oscillator in Hz (cycles per second). used to change 'pitch' or 'notes.'
rampTime
Number: the time in seconds it takes to ramp to a new frequency value (defaults to 0).
Notice any errors or typos? Please let us know. Please feel free to edit src/sources/Oscillator.js and open a pull request!
Related References
getAudioContext
Get the window's audio context.
setAudioContext
Sets the AudioContext to a specified context to enable cross library compatibility.
userStartAudio
starts audio processing in the window when called from a user interaction (such as mousePressed()).
userStopAudio
stops audio processing in the browser window.