Package org.jjazz.phrase.api
Class CyclicPositions
java.lang.Object
org.jjazz.phrase.api.CyclicPositions
Specify positions which appear repeatedly, for example the beat 1.5 of each 4/4 measure.
-
Constructor Summary
ConstructorDescriptionCyclicPositions
(float position, float cycleOffset, float cycleSize, Float... morePosStartSize) Create an instance with one or more cyclic beat positions. -
Method Summary
Modifier and TypeMethodDescriptionboolean
matches
(float pos, float nearWindow) Test if the specified position matches one of the cyclic positions.
-
Constructor Details
-
CyclicPositions
public CyclicPositions(float position, float cycleOffset, float cycleSize, Float... morePosStartSize) Create an instance with one or more cyclic beat positions.Example:
pos=0.5f, startCycle=0, cycleSize=1, means positions 0.5, 1.5, 10.5 etc.
pos=0.5f, startCycle=3, cycleSize=1, means positions 3.5, 4.5, 5.5 etc.
pos=0.5f, starCycle=0, cycleSize=4, means positions 0.5, 4.5, 8.5 etc.- Parameters:
position
- Must be < cycleSizecycleOffset
-cycleSize
- Must be > 0morePosStartSize
- Must be 3*n arguments: pos then cycleOffset then cycleSize.
-
-
Method Details
-
matches
public boolean matches(float pos, float nearWindow) Test if the specified position matches one of the cyclic positions.- Parameters:
pos
-nearWindow
- Matches if pos is >= (cyclic_position-nearWindow) AND pos < (cyclic_position+nearWindow). If nearWindow is 0, it matches if pos==cyclic_position.- Returns:
-