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

Go to the source code of this file.

Classes

struct  Pattern
 

Variables

int formant_pose = 0
 Used for smoothing (old) formant processing.
 
double formants [3]
 Global formant array, used for accessing.
 
bool noise
 
bool drums [3]
 
double fbs [5]
 
double fss [5]
 
int advanced_size = 20
 
unsigned int sampling_period_us = round(1000000 / SAMPLING_FREQUENCY)
 Audio sampling period.
 
int F0arr [20]
 Used for smoothing (old) formant processing.
 
int F1arr [20]
 Used for smoothing (old) formant processing.
 
int F2arr [20]
 Used for smoothing (old) formant processing.
 
unsigned long microseconds
 
double vReal [SAMPLES]
 
double vImag [SAMPLES]
 Imaginary component of vReal. Unused.
 
double vRealHist [SAMPLES]
 Last state of the vReal array.
 
double delt [SAMPLES]
 
double maxDelt = 0.
 
unsigned long myTime
 
Pattern mainPatterns []
 The current list of patterns, externed from globals.h.
 
int NUM_PATTERNS = 15
 The number of patterns that can be shown, externed from globals.h.
 

Detailed Description

This file contains global variables.

Many of the variables in the NanoLux project are global. However, this means that thare are many variables defined that have limited use outside of a few files.

Variables that don't make sense to define in main.ino but are used globally should be first defined here.

Variable Documentation

◆ delt

double delt[SAMPLES]

Variable used to store the frequency delta between vReal and vRealHist.

◆ fbs

double fbs[5]

Global FIVE BAND SPLIT which stores changing bands based on raw frequencies

◆ mainPatterns

Pattern mainPatterns[]
Initial value:
{
{ 0, "None", true, blank},
{ 1, "Pixel Frequency", true, pix_freq},
{ 2, "Confetti", true, confetti},
{ 3, "Hue Trail", true, hue_trail},
{ 4, "Saturated", true, saturated},
{ 5, "Groovy", true, groovy},
{ 6, "Talking", true, talking},
{ 7, "Glitch", true, glitch},
{ 8, "Bands", true, bands},
{ 9, "Equalizer", true, eq},
{ 10, "Tug of War", true, tug_of_war},
{ 11, "Rain Drop", true, random_raindrop},
{ 12, "Fire 2012", true, Fire2012},
{ 13, "Bar Fill", true, bar_fill},
{ 14, "Vowel Rain Drop", true, vowels_raindrop},
}
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 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

The current list of patterns, externed from globals.h.

◆ maxDelt

double maxDelt = 0.

Global variable used to access the frequency band with the largest delta between iterations.

◆ vReal

double vReal[SAMPLES]

Array to store both sampled and FFT'ed audio. Processing is done in place.