public abstract class LXRangeModulator extends LXPeriodicModulator implements LXNormalizedParameter
LXComponent.Placeholder, LXComponent.RenamableLXParameter.Formatter, LXParameter.Polarity, LXParameter.UnitsLXSerializable.Utilslooping, tempoDivision, tempoLock, tempoSyncrunMs, running, triggercontrolSurfaceSemaphore, 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, updateBasisgetDescription, getFormatter, getIndex, getOscAddress, getOscPath, getPath, getPolarity, getUnits, getValue, getValuef, run, setComponent, setDescription, setFormatter, setIndex, setPolarity, setUnits, setValue, setValue, updateValueisRunning, onStart, onStop, reset, start, stop, toggle, triggeraddArray, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdispose, getDescription, getFormatter, getLabel, getPolarity, getUnits, getValue, getValuef, isMappable, reset, setComponent, setMappable, setValueget, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter, getParent, getPathprotected 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()
LXNormalizedParametergetExponent in interface LXNormalizedParameterpublic 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)
LXPeriodicModulatoronSetValue in class LXPeriodicModulatorvalue - The value to applypublic final LXRangeModulator setNormalized(double normalized)
LXNormalizedParametersetNormalized in interface LXNormalizedParameternormalized - The normalized value, from 0 to 1public final double getNormalized()
LXNormalizedParametergetNormalized in interface LXNormalizedParameterpublic final float getNormalizedf()
LXNormalizedParametergetNormalizedf in interface LXNormalizedParameterprotected final double computeValue(double deltaMs,
double basis)
LXPeriodicModulatorcomputeValue in class LXPeriodicModulatordeltaMs - Milliseconds elapsedbasis - Basis of the modulatorprotected final double computeBasis(double basis,
double value)
LXPeriodicModulatorcomputeBasis in class LXPeriodicModulatorbasis - 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