Creating a JavaScript Music Visualizer (with p5.js and React)

Sdílet
Vložit
  • čas přidán 8. 09. 2024
  • I spent two days designing and creating a JavaScript Music Visualizer that reacts to my friends' song. I used p5.js and built it in Gatsby (React). The code is open-sourced at the github repo linked below.
    Visualizer Link:www.maxemitche...
    GitHub Repo: github.com/max...
    Songs Used:
    Ben Mark - Untitled
    EVA - The End: • EVA - The End [Synthwa...

Komentáře • 35

  • @user-qf8rd2kq5f
    @user-qf8rd2kq5f Před 3 lety +2

    Great material for a new p5.js starter!

  • @noshirt4516
    @noshirt4516 Před 3 lety +2

    this is dope man, you need more recognition!!

  • @AL3CMUSIC
    @AL3CMUSIC Před 3 lety +8

    Dude you might be my new favorite channel haha keep it up seriously I’m sure there’s a big audience for this waiting to find ya

    • @MaxMitchell
      @MaxMitchell  Před 3 lety

      You might be my first real fan! Thank you so much though, I'll be posting more this summer and hopefully the audience follows :)

  • @CodeByDom
    @CodeByDom Před 3 lety +1

    very cool, great job here, love glass animals too

    • @MaxMitchell
      @MaxMitchell  Před 3 lety

      Thanks! Glass Animals was definitely my artist of the year

  • @piperpipe201
    @piperpipe201 Před rokem

    looks awesome!

  • @tudor14
    @tudor14 Před 3 lety +1

    i just saw that on your website, dude that is fucking sick! great video man

  • @gchinmayvarma9030
    @gchinmayvarma9030 Před 3 lety +3

    hey its the villain from far cry 5

  • @grahamvp
    @grahamvp Před 2 lety

    So rad!

  • @MoonlightMothMedia
    @MoonlightMothMedia Před 2 lety +1

    STRFKR is great music to listen to while coding!

  • @claystation6360
    @claystation6360 Před 3 lety

    nice dude, cheers

  • @ayushiagarwal5454
    @ayushiagarwal5454 Před 4 měsíci

    I'm using this in next js and getting window is not defined error

  • @bavanindhra2733
    @bavanindhra2733 Před 3 lety +1

    Hey i dont know if u will read this but umm how did u get p5 to render in react? is there a way to import the project onto react components? please reply?

  • @antoinegagnon5652
    @antoinegagnon5652 Před 3 lety +2

    Cool stuff! How about doing it in 3D? Maybe with Three JS

    • @MaxMitchell
      @MaxMitchell  Před 3 lety +2

      Thanks! And that’s a great idea, maybe that’ll be the next video :)

  • @richardogbonnaya9243
    @richardogbonnaya9243 Před 2 lety +1

    working on a project and im finding this very difficult to implement just a visualizer any help?

    • @MaxMitchell
      @MaxMitchell  Před 2 lety

      Sorry it’s been a while, but I’ll need more info than that to be able to help at all

  • @user-fy7kv3pp8r
    @user-fy7kv3pp8r Před 3 lety +1

    Dude your video was super helpful. I would really like your opinion on this: How can we put a text in our background displaying the current amplitude and frequency?
    Thanks in advance keep up the good job

    • @MaxMitchell
      @MaxMitchell  Před 3 lety +1

      Thanks! Not sure the best way to do it, but the quick and easy way would be to add a div with an ID, style it with some normal css to get it where you want, and use either getElementById or the querySelector to modify its innerHtml.

  • @michaelelijah2127
    @michaelelijah2127 Před 3 lety +1

    Enjoyed watching the process of this. Looking good, I was wondering if you have any advice on getting state from p5.js into React components?

    • @MaxMitchell
      @MaxMitchell  Před 3 lety

      Hmmm, I assume you mean accessing the React State from within a p5.js sketch, which I haven't needed to do yet. This stackoverflow answer looks like a good solution though: stackoverflow.com/questions/54868777/how-to-use-react-with-p5-js

  • @shan504
    @shan504 Před 3 lety +1

    hey would you recommend using straight p5 or some kind of wrapper like i've seen like react-p5-wrapper

    • @MaxMitchell
      @MaxMitchell  Před 3 lety +1

      I used straight p5 because I also needed to use p5 sound, and I couldn’t find any documentation on that with the wrapper, but I think the wrapper is another good option. It would certainly help keep the code a little cleaner

    • @shan504
      @shan504 Před 3 lety +1

      Gotcha okay thank you. Seems to be a React component library for everythin haha

  • @abhimanyunaruka378
    @abhimanyunaruka378 Před 3 lety +1

    How did you fix the framerate issue with react?

    • @MaxMitchell
      @MaxMitchell  Před 3 lety

      Hey! What framerate issue are you running into?

    • @abhimanyunaruka378
      @abhimanyunaruka378 Před 3 lety

      @@MaxMitchell I'm trying to run some simple p5js code on a react webapp. But it's running at 1-5 fps. I created a custom wrapper but still the same issue. I tried the way you're handling it in your project but still I'm facing the same issue.

    • @MaxMitchell
      @MaxMitchell  Před 3 lety

      @@abhimanyunaruka378 hmmm are you using a really old laptop? P5.js shouldn’t be that resource intensive though especially if it’s something simple. I didn’t have that issue though so I can’t really help you :(

    • @abhimanyunaruka378
      @abhimanyunaruka378 Před 3 lety

      @@MaxMitchell no. If I'm running p5js in vanilla js then it's working fine but with reactjs it's not working properly. I'm not sure how you're getting a decent framerate. Reactjs lifecycle is messing with p5's lifecycle

    • @MaxMitchell
      @MaxMitchell  Před 3 lety

      @@abhimanyunaruka378 dang, without seeing the code and actually debugging it I have no idea, the only lag issues i ran into was before I added the componentWillUnmount part to remove p5, but it wasn’t lagging on the first page load