Context question
Can someone please explain why the following won't work. I want get the current moment at the end of the music expression. Is this not a valid thing to do? Or perhaps I don't know how to specify the context. This code gives an unbound variable error. \version "2.22.2" \score { \relative c'' { \new Staff { a b c d #(display (ly:context-current-moment Staff)) } } } Thank you for any help. John
RE: Markup command in wrapped text
Thank you, Jean. I'm not sure where I got tripped up. Perhaps I need a brain transplant. John -Original Message- From: Jean Abou Samra Sent: Tuesday, May 31, 2022 4:43 PM To: John Schlomann ; lilypond-user@gnu.org Subject: Re: Markup command in wrapped text Le 31/05/2022 à 23:36, John Schlomann a écrit : > > How can I define a block of wordwrap (or justified) text that includes > commands such as \italic or \bold? I’ve done some searching and tried > various things, all to no avail. > Like this? \version "2.22.2" \markup \wordwrap { Lorem ipsum dolor sit amet, \bold consectetur \italic adipiscing elit. \bold \italic \larger Maecenas tempor neque non nunc sollicitudin, rhoncus egestas diam vehicula. Donec id cursus erat. Praesent placerat leo ac sem porttitor, eget lobortis libero tempus. Donec felis lacus, dapibus at vehicula id, hendrerit ac dolor. Nam semper dictum ipsum vitae tempor. Nam mollis nisi at lacinia egestas. Nulla a nisl volutpat, rhoncus tortor ac, tristique ex. Suspendisse suscipit turpis tortor, a rutrum sem egestas id. } What did you try exactly? Where did you look? I am interested to know what blocked you in the learning process, in the interest of improving the documentation. Best, Jean
RE: Markup command in wrapped text
Yes, that's very straightforward. And it works perfectly. What I'm actually doing is a markup embedded in some Scheme code. I'll take another look at that, and send actual code if I can't get it to work. I apologize for the noise. Thank you, David. John -Original Message- From: David Kastrup Sent: Tuesday, May 31, 2022 4:42 PM To: John Schlomann Cc: lilypond-user@gnu.org Subject: Re: Markup command in wrapped text "John Schlomann" writes: > How can I define a block of wordwrap (or justified) text that includes > commands such as \italic or \bold? I've done some searching and tried > various things, all to no avail. Huh. \markup \wordwrap { This is a text with \italic italic words in it and then I put some \bold bold in there as well and filled it up with a lot of nonsense words so that one can see it wraps. } That seems pretty straightforward to me. Can you show an example of what you tried to do instead? -- David Kastrup
Markup command in wrapped text
How can I define a block of wordwrap (or justified) text that includes commands such as \italic or \bold? I've done some searching and tried various things, all to no avail. Thank for any help, John
RE: Inputting music in parts
Paulo, It seems like what you have is the right approach. How much simpler could it be? AFAIK \alternative is only useful with \repeat volta. Of course, you'd leave off the backslashes when defining the variables. John -Original Message- From: lilypond-user [mailto:lilypond-user-bounces+jschlomann=wideopenwest@gnu.org] On Behalf Of Paulo Matos Sent: Thursday, January 6, 2022 2:36 PM To: lilypond-user@gnu.org Subject: Inputting music in parts Hi, I have some music I want to transcribe that has 2 parts: A and B the music goes: part A part B part A with special ending I could of course define variables like: \partA = \partAtransition = \partAending = \partB = and then write the music as \partA \partAtransition \partB \partA \partAending However, I would like to simplify the final score. What's the best way to write this? I saw repeats but that doesn't seem to be exactly what I need. However the partA with different endings sound like it could be where I could use \alternative, but unsure how to put it all together. Any suggestions? Thanks, -- Paulo Matos
RE: Accidental placement with simultaneous music
Thank you, Kevin and Brian. I should have checked Gould before I emailed the list, but I wasn't at home and didn't have access to it. John > -Original Message- > From: lilypond-user [mailto:lilypond-user- > bounces+jschlomann=wideopenwest@gnu.org] On Behalf Of Brian > Barker > Sent: Sunday, February 21, 2021 10:39 AM > To: lilypond-user@gnu.org > Subject: Re: Accidental placement with simultaneous music > > At 09:11 21/02/2021 -0600, John Schlomann wrote: > >I'm probably missing a simple fix for this. In the following example > >the natural sign on the f4 in the first voice is placed to the left > >of the a4 in the second voice. I can't seem to find a way to fix > >this. Or is this considered acceptable? > > Elaine Gould suggests this *is* correct: > "_Accidentals in double-stemmed writing_ > Place accidentals before both parts, except for altered unisons..." > (Behind Bars, p. 90) > > Brian Barker >
Accidental placement with simultaneous music
I'm probably missing a simple fix for this. In the following example the natural sign on the f4 in the first voice is placed to the left of the a4 in the second voice. I can't seem to find a way to fix this. Or is this considered acceptable? The other accidentals in the measure are correct. \version "2.20.0" \relative c' { \key d \major << { f4 g8 g8 a4 g4 } \\ { \set fontSize = #-3 a4 bes4 c8 bes8 a8 g8 } >> } Thank you for any advice. John
RE: Markup in scheme
Thank you, Martin and Harm. You gave me the understanding I needed. John > -Original Message- > From: Thomas Morley [mailto:thomasmorle...@gmail.com] > Sent: Saturday, October 31, 2020 1:47 PM > To: John Schlomann > Cc: lilypond-user > Subject: Re: Markup in scheme > > Am Sa., 31. Okt. 2020 um 16:30 Uhr schrieb John Schlomann > : > > > > In the following snippet, the first markup works fine. The second gives no > errors, but outputs nothing. > > > > > > > > Why does the scheme version not work? > > > > > > > > \version "2.20.0" > > > > \markup{"First markup"} > > > > #(markup #:line (#:simple "Second markup")) > > > > > > > > Thanks, > > > > John > > > > > > To have LilyPond do something with #(markup ...) you need to explain > to LilyPond _what_ to do with it". > > Martin's example embeds it in a music expression. -> Initiate a TextScript- > grob > > You can store and call it like: > foo = #(markup #:line (#:simple "Second markup")) > \foo > It is called at top level. -> Create top level text > > Directly and on top level you could do: > $(markup #:line (#:simple "Second markup")) > Directly evaluate the expression (here at top level). -> Create top level text > > HTH, > Harm
Markup in scheme
In the following snippet, the first markup works fine. The second gives no errors, but outputs nothing. Why does the scheme version not work? \version "2.20.0" \markup{"First markup"} #(markup #:line (#:simple "Second markup")) Thanks, John
RE: Scheme help request: How can else of an if-statement be made to do nothing?
Ah, thank you much. John > -Original Message- > From: Thomas Morley [mailto:thomasmorle...@gmail.com] > Sent: Saturday, October 17, 2020 3:14 PM > To: John Schlomann > Cc: David Kastrup; Jean Abou Samra; Matthew Fong; lilypond-user > Subject: Re: Scheme help request: How can else of an if-statement be made > to do nothing? > > Am Sa., 17. Okt. 2020 um 22:09 Uhr schrieb John Schlomann > : > > > > Harm, > > > > You used a function or macro called add-text. I can't seem to find it in any > LilyPond or Guile manual. What is that? > > > > John > > Hi John, > > you'll find it in lily-library.scm > > Cheers, > Harm
RE: Scheme help request: How can else of an if-statement be made to do nothing?
Harm, You used a function or macro called add-text. I can't seem to find it in any LilyPond or Guile manual. What is that? John > -Original Message- > From: lilypond-user [mailto:lilypond-user- > bounces+jschlomann=wideopenwest@gnu.org] On Behalf Of Thomas > Morley > Sent: Saturday, October 17, 2020 2:24 PM > To: David Kastrup > Cc: Jean Abou Samra; Matthew Fong; lilypond-user > Subject: Re: Scheme help request: How can else of an if-statement be made > to do nothing? > > Am Sa., 17. Okt. 2020 um 20:33 Uhr schrieb David Kastrup : > > > > Thomas Morley writes: > > > > > Am Sa., 17. Okt. 2020 um 19:39 Uhr schrieb Jean Abou Samra > : > > >> > > >> The point of interpret-markup is to turn a markup into a stencil, so I'd > > >> use empty-stencil: > > >> > > >> \version "2.20.0" > > >> > > >> #(define-markup-command (print-if-defined layout props sym text) > > >> (symbol? markup?) > > >>(if (defined? sym) > > >>(interpret-markup layout props > > >> #{ \markup \with-color #'(0.8 0.2 0.2) #text #}) > > >>empty-stencil)) > > >> > > >> symA = "Something" > > >> > > >> \markup { > > >>\print-if-defined #'symA "Text" > > >>\print-if-defined #'symB "More text" > > >> } > > >> > > > > > > An empty stencil will still be spaced (unless removed by other > > > markup-commands). > > > > empty-stencil will typically not trigger additional spacing. That's > > typically what distinguishes it from point-stencil . > > > > -- > > David Kastrup > > Well, I'd say it depends how that empty-stencil is consumed. See: > > \markup > \box > { \stencil #point-stencil \stencil #empty-stencil \stencil #point-stencil } > > Here I did something silly (of course there are warnings emitted) and > the output _is_ affected. > > Thus, the detailed use-case is important... > > Cheers, > Harm
RE: Strange error from define-syntax
define-macro works perfectly for me, even though the Guile manual seems to somewhat disparage its use. Thank you, David. John > -Original Message- > From: David Kastrup [mailto:d...@gnu.org] > Sent: Thursday, May 28, 2020 2:02 PM > To: John Schlomann > Cc: 'Lilypond-User Mailing List' > Subject: Re: Strange error from define-syntax > > "John Schlomann" writes: > > > Thank you, David, for your quick response. I'm not sure what you mean by > > "stick to macros". I thought define-syntax was the way to define a macro. > > What am I missing? > > define-macro and defmacro apparently. > > -- > David Kastrup
RE: Strange error from define-syntax
Thank you, David, for your quick response. I'm not sure what you mean by "stick to macros". I thought define-syntax was the way to define a macro. What am I missing? John > -Original Message- > From: David Kastrup [mailto:d...@gnu.org] > Sent: Thursday, May 28, 2020 11:54 AM > To: John Schlomann > Cc: 'Lilypond-User Mailing List' > Subject: Re: Strange error from define-syntax > > "John Schlomann" writes: > > > Dear Ponders & Schemers, > > > > > > > > I wanted to try creating a simple Scheme macro. I've never done this > before, > > so I may well be going about it all wrong, but the error I get doesn't make > > sense. > > > > > > > > Here is a minimal non-working example: > > > > > > > > \version "2.20.0" > > > > #(use-modules (ice-9 syncase)) > > > > > > > > #(define-syntax set-default > > > >(syntax-rules () > > > > ((set-default name value) > > > > (if (eqv? name 'UNDEF) name value) > > > >))) > > > > > > > > #(define some-setting 44) > > > > #(set-value some-setting 99) > > > > #(ly:message "some-setting = ~a\n" some-setting) > > > > > > > > This gives the error: > > > > Wrong number of arguments to # > (arg)>> > > > > > > > > Huh? I also tried define-syntax-rule, which came up unbound. Any insights > > into what I'm doing wrong would be welcome. > > syntax-case doesn't work in LilyPond since LilyPond defines \void as a > music function and the Guile 1.8 implementation of syntax-case falls > apart if 'void has a value. > > You are not doing anything wrong other than expecting syntax-case to > work. Stick to macros instead of define-syntax. Sorry for that. > > -- > David Kastrup
Strange error from define-syntax
Dear Ponders & Schemers, I wanted to try creating a simple Scheme macro. I've never done this before, so I may well be going about it all wrong, but the error I get doesn't make sense. Here is a minimal non-working example: \version "2.20.0" #(use-modules (ice-9 syncase)) #(define-syntax set-default (syntax-rules () ((set-default name value) (if (eqv? name 'UNDEF) name value) ))) #(define some-setting 44) #(set-value some-setting 99) #(ly:message "some-setting = ~a\n" some-setting) This gives the error: Wrong number of arguments to #> Huh? I also tried define-syntax-rule, which came up unbound. Any insights into what I'm doing wrong would be welcome. Thanks, John
RE: Getting started with Scheme
Paul, I'm a Windows 10 user. (I'm hoping to get my Linux system rebuilt one of these days.) I currently use LilyPond 2.20.0. My GUILE_LOAD_PATH is set the same as yours (C:\Program Files (x86)\LilyPond\usr\share\guile\1.8). It's defined under "user variables", if that matters. For most terminal window activities I use Git Bash, but for running Guile I actually prefer the built-in Windows cmd, which I get with the Windows key and then typing c m d. I always invoke Guile with lilypond scheme-sandbox It sounds like you’ve tried these very same things, and you say LilyPond itself is working OK. Have you tried starting Guile without passing it a file? That should bring up a guile prompt. (quit) will then exit Guile. I fear this is no help to you. I just wanted to share that it does work fine on Windows 10. Good luck. John > -Original Message- > From: lilypond-user [mailto:lilypond-user- > bounces+jschlomann=wideopenwest@gnu.org] On Behalf Of Ralf > Mattes > Sent: Saturday, May 23, 2020 5:53 AM > To: Kevin Barry > Cc: Lilypond-User Mailing List; Paul McKay > Subject: Re: Getting started with Scheme > > > First off: I'm not a windows user (if I can avoid it) but I would strongly > suggest > to use a real > terminal and _not_ cmd. The one from the Windows store is actually pretty > good (esp. when > compared to cmd). You can either download it for free from the app store or > from github > (https://github.com/microsoft/terminal/releases) - yes, that's right. Microsft > software > as an open-source download from github :-) > > Cheers, RalfD > > Am Samstag, 23. Mai 2020 12:37 CEST, Kevin Barry > schrieb: > > > Hi Paul, > > > > I'm sorry you haven't had the best experience with the scheme sandbox. > > Since development of LilyPond mostly takes place on Linux it's possible > > that Windows-related documentation can be neglected... > > > > On Sat, May 23, 2020 at 10:51:58AM +0100, Paul McKay wrote: > > > I have Frescobaldi 3.1.2 as well (in case that’s relevant). > > > > Well... yes you can use Frescobaldi/LilyPond as a sort of Guile IDE if > > you want. If you put a \version statement at the top of the file and > > start each scheme expression with a '#' then it should work. > > > > > When the documentation refers to ‘opening a terminal window’ I assume > this > > > means a command prompt of some kind. (If so, it would be good to use > this > > > terminology. Not many of us remember the VT52 emulators.) > > > > On Linux and MacOS systems the relevant apps are all still named some > > variation of terminal (terminal, gnome-terminal, terminal.app, iterm, > > terminator - you get the picture). I'll see about adding a clarification > > for Windows users to refer them to cmd. > > > > > My copy of windows doesn’t have a *Start* menu: so that’s another > > > instruction that is meaningless. > > > > OK. Is there a common way to accomplish the old Start -> Run -> type in > > the name of a program? > > > > > At which point I’m presented with an unresponsive terminal. I exit via > > > Ctrl-C. > > > > If there is another Windows user on the list who has this working > > hopefully they can chime in and we can update the documentation as > > necessary. > > > > > I would be grateful for any help to get this going: or a redirection > > > to a better environment. Is there a Scheme IDE? I’ve never seen > > > anything like a comment in Scheme code. I wonder is it a write-only > > > language, the way APL was. > > > > I don't know about Scheme IDEs. An internet search suggests DrScheme > > might be suitable, but I think most people on this list use their > > LilyPond environment for working with scheme. > > > > What happens if you try running the guile program on its own (not via > > lilypond scheme-sandbox)? > > > > Kevin > > > > > > -- > Ralf Mattes > > Hochschule für Musik Freiburg > Projektleitung HISinOne > Schwarzwaldstr. 141, D-79102 Freiburg > http://www.mh-freiburg.de > > >
RE: Running convert-ly on WIndows
Hi Michael, Thank you for your response. It appears to be working now. I added environment variables PYTHONPATH and PYTHONHOME. I'm not sure they're both needed. I might try removing PYTHONHOME. If either of these are described in the LilyPond doc I complete missed them. PYTHONPATH contains two paths: C:\Program Files (x86)\LilyPond\usr\bin C:\Program Files (x86)\LilyPond\usr\lib\Python2.4 PYTHONHOME contains only the first of those paths. Now on to converting several hundred .ly files, including a lot of Scheme code. Best regards, John > -Original Message- > From: Michael Gerdau [mailto:m...@qata.de] > Sent: Thursday, April 16, 2020 4:09 AM > To: John Schlomann; lilypond-user@gnu.org > Subject: Re: Running convert-ly on WIndows > > Hi John, > > I don't have this problem. > > > I've just installed 2.20.0 on Windows 10. I've been using 2.18.2. When I try > > to run convert-ly I get an error from line 61: > [snipped] > > Care to share more details on what you do exactly? > Exact command, where you invoke it etc. pp. > > Kind regards, > Michael > -- > Michael Gerdau email: m...@qata.de > GPG-keys available on request or at public keyserver
Running convert-ly on WIndows
Dear Ponders, I'm sure this has been addressed before, but I can't seem to find the answer. I've just installed 2.20.0 on Windows 10. I've been using 2.18.2. When I try to run convert-ly I get an error from line 61: Import lilylib as ly No module named lilylib Maybe I'm missing something in my environment? I don't recall having this problem previously, though it's been years since I upgraded from 2.16. Apologies if I'm missing something obvious. John
RE: Syllable count
I had been looking for something specific to lyrics, which is maybe why I didn't find it. This is exactly what I need. Thank you, Harm. John -Original Message- From: Thomas Morley [mailto:thomasmorle...@gmail.com] Sent: Monday, February 19, 2018 4:05 PM To: John Schlomann Cc: lilypond-user Subject: Re: Syllable count 2018-02-19 22:38 GMT+01:00 John Schlomann <jschlom...@wideopenwest.com>: > Dear LilyPond experts, > > > > Given a definition of some lyrics, such as > > > > lyr = \lyricmode { Here some lyr -- ics } > > > > Is there any way to get a count of the syllables, in this case 4? > > > > Thank you, > > John #(display-scheme-music (length (ly:music-property lyr 'elements))) HTH, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Syllable count
Dear LilyPond experts, Given a definition of some lyrics, such as lyr = \lyricmode { Here some lyr -- ics } Is there any way to get a count of the syllables, in this case 4? Thank you, John ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
RE: org babel and lilypond
I’m just curious, what would be the advantages of Org Babel over the LilyPond mode that comes with LilyPond? John From: lilypond-user [mailto:lilypond-user-bounces+jschlomann=wideopenwest@gnu.org] On Behalf Of Henrik Frisk Sent: Sunday, December 24, 2017 12:57 PM To: lilypond-user@gnu.org Subject: org babel and lilypond Hi, Today I tried to get ob-lilypond (Org Babel) to work on my OSX system and a recent versin of emacs. Anmyone using it here? I would love to get it to work. Best, Henrik ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
RE: Problem with conditionals in \layout
Thank you, David. I still get an error, though a different one. Is my understanding correct that I need to upgrade to 2.19 for this to work? John > -Original Message- > From: David Kastrup [mailto:d...@gnu.org] > Sent: Saturday, December 02, 2017 2:55 AM > To: Carl Sorensen > Cc: John Schlomann; lilypond-user@gnu.org > Subject: Re: Problem with conditionals in \layout > > Carl Sorensen <c_soren...@byu.edu> writes: > > > From: John Schlomann <jschlom...@wideopenwest.com> > > Date: Friday, December 1, 2017 at 1:02 PM > > To: <lilypond-user@gnu.org> > > Subject: Problem with conditionals in layout > > > > I’m have a problem including conditionals in a \layout block. The following > code results in error, “syntax error, unexpected OUTPUT_DEF_IDENTIFIER”. > > > > The problem is that you are nesting layout blocks with this code, > > which is not allowed. > > The problem rather is that the layout blocks are defined by copying > $defaultlayout at the time he makes his definitions. It would make more > sense to define this kind of stuff with define-scheme-function, like > > > According to the Notation Reference 4.2.1 you can have multiple layout > > blocks as top-level expressions, and they will all apply. So move > > your variables \conditional* above the \score{} block: > > > > > > \version "2.18.2" > > > > > > > > #(define conditionalTimeSignature > > > > (if #t > > > >#{ > > > > \layout { \context { \Staff \remove "Time_signature_engraver" } } > > > >#} > > > > ) > > > > ) > > conditionalTimeSignature = > (define-scheme-function (layout location) () > (if #t > #{ \layout \context { \Staff \remove "Time_signature_engraver" } #})) > > Though it probably can be called at top level only in some 2.19 version. At > any rate, calling \layout { ... } will derive from the current layout > definition, so > if you use that, you have to store it in some kind of function in order to > have > it executed only at the time of use. > > -- > David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
RE: Problem with conditionals in \layout
I had tried that previously, and again just now just to be sure. I still get the same error. I simply moved the two lines \conditionalTimeSignature \conditionalBarNumbers to just above the \score block. Removing the ‘if’ statements works fine, but of course that defeats the purpose of this code. Am I still doing something wrong here? From: Carl Sorensen [mailto:c_soren...@byu.edu] Sent: Friday, December 01, 2017 5:32 PM To: John Schlomann; lilypond-user@gnu.org Subject: Re: Problem with conditionals in \layout From: John Schlomann <jschlom...@wideopenwest.com> Date: Friday, December 1, 2017 at 1:02 PM To: <lilypond-user@gnu.org> Subject: Problem with conditionals in layout I’m have a problem including conditionals in a \layout block. The following code results in error, “syntax error, unexpected OUTPUT_DEF_IDENTIFIER”. The problem is that you are nesting layout blocks with this code, which is not allowed. According to the Notation Reference 4.2.1 you can have multiple layout blocks as top-level expressions, and they will all apply. So move your variables \conditional* above the \score{} block: \version "2.18.2" #(define conditionalTimeSignature (if #t #{ \layout { \context { \Staff \remove "Time_signature_engraver" } } #} ) ) #(define conditionalBarNumbers (if #t #{ \layout { \context { \Score \remove "Bar_number_engraver" } } #} ) ) \conditionalTimeSignature \conditionalBarNumbers \score { { c' e' g' c'' } } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Problem with conditionals in \layout
I'm have a problem including conditionals in a \layout block. The following code results in error, "syntax error, unexpected OUTPUT_DEF_IDENTIFIER". \version "2.18.2" #(define conditionalTimeSignature (if #t #{ \layout { \context { \Staff \remove "Time_signature_engraver" } } #} ) ) #(define conditionalBarNumbers (if #t #{ \layout { \context { \Score \remove "Bar_number_engraver" } } #} ) ) \score { { c' e' g' c'' } \layout { \conditionalTimeSignature \conditionalBarNumbers } } If I remove either of the lines from \layout, it compiles without error and functions as expected. I've tried a number of variations, including putting the two lines outside the \score block. I either get compile errors or no errors but code that appears to do nothing. Any advice? Thank you. John ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
RE: Counter in a repeat
Hmmm. Maybe I looked right past the simple solution. Wouldn't be the first time. Thanks, I'll try this. John > -Original Message- > From: David Kastrup [mailto:d...@gnu.org] > Sent: Friday, July 28, 2017 4:26 PM > To: John Schlomann > Cc: lilypond-user@gnu.org > Subject: Re: Counter in a repeat > > "John Schlomann" <jschlom...@wideopenwest.com> writes: > > > David, > > Your response doesn't give me hope for a simple solution. > > Oh come on. > > stanza = \relative { ... } > > { > \keepWithTag first \stanzaI > \keepWithTag second \stanzaI > \keepWithTag third \stanzaI > } > > Just because \repeat unfold does not work in this case does not mean that > there are no simple ways for repeating stuff. > > -- > David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
RE: Counter in a repeat
David, Your response doesn't give me hope for a simple solution. But then I didn't start out with a lot of hope. I'm not sure I completely understand your last comment. I'm wondering if some sort of preprocessor would work for this. I keep the tunes in separate files, and \include them into the main .ly file containing the lyrics and some other stuff. Right now I manually make copies of the tune, one for each stanza. Because I do a lot of these, automating the process would be helpful. I'm sure I could make a preprocessor, perhaps with Perl or something, that could run before LilyPond runs, making multiple copies of the tune into a temporary file. Ideally, though I would prefer to run it at the point where I include the tune, because the main file computes the repeat count needed. And there would be some things to be careful of, such as partials that shouldn't be repeated, but these wouldn't be insurmountable. I'm not a Schemer, so my knowledge there is limited, but I see Scheme has a 'system' procedure. It seems to work in the scheme-sandbox. Would this work from within LilyPond I wonder? I may pursue that, or am I barking up the wrong tree entirely, and there is some other, better way to do this? I'm not ready to give up on this yet. The reason for this, BTW, is to project hymns on a screen, where every stanza is accompanied by its own melody line. When I have divisi lyrics (different syllable counts in different verses), I'd rather not use the dashed ties and slurs on the screen. That's more suited to the print version. John > -Original Message- > From: David Kastrup [mailto:d...@gnu.org] > Sent: Friday, July 28, 2017 12:04 PM > To: John Schlomann > Cc: lilypond-user@gnu.org > Subject: Re: Counter in a repeat > > "John Schlomann" <jschlom...@wideopenwest.com> writes: > > > Hello Everyone, > > I'd like to maintain a counter that can track the current number of > > passes through a repeat, something like this: > > > > \version "2.18.2" > > rpt-number = 0 % Initialize the counter > > { > > \repeat unfold 3 { > > #(set! rpt-number (1+ rpt-number)) % Increment the counter > > c'4 e'4 g'4 c''4 > > } > > } > > > > Is there any way to do such a thing? My purpose, which is not apparent > > here, is to use the counter to build symbols used with tags, so that I > > can select different tagged parts as the repeat unfolds. In my case, > > the content of the repeat would essentially be an entire hymn stanza. > > Tags are expanded at the level of music expressions but if you take a look at > the actual music code produced by \repeat unfold, you'll see that it only > contains the respective music expression once. That's what I suspected. > > I'm always amazed at the power and elegance of LilyPond, but this may > > be asking for something it wasn't designed for. > > You want to use frontend tools on backend results. That is not going to work > unless you try _simulating_ in the frontend what is supposed to be done in > the backend. However, that is likely to lead to subtly differing results. > -- > David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Counter in a repeat
Hello Everyone, I'd like to maintain a counter that can track the current number of passes through a repeat, something like this: \version "2.18.2" rpt-number = 0 % Initialize the counter { \repeat unfold 3 { #(set! rpt-number (1+ rpt-number)) % Increment the counter c'4 e'4 g'4 c''4 } } Is there any way to do such a thing? My purpose, which is not apparent here, is to use the counter to build symbols used with tags, so that I can select different tagged parts as the repeat unfolds. In my case, the content of the repeat would essentially be an entire hymn stanza. As this code stands, the counter is incremented once, and that value (1), will be used throughout all repeats. I'm always amazed at the power and elegance of LilyPond, but this may be asking for something it wasn't designed for. Thank you for any help. John ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Grouping lyrics stanzas in scheme
Given two are more stanzas of lyrics, such as verseA = \lyricmode { First verse } verseB = \lyricmode { Second verse } I need to do the following statement in scheme: fullLyrics = { verseA verseB } This statement seems to work as written. However, I need to do it programmatically in scheme as part of a template. I don't know the number of stanzas ahead of time. Is there a way of doing this? I am not seeing it. John ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user