Re: Setting the emoji font
> I want to use emoji within markup, and I can see in the output log > that Lilypond can't find a character in its default emoji font > (Symbola). I can't figure out how to override the default font. LilyPond does *not* have a default emoji font! It is Pango and FontConfig which choose the font. Emojis are an especially nasty thing to select. Or to be more precise, you actually can't select them at all within LilyPond, since any setting of a font for an Emoji character is completely ignored. This is due to a Pango problem: https://gitlab.gnome.org/GNOME/pango/-/issues/289 It is necessary to modify the FontConfig setup files (usually in `/etc/fonts/conf.d` or something similarly named) to enforce a certain Emoji font. BTW, I can reproduce your problem, and it is due to `Symbola.ttf` being buggy: (Almost) all of its glyph names are empty – this is technically valid[*] but doesn't work for us: Contrary to many applications, LilyPond selects a glyph by its name if such a name is available. Since this font effectively lies to the application, i.e., providing incorrect glyph names, it fails. Fortunately, it's easy to fix: https://gitlab.com/lilypond/lilypond/-/merge_requests/2235 Werner [*] For TrueType fonts it is normally expected to access glyphs by character code only; glyph names are considered a bonus information.
Re: Grandstaff multi-bar rest count shared between staves
On Wed, 17 Jan 2024 at 15:42, Martin Brown wrote: > To answer my own question, I've fudged this with: > \omit MultiMeasureRestNumber at the start of the bass line > \override MultiMeasureRestNumber.Y-offset = -5 at the start of the > treble line > but that seems a bit fragile. Eg. if the staves need to be separated more. > Any other solutions? > > Cheers, > Martin > > On Tue, 16 Jan 2024 at 14:05, Martin Brown > wrote: > >> Where two-stave scores (eg. piano) have multiple bars rest in common >> between the treble and bass parts, the number of bars rest should be placed >> once, in between the two staves, not separately on each stave. How can I >> achieve this in Lilypond? By default, it seems to treat each stave's rest >> count separately, placing the number above the multi-bar rest symbol on >> each stave. >> >> Thanks, >> Martin >> > I’ve managed to move the multimeasure rest numbers into the PianoStaff context with this code. Next (too hard for me) would be: - place the transparent MMrest in the center of the whole PianoStaff - place the MMrest number on top of this MMrest \version "2.24.2" \score { \new PianoStaff << \new Staff \compressMMRests { c''1 R1*5 g1 f1 } \new Staff \compressMMRests { \clef bass c1 R1*5 c'1 d'1 } >> \layout { \context { \Voice \override MultiMeasureRestNumber.transparent = ##t \override MultiMeasureRest.transparent = ##f \override MultiMeasureRest.direction = #CENTER } \context { \PianoStaff \consists Multi_measure_rest_engraver \override MultiMeasureRest.transparent = ##t % comment this out to place MM rests \override MultiMeasureRestNumber.parent-alignment-Y = #CENTER % this is not the solution } } } %% Vaughan
Re: Grandstaff multi-bar rest count shared between staves
On Wed, 17 Jan 2024, Martin Brown wrote: > To answer my own question, I've fudged this with: > \omit MultiMeasureRestNumber at the start of the bass line > \override MultiMeasureRestNumber.Y-offset = -5 at the start of the > treble line > but that seems a bit fragile. Eg. if the staves need to be separated more. > Any other solutions? Although still not a perfect solution, you may be able to make it less fragile by putting a Dynamics context between the two staves, adding the multi-measure rest engraver to that, and then hiding the actual rests there, to only show the numbers. I still have to add an offset adjustment to make this look decent, but I think the offset adjustment shouldn't change with the height of the things in the staves. The height of other things in the Dynamics context, if any, will be less variable. There are probably more elegant ways to do the overriding, such as defining a new context just for this purpose instead of modifying "Dynamics." But this is what I got from a quick experiment. \new PianoStaff << \new Staff { \omit MultiMeasureRestNumber \clef treble \compressMMRests { 1 | R1*10 | 1 | } } \new Dynamics { \hide MultiMeasureRest \override MultiMeasureRestNumber.Y-offset = -1 \compressMMRests { s1 | R1*10 | s1 | } } \new Staff { \omit MultiMeasureRestNumber \clef bass \compressMMRests { g1 | R1*10 | g1 | } } >> \layout { \context { \Dynamics \consists Multi_measure_rest_engraver } } -- Matthew Skala msk...@ansuz.sooke.bc.ca People before tribes. https://ansuz.sooke.bc.ca/
Bracket to indicate organ manual changes
Hi, I've been trying to make a bracket to indicate a change of manuals for an organ piece, and have succeeded in getting Lilypond to generate what I want (code below) for a particular instance. However, I have three questions: 1) Why does this particular format work? I'm not understanding why removing the tweak from manualBracketUpper, for example, makes the bracket not cross-staff. 2) How do I set Arpeggio.positions to be relative to the staves? I tried to insert a let function to define the position pair but did not do it properly. 3) Is it possible to create this bracket in a single context and have it ignore staff collisions? I tried drawing a bracket to go in the Dynamics context, but everything I tried maintained avoiding collisions. I have an extremely basic knowledge of Scheme but am happy to learn more. Thank you! -David --- manualChange = #(define-music-function (spacer text) (ly:music? markup?) #{ #spacer -\markup { \hspace #-5 \normal-text \fontsize #-1 #text } #}) manualBracketUpper = #(define-music-function (note) (ly:music?) #{ #note -\tweak Arpeggio.positions #'(0 . 0) \arpeggio #}) manualBracketLower = #(define-music-function (note) (ly:music?) #{ \override PianoStaff.Arpeggio.positions = #'(-13 . 3) #note \arpeggio #}) \new PianoStaff << \set PianoStaff.connectArpeggios = ##t \override PianoStaff.Arpeggio.stencil = #ly:arpeggio::brew-chord-bracket \new Staff { \manualBracketUpper c''4 } \new Dynamics { \manualChange 8 "Ch." } \new Staff { \manualBracketLower c'4 } >> ---
Re: Grandstaff multi-bar rest count shared between staves
To answer my own question, I've fudged this with: \omit MultiMeasureRestNumber at the start of the bass line \override MultiMeasureRestNumber.Y-offset = -5 at the start of the treble line but that seems a bit fragile. Eg. if the staves need to be separated more. Any other solutions? Cheers, Martin On Tue, 16 Jan 2024 at 14:05, Martin Brown wrote: > Where two-stave scores (eg. piano) have multiple bars rest in common > between the treble and bass parts, the number of bars rest should be placed > once, in between the two staves, not separately on each stave. How can I > achieve this in Lilypond? By default, it seems to treat each stave's rest > count separately, placing the number above the multi-bar rest symbol on > each stave. > > Thanks, > Martin >
Re: Can I define custom bar lengths in LilyPond?
Thank you so much for your answer. I was talking about the dimensional width of a bar. The situation in my "fat" bar is complicated, because one singer in a recit enters while the other one is on her last note. So I had the problem of accommodating the lyrics and moving them around, so they are well aligned on the sheet. And because with LilyPond's standard behaviour there still was not enough space, I inserted a line break after the "fat" bar. That way I have forced LilyPond to only put two bars in the line instead of three. The result looks OK, but I hope there is a much more elegant way to achieve this. Here is the code snippet (hope this is enough for evaluation): ... c4 ( h8.\trill ) c16 << { r8 \clef bass \tempo "Recitativo" \stemDown \autoBeamOff \once \override TextScript.padding = #1.7 g,8^\markup { "Basso" }_\markup \fontsize #1.5 { \halign #-0.9 "Auch indem" } g e \break} \\ { \once \override TextScript.padding = #1.7 c''2_\markup \fontsize #1.5 { \halign #-0.7 "Stamm!" } } >> \appoggiatura d,,8 cis4 ... I also attach a screenshot. Thank you also for mentioning the \newSpacingSection command, which I did not know. I have looked in the documentation, but the example there is about a different time signature again. In my example it does not change, and I wonder how I can take advantage of the command. SpacingSpanner? uniform-stretching? But how exactly? For my LilyPond knowledge at the moment this goes too deep under the hood... Am Dienstag, dem 16.01.2024 um 09:50 -0800 schrieb Aaron Hill via LilyPond user discussion: > On 2024-01-16 8:06 am, Hajo Baess wrote: > > Hello LilyPond users, > > > > I wonder if there is a possibility to define a custom bar length, > > thus > > for once cancelling LilyPond's automatic insertion of bar lines. > > > > I have a complicated measure here with quite a bit of markup to > > accommodate in one bar. I have worked out a solution which is maybe > > good enough, but it contains lots of tweaks in order to squeeze > > everything into the automatically assigned bar length. > > > > If I could define my own bar lengths, I would get more space in the > > bar, so I hope at least. My search in the documentation did not > > yield a > > result for me, but maybe I did not look in the right places. > > > > Hopefully someone here can troubleshoot me. > > Any help is much appreciated. > > I suspect we are going to need more information as there are at least > two interpretations of "length" here. > > This is why we highly recommend including MWEs (minimum working > examples) with questions, as this gives us a common starting point > without having to make potentially derailing guesses. > > > > Length interpretation one: Metrical length (i.e. number of beats in a > bar) > > If you need to momentarily step away from the defined time signature, > the easiest option I find is to use a cadenza--a section of music > that > is not bound by the time signature. Begin the section with > \cadenzaOn, > cram whatever notes you want, and then end the section with > \cadenzaOff > to resume the original time signature. > > NOTE: LilyPond will not attempt to subdivide a cadenza on its own for > the purposes of line breaking. You can of course provide hints using > \bar "" as needed. > > For more information, see: NR 1.2.3 - Displaying Rhythms; Unmetered > Music > https://lilypond.org/doc/v2.24/Documentation/notation/displaying-rhythms#unmetered-music > > > > Length interpretation two: Dimensional width (i.e. physical space on > the > paper) > > LilyPond's spacing engine tries to keep things unified across the > music, > so notes should look consistently spaced throughout the piece. You > can > define a new "spacing section" within your score with the aptly named > \newSpacingSection command. Each use of this command will break up > the > larger score into chunks that the spacing engine will handle > independently. There are several context properties that affect note > spacing, and these can be adjusted within each spacing section as > desired. > > For your scenario of a measure that just needs to be wider than > everyone > else, you would at a minimum need to start a new spacing section > coming > into the measure and then start yet another section for the > subsequent > measure--a total of three sections: one before, one for the "fat" > measure, and one after. > > For more information, see: NR 4.5.2 - New Spacing Section > https://lilypond.org/doc/v2.24/Documentation/notation/new-spacing-section > > > > If you are talking about something else entirely, please see about > providing a brief example of what you have tried. > > > -- Aaron Hill >
Re: Including input files via command line
Actually the second solution (passing a variable via Scheme) works great! Basically I have multiple template files to render a score in different ways (paper sizes, etc) and this way I can use the same base file to generate PDFs using the different templates without editing the base file every time. And you're right--I did go over that page in the manual, but that part must have escaped me. Thanks for your help. Benjamin Ѫѯ 2024-01-16 Ѩё 12:39, Aaron Hill ѮѴё: > On 2024-01-16 10:12 am, Benjamin Bruce wrote: >> Is there a way to compile multiple input files into one output file via >> the command line? Currently I am using \include, but I would like to be >> able to choose the included file on the fly without editing the main >> file. > > If I recall correctly, LilyPond will process each source file included > on the command-line individually. You could use the shell to > concatenate all your sources together and pass them via standard input. > (Pass the filename "-" to LilyPond to instruct it to read from STDIN.) > > >> Another thought I had was maybe there is a way to pass a value to the >> .ly file via the command line and use Scheme to choose the appropriate >> file to import based on that value. But that may be even more >> far-fetched. > > You could do this, but my Spidey-Sense™ tingles and suggests this may be > an XY problem. But I simply do not have enough information about what > you are needing to accomplish. > > But for reference: > > lilypond -e '(define-public a 42)' > > Then within your .ly source, you'll need to bring in the guile-user > module: > > > #(use-modules (guile-user)) > > %% The variable `a` should now be in scope. > > > > > NOTE: All of the above is documented in the first sections of the Usage > manual. > https://lilypond.org/doc/v2.24/Documentation/usage/command_002dline-usage > > > -- Aaron Hill
Re: Setting the emoji font
Trying with your example doesn't work. I neglected to mentioned the actual error messages, which might not actually mean what I had thought them to mean. programming error: Glyph has no name, but font supports glyph naming. Skipping glyph U+1FFC, file /usr/share/fonts/gdouros-symbola/Symbola.ttf continuing, cross fingers (and so on.) The character code doesn't actually correspond to any emoji... ? I've verified that I do have the necessary fonts, and Lilypond does recognize them. Weirdly, this doesn't happen with all emoji (☕ renders, but with the wrong font). On 16/01/2024 20:26, Aaron Hill wrote: On 2024-01-16 9:12 am, YTG 1234 wrote: I want to use emoji within markup, and I can see in the output log that Lilypond can't find a character in its default emoji font (Symbola). I can't figure out how to override the default font. %%% \markup { "" %% This character isn't be found } %%% I saw an old thread recommending to use \override #'(font-name . "..."), but that doesn't seem to work in modern versions (I'm on 2.25.11). Overriding the serif font doesn't work either, as I don't think Lilypond tries it at all. Cannot reproduce locally running either 2.22.0 or 2.25.11. \version "2.22.0" \markup { } \markup \override #'(font-name . "DejaVu Sans") { } \markup \override #'(font-name . "Segoe UI Emoji") { } This probably has less to do with LilyPond and nearly everything to do with FontConfig and what fonts are installed and accessible. At the very least, the markup \override command has not changed behavior, as far as I can tell. And what works on my machine is largely irrelevant to what you'll need to do on your system. Things to check: Run LilyPond with the -dshow-available-fonts option and grep the output to ensure the font in question appears. If it does not, then something may be screwy with FontConfig. If the font does appear, then make sure you input the name fully with the font-name override. Some fonts include as part of their family name what appears to be a style, and this has been known to cause problems. Adding a trailing comma seems to help, e.g. use "Times New Roman," instead of "Times New Roman". -- Aaron Hill
Re: Including input files via command line
On 2024-01-16 10:12 am, Benjamin Bruce wrote: Is there a way to compile multiple input files into one output file via the command line? Currently I am using \include, but I would like to be able to choose the included file on the fly without editing the main file. If I recall correctly, LilyPond will process each source file included on the command-line individually. You could use the shell to concatenate all your sources together and pass them via standard input. (Pass the filename "-" to LilyPond to instruct it to read from STDIN.) Another thought I had was maybe there is a way to pass a value to the .ly file via the command line and use Scheme to choose the appropriate file to import based on that value. But that may be even more far-fetched. You could do this, but my Spidey-Sense™ tingles and suggests this may be an XY problem. But I simply do not have enough information about what you are needing to accomplish. But for reference: lilypond -e '(define-public a 42)' Then within your .ly source, you'll need to bring in the guile-user module: #(use-modules (guile-user)) %% The variable `a` should now be in scope. NOTE: All of the above is documented in the first sections of the Usage manual. https://lilypond.org/doc/v2.24/Documentation/usage/command_002dline-usage -- Aaron Hill
Re: Setting the emoji font
On 2024-01-16 9:12 am, YTG 1234 wrote: I want to use emoji within markup, and I can see in the output log that Lilypond can't find a character in its default emoji font (Symbola). I can't figure out how to override the default font. %%% \markup { "" %% This character isn't be found } %%% I saw an old thread recommending to use \override #'(font-name . "..."), but that doesn't seem to work in modern versions (I'm on 2.25.11). Overriding the serif font doesn't work either, as I don't think Lilypond tries it at all. Cannot reproduce locally running either 2.22.0 or 2.25.11. \version "2.22.0" \markup { } \markup \override #'(font-name . "DejaVu Sans") { } \markup \override #'(font-name . "Segoe UI Emoji") { } This probably has less to do with LilyPond and nearly everything to do with FontConfig and what fonts are installed and accessible. At the very least, the markup \override command has not changed behavior, as far as I can tell. And what works on my machine is largely irrelevant to what you'll need to do on your system. Things to check: Run LilyPond with the -dshow-available-fonts option and grep the output to ensure the font in question appears. If it does not, then something may be screwy with FontConfig. If the font does appear, then make sure you input the name fully with the font-name override. Some fonts include as part of their family name what appears to be a style, and this has been known to cause problems. Adding a trailing comma seems to help, e.g. use "Times New Roman," instead of "Times New Roman". -- Aaron Hill
Including input files via command line
Is there a way to compile multiple input files into one output file via the command line? Currently I am using \include, but I would like to be able to choose the included file on the fly without editing the main file. Another thought I had was maybe there is a way to pass a value to the .ly file via the command line and use Scheme to choose the appropriate file to import based on that value. But that may be even more far-fetched. Thanks for your help!
Re: Can I define custom bar lengths in LilyPond?
On 2024-01-16 8:06 am, Hajo Baess wrote: Hello LilyPond users, I wonder if there is a possibility to define a custom bar length, thus for once cancelling LilyPond's automatic insertion of bar lines. I have a complicated measure here with quite a bit of markup to accommodate in one bar. I have worked out a solution which is maybe good enough, but it contains lots of tweaks in order to squeeze everything into the automatically assigned bar length. If I could define my own bar lengths, I would get more space in the bar, so I hope at least. My search in the documentation did not yield a result for me, but maybe I did not look in the right places. Hopefully someone here can troubleshoot me. Any help is much appreciated. I suspect we are going to need more information as there are at least two interpretations of "length" here. This is why we highly recommend including MWEs (minimum working examples) with questions, as this gives us a common starting point without having to make potentially derailing guesses. Length interpretation one: Metrical length (i.e. number of beats in a bar) If you need to momentarily step away from the defined time signature, the easiest option I find is to use a cadenza--a section of music that is not bound by the time signature. Begin the section with \cadenzaOn, cram whatever notes you want, and then end the section with \cadenzaOff to resume the original time signature. NOTE: LilyPond will not attempt to subdivide a cadenza on its own for the purposes of line breaking. You can of course provide hints using \bar "" as needed. For more information, see: NR 1.2.3 - Displaying Rhythms; Unmetered Music https://lilypond.org/doc/v2.24/Documentation/notation/displaying-rhythms#unmetered-music Length interpretation two: Dimensional width (i.e. physical space on the paper) LilyPond's spacing engine tries to keep things unified across the music, so notes should look consistently spaced throughout the piece. You can define a new "spacing section" within your score with the aptly named \newSpacingSection command. Each use of this command will break up the larger score into chunks that the spacing engine will handle independently. There are several context properties that affect note spacing, and these can be adjusted within each spacing section as desired. For your scenario of a measure that just needs to be wider than everyone else, you would at a minimum need to start a new spacing section coming into the measure and then start yet another section for the subsequent measure--a total of three sections: one before, one for the "fat" measure, and one after. For more information, see: NR 4.5.2 - New Spacing Section https://lilypond.org/doc/v2.24/Documentation/notation/new-spacing-section If you are talking about something else entirely, please see about providing a brief example of what you have tried. -- Aaron Hill
Setting the emoji font
I want to use emoji within markup, and I can see in the output log that Lilypond can't find a character in its default emoji font (Symbola). I can't figure out how to override the default font. %%% \markup { "" %% This character isn't be found } %%% I saw an old thread recommending to use \override #'(font-name . "..."), but that doesn't seem to work in modern versions (I'm on 2.25.11). Overriding the serif font doesn't work either, as I don't think Lilypond tries it at all.
Can I define custom bar lengths in LilyPond?
Hello LilyPond users, I wonder if there is a possibility to define a custom bar length, thus for once cancelling LilyPond's automatic insertion of bar lines. I have a complicated measure here with quite a bit of markup to accommodate in one bar. I have worked out a solution which is maybe good enough, but it contains lots of tweaks in order to squeeze everything into the automatically assigned bar length. If I could define my own bar lengths, I would get more space in the bar, so I hope at least. My search in the documentation did not yield a result for me, but maybe I did not look in the right places. Hopefully someone here can troubleshoot me. Any help is much appreciated.
Re: Error/warning when creating a piano reduction with lilypond 2.25.7 and frescobaldi 3.3.0
On Mon, Jan 15, 2024 at 10:57 AM Hans Aikema wrote: > > I've created an issue for Frescobaldi and I should be able to start work > on it today. > > https://github.com/frescobaldi/frescobaldi/issues/172 > > > Knute, you've missed a digit while copying the link and without doubt > intended to refer to > https://github.com/frescobaldi/frescobaldi/issues/1728 > Thanks! The Issue is now fixed in the repository.