Class RhythmFeatures

java.lang.Object
org.jjazz.rhythm.api.RhythmFeatures
All Implemented Interfaces:
Serializable

public class RhythmFeatures extends Object implements Serializable
Rhythm general features.
See Also:
  • Constructor Details

    • RhythmFeatures

      public RhythmFeatures()
      Construct an object with all default values.

      Values are set to UNKNOWN, and ALL_TEMPO for TempoRange.

    • RhythmFeatures

      public RhythmFeatures(Feel f, Beat b, Genre g, TempoRange rg, Intensity i)
  • Method Details

    • getMatchingScore

      public int getMatchingScore(RhythmFeatures rf)
      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

      public Feel getFeel()
      Returns:
      Default to UNKNOWN.
    • getIntensity

      public Intensity getIntensity()
      Returns:
      Default to UNKNOWN.
    • getBeat

      public Beat getBeat()
      Returns:
      Default to UNKNOWN.
    • getTempoRange

      public TempoRange getTempoRange()
      Returns:
      Default to TempoRange.ALL_TEMPO.
    • getGenre

      public Genre getGenre()
      Returns:
      Default to UNKNOWN.
    • guessFeatures

      public static RhythmFeatures guessFeatures(String name, Object... fixedValues)
      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()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object