GithubHelp home page GithubHelp logo

maryats / sound-visualizer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 13.63 MB

Works best in Firefox. Click to "Allow" microphone access. :-)

Home Page: https://maryats.github.io/Sound-Visualizer/

HTML 19.14% JavaScript 68.38% CSS 12.48%

sound-visualizer's Introduction

For this project, I wanted to use particles to create an interactive sound visualizer that would respond to sounds made by the user and to music.

I first tried to create the particles using the p5.particles.js library, but I found that the particle definitions did not allow me as much control over particle properties as I wanted. For example, the location of the particle fountain/source had to be defined in the setup() function, so I couldn’t make the particle fountain follow the mouse.

Luckily, I found an example script by Hunter Loftis (http://www.playfuljs.com/particle-effects-are-easy/) that created particles that followed the mouse. His code was originally written in HTML, so I translated most of it into javascript (with the exception of some lines that had to do with HTML canvas properties).

To add music that the particles could respond to, I reused the code from my HW4/5 Sound Visualizer to preload music and create a drop-down list of songs.

I wanted to have my particle sound visualizer fill the entire window, so I tied the canvas size to windowWidth and windowHeight at the moment the program is launched. I used the p5.sound.js library and had my code activate the user’s microphone, and tied the level of microphone sound to the stroke width of the particles, so that they would get bigger in response to louder sounds and disappear entirely when the room was silent.

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.