Commit Graph

137 Commits

Author SHA1 Message Date
Scott Lawson
6f98d31096 Removed function that is no longer needed 2016-12-24 22:54:43 -07:00
Scott Lawson
b6551e04a2 Very minor PEP8 formatting changes 2016-12-24 22:54:06 -07:00
Scott Lawson
e677742584 Added a status indicator LED that blinks when command is received 2016-12-24 20:37:43 -07:00
Scott Lawson
2a87d040a7 Added several new visualizations 2016-11-21 20:11:45 -08:00
Scott Lawson
4dcf3e9a49 Minor pep8 formatting changes 2016-11-21 20:11:31 -08:00
Scott Lawson
1e630f2151 Removed two DSP functions that are no longer needed 2016-11-21 20:11:16 -08:00
Scott Lawson
e3a810db09 Updated documentation for configuration settings 2016-11-21 20:08:35 -08:00
Scott Lawson
51eda2f0ba Made noticeable improvements to performance 2016-11-13 01:11:15 -08:00
Scott Lawson
9bdc8f8cb9 Changed pixels from row vectors to column vectors to improve performance 2016-11-13 01:10:44 -08:00
Scott Lawson
e8b8a09047 Removed useless comments from melbank.py 2016-11-13 01:10:07 -08:00
Scott Lawson
b65989c8f1 Removed some dsp module functions that are never called 2016-11-13 01:09:47 -08:00
Scott Lawson
2bad2cd4d4 Deleted sandbox.py and visualize.py 2016-11-13 01:09:14 -08:00
Scott Lawson
ff6d7719af Removed obsolete gamma table and updated config file to match 2016-11-13 01:08:51 -08:00
Scott Lawson
cdc4c2976c Mel visualization is now globally normalized instead of individually normalized.
Also added realtime adaptive brightness correction to avoid having the
LED strip under or over saturated
2016-11-11 15:52:57 -08:00
Scott Lawson
627f67d3dd Added ability to change mel filterbank at runtime 2016-11-11 15:52:00 -08:00
Scott Lawson
7aa12f17ed LED optimization using gamma correction 2016-11-11 15:51:41 -08:00
Scott Lawson
ffbec2901f Added new visualization module that uses a mel filterbank instead of onset detection
The Mel filterbank visualization is relatively simple but produces
visualizations that are quite nice. Run this file to view the mel
filterbank visualization
2016-11-07 17:45:52 -08:00
Scott Lawson
83453ed436 Refactored led module and fixed a gamma table bug 2016-11-07 17:44:23 -08:00
Scott Lawson
ea8b381c8a Added gui.py module for handling pyqtgraph plots 2016-11-07 17:43:47 -08:00
Scott Lawson
81190a7f4c Added a new gamma table that seems to work better 2016-11-07 17:43:31 -08:00
Scott Lawson
404a216272 Updated visualize.py to reflect changes in DSP module 2016-11-07 17:43:12 -08:00
Scott Lawson
cb34b6353d Significantly changed and improved sandbox.py visualizations
Note: All code in sandbox.py is temporary and used for experimenting
with different visualizations.
2016-11-07 17:42:50 -08:00
Scott Lawson
65d35c2724 dsp module now creates a mel filterbank
Mel filterbank generated based on settings in config.py. Other small
pep8 formatting changes. Renamed ExponentialFilter to ExpFilter.
2016-11-07 17:41:26 -08:00
Scott Lawson
696d684c79 Added melbank.py module for generating Mel filterbanks 2016-11-07 17:40:18 -08:00
Scott Lawson
262206d359 Major changes to onset detection and visualization
Changes to config.py:
> Increased STFT rolling window size
> Added configurable options for setting the max and min FFT frequency

Changes to dsp.py:
> Significantly improved the normalized weighted phase deviation code.
This noticeably improves the onset detection accuracy.
> Logarithmic partitioning of the FFT bins now happens after onset
detection instead of before onset detection. This improves onset
detection accuracy at the expense of CPU time.
> Fixed a bug in the log_partition function which would sometimes cause
out of bounds errors
> Refactored and removed some functions that aren't needed anymore

Changes to sandbox.py:
> Sweeping changes to the visualization functions. The onset detection
functions are now combined after applying Gaussian blur to each onset
function individually. This improves the overall agreement between the
onset functions.
> Hyperbolic tan function is used to map saturated pixels to the range
[0, 1]
> Added a new rainbow generation function with more options than the old
one.
> Refactored most of the led update functions.
> The LED brightness is now being plotted instead of onsets
2016-10-24 16:42:03 -07:00
Scott Lawson
a38a8e1680 Refactored all of the led_update_X functions
Led update functions no longer return a colorized array. Colorizing is
now done in led_visualization. It makes more sense for the led_update_X
functions to return 1D brightness arrays and then to apply color
afterwards. This should also improve performance somewhat. Also added a
new function leak_saturated_pixels() which allows saturated colors (>255
value) to leak into the adjacent color channels
2016-10-23 16:46:52 -07:00
Scott Lawson
9e615e0f35 Added a lowpass filter to pixel output 2016-10-23 15:39:18 -07:00
Scott Lawson
8a1a53fd61 Changd led update functions to return pixel arrays
Led update functions now return an array of pixel values instead of
updating the LED strip directly.  This change makes it possible to
combine the effects of different LED update functions before updating
the LED strip. The function responsible for updating the LED strip is
led_visualization()
2016-10-23 14:56:03 -07:00
Scott Lawson
39325ce69b Minor bug fixes and tweaks 2016-10-22 22:16:08 -07:00
Scott Lawson
d966bb878d Complete rewrite of most sections, added new onset detection 2016-10-22 21:55:22 -07:00
Scott Lawson
17313c254b Major refactoring and update
* Moved all module settings to a new config.py file
* Completely overhauled visualize.py and added a new radiate effect that
colours the radiative beats according the beat frequency.
* Improved some constants like the decay constant to be parametric so
that they scale to any led strip size
* Added temporal dithering to Beat.update_pixels() so that it now
supports fractional speed values. Being limited to integral values was
starting to become a problem.
* Overhauled and simplified the LED module.
* When updating pixels, the LED module no longer sends UDP packets for
pixels that have not changed. This optimization reduces the packet load
significantly and should allow for higher refresh rates.
* Renamed lookup_table.npy to gamm_table.npy to better reflect that the
table is used for gamma correction of the LED strip
2016-10-13 22:27:45 -07:00
Scott Lawson
a3a986ed0b Fixed folder name for arduino ESP8266 firmware 2016-10-12 16:02:36 -07:00
Scott Lawson
8bd22b7359 Added .pyc to gitignore 2016-10-12 16:02:23 -07:00
Scott Lawson
0bd7385a20 Added missing lookup table, fixed pep8 formatting
Added lookup_table.npy which was missing from the previous commit. The
led.py module uses this table to do LED brightness gamma correction.
Fixed formatting for pep8 compliance
2016-10-12 16:02:06 -07:00
Scott Lawson
0809f9b6d1 Refactored visualize.py
Refactored the led shooting_beats effect (now renamed to
radiate_effect). Formatted for pep8 compliance
2016-10-12 16:00:05 -07:00
Scott Lawson
028500f04e Initial commit
Initial commit of working python and ESP8266 code.
2016-10-12 14:50:00 -07:00
Scott Lawson
4f5ab1556e 🎉 Added .gitattributes & .gitignore files 2016-10-12 14:44:03 -07:00