Rectangle-based Audio Visualiser

Hi guys! So, for an assignment I'm working on I'm trying to get an audio visualizer with rectangles instead of a traditional waveform. To see what I mean, check out 0:04 in this video:

Is this possible in Processing? Thanks.

Answers

  • edited March 2018 Answer ✓

    Yes, it is possible!

    One approach:

    Use minim to get the data. Try drawing a single vertically centered rectangle. Try vertically growing an shrinking it with e.g. mouse input. Then make a series of rectangles. Then hook the rectangle series loop up to minim data.

  • Thanks @jeremydouglass! I have it working now.

  • Mind sharing your code please?

  • Chrisir, this is the visualiser part of the code. I added the m variable to make it look a bit more visually appealing and dynamic.

    for(int i = 0; i<ai.bufferSize(); i++)
        {
          for(int p = 176; p<486;p+=28)
            {
              float m = random(200,400);
              rect(p,235,20,ai.left.get(i)*m);
            }
        }
    
  • Thanks a lot for sharing!

  • You're welcome! :)>-

  • edited April 2018

    Yes, congratulations on getting your solution working, and thank you for sharing it with the forum!

    I might recommend against including large random values in your visualization output -- they tend to obscure what your sensor(s) and inputs are actually doing.

Sign In or Register to comment.