Package org.jjazz.rhythm.api
Class TempoRange
java.lang.Object
org.jjazz.rhythm.api.TempoRange
- All Implemented Interfaces:
Serializable
,Cloneable
A range of tempo.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TempoRange
static final TempoRange
static final TempoRange
static final TempoRange
static final TempoRange
static final TempoRange
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkTempo
(int t) float
Compute a percentage that say how similar are this object's tempo bounds with tr's tempo bounds.boolean
contains
(int tempo) boolean
int
getMax()
int
getMin()
getName()
static List<TempoRange>
int
hashCode()
Use only min and max values, name is not used.toString()
-
Field Details
-
ALL_TEMPO
-
SLOW
-
MEDIUM_SLOW
-
MEDIUM
-
MEDIUM_FAST
-
FAST
-
TEMPO_MIN
public static final int TEMPO_MIN- See Also:
-
TEMPO_STD
public static final int TEMPO_STD- See Also:
-
TEMPO_MAX
public static final int TEMPO_MAX- See Also:
-
-
Constructor Details
-
TempoRange
- Parameters:
min
-max
-name
-
-
TempoRange
-
-
Method Details
-
getStandardTempoRanges
-
contains
public boolean contains(int tempo) - Parameters:
tempo
-- Returns:
- True if tempo is included in the bounds of this TempoRange.
-
getMax
public int getMax() -
getMin
public int getMin() -
getName
-
equals
-
hashCode
public int hashCode()Use only min and max values, name is not used. -
toString
-
computeSimilarityLevel
Compute a percentage that say how similar are this object's tempo bounds with tr's tempo bounds.Return value = (tempo range of the intersection of both objects)/(tempo range of the union of both objects)
Examples: this = [60,80], tr=[90,100] => return value = 0 this = [60,80], tr=[70,90] => return value = 10/30 = 0.33 this = [60,80], tr=[58,85] => return value = 20/27 = 0.74 this = [60,80], tr=[60,80] => return value = 20/20 = 1- Parameters:
tr
- TempoRange- Returns:
- A value between 0 and 1.
-
checkTempo
public static boolean checkTempo(int t)
-