Git Product home page Git Product logo

neopixel_sequencer's Introduction

neoPixel_Sequencer

A digital music style sequencer built in Processing for designing patterns for neoPixel rings (WS2812 LEDs) and then Arduino code for playing them back in a loop. Getting Started

Please note, this is a sequencer for designing patterns that you load onto an arduino compatible device, not for direct real-time serial control of the LEDs. The Processing sketch creates a .txt file already formatted for using in the accompanying arduino file. The instructions assume you have the Processing and Arduino IDEs already installed and Arduino is set for your particular board. Setup Processing

  • Download the project files and move the neo_pixel_sequencer folder to your Processing sketches folder (Usually called Processing and in your Documents folder)
  • Open Processing
  • In the Processing select Menu Sketch -> Import Library -> Add Library
  • Search for and install the "ControlP5" library
  • Open the neo_pixel_sequencer.pde file and hit Play

Screenshot>Sequencer1

Using the Sequencer

  • First set the number of pixels in your ring using the slider just below the color picker

Screenshot>LED#

  • The interface is divided into the top and bottom half. The top is for adding colors and the bottom is for controlling time and playback.
  • To begin, first click on an LED that you would like to set the color for. it will then be highlighted and filled with the current color in the color picker.

Screenshot>LEDselect

  • If you want to set other LEDs to the same color, select them one by one.
  • Each time you change the color in the color picker, it will also change the LED that is currently selected.

Screenshot>LEDselect2

  • You will notice the colors of the LEDs are also represented in the timeline in the bottom half of the program as the first column in the sequence.

Screenshot>LEDtimeline

  • Select the next slice of time by moving the playhead one column to the right. The playhead is a small blue triangle.

Screenshot>playhead

  • Now select LEDs and set their colors for the new time slice. As a default the sequencer uses 16 slices (4/4 with 4 measures) but if you look at the code you will easily see how to change that number.
  • Note that another method is to choose a color you would like to use thoughout the timeline and set each LED with the color in every time slice. For example here we have set a blue color which will move around the ring:

Screenshot>LEDtimeline2

  • We can then move back and forth in time, adding colors as needed.

Screenshot>LEDtimeline3

  • When you are ready to see your LEDs in action, you can press the Play_Pause toggle button. The playhead will then move and loop through the sequence. You can adjust the speed using the Speed slider in realtime. It adjusts the number of milliseconds between each time slice, ranging from 75 to 625 milliseconds.

Screenshot>speed

  • Once you are satisfied with the sequence, hit the "Save Sequence" button and it will export a text file with your sequence called "ledSequence.txt" Please note that every time you hit this button it will write over your previous version so re-name the file if you want to keep it. To quickly find the file go back to the Processing IDE and click Sketch -> Show Sketch Folder

Setup Arduino

  • First move the neo_pixel_player folder to your Arduino sketches folder (Usually called Arduino and in your Documents folder)
  • Download the driver and follow the instructions on this page to install the driver and then wire your neopixels to your Arduino board. Adafruit Neo-Pixel Library
  • Open the Arduino IDE
  • In the Arduino IDE select File->Open and select "neo_pixel_player.ino"

Screenshot>arduino1

  • The first change you will need to make is for the pin number you are using on your arduino as the data pin for the neo pixels. As a default it is set to pin 0 but if you follow the instructions on the Adafruit page you will need to change this to pin 6. Simply change the number after "#define PIN" to match your setup.

Screenshot>pin0 Screenshot>pin6

  • Next you need to adjust the number of LEDs on your ring. The default is 16 but you will need to adjust for whatever ring you bought. Simply change the number after "#define LED_QUANTITY" to the number of LED's on your hardware.

Screenshot>pin0 Screenshot>pin6

  • The last edit you have to do is to add the text from your "ledSequence.txt" file to the arduino sketch where it is indicated. (See the screenshots below) You must open the "ledSequence.txt" file in a basic text editor like wordpad or textedit and select all of the text and copy it. Then go to the part of the code on line 18 where it says "//paste contents of the txt file from the sequencer here.", select that line, and paste the text from your txt file there in it's place.

Screenshot>pin0 Screenshot>pin6

  • At this point you can verify your code by hitting the checkmark in the upper left corner. Be sure that you have selected your board and your serial port under the "Tools" menu. Then you can Upload the code to your board and watch it go by pressing the Upload arrow to the right of the Verify checkmark.
  • If you want to adjust the speed, there is a variable for the interval or number of "cycles" you want to wait before changing the LED to the next color called "interval" and it is set to 50 as a default. Lower values will speed up your patterns.

Screenshot>pin0

  • You might also notice that the LEDs are fading out and do not turn off instantly. This is an aesthetic decision I like, but you can easily adjust it to fade slower or quicker by changing the number on the variable called "fadefraction." For a slow fade try changing it to .99 or for almost no fade try .50.

Screenshot>pin0

  • Hopefully you have it up and running, but if you are having troubles, make sure you can run some of the NeoPixel example files before using the neo-pixel player.

neopixel_sequencer's People

Contributors

digitalcoleman avatar

Stargazers

Loren Lepton avatar  avatar  avatar Martin Rieder avatar  avatar Anton Prokhorov avatar Basti Becker avatar  avatar  avatar Datee avatar  avatar  avatar  avatar  avatar Paul avatar Ruud van Buul avatar Jordan Shaw avatar  avatar 1027kg avatar Eoin avatar N. Arman avatar Sergey Bekharsky avatar Rodolfo Rodriguez Girbes avatar Memphis Kanarok avatar Rafael Neri avatar Leó Stefánsson avatar Emmanuel G. Brandão avatar cre8tions avatar Rickorius Maximus avatar Michael Bortnick avatar Adrellias avatar lisper avatar Brannon Dorsey avatar Christopher Baker avatar Aaron Brown avatar Seth Gibson avatar  avatar  avatar Paul Elsberg avatar sovalab.pl avatar

Watchers

James Cloos avatar  avatar  avatar sovalab.pl avatar  avatar

neopixel_sequencer's Issues

Sequencer window size

Hi window size is twice the size of my laptop screen,ive tryed to make the hight smaller but its not as simple as i thought. 1366x768 is my screen res. Is this why its too big for my screen? thanks i only need 3 leds.thanks

Error when trying to play the sequencer

Processing 2.2.1
Controlp5 2.2.5

When trying to play the file it highest the line in the ColorMatrix file.
setView(new ControllerView() {

And lists this error
The type new ControllerView must implement the inherited abstract method ControllerView.display(PGraphics,Object)

I can open other Controlp5 examples.

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.