Class 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 LXModulator 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.
  • Field Details

    • gain

      public final BoundedParameter gain
      Gain of the meter, in decibels
    • range

      public final BoundedParameter range
      Range of the meter, in decibels.
    • attack

      public final BoundedParameter attack
      Meter attack time, in milliseconds
    • release

      public final BoundedParameter release
      Meter release time, in milliseconds
    • slope

      public final BoundedParameter slope
      dB/octave slope applied to the equalizer
    • threshold

      public final BoundedParameter 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

      public final BoundedParameter 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

      public final BoundedParameter decay
      The time the trigger takes to falloff from 1 to 0 after triggered, in milliseconds
    • minFreq

      public final BoundedParameter minFreq
      Minimum frequency for the band
    • maxFreq

      public final BoundedParameter maxFreq
      Maximum frequency for the band
    • meter

      public final GraphicMeter meter
    • gate

      public final BooleanParameter gate
      Gate parameter is set to true for one frame when the beat is triggered.
    • teachTempo

      public final BooleanParameter teachTempo
      Turn this parameter on to have this modulator tap the tempo system
    • average

      public final NormalizedParameter average
      Level parameter is the average of the monitored band
  • Constructor Details

    • BandGate

      public BandGate(LX lx)
    • BandGate

      public BandGate(String label, LX lx)
    • BandGate

      public BandGate(String label, GraphicMeter meter)
      Constructs a gate that monitors a specified frequency band
      Parameters:
      label - Label
      meter - GraphicEQ object to drive this gate
    • BandGate

      public BandGate(GraphicMeter meter, float minHz, float maxHz)
      Constructs a gate that monitors a specified frequency band
      Parameters:
      meter - Equalizer to monitor
      minHz - Minimum frequency band
      maxHz - Maximum frequency band
    • BandGate

      public BandGate(String label, GraphicMeter meter, int minHz, int maxHz)
      Constructs a gate that monitors a specified frequency band
      Parameters:
      label - Label
      meter - Equalizer to monitor
      minHz - Minimum frequency band
      maxHz - Maximum frequency band
  • Method Details

    • onParameterChanged

      public void onParameterChanged(LXParameter p)
      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 interface LXParameterListener
      Overrides:
      onParameterChanged in class LXRunnableComponent
      Parameters:
      p - Parameter that has a value change
    • getExponent

      public double getExponent()
      Description copied from interface: LXNormalizedParameter
      Gets the exponent used for scaling this parameter across its normalized range. Default is 1 which means linear scaling.
      Specified by:
      getExponent in interface LXNormalizedParameter
      Returns:
      scaling exponent
    • setFrequencyRange

      public BandGate setFrequencyRange(float minHz, float maxHz)
      Sets range of frequencies to look at
      Parameters:
      minHz - Minimum frequency
      maxHz - Maximum frequency
      Returns:
      this
    • getBand

      public double getBand(int i)
    • 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.
      Specified by:
      computeValue in class LXModulator
      Parameters:
      deltaMs - Number of milliseconds to advance by
      Returns:
      Computed value
    • setNormalized

      public LXNormalizedParameter setNormalized(double value)
      Description copied from interface: LXNormalizedParameter
      Sets the value or the parameter in normalized space from 0 to 1
      Specified by:
      setNormalized in interface LXNormalizedParameter
      Parameters:
      value - The normalized value, from 0 to 1
      Returns:
      this, for method chaining
    • getNormalized

      public double getNormalized()
      Description copied from interface: LXNormalizedParameter
      Gets the value of the parameter in a normalized space from 0 to 1
      Specified by:
      getNormalized in interface LXNormalizedParameter
      Returns:
      Value of parameter, normalized to range from 0 to 1
    • getNormalizedf

      public float getNormalizedf()
      Description copied from interface: LXNormalizedParameter
      Gets the value of the parameter in a normalized space as a float
      Specified by:
      getNormalizedf in interface LXNormalizedParameter
      Returns:
      Normalized value of parameter, in range from 0 to 1
    • getTriggerSource

      public BooleanParameter getTriggerSource()
      Specified by:
      getTriggerSource in interface LXTriggerSource