lilypond-user-fr
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Espacement vertical de markups


From: éric BELLOCQ
Subject: Re: Espacement vertical de markups
Date: Fri, 26 Aug 2022 22:53:36 +0000 (UTC)

Merci beaucoup Jean.
La dernière possibilité "peu connue", sans fonction est elle documenté dans le manuel ?
Je ne trouve pas.

Sinon, il y avait un souci quand le 1er argument est de hauteur très différente.
J'ai ajouté un staff.padding qui semble bien faire l'affaire :

\version "2.22.1"

\markup cc = #center-column-markup

\score {
\new RhythmicStaff {
\textLengthOn
\override TextScript.baseline-skip = 2.5
\override TextScript.staff-padding = 3
4-\markup \cc { 11 22 }
4-\markup \cc { " " 22 }
4-\markup \cc { … 22 33 }
4-\markup \cc { x 22 33 }
4-\markup \cc { () 22 33 }
4-\markup \cc { | ²22’ 33 }
4-\markup \cc { 11 " " " " 44 }
4-\markup \cc { 11 22 (|) 44 }
}
}


Ce genre de saisie permettra de graver, entre autres, de la tablature allemande de luth renaissance.
Bien-sûr de façon purement graphique, sans lien avec une portée musicale, mais c'est déjà bien.
Pour un exemple de cette tablature :
http://www.sf-luth.org/?Histoire_du_Luth/Qu%27est-ce_qu%27une_Tablature_%3F

Éric
Le vendredi 26 août 2022, 22:57:04 UTC+2, Jean Abou Samra <jean@abou-samra.fr> a écrit :


Le 26/08/2022 à 22:38, éric BELLOCQ a écrit :
> Merci Pierre pour la fonction,
> oui le rendu est tout à fait ce que je cherche.
> Je me permets d'abuser avec une question en plus :
> est-il compliqué d'avoir un nombre d'argument variable pour éviter
> d'avoir à coder trop de d'arguments vides c-à-d les "" quand il y a
> moins de lignes que le maximum ?



C'est possible, en donnant à la fonction un seul argument de type
markup-list? au lieu de plusieurs arguments de type markup? . Par
contre, il faut alors mettre des accolades (logique, sinon
LilyPond ne pourrait pas savoir où les arguments se terminent).

\version "2.22.2"

#(define-markup-command (indic layout props args)
    (markup-list?)
    (interpret-markup layout props
    #{
      \markup
        \override #'(baseline-skip . 2.2)
        \center-column { #args }
    #}))

\score {
 \new RhythmicStaff {
   \textLengthOn
  4-\markup\indic { 11 22 }
  4-\markup\indic { 11 22) }
  4-\markup\indic { 11 33 }
  4-\markup\indic { 11 = 33 }
  4-\markup\indic { 11 22 33 }
 }
}


D'ailleurs, en réalité on n'a même pas besoin d'une fonction ici (mais
la technique est moins connue) :


\version "2.22.2"

\score {
 \new RhythmicStaff {
   \textLengthOn
   \override TextScript.baseline-skip = 2.2
  4-\markup \center-column { 11 22 }
  4-\markup \center-column { 11 22) }
  4-\markup \center-column { 11 33 }
  4-\markup \center-column { 11 = 33 }
  4-\markup \center-column { 11 22 33 }
 }
}

Et si vous trouvez le nom \center-column trop long, vous pouvez toujours
faire

\version "2.22.2"

%{
#(define-markup-command (cc layout props args) (markup-list?)
   (interpret-markup layout props #{ \markup \center-column { #args } #}))
%}
% ou en plus concis :
\markup cc = #center-column-markup

\score {
 \new RhythmicStaff {
   \textLengthOn
   \override TextScript.baseline-skip = 2.2
  4-\markup \cc { 11 22 }
  4-\markup \cc { 11 22) }
  4-\markup \cc { 11 33 }
  4-\markup \cc { 11 = 33 }
  4-\markup \cc { 11 22 33 }
 }
}


Bref, comme souvent, il y a beaucoup de possibilités.

La page de la documentation sur la définition de commandes pour
markup personnalisées est ici :

https://lilypond.org/doc/v2.23/Documentation/extending/new-markup-command-definition


Cordialement,

Jean



reply via email to

[Prev in Thread] Current Thread [Next in Thread]