Package heronarts.lx.dmx
Class DmxModulator
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.LXRunnableComponent
heronarts.lx.modulator.LXModulator
heronarts.lx.dmx.AbstractDmxModulator
heronarts.lx.dmx.DmxModulator
- All Implemented Interfaces:
LXComponent.Renamable,LXLoopTask,LXPath,LXSerializable,LXTriggerSource,LXOscComponent,LXNormalizedParameter,LXParameter,LXParameterListener
@Global("DMX Channel")
@Device("DMX Channel")
@LXCategory("DMX")
public class DmxModulator
extends AbstractDmxModulator
implements LXOscComponent, LXNormalizedParameter, LXTriggerSource
A modulator converting DMX input to normalized output, with three modes:
8-bit: single DMX channel scaled to normalized output
16-bit: two DMX channels for high resolution, scaled to normalized output
Range: A range from [min] to [max] within a DMX channel.
Outputs a normalized value and a boolean indicator of whether
the DMX value is within the range.
-
Nested Class Summary
Nested ClassesNested 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
FieldsModifier and TypeFieldDescriptionfinal DiscreteParameterfinal DiscreteParameterfinal EnumParameter<DmxModulator.Mode> final BooleanParameterFields inherited from class heronarts.lx.dmx.AbstractDmxModulator
channel, universeFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecomputeValue(double deltaMs) Implementation method to advance the modulator's internal state.doubleGets the value of the parameter in a normalized space from 0 to 1voidSubclasses are free to override this if desired.setNormalized(double value) Sets the value or the parameter in normalized space from 0 to 1Methods inherited from class heronarts.lx.dmx.AbstractDmxModulator
setBytesMethods inherited from class heronarts.lx.modulator.LXModulator
autostart, disableAutoStart, getCrash, getCrashStackTrace, getFormatter, getIndex, getOscAddress, getOscPath, getPath, getPolarity, getUnits, getValue, isMappingSource, loop, onSetValue, run, setComponent, setFormatter, setIndex, setMappingSource, setPolarity, setUnits, setValue, setValue, updateValueMethods inherited from class heronarts.lx.LXRunnableComponent
isRunning, onReset, 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, load, loadParameters, loadPreset, removeParameter, removeParameter, removeParameter, removeParameter, save, 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, getExponent, getNormalizedf, 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
-
mode
-
min
-
max
-
rangeActive
-
-
Constructor Details
-
DmxModulator
public DmxModulator() -
DmxModulator
-
-
Method Details
-
onParameterChanged
Description copied from class:LXComponentSubclasses are free to override this if desired. It will automatically fire for any listenable parameter that is registered with this component.- Specified by:
onParameterChangedin interfaceLXParameterListener- Overrides:
onParameterChangedin classLXRunnableComponent- Parameters:
p- Parameter that has a value change
-
computeValue
protected double computeValue(double deltaMs) Description copied from class:LXModulatorImplementation method to advance the modulator's internal state. Subclasses must provide and update value appropriately.- Specified by:
computeValuein classLXModulator- Parameters:
deltaMs- Number of milliseconds to advance by- Returns:
- Computed value
-
getTriggerSource
- Specified by:
getTriggerSourcein interfaceLXTriggerSource
-
setNormalized
Description copied from interface:LXNormalizedParameterSets the value or the parameter in normalized space from 0 to 1- Specified by:
setNormalizedin interfaceLXNormalizedParameter- Parameters:
value- The normalized value, from 0 to 1- Returns:
- this, for method chaining
-
getNormalized
public double getNormalized()Description copied from interface:LXNormalizedParameterGets the value of the parameter in a normalized space from 0 to 1- Specified by:
getNormalizedin interfaceLXNormalizedParameter- Returns:
- Value of parameter, normalized to range from 0 to 1
-