Hacker News new | past | comments | ask | show | jobs | submit login
Music Theory for Musicians and Normal People (tobyrush.com)
697 points by kick on Oct 19, 2019 | hide | past | favorite | 101 comments

Here's my layman explanation:

Pick a frequency. Let's say you picked 400 hertz. If you multiply this frequency by a simple fraction (1/2, 1/3, 2/5, etc) you get a new frequency that harmonizes with your original frequency. That means they sound nice when played together. The simpler the fraction, the better the two frequencies will sound (1/2 sounds nicer than 7/13, for example).

If you pick several of these fractions between 1 and 2 (such as 3/2, 4/3, 5/4, 2/1, etc) you create what's called a scale. All the frequencies in the scale harmonize with the starting frequency, but they don't necessarily harmonize with each other.

Musicians don't always want to play with the same starting frequency so they invented "equal temperament". The idea behind equal temperament is to create a scale using logarithms/exponents instead of fractions. Because it's logarithmic, any frequency in the scale can be used as a starting point and you'll get the same result.

Ready to get your mind blown?

Pure sine waves don't harmonize. If you play a sine wave at 400Hz, and continuously vary the frequency of another sine wave from say 700 to 900Hz, you won't hear any special consonance at 800. It will sound just as ugly as the neighbors.

What really harmonizes is the overtone series. The human voice, and instruments imitating it, have overtones at integer multiples of the main frequency. For example, if I sing a note at 400Hz, it will consist of a sum of sine waves at 400, 800, 1200 etc. When two such notes are sounding at the same time, and their overtone series partially match up - that's when you hear harmony. It's easy to see that it happens at small integer ratios.

The guy who came up with this idea (Sethares) also came up with an easy way to test it. He synthesized bell-like sounds whose overtone series aren't exactly integers. And sure enough, melodies with integer ratios of pitches sound horrible when played on that instrument, but melodies with tweaked ratios sound perfectly fine.

EDIT: Thank you HN! I believed this for years, but after writing this comment and getting some replies I went and checked, and it's not completely true. Matching overtones play a role, but simple frequency ratios sometimes work even without overtones, and there are proposed explanations for that. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2607353/#idm139...

If I open 2 tabs of https://www.szynalski.com/tone-generator/ and then listen to 440+880, and then change 880 to 850 it is a world of difference. I would definitely describe that difference as dissonance and consonance.

Now the overtone series IS important and is not always 'simple ratios', a good example in a real instrument is the strong minor third overtone of a carillon, and as expected writing in major for that instrument is hard.

Thank you for that link. I never thought of my browser as a test bench before. (Of course, now I want a DVM, function generator, scope, logic analyser, spectrum analyzer and all the other goodies ;) ).

I'm not sure if this is the same thing as consonance/dissonance, but the graph of sin(x) + sin(2x), an octave, is regular and pretty and the graph of sin(x) + sin(sqrt(2)x), a tritone, is much less so.



If you plot them as XY it's even more obvious which one is perfect consonance and which one dissonance:



Except that if you use a frequency ratio of sin(x)+sin(2.01 x), which is really very close to an octave and really sounds just as consonant as an octave to almost all people, you almost the same "dissonant" picture:


The strange thing is, none of these "simple ratio" theories account for the fact that our brains allow a lot of "fuzziness" around these simple ratios, so much that you can't really call them simple ratios as they encompass a whole bunch of not-simple ratios as well.

That sine wave sounds a bit "fuzzy" to me, maybe the generator adds a small amount of overtones or aliasing. I tried another generator (http://onlinetonegenerator.com/) and the consonance feels weaker.

Interesting, I still hear it the same, dissonant and consonant, perhaps western music ruined me. Thanks for sharing.

Edit: Didn't see the url, makes my old reply obsolete:

Interesting. I tried to avoid clipping/aliasing by using audacity with as high quality audio as my system allows and I can still reproduce pretty much exactly what you hear on those websites. https://vocaroo.com/i/s0Be5CexLgVs is 440hz, then 440hz+880hz, then 440hz+850hz. But I would be interested in any repeatable signal that does not harmonize at all so do share!

You're right and I was overconfident. I tried some more, and the sense of consonance is weak but still there. Amended the comment.

Loved this comment.

This is why tuning pianos is so hard, btw. The overtones are way more important than anything else about each set of strings.

If you don't take care of the overtones, playing scales will create a sort of "wah" effect that was cool in the 60's, but not so desirable for the freshly tuned piano. It's one of many reasons straight up MIDI sounds so weird. (Instrument modelling and multiple samples fixes that).

And you have different temperments, which flavour the sounds in different ways even after the "clashing" overtones are taken care of.

It's all related to how phonemes, units of speech, make different vowels or consonants when the pitch is changed. You'd be surprised at how much a speech sound changes in perception just because of the pitch. It has everything to do with those "What do you hear?" memes out there. Our brains do interesting things to similar wave envelopes at different pitches.

Fascinating stuff if you're into that sort of thing.

>It's one of many reasons straight up MIDI sounds so weird

PSA for anyone who needs to hear it: MIDI doesn't have a sound any more than sheet music does.

General MIDI-compatible software tone generator in Windows 95 is no more "MIDI" than an untuned piano in an abandoned house is "classical music".

MIDI to music is what TCP/IP is for communication (incidentally, these protocols are of the same age). If you want to "hear" MIDI, turn on the radio. You will "hear" MIDI in the same way you are "seeing" TCP/IP now, reading this page.

The limitations of this protocol do have an effect on sound, but in a subtle way. For instance, implementation of polyphonic pitch bend / slide was not standardized in the 80s. As a result, it was pretty much absent from electronic instruments until recently. A new MIDI-based standard, MPE, addresses that.

Surprisingly, what makes tones sound consonant is a matter of controversy in music perception research. The ratio between fundamental frequencies theory is most easily debunked: if that were true, equal temperament tuning would sound unbearable, but the over-tone matching theory is not confirmed either thus far.

In fact, here are two recent studies that suggest life-time exposure plays a significant role in the perception of consonance. If that's true your own judgement of consonance of two sounds is not a good evaluation of a theory of consonance, because that judgement may be shaped by your cultural exposure.

Indifference to dissonance in native Amazonians reveals cultural variation in music perception. https://www.nature.com/articles/nature18635 pdf: http://mcdermottlab.mit.edu/papers/McDermott_etal_2016_conso...

Universal and Non-universal Features of Musical Pitch Perception Revealed by Singing. https://www.sciencedirect.com/science/article/abs/pii/S09609... (paywalled but sci-hub is your friend)

> The ratio between fundamental frequencies theory is most easily debunked: if that were true, equal temperament tuning would sound unbearable, but the over-tone matching theory is not confirmed either thus far.

Strong disagree there. EDO results in pure 4ths and 5ths. And I’m not sure how you can separate ratio of fundamentals from overtone consonance. And I’m not sure how you can separate “pleasing” from culture/upbringing, or why anyone would ever think that you could. It’s immediately evident by different people having different tastes. I appreciate the research, but I don’t think any of this is at all surprising.

That some properties of “consonance” are shared between cultures seems unsurprising, too, since the sounds everyone is exposed to will follow the same underlying acoustic properties. You can’t form words without listening to the overtones above your fundamental frequency, and forming resonance creates a notable body experiences, so those ratios are going to play an important role in most cultures as a matter of course.

> And I’m not sure how you can separate “pleasing” from culture/upbringing, or why anyone would ever think that you could.

Yeah, this still blows my mind how many people try to prove that "all humans" like a certain musical trope. Nobody would ever do this with a film.

Maryanne Amacher made some music that relies on the non-linearity of ears, what is known as "otoacoustic emissions." I guess if you put a sound source that produces the sum of two pure sine waves up to a human ear then record what comes back out, it can add in combination tones.

I think it's easiest to perceive in Chorale 1: https://www.youtube.com/watch?v=rtmv6LxNJqs&t=3079s (I'm not sure if I only hear the low-pitched tones because of non-linearities of my amplifier and headphones at higher volumes though...)

It's way too easy to get overtones from a sine wave. Lots of music production involves compression of dynamic range into a smaller interval, but this introduces integer overtones. For a toy example, we can think of arctan as being a compression function that takes infinite dynamic range into the interval [-1,1]. Playing around with some Fourier series, it looks like arctan(sin(x)) has a bunch of extra odd harmonics over the sin(x) fundamental.

In May, there was a HN post about a statistical mechanical model that derived a scale from an overtone model. It would be cool to see what comes out of inharmonicity (like bells). https://advances.sciencemag.org/content/5/5/eaav8490.full

But, if I play pure sin(t440) + sin(t440x2^(4/12)) + sin(t440x2^(7/12)), it still sounds like a major chord?

I'm on mobile, so I can't whip up a jsfiddle, but I know from experience this doesn't sound terrible?

It's hard to type the equations out on my phone, but the resulting wave when adding a and a# has a very large period and sounds bad, where a + c# has a shorter period and sounds good. I'd be curious about the pure sine wave which matches the period of the summed waves.

I feel like there's more to this. Maybe I can make a visualization with matching sound over the weekend.

What on Earth are you talking about? 800hz is an octave above 400hz and is absolutely consonant in the most obvious sense.

Try Polychromatics if you want your mind blown :-)


Your lay explanation doesn't account for some important fundamentals - like the subtle distinctions between the different historic tunings, the fact that pure equal temperament is only really a thing on electronic instruments, the need for stretch tuning on some acoustic instruments but not others, the origins of the melodic minor, the harmonic minor, and the modes, the use of the dissonant major second in many folk musics around the world... and that's not even getting into the complications of composing in different styles.

It's not technically wrong to say that equal temperament is based on the 12th root of 2. But it's also not a complete description of real world tunings, especially in acoustic performance.

Generally, math turns out to be a bad way to understand music. There are elements in music that look like math, but the similarities turn out to be superficial and massively oversimplified. If you take them too literally you run into serious conceptual problems almost immediately.

In fact the defining feature of music is that it always slips through any simple bounded conceptual model. Music simply isn't simple. That's what makes it so interesting.

Temperament is irrelevant to most music, even if you're talking about western music using the 12 tone scale. The exceptions are keyboards and electronic music.

The simple reason is that most instruments can't even be played consistently in tune, to the point where you could figure out if they're playing in any temperament at all. String instruments are tuned by pure intervals across the open strings, then the player has to figure out how the other notes should sound. They will push notes up and down to make them sound more "right" in the immediate context. Wind instruments are a bag of compromises.

A large percentage of musician jokes are about intonation.

Early keyboard instruments were tuned in simple temperaments that a musician could learn how to do quickly. A harpsichord had to be tuned before every performance. Equal temperament required an instrument that stayed in tune long enough to make it worth hiring an expert to tune it.

> String instruments are tuned by pure intervals across the open strings

Depending on what you mean by a 'pure interval,' it might come as a surprise that string instrumentalists tend to tune their fifths narrower than 3/2 (and apparently sometimes narrower than a 12-EDO perfect fifth!). This is so the perfect fifth above the highest string is tuned correctly as the major third (and some octaves) above the lowest string. Otherwise, the interval would be a Pythagorean major third (81/64) which is somewhat dissonant.

(In "How Equal Temperament Ruined Harmony," Duffin recounts how in the late 1800s, even the best piano tuners in Britain were unable to get exact equal temperament, being off by about 1 cent per note in such a way that favored common keys. And, even so, equal temperament for pianos was not popular until the 1910s -- non-equal temperaments were favored due to their sound rather than just their practicality.)

I'm not surprised at all. I was taught to use perfect intervals myself, and it's how I've always seen it taught. But tuning is a very interesting topic.

These days I play double bass in a jazz band, so of course every single instrument has its own tuning quirks.

An amusing anecdote: I played in a band, and the drummer complimented my intonation. I asked him how a drummer knows anything about intonation. He said: "My college major was trombone."

They will push notes up and down to make them sound more "right" in the immediate context.

Not all of the stringed players. One of the harder things on violin for me, after years of fretted instruments, is still intonation. Makes a mandolin seem like a push-button version of a violin. (We will save that infernal stick-and-horsehair thing for another discussion.)

The flip side is that when the mandolin gets out of tune (and oh, it does), you just have to live with it until the next opportunity to fire up the tuner.

That means they sound nice when played together

And why's that? The little vibrating hair cells in your cochlea, and overtones from the lower note matching up with the higher note.

... and why did we in the west end up with a 12-note scale? 12 equal divisions of the octave lets you approximate a lot of the interesting ratios 2/3, 3/4 etc (only approximate, see 'even tempered') without the notes being too close together. I think I read the next optimum division would be to divide the octave into 43, but then you're getting far too muddy.

... and if its 12 equal semitones, why have some of them got proper names (CDE) and some treated as variants (sharp/flat). Or in other words, why the white keys and black keys on the piano?

Well lets take the 'foundation' note of your piece of music - this would, more or less, be the note that gets involved the most, although its a bit more complicated than that. Building from that note, and lets say we've chosen C to make things simpler, if you wanted to choose other semitones from the 12 available that would let you build lots of nice ratios starting from C and the note thats 3/2 above it which would be G, then you more or less end up with the white keys on the piano, and you leave the black ones out (mostly). Thats called the C-major scale. There's also a minor version where you choose slightly different semitones to get a 'sadder' sound, and thats C-minor.

The names of the notes (CDEFGAB) are the white keys on a piano are based on the C-major scale, with the sharps and flats defined in relation to them. Some sort of legacy naming convention that is now baked into musical notation at the lowest level and makes everything much less clear than it should be. Because it you want to transpose up or down and use a different foundation note (as happens literally all the time) then you have to use a mix of notes with proper names CDE and the sharps and flats (a mix of white and black piano keys) and thats when it gets confusing. Well, unless you know what you're doing I suppose, and then its not confusing.

In summary: the major and minor scales are kindof optimum selections of notes from the 12 available to make your song sound fairly good. Like a kindof best practice.

But the names of the notes are ridiculous. Its as if instead of the digits 0123456789 we had some weird number system where 3 didnt exist and we called it '4 flat' and 6 was replaced by '5 major' for no good reason.

It’s worth noting that equal temperament predates the concept of a logarithm function, so the methods they used were both clever and imprecise.

Also worth nothing that mean temperament was an intermediate step between Pythagorean tuning and equal temperament, musicians didn’t jump directly from simple fraction into equal temperament.

I really like vihart's visual explanation [0]. I don't even know how to summarize it in a self contained way:).

[0] https://www.youtube.com/watch?v=i_0DXxNeaQ0

But the really weird thing is that, any ratio that is close to a simple fraction like (say) 3:2, but not quite, is in fact a much less simple fraction, maybe 67:23 or something.

Yet we don't need the simple ratios be entirely exact, they can be off a little and you get used to it and it's fine. That's why equal temperament even works.

So our brains like simple ratios but also like ratios that are almost kinda like simple ratios but not quite. How does that work? Isn't any ratio close to a "simple ratio" when you leave some wiggle room like this?

To fill in the bit about temperament:

The problem is, once you construct a diatonic scale using these "Pythagorean" ratios, trying to play a diatonic scale that starts and ends on a different pitch, but using the same set of pitches, will have intervals that aren't in tune and sound terrible.

Musicians and theorists struggled with this for years, coming up with various compromises that sounded good in some "keys" and awful in others, until math provided the ultimate compromise: base your logarithmic scale on twelfth roots of two and every key will be exactly the same more-or-less-in-tune.

> Musicians and theorists struggled with this for years, coming up with various compromises that sounded good in some "keys" and awful in others, until math provided the ultimate compromise: base your logarithmic scale on twelfth roots of two and every key will be exactly the same more-or-less-in-tune.

This is inaccurate in two ways.

First, only keyboards and those playing with them, use a fixed temperament. Everyone else, strings, voices, brass, winds, adjusts the pitch of individual notes based on vertical and horizontal context. A c does not have a fixed number of Hz throughout a piece.

Second, math did not provide the ultimate compromise. Equal temperament was known as far back as the fourth century BC, and people were advocating for and composing in equal temperament in the sixteenth century. Rejecting equal temperament in favor of meantone temperings was a conscious decision, not a compromise from ignorance.

In my musical training I was taught that musicians figured it out in the west by trial error. Bach then wrote the Well Tempered Klavier to demonstrate pieces in all 12 major and 12 minor keys, in 1722.

There is a reference here however to a chinese mathematician who worked it out in 1584. I don't know if his work made it across the continent and influenced anyone. It is not likely that many musicians would have understood the math in the 16th century.


Notably, well-temperament is not equal-temperament. Also under-appreciated is that you can change the pitch of each strike of a key on a clavichord by striking harder/softer or pressing into the key. It uses a “hammer-on” like action, so if you press into the key after striking a note, you will increase the tension on the string and raise the pitch. For me, realizing this gave me a whole new appreciation for CPE Bach’s music. There’s probably a dissertation in that somewhere for somebody.

A klavier is not necessarily a clavichord, but an organ has some interesting tuning tricks up its sleeves with its various stops.

Organs are not really tuned with the stops, the stops engage or disengage banks ('ranks' in organ terminology) of related pipes. The only way this would affect tuning is if you have a secondary rank with an alternate tuning, you'd have to disable one rank and enable another.

Organs are tuned directly at the individual pipes (just like string instruments are tuned at the strings). Each pipe, depending on the kind of pipe used has a slide that goes in and out on one end to match the pipe length or, alternatively, a tiny tongue of metal that is rolled up or extended. Tuning (or 'voicing') an organ is super labor intensive and time consuming.

For a large organ it can take weeks.

I am well aware. I have participated in the tuning of a (small) organ, as I am an organist. You can affect the perceived tuning of the instrument by engaging mutation stops / aliquots. Further, speaking from experience, in practice, stops have a tendency to go out of tune at different rates. Most organists know their instrument very well, have have an intuition for what keys will sound best with what stops at any given time on their instrument.

That makes a lot more sense than the way you wrote it first :)

Which organ do you play?

Oh yes. The things you do to avoid that out-of-tune trumpet pipe. :-)

> If you pick several of these fractions between 1 and 2 (such as 3/2, 4/3, 5/4, 2/1, etc

A point of strong debate I’ve had with mathematical, but non musical friends: is a scale an ordered or unordered set of such fractions?

This doesn't really explain any of the music theory that's described on the linked page, unless you're meaning you're explaining a theoretical basis for harmony itself? The kind of music theory on the page is about triadic harmony, scales, the ways in which one triad moves to the next, non-chord tones, melody, and rhythm.

I do like thinking about tuning systems, however.

- If you have purely harmonic instruments, like bowed strings or the human voice (due to mode locking), there's some justification to try messing around with extended just intonation systems (ones where the ratios use prime factors that go beyond 2, 3, and 5). Ben Johnston has a workable notation for this. But, even after having played around with this for a while, I still struggle to hear things involving 7 or 11 as being in tune!

- For slightly inharmonic instruments, like pianos or plucked strings, just intonation seems to make a bit less sense... though La Monte Young's "The Well-Tuned Piano" with it's 2,3,7-based tuning does work pretty well. (And as someone else pointed out, piano tuners compensate for inharmonicity even for 12-EDO tuning by making all the intervals just a bit wider. So twelfth roots of two don't completely explain things.)

- I'd be interested in seeing how highly inharmonic instruments, like bells, might be tuned to take advantage of their own unique harmonies. It might be that a "5/4" ratio means "take the fifth harmonic of this bell, then find a bell for which that harmonic is the 4th harmonic."

Equal temperament, by the way, apparently wasn't popular until around 1900-ish, and so-called equal temperaments before that tended to be various kinds of unequal but "circular" temperaments that worked well enough for every key, yet still preferred common keys. See [1].

12-tones is an approximation of tuning systems that had been long used by singers and string players. A C# is slightly lower in pitch than a Db (in cents, this is roughly 87 cents vs 109 cents; musicians should be able to perceive deviations of 5 cents, for comparison). In fact, there were early experiments in having split black keys to be able to have both pitches on a keyboard. In [1], the author argues that 1/6-comma meantone is a good approximation for this system, which can be explained as 55-EDO. This makes sweeter major thirds (closer to 5/4 than 12-EDO's 81/64) at the expense of more dissonant perfect fifths, which tends to work out OK for post-medieval western harmonic practice.

[1] Ross Duffin, "How Equal Temperament Ruined Harmony"

I think you meant 'each other' rather than 'themselves' at the end of paragraph 2.

Fixed, thanks.

One of the things that these explainers often miss is the context around music theory, and what it means to be consonant or dissonant. As some comments below complain about, this seems woefully incomplete and extremely restrictive. And it is.

These are the rules of taste and style about what was considered correct in a specific style and location in the 18th century. The way this is taught in basic forms like this isn't much different from Rameau's treatise in 1822. The names of things have changed a little, but the basic concept is that.

For people who say, "Wait! This doesn't account for all the stuff that sounds sooooo good in Jazz, atonal music, or even later classical music! This is bullshit!" You're kind of right, but mostly missing the point.

The fact that Finnegan's Wake was written and works and is a work of art, doesn't change the definition of what a Sonnet is. A Sonnet isn't the only form of poetry out there. But it's a useful thing to study if you study poetry because it's a massively influential form on lots of stuff that developed after it.

The music theory fundamentals from the 18th century are roughly analogous to that. Massively influential on everything that happened later, and therefore a good place to start. But they shouldn't be read as a complete or correct statement of "how music works." Just a snapshot of time, taste, and technology that serves as a convenient starting point for exploring what happened before and after.

The other thing that's often missed here is the role of music theory in the history of music. Theorists have operated across a spectrum of prescriptivism and descriptivism for thousands of years. At some points in time, theorists are laying down the rules about what music should be and claiming artistic/philosophical authority. But at other times in history, they are much more interested in simply describing how composers achieve certain musical effects. This fluctuates every couple of hundred years since the time of Plato or Aristoxenus.

You see the same kinds of divides and fluctuations with linguists and dictionary editors. Some are very focused on capturing the language as it is currently used, where others are very insistent on laying down the rules of correct usage. Music theory, broadly speaking, should be understood in the same way.

I do not get a sense that these posters are incomplete or restrictive, except in the broadest sense that any work which attempts to teach a topic will necessarily not be able to capture the entire breadth of what is possible (and doubly so for a "cheat sheet").

The author of these posters is a theory professor, and the rules he describes here are perfectly fine cheat sheets, in my opinion, for students. They describe idioms that students will likely run across, both in the repertoire, or in their assignments. I don't think there is anything wrong with that, and I'm not sure the author is claiming that this is intended to be a prescriptive set of rules for composition. Just a useful one in a classroom setting where you probably need to start out learning some things, prescriptively, when starting out.

I'd say, take these PDFs for what they are - a learning tool for music students.

Species counterpoint was exactly that - a set of rules intended to be a pedagogical tool.

I don't disagree with you. But when these get cross-posted to sites like this one and lack the context of what they are, they often lead to really unproductive discussions about how broken music theory is or how there are better ways of understanding things or how they are fundamentally incomplete. You can see a lot of that happening in the comments of this article here. So I was simply trying to provide a little more background about how to view these kinds of tools.

This is my sole frustration with most composition-related libraries: they misspell pitch classes because “they’re the same note.” It isn’t just mathematics!

>these explainers often miss is the context around music theory, and what it means to be consonant or dissonant

Manifestoes always have something like this, an implied "if you're like me..." that covers all of the assumed knowledge and context.

Dissonant doesn't mean "sounds bad." It does mean it takes more effort for musicians and listeners alike to resolve, though.

I can’t edit, but Rameau was 1722. Sorry about that.

I can recommend Lightnote [0] on music theory. It has tons of interactive courses, for which made it really fun to learn the music theory for me.

Disclaimer: I’m not associated with lightnote, but just a happy customer who paid for the premium package.

[0] https://www.lightnote.co

To add the all the resources here, Alan Belkin is a composer with many very in depth and practical videos for fellow composers: https://www.youtube.com/channel/UCUQ0TcIbY_VEk_KC406pRpg one of the best theory youtube channels.

And https://musescore.com/groups/counterpoint-and-fugue is one of those well hidden small internet communities centered around contrapuntal writing with many knowledgeable members, original music and in depth essays about contrapuntal details.

Heck yeah!

I have a link to this in my toolbar, as it is one of those sites I find myself returning to again and again. I recently committed myself to becoming a better guitar player. I didn't think I'd dive head first into theory, but I'm so glad I did.

I'm grateful to the people who have created resources like this, because I wouldn't have overcome previous biases w/r/t theory were it not for the different approaches and perspectives available on the web today.

edit: a link to another theory project for anyone interested

Open Music Theory: http://openmusictheory.com/contents.html

A single-document version (unfortunately only linked in the end there, after enabling JS): https://tobyrush.com/theorypages/pdf/en-us/the-whole-enchila...

Another article on the same topic, which I found to be helpful when tried to sort it out: https://noise.getoto.net/2016/09/16/music-theory-for-nerds/

Edit: fixed a link.

Awesome to see this here. I used the development & Form section to create the beat generator for Strikefree[1] with the web audio api. I've been experimenting with pitch as well but for some reason complete randomization leads to better compositions. Honestly when I made music, I'd also come up with better compositions when I let go of everything I knew, and enjoyed the happy accidents.

[1] https://strikefreemusic.com

This site is pretty great. I would love to re-learn some of the basics in this format.

Here are some previous discussions since this content has hit the front page a couple of times:

* 5 years ago - https://news.ycombinator.com/item?id=8472157

* 7 years ago - https://news.ycombinator.com/item?id=4807091

i was gonna say the website design is weird(why pdfs to download instead of pngs?) but considering it's 7 years old it's held up well

I have no affiliation with the author and this is the first I'm seeing the content, but I'd guess its's because PDFs can be vector-scalable and never lose their quality as you scale up/down and PNGs cannot.

And they can be printed.

You can print a png

Sure you can. But it isn't nearly as certain to generate the same kind of output when changing printers; platforms or programs. PDF at least does that part well and I totally support the authors choice and think .png would be a terrible format for this.

They're meant to be posters, pdf is entirely appropriate.

Oh that could be why the font isn't the most readable either.

I'm working on an IDE for music composition. I'll launch soon.


Hmm, so am I. Does your IDE come with a special language, DSL or something to control the transformations you mention on your home page? Or are you using an existing language? I'm using Scheme, but I have a kind of 'declarative DSL' for defining patterns, transformations etc.

It doesn't. DSLs are terrible for expressing music.

I think music theory is just tricky. Lots of rules that are "just so".

Does anyone know a resource that explains music in terms of the "idioms" of each genre. E.g. what makes 50s rock n roll sound the way it does, what makes funk sound the way it does, etc?

What makes 50s Rock n Roll sound the way it does are the chord progressions they preferred. All modern music is just trends in _how_ to layout rhythm and melody on certain chord progressions.

> What makes 50s Rock n Roll sound the way it does are the chord progressions they preferred.

One thing I learnt from composing (with software) is how much the instrumentation determines what style/genre the music sounds like - almost totally. Play "50s Rock n Roll" - the same notes, chords, rhythms - with string quartet or orchestra and it's classical. Get The Ramones, Metallica, Dead Kennedys, Sex Pistols to play it and it will sound like those bands. Or it will be jazz, folk, country etc when played with the instruments of those genres.

Also, I strongly believe in learning from the music. If you want an answer to such questions, don't believe anyone's word, but listen for yourself. I guess it sells books to discourage people from doing that. But there's a lot of wrong or plain loopy stuff printed in books about music. Those who know, don't write books, and those who write books, don't know, I suppose.

> One thing I learnt from composing (with software) is how much the instrumentation determines what style/genre the music sounds like - almost totally.


> If you want an answer to such questions, don't believe anyone's word, but listen for yourself.

That's good advice but presupposes a level of musical literacy I don't have. I can play music but unless everything is in a familar key I'll get lost. Plus, I've tried this with some things (e.g. The Killers) but I'm sure they're playing in a different mode which explains their chord progressions. It seems that each song/artist requires individual research instead of for genres in general.

I guess it's not good advice then! :-) Not sure what you mean familiar key, different mode etc, but anyway..

>what makes 50s rock n roll sound the way it does, what makes funk sound the way it does

I meant, on a fairly basic level, no music literacy required: Listen to lots of 50s rock and roll songs. Listen to what the drums are doing. Listen to what the bass is doing. Listen to what the guitar(s) are doing, the singer, horns etc for every part. Focus on one instrument at a time, for the whole track. Do that for a range of songs, the more the better. (Also ask more overarching questions - is it fast/slow? predominantly major/minor? swing feel/straight 8 feel? And the song form - intro, verse, chorus etc - what does the form do. And how does what the instruments do change in these different sections..etc) Then do the same with, say, James Brown songs from the late 60s. Then I think you would have a very good idea what makes the two sound like they do, and so different from each other.

Just reading a line or two in a book about the difference - even a page or chapter - won't tell you much in comparison.

Not at all that simple. There are many things involved in music composition and production beyond chords and melodies. Instrumentation, orchestration, tone and timbre of instruments/synths, mixing/mastering techniques, vocal timbre and range, form, and that's not exhaustive.

Yes that's what I want to know. What chord progressions, what rhythms for different genres of music.

If you replace "theory" with "European-based jargon and notation patterns" then this is all pretty decent though imperfect.

What most people call "music theory" is not what would qualify as theory in any other field. At best (and it's rarely at its best), it explains music like chemical diagrams explain chemistry.

Any actual theory of music has to be based in human psychology and then the assertions tested against how well they explain music we can observe across the world and through history. And that exists, but it's in stuff people call "music cognition" and even there, folks are often too deferential to the untested hypotheses that claim to be "music theory".

Indeed. And in fact, most music students are told this fairly explicitly.

Not talking about you specifically, but more of a generalization: I've noticed that a lot of technical people get hung up on the arbitrariness of musical conventions, whereas musicians tend to just grab an instrument and start playing.

I wonder if music theory is more like engineering than science. The people I know who studied theory did not become academic theory scholars, but learned theory in order to use it. Lost in discussions about theory are what you actually use it for. Music students, when they learn theory, are simultaneously being taught things like composition, arrangement, technique, and possibly improvisation.

Were you assuming that I took this position because I'm a "technical [person]"?

Incidentally, I'm a musician and music teacher who started out focusing on creative exploration, improvisation, composition, and world music. I found it frustrating that I went through years of "music theory" only to much later realize that all the deeper insights and questions I had were already understood and studied by people in music cognition and related fields and yet most music education never brings up any of it and most music teachers are totally unaware.

One good intro: Music and Memory by Bob Snyder. That was written not for technical people but for multimedia artists at the art school where he teaches. They needed to understand music to use it better in their art. So, he wrote a book to actually explain music in a usable way. It's far and away more insightful and practically applicable than the traditional "music theory"

Nope, it really was intended to be a broader generalization.

That book seems interesting. Oddly enough I'm a jazz musician, but I never learned theory. I mean, I understand scales and chord symbols, but never learned anything beyond that in a formal way. Comparing myself to players who have studied theory, my limitations are that I can't compose or arrange, and I struggle to improvise over complex chord changes.

Yeah, learning the grammar of what has become consensus-jazz (if you will) allows you to better play that game with other people. In that sense, I do just very much dislike that such grammar is presented under the guise of "theory" (that's both in the word and in having a pretense of explaining music rather than just being the general rules that lead to standard jazz).

Compare to cooking: if you don't know how to use a measuring cup or the difference between baking and broiling, you will have a harder time following recipes or adapting them to your own tastes. And knowing deeper ideas like the effect of baking soda or eggs or the smoke points of different oils… it can get advanced and deep, but I still insist that learning about how cooking and digestion and taste actually work would be deeply insightful to cooking even if you can get by without that understanding. Same applies to music. Jazz musicians who just memorize all the scales and voice-leading ideas and forms etc. would gain a ton by learning about what music cognition offers.

My advice is to not get too hung up on the word "theory". Scientific, rigorous, testable theory is one kind of theory, but "music theory" uses the word in an older, broader sense which is just about a contrast between practice and theory, sort of like the difference between experiential learning and analytical learning.

There are absolutely things that can be learned by taking a scientific approach like you describe, but there is nothing wrong with a loose, informal type of analysis that musicians often engage in if it helps them see patterns and structure that occurs in music, even if the ultimate reason why it works isn't well-understood.

I do share some frustration, though, with how music theory is often discussed. Musicians are often not very analytical people, so when they dip their feet into the analytical side, the way they do it can be kind of muddy and confusion and incoherent. But I accept that as sort of a necessary evil because if you get too analytical, it tends to shut off creativity because your mind gets too focused on other things.

Oh, it's not just a semantic hangup. Most people who start reading about "music theory" are, I insist, hoping to understand what music is and how it works. What they get is instead a treatise on common-practice patterns from classical European through American-based jazz and pop music with only a smidgen of insights into the nature of music.

Even if you just stick within one of those traditions, the "theory" is more of a post-hoc attempt to explain (and in some cases dictate) the patterns found in music practice. Rarely are those post-hoc explanations subjected to any rigorous sort of critical thinking aside from the history of debates between different theorists postulating their own variations of post-hoc explanations.

Okay, even that is a bit unfair. But I think it does a disservice to students when these things are presented as "music theory" without qualification and context.

This is still a semantic objection, just something different from what the other poster pointed out.

Yeah, but this semantic problem has deeper ramifications. Since 98% of people who want an explanation of music get instead stuck down a rabbit-hole of culturally-biased music-pattern jargon/notation stuff, they don't know what they are missing. The market doesn't recognize its failure. And teachers don't learn that there even exists better insights to offer.

The core point: I can't just tell someone about this semantic problem and then they are just on the right track and all is fine. Instead, even when you recognize the semantic problem, there's not a robust beginner-oriented base of literature for music cognition. The semantic problem is an actual obstacle to the prosperity of the better approach that I'm suggesting deserves to be recognized as "music theory".

Most people who talk about music theory are artists, not scientists. Scientific rigour isn't normally needed or even expected by people who create music.

What really happens in my observation of what you describe: musicians learn about what other people claim as theory and then pass it on without much question. However, the "theory" itself doesn't just come from practicing musicians explaining their own work (though there's some of that). It comes from a history of theorizing.

A good analogy is language. Poets may indeed chatter about grammar a bunch. But the grammar they describe is usually stuff they inherited from their own schooling and from grammar books that have a whole long multi-generation history. And regardless of all this and the fact that it's largely right overall, scientific study of linguistics has found all sorts of issues with traditional grammar ideas.

Anyone interested in understanding language, whether theoretically as an end in itself or to explore the art of poetry, will do better by studying scientific understandings of linguistics than in memorizing old grammar textbook claims.

Language is an interesting topic. Words ultimately mean whatever it is that they communicate. The meaning of music theory is what musicians have established it to be.

For what you are talking about, you probably need to be more specific. Maybe scientific theory of music.

I'm suggesting that even to musicians, when they say, "I want to understand how music works", they pick up a book on "music theory". They think it does mean that. And they study it and hope it will get them what they want. It does a little. They aren't presented with the idea that any other approach even exists. And when they get advanced enough, some of them teach "music theory" classes and write more "music theory" books — all still thinking this is as good as we have at explaining the nature of music because they themselves sought that out and this is what they got.

At grad-school level "music theory" all the insights from music cognition are recognized as totally within "music theory" except that everyone is so invested in the general notation-jargon path to get there that they rarely think much about what theory could/should be for beginners. They eventually found the other stuff after so many years, and most people don't question whether there might be a better path.

The amount of work that must have gone into that!

I'm not sure about the target audience. For example, I looked at the Pitch poster (notation-pitch.pdf), and it seems to target people starting out on the piano. Nothing wrong with that, but people starting on instruments that don't have pre-programmed pitches (violin, cello, trombone, ...) Probably want to know there's a difference between fi c-sharp and d-flat.

Also, there's a cultural divide in how you read notes (movable-do versus fixed-do) and I'm not sure what you want to do with that.

Music theory is a mess.

Music theory is a cultural artifact encompassing centuries of development. It can be challenging to newcomers, but just like in complex software systems, there are often good reasons why things are the way they are.

... and even more often, historical artifacts which built up for no good reasons, but which aren't worth fixing due to everyone knowing it this way.

Music notation is a mess.

I'm not proposing changing it (that would make no sense -- it's good enough), but it's not worth treating as somehow right. Centuries of unplanned historical evolution don't necessarily result in something rational.

To go with your analogy: it's like the legacy software system written in Fortran which runs on VMS. There's a ton of institutional knowledge and good ideas, but a ton of cruft too.

The nice part is that, in fact, you can ignore most of it unless you are explicitly aiming to reproduce and capture elements of older works. If you are composing new work, you never really have to learn theory, but a few of the most popular frameworks help things along(e.g. composing to familiar meter, motif and chord structure does a ton to fill in gaps) and as a professional getting some familiarity with repertoire, if not necessarily its underlying theory, is expected. But once you have some distinct patterns to play around with, the music is already nearly there, and it's just a case of elaboration and refinement in some direction.

In that sense it's much more forgiving than software. Software becomes indecipherable almost as soon as nobody is looking at it and its structures are in some sense necessary for a purpose. It's not as amenable to pragmatic solutions although often, more of them are possible than we recognize.

Well, I think there are more basic notational issues too, which you can't ignore; they affect everyone. For example, the way that sharps and flats work makes no rational sense, except in the context of history of instruments and scales.

A lot of the notation of timing is cumbersome. Why the large number of wonky-looking symbols? Compare to how a lot of composition software shows timing with how long a position notes take up horizontally (music notation predates the concept of Cartesian coordinates!). It's a lot easier to work with, in all respects.

All this stuff builds up to about an unnecessary 3-month learning curve for kids learning music notation.

Is it worth changing a whole industry -- where everyone already knows the notation and there are countless works in notation -- to save all kids three months? Maybe, but probably not. That's the legacy system problem.

The nice thing -- compared to software systems -- is that none of this stuff is really all that complex.

>Music theory is a mess.

Why do you say so?

Because music theory doesn't know how numbers work. The interval of A(440Hz) to A(440Hz) is "1" in music theory even though it's 0 in literally every other context ever in the history of everything. I mean, if they're going to use a bunch of mathematical terminology, the least they can do is count right.

Seriously? Music theory is a mess because intervals are counted from 1 and not from 0?

>literally every other context ever in the history of everything

Have you met a single non-programmer that counts in everyday life starting on 0? Do you even start counting with your fingers from 0?

It's not a "1", it's a "prime" and the root of that word is an ordinal (whence "first") not a cardinal. There is no zero'th ordinal. There is just "none", which implies that A to A is simply not an interval.

most of it was built before people understood why/how some things work. Take for example scales. In the beginning, you learn that over a C7 chord, you can use the mixolydian scale. Fine. But then you discover that the minor third (e-flat) can work too, and the major 7th can work as well (fe bebop scale). Then you discover that the others can work too (yes even the minor 2nd) and depends on other things like strong-beat/weak beat and what you're resolving to. Classical music theory has no framework to explain all the things that can work. (The reason why all of the above works is still better explained by physics)

I think that's a mischaracterization, because it assumes that it was ever designed. At each point in time it was assembled from the notation conventions familiar from the previous generation of music to record the current generation. As you go back in time you find a nice, continuous progression back to about the 9th century.

This is an excellent set of sheets which will cover nearly all of the concepts you would in an undergraduate curriculum (well, besides all of the homework in 4-part writing and roman numeral analysis...)

If you are studying theory, or composing, then you may find my excellent set of notebooks to be useful! They have perforated pages, college ruled lines on one side, and staves on the other, for note-taking. https://www.themusiciansnotebook.com

Here's my "programmer's version" of music theory:

* We've evolved to hear a wide range of frequencies from elephants stampeding (~60Hz) to flies buzzing (~200Hz) to birds singing (~KHz). To accommodate this, our ears work logarithmically so an exponential increase in frequency is "perceived" as linear progression.

* Melody, tempo and cadence of a tune are linked to how we speak, with the melody following the syllable pattern and tempo of our human language speech [1]. This is also potentially why you get 1/f frequencies when analyzing music, because human language, speech and word frequencies follow power laws themselves [2].

* Discretizing steps between the frequency doubling helps express and communicate music.

* For whatever reason, when combining frequencies we tend to "like" simple ratios of one frequency to another, preferring a small a integer numerator and denominator (maybe this is a consequence of the logarithmic pitch detection?). Discretizing a frequency doubling into 12 steps offers a happy compromise of having many combinations of frequencies that have a small reduced fraction approximations [3].

* From the simple reduced fraction idea you can "derive" why notes close together sound 'dissonant' (large numerator and/or denominator in approximated fraction) and how to construct musical chords as they're 2-3 frequency combinations that have a good pairwise small reduced fraction approximation.

* Musical scales or modes are the result of further restricting the 12 step octave to a reduced set that have nice pairwise reduced fraction approximation (e.g. "sound nice"). The modes ionian, dorian, phrygian, lydian, mixolydian aeolian and locrian are the 'step sequence' of [1,2,2,1,2,2,2] (take 'c' as root, then move one over, then 2, etc.) rotationally permuted (8 steps, 8 modes). For example, ionian has step sequence [2,2,1,2,2,2,1] (e.g. [c,d,e,f,g,a,b]) whereas dorian has step sequence [2,1,2,2,2,1,2] (e.g. c,d,d#,f,g,a,a#]).

This is my understanding so far. I haven't made any music that I would remotely call "good" so all this should be taken with skepticism.

This is also heavily biased towards western music and I think there are many exceptions from around the world of different cultures producing different music that might not be classified from the above.

[1] "An empirical comparison of rhythm in language and music" by Aniruddh D. Pate, Joseph R. Daniele (https://www.researchgate.net/publication/10976378_An_empiric...)

[2] "Musical rhythm spectra from Bach to Joplin obey a 1/f power law" by Daniel J. Levitin, Parag Chordia, and Vinod Menon (https://www.pnas.org/content/109/10/3716)

[3] "Measures of Consonances in a Goodness-of-fit Model for Equal-tempered Scales" by Aline Honingh (https://www.researchgate.net/publication/267806865_Measures_...)

Is it just me or the site isn't loading anymore? HN's hug in action?

My thumbrules:

Middle A or A4: 440 Hz.

Every higher octave doubles the frequencies.

Cutesie cartoons don't make it easier.

Excellent! Give this dude some money.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact