Giter Club home page Giter Club logo

synesthesia-music-visualizer's Introduction

Synesthesia Music Visualizer System

Synesthesia is a music visualizer system originally created for the Oculus Rift. This GitHub repo contains the scripts for that visualizer.

Feel free to fork it and make it your own! If you add something that's useful across the board, please submit a pull request and I'll merge it in.

If you use this code elsewhere, please include my name somewhere visible.

What's that? You want to support the code author? Soon these scripts will be available on the Unity Asset store, and you can support me by buying them for a small price (probably ~$5-$10).


Basic Usage

  1. Clone this repo into your Scripts folder

  2. Create a "Visualization Controller" object and add an Audio Source and the "Audio Visualizer" script

  3. Create another game object and put one of the receivers on there. These are the different types of receivers, note that some of them require various components

    • Basic Object Listener scales the object based on the volume
    • Lights Listener changes the color of the light based on spectrum data
    • Particle System Listener changes the speed and color of a particle system's emissions
    • Particle System Mover Listener mods a Particle System Listener by moving the base transform based on volume
    • Particle System Object Listener mods a Particle System Listener by scaling the base transform based on volume
    • Trail Renderer Listener moves the base transform along a path based on volume
    • Wave Listener is based on the awesome Jason Whitehouse's visualizer package (free in the Unity Asset Store)
  4. Add the listeners to the array of listeners in the Audio Visualizer object's inspector window.

  5. ???

  6. Profit!

Implementation

Synesthesia is designed to be an object oriented audio system based on audio events and audio listeners. The main controller takes advantage of the two methods Unity provides for interpreting an audio source - GetOutputData and GetSpectrumData. GetOutputData provides average decible level over a number of samples. GetSpectrumData provides the levels of all split into a number of buckets.

AudioVisualizer is the controller of the audio events. It gets the data from the Unity methods, calculates the root mean square value (rmsvalue) multiplied by the provided volume, and calculates the color. Then it passes all of this into each listener in its array of listeners using an AudioEvent object.

AudioListener is the base of all of the audio listeners. Extend this class to add a new listener. The functions in this class are designed to be overridden, check the comments in the code for descriptions on what each method is meant to do and how you might override it.

Thanks

Thank you to Jason Whitehouse Visualizer Package, DimasTheDriver's excellent blog post, and aldonaletto's answer on Stack Overflow.


2014 Ulysses Popple http://upopple.com/

synesthesia-music-visualizer's People

Contributors

ulyssesdotcodes avatar

Watchers

Michael Klatskin 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.