Creating Sound Computationally
|

Check it out! Here’s the sketch.

Introduction
For our assignment this week, we created a musical composition using p5.js. The goal was to produce a coherent piece that resembled music rather than random sounds. This involved downloading and incorporating various sound files into our project.

My partner, Fabri, and I drew inspiration from Indian and Arabic rhythm systems, moving away from the more common 4/4 or 3/4 time signatures typically found in pop music. These  rhythmic frameworks offered a unique foundation for our composition, allowing us to explore dynamic patterns.

Brainstorming
Our brainstorming process began with a rhythm that has stayed with me since my childhood. Growing up, I took Kathak classes, a classical Indian dance style where students learn and practice various rhythmic systems called tihai or theka. One rhythm in particular stood out in my memory—a 16-count pattern I had practiced intensively when I was young. It became the foundation of this project.


When I shared this rhythm with Fabri, by voicing it aloud—“da, dhin, dhin, da, da, dhin, dhin, da, na, dhin, dhin, da, dhin, dhin, dhin, da”—he was instantly intrigued. From there, we started brainstorming how to recreate and computationally represent this rhythm.

At the same time, we wanted to incorporate another mutual passion: techno music. Both of us enjoy dancing to techno, and we felt inspired to merge the intricate rhythmic structures of Indian classical music with the pulsating energy of techno, mimicking artist collectives we both love, like Laylit and No Nazar.


Additionally, we thought about including voice as a key element in the composition, since vocalizing rhythms is a traditional way of learning and practicing them in Kathak. This approach was also how I first expressed the rhythm to Fabri, and brought the project full circle.


Developing & Coding
Our coding process began with some challenges, as the pseudocode we had learned in class was built around a standard 4/4 time signature. Initially, we tried to fit our 16-count rhythm into this framework, but it didn’t sound right. We soon realized that instead of using four bars to represent 16 counts, we needed to create a custom system where all 16 counts fit into a single bar of music.

To accomplish this, we researched teentaals and other Indian rhythmic systems to gain a deeper understanding. This was particularly important since neither of us had formal music training. Once we figured out how to properly structure the 16-count rhythm computationally, it felt like a major breakthrough.

With the rhythm framework in place, we moved on to importing sounds. We searched extensively for techno samples online and deconstructed them into individual instruments. We then programmed these sounds to play at specific points in the rhythm, using four distinct instruments to create variation and depth.

Next, we added an ambient sound element that triggers on the first beat of the rhythm. To implement the timing, we used the frameCount variable in p5.js to define our beats. By applying the modulo function, we manipulated the beat to trigger sounds from our sound array at the right moments.

For the final touch, we recorded our voices saying the rhythm’s syllables: dha, dhin, dhin, dha, and na. I taught Fabri how to pronounce these syllables, and we both recorded our parts. Once the recordings were imported, we experimented with reverb and gain to manipulate the vocal sounds, giving them texture and blending them into the composition.

Through this iterative process, we developed the final product.

Final Product

We refined the composition by adjusting reverb and gain. A 0.95 reverb on the voices gave them resonance, while a 0.5 reverb on the ambient sound created a spacious, immersive feel.

Currently, all the sounds play simultaneously in a loop, but future iterations could explore layering. For example, introducing elements sequentially—starting with drums, followed by vocals and ambient sounds—would create a dynamic buildup and enhance the overall experience.