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

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

Re: Arranger.ly dispatch-chords


From: Clément CAILLOL
Subject: Re: Arranger.ly dispatch-chords
Date: Mon, 2 Nov 2020 16:18:52 +0000

Merci beaucoup ! Je vais essayer de comprendre comment ça fonctionne, et je vais utiliser ça !

Clément Caillol


From: Gilles Thibault <gillesth@free.fr>
Sent: Monday, November 2, 2020 3:01:01 PM
To: Clement Caillol <ccazerty@hotmail.fr>
Cc: lilypond-user-fr@gnu.org <lilypond-user-fr@gnu.org>; lilypond-user-fr <lilypond-user-fr-bounces+gillesth=free.fr@gnu.org>
Subject: Re: Arranger.ly dispatch-chords
 
> La première c'est de n'avoir qu'un accord dans chaque musique :
>
> chordI= {<c c' e' g' c'' e'' c'''>4 r4 r2}
> chordII= {<g b d' g' b' d'' b'' d'''>4 r4 r2}
> chordIII= {<fis a d' a' c'' d'' a'' c'''>4 r4 r2}
>
> #(begin
>   (dispatch-chords '(fl1 (fl2 htb1) (htb2 tp1) cor1 tp2 (fag1 cor2)
> fag2) 21 chordI)
>   (dispatch-chords '(fl1 fl2 (htb1 tp1) htb2  tp2 (cor1 fag1) fag2
> cor2) 23 chordII)
>   (dispatch-chords '(fl1 fl2 (tp1 tp2) htb1 htb2 (cor1 cor2) fag1 fag2
> ) 25 chordIII)
>
>   )
>

Bon moi pour le moment, j'ai toujours fait en adaptant l'accord à la
liste d'instrument mais je reconnais qu'il faut effectivement beaucoup
se concentrer quand l'orchestration est importante.
Ci dessous 2 methodes pour adapter la liste d'instruments à chaque
accord. La méthode 2 devrait ressembler à ce que vous demandez. La
méthode 1 est celle que vous avez donnée, et est là pour vérifier que la
2 produit le même résultat.
À expérimenter et probablement améliorer.

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

\version "2.20.0"
\include "arranger.ly"

%%%%%%%%%%%%%% Préparation

#(define* (part-combine-instru instru1 instru2 #:optional (clef
"treble"))
(sim  ; << ... >>
   (make-clef-set clef)
   global
   #{ \set Staff.instrumentName = \markup \center-column {
          #(symbol->string instru1)    % 'fl1 -> "fl1"
          #(symbol->string instru2)
          } #}
   (part-combine (obj->music instru1)  ; 'fl1 -> \fl1
                 (obj->music instru2))))

global = s1*10
vents = #'(fl1 fl2 htb1 htb2 fag1 fag2 tp1 tp2 cor1 cor2)
#(init vents)

%%%%%%%%%%%%%% méthode accord par accord

chordI= {<c c' e' g' c'' e'' c'''>4 r4 r2}
chordII= {<g b d' g' b' d'' b'' d'''>4 r4 r2}
chordIII= {<fis a d' a' c'' d'' a'' c'''>4 r4 r2}

#(begin
   (dispatch-chords '(fl1 (fl2 htb1) (htb2 tp1) cor1 tp2 (fag1 cor2)
fag2) 2 chordI)
   (dispatch-chords '(fl1 fl2 (htb1 tp1) htb2  tp2 (cor1 fag1) fag2 cor2)
3 chordII)
   (dispatch-chords '(fl1 fl2 (tp1 tp2) htb1 htb2 (cor1 cor2) fag1 fag2 )
4 chordIII)
   )

\markup "méthode accord par accord"
{ <<
   \new Staff $(part-combine-instru 'fl1 'fl2)
   \new Staff $(part-combine-instru 'htb1 'htb2)
   \new Staff $(part-combine-instru 'tp1 'tp2)
   \new Staff $(part-combine-instru 'cor1 'cor2)
   \new Staff $(part-combine-instru 'fag1 'fag2 "bass")

>> }


%%%%%% méthode tous les accords dans une seule musique
#(init vents) % efface le travail précédent
chords = { \chordI \chordII \chordIII } % les accords mis à la suite

#(begin
(for-each
    (lambda(instrus where chord)
       (dispatch-chords instrus where chord))
     ;; une liste de liste d'instruments
    '((fl1 (fl2 htb1) (htb2 tp1) cor1 tp2 (fag1 cor2) fag2)
      (fl1 fl2 (htb1 tp1) htb2  tp2 (cor1 fag1) fag2 cor2)
      (fl1 fl2 (tp1 tp2) htb1 htb2 (cor1 cor2) fag1 fag2))
    '(2 3 4)  ; la liste des positions pour chaque accords.
              ; On peut mettre aussi : (iota 3 2)
    (extract-named-music chords 'EventChord)) ; liste des accords
(fonction Lilypond)
;; On doit maintenant mettre le bon rythme aux accords.
;; Ici on récupère celui de chords mais on peut créer son propre pattern
(apply-to vents (set-pat chords #t) 2 5)
)

\markup "méthode tous les accords dans une seule musique"
{ <<
   \new Staff $(part-combine-instru 'fl1 'fl2)
   \new Staff $(part-combine-instru 'htb1 'htb2)
   \new Staff $(part-combine-instru 'tp1 'tp2)
   \new Staff $(part-combine-instru 'cor1 'cor2)
   \new Staff $(part-combine-instru 'fag1 'fag2 "bass")

>> }



--
Gilles

reply via email to

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