On Sun, Jun 26, 2022 at 3:31 AM Лысов Дмитрий <sii...@yandex.ru> 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" } \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 { } \midi { \context { \Staff \remove "Staff_performer" } \context { \Voice \consists "Staff_performer" } \context { \Score tempoWholesPerMinute = #(ly:make-moment 110 2) } } }