Using Code as a Medium for Continuous Learning

Having recently started at Atomic Object as part of its Atomic Accelerator Program, there’s a seemingly endless list of books to read and topics to learn about—all of which revolve around software development practices. Even though I am ecstatic to be learning so much about this subject, I worry I will not have time to learn about other topics I am interested in.

This led to the question: How can I learn about subjects outside of software development, when I am spending all my available time learning about software development?

Learning Through Code

For developers, building great software requires a strong grasp of the project domain and the subject matter at hand. After all, how can you write code about something you don’t understand? This forms an interesting opportunity to study a particular topic through the software development process, using code as the medium.

For example, I have been interested in learning more about music, but I have not been able to find an enjoyable way to go about it. Recently, I came across Sonic Pi, an open-source programming environment designed for creating new sounds in a live coding environment. With only a few lines of code, I can construct a drum beat and combine different sound samples to create an actual song.

Learning to write music with Sonic Pi

The process of learning any topic includes a strong foundation on which to build—an easy-to-achieve starting point. Looking at the following example, in just a few lines of code, I created a simple beat typically used in electronic dance music:

live_loop :kick do
  sample :bd_haus
  sleep 0.5
end

So what is happening here? I create a loop called :kick using the sound sample :bd_haus that will then sleep for half a beat. This is a simple example that doesn’t require much effort to understand how each element fits together. However, when you change some samples and apply a few optional parameters Sonic Pi provides, it is possible to end up with something such as:

live_loop :machine do
  sample :loop_garzul, rate: 0.5, finish: 0.25
  sample :loop_industrial, beat_stretch: 4, amp: 1
  sleep 4
end

Using the optional parameters, I can alter the rate at which notes are played, amplify certain samples instead of others, and specify how much of the sample is played during each loop. Effective use of these options requires an understanding of their use and how they function—including researching how each parameter affects the resulting sound produced.

Growing as a Maker

My primary goal while using Sonic Pi was not centered around learning more about music theory, yet in order to write any code, I was required to research topics that I wasn’t entirely familiar with. Through the process of writing code and needing to understand certain aspects of the subject matter, a learning opportunity outside of software development emerged. Doors have now opened to reveal new ideas and topics that were once out of reach.

It is important to recognize that even though circumstances like this don’t necessarily improve your coding skills, they are vastly important for growing as makers. Enjoy the process, and learn as much as you can.