TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Deriving Keys from Chords in Music

83 pointsby dizzystarabout 4 years ago

12 comments

om2about 4 years ago
This post shows that some very simplistic algorithms can’t unambiguously determine a key. But I don’t think it establishes that a more sophisticated algorithm could not. Key center is not just based on chords and notes in a scale. It’s based on the note&#x2F;chord that seems like the place where the music is at rest, or at home. Many songs have non-diatonic chords, but it’s still fairly obvious what key they are in.<p>That said, there are examples where they key is ambiguous even to humans (e.g. Hey Joe [C G D A E], or Sweet Home Alabama [D C G] but disputed whether it’s in G or in D).
评论 #26616414 未加载
评论 #26616168 未加载
评论 #26616303 未加载
stevehiehnabout 4 years ago
Related: When I was off work in December I used graph theory to find chord paths through keys:<p><a href="http:&#x2F;&#x2F;signalsandsorcery.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;signalsandsorcery.com&#x2F;</a><p>You can see from the graph that chords exist in multiple keys and you can move from one key to another via these shared chords known as &#x27;pivot chords&#x27;
评论 #26633767 未加载
yesenadamabout 4 years ago
Talking about this stuff without saying <i>what kind of music you mean</i> seems a little silly. There is a reference to &quot;one popular song&quot;, and it seems the author is thinking of pop music. But it seems most things that can be said about keys&#x2F;chords in one genre&#x2F;tradition&#x2F;style, don&#x27;t apply to others. And even within genres, things naturally evolve so that old rules no longer apply.
评论 #26618178 未加载
评论 #26617146 未加载
declnzabout 4 years ago
&gt; A song could reasonably have a chord progression such as {Am, G, D, Am, G, Dm}, and the inclusion of both {D} and {Dm} would cause conflicts. Given that music theorists cannot agree on this stuff, there doesn&#x27;t seem to be anything a computer can do that is better.<p>Whilst I&#x27;m no expert, I&#x27;m pretty sure we have hundreds of years of examples of borrowed chords [1] for music theorists to agree upon, so yes plenty of things a computer could do better (as per other comments).<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Borrowed_chord" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Borrowed_chord</a>
评论 #26619190 未加载
elihuabout 4 years ago
One useful heuristic (at least, the one I usually go to first if I&#x27;m not sure what key a song is in) is that root of the final chord of the song is often the same as the root of the key. I suppose that probably works better for some music traditions than others. Also I believe some songs in a minor key sometimes end by converting the root chord to major.
评论 #26617116 未加载
vkhnabout 4 years ago
In college I built a project that could reasonably well predict the key of a given piece based on the distribution of note usage. For example, most pieces written in a major key would have the highest usage of the root, and the dominant of a key.<p>This obviously has a number flaws, but worked remarkably well for western music written between 1600 and 1900.
XCSmeabout 4 years ago
Is the first example with C and Am correct? It says the first chord of Am scale is A, shouldn&#x27;t it be Am?
评论 #26620434 未加载
评论 #26617127 未加载
评论 #26615919 未加载
RHSman2about 4 years ago
I had never thought about a key of a song being ‘variable’ but being set in stone. Interesting to have a mindset challenge.
bluetwoabout 4 years ago
If you can&#x27;t tell the difference, perhaps the answer is both.
justiczabout 4 years ago
I definitely thought this was going in a cryptography direction from the title. I actually kind of like the idea of composing music to generate a secret key :)
exabrialabout 4 years ago
Awesome. So what key is Revelation Song by Phillips Craig and Dean in?
评论 #26617928 未加载
acmjabout 4 years ago
I am no musician. I heard quite a few musicians, with or without innate perfect pitch, can tell the keys in a chord, though maybe not to the 100% accuracy. For example, something like what the kid is doing in this video [1]. I am a bit surprised that this can&#x27;t be done programmatically.<p>[1] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=vXivZlPu0ms&amp;t=175s" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=vXivZlPu0ms&amp;t=175s</a>
评论 #26616359 未加载
评论 #26616402 未加载