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

#121: XML: Properly handle \markup #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

#121: XML: Properly handle \markup #122

wants to merge 1 commit into from

Conversation

uliska
Copy link
Collaborator

@uliska uliska commented 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.

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.
@@ -529,6 +531,12 @@ def UserCommand(self, usercommand):
self.tupl_span = True

def Markup(self, markup):
self.mediator.new_markup(self.postfix)

def MarkupCommand(self, markupCommand):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two methods are preparing support for markup formatting

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

Successfully merging this pull request may close these issues.

2 participants