Live data from Hacker News

Basic Music Theory in ~200 Lines of Python

mvanga.com

111–120 of 192 posts

Re: Basic Music Theory in ~200 Lines of Python

#111
post #64

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

I'm a musician. For me, a great deal of the pleasure of being a musician is making fairly sophisticated, coherent music, with other musicians, in front of an audience.

Scales are not strictly necessary, but are part of an apparatus of making music work in the way that I enjoy it. They are a technology.

Re: Basic Music Theory in ~200 Lines of Python

#112

This is great but if we could go back in time and influence the naming conventions so that the 12 semitones were called A-L or just numbered 1 to 12, and if the intervals were named after the actual semitone distance (a 'fifth' is actually seven semitones) the whole thing would be soooo much less jargonny. With all that bumf removed, the patterns of the 'scales' and 'chords' would be foregrounded and thats the actual…

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…

In some parts of the world, it's A H C D E F G, with B being what you'd call B flat.

Because of that, it took me way too long to figure out that there was any sense in the note names.

Re: Basic Music Theory in ~200 Lines of Python

#113
post #17

There are maybe three aspects to music theory: (1) Theory of how things sound like: Tones, melodies, scales, chords, based on the frequencies of individual sounds. (2) How to name things. (3) How to handle the mess of naming things in Western music theory, where things have 12 different names, depending on which note you choose as the base. This post seems to focus on 3.

Why is that mess necessary? Cant a semantically rich notation be devised to avoid that mess?.

Re: Basic Music Theory in ~200 Lines of Python

#114

As a primer for music theory, this post doesn't teach much. It's using Python to derive various sets of notes in scales and modes, which is already easily available via google search, and in a more learnable format than Python code. The most basic aspect of Western music theory overlooked here is the relationship between tonic and dominant. If you know the "home" chord aka "the I" aka "tonic" is C major, the dominant…

Heh, I understood your first paragraph. I understood literally nothing in the following two paragraphs. Is this what it is like when I talk to people who don’t know anything about programming about my work? Pure gibberish?

I recommend you subscribe to prof Guy Michelmores YouTube channel then.

He is pretty good at explaining music theory without boring you to death. He even has a video on 1-4-5

Re: Basic Music Theory in ~200 Lines of Python

#115

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?

> Thats fine as long as you're in C Major.

C major, yes, but also A minor - where it actually starts from A :)

Re: Basic Music Theory in ~200 Lines of Python

#116
post #46
post #40

Earlier quoted context omitted.

I once listened to a podcast where fourier transforms were used to generate sounds that otherwise don't exist.

Could you maybe share which podcast? Generating “sounds that otherwise don’t exist” does not sound particularly remarkable taken at face value. It’s basically what any synthesizer or audio processor does, and Fourier transforms are also a very commonly used in audio processing.

This podcast. The episode of Joseph Fourier.

https://www.bbc.co.uk/programmes/b00srz5b/episodes/downloads

What I meant by "sounds that otherwise don’t exist" are sounds that are too complex to be created by physical music instruments its easier to simulate them by computer.

Re: Basic Music Theory in ~200 Lines of Python

#117
post #65

Earlier quoted context omitted.

The idea of a semitone in Western classical music is historical not (just) tonal.

True, but that does not mean you can just space notes in a scale randomly.

Hmm, I guess someone should tell those people, like Like Tolgahan Çoğulu who are writing music in microtonal scales with 19, 24 or 31 notes in a scale, that their notes spacing is random.

https://en.m.wikipedia.org/wiki/19_equal_temperament

https://en.m.wikipedia.org/wiki/31_equal_temperament

https://en.m.wikipedia.org/wiki/Arab_tone_system

Re: Basic Music Theory in ~200 Lines of Python

#118
post #65

Earlier quoted context omitted.

True, but that does not mean you can just space notes in a scale randomly.

Hmm, I guess someone should tell those people, like Like Tolgahan Çoğulu who are writing music in microtonal scales with 19, 24 or 31 notes in a scale, that their notes spacing is random. https://en.m.wikipedia.org/wiki/19_equal_temperament https://en.m.wikipedia.org/wiki/31_equal_temperament https://en.m.wikipedia.org/wiki/Arab_tone_system

The spacings are not random, they are still based on ratios. They just include more intervals in (what we call) the octave.

The linked article actually explains the math pretty well.

Re: Basic Music Theory in ~200 Lines of Python

#119

Earlier quoted context omitted.

Interesting that there are no languages with "flat" names. I can think of two reasons: - the word "sharp" has more positive connotations - if you're limited to the keys on a usual keyboard "flat" would be denoted by "b".

Jazz musicians (and brass players) generally prefer playing in flat keys (because of transposition making the reading easier) so while "sharp" has a more positive connotation in normal use, if you asked a tenor saxophone player to play something in F# or C# they would generally not be pleased :-)

I didn't think of that. My musical experience is on piano and voice (neither of which has a preference for sharp or flat keys) and I've played around with guitar a bit (which prefers sharp keys in standard tuning) so I tend to forget that some people like flat keys.

Re: Basic Music Theory in ~200 Lines of Python

#120

Earlier quoted context omitted.

Sure. But the other frequencies need not be integer multiples of the fundamental.

They don't have to, but usually those integer multiples will be present as well. Whether they are dominant or not is another matter but it is quite hard to design something in such a way that if it has a natural resonance at a certain frequency that integer multiples will not be present in the response spectrum. A typical object will have multiple modes of resonance as well.

> usually those integer multiples will be present as well

"usually", under what probability model? A random 3d or 2d shape will have zero harmonic partials with probability 1. What is hard to achieve is having even a few harmonic partials. A rectangular wooden piece is painstakingly carved to have a couple of harmonic partials, in order to become a xylophone or marimba bar.

Post reply on HN