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

Markup isn't handled properly #121

Open
uliska opened this issue May 5, 2018 · 1 comment
Open

Markup isn't handled properly #121

uliska opened this issue May 5, 2018 · 1 comment
Assignees
Labels

Comments

@uliska
Copy link
Collaborator

uliska commented May 5, 2018

#103 falls short of properly handling markup in two respects:

  1. the exported markup is always "above" (which should be easy to fix, I think)
  2. Instead of attaching markup to the note/event all markup words are concatenated to a single text and attached to the beginning of the measure.

I think 2. is harder to fix, especially since the current behaviour seems to be achieved on (some) purpose.

@uliska uliska added the bug label May 5, 2018
@uliska uliska self-assigned this May 5, 2018
@uliska
Copy link
Collaborator Author

uliska commented May 6, 2018

ad 1):
In <direction placement="above"> the placement attribute can simply be left out if there is "neutral" direction.

ad 2):
The <direction> has to be inserted before the note it is attached to (I think this means "before the <note> adds a duration to it").
One <direction><direction-type> element can contain multiple <words> elements, which can be used to apply changing formattings.

One more thing is: any note (=> what else can a markup to attached to? Rests, anything more? How is the relation to marks or tempo indications?) can have multiple markups attached to it (with the same or differing directions). So we have to do a number of things:

  • when parsing, \markup "starts" a markup (different from the current state) and attaches it to the current note. This must be done by appending to a list of markups.
    Note that this has to know about any preceding direction operator, which has to be attached to the markup object
  • each MarkupWord has to be appended to the current markup object
    (Does MarkupWord "know" about the formatting?)
  • When writing the musicxml a current note has to write out the list of markups before itself.
  • All references to the current measure in the existing code have to be reviewed and probably removed

uliska added a commit that referenced this issue May 7, 2018
Closes #121
As described in the Issue the previous implementation of \markup
had two flaws:
- direction modifier wasn't respected
- all markups in a bar would be added as a child of the bar
  instead of being attached to the notes

This commit creates each \markup as a <direction> element
immediately preceding the note/rest the markup is attached to.
If there's an explicit direction operator it is respected.
Multiple markups may be attached to a single note, each with its own
direction (or lack thereof).

The handling of Markup() and MarkupElement() objects is already prepared
to dealing with variable formatting, insofar as a Markup()
contains a list of MarkupElement() items, which will later be used to handle
formatting. One \markup will generate one <direction> element. This contains
a sequence of <words> elements (currently only one), which can individually
be assigned formatting attributes.
uliska added a commit that referenced this issue May 7, 2018
Closes #121
As described in the Issue the previous implementation of \markup
had two flaws:
- direction modifier wasn't respected
- all markups in a bar would be added as a child of the bar
  instead of being attached to the notes

This commit creates each \markup as a <direction> element
immediately preceding the note/rest the markup is attached to.
If there's an explicit direction operator it is respected.
Multiple markups may be attached to a single note, each with its own
direction (or lack thereof).

The handling of Markup() and MarkupElement() objects is already prepared
to dealing with variable formatting, insofar as a Markup()
contains a list of MarkupElement() items, which will later be used to handle
formatting. One \markup will generate one <direction> element. This contains
a sequence of <words> elements (currently only one), which can individually
be assigned formatting attributes.
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

1 participant