FastLED 3.9.15
Loading...
Searching...
No Matches

◆ getCategory()

Category fl::audio::detector::Mood::getCategory ( ) const
inline

Definition at line 36 of file mood_analyzer.h.

36 {
37 const float NEUTRAL_THRESHOLD = 0.3f;
38
39 // Near center = neutral
40 if (abs(valence) < NEUTRAL_THRESHOLD && arousal < NEUTRAL_THRESHOLD + 0.2f) {
41 return NEUTRAL;
42 }
43
44 // Quadrant-based categorization
45 if (arousal < 0.5f) {
46 return valence < 0.0f ? CALM_NEGATIVE : CALM_POSITIVE;
47 } else {
49 }
50 }
constexpr enable_if< is_fixed_point< T >::value, T >::type abs(T x) FL_NOEXCEPT

References fl::abs(), arousal, CALM_NEGATIVE, CALM_POSITIVE, ENERGETIC_NEGATIVE, ENERGETIC_POSITIVE, NEUTRAL, and valence.

Referenced by getCategoryName(), and fl::audio::detector::MoodAnalyzer::shouldChangeMood().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: