Re: Markup functions and punctuation in lyrics
On Nov 2, 2021, at 1:00 PM, Aaron Hill wrote: > > Not sure if this was already suggested, but could you use something like this > to concatenate arbitrary markup? I think that what you’re suggesting is in the spirit of what David was suggesting, but I’m trying to reduce the input overhead at this point and feel like what you propose increases it slightly. > On Nov 2, 2021, at 1:11 PM, Jean Abou Samra wrote: > > The difference between a music function and an > even function is that the return type of an event > function is narrower -- it must return something > suitable as a post-event, such as \p, -., \marcato, > etc. This brings syntax flexibility in the case > where a note is immediately followed by the application > of an event function. The handling of arguments remains > the same. It does not help here. Thanks for that information. So I guess that leads me back towards something like your first post. I’m going to need to pick that code apart and see what I can understand there. > Since you ask about this again, here is some code that > I wrote when you asked the first time. It post-processes > the lyrics to squash punctuation with the previous lyric > event. I had abandoned it because it was getting complex. > Try it and see how it fares -- it has not been extensively > tested. Oooo. This is decidedly more complicated looking than your first post, but I’ll definitely take a look as the interface looks really promising. Given my one track mind, I’ll probably wait until after I’ve had a chance to pick apart and understand your first suggestion. ✝✝✝✝✝✝ 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 ☧ ΧΡΙΣΤΟΣ
Re: Markup functions and punctuation in lyrics
> On Oct 31, 2021, at 6:02 PM, David Kastrup wrote: > > If the ugliness of juxtaposition is ok, you may use things like > > \,\man > > for concatenating stuff, too. What about event functions? Can a command which does the concatenation be written as an event function so that the juxtaposition isn’t needed? (I’ve never written an event function and the extending manual doesn’t provide much info about their capabilities/limitations.) ✝✝✝✝✝✝ 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 ☧ ΧΡΙΣΤΟΣ
Re: Markup functions and punctuation in lyrics
> On Oct 18, 2021, at 5:57 PM, David Kastrup wrote: > > I'd lean towards defining \man like in the question and a function \maN > that takes the following markup and concatenates it. That's viciously > unclever but sometimes not having to worry whether the computer gets > everything right is its own reward. David, can you elaborate on this suggestion a bit? \man is only a single example of the kind of function I have to write (there are similar ones for various pronouns, possessive adjectives, etc.) and so I’d like to separate the punctuation handling from the word selection (to avoid duplicate code in each function. I’m working on applying that idea to Jean’s code, but perhaps your idea is better suited to said separation. Is it anything more elaborate than establishing a function which effectively does `\markup \concat { \man, }`? And if not, is there a more succinct way of writing that? ✝✝ 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 ☧ ΧΡΙΣΤΟΣ
Markup functions and punctuation in lyrics
I’m using some functions to allow me to select words in the lyrics of some hymns in a systematic way so that the same hymn can be used referring to one or more persons (and in some cases, either a man or a woman). These functions work just fine when they appear in the lyrics by themselves, but when there is punctuation immediately after one of these functions, the punctuation gets shifted to its own syllable. Is there a way to have the function interact with punctuation more intelligently? I’m thinking I need to use \concat somehow, but how do I write the function so that it only does the concatenation when the next character is punctuation? Attached is an example showing one of my simple word selection functions followed by a comma. ✝✝ 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 ☧ ΧΡΙΣΤΟΣ gender-test.ly Description: Binary data
Differentiate between including and direct compiling a file
Is there a way for Lilypond to differentiate between a file which is being compiled directly and it being included in the compilation of another file? Something equivalent to `if __name__ == “__main__”` from python? I’d like to add simple examples to my various tools that I can use to test it (both during original development and after an update which breaks something) and remind me of what the tool does when I haven’t used it in a while. Ideally, I’d hide these examples inside a construction like this so that the example output is only produced when the tool file is compiled directly. ✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️ 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 ☧ ΧΡΙΣΤΟΣ
Re: Mass file linting
Stupid send button. > On Dec 18, 2020, at 6:15 PM, David Wright wrote: > > I remember you tried it out in May in connection with identifying > included files, though I didn't follow the thread to see whether > you incorporated it into your final method. > > Cheers, > David. No, I was able to get Lilypond itself to get me the information I needed. That’s probably why I forgot about it: I didn’t end up using it. ✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️ 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 ☧ ΧΡΙΣΤΟΣ
Re: Mass file linting
✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️ 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 18, 2020, at 6:15 PM, David Wright wrote: > > On Fri 18 Dec 2020 at 16:09:51 (-0500), Fr. Samuel Springuel wrote: >>> On 17 Dec, 2020, at 4:27 PM, David Menéndez Hurtado >>> wrote: >>> >>> pip install python-ly >>> ly "reformat" input.ly > output.ly >>> >>> That runs exactly the same that Frescobaldi does. More documentation: >>> https://pypi.org/project/python-ly/ >>> >> >> I should probably smack my forehead over this. I already had python-ly >> installed on my system, indicating I’ve probably used it before. > > I remember you tried it out in May in connection with identifying > included files, though I didn't follow the thread to see whether > you incorporated it into your final method. > > Cheers, > David.
Re: Partially formatting syllables in lyrics
Should have known this would be in the manual. Thanks. ✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️ 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 Nov 21, 2020, at 12:00 PM, Xavier Scheuer wrote: > > > On Sat, 21 Nov 2020 at 17:45, Fr. Samuel Springuel > wrote: > > > > How can I apply italics to part of a syllable in the lyrics context? When > > I use the method I usually use to apply italics, it automatically creates a > > new syllable: > > > > #(ly:set-option 'relative-includes #t) > > \version "2.20.0" > > > > \new Staff > > << > > \new Voice = "mel" { c' c' } > > \new Lyrics \lyricsto "mel" { \lyricmode { hat\override > > Lyrics.LyricText.font-shape = #'italic (s) \revert > > Lyrics.LyricText.font-shape show } } > > >> > > Hello, > > As the doc says: "Markup mode may be used to format individual syllables in > lyrics". > NR 2.1.1 Common notation for vocal music > Entering lyrics > https://lilypond.org/doc/v2.21/Documentation/notation/common-notation-for-vocal-music.html#entering-lyrics > > Hence you can use \concat and \italic. > \markup { \concat { hat \italic (s) } } show > > Cheers, > Xavier > > -- > Xavier Scheuer >
Re: Identify included files
> On May 25, 2020, at 2:58 AM, Wols Lists wrote: > > On 24/05/20 21:28, Fr. Samuel Springuel wrote: >> It’s not quite as straight-forward as you seem to think: >> >> 1) You haven’t accounted for the possibility of multiple folders with >> varying levels of hierarchy. The changed file might be in ../ relative to >> one file, ../../ relative to another, ../some/dir/levels relative to a third >> and other possible variations. It might also be specified >> /with/an/absolute/path in some files. All of that complicates the search >> string for grep. > > This is a real can of worms ... > > I THINK all paths are relative to where lilypond is running. So any > include file that itself contains relative includes is asking for > trouble - it's "random" whether those paths will be valid or not... > > Cheers, > Wol > It depends on the state of the relative-includes variable. If true, then paths are relative to the file in which the include statement appears. If false, the paths are relative to the main input file. Default behavior is false. It’s explained here: http://lilypond.org/doc/v2.21/Documentation/notation/including-lilypond-files
Re: Changing slur behavior
> On 26 Mar, 2020, at 9:54 AM, Aaron Hill wrote: > > On 2020-03-26 2:24 am, Kevin Barry wrote: >> I think the right way to do what you are trying is to write an >> engraver that listens for slur events and alters the spacing of the >> music. (I would write one if I could, but I'm not at that level yet.) > > Firstly, know that slurs are not the only way to define melismata. You can > instruct LilyPond to have a single lyric syllable span multiple notes using > \melisma and \melismaEnd: > > > \version "2.20.0" > > \fixed c' { b4( g a2) | b4\melisma g a2\melismaEnd } > \addlyrics { one two } > > > This does not solve the spacing aspect of the original post, but it shows how > you can avoid messing about with slurs. I’ll have to play with this to see how I like it. The reason I initially wanted to mess with slurs was on the off chance that I later wanted to take the chant and turn it into a fully modern > Assuming you really want to use slurs to adjust spacing, here might be one > way to do it: > > …snip... > > The engraver listens for slur-events, injecting a spacing-section-event and > adjusting some context properties as needed. The logic is very simple, and > there are no safety checks. Be warned this likely could fail with more > complicated music. > > > -- Aaron Hill Thanks for this Aaron. After some playing I’ve adapted this to the way I usually encode chant (where all notes are basically quarters): \version "2.19.84" Slur_spacing_engraver = #(lambda (context) (let ((slur-event-dir #f)) (define (change-spacing dir) (ly:broadcast (ly:context-event-source context) (ly:make-stream-event (ly:make-event-class 'spacing-section-event) '(( (let ((score-context (ly:context-find context 'Score))) (for-each (lambda (args) (apply ly:context-pushpop-property score-context 'SpacingSpanner (if (< 0 dir) (drop-right args 1) args))) `((base-shortest-duration ,(ly:make-moment -2)) (shortest-duration-space 2) (spacing-increment 0) (make-engraver ((start-translation-timestep engraver) (set! slur-event-dir #f)) (listeners ((slur-event engraver event) (let ((dir (ly:event-property event 'span-direction #f))) (set! slur-event-dir dir ((process-music engraver) (if (ly:dir? slur-event-dir) (change-spacing slur-event-dir)) \layout { \context { \Score \override SpacingSpanner.shortest-duration-space = 3 timing = ##f } \context { \Staff \consists \Slur_spacing_engraver \remove Time_signature_engraver \omit Stem \omit Slur } } music = { a' g' a'( g') a'( ges') a'( g') a' g' } words = \lyricmode { Some words to go un -- der notes } \new Staff << \new Voice = "mel" { \music } \new Lyrics \lyricsto "mel" { \words } >> I’ve found a problem: accidentals inside of slurs end up colliding with preceding notes. Is it possible to modify the Slur_spacing_engraver so that it doesn’t ignore accidentals and takes them into account when deciding the spacing between the notes? ✝✝ 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 ☧ ΧΡΙΣΤΟΣ
Changing slur behavior
I’m trying to copy some music (chant) in which slurs are not indicated by bezier curves, but by changing the spacing between the notes (bringing them much closer together). Now, while I’ve been able to figure out how to get the visual look, I’m not happy with the interface at the moment, as it requires inserting extra commands into the music so to turn on and off the tight spacing. Furthermore, if I only have the tight spacing, then each note gets its own word when I start adding lyrics with \lyricsto. What I’d like to do, therefore, is high-jack the existing slur notation so that the source looks “normal” but then instead of the usual curve, my spacing changes are applied instead (or at least in addition to). Is there a way to accomplish this? In the MWE below, \starttight and \endtight are my first pass attempts which apply the spacing, but don’t mark the notes as slurred (resulting in the words being applied wrong and messing up the spacing). \startslur and \endslur apply both my spacing and the usual slur, allowing the lyrics to be assigned right (and the spacing preserved properly when that happens), but also causing the normal bezier curve to show up. % MWE \version "2.19.84" % remove stems and auto bar lines chant = { \set Score.timing = ##f \omit Stem } starttight = { \newSpacingSection \override Score.SpacingSpanner.base-shortest-duration = #(ly:make-moment -2) } endtight = { \newSpacingSection \revert Score.SpacingSpanner.base-shortest-duration } startslur = #(define-music-function (note) (ly:music?) (set! (ly:music-property note 'articulations) (cons (make-music 'SlurEvent 'span-direction -1) (ly:music-property note 'articulations) ) ) (make-music 'SequentialMusic 'elements (list #{ \newSpacingSection \override Score.SpacingSpanner.base-shortest-duration = #(ly:make-moment -2) #} note ) ) ) endslur = #(define-music-function (note) (ly:music?) (set! (ly:music-property note 'articulations) (cons (make-music 'SlurEvent 'span-direction 1) (ly:music-property note 'articulations) ) ) (make-music 'SequentialMusic 'elements (list #{ \newSpacingSection \revert Score.SpacingSpanner.base-shortest-duration #} note ) ) ) music = { \chant a' g' a'( g') \starttight a' \endtight g' \startslur a' \endslur g' } words = \lyricmode { Some words to go under my notes } \displayMusic \music \new Staff << \new Voice = "mel" { \music } \new Lyrics \lyricsto "mel" { \words } >> ✝✝✝✝✝✝✝✝✝✝ 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 ☧ ΧΡΙΣΤΟΣ
Reciting tones
While typesetting chant, I have a pair of functions for dealing with recitation notes: one applies to the notes, the other to the lyrics (see MWE below). This works, but I’m wondering if there isn’t a way to combine the two functions into one that has a few extra features: 1) The function automatically detects whether it’s in a musical or lyrics context and applies the appropriate settings/overrides which are exclusive to that context. 2) The function looks to make sure that it’s always in parallels with itself (that is, when the function is applied in the notes, there should be a corresponding application of the function in the lyrics at the same musical moment), raising an error when it’s not (or at least a warning like a bar check). 3) Line breaks are allowed between the words encapsulated in the function in the lyrics, in which case the reciting tone note will be repeated at the beginning of the new line. Are any of these things possible? Priority wise, I’d say that #3 is the most important for me (as it would allow me to use the same source on different sized paper and/or with different sized staves), while the others are more “nice-to-have” things that would help my workflow without being critical. On the other hand, I naively expect #1 to be easy to implement, perhaps by looking at the associatedVoice property (which would be set for a lyrics context, but presumably not for a music one). % MWE \version "2.19.84" % apply to lyrics in chant which should all appear below a single note recite-words = { \once \override LyricText.self-alignment-X = #LEFT } % a note in chant which is sustained for multiple words % argument for ly:make-duration is 1 for half notes, 0 for whole, -1 for breve % also has second optional argument for number of dots recite-note = #(define-music-function (note) (ly:music?) (withMusicProperty 'duration (ly:make-duration 1) note)) % remove stems and auto bar lines chant = { \set Score.timing = ##f \omit Stem } music = {\chant \recite-note c' d' e' f' } words = \lyricmode{ \recite-words "A phrase all sung on one note" mov -- ing words. } \new Staff << \new Voice = "mel" { \music \music } \new Lyrics \lyricsto "mel" { \words \words } >> ✝✝✝✝✝✝ 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 ☧ ΧΡΙΣΤΟΣ
Re: Lyluatex
Well, LuaTeX is still having trouble finding the executable, just in this case it’s looking for C:\Program. That, of course, is not a complete path to the lilypond executable. The space in the path is clearly not being escaped correctly. Try adding quotes around the complete path or edit your PATH variable so that `lilypond` is recognized without the complete path. ✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️✝️ Br. 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 Sep 18, 2018, at 10:36 AM, foxfanfare wrote: > > Urs Liska-3 wrote >> Did you correctly quote that here? I see -shell-escape instead of >> --shell-escape. > > Hi Urs, > Actually, I just copied what was written in the GitHub documentation: > https://github.com/jperon/lyluatex > > I tried with the -- and also with > \usepackage[program={C:/Program Files > (x86)/LilyPond/usr/bin/lilypond-windows.exe}]{lyluatex}, and yet again: > > D:\tex>lualatex --shell-escape test.tex > This is LuaTeX, Version 1.07.0 (TeX Live 2018/W32TeX) > system commands enabled. > (./test.tex > LaTeX2e <2018-04-01> patch level 5 > (using cache: C:/texlive/2018/texmf-var/luatex-cache/generic) > luaotfload | main : initialization completed in 0.263 seconds > (c:/texlive/2018/texmf-dist/tex/latex/base/article.cls > Document Class: article 2014/09/29 v1.4h Standard LaTeX document class > (c:/texlive/2018/texmf-dist/tex/latex/base/size10.clo(load luc: > C:/texlive/2018 > /texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc))) > (c:/texlive/2018/texmf-dist/tex/luatex/lyluatex/lyluatex.sty > (c:/texlive/2018/texmf-dist/tex/luatex/luatexbase/luatexbase.sty > (c:/texlive/2018/texmf-dist/tex/luatex/ctablestack/ctablestack.sty)) > (c:/texlive/2018/texmf-dist/tex/latex/xkeyval/xkeyval.sty > (c:/texlive/2018/texmf-dist/tex/generic/xkeyval/xkeyval.tex > (c:/texlive/2018/texmf-dist/tex/generic/xkeyval/xkvutils.tex > (c:/texlive/2018/texmf-dist/tex/generic/xkeyval/keyval.tex > (c:/texlive/2018/texmf-dist/tex/latex/graphics/graphicx.sty > (c:/texlive/2018/texmf-dist/tex/latex/graphics/graphics.sty > (c:/texlive/2018/texmf-dist/tex/latex/graphics/trig.sty) > (c:/texlive/2018/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) > (c:/texlive/2018/texmf-dist/tex/latex/graphics-def/luatex.def))) > (c:/texlive/2018/texmf-dist/tex/latex/minibox/minibox.sty > (c:/texlive/2018/texmf-dist/tex/latex/l3kernel/expl3.sty > (c:/texlive/2018/texmf-dist/tex/latex/l3kernel/expl3-code.tex) > (c:/texlive/2018/texmf-dist/tex/latex/l3kernel/l3pdfmode.def))) > (c:/texlive/2018/texmf-dist/tex/latex/environ/environ.sty > (c:/texlive/2018/texmf-dist/tex/latex/trimspaces/trimspaces.sty)) > (c:/texlive/2018/texmf-dist/tex/latex/currfile/currfile.sty > (c:/texlive/2018/texmf-dist/tex/latex/oberdiek/kvoptions.sty > (c:/texlive/2018/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) > (c:/texlive/2018/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty > (c:/texlive/2018/texmf-dist/tex/generic/oberdiek/infwarerr.sty) > (c:/texlive/2018/texmf-dist/tex/generic/oberdiek/etexcmds.sty > (c:/texlive/2018/texmf-dist/tex/generic/oberdiek/ifluatex.sty > (c:/texlive/2018/texmf-dist/tex/latex/filehook/filehook.sty)) > (c:/texlive/2018/texmf-dist/tex/latex/pdfpages/pdfpages.sty > (c:/texlive/2018/texmf-dist/tex/latex/base/ifthen.sty) > (c:/texlive/2018/texmf-dist/tex/latex/tools/calc.sty) > (c:/texlive/2018/texmf-dist/tex/latex/eso-pic/eso-pic.sty > (c:/texlive/2018/texmf-dist/tex/generic/oberdiek/atbegshi.sty > (c:/texlive/2018/texmf-dist/tex/generic/oberdiek/ifpdf.sty)) > (c:/texlive/2018/texmf-dist/tex/latex/xcolor/xcolor.sty > (c:/texlive/2018/texmf-dist/tex/latex/graphics-cfg/color.cfg))) > (c:/texlive/2018/texmf-dist/tex/latex/pdfpages/ppluatex.def)) > (c:/texlive/2018/texmf-dist/tex/latex/metalogo/metalogo.sty > (c:/texlive/2018/texmf-dist/tex/generic/ifxetex/ifxetex.sty))) (./test.aux) > (c:/texlive/2018/texmf-dist/tex/context/base/mkii/supp-pdf.mkii > [Loading MPS to PDF converter (version 2006.09.02).] > ) (c:/texlive/2018/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty > (c:/texlive/2018/texmf-dist/tex/latex/oberdiek/grfext.sty > (c:/texlive/2018/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty)) > (c:/texlive/2018/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty) > (c:/texlive/2018/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg)) > (c:/texlive/2018/texmf-dist/tex/latex/oberdiek/pdflscape.sty > (c:/texlive/2018/texmf-dist/tex/latex/graphics/lscape.sty))(load luc: > C:/texliv > e/2018/texmf-var/luatex-cache/generic/fonts/otl/lmroman7-regular.luc)(load > luc: > > C:/texlive/2018/texmf-var/luatex-cache/generic/fonts/otl/lmsans10-regular.luc) > (load luc
Re: lyluatex: call for Fedora users
> On Mar 28, 2018, at 12:06 PM, Federico Bruniwrote: > > sh: all: command not found" That's the result of a bug in io.popen that was present in the version of LuaTeX which shipped with TeXLive 2017. The bug was fixed shortly after TL2017 was released so some other distros may have picked up the fix. The bug is not in TL2016 or the TL2018 pretest. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user