Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Estimating the Key from a Time Slice #8

Open
rajansaini691 opened this issue Feb 6, 2019 · 0 comments
Open

Estimating the Key from a Time Slice #8

rajansaini691 opened this issue Feb 6, 2019 · 0 comments

Comments

@rajansaini691
Copy link
Collaborator

Basically, we break up the song into several subsections. In each subsection, we count the number of occurrences of each note, to create a 12-dimensional vector. For example, let's convert Mary Had a Little Lamb to such a vector. The notes are EDCDEEEDDDEGGEDCDEEEEDDEDC. In this case, the vector would be <3, 0, 10, 0, 11, 0, 0, 2, 0, 0, 0, 0>. Then, we dot the vector by a mask corresponding to each key. For C Major the mask could be <0.5, 0.1, 0.5, 0.1, 0.5, 0.5, 0.1, 0.5, 0.1, 0.5, 0.1, 0.5>, while for C# major the mask would be <0.5, 0.5, 0.1, 0.5, 0.1, 0.5, 0.5, 0.1, 0.5, 0.1, 0.5, 0.1>. The dot product is 13, while <C# major> is 3.8. Thus, our song is much more likely to be in the key of C. If we continue for the other keys, we'll also get 13 for F major and G major.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant