The Science behind Music: Coding edition

Lera Tsayukova
Geek Culture
Published in
5 min readJun 14, 2021

--

As Aristotle one famously mused, music “makes the hearts of men glad: so that on this ground alone we may assume that the young ought to be trained in it.”

No doubt, there has been a heap of research, particularly in the last 40 years, done regarding the effects of music on the human psyche. In particular, researchers have been interested in determining to what extent music influences creativity, comprehension, and memory.

If you retain nothing else, let this blog convince you, my reader, that incorporating music into your coding life can only be beneficial. Just as in machine learning models, the vast amount of variables has made it difficult for scientists to definitively establish a direct impact between music and its promising effects. Nevertheless, the research is hopeful:

  1. Music improves comprehension.

Known as the Mozart effect, and the arousal-mood-hypothesis state that listening to background music can foster learning,

A study done in Germany concluded: “Due to the Mozart effect, comprehension will be influenced positively and directly by background music”.

2. It may even improve memory.

“There is a lack of research investigating the interaction between listening to background music and working memory capacity:” (Lehmann, Seufert 2017)

Oh no. Did my entire theory just go flying out the window? Well, there is a highly popular theory, that floats among scientific circles, which concludes that music negatively effects memory. However, Lehmann and Seufurt point out here that not only has little research been done on the the direct impact of music and memory but that studies which have been published and point to a negative correlation have largely failed to distinguish between different genres of music.

Luckily, there is a whole host of research that has since rectified this problem. A study done by scientists at Trevecca Nazareth University, examined the effects of two music genres — classical and rap — on memory. Subjects were dived into three groups, classical, rap, and silence and then given a memory task to complete.

There were two hypotheses.

A) Hypothesis 1: predicts that there would be a difference between the three groups (classical, rap, and silence) on a memory task score. The first hypothesis was supported.

The data was analyzed using a one-way ANOVA test which showed a significant difference between the groups, with a p-value of 0.02.

B) Hypothesis 2: predicts the classical music condition would produce the best performance on a memory. This hypothesis was also supported.

The group exposed to classical music competed the memory task with fewer flips than the other groups.

So, clearly the difference of genres of music DOES matter. Unfortunately, even though classical music has proven benefits, it is not a highly popular genre among younger generations. Fortunately, there is a genre of music which has promising feedback.

3. Music can transform your environment to be more conducive to your coding experience; meet Lo-Fi.

Lofi music:

  • Lo-fi → Low Fidelity music
  • In technical terms Lo-fi refers to low quality music, most often referring to the imperfections that would typically be deemed as “errors” during the recording process.
  • It’s fuzzy
  • Examples: muffled noises, background effects, soothing weather sounds
  • mellow rhythm somewhere between 70 and 95 bpm

Lo-fi has been used in music therapy:

  • Michael Viega, a music therapist at Montclair State University, uses Lo-fi beats to helps his patients in stressful environments. His research on using lo-fidelity music to help, “people achieve hi-fidelity and clarity on individual, community, cultural, and spiritual levels of existence”, is linked below.
  • Viega took noises that were typically considered stressors, bustling city sounds, bustling nurse stations, beeping of medical machines, and transformed those noises to a level of subtlety noticeable enough to be nostalgically soothing when combined with a backbeat.

The Roots of Lo-Fi Music:

  • Although Lo-Fi music can span across all genres, its foundations are rooted in hip hop.
  • The genre has actually been around for much longer than Youtube has.

Now that we’ve covered the research on the benefits of music — specifically Lo-fi — how it relates to coding, and what the origins are let’s see (better yet hear) some examples!

Well, if you want to create your own Lo-Fi beats: meet Magenta!

  • Magenta
  • a customizable LoFi player, from Google that is powered by their TensorFlow System.
  • Magenta’s source code on Github
  • click on objects in the moods and customize the levels and tempo to your nostalgic hearts desire
Magenta’s customizable source code

But, if you would rather just jump right into it, here are some LoFi playlists:

For more information check out the following:

https://scholar.utc.edu/cgi/viewcontent.cgi?article=1214&context=mps

--

--

Lera Tsayukova
Geek Culture

Data Scientist | Data Analyst | Machine Learning Engineer