![]() ![]() ![]() To change parameters of an LFO, use the set function which takes the same argument as the constructor of the class: myLfo. ![]() ![]() To retrieve the current value of an LFO, just use the value parameter: const v = myLfo.value Set waveform to one of these strings instead of a function to use it: There are a few basic waveform functions that are included in the library. Note: Every parameter is optional Waveform functions This code will create a new LFO with a frequency of 1.3Hz, an amplitude of 2 and which will produce a square signal. This function takes a number between 0 and 2PI as an argument and must return a number between 0 and 1. waveform: string to use built in waveforms or a custom waveform function.amplitude: the amplitude of the oscillator.The LFO class takes an object as an argument, containing these parameters: To create an LFO, create a new instance of LFO: const myLfo = new LFO() Usage Instantiationįirst, import LFO: import LFO from 'lfo-js' Note: In this library, there is no limitation concerning the frequency, as a result it can behave strangely at a high frequency ExampleĮither run the example from cloning the repo, installing with npm and then running npm run example or visit. LFO stands for Low Frequency Oscillator - a device which oscillates between two values on a certain frequency, following a given waveform. A simple JavaScript library that implements LFOs in JavaScript. Then well look at some examples using SouthPoles LFOs (low frequency oscillators) to create various types of time-varying filtering. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |