Can somebody recommend some music theory book/course for this algorithm or the one in https://www.vitling.xyz/toys/acid-banger/ to make sense? Obviously, there are some pretty simple rules to predict that something sounds alright, some more complicated ones, and baroque music is notoriously algorithmic. But I still have no clue.
I tried to research something across these lines before, and I cannot quite recollect what exactly was the problem with the books I came across on my own (I think it was mostly just too basic to be useful), but somehow I never got any "general" understanding of "how music works". Even though I've got some very basic solfeggio training long time ago (admittedly, I was too young to ask questions I now find interesting and understand what's the purpose of what we were doing there, but at least I can read the notation).
In order for it to fully make sense, you will need to study it from multiple angles. Hooktheory.com, books, and lots of YouTube videos will get you there over the course of 1-10 years. Ultimately, you won't understand music theory without trying to write a lot of your own music. It's like programming: you can read a book about JavaScript, but if you never wrote software and you never plan to, there's simply no way to actually understand the book.
An explanation of how this application might work (haven't verified from the source or letting it run long enough): let's say it chooses a subset of notes ("scale degrees") from a minor key, probably chosen at random. A subset of 5 or fewer notes from a scale (a pentatonic scale) will constrain the possible space of melodies so that most configurations will sound good. Even fewer and you get a more predictably pleasant (but perhaps less interesting) result. For instance, the notes that comprise the root chord will always sound good when played in any order. Acid lines typically suggest some kind of minor chord by playing an arpeggio (usually a repetitive melody consisting entirely of notes from a particular chord).
Also, a subset of notes from one scale are always going to be present in another scale. You can transition (modulate) from one scale to another by having a section use a shared subset of notes, then switching to the new one. In this manner, you can have a single piece of music traverse all possible scales (in acid techno, almost entirely minor scales).
Ultimately, you won't understand music theory without trying to write a lot of your own music. It's like programming: you can read a book about JavaScript, but if you never wrote software and you never plan to, there's simply no way to actually understand the book.
Its very difficult to get into. I liken it most to maths, you simply cannot take something written for someone with a certain higher level of understanding than you currently have and expect to get much from it. You simply must go page by page slowly, deliberately, and humbly, taking the time to completely understand each term you come across (which will often require a several hour diversion, in which you come across more terms branching all the way down, etc). You can't skip over terms like "intervals", "locrian/lydian" and hope to understand them by osmosis.
Except, if you are asking how to learn algebra or statistics to a certain level, I could give you a list of certain theory books and exercise books in a certain order (some of them, admittedly, written in an unnecessarily complicated way in my opinion and you would be better off with some youtube videos, and for some of them I really don't know a more approachable (= better) alternative, but I think there could be), and be fairly confident that you at least could follow them and actually achieve what you were asking for.
And there's no single actual music theory book recommendation in this thread.
(And I don't think it's a lack of patience to learn terms that's the problem here, definitely not in my case. I know names for all intervals literally for a longest part of my life. I kinda know how each of them "feels". But it's still too far from being able to write music "algorithmically", and I don't know what would be the next step. Most books I come across just try to teach me interval names once again, and I'm pretty sure there must be more theory in music than that.)
If I have to give my recommendation, I used "Idiot's Guide: Music Composition" by Michael Miller. It required a lot of background reading, but once I understood chords and chord progressions well and melody construction it started, slowly, to come together. I don't know that it's a good book, but it worked for me.
I then read "A first book of blues, for the beginning pianist" by David Dutkanicz, which led me into blues which is kinda its own thing, I couldn't apply some of the algorithmic rules I had learned to the blues scale and I wanted to understand why. Admittedly the book didnt teach me the background theory of why that is the case but I did learn more concepts like syncopation and ways that the blues scales are constructed from a major scale and why
It's not a typical intro to theory but the "pop psychology" book This Is Your Brain On Music by Daniel J. Levitin includes something like what you're asking for: What is pitch, why do our brains "like" certain combinations of pitches and dislike others, etc.
It's a fascinating book in its own right on a bunch of theories about the neurology of music but it includes a very basic introduction to theory at the beginning.
Comments
Can somebody recommend some music theory book/course for this algorithm or the one in https://www.vitling.xyz/toys/acid-banger/ to make sense? Obviously, there are some pretty simple rules to predict that something sounds alright, some more complicated ones, and baroque music is notoriously algorithmic. But I still have no clue.
I tried to research something across these lines before, and I cannot quite recollect what exactly was the problem with the books I came across on my own (I think it was mostly just too basic to be useful), but somehow I never got any "general" understanding of "how music works". Even though I've got some very basic solfeggio training long time ago (admittedly, I was too young to ask questions I now find interesting and understand what's the purpose of what we were doing there, but at least I can read the notation).
In order for it to fully make sense, you will need to study it from multiple angles. Hooktheory.com, books, and lots of YouTube videos will get you there over the course of 1-10 years. Ultimately, you won't understand music theory without trying to write a lot of your own music. It's like programming: you can read a book about JavaScript, but if you never wrote software and you never plan to, there's simply no way to actually understand the book.
An explanation of how this application might work (haven't verified from the source or letting it run long enough): let's say it chooses a subset of notes ("scale degrees") from a minor key, probably chosen at random. A subset of 5 or fewer notes from a scale (a pentatonic scale) will constrain the possible space of melodies so that most configurations will sound good. Even fewer and you get a more predictably pleasant (but perhaps less interesting) result. For instance, the notes that comprise the root chord will always sound good when played in any order. Acid lines typically suggest some kind of minor chord by playing an arpeggio (usually a repetitive melody consisting entirely of notes from a particular chord).
Also, a subset of notes from one scale are always going to be present in another scale. You can transition (modulate) from one scale to another by having a section use a shared subset of notes, then switching to the new one. In this manner, you can have a single piece of music traverse all possible scales (in acid techno, almost entirely minor scales).
That's a great observation, thank you!
Yale has an online course "Listening to Music" that covers quite a bit of music theory. I quite enjoyed it: https://online.yale.edu/courses/listening-music
Its very difficult to get into. I liken it most to maths, you simply cannot take something written for someone with a certain higher level of understanding than you currently have and expect to get much from it. You simply must go page by page slowly, deliberately, and humbly, taking the time to completely understand each term you come across (which will often require a several hour diversion, in which you come across more terms branching all the way down, etc). You can't skip over terms like "intervals", "locrian/lydian" and hope to understand them by osmosis.
Except, if you are asking how to learn algebra or statistics to a certain level, I could give you a list of certain theory books and exercise books in a certain order (some of them, admittedly, written in an unnecessarily complicated way in my opinion and you would be better off with some youtube videos, and for some of them I really don't know a more approachable (= better) alternative, but I think there could be), and be fairly confident that you at least could follow them and actually achieve what you were asking for.
And there's no single actual music theory book recommendation in this thread.
(And I don't think it's a lack of patience to learn terms that's the problem here, definitely not in my case. I know names for all intervals literally for a longest part of my life. I kinda know how each of them "feels". But it's still too far from being able to write music "algorithmically", and I don't know what would be the next step. Most books I come across just try to teach me interval names once again, and I'm pretty sure there must be more theory in music than that.)
If I have to give my recommendation, I used "Idiot's Guide: Music Composition" by Michael Miller. It required a lot of background reading, but once I understood chords and chord progressions well and melody construction it started, slowly, to come together. I don't know that it's a good book, but it worked for me.
I then read "A first book of blues, for the beginning pianist" by David Dutkanicz, which led me into blues which is kinda its own thing, I couldn't apply some of the algorithmic rules I had learned to the blues scale and I wanted to understand why. Admittedly the book didnt teach me the background theory of why that is the case but I did learn more concepts like syncopation and ways that the blues scales are constructed from a major scale and why
It's not a typical intro to theory but the "pop psychology" book This Is Your Brain On Music by Daniel J. Levitin includes something like what you're asking for: What is pitch, why do our brains "like" certain combinations of pitches and dislike others, etc.
It's a fascinating book in its own right on a bunch of theories about the neurology of music but it includes a very basic introduction to theory at the beginning.
If you don't play, I suspect it's like trying to explain Tetris to a blind person.
Explaining Tetris to a blind person doesn't sound like an intractable problem?!
A better metaphor might be trying to explain to someone who can't hear why the word "barracks" sounds harsher to the ear than the word "mellifluous."