public abstract class LXRangeModulator extends LXPeriodicModulator implements LXNormalizedParameter
LXComponent.Placeholder, LXComponent.Renamable
LXParameter.Formatter, LXParameter.Polarity, LXParameter.Units
LXSerializable.Utils
looping, tempoDivision, tempoLock, tempoSync
runMs, running, trigger
controlSurfaceSemaphore, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_PARAMETER_PATH, KEY_PATH, label, lx, modulationColor
Modifier | Constructor and Description |
---|---|
protected |
LXRangeModulator(String label,
LXParameter startValue,
LXParameter endValue,
LXParameter periodMs) |
Modifier and Type | Method and Description |
---|---|
protected double |
computeBasis(double basis,
double value)
Implementation method to compute the appropriate basis for a modulator
given its current basis and value.
|
protected abstract double |
computeNormalizedBasis(double basis,
double normalizedValue)
Subclasses determine the basis based on a normalized value from 0 to 1.
|
protected abstract double |
computeNormalizedValue(double deltaMs,
double basis)
Subclasses implement this which returns their value from a 0-1 scale.
|
protected double |
computeValue(double deltaMs,
double basis)
Implementation method to compute the value of a modulator given its basis.
|
double |
getExponent()
Gets the exponent used for scaling this parameter across its normalized range.
|
double |
getNormalized()
Gets the value of the parameter in a normalized space from 0 to 1
|
float |
getNormalizedf()
Gets the value of the parameter in a normalized space as a float
|
void |
onSetValue(double value)
Set the modulator to a certain value in its cycle.
|
LXRangeModulator |
setEndValue(double endValue)
Updates the final value
|
LXRangeModulator |
setEndValue(LXParameter endValue)
Assigns a parameter to modulate the end value of this modulator.
|
LXRangeModulator |
setExponent(double exponent) |
LXRangeModulator |
setNormalized(double normalized)
Sets the value or the parameter in normalized space from 0 to 1
|
LXRangeModulator |
setRange(double startValue,
double endValue)
Sets the range of the modulator, maintaining the period.
|
LXRangeModulator |
setRange(double startValue,
double endValue,
double periodMs)
Updates the range of the modulator.
|
LXRangeModulator |
setRangeFromHereTo(double endValue)
Updates the range to proceed from the current value to a new end value.
|
LXRangeModulator |
setRangeFromHereTo(double endValue,
double periodMs)
Updates the range to proceed from the current value to a new end value with
a new period.
|
LXRangeModulator |
setStartValue(double startValue)
Updates the initial value
|
LXRangeModulator |
setStartValue(LXParameter startValue)
Assigns a parameter to modulate the start value of this modulator.
|
computeValue, finished, getBasis, getBasisf, getPeriod, getPeriodf, load, loop, loop, onParameterChanged, onReset, randomBasis, save, setBasis, setLooping, setPeriod, setPeriod, updateBasis
getDescription, getFormatter, getIndex, getOscAddress, getOscPath, getPath, getPolarity, getUnits, getValue, getValuef, run, setComponent, setDescription, setFormatter, setIndex, setPolarity, setUnits, setValue, setValue, updateValue
isRunning, onStart, onStop, reset, start, stop, toggle, trigger
addArray, addChild, addInternalParameter, addParameter, addParameter, contains, copyParameters, dispose, getChild, getComponentName, getComponentName, getComponentName, getId, getLabel, getLX, getOscLabel, getParameter, getParameters, getParent, handleOscMessage, loadParameters, removeParameter, removeParameter, saveParameters, setParent, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dispose, getDescription, getFormatter, getLabel, getPolarity, getUnits, getValue, getValuef, isMappable, reset, setComponent, setMappable, setValue
get, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter, getParent, getPath
protected LXRangeModulator(String label, LXParameter startValue, LXParameter endValue, LXParameter periodMs)
public final LXRangeModulator setRange(double startValue, double endValue, double periodMs)
startValue
- New start valueendValue
- New final valueperiodMs
- New period, in millisecondspublic LXRangeModulator setExponent(double exponent)
public double getExponent()
LXNormalizedParameter
getExponent
in interface LXNormalizedParameter
public final LXRangeModulator setRange(double startValue, double endValue)
startValue
- New start valueendValue
- New end valuepublic final LXRangeModulator setStartValue(double startValue)
startValue
- New start valuepublic final LXRangeModulator setEndValue(double endValue)
endValue
- New final valuepublic final LXRangeModulator setRangeFromHereTo(double endValue)
endValue
- New end valuepublic final LXRangeModulator setRangeFromHereTo(double endValue, double periodMs)
endValue
- New end valueperiodMs
- New period, in millisecondspublic LXRangeModulator setStartValue(LXParameter startValue)
startValue
- A parameter to modify the start valuepublic LXRangeModulator setEndValue(LXParameter endValue)
endValue
- A parameter to modify the start valuepublic void onSetValue(double value)
LXPeriodicModulator
onSetValue
in class LXPeriodicModulator
value
- The value to applypublic final LXRangeModulator setNormalized(double normalized)
LXNormalizedParameter
setNormalized
in interface LXNormalizedParameter
normalized
- The normalized value, from 0 to 1public final double getNormalized()
LXNormalizedParameter
getNormalized
in interface LXNormalizedParameter
public final float getNormalizedf()
LXNormalizedParameter
getNormalizedf
in interface LXNormalizedParameter
protected final double computeValue(double deltaMs, double basis)
LXPeriodicModulator
computeValue
in class LXPeriodicModulator
deltaMs
- Milliseconds elapsedbasis
- Basis of the modulatorprotected final double computeBasis(double basis, double value)
LXPeriodicModulator
computeBasis
in class LXPeriodicModulator
basis
- Last basis of modulatorvalue
- Current value of modulatorprotected abstract double computeNormalizedValue(double deltaMs, double basis)
deltaMs
- Milliseconds elapsedbasis
- Basis of modulatorprotected abstract double computeNormalizedBasis(double basis, double normalizedValue)
basis
- Modulator basisnormalizedValue
- A normalize value from 0 to 1LX library by Mark C. Slee. © 2012-2020