Live data from Hacker News

Basic Music Theory in ~200 Lines of Python

mvanga.com

71–80 of 192 posts

Re: Basic Music Theory in ~200 Lines of Python

#71
post #64

Not a musician here but are scales really necessary? Why not just play any frequency I want?

Musician here—strictly speaking, music itself isn't necessary. Armed with that knowledge, you should produce any combinations of sounds that please you.

Re: Basic Music Theory in ~200 Lines of Python

#72

Does any programmer suffer with music theory as well, just based on the fact that an exact thing could be called in many different ways, depends on its position, function..etc? my brain kind of cannot accept this fact and I struggle with it

I've been programming for 40 years and playing music for 50. My original background was classical and I play jazz today. I'm a fluent reader. I think that historically, people were already familiar with "standard" notation and terminology before they learned theory, so it wasn't a major hurdle. Not only do theory students (i.e., at the college level) know how to read, but they are also required to learn keyboard. I'v…

This is the first time I heard of the Nashville number system - what's the difference to Roman Numeral Analysis? Is it essentially the same concept, but with Arabic numerals instead?

Re: Basic Music Theory in ~200 Lines of Python

#73
post #64

Not a musician here but are scales really necessary? Why not just play any frequency I want?

Scales and Chords are broadly speaking just a way of neatly-ish categorizing sounds and moods. This is true of both most classical music and jazz, for example, but Jazz in particular has a very practical relationship with scales.

One of the personality tests of an improviser is how you think about the music - do you think vertically (in the chord), horizontally (in the mode), for example.

Re: Basic Music Theory in ~200 Lines of Python

#74

“ For historical reasons, there are no sharps or flats between the notes B/C, and E/F.” Mmmm yes, and that’s also a bit confusing because it dodges around why the scale was and is 7 notes to begin with.

As a kid I dismissed the piano because nobody explained to me why the keyboard was so stupid looking, laid out so irregularly. WbWbWWbWbWW. Wot? Only some self-education (much later) revealed that 12 tones per octave deliver some excellent harmonies, not 11 or 13 or 20 or 36 or whatever. Twelve. But the harmonies come only on odd steps. So we have 5 semitones to a perfect fourth (4:3 harmony), then two semitones to a perfect fifth (3:2 harmony), then 5 semitones to the octave. And then - just to keep it confusing - we have to split both of those groups of five semitones, so... we arbitrarily split them as 2-2-1 (i.e. WbWbWW keys). Thus the white/black keyboard pattern, starting at C, of WbWbWWbWbWW. If only someone had explained all this in grade school.

Re: Basic Music Theory in ~200 Lines of Python

#75

Earlier quoted context omitted.

> If you hear a sound of frequency f and others of frequency 2f, 3f, etc then there's a good chance these sounds come from the same object, due to the physical principle of resonance. And so our perception of sound evolved to reflect this... Wow that's interesting enough to share as a standalone post, so I took the liberty! Thanks for the link!

The quoted sentence seems false to me. Most physical objects do not have naturally harmonic vibration spectra. The vibration modes are not integer multiples ofthe fundamental (except for a vibrating string). Only the finely tuned western instruments do. So this is a somewhat backwards argument.

You have the causality backwards though. It isn't saying most objects emit quantized overtones. But if you hear quantized overtones, there's a very good chance they are from the same source.

It's not just strings, either. Drum heads have varying degrees of quantized modes.

Re: Basic Music Theory in ~200 Lines of Python

#77

A perfect 5th is not the same as a diminished 6th unless we assume equal temperament tuning. Granted it is the dominant tuning, but it irks me when this is just silently assumed. Plenty of music around that is recorded using actual perfect intervals, so why muddy the waters?

I think going out of equal temperament into other modes of tuning/intonation would definitely be considered outside of "basic music theory".

It feels like grumping about some inaccuracies/glossing over in elementary school mathematics because of the existence of imaginary numbers.

Re: Basic Music Theory in ~200 Lines of Python

#78

It can be tricky to deal with the intersection of music and programming. For example: > The chromatic scale is the easiest scale possible So far so good-- in both programming and music we're just stepping through the smallest values (half step for music, the integer "1" in programming). So "easy" definitely applies to both domains. > We can generate a chromatic scale for any given key very easily For programming, sur…

> Figuring out what it means to have a chromatic scale "for a given key" is advanced music theory Interesting... Do you have any links for learning more about this - maybe some analyses? My take on chromatic scales (in the context of this post) is that the very existence of a(n equally tempered 12 tone) chromatic scale is the axiom the OP is using but not stated - hence a comment further up/down about P5s not necessa…

> My take on chromatic scales (in the context of this post) is that the very existence of a(n equally tempered 12 tone) chromatic scale is the axiom the OP is using but not stated - hence a comment further up/down about P5s not necessarily being equivalent to d6 in other tunings.

Ooh, good catch-- I completely left out tuning systems!

But again-- the point of "basic" music theory is to simplify the practice of discussing music. In that context, the fundamental purpose of the chromatic scale is to introduce the complete set of note names, as well as the range of the piano pitches. This gives the student a full set from which to derive all other concepts like scales, keys, triads, and all the other fundaments of the common practice period.

So again, if you start with a chromatic scale and then start talking about the differences in half-step intervals along it-- boom. Huge conceptual warp.

Honestly, I don't know much about the intersection between symmetric scales and alternate tuning systems. Personally, it seems like it would be an incredibly esoteric niche, although I can imagine some funny musical jokes with the idea. :)

Re: Basic Music Theory in ~200 Lines of Python

#79

I wonder if there is a scripting environment where I describe a chord progression in one thread, a lead voice in another and run them simultaneously, written entirely in code as a single file (or 2 files for parts + 1 for importing those).

https://github.com/synestematic/kord

I don’t think this has “execution”/synthesis features, but it could at least provide the basis for this environment.

Re: Basic Music Theory in ~200 Lines of Python

#80

Earlier quoted context omitted.

People have had this idea before but I've never seen a version of it that is better than our existing notation systems. Most of our music is diatonic, and we named the notes in our scale A B C D E F G. Seven notes in the scale, seven letters. Seven positions on the staff. Our harmonies are built on stacked thirds, and the stacked thirds line up perfectly on a staff. Line, line, line; or space, space, space. Three dot…

I appreciate most of your points and I appreciate the conciseness of the stave notation for example. But ... A B C D E F G. Seven notes in the scale, seven letters. Seven positions on the staff. Thats fine as long as you're in C Major. As soon as you depart from C Major it all starts going wonky. Why is C Major baked into the notation as if you'd never want to use anything else?

You have to pick something as your starting point.

The sharps and flats diatonic system is way easier to read because you just mentally parse "key of D" instead of "start on D but also sharp the F and C". It takes time but your brain just starts to grok shapes.

"Piano roll" notation, like in DAWs/midi editors, is actually in certain ways a lot hard to read than staff notation, due to the lower density and lack of reference frame. It _is_ easier to see chord shapes transposed up and down as the same. But I'd argue that's an anti-feature, because of said lack of reference points. The symmetry /sameness makes it a lot easier to start on the wrong note.

Post reply on HN