Coder Social home page Coder Social logo

sonic-pixels's Introduction

Sonic-Pixels

Interactive lighting effects for Sonic Pi.

Requires:

  • A strip of NeoPixel LEDs (or similar, as long as it's supported by rpi_ws281x). If you don't have them yet, but still want to try this out, you can run in fake mode and it will just display the LED colours in the terminal.
  • One Raspberry Pi, to control the LED strip (again, not needed to run in fake mode).
  • One copy of Sonic Pi, to make some phat beats and control your lighting fx.

It should work with any version of the Raspberry Pi, but I used a Pi zero set up to run in USB OTG mode (so it behaves like a USB gadget and draws its power from the host computer running Sonic Pi, and you also get a nice stable network connection over USB). Alternatively you could run Sonic Pi on the same Raspberry Pi that's controlling the LEDs, so you don't need a separate computer.

sonic-pixels's People

Contributors

emlyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ryzbaka

sonic-pixels's Issues

Gamma correction

LEDs get very bright very quickly, colours will probably look less washed-out with some gamma correction.

"neopixel" is no longer provided by rpi_ws281x

As of version 4.0.0 rpi_ws281x drops the "neopixel" module from its package, canonicalising instead on "rpi_ws281x", see: https://github.com/rpi-ws281x/rpi-ws281x-python/releases/tag/v4.0.0

So you would need to change:

from neopixel import Adafruit_NeoPixel, Color, ws

to

from rpi_ws281x import Adafruit_NeoPixel, Color, ws

And then - once rpi-ws281x/rpi-ws281x-python@75f4b64 makes it into a release - you should be able to use the rpi_ws281x package.

Support for 2D arrays of LEDs

There's some token attempt at support in places, but it's by no means complete.
It would also need the fake pixels to use curses or similar to be able to update multiple lines.

Improve FX system

Lots (e.g. keeping track of previous image, start time etc) is handled by each derived effect. Should move this to base class to make writing new FX easier.
Make getDisplay set properties, then call an 'abstract' render method in derived FX.
Also abstract out argument parsing (handling optional args etc).

Improve command handling

Effects should register themselves so you don't also need to add a case statement for each new FX.

Remove spectra dependency

Can use PIL.ImageColor to do colour string parsing. Will need to implement equivalent of spectra.scale though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.