Giter Club home page Giter Club logo

p5-music-viz's Introduction

Visualizing Music with p5.js

This session is for anyone who would like to explore music, visuals and creative coding for the web. We'll demonstrate types of data we can get from digital signal processing using interactive sketches in p5.js and the p5.sound library that builds upon the Web Audio API. We'll explore various methods to map this data onto meaningful visuals that enhance our experience of music.

Slides

Intro Slides

Code Slides

Demos:

##1. Amplitude

##2. Frequency FFT - Fast Fourier Transform

Scaling the FFT

##3. Pitch autocorrelation in the time domain to detect fundamental frequency

#4. Musical Timing sync music to timestamped lyrics

Visualizaitons with the Spotify Audio Analysis API (formerly Echo Nest API)


Libraries

Participants may use whatever tools they wish, but the demos in this repo use the following libraries:

p5.js is a JavaScript library that starts with the original goal of Processing, to make coding accessible for artists, designers, educators, and beginners, and reinterprets this for today’s web.

p5.sound.js is an addon library that brings the Processing approach to the Web Audio API.

p5.dom.js is an addon library that helps us manipulate the DOM.

Setup

Inspiration:


p5.sound Classes That We'll Use For Music Visualizations:

p5.AudioIn - microphone! documentation | source code

p5.SoundFile - load and play .mp3 / .ogg files. documentation | source code

  • loadsound() creates a SoundFile using a Web Audio API buffer. Use during preload(), or with a callback, or with drag and drop.

p5.PeakDetect - detect beats and/or onsets within a frequency range documentation }| source code

p5.Amplitude - Analyze volume (amplitude). documentation | source code

  • .getLevel() returns a Root Mean Square (RMS) amplitude reading, between 0.0 and 1.0, usually peaking at 0.5
  • .smooth()

p5.FFT - Analyze amplitude over time / frequency. documentation | source code

  • .analyze() returns amplitude readings from 0-255 in the frequency domain.
  • .waveform() returns amplitude readings from -1 to 1 in the time domain. demo | source

Music included in the demos/repo:


Dig Deeper into Web Audio Music Visualization...

Deeper into DSP

Music Visualization Inspiration...

Notation

Interactive

Audio

Data Sonification

Musical Form

Lyrics

p5-music-viz's People

Contributors

therewasaguy avatar robstenzinger avatar michellechandra avatar

Watchers

TransparentBubble 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.