Subject: 2 marks consécutifs

From: Martial R <[email-masked]>
Date: Wed, 22 Sep 2021 16:48:22 +0200

Bonjour
suite à une "rejet d'un événement : « mark-event »"

http://lilybin.com/znmpug/1
%------------------------
\version "2.23.2"
 \relative c' {
    c1
    \tweak #'break-visibility #end-of-line-visible
    \mark "Fin" \bar "|.|"
    \break
    % 2 \mark simultanés le 2e suivant le break est supprimé
    \mark "2e Partie"  e
  }
%---------------------------

Y-a-t-il une autre solution plus simple que celle-ci :
https://lists.gnu.org/archive/html/lilypond-user-fr/2011-08/msg00026.html

Lilydialement
-- 
Martial Rameaux

---

From: Vincent Gay <[email-masked]>
Date: Wed, 22 Sep 2021 17:11:48 +0200

Oui, il y a ça : https://lsr.di.unimi.it/LSR/Snippet?id=977

un exemple tout simple

\version "2.22.1"

% doubleMark permet d'écrire des mark en fin de ligne ET en début de 
ligne suivante
% ex:
%   \once\override Score.RehearsalMark.break-visibility = 
#end-of-line-visible
%   \once\override Score.RehearsalMark.self-alignment-X = #RIGHT
%   \doubleMark
%    \markup {\bold "D.S. al Coda"}
%   \markup { \box \fontsize #2 \musicglyph "scripts.coda" }

#(define-public (string-or-markup-or-boolean? e)
    (or (string? e) (markup? e) (boolean? e)))

#(define (double-rehearsalmark-stencil grob)
    (let*
     ((grobs-event (ly:grob-property grob 'cause '()))
      (left-label (ly:event-property grobs-event 'left-label))
      (right-label (ly:event-property grobs-event 'right-label))
      (gap (ly:grob-property grob 'gap 1.4)))
     (case (ly:item-break-dir grob)
       ((-1)
        (if (boolean? left-label) empty-stencil
            (grob-interpret-markup grob
                                   (make-right-align-markup left-label))))
       ((1)
        (if (boolean? right-label) empty-stencil
            (grob-interpret-markup grob
                                   (make-left-align-markup right-label))))
       (else
        (if (boolean? left-label)
            (grob-interpret-markup grob
                                   (if left-label
                                       (make-center-align-markup 
right-label)
                                       (make-left-align-markup 
right-label)))
            (if (boolean? right-label)
                (grob-interpret-markup grob
                                       (if right-label
(make-center-align-markup left-label)
                                           (make-right-align-markup 
left-label)))
                (ly:stencil-add
                 (ly:stencil-translate
                  (grob-interpret-markup grob
                                         (make-right-align-markup 
left-label))
                  (cons (* -0.5 gap) 0.0))
                 (ly:stencil-translate
                  (grob-interpret-markup grob
                                         (make-left-align-markup 
right-label))
                  (cons (* 0.5 gap) 0.0)))))))))

doubleMark =
#(define-music-function
   (left-string right-string)
   (string-or-markup-or-boolean? string-or-markup-or-boolean?)
   (if (and (boolean? left-string) (boolean? right-string))
       (ly:warning "~a \\doubleMark - at least one string or markup 
required" (*location*)))
   (make-music 'SequentialMusic
               'elements (list
                          (make-music 'ContextSpeccedMusic
                                      'context-type 'Score
                                      'element
                                      (make-music 'OverrideProperty
                                                  'symbol 'RehearsalMark
                                                  'grob-value 
double-rehearsalmark-stencil
'grob-property-path (list 'stencil)
                                                  'pop-first #t
                                                  'once #t))
                          (make-music 'ContextSpeccedMusic
                                      'context-type 'Score
                                      'element
                                      (make-music 'OverrideProperty
                                                  'symbol 'RehearsalMark
                                                  'grob-value #f
'grob-property-path (list 'self-alignment-X)
                                                  'pop-first #t
                                                  'once #t))
                          (make-music 'ContextSpeccedMusic
                                      'context-type 'Score
                                      'element
                                      (make-music 'OverrideProperty
                                                  'symbol 'RehearsalMark
                                                  'grob-value `#(,(not 
(boolean? left-string))
#t
,(not (boolean? right-string)))
'grob-property-path (list 'break-visibility)
                                                  'pop-first #t
                                                  'once #t))
                          (make-music 'MarkEvent
                                      'label #f
                                      'left-label (if (string? left-string)
(make-simple-markup left-string)
                                                      left-string)
                                      'right-label (if (string? 
right-string)
(make-simple-markup right-string)
right-string)
                                      'origin (*location*)))))

\relative c'' {

   \repeat unfold 4 c1 \break \bar ".|"
     \doubleMark
   \markup {\with-color #red \bold "D.S. al Coda"}
   \markup { \with-color #red \musicglyph "scripts.coda" }

   \repeat unfold 4 c1 \bar ".."
}

-- 
Vincent Gay
Envoyé depuis mon saxo-phone :)
https://myrealbook.vintherine.org/  -http://photos.vintherine.org/

---

From: Martial R <[email-masked]>
Date: Wed, 22 Sep 2021 17:37:19 +0200

Ha j'avais vu,  mais mal utilisé.
J'ai compris le système.
C'est plus simple je reprends mon fichier.
Merci
http://lilybin.com/tg6v0t/2

Le mer. 22 sept. 2021 à 17:13, Vincent Gay <[email-masked]> a écrit :

> % doubleMark permet d'écrire des mark en fin de ligne ET en début de ligne
> suivante
> % ex:
> left-label)
> Envoyé depuis mon saxo-phone :)https://myrealbook.vintherine.org/ - http://photos.vintherine.org/
>
>

-- 
Martial Rameaux