%% Generated by lilypond-book
%% Options: [exampleindent=10.16\mm,indent=0\mm,line-width=160\mm,paper-height=845.047\pt,paper-width=597.508\pt,papersize='(cons (* 597.508 pt) (* 845.047 pt)),quote,ragged-right]
\include "lilypond-book-preamble.ly"


% ****************************************************************
% Start cut-&-pastable-section
% ****************************************************************

#(ly:set-option 'eps-box-padding 3.000000)



\paper {
  #(set-paper-size '(cons (* 597.508 pt) (* 845.047 pt)))
  indent = 0\mm
  line-width = 160\mm
  % offset the left padding, also add 1mm as lilypond creates cropped
  % images with a little space on the right
  line-width = #(- line-width (* mm  3.000000) (* mm 1))
  line-width = 160\mm - 2.0 * 10.16\mm
  % offset the left padding, also add 1mm as lilypond creates cropped
  % images with a little space on the right
  line-width = #(- line-width (* mm  3.000000) (* mm 1))
  ragged-right = ##t
}

\layout {
  
}




% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "snippets/using-tags-to-produce-mensural-and-modern-music-from-the-same-source.ly"
\sourcefileline 0
%% DO NOT EDIT this file manually; it was automatically
%% generated from `Documentation/snippets/new/`.
%%
%% Make any changes in `Documentation/snippets/new/`,
%% then run `scripts/auxiliar/makelsr.pl --new`.
%%
%% This file is in the public domain.
%%
%% Note: this file needs at least LilyPond version 2.24.0.

\version "2.24.0"

\header {
%% Translation of GIT committish: 0cc270b871321ae5aa8622cea8d8262aafd16641
  texidocja = "
タグを使用して、同じ音楽に対して計量音楽譜と現代譜の両方を生成@c
することができます。このスニペットでは、@code{menrest} 関数が定義されており、@c
計量音楽における休符の位置は維持しながら、現代譜における休符は通常の位置に@c
配置しています。タグは曲の終わりにある小節線を 2 つの楽譜で異なるものに@c
するために使用していますが、区別が必要な他の場面でも用いることができます:
例えば、現代譜では @qq{全休符} (R1, R\\breve など) を使用したいが、@c
計量音楽譜では通常の休符 (r1, r\\breve など) を使用したい場合です。@c
計量音楽を現代音楽に変換する作業は通常 @qq{転写 (transcription)} と呼ばれます。
"
  doctitleja = "タグを使用して同じソースから計量音楽譜と現代譜を生成する"

%% Translation of GIT committish: 2f3474d9af596d677ed5b7ce720ae4d0954a6b51
  texidocit = "
Usando le etichette (tag), è possibile usare la stessa musica per produrre sia
la musica mensurale che quella moderna.  In questo frammento, viene introdotta
la funzione @code{menrest}, che permette alle pause mensurali di essere
posizionate precisamente sul rigo come nell'originale, ma con le pause moderne
nella posizione standard.  Le etichette vengono usate per produrre diversi
tipi di stanghetta alla fine della musica, ma possono essere usate anche
quando sono necessarie altre differenze: per esempio se si vogliono usare
@qq{pause d'intero} (R1, R\\breve, etc.) nella musica moderna, ma pause
normali (r1, r\\breve, etc.) nella versione mensurale.  La conversione di
musica mensurale nel suo equivalente moderno viene solitamente chiamata
@code{trascrizione}.

"
  doctitleit = "Usare le etichette per produrre musica mensurale e moderna dallo stesso sorgente"

%% Translation of GIT committish: 606ac3c3b22c41d84aa5fa938d42da5125ac572a
 texidocfr = "
Grâce aux balises (@emph{tags}), il est possible d'utiliser une même
source pour produire une partition de musique mensurale et moderne. Dans
cet exemple est créée la fonction @code{menrest} qui permettra de
positionner les silence comme dans la version originale, tout en
respectant leur position sur une portée standard.

Les balises permettent aussi de gérer d'autres différenciations selon
les besoins, comme des « mesures de silence » (R1, R\\breve, etc.) en
notation moderne mais des silences normaux (r1, r\\breve, etc.) en
notation ancienne. L'action de convertir de la musique mensurale en
version moderne est communément appelée « transcription ».

L'appel à @code{c4.\\Be c8 c\\Am} revient au même que @code{c4.[ c8 c]}.
Néanmoins, il évite les avertissements si le début intervient sur une
note dépourvue de ligature mais pourrait s'en voir affublée de par
l'utilisation du @code{Completion_heads_engraver}.

[La ligne légèrement plus courte dans la portée mensurale permet
d'éviter que le glyphe de custode ne soit raccourci lors de la
génération des images. On peut l'éviter à l'aide d'un
@code{\\with-true-dimensions} comme ici.]
"

  doctitlefr = "Recours aux balises pour produire une partition ancienne et moderne à partir de la même source"

%% Translation of GIT committish: 6744168afc10012e17916282ef5e4353cf1f4e3b
 texidoces = "
Usando etiquetas es posible producir las dos notaciones mensural y
moderna a partir del mismo código fuente de la música.  En este
fragmento se introduce la función @code{\\menrest}, que permite
que los silencios mensurales estén a la altura de notas como en el
original, pero con silencios modetnos en la posicion del
pentagrama estándar.

También se pueden usar etiquetas allí donde se necesiten otras
diferencias: por ejemplo usando @qq{silencios de compás completo}
(@code{R1}, @code{R\\breve}, etc.) en música moderna, pero
silencios normales (@code{r1}, @code{r\\breve}, etc.) en la
versión mensural.  La conversión de música mensural a su
equivalente moderno se conoce normalmente como
@emph{transcription}.

La llamara @code{c4.\\Be c8 c\\Am} es lo mismo que @code{c4.[ c8
c]}.  Sin embargo, suprime las advertencias sin se inicia en una
nota que no puede llevar barra pero la necesita en todo caso
debido al uso del grabador @code{Completion_heads_engraver}.

[La longitud ligeramente acortada de la línea en la pauta mensural
evita el recorte del glifo de los custos cuando LilyPond genera
imágenes recortadas muy estrechamente.  El uso de
@code{\\with-true-dimensions}, tal y como aparece a continuación,
evita esto.]

"

  doctitlees = "Uso de etiquetas para producir música mensural y moderna a partir del mismo código fuente"

  categories = "Ancient notation, Contexts and engravers, Vocal music"

  texidoc = "
Using tags it is possible to produce both mensural and modern notation
from the same music. In this snippet, a function @code{\\menrest} is
introduced, allowing mensural rests to be pitched as in the original,
but with modern rests in the standard staff position.

Tags can also be used where other differences are needed: for example
using @qq{whole measure rests} (@code{R1}, @code{R\\breve}, etc.) in
modern music, but normal rests (@code{r1}, @code{r\\breve}, etc.) in
the mensural version. Converting mensural music to its modern
equivalent is usually referred to as @emph{transcription}.

The call @code{c4.\\Be c8 c\\Am} is the same as @code{c4.[ c8 c]}.
However, it suppresses warnings if it starts on a note that can't hold
a beam but needs it anyway due to the use of
@code{Completion_heads_engraver}.

[Note that the custos sticks out into the right margin and might be cut
off if the LilyPond output gets cropped tightly. The use of
@code{\\with-true-dimensions} below avoids this.]
"

  doctitle = "Using tags to produce mensural and modern music from the same source"
} % begin verbatim


\layout {
  line-width = 150\mm
}

menrest = #(define-music-function (note) (ly:music?)
              #{
                \tag #'mens $(make-music 'RestEvent note)
                \tag #'mod $(make-music 'RestEvent note 'pitch '())
              #})
Be = \tag #'mod
       #(begin
          (ly:expect-warning (G_ "stem does not fit in beam"))
          (ly:expect-warning (G_ "beam was started here"))
          (make-span-event 'BeamEvent START))
Am = \tag #'mod ]

MenStyle = {
  \override Score.BarNumber.transparent = ##t
  \override Stem.neutral-direction = #up
  \omit Slur
  \omit Beam
}

finalis = \section

Music = \relative c'' {
  \key f \major
  g1 d'2 \menrest bes4 bes a2 \menrest r4 g4 fis4. fis8 fis4 fis \break
  g e f4.([ g8] a4[ g8 f] g2.\Be fis8 e\Am fis2) g\breve \finalis
}

MenLyr = \lyricmode {
  So farre, deere life, deare life,
  from thy bright beames ab- ſen- ted,
}
ModLyr = \lyricmode {
  So far, dear life, dear life,
  from your bright beams ab -- sen -- ted, __
}

\score {
  \keepWithTag #'mens {
    <<
      \new PetrucciStaff {
        \new PetrucciVoice = "Cantus" {
          \clef "petrucci-c1" \time 4/4 \MenStyle \Music
        }
      }
      \new Lyrics \lyricsto "Cantus" \MenLyr
    >>
  }
  \layout {
    \context {
      \PetrucciVoice
      % No longer necessary starting with version 2.25.23.
      \override Flag.style = #'mensural
    }
  }
}

\markup\vspace #1

\score {
  \keepWithTag #'mod {
    \new ChoirStaff <<
      \new Staff {
        \new Voice = "Sop" \with {
          \remove "Note_heads_engraver"
          \consists "Completion_heads_engraver"
          \remove "Rest_engraver"
          \consists "Completion_rest_engraver"
        } \shiftDurations 1 0 { \time 2/4 \autoBeamOff \Music }
      }
      \new Lyrics \lyricsto "Sop" \ModLyr
    >>
  }
}



% ****************************************************************
% end ly snippet
% ****************************************************************
