Drum / Glitch Machine

For my midterm project, I initially wanted to make a drum machine. I believed that the program p5 would work well for this. The p5.sound library has a lot of musical examples for inspiration, and I’ve worked with p5 before.

First, I made a p5 sketch that allowed me to play drum sounds and loops by pressing keys on my laptop. I had 8 different drum sounds that I could trigger by pressing the keys “a” to “h” on my computer. I also had two loops that you could turn on or off by pressing keys “z” to “v”. I did a run-through of that in 0:02-0:14 of the video below.

Next, I wanted to create a physical interface that would be easier to use. I wanted to use large button switches to trigger drum sounds and loops. I believed they would give a more natural tactile feel. To do this, I created an Arduino sketch that could draw information from button switches in real time. Then I wired up 8 button switches. I wanted to transfer the data about the microcontrollers from my Arduino sketch to my p5 sketch. I used p5’s built-in loadJSON function to get data from my Arduino sketch through my web browser. At this point, I ran into a problem. I couldn’t figure out how to get my p5 sketch to draw information from my microcontroller in real-time. When I ran my p5 sketch, I could trigger a drum sample if I pressed down on the button switch before the sketch finished loading. But after that, I couldn’t use the button switches to interact with the sketch. Also, the drum sounds that I tried to trigger would buffer, distort, and play indefinitely. Basically, the sounds would glitch.

I decided to rename my project the “glitch machine.” Glitches can sometimes sound cool in music. For example, there is a style of EDM called glitch that uses the effect as a rhythmic device. Glitches are also sometimes used in post-rock and alternative rock as a sound effect. I decided to see if I could create interesting sounds using my glitch machine. I put drum, guitar, bass, and keyboard sounds in my sketch. While it’s not what I initially intended to create, I think my “glitch machine” has the potential to create interesting sounds. I did a run-through of this from 0:20 to 0:30 of my sketch. I used the refresh button on my web browser to switch between different sounds. For this reason, I had to record the audio and visuals separately: I couldn’t press refresh, press down on buttons, and hold my phone to film all at the same time.