edlins / libPCA9685

superfast PCA9685 library for Debian platforms. developed on Raspbian on a Pi B+.
MIT License
13 stars 8 forks source link

examples/audio #45

Closed edlins closed 6 years ago

edlins commented 6 years ago

Add a spectrum analyzer example app.

USB audio input optionally use GPU_FFT for fast fourier transform optionally 16 channels = 16 frequency bins (directly set PWM levels), or 5 RGBs = 5 frequency bins = 15 channels (HSV dim blue to bright red) + 1 channel BPM detection

Resources: https://stackoverflow.com/questions/4364823/how-do-i-obtain-the-frequencies-of-each-value-in-an-fft

edlins commented 6 years ago

see https://github.com/edlins/libPCA9685/tree/audio

edlins commented 6 years ago

Now have a simple VU-meter. Captures from the mic (only processing 1st channel right now), computes EMA of samples, and drives all PWM to normalized EMA.

edlins commented 6 years ago

Add a device to https://github.com/linuxgnuru/pivumeter ..? https://stackoverflow.com/questions/38174727/modify-alsa-arecord-function-to-output-audio-levels-to-raspberry-pi-3-rgb-led

edlins commented 6 years ago

Add a device to https://github.com/linuxgnuru/pivumeter ..?

Nope. Evaluated pivumeter and latency is far too high.

Now have 16 FFTW bins driving PWM channels. Tuning the bin frequencies for aesthetic response to musical frequencies.

edlins commented 6 years ago

good enough! merged #66 to develop.