Commit Graph

84 Commits

Author SHA1 Message Date
not-matt
977f9a0df4
Merge pull request #2 from kanapoutz78/patch-2
Fix overflow bug for Raspberry Pi
2017-12-19 18:04:14 +00:00
kanapoutz78
c61db1b140
Fix overflow bug for Raspberry Pi
As fixed at :  https://github.com/scottlawsonbc/audio-reactive-led-strip/pull/73
2017-12-19 16:50:24 +01:00
kanapoutz78
c55c0f4cb9
Update visualization.py
In order to fit custom number of pixels
2017-12-19 16:43:14 +01:00
not-matt
b0b45efcf4
Add files via upload
There, hopefully that's all where it's meant to be.
2017-12-18 20:50:27 +00:00
not-matt
c90fc83224
Delete config.py 2017-12-18 20:49:45 +00:00
not-matt
be7510dcc3
Delete dsp.py 2017-12-18 20:49:34 +00:00
not-matt
e5f088b981
Delete gamma_table.npy 2017-12-18 20:49:27 +00:00
not-matt
aff3dfd61d
Delete gui.py 2017-12-18 20:49:19 +00:00
not-matt
07d7674ba3
Delete led.py 2017-12-18 20:49:10 +00:00
not-matt
0853caa8d9
Delete melbank.py 2017-12-18 20:49:01 +00:00
not-matt
d9fcf1ec14
Delete microphone.py 2017-12-18 20:48:51 +00:00
not-matt
c21cff14a1
Delete visualization.py 2017-12-18 20:48:44 +00:00
Scott Lawson
debd7f689f Fix bug where message bytes were in wrong scope 2017-01-30 07:32:09 -08:00
Scott Lawson
ee0eda9a4c Change microphone.py, decodes data before callback
Microphone.py is now responsible for decoding audio data. The decoded data now passed to the callback function
2017-01-30 07:19:50 -08:00
Scott Lawson
35c26ca7bb Add many small performance optimizations
Over a dozen small performance optimizations 
* Memoization for linspace generation
* Removed unnecessary copies
* Limited the rate at which information is printed. Excessive `print()` output was causing issues for some SSH users
2017-01-30 07:17:59 -08:00
Scott Lawson
d6bf763c67 Fix #20 ESP8266 can send multiple packets
Previously there was no limit to the number of bytes that could be sent per packet. This commit enforces a limit on the amount of pixel information per packet.
2017-01-30 07:11:07 -08:00
Scott Lawson
fba8175e99 Add zero padded FFT calculation, could help #25
Zero pads the audio time samples until the length is equal to the next largest power of two. This improves the algorithmic complexity of the FFT calculations.

Initialized the Hamming window when the module is loaded instead of every loop.

Replaced a call to numpy.roll() with direct array index manipulation.
2017-01-29 00:41:13 -08:00
George Hopkins
a74d404606 Fix unresponsive GUI on silence 2017-01-21 19:53:50 +01:00
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
6c97a3f57d Changed default value back. 2017-01-06 15:06:55 +01:00
Kevin Kellner
67323cc1e5 Added support for blinkstick pro devices. 2017-01-06 15:03:37 +01:00
Scott Lawson
133c65d9b5 Fixed indenting bug 2017-01-05 20:42:52 -08:00
Scott Lawson
219eb2b62f Python 2.7 compatibility fix 2017-01-05 02:41:04 -08:00
Scott Lawson
fdf79018ad Fixed bug where disabling gui caused error 2017-01-05 02:03:54 -08:00
Scott Lawson
c0ed75d298 Changed default IP to match ESP8266 firmware 2017-01-05 00:14:23 -08:00
Scott Lawson
75d8e8d9f7 Typo 2017-01-05 00:13:39 -08:00
Scott Lawson
32cea53ea1 Fixed typo 2017-01-05 00:13:14 -08:00
Scott Lawson
9837fec3b9 Added more information about device setting in config.py 2017-01-05 00:12:28 -08:00
Scott Lawson
0f29d7c614 Minor PEP8 formatting change 2017-01-04 23:21:09 -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
47aa7bfcdd Added a slider for contrast adjustment
Added a slider and variables for adjusting the contrast of the
visualization.
2017-01-03 19:16:45 -08:00
Scott Lawson
e3ebe167e8 PEP8 formatting 2017-01-03 16:48:18 -08:00
Scott Lawson
5c5300ba7f Minor PEP8 formatting changes 2017-01-03 16:46:19 -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
4b6f9a807b Fixed bug where some FPS values raised exceptions
Fixed a bug where certain config.FPS values would result in arrays with
mismatched dimensions. The mismatched dimensions occurred because an
integer was rounded instead of truncated. This is now fixed and
exceptions should no longer be raised when certain FPS values are used.
2017-01-03 16:09:39 -08:00
Scott Lawson
46b404120f Fixed bug where ComboBox didn't match current effect
Fixed a bug where the GUI ComboBox value would sometimes not match the
effect being displayed. This bug sometimes occurs when the GUI is first
initialized. This change now ensures that the ComboBox value is
correctly initialized.
2017-01-01 13:12:38 -07:00
Scott Lawson
c725d395be Added ComboBox to GUI for effect selection
Added a ComboBox to the GUI to allow the user to change the
visualization effect without having to restart Python. The user can now
select from one of the following visualizations using the GUI: 'Scroll
effect', 'Spectrum effect', 'Energy effect'
2017-01-01 12:14:31 -07: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
3241e43435 Fixed a typo where multiple effects were uncommented 2016-12-30 22:19:46 -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
7b3f95af18 Improved documentation for IP configuration 2016-12-27 21:09:10 -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
d9677a4f8e Renamed mel_visualization.py to visualization.py 2016-12-27 01:31:50 -07:00