Input of an exterior file into a gabc file

23 views
Skip to first unread message

Rob Leduc

unread,
Feb 7, 2022, 12:06:46 PM2/7/22
to Gregorio Users

Somewhat related to my other question with subject: Conditional printing of sections of a gabc file (hopefully here: https://groups.google.com/g/gregorio-users/c/imaqnOZLPTU),
I wonder if there is a way to include an exterior file in processing along with an existing gabc file.

For example, responsories often end with the Gloria Patri.  Rather than continually retyping or cutting an pasting the Gloria Patri mode 8 into the scores that need it, could there be some form of input command (supporting paths) to include right in the gabc file to pull in an exterior gabc file containing this snippet? Maybe existing macro structure could work, but my grasp of this is tentative. 

Something like this?

Test.gabc
-------
name:responsory1;
def-m1:\gabcinput{gloria.patri.8}
%%
(c4) Here(g) is(g) my(g) chant(g) (::[em1]) 

gloria.patri.8.gabc
--------
name:Gloria Patri (Tone VIII);
%%
Glo(g)ry(h) ... etc. (::)

R. Padraic Springuel

unread,
Feb 8, 2022, 8:09:33 AM2/8/22
to gregori...@googlegroups.com
This doesn’t currently exist, but sounds like a reasonable feature request. 

✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey 
4501 South Dakota Ave, NE
Washington, DC, 20017

PAX ☧ ΧΡΙΣΤΟΣ

On Feb 7, 2022, at 12:06 PM, Rob Leduc <rled...@gmail.com> wrote:


--
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 on the web visit https://groups.google.com/d/msgid/gregorio-users/5bb002d7-0d7b-49c4-af6d-3a18af214726n%40googlegroups.com.

rled...@gmail.com

unread,
Feb 8, 2022, 11:46:23 AM2/8/22
to gregori...@googlegroups.com
Thanks. I will look forward to it in the future, and likewise with the other feature.

R
You received this message because you are subscribed to a topic in the Google Groups "Gregorio Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gregorio-users/bmgh1XqQII4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gregorio-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gregorio-users/CF28343B-610F-4A62-89AF-360C24973B8B%40gmail.com.

Matthias Bry

unread,
Feb 8, 2022, 11:55:08 AM2/8/22
to gregori...@googlegroups.com
Hello Fr. Springuel,

I wholeheartedly concur with Rob on both features, they would be very useful to any larger publishing project.

In Christo,
Matthias "xmarteo" Bry

Jakub Pavlík

unread,
Feb 8, 2022, 1:12:49 PM2/8/22
to gregori...@googlegroups.com
There is no need to extend gabc with logic constructs, as these are readily available from tools like the m4 macro processor, the C preprocessor, or various templating systems.
See an example of 1. a score with an optional part and 2. a score including a shared snippet, implemented using the C preprocessor.

Regards,
Jakub

út 8. 2. 2022 v 17:55 odesílatel Matthias Bry <matthi...@gmail.com> napsal:

Rob Leduc

unread,
Feb 9, 2022, 12:15:46 AM2/9/22
to gregori...@googlegroups.com
Jakub,

This is interesting, and while I can almost understand the code, I am not a C programmer and so do not know anything about make, Makefile or how to run it with latex. 

Could you share the sequence of commands to prepare this example and produce the final pdf?

Thanks

Rob

Jakub Pavlík

unread,
Feb 9, 2022, 6:40:46 AM2/9/22
to gregori...@googlegroups.com
Hello Rob,

If you have "make" (a standard build automation tool in Unix-like systems), "cpp" (the C preprocessor - most Linux distribution probably have it as a separate package, you will also automatically get it as a dependency when installing the "gcc" C compiler), gregorio and LuaLaTeX, the only command you need to execute is "make", which reads Makefile and executes the command sequence specified there. I.e. you don't "run make with latex", but rather "make" runs latex (and everything else needed to build the document, as specified in the Makefile) for you.

If you wanted to execute the command sequence without make, it would be as follows.

# 1. process C preprocessor directives, produce pure gabc
cpp -P salva_nos.gabc.cpp > salva_nos.gabc
cpp -P -DTEMPORE_PASCHALI salva_nos.gabc.cpp > salva_nos_paschal.gabc

cpp -P responsory.gabc.cpp > responsory.gabc

# 2. build the LaTeX document
lualatex example.tex

Regards,
Jakub

st 9. 2. 2022 v 6:16 odesílatel Rob Leduc <rled...@gmail.com> napsal:

Rob Leduc

unread,
Feb 9, 2022, 7:38:16 AM2/9/22
to Gregorio Users
Jakub,

Thanks for this explanation.  It would appear that my older Mac is, in fact, missing cpp.  Research seems to suggest I install Apple Command Line Development Tools first, and I am too deep in the weeds to pursue this further.  This solution would work well, I think, for people who knew what they were doing.

Rob

Matthew Roth

unread,
Feb 21, 2022, 12:54:20 PM2/21/22
to Gregorio Users
Even smaller ones. I'm a novice user, but I constantly find myself reusing the same things or wanting to use one score file in different ways (with or without EUOUAE blocks, P.T. Alleluias, etc. ). and I'd have no idea how to do the other stuff, whereas I could make a macro work.
Reply all
Reply to author
Forward
0 new messages