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

Audiveris option tweaks for orchestral scores #762

Open
Alterrien opened this issue Dec 4, 2024 · 8 comments
Open

Audiveris option tweaks for orchestral scores #762

Alterrien opened this issue Dec 4, 2024 · 8 comments

Comments

@Alterrien
Copy link

Hey there,
I'm trying to get Audiveris to work on a full orchestral score. The PDF in itself seems to be a direct export from an engraving software, so it should be fairly clean to work with. However, it seems like Audiveris struggles a lot with the smallness of all parts of the score.

You can get the PDF directly from IMSLP there: https://vmirror.imslp.org/files/imglnks/usimg/d/de/IMSLP741670-PMLP690923-THE_CLOUD_MESSENGER_FINAL.pdf.

One thing I had to tune is to set the min interline value to be much lower. It correctly detected the interline of 8, but could not apply it as it was lower than that setting. The error shown in the "should we set this page as invalid" was a bit misleading. See the logs below.

[IMSLP741670#7] IMSLP741670#7 With an interline value of 8 pixels, either this sheet contains no staves, or the picture resolution is too low (try 300 DPI).
[IMSLP741670#7] Beam  guessed height:  4 -- 0.50 of 8 interline
[IMSLP741670#7] Beam measured height:  7 -- 0.83 of [2..8] range at 59% of needed quorum
[IMSLP741670#7] No reliable beam height found, guessed value: 4
[IMSLP741670#7] Scale{ interline(8,8,9) line(1,1,2) beam(4 extra)}
[IMSLP741670#7] End of sheet step SCALE

With this issue fixed, I can get a bit further in the pipeline, but it quickly fails at the BEAMS step with a nasty java.lang.RuntimeException: org.audiveris.omr.math.Line$UndefinedLineException: Not enough defining points : 1

Would you have an idea on both how to fix my particular issue, and if there is a set of options I can set for Audiveris to better handle my score?
Thanks in advance!

@hbitteur
Copy link
Contributor

hbitteur commented Dec 5, 2024

@Alterrien
The problem is the very low resolution of the input image.
I tried the first sheet which contains some music staves, that's sheet number 7.

The scale step computed a interline value of 8 which is lower than the accepted minimum (11).
So I bypassed the protection by manually setting the constant minInterline in the class ScaleBuilder, from 11 down to 8.
The SCALE step was now OK, even giving me an extrapolated value for beam thickness of 4 (which is correct).

The problem is that the engine now operates in some abnormal land.
The next error occurred in the BEAMS step, when the engine tried to consider the big "M" in the text "The Cloud Messenger" as a candidate spot for a beam!! The reason is the music scale is so small that letters are comparatively very big.
Here again, after some debugging, I discovered that the constant coreSectionWidth which defines the minimum horizontal length for a core section on a beam top or bottom border, got down to the integer value 1 (it is defined as 0.15 times the interline 8)., which means a length of 1 pixel. And this is not enough to define a horizontal line, which requires at least 2 points. Hence the error message.

Here again I somehow cheated, by setting this constant from 0.15 to 0.5, and the BEAMS step no longer crashed.

I was able to get the whole sheet transcribed, but many mistakes remain that would need manual correction by the end user.
So, I don't know if it's worth to fight with this input.

For example, here is a sharp ?
image

And here, see the head, the augmentation dot, and a slur which appears rather thick (still by comparison).
image

Is there any way to get this score with a higher resolution?

@hbitteur
Copy link
Contributor

hbitteur commented Dec 5, 2024

Update:
I just pushed a bug fix for very low resolution.
There is no more need to manually change coreSectionWidthin class BeamsBuilder to survive the BEAMS step.

@Alterrien
Copy link
Author

Hi Hervé, thanks a lot for all your feedback!
I don't think I'll be able to get a higher resolution file, specifically since this is a score that I'd like to extract split parts. However, since this is basically an export from an engraving software, I'm guessing the PDF should have vector graphics instead of a picture, so I'm guessing we should be able to artificially increase the resolution of the PDF? I'll try to look into that.

@hbitteur
Copy link
Contributor

hbitteur commented Dec 5, 2024

Very good idea, assuming of course that the PDF uses vector graphics.
Audiveris now reads PDF files via the Apache PDFBox software, perhaps you could have a look there.

@hbitteur
Copy link
Contributor

Just my two cents:
You might be interested by this handbook section enlarging low resolution scans contributed a couple of years ago by Ram Kromberg

@Alterrien
Copy link
Author

Alterrien commented Dec 11, 2024 via email

@Alterrien
Copy link
Author

Hey again,
Here's the PNG, converted from PDF through convert -density 600 -depth 8 -quality 85 cloud-messenger-7.pdf cloud-messenger.png. I haven't been able to go on my GPU-powered PC so I haven't tried the waifu2x option to compare, I'll report back.
I'm just getting my bearings on using Audiveris so I don't know if the amount of mistakes to fix is on par for the course, but hopefully with some more experience I'll be able to go through those pages quicker.

cloud-messenger

@hbitteur
Copy link
Contributor

Quality is much better this time.
The amount of manual fixes is on par with other scores, even though we have more musical symbols in such an orchestra score.

FYI, I'm attaching TheCloudMessenger.zip wich contains the resulting .omr (which I cannot upload directly on this forum)
TheCloudMessenger.zip

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

2 participants