Tom has already said he wants to be able to use LED strips and GPIO pins in the same configuration. I'll suggest something simple: assign LED 0 to "channel" 100, and increment from there. I don't think we can put more than one strip on an RPi, but is it possible to network multiple RPi's and drive each one separately? I haven't yet looked closely at the new networking functionality.
Allow specification of a "plugin" function in the preshow configuration. It would make it much easier for someone to write a custom animation. It could be as simple as a *.py file following a template, imported at runtime. The animations that Tom suggested could be seeded as examples, along with ON and OFF "animations" -- and I could write a FADE animation. Could we use the same methodology for frequency-triggered animations?
Since the RGB strips offer such a wide variety of colors, users may want an alternate color map for different occasions (Christmas, Halloween, etc.), or to match the other lights in their display. After looking at Tom's use of the color map in bibliopixel, I'd like to provide a way to specify an alternate color map. It is most easily built in Python, so a plugin function would be appropriate. As a stretch goal, maybe we could add a color map parameter to the playlist, and users could choose different ones per song.
Some of the LED strips have a very small pitch. I found one with 60 LEDs per meter, or about 0.65 inches apart: https://www.adafruit.com/products/1138. Yes, that's overkill, and I'm not sure bibliopixel would support it. But, I wanted to make the point that a user might want to map a channel to multiple LEDs to increase the apparent size -- either adjacent or distributed among the strip. For instance: map 25 channels onto a 100 LED strip. I THINK that can be done with custom_channel_mapping, but if not -- we should implement a way to do it.
sage: hardware_controller.py [-h] [--test] [--flash] [--fade] [--cylon]
[--dance] [--step] [--random_pattern]
[--lights_in_group LIGHTS_IN_GROUP]
[--pwm_speed PWM_SPEED] [--cleanup]
[--lights_on] [--lights_off] [--light LIGHT]
[--sleep SLEEP] [--flashes FLASHES]
optional arguments:
-h, --help show this help message and exit
Hardware test:
Run a basic hardware test to insure everything is working
--test Run a basic hardware test
Test patterns:
Different patterns to display
--flash Fade lights in sequence
--fade Fade lights in and out in sequence
--cylon Lights one channel at a time in order Then backs down
to the first rapidly
--dance Start at each end and dance to the other
--step Test fading in and out for each light configured in
pwm mode
Random_pattern:
Display a random pattern of lights
--random_pattern Display a random pattern of lights
--lights_in_group LIGHTS_IN_GROUP
number of light in a group as an int
--pwm_speed PWM_SPEED
time in seconds to full on or off as a float
States:
Different states that the lights can be left in
--cleanup Reset GPIO to default state
--lights_on Turn on the lights
--lights_off Turn off the lights
Option:
Options that can be used with all of the above except Random Pattern which
has it own options
--light LIGHT the lights to act on (comma delimited list), -1 for
all lights
--sleep SLEEP how long to sleep between flashing or fading a light
--flashes FLASHES the number of times to flash or fade each light
Tom, I've checked out this version, and it's working fine for me. config/defaults.cfg needs an update: it still says gpio and led strip support are exclusive.
With respect to the colors/brightness, one thing you might consider is the calculation of brightness in update_lights():
brightness = matrix - mean + (std * 0.5)
brightness = (brightness / (std * 1.25)) * (1.0 - (attenuate_pct / 100.0))
With respect to the colors/brightness, one thing you might consider is the calculation of brightness in update_lights():
brightness = matrix - mean + (std * 0.5)
brightness = (brightness / (std * 1.25)) * (1.0 - (attenuate_pct / 100.0))That will affect the gpio results so not an option.
As for setting gpio_pins = 0 that is the way it is suppose to be. Use gpio pin 0 in the show.gpio_pins is a list of the pins to use, for example gpio_pins = 0, 1, 2, 3, 4, 5, 6, 7, 21, 22, 23, 24, 25, 26, 27, 28
--
http://www.lightshowpi.org/
---
You received this message because you are subscribed to the Google Groups "LightShow Pi Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lightshowpi-d...@googlegroups.com.
To post to this group, send email to lightsh...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lightshowpi-dev/0b7c4675-aa16-4fa9-ad5a-fcb800a1ca46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I had a few minutes this evening, and installed the latest version. It's working great for me, and I really like the new --createcache option!
Tom, if you like -- I can send you some code that uses the glob package, so that you can specify a pattern for the filename, i.e. *.mp3. Then, you can build the cache for your entire library at one time.
On Friday, February 5, 2016 at 5:46:13 PM UTC-6, Paul Barnett wrote:
I'm planning to download this in the next few days and test it -- probably on Monday. This weekend is shaping up to be busy.I just got a new RPi 2 and another 50 LEDs, so I now have a total of 60 (eventually, I expect to have 185). Once I secure the lights to the top of a spiral tree, I'll experiment with different color maps and thresholds.I went to an auto parts store yesterday to buy wire, connectors, fuse block, fuses, heat shrink tubing, etc. The guy at the register looked at my pile of stuff and asked: "what the heck are you building?!". :-) I explained that it was all 5V, but 12V parts would work fine.....For what's it's worth, you can easily convert a newer ATX power supply (with a 24-pin connector) to power multiple RGB LED strips and an RPi by simply shorting pin 16 to ground (simulating Power-On). That's enough to get mine to start up, and I can use the various +5V lines to power everything. But, I highly recommend fusing the 5V lines, as the power supply will be happy crank up the amperage.... mine will put out 30A in the absence of any other load on 3.3V or 12V.
On Friday, February 5, 2016 at 10:29:17 AM UTC-6, Tom Enos wrote:
Updated the code, I used every trick I knew to speed things up. I will now support over 500 leds after cache. I also added the command line option --createcache, it creates the cache without playback which speeds up the process.
On Friday, January 22, 2016 at 8:30:52 PM UTC-8, Tom Enos wrote:
git fetch && git checkout lightshowpi-ledIt is tested and working with APA102's and WS2801's and it should work with LPD8806'sThis is not production code. It will work with led strips or gpio pins, but not both at the same time.This is just to work out any problems with strips. Paul Barnett has offered to work on this with me.After we work out all the bugs I will make it so that we can use led strips and the gpio pins at thesame time.It might be worth writing a few animations that could be trigger by frequency. They could be used for things like leaping arches, spirals wrapped around Paul Dunns tomato cages, a star make up of a few pixies, etc.....
--
http://www.lightshowpi.org/
---
You received this message because you are subscribed to the Google Groups "LightShow Pi Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lightshowpi-d...@googlegroups.com.
To post to this group, send email to lightsh...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lightshowpi-dev/be75add9-dc5e-4e05-80f3-4f60d144a953%40googlegroups.com.
for f in music/*.mp3; do
python py/synchronized_lights.py --createcache --file $f
done
I have code that will build the cache for an entire playlist, I just didn't include it because I was only testing with one file and changing the led count. I didn't need to cache multiple files.
On Sat, Feb 6, 2016 at 4:18 PM, Paul Barnett <paul.thom...@gmail.com> wrote:
I had a few minutes this evening, and installed the latest version. It's working great for me, and I really like the new --createcache option!
Tom, if you like -- I can send you some code that uses the glob package, so that you can specify a pattern for the filename, i.e. *.mp3. Then, you can build the cache for your entire library at one time.
On Friday, February 5, 2016 at 5:46:13 PM UTC-6, Paul Barnett wrote:
I'm planning to download this in the next few days and test it -- probably on Monday. This weekend is shaping up to be busy.I just got a new RPi 2 and another 50 LEDs, so I now have a total of 60 (eventually, I expect to have 185). Once I secure the lights to the top of a spiral tree, I'll experiment with different color maps and thresholds.I went to an auto parts store yesterday to buy wire, connectors, fuse block, fuses, heat shrink tubing, etc. The guy at the register looked at my pile of stuff and asked: "what the heck are you building?!". :-) I explained that it was all 5V, but 12V parts would work fine.....For what's it's worth, you can easily convert a newer ATX power supply (with a 24-pin connector) to power multiple RGB LED strips and an RPi by simply shorting pin 16 to ground (simulating Power-On). That's enough to get mine to start up, and I can use the various +5V lines to power everything. But, I highly recommend fusing the 5V lines, as the power supply will be happy crank up the amperage.... mine will put out 30A in the absence of any other load on 3.3V or 12V.
On Friday, February 5, 2016 at 10:29:17 AM UTC-6, Tom Enos wrote:
Updated the code, I used every trick I knew to speed things up. I will now support over 500 leds after cache. I also added the command line option --createcache, it creates the cache without playback which speeds up the process.
On Friday, January 22, 2016 at 8:30:52 PM UTC-8, Tom Enos wrote:
git fetch && git checkout lightshowpi-ledIt is tested and working with APA102's and WS2801's and it should work with LPD8806'sThis is not production code. It will work with led strips or gpio pins, but not both at the same time.This is just to work out any problems with strips. Paul Barnett has offered to work on this with me.After we work out all the bugs I will make it so that we can use led strips and the gpio pins at thesame time.It might be worth writing a few animations that could be trigger by frequency. They could be used for things like leaping arches, spirals wrapped around Paul Dunns tomato cages, a star make up of a few pixies, etc.....
for f in music/*.mp3 music/*.wav music/*.ogg; do
python py/synchronized_lights.py --createcache --file $f
done[hardware]
gpio_pins=
led_strip_type=WS2801
led_count=1
Traceback (most recent call last):
File "py/synchronized_lights.py", line 964, in <module>
play_song()
File "py/synchronized_lights.py", line 879, in play_song
update_lights(matrix, mean, std)
File "py/synchronized_lights.py", line 242, in update_lights
for pin in xrange(len(brightness[:i])):
IndexError: invalid index to scalar variable.
The reason: brightness is a scalar value, not an array where len(brightness) = 1.
I should note: this problem only appears to occur AFTER the cache file is created. So, maybe the cache-loading is the real issue?
You are probably wondering: why would I want to do this? I'm experimenting with a different way to use the LEDs: rather than assigning a different frequency band to each LED, I'm treating the entire LED strip as a single channel and using the amplitude of the full audio spectrum to set the brightness.
Then, I'm writing an "animation" to occur at the same time -- something like a shifting rainbow or subset of colors. So, the amplitude will vary in time with the music, while the colors shift. It's still a work-in-progress, but once I have a working example and have constructed the first part of my planned display, I'll upload a movie to demonstrate it.
I added a dummy GPIO channel, then used custom_channel_frequencies to map the full audio spectrum to the LED channel. So, this isn't impeding me at the moment. If you don't get to it first, I'll go back and look at the cache loading and see if that's the source of the problem, and keep digging if it's not. But, I want to follow through on this alternate methodology first.