Render one frame into out.
Buffers resize on first use and whenever the length changes.
Definition at line 42 of file mood_painter.cpp.
42 {
44 return;
46
47 const float dtSec =
48 (
mLastMs == 0) ? 0.016f : static_cast<float>(nowMs -
mLastMs) * 0.001f;
50
51
55
56
57
58
59
63 breath.clear();
64 flow.clear();
65 groove.clear();
66 mBreath.render(s, pal, dtSec, breath);
67 mFlow.render(s, pal, dtSec, flow);
68 mGroove.render(s, pal, dtSec, groove);
69
71
73 float keep =
tuning.trailOverride;
74 if (keep < 0.0f) {
77 }
79 } else {
80
81 for (fl::size i = 0; i <
mTrail.size(); ++i)
83 }
84
86
87
88 if (s.events.downbeat) {
90 } else if (s.events.kick || s.events.beat) {
92 }
94 }
95
96
97 for (fl::size i = 0; i < out.
size(); ++i)
99}
constexpr bool empty() const FL_NO_EXCEPT
constexpr fl::size size() const FL_NO_EXCEPT
fl::vector< RGBf > mBufGroove
fl::vector< RGBf > mTrail
persistence shadow
fl::vector< RGBf > mBufFlow
void drawPulses(const MoodPalette &pal, fl::u32 nowMs)
void mixLayers(const RoomSense &s)
void applyTrails(float keep)
void ensureBuffers(fl::size n)
float mHueDrift
slow hue travel, turns of the wheel
fl::vector< RGBf > mBufBreath
void emitPulse(float strength, bool downbeat, fl::u32 nowMs)
fl::vector< RGBf > mMix
this frame, summed
constexpr float kKeepGroove
constexpr float kKeepFlow
constexpr float kKeepCalm
CRGB toCRGB(const RGBf &p)
MoodPalette paletteFor(const RoomSense &s, float hueDrift)
Derive the family for this frame. Cheap; call every frame.
float wrapTurns(float t)
Wrap into [0, 1).
References applyTrails(), mood_ring::RoomEvents::beat, mood_ring::RoomSense::calm, mood_ring::RingCanvas::clear(), mood_ring::RoomEvents::downbeat, drawPulses(), emitPulse(), fl::span< T, Extent >::empty(), ensureBuffers(), mood_ring::RoomSense::events, mood_ring::RoomSense::flow, mood_ring::RoomSense::groove, mood_ring::RoomEvents::kick, mBreath, mBufBreath, mBufFlow, mBufGroove, mFlow, mGroove, mHueDrift, mixLayers(), mLastMs, mMix, mTrail, mood_ring::paletteFor(), fl::span< T, Extent >::size(), mood_ring::toCRGB(), tuning, and mood_ring::wrapTurns().