%% 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))]
\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))
}

\layout {
  
}




% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "snippets/customizing-the-position-and-number-of-dots-in-repeat-sign-bar-lines.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.25.15.

\version "2.25.15"

\header {
%% Translation of GIT committish: a8a85e19654e46d725563e6deba44083ef137a2c
  texidocja = "
繰り返しの小節線で、ドットの位置や数をカスタマイズしたい場合、@c
新たな小節線を定義し、デフォルトの繰り返し記号を変更します。@c
このスニペットはその方法を示しています。@c
これは、このスニペットのように line-positions がカスタマイズされている場合に@c
特に有用です。
"
  doctitleja = "繰り返しの小節線のドットの位置と数をカスタマイズする"

%% Translation of GIT committish: 1abe87de51b9b00a391da1be4cf4b5ebe4021ca9
  texidocfr = "
Il est possible de personnaliser la position et le nombre de points
d'une barre indiquant une reprise, que ce soit en définissant de
nouvelles barres de mesure personnalisées ou bien en redéfinissant la
manière dont les indications de reprise par défaut sont dessinées. Ceci
s'avère tout particulièrement utile dans le cas de portées aux lignes
adaptées comme dans l'exemple ci-dessous.
"

  doctitlefr = "Contrôle de la position et du nombre de points d'une barre de reprise"

%% Translation of GIT committish: 2dbd7c68d29e97631d7ef0d5f324fdc0ad92eccf
  texidoces = "
Si queremos personalizar la posición y/o el número de puntos en
las barras de repetición, podemos definir líneas divisorias
personalizadas o redefinir la manera en que se dibujan los
símbolos de repetición.  Esto puede ser de especial ayuda cuando
se usa un pentagrama con posiciones de línea personalizadas, como
se muestra en el fragmento.

"

  doctitlees = "Personalizar la posición y el número de puntos en las líneas divisorias de repetición"

  categories = "Scheme, Symbols and glyphs"

  texidoc = "
If you want to customize the position and/or number of dots in repeat
sign bar lines, you can define new custom bar lines or redefine the
way default repeat signs are drawn.  This may be particularly helpful
when using a staff with custom line positions, as shown in this
snippet.
"

  doctitle = "Customizing the position and number of dots in repeat sign bar lines"
} % begin verbatim


#(define ((make-custom-dot-bar-line dot-positions) is-span grob extent)
   "Draw dots (repeat sign dots) at DOT-POSITIONS.

The coordinates of DOT-POSITIONS are equivalent to the coordinates of
`StaffSymbol.line-positions`; a dot position of X and a line position
of X indicate the same vertical position.

IS-SPAN is not used in this custom function."
   (let* ((staff-space (ly:staff-symbol-staff-space grob))
          (dot (ly:font-get-glyph (ly:grob-default-font grob)
               "dots.dot"))
          (stencil empty-stencil))
     (for-each
      (lambda (dp)
        (set! stencil (ly:stencil-add stencil
                        (ly:stencil-translate-axis
                         dot (* dp (/ staff-space 2)) Y))))
      dot-positions)
     stencil))

% With the procedure above we can define custom bar lines, for example,
% that resemble standard repeat sign bar lines except that there are
% three dots at staff positions -3, 0, and 3.

#(add-bar-glyph-print-procedure "*" (make-custom-dot-bar-line '(-3 0 3)))
\defineBarLine ".|*" #'("" "*" "")
\defineBarLine "*|." #'("" "*" "")

% We can also customize the dot positions used in all default repeat
% signs by redefining the print procedure of the colon bar glyph (":").
% On a staff with line positions of `(-4 -2 2 4)`, the default repeat
% sign dots appear at `(-3 3)`, but we can put them at `(-1 1)` instead.
#(add-bar-glyph-print-procedure ":" (make-custom-dot-bar-line '(-1 1)))


\new Staff \with {
  \override StaffSymbol.line-positions = #'(-4 -2 2 4)
  \override StaffSymbol.staff-space = #1.3
} \relative f' {
  g1 \bar ".|*"
  g \bar "*|."
  g \bar ".|:-|"
  g \bar ":|."
  g |
  \repeat volta 2 { g }
}



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