Package heronarts.lx.script
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
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.lx.effect.LXEffect
LXEffect.Container, LXEffect.Placeholder, LXEffect.ProfilerNested classes/interfaces inherited from class heronarts.lx.LXDeviceComponent
LXDeviceComponent.MidiNested 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.LXSerializable
LXSerializable.Utils -
Field Summary
FieldsFields inherited from class heronarts.lx.effect.LXEffect
enabled, enabledDamped, enabledDampingAttack, enabledDampingRelease, hasDamping, locked, profilerFields inherited from class heronarts.lx.LXDeviceComponent
automationChildren, controlsExpanded, controlsExpandedAux, controlsExpandedCue, controlSurfaceSemaphore, crashed, DEVICE_CATEGORY_NAME_SORT, DEVICE_VERSION_UNSPECIFIED, KEY_DEVICE_VERSION, midiFilter, modulation, modulationExpanded, remoteControlsChanged, view, viewPriorityFields inherited from class heronarts.lx.LXLayeredComponent
colors, layers, paletteFields inherited from class heronarts.lx.LXModelComponent
modelFields inherited from class heronarts.lx.LXModulatorComponent
modulatorsFields 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 TypeMethodDescriptionvoidaftertouchReceived(MidiAftertouch aftertouch) voidvoiddispose()Invoked when a component is being removed from the system and will no longer be used at all.booleanisHiddenControl(LXParameter parameter) Returns whether this parameter is visible in default remote control or device control UIsvoidload(LX lx, JsonObject obj) Loads the LX component.voidvoidnoteOffReceived(MidiNote note) voidnoteOnReceived(MidiNoteOn note) voidonModelChanged(LXModel model) Subclasses should override to handle changes to which model they are addressing.voidSubclasses are free to override this if desired.voidpitchBendReceived(MidiPitchBend pitchBend) voidprotected voidrun(double deltaMs, double enabledAmount) Implementation of the effect.Methods inherited from class heronarts.lx.effect.LXEffect
disable, enable, getBus, getContainer, getIndex, getModelView, getPath, getPattern, isBusEffect, isEnabled, isPatternEffect, onDisable, onEnable, onLoop, setBus, setDamping, setDampingTime, setDampingTime, setIndex, setPattern, toggleMethods inherited from class heronarts.lx.LXDeviceComponent
addAutomationChild, addControlSurface, clearCustomRemoteControls, getControlSurfaces, getCrash, getCrashStackTrace, getCustomRemoteControls, getDeviceDescription, getDeviceVersion, getModulationEngine, getModulationExpanded, getRemoteControls, isSnapshotControl, loop, midiDispatch, removeControlSurface, removeCustomRemoteControl, resetRemoteControls, save, setCustomRemoteControls, setRemoteControlsMethods inherited from class heronarts.lx.LXLayeredComponent
addColor, addColor, addLayer, afterLayers, applyEffects, blendColor, blendColor, clearColors, getBuffer, getColor, getColor, getColors, getLayers, removeLayer, setBuffer, setBuffer, setColor, setColor, setColor, setColors, subtractColorMethods inherited from class heronarts.lx.LXModelComponent
getModel, setModelMethods inherited from class heronarts.lx.LXModulatorComponent
addModulator, addModulator, addModulator, addModulator, addModulator, constructProfiler, getModulator, getModulators, moveModulator, removeModulator, startModulatorMethods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, assertDisposed, contains, copyParameters, getCategory, getChild, getComponentDescription, getComponentName, getComponentName, getComponentName, getDescription, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, 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
sysexReceivedMethods inherited from interface heronarts.lx.osc.LXOscComponent
getOscAddress, handleOscMessageMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendantMethods inherited from interface heronarts.lx.LXPresetComponent
getPresetClass, postProcessPreset
-
Field Details
-
engine
-
-
Constructor Details
-
ScriptEffect
-
-
Method Details
-
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 classLXComponent- Parameters:
p- Parameter that has a value change
-
onModelChanged
Description copied from class:LXModelComponentSubclasses 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:
onModelChangedin classLXModelComponent- Parameters:
model- New model
-
isHiddenControl
Description copied from class:LXDeviceComponentReturns whether this parameter is visible in default remote control or device control UIs- Overrides:
isHiddenControlin classLXEffect- 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:LXEffectImplementation of the effect. Subclasses need to override this to implement their functionality. -
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 classLXDeviceComponent- Parameters:
lx- LX instanceobj- Object to deserialize
-
noteOnReceived
- Specified by:
noteOnReceivedin interfaceLXMidiListener
-
noteOffReceived
- Specified by:
noteOffReceivedin interfaceLXMidiListener
-
controlChangeReceived
- Specified by:
controlChangeReceivedin interfaceLXMidiListener
-
programChangeReceived
- Specified by:
programChangeReceivedin interfaceLXMidiListener
-
pitchBendReceived
- Specified by:
pitchBendReceivedin interfaceLXMidiListener
-
aftertouchReceived
- Specified by:
aftertouchReceivedin interfaceLXMidiListener
-
midiPanicReceived
public void midiPanicReceived()- Specified by:
midiPanicReceivedin interfaceLXMidiListener
-
dispose
public void dispose()Description copied from class:LXComponentInvoked 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 callsuper.dispose()at the appropriate time to perform the basic cleanup, which may need to happen either before or after cleaning up other objects.
-