Generate a drawing from a sound file?

Hi All,

I'm wanting to use an audio file (specifically its values of pitch, tone, volume, etc.) to generate a line drawing. I'm not looking to make a music visualizer. I've looked at and modified a few sketches I've found but nothing is what I really want. So, I figured I should do it myself.

I'm wanting an output like this image, which is one I've made using a modified sketch.

Where should / do I begin?

Thanks.

Tagged:

Answers

  • edited July 2017

    Getting the waveform or the fft from a sound file (using minim library, probably) will give you a bunch of numbers. (1000s a second in some cases)

    The hard bit is deciding what you want to do with those numbers.

  • edited July 2017

    Say something about how you want the sound to be reflected in that kind of image. What do the lines represent?

    Was your example image rendered as a continuous line? How was it generated? The points seem highly structured in ways that raw sound data almost certainly won't be -- you'll get more of a hairball then massively overlapping triangles / lattices / grids.

  • You could just draw lines for each tone

    A line is centered around the middle of the screen

    You could use the amplitude for the length of the line

    You could use the angle for the pitch

    You could even use color

  • he has a sketch to draw the image he showed, it's just a question of how he decides to get from the numbers derived from the music to that image.

    without knowing how he produced that image we are just guessing.

  • So start by reading about minim and what numbers it can give you from a song. Use println to find on which ranges those are for amplitude and pitch etc.

    Then use map() to map those values to the ranges you want for the length and angle of the line

    @koogs I think he did the image without using a song, otherwise his question would not make sense

Sign In or Register to comment.