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

Support brackets in NABC typography #1569

Open
lbssousa opened this issue Dec 20, 2022 · 6 comments
Open

Support brackets in NABC typography #1569

lbssousa opened this issue Dec 20, 2022 · 6 comments

Comments

@lbssousa
Copy link

Some works like Antiphonae et Responsoria, by Mons. Alberto Turco, uses brackets around adiastematic neums to indicate that they are editor choices not corresponding necessarily to original ancient manuscripts.

I would like to suggest such an addition to NABC typography.

@xmarteo
Copy link

xmarteo commented Feb 3, 2024

I volunteer to add this in the following way:

  • add NABC base glyph codes "ob" and "cb" (opening bracket, closing bracket) in tex/gregoriotex-nabc.lua
  • create (identical) opening and closing square bracket characters in gregall.sfd, gresgmodern.sfd and grelaon.sfd. They would be fairly tall, more or less the height of pr, ql!cl, toSsu2 and other tall neumes.
  • "ob" would have no width with the character drawn on the negative X axis, such that "a(g|obvi)" draws the vi at the same alignment point as "a(g|vi)".
  • update the documentation: should I list them among the base glyphs, or in a separate place?

@rpspringuel @jakubjelinek can you give me a go for this?

@jakubjelinek
Copy link
Contributor

I think the fonts used for gabc rendering already do have such brackets, what is used say for
([[ce]]) ([[gi]]) ([[fh]])
So, syntax-wise, I think it would be best to do the same in nabc, so a(g|[[vi]]) and also switch to the other font at that point, pick up somehow the right height and vertical position (perhaps from measuring the height of the neumes in between?) and then switch back to the gregall/grelaon/gresgmodern font.

@xmarteo
Copy link

xmarteo commented Feb 3, 2024

Avoiding duplicating brackets across fonts is good.
Note that in a typical use case there may be long passages between brackets, spanning multiple syllables and multiple lines.

I can attempt something, but as far as I can see the main while loop in gregallparse_neumes does not easily allow for either forward measurement of the neumes heights across the score, or multiple passes once this measurement is done, since it only gets passed the NABC for a given syllable.

So, we can do one of the following:

  • renounce customizing the vertical placement and vertical length of the bracket,
  • pass more info (e.g. the whole piece's gabc code) to GreNABCNeumes -> GreNABCChar -> gre@nabccharno -> parse_nabc -> gregallparse_neumes
  • manage brackets in NABC in gregorio and not in gregoriotex, and that's a can of worms I am /not/ opening :p

@xmarteo
Copy link

xmarteo commented Feb 14, 2024

@jakubjelinek Any guidance on this?

@jakubjelinek
Copy link
Contributor

jakubjelinek commented Apr 1, 2024

I think we should start by writing a TeX macro which temporarily switches to the music font and typesets the bracket, first test it completely outside of gregorio score, then test it in [alt:...] and then tweak the nabc parsing to emit those after parsing [[ or ]].
But I have trouble writing such a macro.
From what I can see in the fonts, there isn't a single character for the Brackets, but there are
Bracket{Left,Right}{Bottom,Line,Top}
characters.
And gregoriotex.lua should predefine macros for all characters in map_font.
But, when I try to use
\hbox{\gre@font@music\GreBracketLeftBottom} or
\hbox{\gre@font@music\GreCPBracketLeftBottom}
either outside of score or in [alt:], it just doesn't work.
@rpspringuel any ideas here?

@jakubjelinek
Copy link
Contributor

@rpspringuel Oops, mistyped, see above.

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

3 participants