%% 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/generate-special-note-head-shapes.ly"
\sourcefileline 0
%% DO NOT EDIT this file manually; it was automatically
%% generated from the LilyPond Wiki
%% (https://wiki.lilypond.community).
%%
%% Make any changes in the Wiki itself, or in
%% `Documentation/snippets/new/`, then run
%% `scripts/auxiliar/makelsr.pl`.
%%
%% This file is in the public domain.

\version "2.24.0"

\header {
%% Translation of GIT committish: 1abe87de51b9b00a391da1be4cf4b5ebe4021ca9
  texidocfr = "
Lorsque le profil spécifique d'une tête de note ne peut être obtenu
facilement à l'aide d'un @emph{markup} graphique, il est possible
d'utiliser des instructions de dessin pour @code{ly:make-stencil} afin
de générer ce profil. Cet exemple propose une tête de note profilée en
parallélogramme.

Malheureusement, les commandes disponibles pour spécifier le dessin ne
sont pas documentées à ce jour -- c'est l'objet du
@uref{https://gitlab.com/lilypond/lilypond/-/issues/6874,ticket #6874}
-- mais la sous-commande @code{path} a la signature suivante, très
proche de la fonction Scheme @code{make-path-stencil}.

@example
(path @var{épaisseur} @var{liste-commandes} @var{style-ligne-principale} @var{style-jonction-ligne} @var{remplissage})
@end example

Les commandes dans @var{liste-commandes} ressemblent aux instructions de
dessin en PostScript, à ceci près que les arguments suivent ici le nom
de la commande.
"
  doctitlefr = "Génération de notes profilées spéciales"

  categories = "Editorial annotations, Scheme, Tweaks and overrides"

  texidoc = "
When a note head with a special shape cannot easily be generated with
graphic markup, a drawing specification for @code{ly:make-stencil} can
be used to generate the shape. This snippet gives an example for a
parallelogram-shaped note head.

Unfortunately, the available commands in a drawing specification are
currently not documented (this is tracked in
@uref{https://gitlab.com/lilypond/lilypond/-/issues/6874,Issue #6874});
in any case, the used @code{path} sub-command has the following
signature, quite similar to the @code{make-path-stencil} Scheme
function.

@example
(path @var{thickness} @var{command-list} @var{line-cap-style} @var{line-join-style} @var{fill})
@end example

The commands in @var{command-list} resemble PostScript drawing
commands but with arguments after the command name.
"

  doctitle = "Generate special note head shapes"
} % begin verbatim


parallelogram =
  #(ly:make-stencil
    '(path 0.1
           (rmoveto 0 0.25
            lineto 1.2 0.75
            lineto 1.2 -0.25
            lineto 0 -0.75
            lineto 0 0.25)
           round
           round
           #t)
    (cons -0.05 1.25)
    (cons -.75 .75))

myNoteHeads = \override NoteHead.stencil = \parallelogram
normalNoteHeads = \revert NoteHead.stencil

\relative c'' {
  \myNoteHeads
  g4 d'
  \normalNoteHeads
  <f, \tweak stencil \parallelogram b e>4 d
}



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