Giter Club home page Giter Club logo

chroma-scripts's Introduction

Chroma-Lights

Chroma lights is a frame work for running annimations for led lights over OSC.

Setup

Install virtualenv (skip if you have it already).

sudo easy_install virtualenv

Move on to running to get the environment activated and dependencies checked.

###Windows users Scroll down to see instructions since there are a buttload.

Running

There is a simple emulator provided that will start automatically when run.py is executed if it's not running already. In your chrome-scripts directory, run the activate script. If this is your first time running it, give it a bit to fetch dependencies and setup the environment:

source activate

To run an animation:

./run.py [animation name]

If you're on zsh, tab completion should work too. If there isn't a server or emulator started, it will start the emulator for you automatically.

When you're done hacking, deactivate to get exit out of virtualenv. Contributing

To contribute add a new folder in the animation directory. This folder should be have a unique name for the animation. The folder must contain the following two files:

main.py:

import sys
from oscapi import ColorsOut
...

manifest.json:

{
	"name":"Random Colors",
	"description":"Random colors on 3 second intervals",
	"creator":"RJ and Reed"
}

Each light recieves an input that is a tuple (r,g,b) where each of r, g, b can be 0-1023.

Construct an array of tuples and send them to the OSC server with

pix = [(1023.0,0.0,0.0)]*24
out = ColorsOut()
out.write(pix)

To add simple effects, such as automatic fade-in and fade-out of pixels, use the animations library in place of ColorsOut

from animations import FadeAnimation
pix = [(1023.0,0.0,0.0)]*24
out = FadeAnimation()
out.FADEINRATE = 2.0 #optional
out.FADEOUTRATE = 8.0 #optional, makes things 'trail off'
out.start()
out.write(pix)

Tips and Tricks

Chroma is bright, and can easily be the predominant lighting in the room. Fast blinking of the lights can be intense, so be considerate.

  • Avoid instantaneous changes in both intensity and color
  • Use the provided animation framework to transition between colors

Windows Setup Cont'd

0. Install Python 2.x from http://www.python.org/getit/
1. Download and run Processing for Windows from http://processing.org/download/
2. Install the oscP5 library from http://www.sojamo.de/libraries/oscP5/
3. Run chroma-scripts\emulator\source\lights_emulator\lights_emulator.pde in processing
4. Add "C:\Python2x" and "C:\Python2x\Scripts" to your PATH environment variable
5. Install the setup tools as described here: http://pypi.python.org/pypi/setuptools
6. Download and fully extract this file: http://pypi.python.org/pypi/pip#downloads
7. Go to the extracted directory and run
python setup.py install
pip install virtualenv
8. Change directory to chroma-scripts and run
virtualenv env
env\Scripts\activate
pip install -r dependencies.txt
python run.py random

Note: be sure (env) is displayed at the beginning of every command line when running scripts, or else it will not work!

9. Check your emulator. It should be displaying random colors.

chroma-scripts's People

Contributors

dylnuge avatar hsingh23 avatar klange avatar klnusbaum avatar marner2 avatar nhandler avatar reedlabotz avatar rjmarsan avatar rmmh avatar robertpieta avatar scowalt avatar swotfabs avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.