Class MultiStageEnvelope

All Implemented Interfaces:
LXComponent.Renamable, LXLoopTask, LXPath, LXSerializable, LXWaveshape, LXOscComponent, LXNormalizedParameter, LXParameter, LXParameterListener

@LXCategory("Core") @Global("Envelope") @Device("Envelope") public class MultiStageEnvelope extends LXVariablePeriodModulator implements LXWaveshape, LXOscComponent
  • Field Details

  • Constructor Details

    • MultiStageEnvelope

      public MultiStageEnvelope()
    • MultiStageEnvelope

      public MultiStageEnvelope(String label)
    • MultiStageEnvelope

      public MultiStageEnvelope(String label, float initialValue, float endValue)
  • Method Details

    • removeStage

      public MultiStageEnvelope removeStage(MultiStageEnvelope.Stage stage)
    • addStage

    • addStage

      public MultiStageEnvelope.Stage addStage(double basis, double value)
    • computeNormalizedValue

      protected double computeNormalizedValue(double deltaMs, double basis)
      Description copied from class: LXRangeModulator
      Subclasses implement this which returns their value from a 0-1 scale. This class automatically takes care of scaling to the startValue/endValue range.
      Specified by:
      computeNormalizedValue in class LXRangeModulator
      Parameters:
      deltaMs - Milliseconds elapsed
      basis - Basis of modulator
      Returns:
      Modulator value
    • computeNormalizedBasis

      protected double computeNormalizedBasis(double basis, double normalizedValue)
      Description copied from class: LXRangeModulator
      Subclasses determine the basis based on a normalized value from 0 to 1.
      Specified by:
      computeNormalizedBasis in class LXRangeModulator
      Parameters:
      basis - Modulator basis
      normalizedValue - A normalize value from 0 to 1
      Returns:
      Computed normalized basis for modulator
    • compute

      public double compute(double basis)
      Specified by:
      compute in interface LXWaveshape
    • invert

      public double invert(double value, double basisHint)
      Specified by:
      invert in interface LXWaveshape
    • save

      public void save(LX lx, JsonObject obj)
      Description copied from class: LXComponent
      Serializes the LX component. By default, all internal and user-facing parameters are serialized, as well as any explicitly registered child components. Note that child arrays are not serialized, or any other dynamic components. Subclasses may override to perform more saving, and are expected to call super.save(lx, obj) at the appropriate time.
      Specified by:
      save in interface LXSerializable
      Overrides:
      save in class LXPeriodicModulator
      Parameters:
      lx - LX instance
      obj - Object to serialize into
    • load

      public void load(LX lx, JsonObject obj)
      Description copied from class: LXComponent
      Loads 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:
      load in interface LXSerializable
      Overrides:
      load in class LXPeriodicModulator
      Parameters:
      lx - LX instance
      obj - Object to deserialize