audiolux / pixel-mapping-library

Master library for creating sound-reactive lighting visualizations for Audiolux Devices hardware. www.audioluxdevices.com
3 stars 0 forks source link

Create Method to Include / Disregard specific Frequencies #4

Open audioluxdevices opened 8 years ago

audioluxdevices commented 8 years ago
  1. Create sketch that creates for an array of "f" number of frequencies (i.e. 7 bands from MSGEQ7 or 512(?) bands from Teensy FFT Audio).
  2. Implement Function that allows a user to easily include or disregard a range of frequencies (ideally in Hz, but to begin with can simply be "Lows" "Mids" "Highs" or "All"). Suggestions
fLows()
fMids()
fHighs()
fAll()
  1. Pass along the filtered array of frequencies to be used in any other sketch.
  2. Add sketch to /methods directory called generate_frequencies.ino (.h? )

_Note: might need separate msgeq7_generate_frequencies / teensy_generatefrequencies?

Evanfeenstra commented 8 years ago

Ok, so we are thinking an easy code modification, rather than hooking up a knob or button to control this?

fyi, I think the teensy FFT is 1024-point, which creates 10 bands (2^10)

audioluxdevices commented 8 years ago

I thought Teensy creates up to 2048 separate bands of amplitude values across 20-20khz?

I'm not an expert but I'm trying to make this more modular, we could make a sketch that has all the additional bells and whistles but it'd be best to have the simplest method first that maybe prints to serialmonitor?

audioluxdevices commented 8 years ago

As for input controls, that's a later step for sure. Best keep it as a code mod for the time being.

audioluxdevices commented 8 years ago

Looks like Teensy Audio does 512 bands?

Evanfeenstra commented 8 years ago

there is a 1024 point fft analyzer, but functionally it gives you only 10 bands, since frequency is logrithmic.

In this example Paul makes 16 bands by manually dividing the freq points into groups https://github.com/PaulStoffregen/Audio/blob/master/examples/Analysis/SpectrumAnalyzerBasic/SpectrumAnalyzerBasic.ino#L89

audioluxdevices commented 8 years ago

Hmm you probably have a clearer handle on it than I do but in the other FFT example it says the first 40 of 512 bins are printed to serial monitor:

https://github.com/PaulStoffregen/Audio/blob/master/examples/Analysis/FFT/FFT.ino

So what are these 512 bins for?

Audiolux Devices Web http://www.audioluxdevices.com/ | Instagram http://www.instagram.com/audioluxdevices | Facebook http://www.facebook.com/audioluxdevices

On Wed, May 25, 2016 at 1:57 PM, Evan Feenstra notifications@github.com wrote:

there is a 1024 point fft analyzer, but functionally it gives you only 10 bands, since frequency is logrithmic.

In this example Paul makes 16 bands by manually dividing the freq points into groups

https://github.com/PaulStoffregen/Audio/blob/master/examples/Analysis/SpectrumAnalyzerBasic/SpectrumAnalyzerBasic.ino#L89

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/audiolux/pixel-mapping-library/issues/4#issuecomment-221705120

Evanfeenstra commented 8 years ago

check out a midi note to frequency chart to understand. http://www.phy.mtu.edu/~suits/notefreqs.html

The low notes are like 1 Hz each, but higher notes are like 400 Hz each. So to group the 512 bins across the frequency spectrum evenly, you need more and more bins per band as you go up (evenly by note, not by hertz). Anyway it works out as a log base 2 curve