Link to p5.js editor: https://editor.p5js.org/kh1785/sketches/pK58fkixU
This week's assignment was inspired by the phenakistoscope technique, one of the old fashioned optical illusion toys.
Example of the phenakistoscope disc
There are two different modes in the sketch, which can be navigated by typing keyboard keys, 'p' and 'h.' As shown below, the title page presents the name of the song and its composer and the sound mode shows the phenakistoscope disc.
By typing the keyboard key 'p', the users can enter the sound mode where the sound file will be played. When the keyboard key 'h' is typed, the sound stops and the title page will be shown again.
Depending on the amplitude, the speed of rotation will be determined. I used abs() and int() to smooth the rotation of the disc. The result is a rotating disc depending on the amplitude of the sound. However, the sketch is not completed by itself; it still requires the users to look through the moving slits to visualize animation.