# Mathematically Constructed Music

In another post, I explain a way to use a code to make an infinitely long string of symbols that never repeats. I decided to use this method to make some music. In this post, I explain how you can do the same thing.

1. First, take the first 6 bars of Twinkle, Twinkle Little Star, in the key of C. This song only has six different notes, C, D, E, F, G and A.
2. Then, merge the pairs of identical notes into single notes. That way, each bar contains exactly two notes.
3. Label the bars C, D, E, F, G and A, in any order you like.

Now you have a code – a way of changing a letter into a pair of letters. When I did it, I got this code :

• C becomes CG, because the first bar (which I labeled it C) contains the two notes C and G.
• D becomes AG, because the second bar (which I labeled D) contains the two notes A and G.
• Likewise, E becomes FE, F becomes DC, G becomes GF and A becomes ED.

Actually, practically any way of converting letters to other letters will do. A letter doesn’t have to change into two other letters. You don’t have to get your code from a real song, you could roll dice instead.