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 SummaryFieldsModifier and TypeFieldDescriptionstatic final TempoRangestatic final TempoRangestatic final TempoRangestatic final TempoRangestatic final TempoRangestatic final TempoRangestatic final intstatic final intstatic final int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleancheckTempo(int t) floatCompute a percentage that say how similar are this object's tempo bounds with tr's tempo bounds.booleancontains(int tempo) booleanintgetMax()intgetMin()getName()static List<TempoRange>inthashCode()Use only min and max values, name is not used.toString()
- 
Field Details- 
ALL_TEMPO
- 
SLOW
- 
MEDIUM_SLOW
- 
MEDIUM
- 
MEDIUM_FAST
- 
FAST
- 
TEMPO_MINpublic static final int TEMPO_MIN- See Also:
 
- 
TEMPO_STDpublic static final int TEMPO_STD- See Also:
 
- 
TEMPO_MAXpublic static final int TEMPO_MAX- See Also:
 
 
- 
- 
Constructor Details- 
TempoRange- Parameters:
- min-
- max-
- name-
 
- 
TempoRange
 
- 
- 
Method Details- 
getStandardTempoRanges
- 
containspublic boolean contains(int tempo) - Parameters:
- tempo-
- Returns:
- True if tempo is included in the bounds of this TempoRange.
 
- 
getMaxpublic int getMax()
- 
getMinpublic int getMin()
- 
getName
- 
equals
- 
hashCodepublic int hashCode()Use only min and max values, name is not used.
- 
toString
- 
computeSimilarityLevelCompute 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.
 
- 
checkTempopublic static boolean checkTempo(int t) 
 
-