Automatic Chord Identification and Entry

• Sep 15, 2013 - 02:50

This would be designed to analyze the notes of each chord in a score (most likely a song or hymn), identify the name of the chord, and place it in the proper place in the score (above the G staff in standard notation).


Comments

In reply to by Jojo-Schmitz

Thank you for posting this script. It is great to see someone trying to fulfill the need!

How do I get it to work, though?

Here is my latest hymn: ICanSee.mscz

I select the menu entry and it claims to find 0 harmonies. If I select all of the measures in the score, I still get the same result. If I select a note or a chord, it is still the same result. I put it in note-entry mode, and it still finds no harmonies.

Since I am writing hymns, each system of the score spans two staves (G clef and F Clef), so the chord will span those staves as well.

Attachment Size
ICanSee.mscz 6.29 KB

In reply to by Billsey

I discovered a workaround.

It is a bit tedious, at least for a non-coder like myself, but here it is:

Rosegarden includes a ruler that displays the chords it finds in a MIDI file. Those can be used to manually enter the chords into MuseScore.

Rosegarden is an open source application, so, perhaps the code that does this for Rosegarden can be used to get the same sort of functionality into MuseScore.

In reply to by Drace07

Just a heads up I ported over the js to a .qml file to be able to run in MuseScore 2.0:
https://github.com/andresn/standard-notation-experiments/tree/master/Mu…

I refactored a lot of the code in the process, so any issues, please file here:
https://github.com/andresn/standard-notation-experiments/issues

@ Jojo-Schmitz, I'm going to create a different Github repo for just this feature, experimenting with ideas in this thread and some I've been ruminating on, to eventually submit to you guys as a standalone plugin. My focus though is going to be on developing for 2.0.

Well, these aren't added as true chord symbols, because the plugin framework does not support that. So they are plain text only and are really just for informational purposes. If you want true chord symbols (with nice rendering, ability to transpose, export to MusicXML , etc) you will have type them in manually. But at least the plugin can help you figure out what the chords are if you don't know. Do note, though, that it is almost never the case in the real world that auto-generated chord symbols would be of much use. Far too many complexities, like the possibility of chords being split between voices or staves or arpeggiated, the likelihood of incomplete chords, the presence of non-chord tones, the presence of passing chords that should not be notated, etc. It's just not a solvable problem in the general case.

In reply to by Marc Sabatella

Thanks, Mark.

I understood that. I can move the notation to read and copy it to the real score, no problem. Right now, I'm just trying to find out why each one seems to have an A-caron and superscript attached to it. If I can figure that out, I'm probably good to go.

You may check http://musescore.org/en/project/magicchords -- I have patched it last year so that it is able to detect simple harmonies in a reasonable time.
Plugin uses home-made ad-hoc algorithm, I guess there are better ways to do it. Does anyone know any reference (a link to a publication) that explains how humans do it? I would be glad to read it and try to improve the plugin.

In reply to by anatoly.gorbunov

Hi Anatoly, Music21 has a commonName attribute for Chord and can label them from a list of pitch. See http://web.mit.edu/music21/doc/moduleReference/moduleChord.html

It should also be possible to make a test file containing all the possible chords since there are only 4083 possible chords https://groups.google.com/forum/#!topic/music21list/LFpnAZICK48 and only 349 chords if you don't consider the pitch http://solomonsmusic.net/pcsets.htm

In reply to by [DELETED] 5

I guess that it is rarely needed to try to detect current chord from a list of all possible chords, because there are some notes in melodies that are just transitional relative to a current chord.
For example, consider that you have harmony E---|A---|B---, and a melody like e, f#, e, g#|, a, b, a, c#|, b, c#, c#, d#. Notice that f# is a transitional note in E chord, thus most probably we do not need to consider it while detecting a chord say for a current bar. This leads to conclusion that some notes are excessive, and we must ignore them if we really want to detect something meaningful.
As I see that other people need this feature too, I will try to find my time to improve the plugin, so that it at least supports jazz chords like A7, A9, A11, A13.
As far as I remember, the plugin currently operates on a selected staves. In case there is no selection, entire score should be used. I have not tested it for more than half a year, though, so feel free to fire bugs/improvement requests.

Thank you, Anatoly. I'll give it a look. If you can extend it to work on both treble and bass clefs at the same time (treating them as though they were one staff instead of two), it will be very useful for hymns (such as I compose).

Do you still have an unanswered question? Please log in first to post your question.