Subject: Re: mesures d'égale longueur

From: NOreply <[email-masked]>
Date: Fri, 1 Feb 2019 03:41:21 -0700 (MST)

Bonjour,
Je pense qu'il est possible d'écrire une grille d'accord assez facilement,
avec peu d'ajustements manuels.
Il faut que les mesures soient effectivement d'égales longueurs. 
Un changement de chiffrage doit être possible. 
On doit pouvoir écrire une mesure de 1° fois et une mesure de 2° fois.
On doit pouvoir choisir le nombre de mesures par ligne. 
On doit pouvoir indiquer le rythme souhaité. 
On doit pouvoir diviser les mesures en 2, 3, 4...
ça doit être facile à réaliser.

Voir ici:
http://lilybin.com/2yg9pw/1

Su cet exemple, il y a une seule correction manuelle au niveau de la 3°
ligne, à cause du rythme, mais pas de correction manuelle au niveau de la
division des mesures.

Voici une grille  vierge:
http://lilybin.com/l4044v/1

Pour diviser les mesures, il faut utiliser les commande \/, \X, \Y, \RV,
\VR.
Avec ces commandes, les accords sont placées de manière automatique. 
La commande \/ attend 2 accords.
\X attend 4 accords
\Y et \T attendent 3 accords
\RV et  \VR attendent 3 accords.

Les chiffrages de mesures perturbent la longueur des mesures, il faut les
indiquer dans un markup comme dans mon exemple ici:
http://lilybin.com/2yg9pw/1

Les barres de reprise perturbent légèrement la longeur des mesures, mais ça
passe.

%%%%%%%%%%%%% Ci dessous le code de mon 1° exemple (plus bas le code du
fichier vierge à remplir)

\version "2.18.2"

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Le code pour les divisions des mesures
"\\/" =  #(define-music-function (parser location m1 m2 ) 
            (   ly:music? ly:music?  ) 
            #{ { 
              \mark \markup  {
                \postscript # "
0 -12.8 moveto 
26 12 rlineto
stroke
" }          \override ChordName.font-size = -1
              \once \override  ChordName.extra-offset = #'(  1 . 10 ) 
              #m1
              \once \override  ChordName.extra-offset = #'(  2 . 5 ) 
              #m2  
              \override ChordName.font-size = 2
               }
            #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
X =  #(define-music-function (parser location m1 m2 m3 m4 ) 
        (   ly:music? ly:music? ly:music? ly:music?  ) 
        #{ { 
          \mark \markup  {
            \postscript # "
0 -12.8 moveto 
26.5 11.9 rlineto
0 -0.9 moveto
26.5 -11.9 rlineto
stroke
" }            \override ChordName.font-size = -2
          \once \override  ChordName.extra-offset = #'(  0 . 7 ) 
          #m1
          \once \override  ChordName.extra-offset = #'(  2.5 . 11.5 ) 
          #m2  
          \once \override  ChordName.extra-offset = #'(  4 . 8 )  
          #m3
          \once \override  ChordName.extra-offset = #'(  -11 . 4 )  
          #m4 
          \override ChordName.font-size = 2
           }
        #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Y =  #(define-music-function (parser location m1 m2 m3 ) 
        (   ly:music? ly:music? ly:music?   ) 
        #{ { 
          \mark \markup  {
            \postscript # "
0 -12.8 moveto 
27.2 11.9 rlineto
0 -0.9 moveto
13 -6 rlineto
stroke
" }            \override ChordName.font-size = -2
          \once \override  ChordName.extra-offset = #'(  0 . 7 ) 
          #m1
          \once \override  ChordName.extra-offset = #'(  2.5 . 11.5 ) 
          #m2  
          \once \override  ChordName.extra-offset = #'(  2 . 5 )  
          #m3
          
          \override ChordName.font-size = 2
           }
        #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
T =  #(define-music-function (parser location m1 m2 m3  ) 
        (   ly:music? ly:music? ly:music?   ) 
        #{ { 
          \mark \markup  {
            \postscript # "
0 -12.8 moveto 
26.6 11.9 rlineto
0 -0.9 moveto
26.6 -11.9 rlineto
stroke
" }            \override ChordName.font-size = -2
          \once \override  ChordName.extra-offset = #'(  0 . 7 ) 
          #m1
          \once \override  ChordName.extra-offset = #'(  2.5 . 11.5 ) 
          #m2  
          \once \override  ChordName.extra-offset = #'(  4 . 8 )  
          #m3
          
          \override ChordName.font-size = 2
           }
        #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VR =  #(define-music-function (parser location m1 m2  ) 
         (   ly:music? ly:music?    ) 
         #{ { 
           \mark \markup  {
             \postscript # "
0 -12.8 moveto 
13 6 rlineto
0 -0.9 moveto
13 -6 rlineto
stroke
" }            \override ChordName.font-size = -2
           \once \override  ChordName.extra-offset = #'(  0 . 8 ) 
           #m1
           \override ChordName.font-size = 1
           \once \override  ChordName.extra-offset = #'(  8 . 8 ) 
           #m2            
           \override ChordName.font-size = 2
            }
         #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RV =  #(define-music-function (parser location m1 m2  ) 
         (   ly:music? ly:music?    ) 
         #{ { 
           \mark \markup  {
             \postscript # "
12.3 -7 moveto 
12.8 6.1 rlineto
12.3 -7 moveto 
12.8 -5.9 rlineto
stroke
" }            \override ChordName.font-size = 1
           \once \override  ChordName.extra-offset = #'(  0 . 8 ) 
           #m1
           \override ChordName.font-size = 0
           \once \override  ChordName.extra-offset = #'(  -2 . 8 ) 
           #m2            
           \override ChordName.font-size = 2
            }
         #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

\header {
  title = "Une grille d'accords"
}
\markup { \vspace  #2 }
\score {
  <<
    %% La grille
    \new Staff 
    { \override Staff.TimeSignature.break-visibility = ##(#f #t #t)
      \stopStaff 
      \override Staff.StaffSymbol.line-positions = #'( 12 -12 )
      \startStaff
      \stemDown
      \override Stem.length = #6
      \improvisationOn
     
      s1^\markup \center-column { \number 4  \number 4  } % 1
      s  % 2
      s  % 3     
      s  % 4
      \repeat volta 2 {  s1 s }  % 5 et 6     
      \alternative { { s s }      % 7 et 8
                     { s1 d4. d8 d\rest d~ d4 }   % 7' et 8'
      }
      \stopStaff  s1   s \once  \override Score.BarLine.stencil =##f  % 9 et
10
      \startStaff
      \time 3/4  s2.^\markup \center-column { \number 3  \number 4  } %11
      \repeat percent 2 {s}    s  % 12, 13, 14
      \time 4/4  s1^ \markup \center-column { \number 4  \number 4  } 
      s s \stopStaff  s \once  \override Score.BarLine.stencil =##f 
      \startStaff
      s s s s
    } 
    %% les accords     

    \chords {     
      c1  %1
      \/ g2 f  %2
      \X  c4:sus4 d:min7 e f:min7 % 3
      f1 \break % 4
      %__________________________________      
      \Y  c4 g  c2 % 5
    
      \X  c4:sus4 d:min7 e f:min7 % 6
      d1 \/ e2 d \break % 7 et 8 
      \once \override  ChordName.extra-offset = #'( 5 . 12 )  
      c1:/f      % 7' 8'
      \once \override  ChordName.extra-offset = #'( 5 . 12 ) 
      g1:maj7  s  s \break % 8'
      c2.   g  s c \break % 9, 10, 11, 12
      
      \Y a4 c d2  \VR b4:min7 a2. c1 s \break %13, 14, 15
      \/ c2 g d1 \RV e2. f4  f1 % 16, 17, 18, 19
    }

  %%%%%%%%%%%%%%%%%%%%%%%%%%
  \layout {
    indent = 0
 
    \override Staff.Clef.stencil = ##f
    \omit Score.TimeSignature
 
    \context {
      \Score
 
      proportionalNotationDuration = #(ly:make-moment 1/8)
      \override BarNumber.stencil = ##f
    }
    \context {
      \ChordNames
      \override ChordName.extra-offset = #'(7 . 8.5)
    }      
  }
}

%%%%%%%%%%%%% fichier vierge

\version "2.18.2"

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Le code pour les divisions des mesures
"\\/" =  #(define-music-function (parser location m1 m2 ) 
            (   ly:music? ly:music?  ) 
            #{ { 
              \mark \markup  {
                \postscript # "
0 -12.8 moveto 
26 12 rlineto
stroke
" }          \override ChordName.font-size = -1
              \once \override  ChordName.extra-offset = #'(  1 . 10 ) 
              #m1
              \once \override  ChordName.extra-offset = #'(  2 . 5 ) 
              #m2  
              \override ChordName.font-size = 2
               }
            #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
X =  #(define-music-function (parser location m1 m2 m3 m4 ) 
        (   ly:music? ly:music? ly:music? ly:music?  ) 
        #{ { 
          \mark \markup  {
            \postscript # "
0 -12.8 moveto 
26.5 11.9 rlineto
0 -0.9 moveto
26.5 -11.9 rlineto
stroke
" }            \override ChordName.font-size = -2
          \once \override  ChordName.extra-offset = #'(  0 . 7 ) 
          #m1
          \once \override  ChordName.extra-offset = #'(  2.5 . 11.5 ) 
          #m2  
          \once \override  ChordName.extra-offset = #'(  4 . 8 )  
          #m3
          \once \override  ChordName.extra-offset = #'(  -11 . 4 )  
          #m4 
          \override ChordName.font-size = 2
           }
        #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Y =  #(define-music-function (parser location m1 m2 m3 ) 
        (   ly:music? ly:music? ly:music?   ) 
        #{ { 
          \mark \markup  {
            \postscript # "
0 -12.8 moveto 
27.2 11.9 rlineto
0 -0.9 moveto
13 -6 rlineto
stroke
" }            \override ChordName.font-size = -2
          \once \override  ChordName.extra-offset = #'(  0 . 7 ) 
          #m1
          \once \override  ChordName.extra-offset = #'(  2.5 . 11.5 ) 
          #m2  
          \once \override  ChordName.extra-offset = #'(  2 . 5 )  
          #m3
          
          \override ChordName.font-size = 2
           }
        #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
T =  #(define-music-function (parser location m1 m2 m3  ) 
        (   ly:music? ly:music? ly:music?   ) 
        #{ { 
          \mark \markup  {
            \postscript # "
0 -12.8 moveto 
26.6 11.9 rlineto
0 -0.9 moveto
26.6 -11.9 rlineto
stroke
" }            \override ChordName.font-size = -2
          \once \override  ChordName.extra-offset = #'(  0 . 7 ) 
          #m1
          \once \override  ChordName.extra-offset = #'(  2.5 . 11.5 ) 
          #m2  
          \once \override  ChordName.extra-offset = #'(  4 . 8 )  
          #m3
          
          \override ChordName.font-size = 2
           }
        #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VR =  #(define-music-function (parser location m1 m2  ) 
         (   ly:music? ly:music?    ) 
         #{ { 
           \mark \markup  {
             \postscript # "
0 -12.8 moveto 
13 6 rlineto
0 -0.9 moveto
13 -6 rlineto
stroke
" }            \override ChordName.font-size = -2
           \once \override  ChordName.extra-offset = #'(  0 . 8 ) 
           #m1
           \override ChordName.font-size = 1
           \once \override  ChordName.extra-offset = #'(  8 . 8 ) 
           #m2            
           \override ChordName.font-size = 2
            }
         #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RV =  #(define-music-function (parser location m1 m2  ) 
         (   ly:music? ly:music?    ) 
         #{ { 
           \mark \markup  {
             \postscript # "
12.3 -7 moveto 
12.8 6.1 rlineto
12.3 -7 moveto 
12.8 -5.9 rlineto
stroke
" }            \override ChordName.font-size = 1
           \once \override  ChordName.extra-offset = #'(  0 . 8 ) 
           #m1
           \override ChordName.font-size = 0
           \once \override  ChordName.extra-offset = #'(  -2 . 8 ) 
           #m2            
           \override ChordName.font-size = 2
            }
         #})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

\header {
  title = "Une grille d'accords"
}
\markup { \vspace  #2 }
\score {
  <<
    %% La grille
    \new Staff 
    { \override Staff.TimeSignature.break-visibility = ##(#f #t #t)
      \stopStaff 
      \override Staff.StaffSymbol.line-positions = #'( 12 -12 )
      \startStaff
      \stemDown
      \override Stem.length = #6
      \improvisationOn
   s1 s s s
   s s s s
    } 
    %% les accords     

    \chords {     

    }

  %%%%%%%%%%%%%%%%%%%%%%%%%%
  \layout {
    indent = 0
 
    \override Staff.Clef.stencil = ##f
    \omit Score.TimeSignature 
  
    \context {
      \Score
 
      proportionalNotationDuration = #(ly:make-moment 1/8)
      \override BarNumber.stencil = ##f
    }
    \context {
      \ChordNames
      \override ChordName.extra-offset = #'(7 . 8.5)
    }      
  }
}

% ; = )

--
Sent from: http://lilypond-french-users.1298960.n2.nabble.com/