Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How many melodies are there? (2014) (maths.org)
89 points by pyinstallwoes on May 12, 2022 | hide | past | favorite | 41 comments


Shouldn't a proper analysis of "how many melodies" be interval based rather than on individual notes? In that case there would be many fewer potential melodies. In an interval based analysis, a B to an A would be the same as a C# to a B. Too tired to count past ten but I think there would be 14 in-octave two note intervals, rather than 25.

Edit: I stupid, author's terminology confused me with "relative pitch" vs. intervals. And I forgot how to count.


I'm guessing the link comes from my Show HN post earlier today about a generative diffusion process neural net assistant which let me create 60 pretty catchy melodies that linked to this page (https://news.ycombinator.com/item?id=31343944).

One interesting question will be about copyrights. There are other melody-making programs but I'm not aware of anything catchy or worth registering with the U.S. Copyright Office being created by them. It costs $8.50/song. I've registered all 60 melodies I've posted so far since they all required my creative input, but with further advancements, the creative input will be reduced to cherry-picking best melodies. Eventually, a high enough percentage of the melodies created will be good enough that somebody will attempt to just register all of them. It's unclear whether they'll be judged as worthy of copyright protection under current laws or if these laws will be changed.

Another very interesting question is what's the number of "good" melodies. We could define this as being rated by random people at a level equivalent to an existing melody from a database (e.g. Hooktheory's) that they're not familiar with.


Is this some form of melody squatting?


https://www.theatlantic.com/technology/archive/2020/02/whats... is an interesting related article on this topic


I'm The Atlantic article's subject. To date, we have created — and copyrighted — about 400 billion (400,000,000,000) melodies. Here are descriptions:

http://allthemusic.info/faqs/#What_have_you_created_so_far

All of the melodies could be filed with the U.S. Copyright Office — as a "compilation" — much like a music album.


I've been trying to follow your project since I heard about it - but hadn't read the link you posted here. Really thorough, really good description of many of the quagmires (with prior cases) of melody and music copyright. Thanks!


Has copyright been defended against any of those?

I'm concerned about the "original authorship" requirement.


Thankfully the (US) courts have ruled that copyright can only be held by a person and don't apply to algorithmically generated works.


> It's unclear whether they'll be judged as worthy of copyright protection under current laws or if these laws will be changed.

If your goal is to register the melodies, you can do that under current law. Write the melody down, register it. There is no inquiry into whether you morally deserve to benefit from the system.


I have a theory that all the good melodies were already squatted by the classical masters before 1900 and therefore we now have to deal with all the dissonant modern crap that's usually inserted at the beginning of every concert program these days.


I have the opposite theory that the classical "masters" grabbed all the obvious low-hanging fruit and hypnotized the masses with mindless repetition for centuries. Finally, some of us have broken the spell, and can now enjoy more interesting, sometimes "dissonant" more modern melodies to enrich our aural lives.


what software did you use to make the music visualizations? I'm guessing Unity/Blender but not sure. Really cool stuff btw!


Thanks. I used Piano VFX (it's a bit buggy but workable) and VSDC (it's missing any sort of more advanced functions like batch rendering but does visualizations very well).


Actually we need to define melodies first. If we expend from Western music theories, the possibility becomes endless (even from information theory perspective).

Also, how long should the melodies be? What would be our perception chunk for melodies? And what if we have multiple layers?

See how you can tweak the 'melodies' of Kraftwerk's The Model:

https://glicol.org/demo#themodel

In music AI, there is a famous distinction between symbolic and subsymbolic. I guess when the entropy of symbolic reaches some threshold, switching to subsymbolic raw audio sample generation becomes natural.


A 6-note melody that starts with a 5-note melody would generally be perceived as the same melody. Shouldn't the 6-note melodies exclude all of the 5-note melodies? Similarly with a 6-note melody that ends with a 5-note melody, so shouldn't the 6-note melodies exclude twice the number of 5-note melodies? And so on, for all of the melodies? At what point would a smaller-number-note melody existing within a larger melody not be perceived as part of that melody?


A sentence of 6 words that starts with 5 words that themselves form a valid sentence would NOT necessarily be perceived as the same phrase, because the last, 6th word may completely change the meaning of the 5 previous ones.

A new word, as well as a new note, may transform the previous sentence/melody from a affirmation to a question, from a congratulation to a menace, etc.

Moreover, the punctuation used may radically change the meaning of the sentence.

And even more, the intonation and cadence in which you say this sentence, again, influence the meaning.

A melody is not just a succession of discrete tones (at least the article acknowledges that with its ground rules at the start).


You make excellent points. Some 6th notes will transform a 5-note melody into an entirely different melody, while some 6th notes would be barely distinguishable from the 5-note melody.


This is a good next step in mapping musical space, yes.


Would add that this is a very low estimate because it's only treating rhythm as a a steady 16th note increments when many musical genres use "swing" timing and probably ways of interpreting the timing of the notes as well


Even in traditional Western classical music, you have triplets, 5-lets, 7-lets, etc. (I have a flute piece which opens with a 57-let iirc—I forget the exact number but it was large enough that there’s no way that any flautist could actually play it as written).

Tempo also plays a big role. The soundtrack to Across the Universe includes slowed-down versions of “I want to hold your hand” and “Blackbird” which become almost unrecognizable thanks to a change of tempo (and instrumentation).

Rhythmic variations can dramatically change the perception of a piece. I used to play a choral piece by Poulenc (“O Magnum Mysterium”) with a swung jazz rhythm and it takes a very different character when you do that (see also countless jazz reinterpretations of Beatles and other pop songs).

One other piece of fun trivia: The rhythm of Hall of the Mountain King is exactly the same as the rhythm of Mary had a Little Lamb.


Also worth adding another caveat that the 12-tone equal tempered musical scale that most of the world uses these days is used because those notes give you a pretty reasonable approximation of most of the small whole-number frequency ratios that sound most consonant. But there's no reason a melody has to restrict itself to just those notes. In particular, ratios that have a 7 in them somewhere are very poorly approximated in 12-tone equal temperament.

The number of pitch intervals is theoretically infinite, but as a practical matter if a pitch is close to another it's likely to be mistaken for it. If we suppose that the threshold for a note to be different enough in pitch to be distinguished as a different note in a certain context is, say, five cents, then that gives us about 240 unique notes per octave. That's a bit of an oversimplification, but anyways the point is there's more than 12 notes, and music is like a vast continent with a thriving metropolis in one small corner but the vast majority of the land has never had more than a cursory exploration, if that.

Here's a list of pitch intervals that were deemed interesting enough to be included in wikipedia:

https://en.wikipedia.org/wiki/List_of_pitch_intervals


Definitely. Some bands work almost entirely with rhythm. For example what Meshuggah (the Swedish metal band) has been doing for the last 30 years. :) This is a video of a breakdown of two riffs from one song from their new album.

https://www.youtube.com/watch?v=A3_OjcLS3Jc


Great link, thanks!


The largest number on this page is 8.25x10**19; a number essentially incomprehensible to human minds.

It seems the message is: there’s a lot of room for creativity.

Any increase in the rhythm resolution will only further balloon that figure.

Agreeing with the message exponentially more.


The ground rules of this are prohibitive enough as to rule out major works as having notable melodies, and dismiss entire genres from their own characteristic melodies. It’s possibly interesting as a mathematical/algorithmic exercise but it’s musically equivalent to saying there are only so many permutations of words in a poem.


That might be OK, as the need for "melody" in music is itself a convention. The Prelude of Bach's 1st cello suite has been described as pure harmony. There's music that's just drums and chant.


Or colours in a painting


This is a great example of how you can still tell a unique story with music.

To strengthen this even further, there are scales that span over 16 (?) notes in Southeast Asia.

There are many different scales. There are different instrumentations. There are different arrangements. There are different dynamics, tempos, etc.

It really is infinite.


I'm working on a tool that could generate all possible melodies. It's just a fun side project to improve my skills, but if I ever complete it I will put it online.

It creates a unique id for Every Melody, but only generates and plays it when the corresponding page is accessed. So I wont generate a huge library of mp3's or something.


This[0] is a video by Adam Neely, who frequently talks about the cluster f*ck that is copyright law with regards to music, interviewing two guys having done this (within some constraints).

This[1] is the website linking to the dataset and code that was used to generate it.

[0] https://www.youtube.com/watch?v=sfXn_ecH5Rw

[1] http://allthemusic.info/


Thanks for your amplification of my project!



This was my inspiration. I even call my project Composer of Babel :)


Yes, I'm a cofounder of All The music — that someone referenced above — and you can feel free to build upon our tool, which is open source: https://github.com/allthemusicllc?tab=repositories

If/when you improve it, please let us know. We'd love to amplify your message/work!


If anyone would like to see my TED Talk on the topic, it's here: https://www.ted.com/talks/damien_riehl_why_all_melodies_shou...


I sure will check it out. Thanks!


The unique id for each and every monophonic melody (in the diatonic scale) is determined with the following pseudo-regexp: ([A-G][b#]?[0-9]/[1-9][0-9]*-)+.



There's never been any shortage of melodies, rather the problem is and has always been whether one has the talent to arrange the notes: https://www.youtube.com/watch?v=dCud8H7z7vUthere?


When calculating the number of melodies, although he takes into account the rhythm and length of notes, the writer forgets to take into account that the silent pause is often a part of melodies as well.


Our All The Music project accounts for silence. A "note" can be silence. Which could also account for rhythm. How different are these?

<eighth> <eighth_rest> <eighth_rest> <eighth> <eighth> <quarter> <eighth_rest> <eighth> <eighth>

Especially when considering copyright infringement lawsuits? Which require only "substantial similarity."




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: