Insérer un objet graphique

Bonsoir/jour à tous,

je cherche à insérer à la fin d'une portée:

1. deux flèches, une vers le haut, l'autre vers la bas (pour indiquer qu'à
la portée suivante il y a division de la voix), comme ceci:

<http://lilypond-french-users.1298960.n2.nabble.com/file/n7580411/fleches1.jpeg&gt;

2. deux flèches, mais chacune sur une portée, comme ceci:

<http://lilypond-french-users.1298960.n2.nabble.com/file/n7580411/fleches2.jpeg&gt;

pour indiquer un regroupement de 2 voix sur une seule portée.

Merci pour vos lumières.

Bernard

···

-----
Cordialement

Bernard
--
View this message in context: http://lilypond-french-users.1298960.n2.nabble.com/Inserer-un-objet-graphique-tp7580411.html
Sent from the LilyPond French Users mailing list archive at Nabble.com.

Message du 01/10/13 02:14
De : "bameylan"
A : lilypond-user-fr@gnu.org
Objet : Insérer un objet graphique

Bonsoir/jour à tous,

je cherche à insérer à la fin d'une portée:

1. deux flèches, une vers le haut, l'autre vers la bas (pour indiquer qu'à
la portée suivante il y a division de la voix), comme ceci:

Regarde là :

2. deux flèches, mais chacune sur une portée pour indiquer un regroupement de 2 voix sur une seule portée.

En t'inspirant de la fonction du 1)

Ne puis tester car au boulot jusqu'à ce soir.

@+
Jean-Charles

Jean-Charles MALAHIEUDE wrote

En t'inspirant de la fonction du 1)

Ça fonctionne très bien pour les 2 flèches à 45 degrés (quoi qu'en
pinaillant un peu, leurs bases s'entrecroisent...) 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...
Jean-Charles ne te bile pas... ton boulot passe avant mes problèmes
existentiels... et merci pour le lien.

Bernard

···

-----
Cordialement

Bernard
--
View this message in context: http://lilypond-french-users.1298960.n2.nabble.com/Inserer-un-objet-graphique-tp7580411p7580413.html
Sent from the LilyPond French Users mailing list archive at Nabble.com.

Bonjour Bernard,

···

(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

}

}

}

Pierre, ton code a fait merveille, merci!

Bernard

···

-----
Cordialement

Bernard
--
View this message in context: http://lilypond-french-users.1298960.n2.nabble.com/Inserer-un-objet-graphique-tp7580411p7580415.html
Sent from the LilyPond French Users mailing list archive at Nabble.com.