Re: Forcing custodes to be always placed at the right-hand margin?

2023-12-28 Thread Werner LEMBERG


> I wanted a more natural text spacing for some chant in modern
> notation I am typesetting, using the setting *ragged-right = ##t*.
> However, the custodes also moves along with the line, and I would
> like it to always be in the same place, at the right-hand margin.
> That is, custodes is always placed at the end of the line-width.

Such a mode between ragged-right and normal justification doesn't
exist in LilyPond.  Can you provide scans of some real-world examples
that show how you would actually like to format stuff?


Werner



Re: How to put a big number in the upper left or right corner of a score?

2023-12-28 Thread billhunker
On some projects,  I use this method:Make the number a rehearsal mark. In the 
layout block:\override Score.RehearsalMark.X-extent = ##f\override 
Score.RehearsalMark.Y-extent = ##f\override Score.RehearsalMark.X-offset= 
#?\override Score.RehearsalMark.Y-offset= #?Create a scheme music definition 
for each page (useful for slides) which includes the rehearsal mark. The 
result,  for me, is a number that prints on every page and immune from pushing 
around, or being pushed around by...other grobs.  Sorry, away from my computer 
now, can't send an actual example.  Sent from my Verizon, Samsung Galaxy 
smartphone
 Original message From: Michael Werner  
Date: 12/28/23  6:15 AM  (GMT-06:00) To: Kris Van Bruwaene  
Cc: lilypond-user@gnu.org Subject: Re: How to put a big number in the upper 
left or right corner of a score? Hi Kris,On Mon, Aug 28, 2023 at 4:44 AM Kris 
Van Bruwaene  wrote:(Lilypond version 2.24.1, Guile 2.2). 

What is the easiest way to put a big number (e.g. font size 4 bold)  
in the upper left or right corner of a score? In previous versions I 
used to manage this with a double header, one in \book and one in 
\score, and faking a second "poet" (left corner) or "composer" (right 
corner), but this does not seem to work any more, at least not the way 
it used to. Moreover it isn't a very "clean" solution. Something like a regular 
(but huge) page number would be better.If this is something you'll want on a 
regular basis I'd do a custom header. They're pretty simple to define - I've 
got one I use for a score version. I used to use either subtitle or 
subsubtitle, but ran into enough cases where I actually had need of both that I 
finally just defined my own header to use.  It goes into a \paper block, 
defined before the \header block where you want to use it. For the docs 
seehttps://lilypond.org/doc/v2.24/Documentation/notation/custom-titles-headers-and-footersThe
 part about defining your own is about half way down. The entry in the \paper 
block for this would be something like:bookTitleMarkup = \markup {   \sans {    
\override #'(baseline-skip . 3.5)    \column {      \fill-line { \null \null 
\fontsize #4 \bold \fromproperty #'header:bignumber }      \fill-line { 
\fromproperty #'header:dedication }      \override #'(baseline-skip . 3) % 
default 3.5      \column {        \fill-line {          \huge \larger \larger 
\bold          \fromproperty #'header:title        }        \fill-line {        
  \large \bold          \fromproperty #'header:subtitle        }        
\fill-line {          \smaller \bold          \fromproperty 
#'header:subsubtitle        }        \fill-line {          { \smaller 
\fromproperty #'header:poet }          { \bold \fromproperty 
#'header:myscoreversion }          { \smaller \fromproperty #'header:composer } 
       }        \fill-line {          { \smaller \fromproperty #'header:meter } 
         { \large \bold \fromproperty #'header:instrument }          { \smaller 
\fromproperty #'header:arranger }        }      }    }  }}In this case a new 
header field called bignumber is defined on the fifth line, placed at the very 
top of the header block, in the top right corner.  If you want it in the top 
left corner, change that line to:\fill-line { \fontsize #4 \bold \fromproperty 
#'header:bignumber \null \null }(BTW, Lilypond's default for this block is in 
titling-init.ly)  In this block you can adjust the order and placement of all 
the headers, not just your own custom ones. In this example, I've also added 
myscoreversion (the one I mentioned earlier), put it where the instrument 
header used to be, and moved instrument down a line centered between meter and 
arranger (a spot left blank in the default).To use your newly defined custom 
header, you set it just like any other header:\header {  title = "Title Goes 
Here"  bignumber = "42"  composer = "Written by Somebody"  subtitle = "Random 
subtitle"}Also, as this is now a defined header entry, it can be used just like 
any other header entry, such as in subsequent page headers:oddHeaderMarkup = 
\markup \sans {  \fill-line {    \unless \on-first-page    \fontsize #4 \bold 
\fromproperty #'header:bignumber    \unless \on-first-page    \fromproperty 
#'header:title    \unless \on-first-page    \fromproperty 
#'page:page-number-string  }}Granted, this all winds up being a fair sized 
chunk of code. But it's easy enough to just save it all off into an include 
file, where it's out of the way but accessible.-- Michael


Re: How to achieve minimum horizontal spacing between notes

2023-12-28 Thread Jiří Hon

After some trial and error, the simplest workaround was to override the stencil 
of NoteHead so it draws the missing ledger line. I conditionally set 
NoteHead.stencil to ly:text-interface::print and set NoteHead.text to custom 
markup function.

\override NoteHead.stencil =
#(lambda (grob)
   (let ((pos (ly:grob-property grob 'staff-position)))
 (begin
   (if (< pos -7) (display "ERROR: Lower brevis then expected\n") (display 
""))
   (if (<= pos -6) ly:text-interface::print ly:note-head::print

\override NoteHead.text =
  #(lambda (grob)
 (let ((pos (ly:grob-property grob 'staff-position)))
   #{\markup {
 \combine
\halign #-0.55 \raise #(if (= pos -6) 0 0.5) \override #'(thickness 
. 2) \draw-line #'(3.2 . 0)
\musicglyph "noteheads.sM1"
}#}))

It is very basic ledger line code that is valid only for staff positions -6 and 
-7, but this is all I need for the psalms.

Even though my question didn't get any attention, I hope this workaround might 
help someone in the future.

Many thanks to all the developers of LilyPond for creating such a highly 
customizable music engraving tool. I can't imagine creating this project 
without LilyPond.

Kind regards,
Jiri Hon


On 15. 12. 23 13:19, Jiří Hon wrote:

Dear LilyPond community,

I'm working on an web psalter https://www.zaltar.cz (in Czech language) with 
responsive music notation based on LilyPond. For example, take a look at 
https://www.zaltar.cz/OL1.html and try changing the width of the browser. The 
notation is pre-engraved at 9 different sizes and the correct size is 
automatically selected using CSS rules. The LilyPond code used to create the 
notation is linked at the bottom of each page.

In order to make the notation work at so many different sizes, I have used the 
excellent work of Thomas Morley 
(https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg2.html), Jean 
Abou Samra and Werner Lemberg 
(https://www.mail-archive.com/lilypond-user@gnu.org/msg149350.html). Thank you 
very much! Their code handles automatic wrapping of long breves and snapping 
syllables so that they appear as one text on each breve.

However, I would like to take musical notation even further. Right now, there's 
a lot of extra space behind the breve because of those invisible notes that are 
evenly spaced.

My question is: Is it possible to reduce the spacing between those invisible 
breves? I tried using \override NoteHead.X-extent = #'(0 . 0). This almost does 
what I want. The notes can overlap and the spacing is dictated by the text 
only, which is great for my purpose. However, there is serious drawback to 
this. The ledger lines stop working. This is understandable, since they need 
the X-extent of note heads to calculate the length. So, please, is there any 
other way to a achieve similar spacing, but without interfering with the ledger 
lines?

Below is some kind of MWE. I would like to achieve the same spacing as in the 
MWE, but with working ledger lines:

\version "2.24.0"

\header {
   tagline = ""
}

\paper {
   indent = 0\cm
   top-margin = 0\cm
   right-margin = 0\cm
   bottom-margin = 0\cm
   left-margin = 0\cm
   paper-width = 15\cm
   page-breaking = #ly:one-page-breaking
}

hideNotes = {
   % logic for hiding notes based on Thomas Morley's work
   % https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg2.html
}
unHideNotes = {
   % logic for hiding notes based on Thomas Morley's work
   % https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg2.html
}

squashNotes = {
   \override NoteHead.X-extent = #'(0 . 0)
}
unSquashNotes = {
   \revert NoteHead.X-extent
}

\score {
   <<
     \new Voice = "melody" {
   \cadenzaOn \key c \major \relative {
     c'\breve*1/16 \squashNotes \hideNotes \breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 
\bar "" \breve*1/16 \bar ""
     \breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 \bar "" 
\breve*1/16 \breve*1/16 \bar ""
     \unHideNotes \unSquashNotes \bar "" f8 e d d4 r \bar "|"
     d\breve*1/16 \squashNotes \hideNotes \breve*1/16 \breve*1/16 \bar "" 
\unHideNotes \unSquashNotes \bar ""
     g8[( f)] e e2 \bar "||" \break
   }
     }
     \new Lyrics \lyricsto "melody" {
   \lyricmode {
     \set stanza = "3."
     Bu -- deš-li u -- cho -- vá -- vat "v pa" -- mě -- ti vi -- ny, Ho -- 
spo -- di -- ne,
     Pa -- ne, kdo ob -- sto -- jí?
   }
     }
   >>
}

Thank you very much for your time and effort,
Jiri Hon




Re: How to put a big number in the upper left or right corner of a score?

2023-12-28 Thread Michael Werner
Hi Kris,

On Mon, Aug 28, 2023 at 4:44 AM Kris Van Bruwaene  wrote:

> (Lilypond version 2.24.1, Guile 2.2).
>
> What is the easiest way to put a big number (e.g. font size 4 bold)  in
> the upper left or right corner of a score? In previous versions I used to
> manage this with a double header, one in \book and one in \score, and
> faking a second "poet" (left corner) or "composer" (right corner), but this
> does not seem to work any more, at least not the way it used to. Moreover
> it isn't a very "clean" solution. Something like a regular (but huge) page
> number would be better.
>

If this is something you'll want on a regular basis I'd do a custom header.
They're pretty simple to define - I've got one I use for a score version. I
used to use either subtitle or subsubtitle, but ran into enough cases where
I actually had need of both that I finally just defined my own header to
use.  It goes into a \paper block, defined before the \header block where
you want to use it. For the docs see
https://lilypond.org/doc/v2.24/Documentation/notation/custom-titles-headers-and-footers
The part about defining your own is about half way down. The entry in the
\paper block for this would be something like:

bookTitleMarkup = \markup {
  \sans {
\override #'(baseline-skip . 3.5)
\column {
  \fill-line { \null \null \fontsize #4 \bold \fromproperty
#'header:bignumber }
  \fill-line { \fromproperty #'header:dedication }
  \override #'(baseline-skip . 3) % default 3.5
  \column {
\fill-line {
  \huge \larger \larger \bold
  \fromproperty #'header:title
}
\fill-line {
  \large \bold
  \fromproperty #'header:subtitle
}
\fill-line {
  \smaller \bold
  \fromproperty #'header:subsubtitle
}
\fill-line {
  { \smaller \fromproperty #'header:poet }
  { \bold \fromproperty #'header:myscoreversion }
  { \smaller \fromproperty #'header:composer }
}
\fill-line {
  { \smaller \fromproperty #'header:meter }
  { \large \bold \fromproperty #'header:instrument }
  { \smaller \fromproperty #'header:arranger }
}
  }
}
  }
}

In this case a new header field called bignumber is defined on the fifth
line, placed at the very top of the header block, in the top right corner.
If you want it in the top left corner, change that line to:
\fill-line { \fontsize #4 \bold \fromproperty #'header:bignumber \null
\null }
(BTW, Lilypond's default for this block is in titling-init.ly)  In this
block you can adjust the order and placement of all the headers, not just
your own custom ones. In this example, I've also added myscoreversion (the
one I mentioned earlier), put it where the instrument header used to be,
and moved instrument down a line centered between meter and arranger (a
spot left blank in the default).

To use your newly defined custom header, you set it just like any other
header:

\header {
  title = "Title Goes Here"
  bignumber = "42"
  composer = "Written by Somebody"
  subtitle = "Random subtitle"
}

Also, as this is now a defined header entry, it can be used just like any
other header entry, such as in subsequent page headers:

oddHeaderMarkup = \markup \sans {
  \fill-line {
\unless \on-first-page
\fontsize #4 \bold \fromproperty #'header:bignumber
\unless \on-first-page
\fromproperty #'header:title
\unless \on-first-page
\fromproperty #'page:page-number-string
  }
}

Granted, this all winds up being a fair sized chunk of code. But it's easy
enough to just save it all off into an include file, where it's out of the
way but accessible.
-- 
Michael


Re: Tweak Slur Position or Priority

2023-12-28 Thread Johannes Roeßler

*facepalm* - thank you!!
You've mistyped "positions" as "position" (hence the warning “cannot 
find the property type-check…”).





--
Diese E-Mail wurde von Avast-Antivirussoftware auf Viren geprüft.
www.avast.com

Re: Tweak Slur Position or Priority

2023-12-28 Thread Jean Abou Samra
You've mistyped "positions" as "position" (hence the warning “cannot find the
property type-check…”).



signature.asc
Description: This is a digitally signed message part


Re: How to put a big number in the upper left or right corner of a score?

2023-12-28 Thread Jean Abou Samra
Hi,


> Thank you Jean. I just now wanted to apply your tip, but it's not quite what 
> I expected. If I copy your script litterally, the number overlaps with the 
> \header (piece title, composer etc.). If I delete the \with-outline the 
> overlap is gone, but the number appears below the header, but I would like it 
> in the TOP corner, above the header. Is that possible?



Sorry for the very late reply. It's best to reply to the list also, this shares 
the burden of helping (I've added back in CC).

You could increase the distance from the top of the page to the header, as in, 
e.g.,

```
\version "2.24.2"

\paper {
  top-markup-spacing.minimum-distance = 10
}
\header {
  title = "ABC"
}
{ c' }
```


signature.asc
Description: This is a digitally signed message part


Tweak Slur Position or Priority

2023-12-28 Thread Johannes Roeßler

Hi Group and Merry Christmas :)

I do not find the right way to tweak the slur position here:

---8<--

\version "2.24.0"
{\relative {\tupletUp \tuplet 3/2 { as'2 b4 } \override Slur.position
=#'(5 . 5) \tuplet 3/2 { c4 (d e) } f\fermata}}

-->8---

I know I could avoid collision by putting the tuple brackets down - but
since I've got lyrics there, I prefer them up.
As you can see, I tried to raise the slur, but I guess it's "blocked"
under the bracket - is there a way to put the slur above the tuplet bracket?

Best regards
Johannes


--
Diese E-Mail wurde von Avast-Antivirussoftware auf Viren geprüft.
www.avast.com