NanoLux (Device) 3.0
Codebase for the open-source AudioLux device.
Loading...
Searching...
No Matches
patterns.h File Reference
#include "nanolux_types.h"
#include "storage.h"

Go to the source code of this file.

Classes

struct  Strip_Buffer
 Holds persistent data for currently-running patterns. More...
 

Functions

void nextPattern ()
 
void clearLEDSegment (Strip_Buffer *buf, int len)
 
void setColorHSV (CRGB *leds, byte h, byte s, byte v, int len)
 
void getFhue (uint8_t min_hue, uint8_t max_hue)
 
void getVbrightness ()
 get vol brightness
 
void blank (Strip_Buffer *buf, int len, Pattern_Data *params)
 
void confetti (Strip_Buffer *buf, int len, Pattern_Data *params)
 Confetti effect using frequency and brightness. Colored speckles that blink and fade smoothly are scattered across the strip.
 
void pix_freq (Strip_Buffer *buf, int len, Pattern_Data *params)
 Based on a sufficient volume, a pixel will float to some position on the light strip and fall down (vol_show adds another threshold)
 
void eq (Strip_Buffer *buf, int len, Pattern_Data *params)
 Short and sweet function. Each pixel corresponds to a value from vReal, where the volume at each pitch determines the brightness of each pixel. Hue is locked in to a rainbow.
 
void tug_of_war (Strip_Buffer *buf, int len, Pattern_Data *params)
 Strip is split into two sides, red and blue showing push and pull motion based on either frequency or volume.
 
void saturated (Strip_Buffer *buf, int len, Pattern_Data *params)
 Fills the light strip with a nice ambient mess of colors that shift slowly over time. This function is similar to grovvy noise except the scale and hue_shift values are quiote different. Hue Octave Config remaps the volume to the range of hues present on strip. Hue Shift Config remaps volume as octaves and hhue_shift parameters in fill_noise16() Noise Compression config rremaps volume as hue_x parameter.
 
void random_raindrop (Strip_Buffer *buf, int len, Pattern_Data *params)
 A random spot is chosen along the length and does a ripple based on frequency.
 
void hue_trail (Strip_Buffer *buf, int len, Pattern_Data *params)
 Outputs a steady moving stream of lights where each pixel correlates to a previous fHue value. Visually tracks pitch over time, with brightness determined by volume. blur configuration adds blur.
 
void groovy (Strip_Buffer *buf, int len, Pattern_Data *params)
 A cool fluctuating pattern that changes color in waves of greens, yellows, purples and blue. This function is similar to saturated_noise but the values of scale and hue_shift are 100 and 5 respectively. This is a moving pattern but it does not change based on and volume or frequency changes. Uses fill_noise16() and blur. Hue Shift Change configuration remaps volume variable as hue_shift.
 
void talking (Strip_Buffer *buf, int len, Pattern_Data *params)
 Generates three clusters of lights, one in the middle, and two symmetric ones that travel out from the center and return. The distance the two outer LEDS from the center is determined by the detected volume. Formant configuration takes the clusters to be red,green,blue. Moving configuration, the three clusters move up and down according to sine wave motion.
 
void glitch (Strip_Buffer *buf, int len, Pattern_Data *params)
 Creates two light clusters that move according to sine wave motion, but their speed is affected by the volume. One pulls its color from fHue, and the other pulls its color from the formant values. Talk configuration combines glitch with talking_moving(). Sections configuration creates 4 seperate sine wave clusters.
 
void bands (Strip_Buffer *buf, int len, Pattern_Data *params)
 Basic band config : Uses the band_split_bounce() function to generate a five band split, and maps that split to the light strip. The strip is broken into five chunks of different colors, where the volume of each band determines how much of each section of the LED strip is lit. Advanced bands config : he strip is broken into five chunks of different colors, where the volume of each band determines how much of each section is lit, and that portion will diminish over time if a certain volume threshold is not met Fomant bands config: emonstrates the formant feature of the audio analysis code. Each of the three formant values correspond to a third of the entire LED strip, where the individual formant values determine the hue of each third.
 
void Fire2012 (Strip_Buffer *buf, int len, Pattern_Data *params)
 Fire2012 pattern utilizing heating and cooling.
 
void bar_fill (Strip_Buffer *buf, int len, Pattern_Data *params)
 Displays a pattern that occupies "lower" pixels at lower values, and "higher" pixels at higher values.
 
void vowels_raindrop (Strip_Buffer *buf, int len, Pattern_Data *params)
 

Variables

Pattern_Data params
 

Detailed Description

This file contains function headers for patterns.cpp along with the Strip_Buffer struct definition.

Function Documentation

◆ bands()

void bands ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

Basic band config : Uses the band_split_bounce() function to generate a five band split, and maps that split to the light strip. The strip is broken into five chunks of different colors, where the volume of each band determines how much of each section of the LED strip is lit. Advanced bands config : he strip is broken into five chunks of different colors, where the volume of each band determines how much of each section is lit, and that portion will diminish over time if a certain volume threshold is not met Fomant bands config: emonstrates the formant feature of the audio analysis code. Each of the three formant values correspond to a third of the entire LED strip, where the individual formant values determine the hue of each third.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ bar_fill()

void bar_fill ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

Displays a pattern that occupies "lower" pixels at lower values, and "higher" pixels at higher values.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ confetti()

void confetti ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

Confetti effect using frequency and brightness. Colored speckles that blink and fade smoothly are scattered across the strip.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ eq()

void eq ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

Short and sweet function. Each pixel corresponds to a value from vReal, where the volume at each pitch determines the brightness of each pixel. Hue is locked in to a rainbow.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ Fire2012()

void Fire2012 ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

Fire2012 pattern utilizing heating and cooling.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ glitch()

void glitch ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

Creates two light clusters that move according to sine wave motion, but their speed is affected by the volume. One pulls its color from fHue, and the other pulls its color from the formant values. Talk configuration combines glitch with talking_moving(). Sections configuration creates 4 seperate sine wave clusters.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ groovy()

void groovy ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

A cool fluctuating pattern that changes color in waves of greens, yellows, purples and blue. This function is similar to saturated_noise but the values of scale and hue_shift are 100 and 5 respectively. This is a moving pattern but it does not change based on and volume or frequency changes. Uses fill_noise16() and blur. Hue Shift Change configuration remaps volume variable as hue_shift.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ hue_trail()

void hue_trail ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

Outputs a steady moving stream of lights where each pixel correlates to a previous fHue value. Visually tracks pitch over time, with brightness determined by volume. blur configuration adds blur.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ pix_freq()

void pix_freq ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

Based on a sufficient volume, a pixel will float to some position on the light strip and fall down (vol_show adds another threshold)

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ random_raindrop()

void random_raindrop ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

A random spot is chosen along the length and does a ripple based on frequency.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ saturated()

void saturated ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

Fills the light strip with a nice ambient mess of colors that shift slowly over time. This function is similar to grovvy noise except the scale and hue_shift values are quiote different. Hue Octave Config remaps the volume to the range of hues present on strip. Hue Shift Config remaps volume as octaves and hhue_shift parameters in fill_noise16() Noise Compression config rremaps volume as hue_x parameter.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ talking()

void talking ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

Generates three clusters of lights, one in the middle, and two symmetric ones that travel out from the center and return. The distance the two outer LEDS from the center is determined by the detected volume. Formant configuration takes the clusters to be red,green,blue. Moving configuration, the three clusters move up and down according to sine wave motion.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.

◆ tug_of_war()

void tug_of_war ( Strip_Buffer * buf,
int len,
Pattern_Data * params )

Strip is split into two sides, red and blue showing push and pull motion based on either frequency or volume.

Parameters
bufPointer to the Strip_Buffer structure, holds LED buffer and history variables.
lenThe length of LEDs to process
paramsPointer to Pattern_Data structure containing configuration options.