Thanks, Fr. Samuel,
When I try this, I get an error of an Extra \endgroup. MWE follows with some of the error message.
It may be that comment expects an end of paragraph in order to stop trying to process a comment. As an additional example, the code
\documentclass{article}
\usepackage{comment}
\begin{document}
\begin{comment} This is a comment \end{comment}
\end{document}
will generate an error. But moving \end{comment} to the next line gives an empty page of output.
I also tried using the \comment and \endcomment from the verbatim package, but to no avail. The verbatim package documentation says something about not being able to include \begin or \end commands within a verbatim (and hence comment) environment or you get a runaway argument. That seemed to happen also in some variations I tried.
I also tried a simple \grechangestyle{abovelinestext}{\comment}[\endcomment]
with each package separately, but to no avail.
I'm afraid I lack sufficient tex knowledge to delve into the guts of gregorio and figure out what is causing these environments to choke when simpler ones succeed, but I wager something can't nest with something else or something isn't being escaped that would need to be for this to work.
Rob
MWE, trying to change
% !TEX TS-program = lualatex
% !TEX encoding = UTF-8
\documentclass[12pt,twoside,latin]{book}
\usepackage[oldstyle]{libertine}
\usepackage{comment}
\usepackage[autocompile]{gregoriotex} % for gregorio score inclusion
% CHANT settings
\gresetinitiallines{1}
\usepackage{comment}
\makeatletter
\excludecomment{gre@style@abovelinestext}
\makeatother
\begin{document}
\gregorioscore{Speciosus}
\end{document}
Speciosus.gabc:
name: Speciosus forma;
office-part: Antiphona;
commentary: {\itshape\mdseries Ps.44,3;\/} H70;
annotation: 1.Ant;
annotation: I.g;
%%
(c4) Spe([alt:Extra Tempus Paschale.]f)ci(g)ó(fd!ewf)sus(dfc) for(fh>)ma<sp>*</sp>(g) (,)
præ(e) fí(gh)li(f)is(f) hó(d)mi(f)num,(c) (;)
dif(d)fú(fd)sa(e) est(f) grá(gh)ti(g)a(f) in(e) lá(fg)bi(e)is(fo~) tu(d)is.(d) (::)
<eu> E(h) U(h) O(g) U(f) A(gh) E.(g) </eu> (::)
Portion of error message cut from the console (it will have a different filename in the MWE):
-----------------------------------------------------------
[...] /ExtraTempusPaschale.Quarta.Antiphon.1-5_2_1.gtex:11:
Extra \endgroup.
\gre@style@abovelinestext ->\endgroup
\message {Excluding 'gre@style@aboveli...
l.11 ...5}{0}{1}{}{4}{\GreInitialClefPosition{4}{0}}
%