Package heronarts.lx.mixer
Class LXPatternEngine
java.lang.Object
heronarts.lx.mixer.LXPatternEngine
- All Implemented Interfaces:
LXSerializable,LXParameterListener
A channel is a single component of the engine that has a set of patterns from
which it plays and rotates. It also has a fader to control how this channel
is blended with the channels before it.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic interfacestatic interfaceListener interface for objects which want to be notified when the internal channel state is modified.Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal BooleanParameterWhether auto pattern transition is enabled on this channelAuto-cycle to a random pattern, not the next onefinal BoundedParameterTime in seconds after which transition thru the pattern set is automatically initiated.final LXComponentfinal BooleanParameterWhether damping is enabled on pattern composite blendingfinal CompoundParameterDamping time when a pattern is enabled or disabled in blending modeAuto-cycle to a random pattern, not the next onefinal DiscreteParameterWhich pattern is focused in the channelstatic final intfinal MutableParameterfinal LXParameter.Collectionstatic final Stringstatic final Stringstatic final Stringstatic final Stringfinal MutableParameterCan be monitored for changes to the name of any pattern on this engineprotected final ModelBufferThis is a local buffer used to render a secondary patternfinal ObjectParameter<LXBlend> final BooleanParameterfinal BoundedParameterfinal TriggerParameter -
Constructor Summary
ConstructorsConstructorDescriptionLXPatternEngine(LX lx, LXComponent component) LXPatternEngine(LX lx, LXComponent component, LXPattern[] patterns) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddListener(LXPatternEngine.Listener listener) final LXPatternEngineaddPattern(LXPattern pattern) final LXPatternEngineaddPattern(LXPattern pattern, int index) voidvoiddispose()enableAutoCycle(double autoCycleThreshold) Enable automatic transition from pattern to pattern on this channelfinal LXPatternfinal intReturns the index of the currently active pattern, if anydoubleReturn progress towards making a cyclefinal LXPatternReturns the pattern that currently has focus in this channel's pattern list.final intfinal LXPatternfinal intfinal LXPatterngetPattern(int index) final LXPatterngetPattern(String label) final LXPatterngetPatternByClassName(String className) final LXPatterndoubleReturn progress through a transitionfinal LXPatternEngineActivates the next pattern in this channel's pattern listfinal LXPatternEngineActivates the given pattern, which must belong to this channel.final LXPatternEngineActivates the given pattern, which must belong to this channel.final LXPatternEnginegoPatternIndex(int index) Activates the pattern at the given index, if it is within the bounds of this channel's pattern list.final LXPatternEngineActivates the previous pattern in this channel's pattern listfinal LXPatternEngineActivates a randomly selected pattern on the channel, from the set of patterns that have auto cycle enabled.booleanhandleOscMessage(OscMessage message, String[] parts, int index) booleanbooleanbooleanvoidload(LX lx, JsonObject obj) Restores this instance from a JSON objectloadPattern(JsonObject patternObj, int index) voidvoidmidiDispatch(LXShortMessage message) movePattern(LXPattern pattern, int index) voidInvoked when the value of a parameter is changed.voidonPatternEnabled(LXPattern pattern) final voidremoveListener(LXPatternEngine.Listener listener) final LXPatternEngineremovePattern(LXPattern pattern) voidsave(LX lx, JsonObject obj) Serializes this instance into the JSON objectfinal LXPatternEnginesetPatterns(LXPattern[] patterns)
-
Field Details
-
NO_PATTERN_INDEX
public static final int NO_PATTERN_INDEX- See Also:
-
patternRenamed
Can be monitored for changes to the name of any pattern on this engine -
focusedPattern
Which pattern is focused in the channel -
compositeMode
Auto-cycle to a random pattern, not the next one -
compositeDampingEnabled
Whether damping is enabled on pattern composite blending -
compositeDampingTimeSecs
Damping time when a pattern is enabled or disabled in blending mode -
autoCycleEnabled
Whether auto pattern transition is enabled on this channel -
autoCycleMode
Auto-cycle to a random pattern, not the next one -
autoCycleTimeSecs
Time in seconds after which transition thru the pattern set is automatically initiated. -
transitionTimeSecs
-
transitionEnabled
-
transitionBlendMode
-
patterns
-
triggerPatternCycle
-
launchPatternCycle
-
numPatternsChanged
-
renderBuffer
This is a local buffer used to render a secondary pattern -
component
-
parameters
-
PATH_PATTERN
- See Also:
-
PATH_ACTIVE
- See Also:
-
PATH_ACTIVE_PATTERN
- See Also:
-
PATH_NEXT_PATTERN
- See Also:
-
-
Constructor Details
-
LXPatternEngine
-
LXPatternEngine
-
-
Method Details
-
isPlaylist
public boolean isPlaylist() -
isComposite
public boolean isComposite() -
onParameterChanged
Description copied from interface:LXParameterListenerInvoked when the value of a parameter is changed.- Specified by:
onParameterChangedin interfaceLXParameterListener- Parameters:
p- The parameter that has changed its value
-
onPatternEnabled
-
addListener
-
removeListener
-
handleOscMessage
-
midiDispatch
-
getPatterns
-
getPattern
-
getPattern
-
getPatternByClassName
-
setPatterns
-
addPattern
-
addPattern
-
removePattern
-
clearPatterns
public void clearPatterns() -
movePattern
-
getFocusedPatternIndex
public final int getFocusedPatternIndex() -
getFocusedPattern
Returns the pattern that currently has focus in this channel's pattern list.- Returns:
- Pattern focused in the list
-
getActivePatternIndex
public final int getActivePatternIndex()Returns the index of the currently active pattern, if any- Returns:
- Index of the currently active pattern
-
getActivePattern
-
getTargetPattern
-
getNextPatternIndex
public final int getNextPatternIndex() -
getNextPattern
-
isInTransition
public boolean isInTransition() -
goPreviousPattern
Activates the previous pattern in this channel's pattern list- Returns:
- this
-
goNextPattern
Activates the next pattern in this channel's pattern list- Returns:
- this
-
goPattern
Activates the given pattern, which must belong to this channel.- Parameters:
pattern- Pattern to activate- Returns:
- this
-
goPattern
Activates the given pattern, which must belong to this channel. Transition can be optionally skipped- Parameters:
pattern- Pattern to activateskipTransition- Skip over a transition- Returns:
- this
-
goRandomPattern
Activates a randomly selected pattern on the channel, from the set of patterns that have auto cycle enabled.- Returns:
- this
-
goPatternIndex
Activates the pattern at the given index, if it is within the bounds of this channel's pattern list.- Parameters:
index- Pattern index- Returns:
- this
-
disableAutoCycle
-
enableAutoCycle
Enable automatic transition from pattern to pattern on this channel- Parameters:
autoCycleThreshold- time in seconds- Returns:
- this
-
getAutoCycleProgress
public double getAutoCycleProgress()Return progress towards making a cycle- Returns:
- amount of progress towards the next cycle
-
getTransitionProgress
public double getTransitionProgress()Return progress through a transition- Returns:
- amount of progress thru current transition
-
loop
-
dispose
public void dispose() -
save
Description copied from interface:LXSerializableSerializes this instance into the JSON object- Specified by:
savein interfaceLXSerializable- Parameters:
lx- LX instanceobj- Object to serialize into
-
load
Description copied from interface:LXSerializableRestores this instance from a JSON object- Specified by:
loadin interfaceLXSerializable- Parameters:
lx- LX instanceobj- Object to deserialize
-
loadPattern
-