Sound Visualization - 'Irisgram' (Spectrogram) P5JS

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ก.ค. 2022
  • In today's video, you'll learn how to make a circular spectrogram (irisgram) in P5JS. If you come from another programming language, don't worry; you can still learn the basics and give it a shot!
    This project is special to me because it is what drew me deeper into programming in general. I began coding in Godot by watching tutorials; I hadn't solved a single problem on my own at the time. But after seeing an incredible circular spectrogram on Vimeo, I knew I had to try it. The rest is history:)
    The code is admittedly a little unoptimized; the line visualizer and spectrogram length variables could be parametric, and the angle problem could be solved by introducing an additional variable to hold the angle value at pause/play. But my excitement was too much for me to contain, so I made the video. I'll leave that problem up to you to solve!
    P5JS sketch: editor.p5js.org/tinyturingmac...
    Thanks for watching, happy programming!
    #p5js
    tags:
    spectrogram, irisgram, sound visualization, p5js, tutorial

ความคิดเห็น • 26

  • @ninjarts9034
    @ninjarts9034 ปีที่แล้ว +2

    @turing code the way to fix the angle resetting when pause is to make a=a is stead of a=0

    • @turingcode
      @turingcode  ปีที่แล้ว

      Thank you, it works!

  • @Bowen448
    @Bowen448 21 วันที่ผ่านมา

    Thanks for passing it forward!

    • @Bowen448
      @Bowen448 21 วันที่ผ่านมา

      I created my own particle system and many other experiments 20 years ago in Processing when it was just around and mostly Java based. I'm really happy redescovering p5(.js) and having some fun again. Unbelievable how much the whole ecosystem evolved and the ease of use improved. Anyway, happy coding :)

  • @morejpeg
    @morejpeg ปีที่แล้ว +12

    Hey I'm the dude from Reddit who made this!

    • @turingcode
      @turingcode  ปีที่แล้ว +3

      Thanks for your help!

    • @morejpeg
      @morejpeg ปีที่แล้ว +2

      @@turingcode Anytime, good work on the tutorial!

    • @Bowen448
      @Bowen448 21 วันที่ผ่านมา

      Haha that's so cool/funny. Nice work and thabks for sharing!

  • @sebastianquirarte6705
    @sebastianquirarte6705 3 หลายเดือนก่อน +1

    Really cool thank you for sharing!

  • @charlenezhao3366
    @charlenezhao3366 ปีที่แล้ว +1

    Incrediable!! Really loving your code and it's so delicate to use short lines to show these complicate art. Thanks for sharing😄

    • @turingcode
      @turingcode  ปีที่แล้ว

      Haha thanks! Glad you enjoyed the video!

  • @eroskuncoro3837
    @eroskuncoro3837 ปีที่แล้ว

    brother ur the best my man, very helpful video for my final exam coding class thank you so much blessed

    • @turingcode
      @turingcode  ปีที่แล้ว

      Glad to have helped in anyway!

  • @user-lm4qj6jy5v
    @user-lm4qj6jy5v 7 หลายเดือนก่อน

    thanks a lot for this!! amazing

  • @mehmeterendesign
    @mehmeterendesign 2 หลายเดือนก่อน

    Cool one ✌️

  • @patrickd4358
    @patrickd4358 ปีที่แล้ว

    nice bro

  • @UNKNOWNMAER
    @UNKNOWNMAER ปีที่แล้ว

    Интересная идея!

  • @buzzkill29
    @buzzkill29 6 หลายเดือนก่อน

    Thank you for sharing this! I was wondering if it is possible to connect a spotify API to this sketch? Would love to get some help on it!

    • @turingcode
      @turingcode  6 หลายเดือนก่อน

      Hi, I really haven't used the Spotify API but it seems Spotify doesn't allow saving of audio files. Which means you wouldn't get access to the frequency data... Now you don't have to explicitly get the frequencies from an offline file but again I don't think Spotifiy gives you access to the same. So far I can only see access to data like genre, year, mood, etc.
      One solution I could think of is to simply adapt the spectrogram so it's not running in real-time which would give you time to "gather" audio information from the Spotify 'play song' calls. How you would capture that data is entirely up to you. I want emphasize this by no means an optimal solution.

  • @natalieiverson3333
    @natalieiverson3333 ปีที่แล้ว

    Hi, I'm wondering the code can be edited to export an SVG. I've been trying but have not had any success yet. Do you have any ideas?

    • @turingcode
      @turingcode  ปีที่แล้ว +1

      Sorry for the late response. If you're still looking for answers, check this project.
      editor.p5js.org/dannyrozin/sketches/r1djoVow7

  • @hanbala9138
    @hanbala9138 ปีที่แล้ว

    Hi! thanks man! is it possible to make this react to a mic? how can you do that?

    • @turingcode
      @turingcode  ปีที่แล้ว

      That's an interesting idea! But since its a live feed we won't be able to work out the angle (constrained by the audio duration, perhaps you could start a timer and set that as duration?). If you're happy to work with the duration constraint, set a predefined time limit first, then pass the live feed through the FFT by calling fft.setInput(_mic variable_). You can set up your mic input using:
      p5js.org/reference/#/p5.AudioIn
      Also, depending on the quality of your mic, you might need to boost/cut certain frequencies. Cheers!

  • @richardwatson4921
    @richardwatson4921 ปีที่แล้ว

    Thats very cool....But, come one, now do the reverse - Take a picture of somebodies actual iris and play it as a sound!

    • @turingcode
      @turingcode  ปีที่แล้ว

      That'd pretty interesting indeed 🤔 😁

  • @Nicogs
    @Nicogs 10 หลายเดือนก่อน

    the line(0, i, 0, i) makes noooo sense at all ahha