Class ScriptEffect

All Implemented Interfaces:
LXComponent.Renamable, LXDeviceComponent.Midi, LXLoopTask, LXPath, LXPresetComponent, LXSerializable, LXMidiListener, LXModulationContainer, LXOscComponent, LXParameterListener

@Description("Generates an effect from code in a JS file") public class ScriptEffect extends LXEffect implements LXDeviceComponent.Midi
  • Field Details

  • Constructor Details

    • ScriptEffect

      public ScriptEffect(LX lx)
  • 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 LXComponent
      Parameters:
      p - Parameter that has a value change
    • onModelChanged

      public void onModelChanged(LXModel model)
      Description copied from class: LXModelComponent
      Subclasses should override to handle changes to which model they are addressing. This method will be invoked at the start of the next core loop invocation, after the buffer has been updated.
      Overrides:
      onModelChanged in class LXModelComponent
      Parameters:
      model - New model
    • isHiddenControl

      public boolean isHiddenControl(LXParameter parameter)
      Description copied from class: LXDeviceComponent
      Returns whether this parameter is visible in default remote control or device control UIs
      Overrides:
      isHiddenControl in class LXEffect
      Parameters:
      parameter - Parameter to check
      Returns:
      true if this should be hidden by default
    • run

      protected void run(double deltaMs, double enabledAmount)
      Description copied from class: LXEffect
      Implementation of the effect. Subclasses need to override this to implement their functionality.
      Specified by:
      run in class LXEffect
      Parameters:
      deltaMs - Number of milliseconds elapsed since last invocation
      enabledAmount - The amount of the effect to apply, scaled from 0-1
    • 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 LXDeviceComponent
      Parameters:
      lx - LX instance
      obj - Object to deserialize
    • noteOnReceived

      public void noteOnReceived(MidiNoteOn note)
      Specified by:
      noteOnReceived in interface LXMidiListener
    • noteOffReceived

      public void noteOffReceived(MidiNote note)
      Specified by:
      noteOffReceived in interface LXMidiListener
    • controlChangeReceived

      public void controlChangeReceived(MidiControlChange cc)
      Specified by:
      controlChangeReceived in interface LXMidiListener
    • programChangeReceived

      public void programChangeReceived(MidiProgramChange pc)
      Specified by:
      programChangeReceived in interface LXMidiListener
    • pitchBendReceived

      public void pitchBendReceived(MidiPitchBend pitchBend)
      Specified by:
      pitchBendReceived in interface LXMidiListener
    • aftertouchReceived

      public void aftertouchReceived(MidiAftertouch aftertouch)
      Specified by:
      aftertouchReceived in interface LXMidiListener
    • midiPanicReceived

      public void midiPanicReceived()
      Specified by:
      midiPanicReceived in interface LXMidiListener
    • dispose

      public void dispose()
      Description copied from class: LXComponent
      Invoked when a component is being removed from the system and will no longer be used at all. This unregisters the component and should free up any resources and parameter listeners. Ideally after this method is called the object should be eligible for garbage collection. Subclasses are generally expected to override this method to handle their particular cleanup work. They should also generally call super.dispose() at the appropriate time to perform the basic cleanup, which may need to happen either before or after cleaning up other objects.
      Overrides:
      dispose in class LXEffect