Generates a consistent tone, sometimes referred to as a pitch. A building block of sound design, this oscillator can produce the following "waveforms": Sine, Triangle, Square and Sawtooth. A repeating waveform produces a perceived pitch beginning at around 20 times a second, with additional textural or harmonic content dependent on the type of waveform you choose.
उदाहरण
सिंटैक्स
p5.Oscillator([frequency], [type])
पैरामीटर्स
frequency
Number: defaults to 440Hz, or 440 'cycles per second.' represents the pitch of the tone. Acts as a 'control-rate' or 'low frequency oscillator' (LFO) at values between 0 and 20. Creates a tone between 20 and about 20,000 Hertz depending on how well you can hear!
type
String: type of waveform: 'sine' (default), 'triangle', 'sawtooth', 'square'
मेथड्स
freq
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 results in a change of 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. You can also use note names such as C4, D4, C#4 (for octaves in range of -4 to 11).
phase
Adjusts the phase of the oscillator. Effectively, this changes the starting point of waveform. You might want to adjust the phase of an oscillator in more advanced sound design scenarios when layering multiple oscillators at different offsets to produce a particular instrument or timbre.
setType
Sets the type of the oscillator.
Notice any errors or typos? Please let us know. Please feel free to edit src/sources/Oscillator.js and open a pull request!