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

Transpose after render changes result: Transposition to keys with more than 4 flats or sharps results in difficult sheets. #1345

Open
fredrikvedvik opened this issue Mar 13, 2023 · 7 comments
Labels

Comments

@fredrikvedvik
Copy link

fredrikvedvik commented Mar 13, 2023

We're having an issue where our sheets are rendered with a more difficult to read transcription than necessary when transposing the scores to a flat key. For example a sheet in E transposed to Db:

Manually written:
image

Output from OSDM (+9, with the source originally in E)
image

As we can see, E's for example are never notated, even though they also represent the same note as D#. Same with B's, making this a bit more difficult than necessary to read.

Is it possible to fix this?

@fredrikvedvik
Copy link
Author

Here's an example file where that issue happens (originally in E, transposing for Eb instruments (+9) results in bad readability).

ID-98013_Det_er_en_skatt_bak_dekker_gjemt.musicxml.zip

@fredrikvedvik fredrikvedvik changed the title Transposition to flat keys Transposition from E to Db results in hard to read sheets Mar 23, 2023
@sschmidTU sschmidTU added the bug label Mar 23, 2023
@fredrikvedvik fredrikvedvik changed the title Transposition from E to Db results in hard to read sheets Transposition to keys with more than 4 flats or sharps results in difficult sheets. May 16, 2023
@ammatwain
Copy link
Contributor

Good morning Simon, I uploaded the MusicXML file to my test area at https://ammatwain.github.io/transport-calculator/, and it is transposed correctly.

@fredrikvedvik
Copy link
Author

fredrikvedvik commented Jun 1, 2023

I fixed this for our case with a hardcoded if this then that solution

Basically, B-flats and E sharps can be written as just that instead of A-sharp and F-neutral, and it only occurred for those notes, so the issues we had are no longer to be seen.

I would revisit this if you wanted to implement something properly though, that fixes the root problem, not just the sideeffects.

@ammatwain
Copy link
Contributor

Yes, Fredrik, my class works with equal temperament. The expected transposed note is delivered by the final link in a chain of key relationships.

@fredrikvedvik
Copy link
Author

fredrikvedvik commented Jun 1, 2023

Oh now I see. Used the wrong transposition selector on your page 🙈

Your solution works great for this issue.

@ammatwain
Copy link
Contributor

Darn it... I should have put it first!...

@sschmidTU
Copy link
Contributor

sschmidTU commented Jun 6, 2023

Note that this problem doesn't occur when you transpose immediately before the first render(), after load():

        openSheetMusicDisplay.load(str).then(
            function () {
                // This gives you access to the osmd object in the console. Do not use in production code
                window.osmd = openSheetMusicDisplay;
                openSheetMusicDisplay.zoom = zoom;
                openSheetMusicDisplay.Sheet.Transpose = 9; // try transposing between load and first render if you have transpose issues with F# etc
                openSheetMusicDisplay.render();
                openSheetMusicDisplay.cursor.show();
            },
            function (e) {
                errorLoadingOrRenderingSheet(e, "rendering");
            }
        );

(modified code from our index.js, just adding the transpose)

image

So the issue here is changing the transpose after the first render, which can cause issues in some cases.
We haven't yet been able to figure out why.
But since load() is very fast, you should be able to simply load the sheet again and then transpose and render if you need transposition and the normal method causes issues.
So, this is a workaround for most cases. Of course it would be great to fix it completely though.

@sschmidTU sschmidTU changed the title Transposition to keys with more than 4 flats or sharps results in difficult sheets. Transpose after render changes result: Transposition to keys with more than 4 flats or sharps results in difficult sheets. Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants