-
Notifications
You must be signed in to change notification settings - Fork 5
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
Annotations for upper/lower halves of a time signature #28
Comments
timeSig26over8 is definitely possible. A bit like with tuplets, we will need to define what to do with elements that MuseScore supports and what Audiveris or other OMR can handle. Do we limit the number of supported time signatures and if yes, which limit ? or do we support an infinity of "shape" ids ? Regarding the nested symbols, you mean something like this ?
What about 12/8 ?
or
|
Any update on this? :) |
Just a thought: What if to get the bounds of the nested element we do:
To get the bounds for each 4 shape, we apply the math like: |
Try with 12/8 to see why it doesn't work. |
The 8 box should be smaller in width. |
Actually I thought it is not a crucial requirement only proper segmentation is hence this logic but as it is, I will look into it. :) |
I guess OMR will be happier with the smallest bounding box possible, @hbitteur ? |
Update: I have implemented Bigger box for 12 and smaller for 8. I have tested it on other TimeSig values too. For reference, putting a snippet from one generated XML here:
Algorithm for this approach: Now the Num and denom coordinates bounds - denomX = midHorizontal - (denom.width() / 2) In case we want a change, I will do it accordingly. Let's see which one suits the OMR well. :) |
This data is meant to become an OMR reference, and nobody can't guess all the future uses of it. So it would be a bad decision to jeopardize this reference data just to save a little bit of coding today! Stated differently, let's not cheat on bounding boxes! The bounding box of a given entity is the smallest rectangle that contains this entity. In your precise case, I don't think that the "12" glyph can exhibit the same width as the "8" glyph. After a careful look at your XML snippet, I have a few questions:
Concerning the algorithm, I would rewrite it as follows: midHorizontal = outerElement.x() + outerElement.width()/2; // /2
midVertical = outerElement.y() + outerElement.height()/2; // + and /2
numX = midHorizontal - (num.width() / 2);
numY = outerElement.y(); // top of num = top of outer
denomX = midHorizontal - (denom.width() / 2);
denomY = midVertical; |
Regarding the algorithm, Sorry It was my bad I forgot to mention / 2 here. In the implementation, I used the midpoint technique which you mentioned above but unfortunately, missed it here. Thanks for the review. :) Exploring more on point 4, this means in a typical five-line staff, the distance between the 1st line and the 5th line should be nearly 16? @hbitteur @lasconic |
Distance between 1st and 5th line it typically "interline value" * 4 |
I said because the height of 12 and 8 glyph combined gives me the value 16.047 and that is basically the distance between 1st and 5th line. As discussed, there are no visible gaps - the outer element width and height should not be this much. :) |
I think I got my mistake. For reference, providing here the new snippet after changing the implementation.
Hope it's fine this time because all the calculations seems to look accurate. Up for review @hbitteur @lasconic. :D |
I believe it would be very useful if we had a tool that can ingest an image and the XML description and draw bounding boxes and x,y origin point for each box in order to test the implementation quickly. Can Audiveris do that already or should @nasehim7 quickly do something in C++ or any other language (JS could enable this in a browser... ?). |
Drawing symbols bounding boxes on top of background image is already available in this project. To operate this feature, launch the Java program For help on available arguments, launch the program with the Update: I just fixed the typo in wiki link |
To launch the program, you can more easily use this command line (from the directory where you cloned omrdataset):
Mind the fact that the argument separator is the comma character, not the space character |
Sorry, I missed that. @nasehim7 looks like you have something to test your files ! |
When I run -
I am getting this -
Am I missing something? :) |
My gradle version is 4.0, and I don't know which incompatibilities gradle 5.0 might bring. |
After second though, I would export all timesig, and let audiveris or any other consumer deals with the one they can handle. |
The Time Signature Implementation is generalized i.e. works for all the timesig MuseScore has. If there is any test score that you can help me with @lasconic, we can surely test it on that. :) |
Sure, export both the "whole" timesig (such as 12/8) and its nested numbers (12 and 8). |
Yes, the current Implementation does that @hbitteur :D |
@lasconic This should also be okay in the next dataset. :) |
Except the whole time signatures (timeSigCommon and timeSigCutCommon), all the time signatures are composed of numerator and denominator numbers.
Would it be possible to get:
This would help the recognition of all time signatures, even the less frequent ones.
Nota: I found a timeSig26over8, but I suspect a typo... :-)
The text was updated successfully, but these errors were encountered: