fix #19527, support for Sori and Koron

see http://musescore.org/en/node/19527.
Also some code cleanup