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

Real cross-staff frames #3

Open
uliska opened this issue May 4, 2017 · 3 comments
Open

Real cross-staff frames #3

uliska opened this issue May 4, 2017 · 3 comments

Comments

@uliska
Copy link
Contributor

uliska commented May 4, 2017

No idea if that's reasonably possible, but it should be possible to get the coordinates of the neighboring staves, either within the current NN-group or the whole score.

@uliska uliska added the bug label Oct 2, 2019
@uliska
Copy link
Contributor Author

uliska commented Oct 2, 2019

I have run in a situation where this is not only an enhancement but could even be qualified as a bug.

grafik

This is done with the code from the usage example file.
I think it's clear why the right borders don't match: The frame gets its X-extent from the original horizontal bracket, and that is different for NoteColumns with different width, like here with the b notehead being to the right.

For the task at hand (I need it on a slide tomorrow) I worked around with shorten-pair, but that's ugly and unreliable, I think it could easily (and unnoticedly) break when the overall spacing changes.

So there should be a way to make cross-staff frames reliably possible. I have a few ideas how one could approach that but don't know whether any of them would work.

Hard-code the X-extent

It should be rather straightforward to provide a way to override the automatic retrieval of the X-extent from the horizontal bracket. This is surely the easiest way to ensure fitting borders, but it isn't really elegant.

Link frames

I have no idea whether this is possible at the time when the frames are calculated, but it would seem like an option to "link" a frame to another, presumably by an id property. In that case one would retrieve the (automatic) X-extent from both frames and adjust them to extend to the larger value on both sides, so the overall frame would grow (instead of shrink) to fit together.

Include arbitrary staves in a frame

Here too I have no idea whether it is possible at the appropriate point in the complilation process. But conceptually it would be ideal if a frame could have a property include-staff with a context name, similar to the alignAboveContext property that can be used for some things.
Here the system would have to get the relative Y coordinate of the target context, and the y-upper or y-lower would be calculated relatively to that.

@KlausBlum do you have any idea?

@KlausBlum
Copy link
Contributor

Sorry, I don't have any idea. It sounds interesting that one frame "reads" the property of another, but I absolutely don't know how to do that.

I could only offer another ugly hack:
I would rather take the staff that needs the widest frame (eventually use shorten-pair) and set its Y-extent to cover the staff above or below.
At least, this would avoid the need of fitting two frames with different widths.

@uliska
Copy link
Contributor Author

uliska commented Oct 5, 2019

Well, that's what I suggested as the last - and actually the most "correct" - approach. I don't think this is a hack.

The question is if - in a stencil callback we can get the relative coordinates of another - named - staff to calculate the offset.

If that is possible there would be two properties denoting the upper and the lower staff to be included in the frame, with both defaulting to the "current" staff. So by default the frame would behave like it does currently, but it would be possible to create arbitrary frames around multiple contexts.

Note: Such other contexts might as well be Lyrics, Dynamics or FiguredBass (probably others too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants