A classical Musicians Guide to Coding Theory

Remington T Griffin
2 min readMar 30, 2017

--

As a classical musician, I have searched high and low for someone to relate classical music theory to computer coding. Needless to say, I haven’t been able to find anything on the correlation between the two theories. So, I’m writing a three party series to help classical musicians understanding coding theories and fundamentals.

The first thing to know is: Very large things in music equals very small things in coding.

The second thing to know is: google is your new best friend.

Now, let’s talk about structures.

Sonata form is a very useful idea in coding. For non-musicians, Sonata form is basically a three paragraph essay. Paragraph one is the introduction or in music terms “Exposition”. Paragraph two is your content or “Transition” and paragraph three is your conclusion or “Recapitulation”.

A basic example of how that relates to coding, specifically in javascript, is:

Var themeOne = ‘Exposition’;

This is saying that the variable called themeOne is equal to the text string “Exposition”.

function transition(){

Var themeOne = ‘Recapitulation’;

console.log(themeOne);

};

This function is saying, take our first theme and change the text string from ‘Exposition’ to ‘Recapitulation’. The console.log means that we are going to print the output of the function in the console or terminal. Thus, the function is our transition but we aren’t done yet! Now, we are going to call our function to output the string of ‘Recapitulation’.

transition();

This is calling the function so that the computer knows we want to run the function at the end of our script. All together it looks like:

Var themeOne = ‘Exposition’;

function transition(){

Var themeOne = ‘Recapitulation’;

console.log(themeOne);

};

transition();

Even though this is doing something very small, it’s form is very much the same as Sonata Form. Stay tuned for more as we dive deeper into the code and music theory.

--

--