Giter Site home page Giter Site logo

lightshow's Introduction

lightshow

This project visualizes songs with LEDs using a Raspberry Pi. I wanted to build something fun to show my young niece over the winter holidays, so the first song that I wrote in this format was Jingle Bells; you can click here to see the song being performed.

Each LED represents a different note in a diatonic scale, with the leftmost LED representing "do", and the rightmost LED representing "ti".

The music is coded in, and played from, an instance of Sonic Pi that is running on my Raspberry Pi 3B+. The code sends OSC messages for every note played.

A Python script listens for these OSC messages, and lights up a corresponding LED in time with the music.

Materials

I used:

  • Raspberry Pi 3B+
  • 9 male-female leads
  • 7 220-ohm resistors
  • 7 LEDs (4 red and 3 green for the festive colours)

Circuit Diagram

jingle bells circuit diagram

Procedure

  1. Start OSCtoLights.py (I ran it on Python 3.x). This script assigns LEDs to each GPIO pin used, listens on port 3585 for incoming messages, and parses those message to visualize one note at a time on te LED set. The code currently only looks at the pitch name being sent, and not the octave.
  2. Run your Sonic Pi tune on the same Raspberry Pi. Make sure that you set the outbound OSC messages to use the same port (here, 3585).

Note: if you are writing your own sonic pi tunes, make sure to format the OSC messages as "octave/pitch". See sample code.

lightshow's People

Contributors

jakeparmstrong avatar

Watchers

 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.