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

Method reset

src/fl/audio/audio_reactive.cpp.hpp:786–797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

784SpectralFluxDetector::~SpectralFluxDetector() FL_NOEXCEPT = default;
785
786void SpectralFluxDetector::reset() {
787 for (fl::size i = 0; i < mPreviousMagnitudes.size(); ++i) {
788 mPreviousMagnitudes[i] = 0.0f;
789 }
790
791#if SKETCH_HAS_LARGE_MEMORY
792 for (fl::size i = 0; i < mFluxHistory.size(); ++i) {
793 mFluxHistory[i] = 0.0f;
794 }
795 mHistoryIndex = 0;
796#endif
797}
798
799bool SpectralFluxDetector::detectOnset(span<const float, 16> currentBins) {
800 float flux = calculateSpectralFlux(currentBins, span<const float, 16>(mPreviousMagnitudes.data(), 16));

Callers 1

beginMethod · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected