FastLED 3.9.15
Loading...
Searching...
No Matches
animartrix_ring::SoundOrchestrator Class Reference

Detailed Description

Top-level orchestrator.

Owns no audio data of its own; polls the supplied Processor on every tick() and drives the supplied FxEngine / Animartrix.

Definition at line 71 of file sound_orchestrator.h.

#include <sound_orchestrator.h>

+ Collaboration diagram for animartrix_ring::SoundOrchestrator:

Public Member Functions

 SoundOrchestrator (fl::shared_ptr< fl::audio::Processor > processor, fl::shared_ptr< fl::Animartrix > animartrix, fl::FxEngine *engine)
 
void begin ()
 Wire up audio callbacks (downbeat/kick/snare).
 
const OrchestratorConfigconfig () const
 
float lastEngineSpeed () const
 
void setConfig (const OrchestratorConfig &cfg)
 Override config (e.g. from UI sliders). Cheap; safe to call every tick.
 
SoundState state () const
 Observability.
 
fl::u32 stateEnteredAtMs () const
 
float tick (fl::u32 nowMs, float manualSpeedScalar)
 Per-frame tick.
 

Private Member Functions

SoundState classify (fl::u32 nowMs)
 
float driveBpmLocked (fl::u32 nowMs, float manualSpeedScalar)
 
float driveDisorganized (fl::u32 nowMs, float manualSpeedScalar)
 
float driveSilence (fl::u32 nowMs, float manualSpeedScalar)
 
void switchAnimationIfNeeded (SoundState newState, fl::u32 nowMs)
 

Static Private Member Functions

static fl::AnimartrixAnim pickAnimationFor (SoundState s, fl::u32 nowMs)
 

Private Attributes

fl::shared_ptr< fl::AnimartrixmAnimartrix
 
SoundState mCandidate = SoundState::Silence
 
fl::u32 mCandidateSinceMs = 0
 
OrchestratorConfig mCfg {}
 
fl::AnimartrixAnim mCurrentAnim = fl::AnimartrixAnim::SLOW_FADE
 
fl::u8 mDownbeatCount = 0
 
fl::FxEnginemEngine
 
fl::u32 mLastDownbeatMs = 0
 
float mLastEngineSpeed = 1.0f
 
fl::u32 mLastKickMs = 0
 
fl::u32 mLastSnareMs = 0
 
fl::u32 mNonSilentSinceMs = 0
 
fl::shared_ptr< fl::audio::ProcessormProcessor
 
fl::u32 mSilentSinceMs = 0
 
SoundState mState = SoundState::Silence
 
fl::u32 mStateEnteredAtMs = 0
 

The documentation for this class was generated from the following files: