FastLED 3.10.8
Loading...
Searching...
No Matches

◆ bpm()

void bpm ( )
Examples
DemoReel100.ino.

Definition at line 116 of file DemoReel100.ino.

117{
118 // colored stripes pulsing at a defined Beats-Per-Minute (BPM)
119 uint8_t BeatsPerMinute = 62;
120 CRGBPalette16 palette = PartyColors_p;
121 uint8_t beat = beatsin8( BeatsPerMinute, 64, 255);
122 for( int i = 0; i < NUM_LEDS; i++) { //9948
123 leds[i] = ColorFromPalette(palette, gHue+(i*2), beat-gHue+(i*10));
124 }
125}
CRGB leds[1]
#define NUM_LEDS
uint8_t gHue
UINumberField palette("Palette", 0, 0, 2)
CRGB ColorFromPalette(const CRGBPalette16 &pal, fl::u8 index, fl::u8 brightness, TBlendType blendType) FL_NO_EXCEPT
const TProgmemRGBPalette16 PartyColors_p
HSV color ramp: blue, purple, pink, red, orange, yellow (and back).
LIB8STATIC u8 beatsin8(accum88 beats_per_minute, u8 lowest=0, u8 highest=255, u32 timebase=0, u8 phase_offset=0) FL_NO_EXCEPT
Generates an 8-bit sine wave at a given BPM that oscillates within a given range.
Definition beat.h:105
unsigned char uint8_t
Definition stdint.h:208

References beatsin8(), ColorFromPalette(), gHue, leds, NUM_LEDS, palette(), and PartyColors_p.

Referenced by fl::audio::detector::TempoAnalyzer::calculateIntervalScore(), fl::audio::detector::MusicalBeat::isValidIBI(), fl::audio::Processor::onTempo(), fl::audio::Processor::onTempoChange(), fl::audio::Processor::onTempoWithConfidence(), fl::DemoReel100::runPattern(), and fl::audio::detector::TempoAnalyzer::updateHypotheses().

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