Class CyclicPositions

java.lang.Object
org.jjazz.phrase.api.CyclicPositions

public class CyclicPositions extends Object
Specify positions which appear repeatedly, for example the beat 1.5 of each 4/4 measure.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CyclicPositions(float position, float cycleOffset, float cycleSize, Float... morePosStartSize)
    Create an instance with one or more cyclic beat positions.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    matches(float pos, float nearWindow)
    Test if the specified position matches one of the cyclic positions.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 < cycleSize
      cycleOffset -
      cycleSize - Must be > 0
      morePosStartSize - 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: