NanoLux (Device) 3.0
Codebase for the open-source AudioLux device.
|
#include <FastLED.h>
#include <Arduino.h>
#include "patterns.h"
#include "nanolux_types.h"
#include "nanolux_util.h"
#include <cmath>
Functions | |
double * | density_formant () |
Calculates the frequency bands with the highest density. | |
double * | band_split_bounce (int len) |
Outputs the average volume of 5 buckets given a sample length. | |
void | temp_to_array (double *temp, double *arr, int len) |
Used for moving a temporary pointer into another pointer. | |
void | update_formants () |
Moves data from the formant calculation function to the global array. | |
void | update_five_band_split (int len) |
Moves data from the 5-band-split calculation function to the global array. | |
VowelSounds | vowel_detection () |
Detects vowels based off of formants. | |
Variables | |
double | volume |
Global variable used to access the current volume. | |
double | peak |
Global variable used to store preak audio frequency. | |
double | vReal [SAMPLES] |
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. | |
int | formant_pose |
Used for smoothing (old) formant processing. | |
double | formants [3] |
Global formant array, used for accessing. | |
double | fbs [5] |
This file's functions perform advanced audio processing.
Many of the functions defined here use values calculated from core_analysis.h to perform more complex audio analysis.
double * band_split_bounce | ( | int | len | ) |
Outputs the average volume of 5 buckets given a sample length.
len | The number of samples the buckets should stretch across. |
This function totals up the volume inside all 5 buckets, averages them, then maps them to the allowed volume range.
double * density_formant | ( | ) |
Calculates the frequency bands with the highest density.
This is intended to be used for functions like vowel detection, and is used in a couple patterns. For any nontrivial applications, do not use this.
void temp_to_array | ( | double * | temp, |
double * | arr, | ||
int | len ) |
Used for moving a temporary pointer into another pointer.
temp | The temporary pointer to copy from. |
arr | The global pointer to copy to. |
len | The number of elements to copy. |
Automatically deletes temp after copy is finished.
Intended to be used to copy temporary audio analysis pointer data into global arrays.
|
extern |
Global FIVE BAND SPLIT which stores changing bands based on raw frequencies
|
extern |
Global variable used to store preak audio frequency.
Global variable used to store preak audio frequency.
|
extern |
Global variable used to access the current volume.
Global variable used to access the current volume.
|
extern |
Array to store both sampled and FFT'ed audio. Processing is done in place.