Can Math be turned into music?

I will analyze the relationship between music and math using numbers such as pi and e.
Grade 8

Problem

Can Math be turned into music?

Hypothesis: If the soundtrack sounds musical, it might drive people who love music to see that math can be enjoyable and fun too.

Method

To create soundtracks from mathematical constants and random digits, I embarked on the following process:

To 'translate' mathematics into music, I utilized the constants pi and e. By selecting three hundred digits from each, I composed three soundtracks. In these compositions, pi's digits determined the musical notes, starting with the harmonic C major scale (where 0 corresponds to middle C, 2 to D, and so forth). Conversely, e's digits dictated the duration of each note (with 1 representing an eighth note, 2 a quarter note, and 3 a quarter note plus an eighth, as illustrated in the logbook sketch). It's crucial to note that 0 represented a eighth note duration.

For the control group, I employed a Python script (see below) with Google Colab, and ChatGPT's assistance, to generate a similar quantity of random digits for the soundtracks. Each soundtrack was comprised of 100 notes, using 200 digits in total. The project resulted in six compositions—three derived from the digits of pi and e, and three from randomly generated numbers. The rationale behind creating three soundtracks for each category was to facilitate average calculations while maintaining audience engagement throughout the survey.

Python script:

import random

# Function to generate and format tables

def generate_formatted_tables():

    # Generate 200 random digits

    random_series = ''.join(str(random.randint(0, 9)) for _ in range(200))

 

    # Split the digits into chunks for the tables (20 digits per chunk, 10 for each row of a table)

    chunks = [random_series[i:i+20] for i in range(0, 200, 20)]

 

    # Prepare the formatted output for 5 tables, 2 rows each, 40 columns in total (20 per row)

    formatted_tables = []

    for i in range(5):

        table = f"Table {i+1}:\n"

        # First row (first 20 digits of the chunk)

        table += ' '.join(chunks[i][:20]) + '\n'

        # Second row (first 20 digits of the next chunk, which is 5 chunks away due to the sequence)

        table += ' '.join(chunks[i+5][:20]) + '\n'

        # Add a separator between tables for clarity

        table += '-' * 40 + '\n'

        formatted_tables.append(table)

 

    return '\n'.join(formatted_tables)

 

# Generate and format tables 3 times

formatted_output_all = [generate_formatted_tables() for _ in range(3)]

 

# Combine all formatted outputs into a single string for printing

final_output_text = '\n'.join([f"Sequence {_+1}:\n{formatted_output_all[_]}" for _ in range(3)])

print(final_output_text)

 

 

All six soundtracks were uploaded to a private youtube video because of google form's limitation (google form doesn't accept any other videos other than the ones of youtube). In the survey, 41 individuals were sent to a Youtube link (https://www.youtube.com/watch?v=ClFK71bpvZA) to hear out 6 pieces of mixed sountracks, with the participants unaware of what the survey's purpose is, to ensure that each response will be more unbiassed. The youtube video plays the soundtrack as well as the sheet it corresponds to. In order to make the soundtrack, I had to manually insert every note into the musical notation software. Every soundtrack has its own piece of sheet music playing with it in the video. 

Link for the raw data of pi and e as well as the random digits:https://docs.google.com/document/d/1_20GIssuTy39FAuqGabkRCjdq7cC88giLjud8YoAKfA/edit

 

Research

Math helps music sound right: math is ingrained into music whether we like it or not. Math and music have been used together for a long long time. For example, some music pieces are like puzzles that use special number patterns (like the Fibonacci sequence) to create a beautiful piece of art, similar to how some buildings or paintings use certain shapes and patterns to appease us.

In math, we have numbers called constants, like pi and e, that appear everywhere because they're part of the universe's ratios. When we use constants to make music, it's like we're playing a secret melody hidden within math. If we turn each number into a note, it might just reveal the beauty of math in music.

In the end, I'm trying to show that math isn't just about numbers and equations. It can be about music, creativity, and fun too. Maybe this project inspires you to think of other ways math and music, come together. The possibilities are limitless (pretty much because there are constants with infinite digits).

Conclusion

My hypothesis stated that people with a musical background would be inclined to soundtracks composed of mathematical constants, at least more than those who are made from random digits. However, the results don't fully support it as both groups, whether they had a musical background or not, showed that their was a balance between the yes and no responses. The control group, recieved more yes responses (not by a lot) than the pi and e compositions. The connections between music and mathematical constats(pi and e), showed curious insights, although it didn't support my original hypothesis. Participants, regardless of their background, did not show a strong inclination towards the mathematical soundtracks then those which are generated randomly. This may stem from design flaws and limitations, such as the way the digits were translated into musical notes and their durations, which could have held back the mathematical beauty from being expressed to its fullest extent. Future attempts could be better with a refined approach to the math and music translation proccess, by expressing more and more of musics aspects, to help convey the beauty of math.

Flaws and shortcomings of this experiment: Due to low number of respondants, the data may not be very averaged out. Another problem that has caused confusion during the survey is the questions as it states "Is this soundtrack musical instead of "Does this soundtrack sound like a song to you?" My aunt pointed this out but by the time I realized I had already begun working on analysis. There are many different variants and combinations that could represent math in music, and mines may just be 1 of the little ones. One could argue when does pi have to do with e when it comes to music, why not use pi for the notes and pi for the length.

Citations

My first thoughts of this project was when I watched the movie X+Y. In the movie it touches briefly on the corelation of math and music.

The first source I stumbled across that took pi and made it a song was this youtube video: https://www.youtube.com/watch?v=OMq9he-5HUU

The other soundtrack for e is here:https://www.youtube.com/watch?v=ItzSD-Ejis8

The source of my digits of pi and e came from these two websites:

https://www.piday.org/million/

https://apod.nasa.gov/htmltest/gifcity/e.1mil

Acknowledgement

I recieved a lot of help from my father, who guided me through this project. My mother also helped me on some parts as well. One of my aunt told me a key flaw after finishing the surveys that I had done. Thanks to Colab for being able to run the software that generated random digits in a particular format. Chat GPT helped write the code that was runned by Colab and helped with my grammer. It also helped generate the header image. Crescendo served as my sheet music, as it played all the soundtracks I made.