Re: How to align second repeat verse against second voice

2024-02-26 Thread Jiří Hon

Hi Andy,

Aaron has already answered your question, but I'd like to suggest one more 
adjustment. Reading the rhythm would be easier if you replaced two of the 
dotted quarter notes with an eighth note tied to the following quarter note. 
Here is the modified code:

\version "2.18.2"

\paper {
  #(set-paper-size "letter")
}

\score {
  <<
\new ChoirStaff {
  <<
\new Staff {
  <<
\key c \major
\time 4/4
\new Voice = "first" {
  \relative c' {
\partial 4
c8 c
\repeat volta 2 {
  a b8~ b4 r4 a8 c
  << % maybe there is a better way?
{ \voiceOne c4. d8 d8. }
\new Voice = "second" {
  \voiceTwo \tiny c4 c8 d8 \normalsize }
  >> \oneVoice e16 f8 c
  a c4 c8~ c4 d8 e
}
\alternative {
  { f4 r2 c8 c }
  { f2( d4) c8 c }
}
f1 \bar "|."
  }
}
  >>
}
\new Lyrics \lyricsto "first" {
  lo lo |
  la -- la la -- la |
  la, la la la la la --
  la la. la la la |
  lu mo mo
  mo __ mi me
  ru
}
\new Lyrics \lyricsto "first" {
  \repeat unfold 2 { \skip 1 }
  mo -- mu. mi me |
  \repeat unfold 2 { \skip 1 } ma ma mi me |
  mu -- mo.  ma mi -- mi
}
\new Lyrics \lyricsto "second" {
  ma -- mo mu % this ends up shifted down below the second verse
}
  >>
}
  >>
  \layout {
\context {
  \Score
  proportionalNotationDuration = #(ly:make-moment 1/8)
}
  }
}

Best,
Jiri

On 25. 02. 24 16:24, Andy Bradford wrote:

Thus said Aaron Hill on Sat, 24 Feb 2024 20:51:44 -0800:


Probably  the  easiest  the  option  is  to  \set  associatedVoice  to
temporarily align  your lyrics to  the alternate notes.  The important
quirk of associatedVoice  is that you must make the  change a syllable
ahead of when you need it:


I see,  yes, this works  quite well, thank you.  It also cleans  up some
other tricks I had employed to try to get the text aligned (specifically
I had  some manual  \break and  also extended the  voice longer  than it
needed to be).

Thanks,

Andy






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




How to achieve minimum horizontal spacing between notes

2023-12-15 Thread Jiří Hon

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: Magnetic snap and whiteout on LyricText: warnings

2023-06-07 Thread Jiří Hon

Hi Jean and Werner,

Thank you very much for this snippet. It brings the lyrics closer to perfection.

Jirka

On 06. 06. 23 16:43, Jean Abou Samra wrote:

Le mardi 06 juin 2023 à 15:56 +0200, Simon Albrecht a écrit :

Hi Jean, hi Werner,

On 05.06.23 22:28, Jean Abou Samra wrote:

Well, for my defense, I did also post a revised version of the
“magnetic lyrics” snippet:

https://www.mail-archive.com/lilypond-user@gnu.org/msg149201.html 



thanks for that pointer and your contributions. I reviewed that thread,
since I had only noticed at the time that your, Jean’s, initial design
wasn’t production-ready and not gotten around to following up…

Based on that, and on successful test on one (!) current score I was
working on, I submitted the snippet to LSR as no. 1169 (pending
approval) in the attached form. I hope that this is in your interest, as
well as that of users who may find it there.

I also hope that LSR admins will review the ‘headers’ within the snippet
code, namely the way you two are being credited and the list archive is
being referred to.



I've approved it.

I replaced the ellipses in the email addresses with the full addresses; there 
is no point in hiding them since they are given publicly on the list archives.

Best,
Jean





Re: A new Scheme tutorial

2022-07-13 Thread Jiří Hon

Hi Jean,

thank you very much for the tutorial and its translation to English. I went through and 
it seems perfect for all of us coming from the world of "imperative" languages. 
You have a precious gift to explain convoluted things in a straightforward way.

Best,
Jiri

Dne 12. 07. 22 v 1:28 Jean Abou Samra napsal(a):

Hi,

Last year, after I delivered a presentation on Scheme at a
French-speaking virtual meeting of LilyPond users, I was asked
if I could write that down in tutorial form, which I did as
https://tutoriel-scheme.readthedocs.io. Over the past few days,
I've set some time apart to translate that into English.
The English version can be found here:

https://scheme-tutorial.readthedocs.io

The translation is a bit unpolished at the moment, and I didn't
proofread it yet; I indent to do that later.

I hope this can help some people on their way to learning Scheme
and LilyPond's inner workings. If you have feedback, feel free
to drop me an email.

Enjoy!

Best,
Jean






Re: ANN: Frescobaldi 3.2

2022-05-05 Thread Jiří Hon

Hi Wilbert,

thank you very much for the new release of Frescobaldi and especially for the 
parce and quickly packages. Quickly will make my life much easier. Now I'm able 
to find and fix common notation errors in hundreds of scores more reliably, 
without the need for fragile regular expressions. Great work!

Have a nice day,
Jiri Hon

Dne 05. 05. 22 v 7:40 Wilbert Berendsen napsal(a):

Dear Friends,

Lots of people contributed to this new release of Frescobaldi 3.2,
which actually has been in the works for quite a long time. Thanks!!
Recently it became urgent to fix various issues that arose in
Frescobaldi (and many programs that use Python-Qt bindings) with Python
3.10, where you no longer can give a floating point value to a function
that requires an integer. Python releases are so quick :-)

So hopefully this new release[1] fixes those annoyances. But it brings
also some nice new features; see for an overview[2]:

[1] https://github.com/frescobaldi/frescobaldi/releases/tag/v3.2
[2] https://github.com/frescobaldi/frescobaldi/blob/v3.2/ChangeLog

Note that there is a dependency change: the qpageview module, thus far
in frescobaldi_app/qpageview, is now, because of its generic nature, a
separate project at http://qpageview.org/ . This package needs to be
installed for Frescobaldi to work; it is used by the Music View and
other viewers inside Frescobaldi. Because of this, be sure to remove
Frescobaldi completely and then install qpageview and Frescobaldi,
otherwise it still finds the old qpageview inside the frescobaldi_app
folder.

In the meantime I worked on two new Python packages: parce[3] and
quickly[4], which together will supersede python-ly. In the future they
will help Frescobaldi with an even more thorough musical understanding
of the LilyPond source text, making (probably) more interesting music
manipulations possible.

[3] https://parce.info/
[4] https://quick-ly.info/

Enjoy!