Music Generation Using Code

nvisia is an award-winning software development partner driving competitive edge for clients.

As part of the nvisionaries Science Fair, software developer Farhat Samara explored the space where science and art meet by using emerging technologies that can create music and visuals via code.

“I’ve loved music since I was a kid, and hearing about emerging technologies that mix tech and music together was very interesting to me. Knowing that there are code libraries to create music patterns was something I had to try.” -Farhat Samara, Software Developer (Milwaukee Region)

For this experiment, Farhat investigated a variety of technologies that use code to create a performance. Tidal Cycles is one such coding environment built for creating algorithmic music, but Farhat ended up using Sonic Pi for his project. Originally built to support coding and music lessons in schools, Sonic Pi is based on Ruby and provides an environment already set with a variety of tools, making it a good option to get started quickly on your sound creation.

sonicpi

After determining the music generation tech, Farhat also wanted to incorporate a visual element. He used hydra, a live-coding video synth environment using JavaScript, to create visual oscillations based on the music outputted from Sonic Pi. In order to keep interaction between Sonic Pi and hydra fully contained during the nvisionaries event and avoid any interruptions from outside noise, he utilized BlackHole, a virtual audio driver that allows applications to pass audio to other apps with no additional latency. So as code and a MIDI controller generated music in Sonic Pi, it was inputted virtually into hydra, which created a visual that reacted to the sounds. The hydra visualizations could also react to unconventional sources like a spoken conversation, depending on the audio input.

These programs and experiments highlight the ability to create art via technology and have a variety of uses in the fields of events or music and entertainment. Although he was originally intrigued by Sonic Pi and the music side of the technology, Farhat found himself intrigued by the possibilities of hydra. Creative exploration of emerging technologies often leads to new paths and unexpected innovations.

Meet the nvisionary

Name: Farhat Samara
Title: Software Developer
Track: Developer
Specialty: Full stack developer with a focus on front-end development

farhat

 


Are you a creative technologist with a passion for experimenting with emerging technology? Learn more about joining our team and becoming an nvisionary!

Related Articles