Commit Graph

7 Commits

Author SHA1 Message Date
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
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