Commit Graph

25 Commits

Author SHA1 Message Date
Kevin Kellner
8d090913d6 Fixed missing import. 2017-01-06 19:49:21 +01:00
Kevin Kellner
1b39f92df8 Changed the Interrupt handling.
Now SIGTERM and SIGINT will be caught and the LEDs will be turned off.
2017-01-06 19:44:10 +01:00
Kevin Kellner
b23bbc4d22 Changed type from int to long
For Python 3.5 compatibility.
2017-01-06 19:40:29 +01:00
Kevin Kellner
063889b23b Removed unnecessary brackets. 2017-01-06 15:26:00 +01:00
Kevin Kellner
9113f4258f Fixed typo 2017-01-06 15:21:46 +01:00
Kevin Kellner
ad0751bc9e Added atexit listener that turns the leds of when the programm terminates. 2017-01-06 15:20:23 +01:00
Kevin Kellner
67323cc1e5 Added support for blinkstick pro devices. 2017-01-06 15:03:37 +01:00
Scott Lawson
219eb2b62f Python 2.7 compatibility fix 2017-01-05 02:41:04 -08:00
Scott Lawson
0e73fd1348 Improved GUI, fixed bugs, better visualizations
* Resolved an issue with the ESP8266 where gamma correction would be
performed twice. Changed GAMMA_CORRECTION to SOFTWARE_GAMMA_CORRECTION
to make a distinction between software and firmware gamma correction.
The ESP8266 does firmware gamma correction and dithering, while the
Raspberry Pi uses slightly more inferior software gamma correction.
Changed the software gamma table to match the gamma table used in the
ESP8266 firmware.

* Improved the spectrum visualization by using one of the color channels
to visualize the absolute value of the temporal derivative of the
spectrum. Also added a feature to reject the "common mode" spectral
components, which is analogous to the spectral DC component.

* Signficantly improved the GUI and added a frequency adjustment slider.
Adjusting the frequency range has a big impact on the visualization
output. Recommend using a high frequency range (something like 4 kHz -
10 kHz) when running the scrol visualization.
2017-01-04 22:12:12 -08:00
Scott Lawson
68c2a66fa6 Replaced instance of 'long' type with 'int' for python 2 to 3 compatibility 2017-01-03 16:35:43 -08:00
Scott Lawson
b10a7d0396 Added experimental support for Raspberry Pi devices
This commit adds support for the Raspberry Pi, which allows users to
create a completely standalone music visualization system. The Raspberry
Pi should be connected directly to a ws2812b LED strip. A PWM-capable
GPIO pin should be connected to the data line of the LED strip. A USB
audio input device should be connected to one of the Raspberry Pi's USB
ports.

It is recommended that the GUI and FPS output be disabled when running
the visualization on the Raspberry Pi. These features can degrade
performance on the already computationally limited Raspberry Pi.
2017-01-03 16:33:28 -08:00
Scott Lawson
0f5c05339c Fixed a byte encoding error that occurred in Python 3
Fixed an error that caused strange byte encoding in Python 3. This error
was caused by a mistake in porting code from Python 2.7 to Python 3 and
would cause strange LED flickering behaviour. The LED update code should
now work properly in Python 2.7 and Python 3.
2016-12-31 11:06:09 -07:00
Scott Lawson
27a0448203 Added LED strand test to LED.py
Added a test routine to led.py to do a simple LED strand test. The
strand test scrolls a red, green, and blue pixel across the LED strip
forever.
2016-12-30 22:18:56 -07:00
Scott Lawson
e874ed3b2c Resolved issues with Python 3.5 compatibility
Fixed some bugs that occurred in Python 3.5 but were not present in
Python 2.7. Most compatiblity issues were caused by incompatible type
casting of numpy arrays.
2016-12-29 15:51:38 -07:00
Scott Lawson
e09578da1d Updated dsp.py and led.py to be Python 3.5 compatible 2016-12-27 03:06:57 -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
9bdc8f8cb9 Changed pixels from row vectors to column vectors to improve performance 2016-11-13 01:10:44 -08:00
Scott Lawson
7aa12f17ed LED optimization using gamma correction 2016-11-11 15:51:41 -08:00
Scott Lawson
83453ed436 Refactored led module and fixed a gamma table bug 2016-11-07 17:44:23 -08: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
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
028500f04e Initial commit
Initial commit of working python and ESP8266 code.
2016-10-12 14:50:00 -07:00