MCPcopy Create free account
hub / github.com/FastLED/FastLED / updateChromaHistory

Method updateChromaHistory

src/fl/audio/detector/key.cpp.hpp:264–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264void KeyDetector::updateChromaHistory(const float* chroma) {
265 // Add current chroma to history (circular buffer)
266 for (int i = 0; i < 12; i++) {
267 if (static_cast<int>(mChromaHistory[i].size()) < mAveragingFrames) {
268 mChromaHistory[i].push_back(chroma[i]);
269 } else {
270 mChromaHistory[i][mHistoryIndex] = chroma[i];
271 }
272 }
273
274 mHistoryIndex = (mHistoryIndex + 1) % mAveragingFrames;
275 if (mHistorySize < mAveragingFrames) {
276 mHistorySize++;
277 }
278}
279
280void KeyDetector::getAveragedChroma(float* chroma) {
281 if (mHistorySize == 0) {

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected