Package heronarts.lx.modulator
Class MultiStageEnvelope
- All Implemented Interfaces:
LXComponent.Renamable,LXLoopTask,LXPath,LXSerializable,LXWaveshape,LXOscComponent,LXNormalizedParameter,LXParameter,LXParameterListener
@LXCategory("Core")
@Global("Envelope")
@Device("Envelope")
public class MultiStageEnvelope
extends LXVariablePeriodModulator
implements LXWaveshape, LXOscComponent
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class heronarts.lx.modulator.LXVariablePeriodModulator
LXVariablePeriodModulator.ClockModeNested classes/interfaces inherited from class heronarts.lx.modulator.LXModulator
LXModulator.Device, LXModulator.Global, LXModulator.PlaceholderNested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Description, LXComponent.Hidden, LXComponent.Name, LXComponent.PluginRequired, LXComponent.RenamableNested classes/interfaces inherited from interface heronarts.lx.parameter.LXNormalizedParameter
LXNormalizedParameter.OscModeNested classes/interfaces inherited from interface heronarts.lx.parameter.LXParameter
LXParameter.Collection, LXParameter.Formatter, LXParameter.Monitor, LXParameter.MultiMonitor, LXParameter.Polarity, LXParameter.UnitsNested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils -
Field Summary
FieldsFields inherited from class heronarts.lx.modulator.LXVariablePeriodModulator
clockMode, periodFast, periodSlowFields inherited from class heronarts.lx.modulator.LXPeriodicModulator
looping, tempoDivision, tempoLock, tempoSyncFields inherited from class heronarts.lx.modulator.LXModulator
crashed, midiFilter, midiSourceFields inherited from class heronarts.lx.LXRunnableComponent
runMs, running, triggerFields inherited from class heronarts.lx.LXComponent
childArrays, 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, presetFileFields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH -
Constructor Summary
ConstructorsConstructorDescriptionMultiStageEnvelope(String label) MultiStageEnvelope(String label, float initialValue, float endValue) -
Method Summary
Modifier and TypeMethodDescriptionaddStage(double basis, double value) addStage(MultiStageEnvelope.Stage stage) doublecompute(double basis) protected doublecomputeNormalizedBasis(double basis, double normalizedValue) Subclasses determine the basis based on a normalized value from 0 to 1.protected doublecomputeNormalizedValue(double deltaMs, double basis) Subclasses implement this which returns their value from a 0-1 scale.doubleinvert(double value, double basisHint) voidload(LX lx, JsonObject obj) Loads the LX component.voidsave(LX lx, JsonObject obj) Serializes the LX component.Methods inherited from class heronarts.lx.modulator.LXVariablePeriodModulator
onParameterChangedMethods inherited from class heronarts.lx.modulator.LXRangeModulator
computeBasis, computeValue, getExponent, getNormalized, getNormalizedf, onSetValue, setEndValue, setEndValue, setExponent, setNormalized, setRange, setRange, setRangeFromHereTo, setRangeFromHereTo, setStartValue, setStartValueMethods inherited from class heronarts.lx.modulator.LXPeriodicModulator
computeValue, disableAutoReset, finished, getBasis, getBasisf, getPeriod, getPeriodf, loop, loop, numLoops, onReset, randomBasis, setBasis, setLooping, setPeriod, setPeriod, updateBasisMethods 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, updateValueMethods inherited from class heronarts.lx.LXRunnableComponent
isRunning, onStart, onStop, onTrigger, postRun, reset, start, stop, toggle, triggerMethods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, assertDisposed, contains, copyParameters, dispose, getCategory, getChild, getComponentDescription, 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface heronarts.lx.parameter.LXNormalizedParameter
getBaseNormalized, getBaseNormalizedf, getOscMode, getValueFromNormalized, isWrappableMethods inherited from interface heronarts.lx.osc.LXOscComponent
getOscAddress, handleOscMessageMethods inherited from interface heronarts.lx.parameter.LXParameter
dispose, getBaseValue, getBaseValuef, getFormatter, getLabel, getParentParameter, getPolarity, getUnits, getValue, getValuef, isMappable, reset, setComponent, setFormatter, setMappable, setValueMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getDescription, getParent, getPath, isDescendant
-
Field Details
-
stages
-
monitor
-
-
Constructor Details
-
MultiStageEnvelope
public MultiStageEnvelope() -
MultiStageEnvelope
-
MultiStageEnvelope
-
-
Method Details
-
removeStage
-
addStage
-
addStage
-
computeNormalizedValue
protected double computeNormalizedValue(double deltaMs, double basis) Description copied from class:LXRangeModulatorSubclasses 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:
computeNormalizedValuein classLXRangeModulator- Parameters:
deltaMs- Milliseconds elapsedbasis- Basis of modulator- Returns:
- Modulator value
-
computeNormalizedBasis
protected double computeNormalizedBasis(double basis, double normalizedValue) Description copied from class:LXRangeModulatorSubclasses determine the basis based on a normalized value from 0 to 1.- Specified by:
computeNormalizedBasisin 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:
computein interfaceLXWaveshape
-
invert
public double invert(double value, double basisHint) - Specified by:
invertin interfaceLXWaveshape
-
save
Description copied from class:LXComponentSerializes the LX component. By default, all internal and user-facing parameters are serialized, as well as any explicitly registered child components. Note that child arrays are not serialized, or any other dynamic components. Subclasses may override to perform more saving, and are expected to callsuper.save(lx, obj)at the appropriate time.- Specified by:
savein interfaceLXSerializable- Overrides:
savein classLXPeriodicModulator- Parameters:
lx- LX instanceobj- Object to serialize into
-
load
Description copied from class:LXComponentLoads the LX component. Restores the ID of the component, as well as its internal and user-facing parameters. Any explicitly registered children will be automatically loaded, so long as they are direct descendants. Dynamic arrays will not be automatically loaded, this is left to subclasses to implement.- Specified by:
loadin interfaceLXSerializable- Overrides:
loadin classLXPeriodicModulator- Parameters:
lx- LX instanceobj- Object to deserialize
-