Send
Close Add comments:
(status displays here)
Got it! This site "robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website. Note: This appears on each machine/browser from which this site is accessed.
Musical analogies to programming
1. Musical analogies to programming
To help understand the relationship between
computer science and
coding, a musical analogy may be useful to help put the puzzle pieces together.
2. Musical interests in graduate school
In graduate school in computer science, I sat in on more than 30 credit hours of music courses, including taking a few as allowed by my graduate assistantship (e.g., jazz improvisation, guitar and voice classes, private classical guitar lessons from Bill Carter, a world expert in the bass lute, etc.).
I wrote and used ear training software (Prolog logic programming language) using a PS/2 Model 30 and IBM MIDI sound board that kept learning statistics. The minor third was the hardest interval for me to distinguish.
3. Bill Carter
In graduate school in computer science, I took guitar classes and private classical guitar lessons from Bill Carter - a world expert in the bass lute.
William Carter is a founding member of the acclaimed Palladians and a virtuoso player of the baroque guitar, lute and theorbo.
William Carter is also an enthusiastic teacher, and is Professor of Baroque Studies and Lute at the Guildhall School of Music and Drama in London.
https://www.bach-cantatas.com/Bio/Carter-William.htm (as of 2022-12-10) (1st quote)
https://www.linnrecords.com/artist-william-carter (as of 2022-12-10) (2nd quote)
4. Music
Can one create music without a musical instrument?
Can one do computer science without using a programming language?
(LilyPond used dynamically with text formatter to create the musical notation)
5. Table part 1
Music and computer science part 1 |
Music |
Computer Science |
musical problem |
problem to solve |
musical idea |
solution idea |
compose music in notation |
specify solution in pseudo-code |
learn to read the musical notation |
learn to read the pesudo-code solution |
learn to play an instrument |
learn to code in a programming language |
6. Table part 2
Music and computer science part 2 |
play the music |
write the code |
playing |
coding |
listen to music |
run the program |
audio output |
program output |
7. Put the pieces together
Does the music analogy help put the pieces together?
One should program designed solutions into a programming language. One should not think in a programming language.
Think like a trumpet. Think like Java.
Think like a saxophone. Think like Python.
If the code does not have to be correct, it can be made as fast as desired (paraphrased from the micro-computer days). Think correctness and not run-time speed.
8. Music analogy
Think of music, playing a musical instrument, and creating a score of music to play. In computer terms, the musical analogy is as follows.
Using a computer (program) is listening to music.
Writing a program from a design (including pseudo-code) is playing an instrument, such as the C programming instrument, the Java programming instrument, etc.
Designing and creating pseudo-code to solve a problem is creating a score of music to be played.
9. Learning music
How does one learn music? (After listening to music for a while).
A computer (science) programming approach often used is the following to a beginning programmer.
Think of some music you to which you like to listen.
Now create a musical score for that music.
Now play that musical score on your musical instrument for which you are here to learn.
Will that work well?
How about the following?
Think of some music you to which you like to listen.
Here is a musical score (design, pseudo-code, etc.) that represents that music.
You will now learn how to play your instrument (write a program in a language that implements) using that musical score (design and pseudo-code) for the music to which you like to listen.
10. End of page