Package heronarts.lx.audio
Class BandGate
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.LXRunnableComponent
heronarts.lx.modulator.LXModulator
heronarts.lx.audio.BandFilter
heronarts.lx.audio.BandGate
- All Implemented Interfaces:
LXComponent.Renamable
,LXLoopTask
,LXPath
,LXSerializable
,LXTriggerSource
,LXOscComponent
,LXNormalizedParameter
,LXParameter
,LXParameterListener
@LXCategory("Audio")
@Global("Beat Detect")
@Device("Beat Detect")
public class BandGate
extends BandFilter
implements LXNormalizedParameter, LXTriggerSource, LXOscComponent
A frequency gate monitors a Graphic Meter for a particular frequency range and
triggers when that range passes a certain threshold. Note that the beat detect
does *not* respect the attack and release settings of the underlying meter, it
merely shares the raw values. The BeatDetect applies its own time-band filtering.
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.lx.modulator.LXModulator
LXModulator.Device, LXModulator.Global, LXModulator.Placeholder
Nested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Description, LXComponent.Hidden, LXComponent.Name, LXComponent.PluginRequired, LXComponent.Renamable
Nested classes/interfaces inherited from interface heronarts.lx.parameter.LXNormalizedParameter
LXNormalizedParameter.OscMode
Nested classes/interfaces inherited from interface heronarts.lx.parameter.LXParameter
LXParameter.Collection, LXParameter.Formatter, LXParameter.Monitor, LXParameter.MultiMonitor, LXParameter.Polarity, LXParameter.Units
Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal NormalizedParameter
Level parameter is the average of the monitored bandfinal BoundedParameter
The time the trigger takes to falloff from 1 to 0 after triggered, in millisecondsfinal BoundedParameter
The floor at which the trigger releases.final BooleanParameter
Gate parameter is set to true for one frame when the beat is triggered.final BooleanParameter
Turn this parameter on to have this modulator tap the tempo systemfinal BoundedParameter
The gate level at which the trigger is engaged.Fields inherited from class heronarts.lx.audio.BandFilter
attack, averageNorm, gain, maxFreq, meter, minFreq, range, release, slope
Fields inherited from class heronarts.lx.modulator.LXModulator
crashed, midiFilter, midiSource
Fields inherited from class heronarts.lx.LXRunnableComponent
runMs, running, trigger
Fields 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, presetFile
Fields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
ConstructorsConstructorDescriptionBandGate
(GraphicMeter meter, float minHz, float maxHz) Constructs a gate that monitors a specified frequency bandBandGate
(String label, GraphicMeter meter) Constructs a gate that monitors a specified frequency bandBandGate
(String label, GraphicMeter meter, int minHz, int maxHz) Constructs a gate that monitors a specified frequency band -
Method Summary
Modifier and TypeMethodDescriptionprotected double
computeValue
(double deltaMs) Implementation method to advance the modulator's internal state.void
Subclasses 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.audio.BandFilter
getBand, getNormalized, setFrequencyRange
Methods 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, updateValue
Methods inherited from class heronarts.lx.LXRunnableComponent
isRunning, onReset, onStart, onStop, onTrigger, postRun, reset, start, stop, toggle, trigger
Methods 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, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface heronarts.lx.parameter.LXNormalizedParameter
getBaseNormalized, getBaseNormalizedf, getExponent, getNormalized, getNormalizedf, getOscMode, getValueFromNormalized, isWrappable
Methods inherited from interface heronarts.lx.osc.LXOscComponent
getOscAddress, handleOscMessage
Methods inherited from interface heronarts.lx.parameter.LXParameter
dispose, getBaseValue, getBaseValuef, getFormatter, getLabel, getParentParameter, getPolarity, getUnits, getValue, getValuef, isMappable, reset, setComponent, setFormatter, setMappable, setValue
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getDescription, getParent, getPath, isDescendant
-
Field Details
-
threshold
The gate level at which the trigger is engaged. When the signal crosses this threshold, the gate fires. Value is in the normalized space from 0 to 1. -
floor
The floor at which the trigger releases. Once triggered, the signal must fall below this amount before a new trigger may occur. This value is specified as a fraction of the threshold. So, a value of 0.75 means the signal must fall to 75% of the threshold value. -
decay
The time the trigger takes to falloff from 1 to 0 after triggered, in milliseconds -
gate
Gate parameter is set to true for one frame when the beat is triggered. -
teachTempo
Turn this parameter on to have this modulator tap the tempo system -
average
Level parameter is the average of the monitored band
-
-
Constructor Details
-
BandGate
-
BandGate
-
BandGate
Constructs a gate that monitors a specified frequency band- Parameters:
label
- Labelmeter
- GraphicEQ object to drive this gate
-
BandGate
Constructs a gate that monitors a specified frequency band- Parameters:
meter
- Equalizer to monitorminHz
- Minimum frequency bandmaxHz
- Maximum frequency band
-
BandGate
Constructs a gate that monitors a specified frequency band- Parameters:
label
- Labelmeter
- Equalizer to monitorminHz
- Minimum frequency bandmaxHz
- Maximum frequency band
-
-
Method Details
-
onParameterChanged
Description copied from class:LXComponent
Subclasses are free to override this if desired. It will automatically fire for any listenable parameter that is registered with this component.- Specified by:
onParameterChanged
in interfaceLXParameterListener
- Overrides:
onParameterChanged
in classBandFilter
- Parameters:
p
- Parameter that has a value change
-
computeValue
protected double computeValue(double deltaMs) Description copied from class:LXModulator
Implementation method to advance the modulator's internal state. Subclasses must provide and update value appropriately.- Overrides:
computeValue
in classBandFilter
- Parameters:
deltaMs
- Number of milliseconds to advance by- Returns:
- Computed value
-
setNormalized
Description copied from interface:LXNormalizedParameter
Sets the value or the parameter in normalized space from 0 to 1- Specified by:
setNormalized
in interfaceLXNormalizedParameter
- Overrides:
setNormalized
in classBandFilter
- Parameters:
value
- The normalized value, from 0 to 1- Returns:
- this, for method chaining
-
getTriggerSource
- Specified by:
getTriggerSource
in interfaceLXTriggerSource
-