Bonjour,
Sur une ancienne partition (2.22.0) j'avais cherché et trouvé un code pour afficher une double Mark
Suite à un convert-ly (vers la version 2.2.13), ce code ne fonctionne plus, le journal indique une "erreur fatale : impossible de trouver l'objet de type musique : MarkEvent"
L'idée c'était d'avoir une mark en fin de ligne
et une autre marque au début de la ligne suivante
Ma question : Peut-on modifier un peu ce code pour qu'il fonctionne à nouveau ?
ou bien existe-t-il une nouvelle fonction qui ferait la même chose ?
Voici comment j'utilisais dans la partition :
\once\override Score.RehearsalMark.break-visibility = #end-of-line-visible
\once\override Score.RehearsalMark.self-alignment-X = #RIGHT
\doubleMark
\markup {\hspace #8 \column { \fontsize #-2 { \line { texte 1 } \line { en fin de ligne }}}
\rounded-box { \musicglyph "scripts.coda" }}
\markup { \rounded-box "Module 2"
\column { \fontsize #-2 { \line { texte 2 }
\line { au début de }
\line { la ligne suivante} }} }
Voici le code que j'utilisais :
#(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
(parser location 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))))
texte = {
\override TextScript.extra-spacing-width = #'(0 . 0)
\override TextScript.Y-offset = #0
\override TextScript.outside-staff-priority = ##f
\override TextScript.self-alignment-X = #LEFT
\override Stem.transparent = ##t
\override NoteHead.transparent = ##t
\override NoteHead.no-ledgers = ##t
}