A9 - Draw my Drum Machine
My Box Sequencer and Circle Visualization
A Dumb GIF illustration:
I just followed the steps we learned in class and stylized the box sequencer a little bit by shrinking the size, add strokes, and changing colors. Those were the easy part. Then I recalled that Luisa encouraged me to try making a circular sequencer with arc(x,y,w,h,start,stop). I felt confident about it because I've used arc several times in P5. However, when I actually coded it, I found it's more complicated than I thought.
The first difficulty assigning orders. At first the bigger arc overlapped the smaller ones and hided them underneath. I fixed that through changing the w and h from adding up to decreasing down.
The second challenge was the mousePressed function. It's doing not simple math with mouseX, mouseY, and w anymore. In order to make it work, I have to create a class of arcs and assign the arcs that represent each drum note to objects of that class. It's too much labor to do for now so I just stopped here and saved it for another day. Plus we probably would learn smarter ways to do it.
As a result, I just kept the old one, and add the circle illustration of my sequencer on the right. That part is not interactive, just showing off that I did the work : )
Link to my editor code: https://editor.p5js.org/roger1mjh/sketches/E1szOB4p
Link to present mode: https://editor.p5js.org/roger1mjh/present/E1szOB4p
Comments
Post a Comment