wyager / LEDStrip

An LED music visualizer
Other
74 stars 5 forks source link

Changing num_leds results in an error #2

Closed bored-engineer closed 8 years ago

bored-engineer commented 9 years ago

Changing num_leds (https://github.com/wyager/LEDStrip/blob/master/Audio%20Processing/led_driver.py#L43) to any value other than 32 results in the following error:

Traceback (most recent call last):
  File "led_driver.py", line 74, in <module>
    for strip in colors:
  File "LEDStrip/Audio Processing/lavalamp_colors.py", line 49, in cap_colors
    for colors in color_stream:
  File "LEDStrip/Audio Processing/lavalamp_colors.py", line 41, in multiply_colors
    mags = magnitude_stream.next()
  File "LEDStrip/Audio Processing/notes_scaled_nosaturation.py", line 22, in rolling_smooth
    smooth = array_stream.next()
  File "LEDStrip/Audio Processing/notes_scaled_nosaturation.py", line 37, in exaggerate
    for array in array_stream:
  File "LEDStrip/Audio Processing/notes_scaled_nosaturation.py", line 59, in rolling_scale_to_max
    for array in stream:
  File "LEDStrip/Audio Processing/notes_scaled_nosaturation.py", line 55, in schur
    yield array*multipliers
ValueError: operands could not be broadcast together with shapes (32) (64)

The issue seems to be caused by the number 32 on this line.

wyager commented 9 years ago

So at the time, I figured if people wanted more than 32 LEDs they would probably want to change the scaling algorithm anyway.

What happens if you replace the 32 with num_leds and add a num_leds argument to scale_samples? I suspect that will fix it (unless I also hard-coded 32 in the color generation algorithms for some reason).

airboy182 commented 9 years ago

I have a issue with this file as well, I am no where good at coding so, yeah I need help. When this file tries to run I get this: File "C:\Users\Justin\Downloads\LEDStrip-master\LEDStrip-master\Audio Processing\lavalamp_colors.py", line 42 def scale((r,g,b), magnitude): ^ SyntaxError: invalid syntax Any ideas? Thanks in advance! EDIT: the carrot is actually under the parentheses

wyager commented 8 years ago

Closing due to inactivity.