views:

608

answers:

21

It seems to me as if there are a higher proportion of musicians in the programming field than in the general public. Maybe it's just an illusion caused by the fact that I'm an amateur guitarist myself, so I tend to notice coding musicians (or musical coders?) more.

But I wonder if there really is some connection. Perhaps a shared set of skills or an innate quality that makes it more likely for someone who enjoys programming to also enjoy playing and composing music. How closely related is music composition to coding?

I'd especially like to hear from the musicians around here.

A: 

My brother and sister are both musicians, and while I love music, I am not. Yet I am the only programmer.

However, I do think there is quite a bit of logic involved in music composition. I also think we'll eventually see computers composing better music than we're capable of.

Kevin
Nah, i dont think computers, as it currently stands, is capable of composing original pieces (like how mozart or past musicians of great did). The reason is that music composition cant possibly be deterministic, and thus, computers wont be able to compose like humans. Till the day we write an AI that is.
Chii
A: 

He He... Possible NPR question. In my case I am a programmer and I love music a lot. Working to become a guitarist. So I am in your boat ;)

Chathuranga Chandrasekara
we are all artists ;-) thats why nobody is down-voting this one ;-)
Perica Zivkovic
May be... I hoped some votes for clost this or several downvotes. ;)
Chathuranga Chandrasekara
A: 

Nice evaluation here: http://www.psyc3d.com/artist-vs-programmer

Perica Zivkovic
+2  A: 

Heard it from DotNetRocks that musicians make excellent coders. So there should be some correlation there. At best, eventhough we like to call coding an engineering discipline, it's really not. In my opinion, it is really an art form. Music = art, Coding = art, hmm...

Composing music = writing code. There are structure to good music, similarly code is very much structure based.

Composer / Arranger can think at many level / layers. I.e. in a symphony, you need to combine multiple sounds, brass, percussion, wind, and string to form something good. Coder must also think on many level of abstractions. Code architecture, how each component interact w/ each other, etc.

Jimmy Chandra
I completely agree with the point about having to think at many levels. This probably applies more to classical composition though. However, improvisational jazz fits in with the type of programmer that just starts coding without thinking too much, but still makes sure everything fits together.
ehsanul
A: 

Think of Beethoven, composing even being deaf. There is a lot of math in his compositions, as well as experience. Both critical parts of programming as well.

As I view programming to be a highly creative task, using both the math/logic and the creative part of my brain, I can see a lot of common with musicians. I used to play the base and still sing.

Ralph Rickenbach
+4  A: 

There are similarities between some programming constructs like recursion and some musical forms - see Douglas Hofstadter's "Godel, Escher Bach: An Eternal Golden Braid". Maybe having a good mental model of 'unwinding the stack' helps with musical concepts like resolution, and vice versa?

Hah, beat me to it by 30 seconds with the GEB reference!
Vicky
+2  A: 

Have a read of Hofstadter's "Goedel, Escher, Bach" for a wonderful overview of the links between music, maths, and logic.

Personally I was able to get technically reasonably good (not brilliant, though) at two different musical instruments but have absolutely no innate musicality - I was never able to "feel" them music, and certainly can't compose or improvise.

I'm much better at coding than at music :-)

Vicky
A: 

I have many fellows computer scientists that play a wide range of musical instruments, there were a percussionist, a few pianists, a few guitarists, an accordionist... and about myself, I've tried to play the bass guitar without much success.

Some of them were very good programmers, others were regular and a few were awful. So I think there's lot of variety out there.

About the relationship, I think there must be some kind, at least if the relationship between programming and mathematics, and mathematics and music is transitive. Just as a side note, some of my fellow CS/musicians made a software that composed music for an AI free themed assignment (although it didn't sound specially good).

fortran
+1  A: 

I've been an amateur singer for 30 years, and professional programmer for 15 years. I find that both activities challenge me in comparable ways:

  • synchronisation (voices or processes)
  • interpretation (written music vs. sounding music, and requirements vs. implementation)
  • debugging (I'm out of tune with another voice - whose fault is it, please correct in real time)

The comparison of a musician scanning notes and a computer scanning code is also interesting (although the computer should not go into interpretation).

Pim
A: 

I consider the way you separate resposibilites in OOP similar to the way I compose songs. You could also make an analogy to "model" and "view" from the MVC pattern:

Model: The actual song, content, message, feeling, structure, man lyrics View: The recording on a cd, the represenation of the song live on stage, slightly altered lyrics according to the situation/sound/atmosphere

You could even bring in a controller like when you improvise and alter the model while jamming with friends. :-)

galaktor
+3  A: 

I'm not a musician, more of a painter. I got started after reading the book "Drawing on the Right Side of the Brain" by Betty Edwards. She presents this idea of how the brain halves are different and complete each other, but that we are very left-brained in society today. She presents a few tricks to get into more right-brain thinking, and shows how it makes anyone a better painter.

Everyone who gets into this right-brain mode becomes silent, can sit and work for hours, time just disappear. When it ends it feels like one wake up. It is to be in "flow". I imagine that this happens to you musicians as well when you have your instrument.

As a programmer, I recognize the same when I can write code and easily have it run. Either programming interactively as with a lisp REPL, or by running a suite of unit tests. The ability to create and see it in action is important to stay in flow. Long compile times before I can see something run and I'm thrown out of flow.

When painting I move into details, perfecting a shadow or correcting a ratio in a sketch, then move out to see the impression of the whole. In programming I move into details in units of the program, then move out to see how it fits in with the entire program. Again, not being a musician I imagine you move into details, adjusting tone levels or timings in a section, then move out to feel how the entire tune sounds.

Of course, I think I barely spend 25% of my working day programming. It is dominated by communicating; describing how something should be used, design meetings, time-estimates, support questions, branching/merging, helping colleagues. Very left-brain:ed activities.

I've also seen some curious correlations between computer programmers and practitioners of orienteering (which seems to be a sport that is only popular in scandinavia?). In orienteering you need to be good at taking this abstract version of reality in form of a map, build a mental model from that description, and correlate the mental model with the observed reality.

I think both musicians and programmers should find similarity in having a written down abstraction, imagining it, and making it happen.

Christian
A: 

Both are creative skills in my opinion :)

Rashmi Pandit
+10  A: 

I studied music theory and composition, yet I earn my money as a programmer and database guy. My dad is also a musician/programmer. It seems that about 25 or 30% of my programmer colleagues at work also actively play an instrument.

Because of my studies, I usually get this question in interviews: What does music have to do with programming? Here are at least some of my thoughts on the subject:

Musical notation is a lot like a system spec: There are varying amounts of information present, from which you have to make educated guesses about what was intended. Composing music on paper is a lot like writing a system specification. The more you spell out what you want (using all the notational elements available), the more faithful to your ideas the final performance of the piece will be. But just as you can have coders that ignore some of the specs, you'll have some musicians that will improve on the piece by ignoring certain instructions and providing their own interpretation. Sometimes this works, sometimes it doesn't.

Writing code is a lot like playing music: you interpret the instructions of others, internalize them, interpret them, until you can deliver a performance. There's no clear right or wrong with either, just degrees of faithfulness to the original thought or intent, but there's a goal in both (even improvisations follow a certain style and direction). How well that performance was executed is left for others to judge (audience, users), except when your playing or programming for your own pleasure.

Debugging and testing is a lot like hearing your a composition played for the first time - there are often wrong pitches in the notation, simple notational errors, but sometimes you can tell that something just isn't working right in an ensemble, so you have analyze the problem and look at why this is. You can do trial runs with users/audiences to see what their reaction is.

So to answer the original question more concisely: I think that the process of composing music is more related to the process of writing a specification (or at least thinking about HOW you're going to write a particular program), while the coding itself is more like playing the music, after it has been decided what the goal should be.

Galghamon
A: 

I suppose it's more math-related than coding, but you still might be interested to hear about Bartok's Concerto for Strings and Celeste. It's a canon, and every voice enters in a Fibonacci-numbered measure, and exits a in a measure that is a Fibonacci number away from the end.

I think composition and coding are quite similar; in both cases you're taking abstract concepts and representing them in a formal language (like musical notation). I could even imagine picking a particular mood to convey at some point in a piece, then deciding upon a musical "algorithm" to achieve that goal. ("I want a powerful, heroic mood... better write some parallel open fifths in the low brass.")

andyvn22
A: 

Very interesting question - though I never thought about it really - until now :). I love both - programming & music (playing, composing, etc.). Will try to think about this question a little bit more - before I answer from my own perspective.

AnywayZ, to all of you who wish to compose something on your own (but don't know how/where to start), I really suggest this: ImageLine - FL Studio

It's a wonderful software: stable & fast (good coding of course :-)), with extremely good and intuitive GUI (one of the best out there for sure), super on-line-forum support, etc. Give it a try (like I did 6-7 years ago) & you'll get hooked ;).

Cheers!

FL is nice, but if you're like me, you would never buy it at that price. Max/Msp/Jitter looks wonderful, and is a cooler choice I think. But I wouldn't buy that either. Luckily, it has an open source cousin, PureData. Pd is actually a visual dataflow programming language, which you can use to make music. Check it out.
ehsanul
+2  A: 

Some people compose music using programming languages such as supercollider, ChucK, pure data, actually I think just about all programming languages have been used for music making. Some people even use programming languages when improvising (see toplap). For these people programming languages are music making environments. Then again people can write software to generate architecture or any other forms... Programming is very general.

So my answer would be, it depends on the individual. I think if someone is a musician or listens to a lot of music, then in my opinion they're bound to use some cognitive resources developed through music, to help them with the pattern recognition, inference, abstraction etc that is required for programming. If they're not musical then that isn't disabling, the same kind of resources could come from reading fiction, rock climbing, painting, or just doing a lot of coding.

yaxu
A: 

Pattern recognition.

joebert
A: 

Of all of the hundreds of programmers I've known, only two come to mind who were/are musicians (one sax player, one singer) at anything more than the most amateur level. On the other hand, just about every programmer I've ever met has enjoyed going out and getting drunk. Does this mean that there is a correlation between coding and alcoholism?

anon
If you see that there are more drinkers among the coding population compared to the general population, then yes, perhaps there is a correlation.
ehsanul
A: 

I actually have my degree in music (Composition) and was a professional full-time gig musician and composer for about 3 years before I got into programming.

In my personal opinion I don't think it's necessarily a singular relationship between music and programming, I think it's a much more complex relationship. Some programmers prefer to use windows-style text editors so they can "sculpt" their code (allows for easier manipulation of code via the mouse tool) while other coders feel that they get more tactile response and are more efficient when only using the keyboard (via VI/VIM or Pico/Nano/etc).

In that vein, I think coders who come from a music background are auditory and in some cases visual learners who think of music in terms of more concrete constructs (pitches as they relate to frequency, scales as they are related to each other in a periodic numerical system, etc).

Thus not all musicians are coders, and not all coders are musicians, but I think that the Venn diagram would contain a pretty healthy level of overlap.

NateDSaint
A: 

In my opinion, both activities should approximate the other one: sometimes it's useful to think of programming as an art with which you communicate a message from person to person; and on the other hand, one should apply the methodologies of software development and architectural planning when composing a work (let me refer to Ps 122:3).

But I think the main point is common: the most important question in both of them is finding the language or ruleset (in programming terms: model, domain) in which you can express your ideas the best way.

thSoft
A: 

Alan Kay was a professional musician before he happened to invent object oriented programming =)

kolistivra