When I asked Vikalp to design a new one, I knew I wanted something that was slightly more softer. This is what he came up with, after a few iterations:
This wasn’t the final iteration, and both of us agreed that there was something missing.
I saw a colleague using
cava and spent a bit of time trying out different visualization software. The ones that I tried out:
I decided to go ahead with Spectrumyzer (This is the default config):
The very same day, stuck in a traffic jam1, I asked Vikalp for some color ideas on the visualization.
The obvious 2 were tried first:
It finally dawned on us to use the light blue variant with padding set to zero:
Here is one showing the actual positioning (set using the offsets):
With the padding set to zero, it already looked great. I ended up using this as my wallpaper for the next one week. Vikalp wanted to make the bars non-rectangular, and I spent some time figuring out how to make waveforms using bezier curves2. The basic learning from my experiments were:
This is roughly what you want to do when drawing waveforms:
If you are interested in playing around with Bezier curves, see Animated Bézier Curves. A Primer on Bézier Curves is a math-heavy explanation if you want to read further3.
The code I wrote picks the midpoints of the bars and then connects them using bezier curves:
# control point cords # Make sure these are symmetric c1x = rect_top_mid_x + 16 c2x = next_rect_top_mid_x - 16 c1y = rect_top_mid_y c2y = next_rect_top_mid_y
I also had to make the number of bars configurable (this is default=64, which doesn’t look great):
Here is the complete final result in HD:
If you’d like to replicate this setup, or build upon it, here is my spectrum.conf file. I also filed a PR (now merged!) to the spectrumyzer project adding support for curve based renders.
Published on May 01, 2017 in visualization,audio,python