Programming and Music - Chapter 1 – A matter of languages
The questions “Why should I learn programming?” and the counterpart “Why should I learn to play a musical instrument?” have a surprising number of common valid answers.Let's evaluate all of them in a series of articles.
Article 1 – A matter of languages
Music: You know, when you approach music for the first time, you understand immediately that you’re going to learn a NEW language in a broad sense. A sort of universal language you will be able to use anytime, anywhere in the world with any other musician.
As all languages, music embraces an incredible number of “dialects” that, just like the spoken word, bring on and preserve the legacy of the socio-cultural environment in which they were born and raised.
Programming: When you approach for the first time a programming language, you’ll find yourself in a very similar situation; you will have the feeling that you’ve got there a huge potential to express yourself, and your ideas. It’s just a matter to build your own vocabulary learning the basics and the fundamental rules that are valid for any programming language.
Common playground Just like any other language, music and programming have a set of rules as well as their own syntax and relative notation. At the beginning, in music, you will find the building blocks of the matter in notes, time signatures and intervals. At the beginning in programming, you will find the building blocks of the matter in the console output, variables and types of objects. There’s your common playground. It’s there that everyone is building own self-consciousness over the potential of the language. But then what? Well, in music you will soon stumble upon the fascinating rules of harmony (related in turn to physics and mathematics) the same way in programming you start dealing with function, methods and classes.
For both music and programming you will soon find that, among all the available languages and literature, there’s something that you “feel” connected to. You will find one or more languages that most fits to “your style” of conceiving thing or that you feel you can use to express yourself at your best.
And soon – somebody has to say this – in both cases for music and programming, you will find styles and languages that can help you with some extra money and some other that do really not ;-) …
But that’s life right? No, that’s more … That’s REAL life.
Back to music. Yes, it’s tempered. And we all tune over a commonly agreed reference frequency. What does this mean? That, from a certain point of view, you can consider yourself lucky to be born in a time in which on most music a C# - C sharp – (hey programmer, I heard your joke 😜) and a Db (D flat) are the same note. And (mostly) everywhere in the world if you join other musician for a gig with your instrument with high A tuned to 440hz, you will be in tune with all the others. So, to say, there’s a “standard”. A common playground to help people cooperate.
… and back to programming. No, it’s not tempered in a strict sense, but just like music, your program will necessarily imply a set of common rules that are valid from anyone, anywhere. And this will help you to understand others and – final goal – to cooperate with others.
This, and way more than this, is part of my “Live coding for Data Sonification” Masterclass.