MLNI – W06 – Pitch Visualization

For this week’s assignment, I visualized the pitch by changing the color and the size of the figure correspondingly. Since during the class, we’ve learned how to detect the pitch from the microphone and visualized it by changing width and height of the rectangle, I made a few changes to the sample code so that it can be more aesthetic. 

Basically, I chose to present an ellipse instead of a rectangle. Then I used the map function to make the color and the size changing with the pitch frequency. Since I was using HSB color mode, the color would change from red to purple following the increase of the frequency. And the higher the pitch is, the larger the ellipse would be. I also changed the color of the background corresponding to the frequency so that if the pitch is higher, the background would be whiter. Then I played a piano song called “Sonata in C Major K.545 No.1” from Mozart to test how it works. 

It looks like this:

Leave a Reply

Your email address will not be published. Required fields are marked *