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

Go to the source code of this file.

Classes

struct  Pattern
 

Variables

int formant_pose = 0
 
double formants [3]
 
bool noise
 
bool drums [3]
 
double fbs [5]
 
double fss [5]
 
int salFreqs [3]
 
float centroid
 
float noisiness
 
bool percussionPresent = false
 
int advanced_size = 20
 
unsigned int sampling_period_us = round(1000000 / SAMPLING_FREQUENCY)
 
int F0arr [20]
 
int F1arr [20]
 
int F2arr [20]
 
unsigned long microseconds
 
double vReal [SAMPLES]
 
double vImag [SAMPLES]
 
double vRealHist [SAMPLES]
 
float audioPrismInput [SAMPLES]
 
Spectrogram fftHistory
 
double delt [SAMPLES]
 
double maxDelt = 0.
 
unsigned long myTime
 
AudioAnalysis audioAnalysis
 External reference to the AudioAnalysis instance.
 
Pattern mainPatterns []
 The current list of patterns, externed from globals.h.
 
int NUM_PATTERNS = 20
 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

◆ mainPatterns

Pattern mainPatterns[]
Initial value:
{
{ 0, "None", true, blank},
{ 1, "Equalizer", true, eq},
{ 2, "Bands", true, bands},
{ 3, "Splash Theory", true, splashTheory},
{ 4, "deltaHeat", true, deltaHeat},
{ 5, "Fire 2012", true, Fire2012},
{ 6, "Pixel Frequency", true, pix_freq},
{ 7, "Confetti", true, confetti},
{ 8, "Hue Trail", true, hue_trail},
{ 9, "Saturated", true, saturated},
{ 10, "Groovy", true, groovy},
{ 11, "Talking", true, talking},
{ 12, "Glitch", true, glitch},
{ 13, "Rain Drop", true, random_raindrop},
{ 14, "Bar Fill", true, bar_fill},
{ 15, "Blend In", true, blendIn},
{ 16, "Bleed Through", true, bleedThrough},
{ 17, "Synesthesia Rolling", true, synesthesiaRolling},
{ 18, "Note EQ", true, noteEQ},
{ 19, "String Theory", true, stringTheory},
}
void splashTheory(Strip_Buffer *buf, int len, Pattern_Data *params)
Maps the LED strip to volume. The starting position is based on the volume of the sampled audio....
Definition patterns.cpp:1066
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:108
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:742
void noteEQ(Strip_Buffer *buf, int len, Pattern_Data *params)
Maps the current note to a section on the led strip.
Definition patterns.cpp:953
void blendIn(Strip_Buffer *buf, int len, Pattern_Data *params)
Maps the LED strip to the different frequencies, and each LED blends between two different colors bas...
Definition patterns.cpp:800
void synesthesiaRolling(Strip_Buffer *buf, int len, Pattern_Data *params)
Maps the current note to a color.
Definition patterns.cpp:904
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:397
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:143
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:297
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:161
void deltaHeat(Strip_Buffer *buf, int len, Pattern_Data *params)
Maps the LED strip to frequencies. Creates a heatmap, where frequencies that have had drastic/continu...
Definition patterns.cpp:1126
void bleedThrough(Strip_Buffer *buf, int len, Pattern_Data *params)
A color blended between a base and transitioning color is sent down the LED strip....
Definition patterns.cpp:850
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:253
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:665
void stringTheory(Strip_Buffer *buf, int len, Pattern_Data *params)
Maps the LED strip to a string on a violin. The color changes based on which string of the violin is ...
Definition patterns.cpp:1032
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:339
void Fire2012(Strip_Buffer *buf, int len, Pattern_Data *params)
Fire2012 pattern utilizing heating and cooling.
Definition patterns.cpp:683
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:567
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:206

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