Altering Staff Appearance

43 views
Skip to first unread message

John Greutman

unread,
Nov 23, 2024, 4:03:36 PM11/23/24
to Gregorio Users
Hello,

I'm wondering if there is any way to adjust how the staff appears. What I'm hoping to accomplish is have some light grey bars which sit behind the notes, indicating where on the staff the half steps are. I'm using LaTeX. Below is a picture of the sort of thing I'm after.

John Greutman

blank staff.png

Fr. Samuel Springuel

unread,
Nov 24, 2024, 1:26:05 PM11/24/24
to noreply-spamdigest via Gregorio Users
There is nothing built-in for that kind of functionality.

However, you might be able to manually achieve that result with a suitable redefinition of `\gre@generatelines`. The goal would be to replace some of the whitespace skips with a suitably drawn gray line and a smaller skip.

It should be noted, that this macro is ignorant of the clef position as written, and I’m fairly certain it gets called for the first time before the initial clef is set, so positioning the gray lines according to the clef position automatically is probably impossible. You’re going to have to make your alternate definition knowing where the clef is going to be and redefine it manually should you change clef.

✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ
> <blank staff.png>
>
> --
> Gregorio homepage: http://gregorio-project.github.io
> Archives for the old mailing list: http://www.mail-archive.com/gregori...@gna.org/
> To report a bug, please post to: https://github.com/gregorio-project/gregorio/issues
> ---
> You received this message because you are subscribed to the Google Groups "Gregorio Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gregorio-user...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/gregorio-users/9b14f5f7-2a3c-4ae7-87b6-dad108af1cbcn%40googlegroups.com.
> <blank staff.png>

John Greutman

unread,
Nov 26, 2024, 8:20:01 AM11/26/24
to Gregorio Users
Thanks, Father.

Do you know how I would redefine that macro? I've been trying with something like: 

\newcommand{\gre@generatelines}[0]{\rule{\textwidth}{0.4pt}}

Just as proof of concept to re-generate the staff. But I think \newcommand must not be right, I'm only getting errors. I've been able to do a lot in LaTeX, but this one is evading me. 

Thanks for your help!

R. Padraic Springuel

unread,
Nov 26, 2024, 8:22:56 AM11/26/24
to gregori...@googlegroups.com
Try the following proof of concept:

\makeatletter
\renewcommand{\gre@generatelines}[0]{\rule{\textwidth}{0.4pt}}
\makeatother



✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ

John Greutman

unread,
Nov 27, 2024, 8:58:02 AM11/27/24
to Gregorio Users
Hmm.
I've done some reading and now understand the purpose of \makeatletter and \makeatother, and I understand now why I must use \renewcommand. But for some reason the results are bizarre. The default staff will still be printed for the first line, and then for subsequent lines there will be nothing, but the lines and score bump each other around a bit. I've played around with it for a bit, but I'm completely out of my depth. Perhaps Gregorio's default definition could be used as a starting point, which I then alter, but I had no luck finding it. I don't know if the format would be LaTeX compatible or not. I've attached a MWE of the sorts of results I've been getting, any assistance is greatly appreciated! 
AlteringStaffLines.tex
AlteringStaffLinesMWE.pdf

Rev. Elijah Schwab, O.Carm.

unread,
Nov 29, 2024, 12:02:21 PM11/29/24
to gregori...@googlegroups.com
The default def for gregoriostafflines follows these comments.

Find the lines: \hrule height \gre@dimen@stafflineheight width \gre@dimen@stafflinewidth\relax%
and add the grey lines underneath.

Concept and untested:

\hrule height \gre@dimen@stafflineheight width \gre@dimen@stafflinewidth\relax%
{\color{grey}\hrule height 5px width \gre@dimen@stafflinewidth\relax}%

Add the appropriate lines to the code below and replace the beginning \def with \renewcommand wrapping with \makeatletter \makeatother

Spacing caveat: you may need to negate the height of the grey line from the interstafflinespace for the following staff line to make it all line up again:
\gre@skip@temp@four = \gre@dimen@interstafflinespace\relax%
might become
\gre@skip@temp@four = \dimexpr(\gre@dimen@interstafflinespace - 5px)\relax%

------------------------------

\def\gre@generatelines{%
  \gre@trace{gre@generatelines}%
  \setbox\gre@box@lines=\hbox to 0pt{%
    \vbox{%
      \gre@style@normalstafflines%
      \vskip\glueexpr(\gre@dimen@additionaltopspace+\gre@space@skip@spaceabovelines+\gre@dimen@currentabovelinestextheight)\relax%
      \ifgre@showlines %
        \hrule height \gre@dimen@stafflineheight width \gre@dimen@stafflinewidth\relax%
      \else %
        \vskip\gre@dimen@stafflineheight\relax%
      \fi %
      \gre@skip@temp@four = \gre@dimen@interstafflinespace\relax%
      \kern\gre@skip@temp@four %
      \ifgre@showlines %
        \hrule height \gre@dimen@stafflineheight width \gre@dimen@stafflinewidth\relax%
      \else %
        \vskip\gre@dimen@stafflineheight\relax%
      \fi %
      \ifgre@haslinethree %
        \gre@skip@temp@four = \gre@dimen@interstafflinespace\relax%
        \kern\gre@skip@temp@four %
        \ifgre@showlines %
          \hrule height \gre@dimen@stafflineheight width \gre@dimen@stafflinewidth\relax%
        \else %
          \vskip\gre@dimen@stafflineheight\relax%
        \fi %
      \fi %
      \ifgre@haslinefour %
        \gre@skip@temp@four = \gre@dimen@interstafflinespace\relax%
        \kern\gre@skip@temp@four %
        \ifgre@showlines %
          \hrule height \gre@dimen@stafflineheight width \gre@dimen@stafflinewidth\relax%
        \else %
          \vskip\gre@dimen@stafflineheight\relax%
        \fi %
      \fi %
      \ifgre@haslinefive %
        \gre@skip@temp@four = \gre@dimen@interstafflinespace\relax%
        \kern\gre@skip@temp@four %
        \ifgre@showlines %
          \hrule height \gre@dimen@stafflineheight width \gre@dimen@stafflinewidth\relax%
        \else %
          \vskip\gre@dimen@stafflineheight\relax%
        \fi %
      \fi %
      \kern\dimexpr(\gre@space@dimen@spacelinestext+\gre@dimen@additionalbottomspace+\gre@space@dimen@spacebeneathtext+\gre@dimen@currenttranslationheight)\relax%
      \endgre@style@normalstafflines %
    }%
    \hss%
  }%
  \relax %
  \gre@trace@end%
}%

--
Gregorio homepage: http://gregorio-project.github.io
Archives for the old mailing list: http://www.mail-archive.com/gregori...@gna.org/
To report a bug, please post to: https://github.com/gregorio-project/gregorio/issues
---
You received this message because you are subscribed to the Google Groups "Gregorio Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gregorio-user...@googlegroups.com.

John Greutman

unread,
Nov 29, 2024, 12:44:18 PM11/29/24
to Gregorio Users
Thank you! That works wonderfully. The only issue I still seem to have is that the staff is not altered for the first line of each chant. Any ideas of how I may fix that? Thank you all for your help.
AlteringStaffLines-MostlyWorks.pdf

John Greutman

unread,
Dec 3, 2024, 9:54:43 AM12/3/24
to Gregorio Users
I think I can get the first line of each score to work as well by redefining  \gre@drawfirstlines (I don't know how I missed it for so long, it's right before \gre@generatelines in the Gregorio manual pdf). But it seems  \gre@drawfirstlines must have a different definition than  \gre@generatelines, because simply pasting in the additional definition and changing the command names is not working, I am not getting any staff at all for the first line. If someone could find the default definition of  \gre@drawfirstlines, I could probably figure it out from there. But I don't know where to locate the default definitions.

R. Padraic Springuel

unread,
Dec 4, 2024, 7:52:54 AM12/4/24
to gregori...@googlegroups.com
The definition you’re looking for is in gregoriotex-main.tex (it starts at line 813). 

That file’s location will depend on your TeX distribution but you should be able to find it using kpsewhich. 
✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝

Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ

On Dec 4, 2024, at 7:40 AM, John Greutman <johng...@gmail.com> wrote:

I think I can get the first line of each score to work as well by redefining  \gre@drawfirstlines (I don't know how I missed it for so long, it's right before \gre@generatelines in the Gregorio manual pdf). But it seems  \gre@drawfirstlines must have a different definition than  \gre@generatelines, because simply pasting in the additional definition and changing the command names is not working, I am not getting any staff at all for the first line. If someone could find the default definition of  \gre@drawfirstlines, I could probably figure it out from there. But I don't know where to locate the default definitions.
Reply all
Reply to author
Forward
0 new messages