Package heronarts.lx.modulator
Class Click
- All Implemented Interfaces:
LXComponent.Renamable,LXLoopTask,LXPath,LXSerializable,LXParameter,LXParameterListener
A click is a simple modulator that fires a value of 1 every time its period
has passed. Otherwise it always returns 0.
-
Nested Class Summary
Nested 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.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
Fields 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
ConstructorsConstructorDescriptionClick(double periodMs) Click(LXParameter periodMs) Click(String label, LXParameter periodMs) -
Method Summary
Modifier and TypeMethodDescriptionbooleanclick()Helper to conditionalize logic based on the click.protected doublecomputeBasis(double basis, double value) Implementation method to compute the appropriate basis for a modulator given its current basis and value.protected doublecomputeValue(double deltaMs, double basis) Implementation method to compute the value of a modulator given its basis.fire()Sets the value of the click to 1, so that code querying it in this frame of execution sees it as active.voidloop(double deltaMs) Methods inherited from class heronarts.lx.modulator.LXPeriodicModulator
computeValue, disableAutoReset, finished, getBasis, getBasisf, getPeriod, getPeriodf, load, loop, numLoops, onParameterChanged, onReset, onSetValue, randomBasis, save, 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.LXParameter
dispose, getBaseValue, getBaseValuef, getLabel, getParentParameter, getValuef, isMappable, reset, setMappableMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getDescription, getParent, isDescendant
-
Constructor Details
-
Click
public Click(double periodMs) -
Click
-
Click
-
Click
-
-
Method Details
-
loop
public void loop(double deltaMs) - Specified by:
loopin interfaceLXLoopTask- Overrides:
loopin classLXPeriodicModulator
-
fire
Sets the value of the click to 1, so that code querying it in this frame of execution sees it as active. On the next iteration of the run loop it will be off again.- Returns:
- this
-
click
public boolean click()Helper to conditionalize logic based on the click. Typical use is to query as follows:if (clickInstance.click()) { // perform periodic operation }- Returns:
- true if the value is 1, otherwise false
-
computeValue
protected double computeValue(double deltaMs, double basis) Description copied from class:LXPeriodicModulatorImplementation method to compute the value of a modulator given its basis.- Specified by:
computeValuein classLXPeriodicModulator- Parameters:
deltaMs- Milliseconds elapsedbasis- Basis of the modulator- Returns:
- Value of modulator
-
computeBasis
protected double computeBasis(double basis, double value) Description copied from class:LXPeriodicModulatorImplementation method to compute the appropriate basis for a modulator given its current basis and value.- Specified by:
computeBasisin classLXPeriodicModulator- Parameters:
basis- Last basis of modulatorvalue- Current value of modulator- Returns:
- Basis of modulator
-