Check scores for adherance to music harmony rules
Hi,
I am reading First Year Harmony by William Lovelock, with a view to learning how to harmonize a melody, resulting in Soprano, Alto, Tennor, Bass. There are many rules to follow - e.g. No two parts may move in parallel perfect 5ths or octaves; the leading note may never be doubled; no part may leap an augmented interval, etc., etc., etc.
I was wondering about a mechanism to check these rules for a score, and the best way to implement it - while MuseScore is running (interactively letting you know if you break a rule), or something to parse and check the score after it is written (e.g. reading the score in XML).
I am considering writing something to add to the MuseScore code to do this, but just getting MuseScore to compile on windows 7 seems somewhat daunting with all the different packages required... I am a stay at home mum with 2 small kids, so don't have a lot of spare time, and my C++ is somewhat rusty, as I have not used it since 1999. I have used C a lot more.
Any thoughts on this?
Thanks,
Yvonne
Comments
Maybe this could be done by a plugin?
Ah - William Lovelock :)
I still have both books 1 & 2 from my college days mainly for sentimental reasons, but occasionally for reference when my memory fails me :)
This would be a wonderful teaching resource.
And certainly a parallel 5ths/octaves check would save me a lot of time visually and aurally checking my compositions on the occasions when I am being technically correct :)
Seems a plugin could indeed handle this nicely - not that it wouldn't be a programming challenge no matter how it was implemented!
Thanks - I have been checking out how to write plugins, and yes, it looks feasible that way. Thanks again for the suggestions.
Hi ChurchOrganist,
I'm wondering how 'general' to make this plugin. What do you think about the following questions?
Could I assume a maximum of four voices to check...or maybe five if there's a descant?
Do you think I could assume different "Voices" for each of Soprano, Alto, Tennor, Bass, or do you think it's likely that some people would have have e.g. Soprano & Alto in one "Voice" but using a chord instead of a single note?
Thanks,
Yvonne
There is a maximum of 4 voices per staff.
For SATB there are sometimes 4 staves with one voice each, sometimes 2 staves with 2 voices each and sometimes even 2 staves with one voice but 2 note "chords". And sometimes more then 4 staves...
Just iterate through all 4 possible voices in the user's selection of measures and staves, see the first example on http://musescore.org/en/plugin-development/how-plugin-development
I figure the main users of this plugin would be students writing four-part exercises for college theory courses (or teachers grading same :-). And as such, I wouldn't see any need to handle anything more general than that. I mean, sure, the more general the better, but no reason to create unnecessary extra work for yourself, either.
You might want to check this project by the Music21 people from MIT : http://music21-mit.blogspot.de/2012/02/music21-theory-analyzer.html
As far as I know they didn't release a public version of it, but maybe if you ask in the comments :)
Oh and if you need any help compiling MuseScore, you can pass by MuseScore IRC channel #musescore on freenode.net.
The way I would see a plugin working is for the user to select a section of score to check for harmony errors.
I would suggest that this should not contain more than 8 voices - ie SATB and keyboard accompaniment. If it does, the plugin should stop with an error. The only problem you may run into, however is that in 8 voices there will be inevitably some octave doubling, so it will need to be documented in such a way that the user can control this by means of the selection (s)he makes.
HTH
Michael
You may want to have a look at the Find Hamonies plugin , it might serve as a basis?
I emailed the music21 Theory Analyzer people at MIT as lasconic suggested, and received the following reply last night:
"The student who made the module is working on improved docs this weekend and it will be made part of the main music21 project in a release latter this month. Thanks for noticing it!"
--- Thanks, lasconic.
While I was waiting for the reply, I completed a plugin that will check for consecutive perfect fifths and perfect octaves. I have submitted it as a plugin called Check Harmony Rules if anyone is interested.
Some possible improvements:
- if there is no selection, just work on the entire score
- you included a sample file, but took the backup file (the one ending with a ,) rather than the latest version
Thanks for the suggestions, Jojo-Schmitz. I have carried out both of them and a new version has been uploaded (sorry - I did wonder what the comma meant! Now I know).
One more suggestion: move the stuff to GitHub, http://github.com.
I've never used GitHub. Should I make a new repository or put it in one already existing for MuseScore?
you'd need your own repository, and an account first.
I started using GitHub a couple days ago and really start to like it.
I could also create a repository for it im my account and make you a collaborator (you'd still need an account for this)?
Done. https://github.com/c3yvonne7/harmonyRules.git
now you can remove the attachment from http://musescore.org/de/project/harmonyrules and just hyperlink to . https://github.com/c3yvonne7/harmonyRules/zipball/master and everyone would alwas download your latest version
Thanks. I've done that too, now.
The plugin now does some extra checks, for those interested.
As we now have an excellent plugin from Christine to do this job, which I have already used several times :)
I am marking this as fixed.
Hi ChurchOrganist,
When you said "As we now have an excellent plugin from Christine... " did you mean from Yvonne (me), the Check Harmony Rules plugin, or is there another plugin I've missed? If it's mine you are using, then it is great to hear that it is useful to someone! :)
Best regards,
Yvonne
Oops!
I meant to type Yvonne!
My excuse was that I typed it just before going to bed and was feeling sleepy :)
Automatically closed -- issue fixed for 2 weeks with no activity.
Congratulations and thanks for your contribution.
Seasons Greetings.