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

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

Re: re: Insérer un objet graphique


From: Pierre Perol-Schneider
Subject: Re: re: Insérer un objet graphique
Date: Tue, 1 Oct 2013 11:49:57 +0200

Bonjour Bernard,

Le 1 octobre 2013 11:30, bameylan <address@hidden> a écrit :

(quoi qu'en pinaillant un peu, leurs bases s'entrecroisent...)

tu dois être en v 2.17 alors.
Ci-joint une version corrigée mais sans solution pour rapprocher les pointes de flèches.
On peut "masquer" cet espace en appliquant la valeur  #t à \arrow-at-angle
 
mais je n'ai pas réussi à isoler dans le code ce qui me permettrait de n'avoir qu'une seule flèche, en
haut ou en bas...

et voilà :

\version "2.17.27"

#(define-markup-command (arrow-at-angle layout props angle-deg length fill)

(number? number? boolean?)

(let* (

(PI-OVER-180 (/ (atan 1 1) 34))

(degrees->radians (lambda (degrees) (* degrees PI-OVER-180)))

(angle-rad (degrees->radians angle-deg))

(target-x (* length (cos angle-rad)))

(target-y (* length (sin angle-rad))))

(interpret-markup layout props

(markup

#:translate (cons (/ target-x 2) (/ target-y 2))

#:rotate angle-deg

#:translate (cons (/ length -2) 0)

#:concat (#:draw-line (cons length 0)

#:arrow-head X RIGHT fill)))))

splitStaffBarLineMarkup = \markup \with-dimensions #'(0 . 0) #'(0 . 0) {

\combine

\arrow-at-angle #45 #(sqrt 8) ##t

\arrow-at-angle #-45 #(sqrt 8) ##t

}

convDownStaffBarLineMarkup = \markup \with-dimensions #'(0 . 0) #'(0 . 0) {

\arrow-at-angle #-45 #(sqrt 8) ##t

}

convUpStaffBarLineMarkup = \markup \with-dimensions #'(0 . 0) #'(0 . 0) {

\arrow-at-angle #45 #(sqrt 8) ##t

}

splitStaffBarLine = {

\once \override Staff.BarLine.stencil =

#(lambda (grob)

(ly:stencil-combine-at-edge

(ly:bar-line::print grob)

X RIGHT

(grob-interpret-markup grob splitStaffBarLineMarkup)

0))

\break

}

convDownStaffBarLine = {

\once \override Staff.BarLine.stencil =

#(lambda (grob)

(ly:stencil-combine-at-edge

(ly:bar-line::print grob)

X RIGHT

(grob-interpret-markup grob convDownStaffBarLineMarkup)

0))

\break

}

convUpStaffBarLine = {

\once \override Staff.BarLine.stencil =

#(lambda (grob)

(ly:stencil-combine-at-edge

(ly:bar-line::print grob)

X RIGHT

(grob-interpret-markup grob convUpStaffBarLineMarkup)

0))

\break

}

\paper {

ragged-right = ##f

short-indent = 5\mm

}

\score {

<<

\new ChoirStaff <<

\new Staff \with { instrumentName = #"High I + II" } {

<<

\repeat unfold 4 f''1

\\

\repeat unfold 4 d''1

>>

\splitStaffBarLine

}

\new Staff \with { instrumentName = #"Low" } {

<<

\repeat unfold 4 b'1

\\

\repeat unfold 4 g'1

>>

}

\new Staff \with { shortInstrumentName = #"H I" } {

R1*4

\repeat unfold 2 { r4 f''2 r4 } \repeat unfold 2 e''1

\convDownStaffBarLine

}

\new Staff \with { shortInstrumentName = #"H II" } {

R1*4

\repeat unfold 4 b'2 \repeat unfold 2 c''1

\convUpStaffBarLine

}

\new Staff \with { shortInstrumentName = #"L" } {

R1*4

<<

\repeat unfold 4 g'1

\\

\repeat unfold 4 c'1

>>

}


Bonne journée,

Pierre

>>

>>

\layout {

\context {

\Staff \RemoveEmptyStaves

\override VerticalAxisGroup.remove-first = ##t

}

}

}


 

reply via email to

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