Live data from Hacker News

Basic Music Theory in ~200 Lines of Python

mvanga.com

171–180 of 192 posts

Re: Basic Music Theory in ~200 Lines of Python

#171

Earlier quoted context omitted.

I've been working on a fixed chromatic solfege system (MaNePu) for a while as well. It uses a repeating vowel pattern which I find produces some really interesting effects. In MaNePu, the chromatic scale is ma - ne - pu - qa - re - su - ta - ve - wu - xa - ye - zu. In other words, consonants starting with M til the end of the alphabet, and rotating through the vowel sounds "ah", "ee", and "ooh". What's neat about thi…

Your MaNePu system sounds very cool! It's interesting that you speak of the symmetry vis a vis the number 3. My "way of word" has a similar property. It's based on trigrams from the I-Ching and all of that follows the diminished (3) geometry. Regarding spelling chords as the iteration over their notes like MaReVe for a major chord, my system can do this as well, by using an -a ending for each letter. In this case a m…

Thanks for sharing all this, I'll definitely dig deeper into your site! Exciting time for new theories of music.

Re: Basic Music Theory in ~200 Lines of Python

#172

I've worked on music theory coding for a while. I originally used a dict-lookup style like you have done, but found a simpler way (for me). The problem with that approach is you have to maintain values for enharmonics of note names. It's hardwired. Also what if you gave it something like ♭♭♭♭♭♭44? Why shouldn't it "theoretically" be able to handle that. It is "theory" after all. I use something like this to convert t…

From your link, I followed to the music of Lotus Helix: https://lotushelix.bandcamp.com/ Wow, I'm very captivated by it, such high musical weirdness! Excellent stuff.

Thank you very much. I guess because I have not succeeded yet at some externalities in this lifetime the album isn't even properly distributed.. something to do with the cover and my procrastination at registering with SOCAN.. and my preoccupation with my music-coding project for several years. And lack of internet chops and social stuff and neuroatypicality perhaps.

But every once in a while I'll throw it on and be truly weirded out (in a weird/good[?] way). The album is kinda like getting your brain hit by a truck in space. In the future I would like to make stuff that is slightly less dense. And also more focused.

But ya I recorded, composed, produced, played most of the instruments on that piece and am hypothetically available for musical services. Of course peeps can use the wonders of the www and just get weirded out whenever, wow! For free! I guess that's why people like me get minimum wage jobs in kitchens!

Ya that album will always be a personal memento and all round strange banger. I'm glad you enjoyed it!

Most of the stuff on my youtube honestly borderline sucks. Different phase of idea.. more improv and raw.. but there's like 2 or 3 good ones. Then I quit youtubing like 6 months ago cause I had to go frame houses to pay my rent which put my hand out of commission for a while. If you like Lotus Helix maybe check out a more solo-project one I did last year on the youtube.

It's about where I was born, outside among trees and stuff. I was actually born in the middle of a place called Riverdale.. but not like the tv show but the real one by the river. The tune is called Edrihan - The Riverdalian. https://www.youtube.com/watch?v=E-XZx1DUGhM

Re: Basic Music Theory in ~200 Lines of Python

#173
post #140

Earlier quoted context omitted.

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…

I didn't really understand your explanation so I might be restating your ideas, but just in case: > 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. We don't arbitrarily split them! It w…

I'm not sure what you're saying. B to F is not a fifth. A fifth up from B is F#.

Re: Basic Music Theory in ~200 Lines of Python

#174

Earlier quoted context omitted.

The notation OP is using is relative to the key of your song. So if your key is C major, the V chord is G. However, if your key is F major, the V chord is Bb. So it's not that there's only a few chords used in popular music, it's that there's a very consonant group of chords for any key your choose. Also, OP is leaving out lots of ways to modulate these basic chords into more complex ones (adding a seventh step, inve…

Any suggestions about theory learning beyond this? Something that would help with composition perhaps? Music phrasing? Some book to read? Something for self learning? I wish that melodies I am trying to compose would be better in reflecting what I like in music, and I whish to figure out what is missing. I can improvise with different chords but it is getting boring and once I try to do something more comlex it doesn…

This is not a bible for composers but does cover some common chord progression for popular music: https://smile.amazon.com/gp/product/0595263844/ref=ppx_yo_dt...

Re: Basic Music Theory in ~200 Lines of Python

#175
Apropos, some years ago I had written this blog post and Python program:

Play the piano on your computer with Python:

https://jugad2.blogspot.com/2013/04/play-piano-on-your-compu...

The post got some interesting comments with info about Western music theory, which I knew nothing about. And suggestions on how to improve the program to make calculation of note frequencies more accurate.

Re: Basic Music Theory in ~200 Lines of Python

#176
post #8

Earlier quoted context omitted.

Coincidentally there are no commonly used scales or modes with two consecutive semitones. The semitone gaps are always spaced out. With 11 notes (excluding the octave), that only leaves 4 possibilities for a 7 note scale if you remove rotations. These correspond to major, harmonic minor, melodic minor and harmonic major. It’s easy to prove with pencil and paper concentrating on c to c

> Coincidentally there are no commonly used scales or modes with two consecutive semitones. It's common in Bebop to add a passing tone to otherwise heptatonic scales. Consecutive semitones are also a common feature in blues.

That’s true but in those cases they are passing tones. For examples in a bebop scale you don’t tend to arpeggiate using both the consecutive tones.

Re: Basic Music Theory in ~200 Lines of Python

#177
post #173
post #140

Earlier quoted context omitted.

I didn't really understand your explanation so I might be restating your ideas, but just in case: > 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. We don't arbitrarily split them! It w…

I'm not sure what you're saying. B to F is not a fifth. A fifth up from B is F#.

B to F is a fifth; that interval is called a diminished fifth (one semitone less than a perfect fifth like B to F#).

Re: Basic Music Theory in ~200 Lines of Python

#178
post #177
post #173

Earlier quoted context omitted.

I'm not sure what you're saying. B to F is not a fifth. A fifth up from B is F#.

B to F is a fifth; that interval is called a diminished fifth (one semitone less than a perfect fifth like B to F#).

Yes, this is true, but it's not how the circle of fifths works (which is what the comment I was responding to seemed to be alluding to).

Re: Basic Music Theory in ~200 Lines of Python

#179
post #173
post #140

Earlier quoted context omitted.

I didn't really understand your explanation so I might be restating your ideas, but just in case: > 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. We don't arbitrarily split them! It w…

I'm not sure what you're saying. B to F is not a fifth. A fifth up from B is F#.

Huh, I copypasted that from wikipedia but botched the text when trying to highlight the part where sharps start and left it half-written.

I'll just link the relevant wikipedia article:

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

Re: Basic Music Theory in ~200 Lines of Python

#180
post #177
post #173

Earlier quoted context omitted.

I'm not sure what you're saying. B to F is not a fifth. A fifth up from B is F#.

B to F is a fifth; that interval is called a diminished fifth (one semitone less than a perfect fifth like B to F#).

He's right though, that's not what I was trying to write (not a 3:2 ratio).
Post reply on HN