Package heronarts.lx.modulator
Class Randomizer
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.LXRunnableComponent
heronarts.lx.modulator.LXModulator
heronarts.lx.modulator.LXPeriodicModulator
heronarts.lx.modulator.Randomizer
- All Implemented Interfaces:
LXComponent.Renamable,LXLoopTask,LXPath,LXSerializable,LXMidiListener,LXTriggerSource,LXOscComponent,LXNormalizedParameter,LXParameter,LXParameterListener
@Global("Randomizer")
@Device("Randomizer")
@LXCategory("Core")
public class Randomizer
extends LXPeriodicModulator
implements LXNormalizedParameter, LXTriggerSource, LXMidiListener, LXOscComponent
Modulator that provides randomization within normalized value range.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumNested 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 CompoundParameterfinal CompoundParameterfinal CompoundParameterfinal CompoundParameterfinal CompoundParameterfinal CompoundParameterfinal CompoundParameterfinal BoundedParameterfinal CompoundParameterfinal TriggerParameterfinal TriggerParameterFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.doubleGets the value of the parameter in a normalized space from 0 to 1voidload(LX lx, JsonObject obj) Loads the LX component.voidnoteOnReceived(MidiNoteOn note) voidSubclasses are free to override this if desired.protected voidpostRun(double deltaMs) setNormalized(double value) Sets the value or the parameter in normalized space from 0 to 1Methods inherited from class heronarts.lx.modulator.LXPeriodicModulator
computeValue, disableAutoReset, finished, getBasis, getBasisf, getPeriod, getPeriodf, loop, loop, numLoops, 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, 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.midi.LXMidiListener
aftertouchReceived, controlChangeReceived, midiPanicReceived, noteOffReceived, pitchBendReceived, programChangeReceived, sysexReceivedMethods 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
-
triggerMode
-
lerpMode
-
periodMs
-
randomMs
-
chance
-
speed
-
accelTimeSecs
-
smoothingWindow
-
smoothingWindowRangeMs
-
min
-
max
-
triggerIn
-
triggerOut
-
-
Constructor Details
-
Randomizer
public Randomizer()
-
-
Method Details
-
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
-
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 classLXPeriodicModulator- Parameters:
p- Parameter that has a value change
-
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
-
postRun
protected void postRun(double deltaMs) - Overrides:
postRunin classLXRunnableComponent
-
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
-
getTriggerSource
- Specified by:
getTriggerSourcein interfaceLXTriggerSource
-
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
-
noteOnReceived
- Specified by:
noteOnReceivedin interfaceLXMidiListener
-