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

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

Re: Accompagnement 2e demande


From: Gilles THIBAULT
Subject: Re: Accompagnement 2e demande
Date: Fri, 21 May 2010 02:01:05 +0200

Je suppose qu'il doit y avoir moyen de "bricoler" quelque chose

La proposition ci-dessous est en effet un peu du bricolage car je ne connais pas le moyen de mettre sur une même ligne des noms de notes (context NoteNames) et des noms d'accords (context ChordNames), et j'ai été obligé d'utiliser un #'extra-offset pour l'un des 2 contexts pour les aligner.Par contre, mettre les noms de notes en majuscules, et les noms d'accords en minuscules est difficile mais possible.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#(define (accidental->markup alteration) ; copier coller de "chord-name.scm"
 "Return accidental markup for ALTERATION."
 (if (= alteration 0)
     (make-line-markup (list empty-markup))
     (conditional-kern-before
      (alteration->text-accidental-markup alteration)
      (= alteration FLAT) 0.2)))

#(define (my-note-name->markup pitch) ;  voir aussi "chord-name.scm"
 "Return pitch markup for PITCH."
 (make-line-markup
  (list
   (make-simple-markup
    (vector-ref #("c" "d" "e" "f" "g" "a" "b") (ly:pitch-notename pitch)))
   (accidental->markup (ly:pitch-alteration pitch)))))

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\layout {
 \context {
   \NoteNames
   \override NoteName #'font-size = #0
\override NoteName #'stencil = #(lambda (grob) ; nom de note en majuscule
      (let ((text (ly:grob-property grob 'text)))
         (ly:grob-set-property! grob 'text (string-upcase! text))
         (ly:text-interface::print grob)))

 }
 \context {
   \ChordNames
   \override ChordName #'font-size = #-2
chordRootNamer = #my-note-name->markup % nom de la note "root" en minuscule

 }
}

global = {
 \time 3/4
 \override NoteNames.NoteName #'extra-offset = #'( 0 . 2 )
}

melodie = \relative {
   \partial 4 a'
c2 d4 | e4. f8 e4 }

basse = \relative {\partial 4 r a,4 s s e s s}
accordsNotes = \relative {
 \partial 4 s4
 s4 < e, a c> < e a c>
 s4 < e a c> < e a c>
}
accordsLettres = \chordmode {\partial 4 s
 s a:m a:m
 s a:m a:m}

music = {
 <<
  \new PianoStaff
  <<
     \new Staff <<\melodie \global>>
     \new Staff  << \clef bass \basse \accordsNotes >>
  >>
 \new ChordNames \accordsLettres
 \new NoteNames \basse
 >>
}

\score { \music }
\score {\transpose a d' \music }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Gilles





reply via email to

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