Re: simplify the program code

2022-06-26 Thread Jean Abou Samra

Le 26/06/2022 à 20:25, Лысов Дмитрий a écrit :
Thanks. That's not bad. Probably, the insertion of the \markup block 
in \score should not be done. Then you will get one midi file. Still, 
it is more convenient to listen to individual midi files.



1. It is usually more convenient if you move global \layout
and \midi settings to a separate block on the top-level rather
than duplicating them.

2. To move the markups inside the score, you can use headers:

\score {
  \header {
    piece = \markup ...
  }
  ...
}

3. Define a substitution function to do the rest. (This is easier
with the previous bullet point since it only has to return one single
value.)




\version "2.23.9"

\header {
  title = "Сборник мелодических формул знаменного распева" %\markup { 
\override #'(line-width . 60) \wordwrap-string  { "Конда́къ ..., гла́съ 
є҃:"  } }

  %subtitle = ""
  %subsubtitle =  ""
  composer= "Штейнберг Б."
  poet = "Москва 2017"
  %copyright = ""
}

\paper {
  #(set-paper-size "a4")
  %page-count = # 1
  tagline=##f
  %ragged-last = ##t
  ragged-right = ##t
  myStaffSize = #21
  #(define fonts (make-pango-font-tree
  "Times New Roman"
  "Times New Roman"
  "Times New Roman"
  (/ myStaffSize 21)))
}

\layout {
  indent = 0.0
  \context {
    \Lyrics
    \override LyricText #'font-size = #4
    \override LyricText #'font-name = #"Times New Roman"
    \override LyricSpace.minimum-distance = #0.8
  }
}

#(define counter-alist '())

#(define-markup-command (counter layout props name) (string?)
   "Increases and prints out the value of the given counter named 
@var{name}.

   If the counter does not yet exist, it is initialized with 1."
   (let* ((oldval (assoc-ref counter-alist name))
  (newval (if (number? oldval) (+ oldval 1) 1)))
 (set! counter-alist (assoc-set! counter-alist name newval))
 (interpret-markup layout props
   (markup (number->string newval)

#(define-markup-command (setcounter layout props name value) (string? 
number?)
   "Set the given counter named @var{name} to the given @var{value} and 
prints

   out the value. The counter does not yet have to exist."
   (set! counter-alist (assoc-set! counter-alist name (- value 1)))
   (interpret-markup layout props (make-counter-markup name)))

\markup { \setcounter #"mycounter" #-1 }
\markup { \fill-line \huge { "Глас 1" }}
\markup { \fill-line \huge { "Начальные" }}
\markup { Номер midi файла: \counter #"mycounter" }

\layout {
  \context {
    \Score
    \override SpacingSpanner.spacing-increment = 0.5
  }
  \context {
    \KievanVoice
    \stemDown
    fontSize = 1.0
  }
}

\midi {
  \context {
    \Score
    tempoWholesPerMinute = #(ly:make-moment 110 2)
  }
  \context {
    \Staff
    \remove Staff_performer
  }
  \context {
    \Voice
    \remove Staff_performer
  }
}

makeScore =
#(define-scheme-function (mark notes) (markup? ly:music?)
   #{
 \score {
   \header {
 piece = \markup { Номер midi файла: \counter #"mycounter" }
   }
   \new KievanVoice = "melody" \relative c' {
 \cadenzaOn
 \mark #mark
 #notes
 \bar "|"
   }
   \layout { }
   \midi { }
 }
   #})

\makeScore Удра { e4 c d f e d c d e d e1 }
\makeScore Рымза { e4 c d e f e d c2 d e1 }
\makeScore Рутва { e2 e4 c d f e d c d e d e1 }
\makeScore Перегиб { e2 e4 c d f e d c2 d e1 }
\makeScore "Вознос последний" { d2 d4 f e d c b a1 g }




See these pages in the documentation:

https://lilypond.org/doc/v2.23/Documentation/notation/creating-titles-headers-and-footers#default-layout-of-bookpart-and-score-titles
https://lilypond.org/doc/v2.23/Documentation/extending/scheme-functions.html

(You need define-scheme-function rather than the more usual
define-music-function because this function returns a whole
\score block, not some music that could be used within a larger
piece of music.)

Best,
Jean




Re: Hyphen in lyrics

2022-06-26 Thread David Kastrup
David Kastrup  writes:

> Stephan Schöll  writes:
>
>> Hi all
>>
>> How can I force a hyphen in a word to be printed as in the example with
>> the word "washed-out":
>>
>> \version "2.20.0"
>>
>> \score {
>>   <<
>>   \new Staff {
>> \new Voice = melody \relative c'{
>>   d4 d d r
>> }
>>   }
>>   \new Lyrics \lyricsto "melody" {
>> % whashed-out dreams
>> \lyricmode { Whashed out dreams }
>>   }
>>   >>
>> }
>>
>> This hyphen is a part of the word. I don't want to have it printed
>> optionally depending on the vertical spacing as regular
>> inter-syllable-hyphens in lyrics do.
>>
>> \lyricmode { Whashed- out dreams }
>> or
>> \lyricmode { "Whashed -" out dreams }
>> might be viable compromises, but I'd prefer it centered between "washed"
>> and "out".
>>
>> TIA
>> Stephan
>>
>>
>
> 
>
> tells you how to enter hyphens and how to specify minimum distances and
> minimum length for a hyphen.
>
>   \new Lyrics \with { \override LyricHyphen.minimum-length=#0
> \override LyricHyphen.minimum-distance=#1
>   } \lyricsto "melody" {
> % washed-out dreams
> \lyricmode { Washed -- out dreams }
>   }
>
> will work when inserted into your example.
>
>
> If you want this override to be one-time rather than unconditional, you
> could try something like
>
> \version "2.20.0"
>
> hy =
> \tweak minimum-length #0
> \tweak minimum-distance #1
> \etc
>
> \score {
>   <<
>   \new Staff {
> \new Voice = melody \relative c'{
>   d4 d d r
> }
>   }
>   \new Lyrics \lyricsto "melody" {
> % washed-out dreams
> \lyricmode { Washed \hy -- out dreams }
>   }
>   >>
> }

Seems like I forgot that -- is actually an articulation, so the line
defining hy should actually be

hy = -

followed by the rest.  In current versions of LilyPond, this makes
little difference, but in 2.20 it does.

-- 
David Kastrup



Re: Hyphen in lyrics

2022-06-26 Thread David Kastrup
Stephan Schöll  writes:

> Hi all
>
> How can I force a hyphen in a word to be printed as in the example with
> the word "washed-out":
>
> \version "2.20.0"
>
> \score {
>   <<
>   \new Staff {
> \new Voice = melody \relative c'{
>   d4 d d r
> }
>   }
>   \new Lyrics \lyricsto "melody" {
> % whashed-out dreams
> \lyricmode { Whashed out dreams }
>   }
>   >>
> }
>
> This hyphen is a part of the word. I don't want to have it printed
> optionally depending on the vertical spacing as regular
> inter-syllable-hyphens in lyrics do.
>
> \lyricmode { Whashed- out dreams }
> or
> \lyricmode { "Whashed -" out dreams }
> might be viable compromises, but I'd prefer it centered between "washed"
> and "out".
>
> TIA
> Stephan
>
>



tells you how to enter hyphens and how to specify minimum distances and
minimum length for a hyphen.

  \new Lyrics \with { \override LyricHyphen.minimum-length=#0
  \override LyricHyphen.minimum-distance=#1
} \lyricsto "melody" {
% washed-out dreams
\lyricmode { Washed -- out dreams }
  }

will work when inserted into your example.


If you want this override to be one-time rather than unconditional, you
could try something like

\version "2.20.0"

hy =
\tweak minimum-length #0
\tweak minimum-distance #1
\etc

\score {
  <<
  \new Staff {
\new Voice = melody \relative c'{
  d4 d d r
}
  }
  \new Lyrics \lyricsto "melody" {
% washed-out dreams
\lyricmode { Washed \hy -- out dreams }
  }
  >>
}


-- 
David Kastrup


Hyphen in lyrics

2022-06-26 Thread Stephan Schöll

Hi all

How can I force a hyphen in a word to be printed as in the example with
the word "washed-out":

\version "2.20.0"

\score {
  <<
  \new Staff {
\new Voice = melody \relative c'{
  d4 d d r
}
  }
  \new Lyrics \lyricsto "melody" {
% whashed-out dreams
\lyricmode { Whashed out dreams }
  }
  >>
}

This hyphen is a part of the word. I don't want to have it printed
optionally depending on the vertical spacing as regular
inter-syllable-hyphens in lyrics do.

\lyricmode { Whashed- out dreams }
or
\lyricmode { "Whashed -" out dreams }
might be viable compromises, but I'd prefer it centered between "washed"
and "out".

TIA
Stephan



Re: simplify the program code

2022-06-26 Thread Лысов Дмитрий
Thanks. That's not bad. Probably, the insertion of the \markup block in \score should not be done. Then you will get one midi file. Still, it is more convenient to listen to individual midi files.26.06.2022, 17:32, "Knute Snortum" :On Sun, Jun 26, 2022 at 3:31 AM Лысов Дмитрий  wrote: Thanks. I will give a part of the code. The name and \score blocks often alternate here. The \score block is bulky and has repetitive content. How can this content be taken out separately?The first thing is to format your input file better.  I have donethat, and now the repetition is easier to see and understand.Unfortunately, all I could think of was to pull the layout sectionsinto one global layout.  Eliminating the rest of the repetition eludesme, but maybe some of the smarter people here will look at it.  I'veattached the file. Second question: is it possible to describe the name of the section \markup { \fill-line \huge { "Name" }} inside the \score block?I'm not sure why you would want to do that, but I'm sure it can be done.-- Knute Snortum

Re: CrossStaff and Dynamics

2022-06-26 Thread Alberto Simões
Hello

Yeah, it took some time to realize that too, but that was easier than to
understand I had it working and.. deleted the engraver :-)
Cheers

On Sun, Jun 26, 2022 at 4:06 AM Andrew Bernard 
wrote:

> Oh - I just realised you were talking about the engraver!
>
> Andrew
>
>
> Andrew Bernard wrote on 26/06/2022 12:35 PM:
> > No need for shame. I think it depends on the direction of the stem in
> > the upper staff doesn't it? So it's not always the case that you have
> > to put the cross staff indication in the upper staff. I think.
> >
> > Andrew
> >
> > Alberto Simões wrote on 26/06/2022 6:53 AM:
> >> Dear Paul,
> >> I feel ashamed now.
> >> Indeed, I lost it when changing to the new Dynamics.
> >> Thanks for your quick answer.
> >> Its working back ;)
> >>
> >
> >
>
>
>


LilyPond 2.23.10

2022-06-26 Thread Jonas Hahnfeld via LilyPond user discussion
We are happy to announce the release of LilyPond 2.23.10. This is
termed a development release, but these are usually reliable. However,
if you require stability, we recommend using version 2.22.2, the
current stable release.

As a reminder, the official binaries can be downloaded from GitLab:
https://gitlab.com/lilypond/lilypond/-/releases/v2.23.10
We provide packages for macOS ("darwin"), Linux, and Windows ("mingw")
that only need to be extracted (no installation as in older versions).


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


Re: simplify the program code

2022-06-26 Thread Knute Snortum
On Sun, Jun 26, 2022 at 3:31 AM Лысов Дмитрий  wrote:
>
> Thanks. I will give a part of the code. The name and \score blocks often 
> alternate here. The \score block is bulky and has repetitive content. How can 
> this content be taken out separately?

The first thing is to format your input file better.  I have done
that, and now the repetition is easier to see and understand.
Unfortunately, all I could think of was to pull the layout sections
into one global layout.  Eliminating the rest of the repetition eludes
me, but maybe some of the smarter people here will look at it.  I've
attached the file.

> Second question: is it possible to describe the name of the section \markup { 
> \fill-line \huge { "Name" }} inside the \score block?

I'm not sure why you would want to do that, but I'm sure it can be done.

--
Knute Snortum
% 1) Formatting
% 2) set-paper-size syntax incorrect
% 3) pull out layouts and make global

\version "2.22.1"

\header {
  title = "Сборник мелодических формул знаменного распева" %\markup { \override #'(line-width . 60) \wordwrap-string  { "Конда́къ ..., гла́съ є҃:"  } }
  %subtitle = ""
  %subsubtitle =  ""
  composer= "Штейнберг Б."
  poet = "Москва 2017"
  %copyright = ""
}

\paper {
  #(set-paper-size "a4")
  %page-count = # 1
  tagline=##f
  %ragged-last = ##t
  ragged-right = ##t
  myStaffSize = #21
  #(define fonts (make-pango-font-tree
  "Times New Roman"
  "Times New Roman"
  "Times New Roman"
  (/ myStaffSize 21)))
}

\layout {
  indent = 0.0 
  \context {
\Lyrics 
\override LyricText #'font-size = #4 
\override LyricText #'font-name = #"Times New Roman" 
\override LyricSpace.minimum-distance = #0.8 
  } 
} 

#(define counter-alist '())

#(define-markup-command (counter layout props name) (string?)
   "Increases and prints out the value of the given counter named @var{name}.
   If the counter does not yet exist, it is initialized with 1."
   (let* ((oldval (assoc-ref counter-alist name))
  (newval (if (number? oldval) (+ oldval 1) 1)))
 (set! counter-alist (assoc-set! counter-alist name newval))
 (interpret-markup layout props
   (markup (number->string newval)

#(define-markup-command (setcounter layout props name value) (string? number?)
   "Set the given counter named @var{name} to the given @var{value} and prints
   out the value. The counter does not yet have to exist."
   (set! counter-alist (assoc-set! counter-alist name (- value 1)))
   (interpret-markup layout props (make-counter-markup name)))

\markup { \setcounter #"mycounter" #-1 }
\markup { \fill-line \huge { "Глас 1" }}
\markup { \fill-line \huge { "Начальные" }}
\markup { Номер midi файла: \counter #"mycounter" }

\score {
  << 
\new KievanVoice = "melody" { 
  \cadenzaOn 
  \stemDown 
  \set fontSize = #1.0 
  \override Score.SpacingSpanner.spacing-increment = #0.5 
  \relative c' { 
\mark "Удра" e4 c d f e d c d e d e1 \bar "|" \break
  }
}
  >>
  \layout{
  }
  \midi { 
\context {
  \Staff 
  \remove "Staff_performer"
} 
\context {
  \Voice 
  \consists "Staff_performer"
} 
\context {
  \Score 
  tempoWholesPerMinute = #(ly:make-moment 110 2)
}
  }
}

\markup { Номер midi файла: \counter #"mycounter" }

\score {
  << 
\new KievanVoice = "melody" { 
  \cadenzaOn 
  \stemDown 
  \set fontSize = #1.0 
  \override Score.SpacingSpanner.spacing-increment = #0.5 
  \relative c' { 
\mark "Рымза" e4 c d f e d c2 d e1 \bar "|" \break
  }
}
  >>
  \layout {
  }
  \midi { 
\context { 
  \Staff 
  \remove "Staff_performer"
} 
\context {
  \Voice 
  \consists "Staff_performer"
} 
\context {
  \Score tempoWholesPerMinute = #(ly:make-moment 110 2) 
} 
  } 
}

\markup { Номер midi файла: \counter #"mycounter" }

\score {
  << 
\new KievanVoice = "melody" { 
  \cadenzaOn 
  \stemDown 
  \set fontSize = #1.0 
  \override Score.SpacingSpanner.spacing-increment = #0.5 
  \relative c' { 
\mark "Рутва" e2 e4 c d f e d c d e d e1 \bar "|" \break
  }
}
  >>
  \layout {
  } 
  \midi { 
\context {
  \Staff 
  \remove "Staff_performer"
} 
\context {
  \Voice 
  \consists "Staff_performer"
} 
\context {
  \Score tempoWholesPerMinute = #(ly:make-moment 110 2) 
} 
  }
}
  
\markup { Номер midi файла: \counter #"mycounter" }

\score {
  << 
\new KievanVoice = "melody" { 
  \cadenzaOn 
  \stemDown 
  \set fontSize = #1.0 
  \override Score.SpacingSpanner.spacing-increment = #0.5 
  \relative c' { 
\mark "Перегиб" e2 e4 c d f e d c2 d e1 \bar "|" \break
  }
}
  >>
  \layout {
  } 
  \midi { 
\context {
  \Staff 
  \remove "Staff_performer"
} 
\context {
  \Voice 
  \consists "Staff_performer"
} 
  

Re: simplify the program code

2022-06-26 Thread Лысов Дмитрий
Thanks. I will give a part of the code. The name and \score blocks often alternate here. The \score block is bulky and has repetitive content. How can this content be taken out separately?Second question: is it possible to describe the name of the section \markup { \fill-line \huge { "Name" }} inside the \score block? %\version "2.22.1"   \header {   title = "Сборник мелодических формул знаменного распева" %\markup { \override #'(line-width . 60) \wordwrap-string  { "Конда́къ ..., гла́съ є҃:"  } }   %subtitle = ""  %subsubtitle =  ""  composer= "Штейнберг Б."  poet = "Москва 2017"  %copyright = ""} \paper {  (set-paper-size "a4")   %page-count = # 1  tagline=##f   %ragged-last = ##t  ragged-right = ##t  myStaffSize = #21  #(define fonts (make-pango-font-tree          "Times New Roman"         "Times New Roman"         "Times New Roman"         (/ myStaffSize 21)))} #(define counter-alist '()) #(define-markup-command (counter layout props name) (string?)  "Increases and prints out the value of the given counter named @var{name}.  If the counter does not yet exist, it is initialized with 1."  (let* ((oldval (assoc-ref counter-alist name))         (newval (if (number? oldval) (+ oldval 1) 1)))  (set! counter-alist (assoc-set! counter-alist name newval))  (interpret-markup layout props    (markup (number->string newval) #(define-markup-command (setcounter layout props name value) (string? number?)  "Set the given counter named @var{name} to the given @var{value} and prints  out the value. The counter does not yet have to exist."  (set! counter-alist (assoc-set! counter-alist name (- value 1)))  (interpret-markup layout props (make-counter-markup name))) \markup { \setcounter #"mycounter" #-1 } \markup { \fill-line \huge { "Глас 1" }}\markup { \fill-line \huge { "Начальные" }}\markup { Номер midi файла: \counter #"mycounter" } \score {<< \new KievanVoice = "melody"{ \cadenzaOn \stemDown \set fontSize = #1.0 \override Score.SpacingSpanner.spacing-increment = #0.5 \relative c' { \mark "Удра" e4 c d f e d c d e d e1 \bar "|" \break}}>>\layout {indent = 0.0 \context {\Lyrics \override LyricText #'font-size = #4 \override LyricText #'font-name = #"Times New Roman" \override LyricSpace.minimum-distance = #0.8 } \context {\Score}} \midi { \context {\Staff \remove "Staff_performer"} \context {\Voice \consists "Staff_performer"} \context {\Score tempoWholesPerMinute = #(ly:make-moment 110 2)}}}\markup { Номер midi файла: \counter #"mycounter" } \score {<< \new KievanVoice = "melody"{ \cadenzaOn \stemDown \set fontSize = #1.0 \override Score.SpacingSpanner.spacing-increment = #0.5 \relative c' { \mark "Рымза" e4 c d f e d c2 d e1 \bar "|" \break}}>>\layout {indent = 0.0 \context {\Lyrics \override LyricText #'font-size = #4 \override LyricText #'font-name = #"Times New Roman" \override LyricSpace.minimum-distance = #0.8 } \context {\Score}} \midi { \context {\Staff \remove "Staff_performer"} \context {\Voice \consists "Staff_performer"} \context {\Score tempoWholesPerMinute = #(ly:make-moment 110 2)}}}\markup { Номер midi файла: \counter #"mycounter" } \score {<< \new KievanVoice = "melody"{ \cadenzaOn \stemDown \set fontSize = #1.0 \override Score.SpacingSpanner.spacing-increment = #0.5 \relative c' { \mark "Рутва" e2 e4 c d f e d c d e d e1 \bar "|" \break}}>>\layout {indent = 0.0 \context {\Lyrics \override LyricText #'font-size = #4 \override LyricText #'font-name = #"Times New Roman" \override LyricSpace.minimum-distance = #0.8 } \context {\Score}} \midi { \context {\Staff \remove "Staff_performer"} \context {\Voice \consists "Staff_performer"} \context {\Score tempoWholesPerMinute = #(ly:make-moment 110 2)}}}\markup { Номер midi файла: \counter #"mycounter" } \score {<< \new KievanVoice = "melody"{ \cadenzaOn \stemDown \set fontSize = #1.0 \override Score.SpacingSpanner.spacing-increment = #0.5 \relative c' { \mark "Перегиб" e2 e4 c d f e d c2 d e1 \bar "|" \break}}>>\layout {indent = 0.0 \context {\Lyrics \override LyricText #'font-size = #4 \override LyricText #'font-name = #"Times New Roman" \override LyricSpace.minimum-distance = #0.8 } \context {\Score}} \midi { \context {\Staff \remove "Staff_performer"} \context {\Voice \consists "Staff_performer"} \context {\Score tempoWholesPerMinute = #(ly:make-moment 110 2)}}}\markup { \fill-line \huge { "Конечные" }}\markup { Номер midi файла: \counter #"mycounter" } \score {<< \new KievanVoice = "melody"{ \cadenzaOn \stemDown \set fontSize = #1.0 \override Score.SpacingSpanner.spacing-increment = #0.5 \relative c' { \mark "Вознос последний" d2 d4 f e d c b a1 g \bar "|" \break}}>>\layout {indent = 0.0 \context {\Lyrics \override LyricText #'font-size = #4 \override LyricText #'font-name = #"Times New Roman" \override LyricSpace.minimum-distance = #0.8 } \context {\Score}} \midi { \context {\Staff \remove "Staff_performer"} \context {\Voice \consists "Staff_performer"} \context {\Score tempoWholesPerMinute = #(ly:make-moment 110 2)}}} 25.06.2022, 16:30, "Knute Snort