Package org.jjazz.rhythm.api
Class RhythmFeatures
java.lang.Object
org.jjazz.rhythm.api.RhythmFeatures
- All Implemented Interfaces:
Serializable
Rhythm general features.
- See Also:
-
Constructor Summary
ConstructorDescriptionConstruct an object with all default values.RhythmFeatures
(Feel f, Beat b, Genre g, TempoRange rg, Intensity i) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getBeat()
getFeel()
getGenre()
int
Compute a matching score between this RhythmFeatures and rf.static RhythmFeatures
guessFeatures
(String name, Object... fixedValues) Try to set features from a rhythm name.int
hashCode()
-
Constructor Details
-
RhythmFeatures
public RhythmFeatures()Construct an object with all default values.Values are set to UNKNOWN, and ALL_TEMPO for TempoRange.
-
RhythmFeatures
-
-
Method Details
-
getMatchingScore
Compute a matching score between this RhythmFeatures and rf.Score calculation on each variable:
- Add 0 point if both values are UNKNOWN (or ALL_TEMPO_RANGE)
- Add 70 points if genre values match
- Add 30 points if 2 values match (other than genre)
- Add 10 points if 1 value matches with UNKNOWN- Parameters:
rf
-- Returns:
- The matching score
-
getFeel
- Returns:
- Default to UNKNOWN.
-
getIntensity
- Returns:
- Default to UNKNOWN.
-
getBeat
- Returns:
- Default to UNKNOWN.
-
getTempoRange
- Returns:
- Default to TempoRange.ALL_TEMPO.
-
getGenre
- Returns:
- Default to UNKNOWN.
-
guessFeatures
Try to set features from a rhythm name.Use featureValues to fix some values in the returned RhythmFeatures.
- Parameters:
name
- eg "Bossa Nova"fixedValues
- If Intensity object use it for intensity, if Feel object use it for feel, etc.- Returns:
- If no guess all features will be UNKNOWN or TempoRange.ALL_TEMPO
-
hashCode
public int hashCode() -
equals
-