Package heronarts.lx.modulator
Class VariableLFO
- All Implemented Interfaces:
LXComponent.Renamable
,LXLoopTask
,LXPath
,LXSerializable
,LXWaveshape
,LXOscComponent
,LXNormalizedParameter
,LXParameter
,LXParameterListener
@LXCategory("Core")
@Global("LFO")
@Device("LFO")
public class VariableLFO
extends LXVariablePeriodModulator
implements LXWaveshape, LXOscComponent
A sawtooth LFO oscillates from one extreme value to another. When the later
value is hit, the oscillator rests to its initial value.
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.lx.modulator.LXVariablePeriodModulator
LXVariablePeriodModulator.ClockMode
Nested classes/interfaces inherited from class heronarts.lx.modulator.LXModulator
LXModulator.Device, LXModulator.Global, LXModulator.Placeholder
Nested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Hidden, LXComponent.Renamable
Nested classes/interfaces inherited from interface heronarts.lx.parameter.LXNormalizedParameter
LXNormalizedParameter.OscMode
Nested classes/interfaces inherited from interface heronarts.lx.parameter.LXParameter
LXParameter.Collection, LXParameter.Formatter, LXParameter.Monitor, LXParameter.MultiMonitor, LXParameter.Polarity, LXParameter.Units
Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils
-
Field Summary
Modifier and TypeFieldDescriptionfinal CompoundParameter
final CompoundParameter
final CompoundParameter
Period of the waveform, in msfinal CompoundParameter
final CompoundParameter
final CompoundParameter
final ObjectParameter<LXWaveshape>
Parameter ofLXWaveshape
objects that select the wave shape used by this LFO.Fields inherited from class heronarts.lx.modulator.LXVariablePeriodModulator
clockMode, periodFast, periodSlow
Fields inherited from class heronarts.lx.modulator.LXPeriodicModulator
looping, tempoDivision, tempoLock, tempoSync
Fields inherited from class heronarts.lx.modulator.LXModulator
crashed, midiFilter
Fields inherited from class heronarts.lx.LXRunnableComponent
runMs, running, trigger
Fields inherited from class heronarts.lx.LXComponent
children, internalParameters, KEY_CHILDREN, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_INTERNAL, KEY_PARAMETER_PATH, KEY_PARAMETERS, KEY_PATH, KEY_RESET, label, legacyInternalParameters, legacyParameters, lx, modulationColor, modulationControlsExpanded, modulationsExpanded, parameters, presetFile
Fields inherited from interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
ConstructorDescriptionVariableLFO
(String label) VariableLFO
(String label, LXWaveshape[] waveshapes) VariableLFO
(String label, LXWaveshape[] waveshapes, CompoundParameter period) Constructs a VariableLFO with a custom list of waveshapes -
Method Summary
Modifier and TypeMethodDescriptiondouble
compute
(double basis) double
computeBase
(double basis) protected final double
computeNormalizedBasis
(double basis, double normalizedValue) Subclasses determine the basis based on a normalized value from 0 to 1.protected final double
computeNormalizedValue
(double deltaMs, double basis) Subclasses implement this which returns their value from a 0-1 scale.double
invert
(double value, double basisHint) Methods inherited from class heronarts.lx.modulator.LXVariablePeriodModulator
onParameterChanged
Methods inherited from class heronarts.lx.modulator.LXRangeModulator
computeBasis, computeValue, getExponent, getNormalized, getNormalizedf, onSetValue, setEndValue, setEndValue, setExponent, setNormalized, setRange, setRange, setRangeFromHereTo, setRangeFromHereTo, setStartValue, setStartValue
Methods inherited from class heronarts.lx.modulator.LXPeriodicModulator
computeValue, disableAutoReset, finished, getBasis, getBasisf, getPeriod, getPeriodf, load, loop, loop, numLoops, onReset, randomBasis, save, setBasis, setLooping, setPeriod, setPeriod, updateBasis
Methods inherited from class heronarts.lx.modulator.LXModulator
autostart, disableAutoStart, getCrash, getCrashStackTrace, getFormatter, getIndex, getOscAddress, getOscPath, getPath, getPolarity, getUnits, getValue, isMappingSource, run, setComponent, setFormatter, setIndex, setMappingSource, setPolarity, setUnits, setValue, setValue, updateValue
Methods inherited from class heronarts.lx.LXRunnableComponent
isRunning, onStart, onStop, onTrigger, postRun, reset, start, stop, toggle, trigger
Methods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, contains, copyParameters, dispose, getCategory, getChild, getComponentName, getComponentName, getComponentName, getDescription, getId, getLabel, getLX, getOscLabel, getParameter, getParameters, getParent, handleOscMessage, hasParameter, isValidOscParameter, loadParameters, loadPreset, removeParameter, removeParameter, removeParameter, removeParameter, savePreset, setDescription, setParent, toOscQuery, toOscQuery, toOscQuery, toString, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface heronarts.lx.parameter.LXNormalizedParameter
getBaseNormalized, getBaseNormalizedf, getOscMode, getValueFromNormalized, isWrappable
Methods inherited from interface heronarts.lx.osc.LXOscComponent
getOscAddress, handleOscMessage
Methods inherited from interface heronarts.lx.parameter.LXParameter
dispose, getBaseValue, getBaseValuef, getFormatter, getLabel, getParentParameter, getPolarity, getUnits, getValue, getValuef, isMappable, reset, setComponent, setFormatter, setMappable, setValue
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getDescription, getParent, getPath, isDescendant
-
Field Details
-
waveshape
Parameter ofLXWaveshape
objects that select the wave shape used by this LFO. Default options are the waveshapes predefined inLXWaveshape
, but you can pass your own. -
periodCustom
Period of the waveform, in ms -
skew
-
shape
-
exp
-
bias
-
phase
-
-
Constructor Details
-
VariableLFO
public VariableLFO() -
VariableLFO
-
VariableLFO
-
VariableLFO
Constructs a VariableLFO with a custom list of waveshapes- Parameters:
label
- LFO labelwaveshapes
- Optional list of customLXWaveshape
. If null, will use predefined ones inLXWaveshape
period
- Optional. Parameter that supplies custom waveform period, in ms. Default goes 100-60000ms.
-
-
Method Details
-
getWaveshape
-
computeNormalizedValue
protected final double computeNormalizedValue(double deltaMs, double basis) Description copied from class:LXRangeModulator
Subclasses implement this which returns their value from a 0-1 scale. This class automatically takes care of scaling to the startValue/endValue range.- Specified by:
computeNormalizedValue
in classLXRangeModulator
- Parameters:
deltaMs
- Milliseconds elapsedbasis
- Basis of modulator- Returns:
- Modulator value
-
computeNormalizedBasis
protected final double computeNormalizedBasis(double basis, double normalizedValue) Description copied from class:LXRangeModulator
Subclasses determine the basis based on a normalized value from 0 to 1.- Specified by:
computeNormalizedBasis
in classLXRangeModulator
- Parameters:
basis
- Modulator basisnormalizedValue
- A normalize value from 0 to 1- Returns:
- Computed normalized basis for modulator
-
compute
public double compute(double basis) - Specified by:
compute
in interfaceLXWaveshape
-
computeBase
public double computeBase(double basis) -
invert
public double invert(double value, double basisHint) - Specified by:
invert
in interfaceLXWaveshape
-