NanoLux (Device) 3.0
Codebase for the open-source AudioLux device.
Loading...
Searching...
No Matches
patterns.h
Go to the documentation of this file.
1
8#ifndef PATTERNS_H
9#define PATTERNS_H
10
11#include "nanolux_types.h"
12#include "storage.h"
13
28typedef struct{
29
30 // Pattern Buffer for the particular history being used.
31 CRGB leds[MAX_LEDS] = {0};
32
33 // History Variables
34 int frame = 0; // for spring mass
35 double amplitude = 0; //for spring mass 2
36 int tempHue = 0;
37 int vol_pos = 0;
38 int pix_pos = 0;
39 uint8_t genre_smoothing[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
40 int genre_pose = 0;
41 double max1[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
42 double max2[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
43 double max3[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
44 double max4[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
45 double max5[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
46 int maxIter = 0;
47 double velocity = 0;
48 double acceleration = 0;
49 double smoothing_value[10] = {0,0,0,0,0,0,0,0,0,0};
50 int location = 70;
51 double velocities[5] = {0,0,0,0,0};
52 double accelerations[5] = {0,0,0,0,0};
53 int locations[5] = {70,60,50,40,30};
54 double vRealSums[5] = {0,0,0,0,0};
56
57extern Pattern_Data params;
58
59void nextPattern();
60
61void clearLEDSegment(Strip_Buffer * buf, int len);
62
63void setColorHSV(CRGB* leds, byte h, byte s, byte v, int len);
64
65// void getFhue(uint8_t min_hue, uint8_t max_hue);
66
67void getFhue(uint8_t min_hue, uint8_t max_hue);
68
69void getVbrightness();
70
71void blank(Strip_Buffer * buf, int len, Pattern_Data* params);
72
73void confetti(Strip_Buffer * buf, int len, Pattern_Data* params);
74
75void pix_freq(Strip_Buffer * buf, int len, Pattern_Data* params);
76
77void eq(Strip_Buffer * buf, int len, Pattern_Data* params);
78
79void tug_of_war(Strip_Buffer * buf, int len, Pattern_Data* params);
80
81void saturated(Strip_Buffer * buf, int len, Pattern_Data* params);
82
83void random_raindrop(Strip_Buffer * buf, int len, Pattern_Data* params);
84
85void hue_trail(Strip_Buffer* buf, int len, Pattern_Data* params);
86
87void groovy(Strip_Buffer* buf, int len, Pattern_Data* params);
88
89void talking(Strip_Buffer *buf, int len, Pattern_Data *params);
90
91void glitch(Strip_Buffer * buf, int len, Pattern_Data * params);
92
93void bands(Strip_Buffer * buf, int len, Pattern_Data * params);
94
95void Fire2012(Strip_Buffer * buf, int len, Pattern_Data* params);
96
97void bar_fill(Strip_Buffer * buf, int len, Pattern_Data* params);
98
99void vowels_raindrop(Strip_Buffer * buf, int len, Pattern_Data* params);
100
101#endif
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 (v...
Definition patterns.cpp:101
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...
Definition patterns.cpp:792
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...
Definition patterns.cpp:657
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,...
Definition patterns.cpp:411
void confetti(Strip_Buffer *buf, int len, Pattern_Data *params)
Confetti effect using frequency and brightness. Colored speckles that blink and fade smoothly are sca...
Definition patterns.cpp:134
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 th...
Definition patterns.cpp:285
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....
Definition patterns.cpp:152
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....
Definition patterns.cpp:242
void getVbrightness()
get vol brightness
Definition patterns.cpp:60
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.
Definition patterns.cpp:638
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 th...
Definition patterns.cpp:341
void Fire2012(Strip_Buffer *buf, int len, Pattern_Data *params)
Fire2012 pattern utilizing heating and cooling.
Definition patterns.cpp:700
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 pitc...
Definition patterns.cpp:623
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....
Definition patterns.cpp:197
Definition storage.h:41
Holds persistent data for currently-running patterns.
Definition patterns.h:28