Live data from Hacker News

Music Theory for Programmers

runjs.app

221–230 of 260 posts

Re: Music Theory for Programmers

#221

Earlier quoted context omitted.

For people with the mind of a programmer, explaining the mathematical basis of equal temperament and then the major scale (the article doesn’t explain the major scale well, but simply says “it sounds better than a chromatic scale”) allows a programmer to understand not just the how but the why for the basics of western music. For people that just want the how, one would start with “here is a pentatonic scale” followe…

It's also a really strong example of "missing the forest for the trees". Deriving Western music traditions from first principles does not help you to understand why, what, and how any of it actually works.

If we teach theory without first principles, all we have to do is say “C + E + G make up a major triad”; we may go as far as to explain that, in a major key, the I, IV, and V chords are major chords, the ii, iii, and vi chords are minor chords, and the vii chord is a very dissonant diminished chord.

However, first principles explain “why” a major chord sounds the way it does, and “why” a minor chord has more tension.

Let’s look at the five-limit just intervals: 2/1, 3/2, 4/3, 5/4, and 6/5. 2/1 is a perfect interval; two notes an octave apart sound nearly the same. 3/2 and 4/3 are also perfect intervals, but there’s a little more tension and beating than with 2/1. 5/4 has a little more tension than 4/3, and 6/5 has even more tension. I just explained, using first principles, the octave, perfect fifth, perfect fourth, major third, and minor third. That’s most of the scale right there.

Now, let’s make a chord. Experience has shown that three notes is more interesting to the human ear than just two notes. That in mind, we want three distinct notes where the intervals between notes have a minimum of tension. Take the root, take 5/4 of that, then take 3/2 of the root. That’s a major chord. The reason we use 5/4 instead of 4/3 is because the interval between 5/4 and 3/2 is 6/5; the interval between 4/3 and 3/2 is 9/8. Since 9/8 has more tension than 6/5, that gives us a suspended chord, and it’s better to use a major chord with less tension to make a simple chord progression.

Now that we have our first chord, we can hear that having a 1-chord song becomes repetitive very quickly to the human ear. We can make the song more dynamic and interesting by giving it three chords: I, IV, and V. Take that chord: 1, 5/4, and 3/2 (a major chord). Move all three notes up 4/3, because 4/3 is a perfect interval with a minimum of tension. That’s our IV chord (F chord in the key of C major) Next, from the root position, instead of moving up the chord 4/3, we instead move it up 3/2. That’s a V (or dominant) chord—a G chord when played in the key of C major.

Now, from first principles, namely that the intervals 3/2, 4/3, and 5/4 sound pleasant to the human ear, that 6/5 has more tension, and 9/8 has even more tension (so we avoid suspended chords for now), we have a I IV V chord progression, which is the basis for countless rock and popular songs.

If we take all of the individual notes from the I IV V chord progression, that gives us the seven notes of the major scale, after explaining that, once we cross the octave threshold, we can transpose an octave down without affecting the musicality of the notes. We might even explain chord inversions here.

So instead of just parroting “I IV V makes a nice simple chord progression”, we now know the underlying physics which make I IV V sound so nice to the human ear, and how to get the major scale from those chords. I prefer understanding both the why and the how.

(I would have used two slightly detuned sawtooth waves instead of a sine wave for most of the examples if I were to write an article like the one this discussion links to, explaining this has a more pleasant, piano or violin like sound to it. Maybe even a low pass filter to tame the harmonics. Another option is to run a single sawtooth wave through a Solina style chorus, but explaining two detuned sawtooth waves is easier than trying to explain the Solina chorus effect)

Re: Music Theory for Programmers

#222

Earlier quoted context omitted.

While these are helpful topics to understand, they are not beginner topics. Not if you want to make music. They are fundamental questions in that they reside at the base of why things are the way they are, but they are not fundamental in the sense that you should teach them to a beginner who wants to make music. The point is to make music. And the most practical way to do so is to teach instrument technique, interval…

> The point is to make music. Is it? Why?

Because music is pleasurable to play, to experience, and it's gratifying to be creative and to discover your creative potential.

If you have an alternative reason to learn music and to start learning through acoustic phenomena then let's hear it.

Most people don't get into molecular gastronomy if they don't intend to cook a meal. And I'm going to go out on a limb and say that 99% of aspiring cooks shouldn't learn cooking via that discipline without first starting with something more practical and immediate.

Re: Music Theory for Programmers

#223

Earlier quoted context omitted.

What is meant here is that there are different musical cultures around the world, and if you grew up in one that, for example, prominently uses quarter-tones/microtones (e.g. a lot of music from Arabic and Indian cultures) then we know that you will have a different reaction to, say, Bach, than someone who grew up in a culture that uses strict equal temperament. It does not mean "my parents played a lot of and that d…

I grew up with Western music, and now Arabic music is one of my favorites. I really don't think Westerners hear semitones differently. Also, a lot of Arabic music is 12-tone, and even if it weren't, they probably appreciate Bach the same way.

Also just realized, I don't think much Arabic music has used semitones in like 100 years. The classical ones do.

Re: Music Theory for Programmers

#224

Earlier quoted context omitted.

When I see my friends who are into music play and talk about different instruments, it actually feels like magic to me. I tried to learn Violin some years ago but I could never understand why the note was correct. I do know that if I had learnt Keyboard instead, I would know where the correct notes are but I am still not able to recognize a sound and understand what note that is. Any pointer as to what I can do? Beca…

There's nothing magic in it. Any two pitches that have a rational number ratio with a small denominator sound "correct". It's just a quirk of human physiology. The real creativeness and ingenuity comes from rhythm and the interplay of repetitive and surprising sounds. The pitches are not important.

[dead]

Re: Music Theory for Programmers

#225

This is (mostly) not music theory and what is music theory is mostly wrong or incomplete to the point of being wildly misleading. Source: have degree and postgrad in music, was a professional musician until RSI put paid to that career, wife is a professional musician and teaches to postgrad level at 2 conservertoires, most of our friends are professional musicians, have a house full of scores and music books. If you…

Off topic, but given your credentials you might be a good person to ask. Any recommendations on how I should go about learning to play piano? I am just starting out. I have no music background except playing some basic self taught guitar in my teenage years. I can't read music fluently yet. I have access to a nice Yamaha with weighted keys.

Re: Music Theory for Programmers

#226

Earlier quoted context omitted.

West Asian maqam has 24 notes, Indian classical has 22 notes, Indonesian gamelan has 5 or 7 notes. What would be the ratios that sound pleasurable now? What is or isn't pleasurable is a matter of cultural training, and treating them as absolute facts is what I found frustrating in the books that I was complaining about.

All of those systems you mention also include those so-called "pleasant" ratios.

Indeed. Bobby McFerrin has a demonstration where, regardless of culture, the pentatonic scale is universal. For the record, a just major pentatonic scale is the notes with the intervals (from the root note) 1, 9/8, 5/4, 3/2, and 5/3.

https://www.youtube.com/watch?v=ne6tB2KiZuk

Re: Music Theory for Programmers

#227

Earlier quoted context omitted.

> The point is to make music. Is it? Why?

Because music is pleasurable to play, to experience, and it's gratifying to be creative and to discover your creative potential. If you have an alternative reason to learn music and to start learning through acoustic phenomena then let's hear it. Most people don't get into molecular gastronomy if they don't intend to cook a meal. And I'm going to go out on a limb and say that 99% of aspiring cooks shouldn't learn coo…

TFA is titled "Music Theory for Programmers".

Re: Music Theory for Programmers

#229
Music theory is a tool for analyzing music and, optionally, helping make it. Treating analysis and composition as inverse operations is going to mislead you. There are useful analyses in music theory that would be completely alien to the person whose work it's based on.

Re: Music Theory for Programmers

#230

Earlier quoted context omitted.

In the all the textbooks I have or have seen, those are called "acoustics" (and more specifically "tuning and temperament"). They are covered in the text book I had for acoustics, and not covered in any of the textbooks I used for theory (jazz or classical). For example, in Rossings "The Science of Sound", it's in a chapter called "Musical Scales and Temperament". Look, I agree that they should be. I have literally h…

But TFA is called "Music Theory for Programmers". It's not called "Music Theory for Music Students".

I guess we disagree on whether that should change anything.
Post reply on HN