I am bad at music. But I am pretty ok at programing, and building electronics. I have a couple sound projects I'm working on to create live music, assisting my lack of dexterity. I've been fiddling with sonic-pi, but it doesn't work well on non raspberry pi computers in my experience. Anyway, sonic-pi employs a programing structure to create music using various aspects of the synth sounds, like duration, pan, fade, attack decay, sleep, etc.. Even understanding the language and the function, I'm not necessarily about to try live coding music.

It occurs to me that music must have some sort of rules about what sounds good (subjective), or bad (off key). where can I learn more about what that means from a mathematical / theoretical perspective?

do the patterns of music overlap across genres?

  • If you want to understand the “math” side of music, then you probably want to learn music theory. That’s the subject of how musical elements relate to each other across microscopic and macroscopic scales. Also it is possible to make music in real time without a lot of dexterity by using synthesis and sequencing. I’d do some web searches on those topics and also be patient since learning a good amount about music will take a few years. The upside is it’s a lifelong endeavor that is always rewarding. Jun 27, 2023 at 15:27
  • If you can cross a bit of a culture gap this may help youtu.be/vp9fu1ErBLQ
    – Rusi
    Jun 27, 2023 at 15:42
  • 1
    Welcome! There are a few issues with this question. Please check out the topics covered here, and how to get focused, factual answers. I'll cut to the chase and give my TLDR advice: 1) Explore the potential of DAWs and "virtual instruments." If you can take an entry-level class in music production or synthesis you'll learn a lot. and 2) take, or audit, or simulate via youtube etc., intro courses in music history or ethnomusicology. You'll quickly get a broad view of what makes music music. Jun 27, 2023 at 16:19
  • More detailed comments: The core of this question, "what makes music good or bad," is both way too broad to answer, and subjective. Not just a matter of taste, but culturally constructed. It's like asking "how do you define human beauty." There's little that a mathematical approach can do toward that goal (and when it tries, it often gets bogged in biased pseudoscience). Also note, "where can I learn about ___" questions are not on-topic, but "explain ___ to me" questions are. Finally, no harm in tinkering with approaches that are very code-y, but you'll find that there are... Jun 27, 2023 at 16:23

2 Answers 2


Although I just posted comments saying the question can't be answered, it occurs to me that a portion of it can, with disclaimers.

It occurs to me that music must have some sort of rules about what sounds good (subjective), or bad (off key). where can I learn more about what that means from a mathematical / theoretical perspective?
do the patterns of music overlap across genres?

"Good"/"bad" are culturally constructed—the rules governing baroque European music were different than medieval, which were different from ancient Greek, all of which are different from classical Indian. But all of these had their own codes of procedures and explanations. So if you restrict your scope narrowly enough, you can find rule sets that are valid within that context.

Now, there's one music-culture that's had an outsized effect on others. The music of the so-called "common-practice period"—the system of tonal harmony that broadly dominated from late baroque through mid-Romantic eras—continues to be the foundation of a lot of contemporary music, and through cultural transmission, a lot of global music-cultures as well. In other words, the musical language of Mozart makes up 95% of the musical language of Taylor Swift. Other genres can be more intentionally distanced, like jazz, metal, or 20th-century serialism, but the predominance of this tonal language is the reason it gets studied so much. When we say the phrase "music theory," ideally we mean a discipline that can be applied to any musical artifact, including Schoenberg, acid jazz, and prog metal... BUT what we often mean is the study of this tonal harmony, as in "Music Theory 101."

So in short, try for an entry-level education in "music theory," i.e. tonal harmony.* But bear in mind that any "rules" you find are only applicable within certain cultural parameters. Because...

Do the patterns of music overlap across genres?

Not always. Sometimes the evolution of genres out of others, or cultural transmission, mean that some genres have shared traits. But nothing is universally guaranteed.

* And good luck turning these rules into a data set that's useful for computational composition! You're not the first person to have this idea, and might look into what others are doing rather than reinvent a wheel. I've seen experiments using generative AI to generate music for years now, long before people have gotten so excited lately.


This may not be a proper question for this group as it's very broad and cannot be answered with a short discussion.

There is a lot of literature on similar subjects. Much is about the psychology of music though some attempts to describe music mathematically do exist. It's probably best to search through something like ARXIV preprints or Google Scholar or Academia.

  • people are always saying music is math. functionally speaking, would selecting the limitation, or parameterazation of a specific genre help improve the quality of the question? for example what are the mathematical models, algorithms, or patterns of Drum N Bass?
    – j0h
    Jun 28, 2023 at 13:58
  • 1
    @j0h I think saying music is math is a fairly flippant half-truth. Or perhaps it is true, but you have to accept that music is a whole other subset of maths with it's own conventions if so. There are parallels in the way of thinking, for sure, those who like maths may well enjoy music theory as it 'feels' very similar. But you can't apply a mathematical model to eg. DnB and get anything useful back without being fairly fluent in the music theory that surrounds it. The music theory IS the system of explanation that surrounds a genre.
    – OwenM
    Jun 28, 2023 at 22:12
  • 1
    @j0h More accurate would be "math is applicable to music." Math is applicable to a lot of things—you can do a lot of math with visual art; the color spectrum is measurable and so are the dimensions of a painting. Perspective is geometry. But to try to paramaterize and quantify "what is Renaissance taste," or worse "what is Good Art," is impossible, because it's trying to measure cultural and conceptual tokens (which are often hard to define even by subjective means). Jun 29, 2023 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.