« Introduction à LilyPond/Gestion de partitions volumineuses » : différence entre les versions

Contenu supprimé Contenu ajouté
He7d3r (discussion | contributions)
m -code invalid in HTML5: <font> was deprecated a long time ago; use of CSS to format, instead of superfluous (and obsolete) "big" tags
Ligne 1 :
{{lilypond}}
 
<div style="font-size: 170%; margin: 1em 0 0 0; border-bottom: 1px solid #aaa; padding: 0.2em 0;">7. Gestion de partitions volumineuses</div>
<br />
<big><big><big>7. Gestion de partitions volumineuses </big></big></big>
----
 
Une partition peut vite devenir volumineuse, surtout lorsqu'elle contient plusieurs voix. Pour vous aider à gérer cette situation, LilyPond dispose de trois outils : les commentaires, les variables et la possibilité de scinder la partition en plusieurs fichiers. Par ailleurs, il y a la possibilité de créer plusieurs partitions dans un même document, comme par exemple les différentes pièces d'une œuvre. Enfin, la gestion des voix nécessite un peu de rigueur, et la mise en place de certains éléments peut faciliter le déchiffrage par les musiciens.
 
Ligne 16 ⟶ 13 :
 
; Exemple
<fontspan colorstyle="color: #00AA00;">{</fontspan>c4 c c d e2 d c4 e d d c1<fontspan colorstyle="color: #00AA00;">}</fontspan> <fontspan colorstyle="color: #AA0000;">% thème de base</fontspan>
 
Vous pouvez définir tout un bloc de commentaires, c'est-à-dire plusieurs lignes. Un bloc de commentaire est ouvert par <code>%{</code> et est fermé par <code>%}</code>.
Ligne 23 ⟶ 20 :
 
; Exemple
<fontspan colorstyle="color: #AA0000A00;">%{
*********************
* *
Ligne 29 ⟶ 26 :
* *
*********************
%}</fontspan>
 
Les commentaires permettent aussi de faire des essais : plutôt que de modifier une ligne, vous pouvez la mettre en commentaire, la copier et modifier la copie, ce qui permet de revenir en arrière facilement.
 
; Exemple
<fontspan colorstyle="color: #AA0000;">% {<c e>4 <d f> <e g>}</fontspan>
<fontspan colorstyle="color: #00AA00;"><<</fontspan>
<fontspan colorstyle="color: #0000AA;">{</fontspan>c4 d e<fontspan colorstyle="color: #0000AA;">}</fontspan>
<fontspan colorstyle="color: #0000AA;">{</fontspan>e f g<fontspan colorstyle="color: #0000AA;">}</fontspan>
<fontspan colorstyle="color: #00AA00;">>></fontspan>
 
== Les variables ==
Ligne 53 ⟶ 50 :
; Exemple
: ''Frère Jacques'' en canon
ThemePremier = <fontspan colorstyle="color: #00AA00;">{</fontspan>
c4 d e c c d e c
<fontspan colorstyle="color: #00AA00;">}</fontspan>
ThemeSecond = <fontspan colorstyle="color: #00AA00;">{</fontspan>
e4 f g2 e4 f g2
<fontspan colorstyle="color: #00AA00;">}</fontspan>
<fontspan colorstyle="color: #00AA00;"><<</fontspan>
<fontspan colorstyle="color: #0000AA;">\new Staff {</fontspan>
\ThemePremier
\ThemeSecond
<fontspan colorstyle="color: #0000AA;">}</fontspan>
<fontspan colorstyle="color: #0000AA;">\new Staff {</fontspan>
R1*2
\ThemePremier
<fontspan colorstyle="color: #0000AA;">}</fontspan>
<fontspan colorstyle="color: #00AA00;">>></fontspan>
 
Si vous travaillez avec plusieurs voix, une bonne pratique consiste à définir chaque voix dans une variable portant un nom explicite, puis d'utiliser ces variables dans une deuxième partie de fichier qui sera assez courte.
Ligne 79 ⟶ 76 :
\version "''version''"
<fontspan colorstyle="color: #AA0000A00;">%{
***********************
* *
Ligne 85 ⟶ 82 :
* *
***********************
%}</fontspan>
<fontspan colorstyle="color: #AA0000;">% ***** Chant *****</fontspan>
PartieChant = {
Ligne 93 ⟶ 90 :
}
<fontspan colorstyle="color: #AA0000;">% ***** Guitare *****</fontspan>
PartieGuitare = {
Ligne 101 ⟶ 98 :
<fontspan colorstyle="color: #AA0000A00;">%{
**************************
* *
Ligne 107 ⟶ 104 :
* *
**************************
%}</fontspan>
<fontspan colorstyle="color: #00AA000A0;">\score {
<<</fontspan>
<fontspan colorstyle="color: #0000AA;">\new Staff {</fontspan>
\set Staff.instrument = "Chant"
\set Staff.instr = "Ch."
\PartieChant
<fontspan colorstyle="color: #0000AA;">}</fontspan>
<fontspan colorstyle="color: #0000AA;">\addlyrics {</fontspan>
''paroles''
<fontspan colorstyle="color: #0000AA;">}</fontspan>
<fontspan colorstyle="color: #0000AA00A;">\new StaffGroup {
<<</fontspan>
<fontspan colorstyle="color: #AAAA00;">\new Staff {</fontspan>
\set Staff.instrument = "Guitare"
\set Staff.instr = "Gtr."
\clef "G_8"
\PartieGuitare
<fontspan colorstyle="color: #AAAA00;">}</fontspan>
<fontspan colorstyle="color: #AAAA00;">\new TabStaff {</fontspan>
\PartieGuitare
<fontspan colorstyle="color: #AAAA00;">}</fontspan>
<fontspan colorstyle="color: #0000AA00A;">>>
}</fontspan>
<fontspan colorstyle="color: #00AA000A0;">>>
}</fontspan>
(Voir le [[Introduction à LilyPond/Notation spécifique à certains instruments#Tablature|chapitre suivant]] pour l'explication de <code>TabStaff</code>.)
 
Ligne 153 ⟶ 150 :
; Exemple
: Le fichier <code>chant.LY</code> contient
<fontspan colorstyle="color: #AA0000;">% ***** Chant *****</fontspan>
PartieChant = {
Ligne 160 ⟶ 157 :
: le fichier <code>guitare.LY</code> contient
<fontspan colorstyle="color: #AA0000;">% ***** Guitare *****</fontspan>
PartieGuitare = {
Ligne 168 ⟶ 165 :
\version "''version''"
<fontspan colorstyle="color: #AA0000A00;">%{
***********************
* *
Ligne 174 ⟶ 171 :
* *
***********************
%}</fontspan>
\include "chant.ly"
\include "guitare.ly"
<fontspan colorstyle="color: #AA0000A00;">%{
**************************
* *
Ligne 185 ⟶ 182 :
* *
**************************
%}</fontspan>
<fontspan colorstyle="color: #00AA000A0;">\score {
<<</fontspan>
<fontspan colorstyle="color: #0000AA;">\new Staff {</fontspan>
\set Staff.instrument = "Chant"
\set Staff.instr = "Ch."
\PartieChant
<fontspan colorstyle="color: #0000AA;">}</fontspan>
<fontspan colorstyle="color: #0000AA;">\addlyrics {</fontspan>
''paroles''
<fontspan colorstyle="color: #0000AA;">}</fontspan>
<fontspan colorstyle="color: #0000AA00A;">\new StaffGroup {
<<</fontspan>
<fontspan colorstyle="color: #AAAA00;">\new Staff {</fontspan>
\set Staff.instrument = "Guitare"
\set Staff.instr = "Gtr."
\clef "G_8"
\PartieGuitare
<fontspan colorstyle="color: #AAAA00;">}</fontspan>
<fontspan colorstyle="color: #AAAA00;">\new TabStaff {</fontspan>
\PartieGuitare
<fontspan colorstyle="color: #AAAA00;">}</fontspan>
<fontspan colorstyle="color: #0000AA00A;">>>
}</fontspan>
<fontspan colorstyle="color: #00AA000A0;">>>
}</fontspan>
 
== Plusieurs partitions ==
 
Il est possible de mettre plusieurs partitions, contenues dans un contexte <code>\score {…}</code>, dans un même document. Pour cela, il faut utiliser un contexte global <fontspan id = "book1"><code>\book {…}</code></fontspan> (littéralement « livre ») qui contient les différentes partitions.
 
Il peut alors y avoir :
Ligne 230 ⟶ 227 :
 
; Exemple
<fontspan style="color: = "#AA0000;">\book {</fontspan>
<fontspan style="color: = "#00AA00;">\header {</fontspan>
title = <fontspan style="color: = "#0000AA;">\markup {</fontspan>
"Sonate en si" \flat " majeur pour deux hautbois"
<fontspan style="color: = "#0000AA;">}</fontspan>
composer = "Haendel"
<fontspan style="color: = "#00AA00;">}</fontspan>
<fontspan style="color: = "#00AA00;">\score {</fontspan>
<fontspan style="color: = "#0000AA;">\header {</fontspan> piece = "Adadgio" <fontspan style="color: = "#0000AA;">}</fontspan>
''musique''
<fontspan style="color: = "#00AA00;">}</fontspan>
<fontspan style="color: = "#00AA00;">\score {</fontspan>
<fontspan style="color: = "#0000AA;">\header {</fontspan> piece = "Allegro" <fontspan style="color: = "#0000AA;">}</fontspan>
''musique''
<fontspan style="color: = "#00AA00;">}</fontspan>
<fontspan style="color: = "#AA0000;">}</fontspan>
 
== Gestion des voix ==
Ligne 261 ⟶ 258 :
; Exemple
 
<fontspan style="color: = "#AA0000;">\score {</fontspan>
<fontspan style="color: = "#00AA00;">\new ChoirStaff {</fontspan>
<fontspan style="color: = "#0000AA;">\new Staff = "duo" {</fontspan>
<fontspan style="color: = "#AAAA00;">\new Voice = "VoixUn" {</fontspan>
<fontspan style="color: = "#AAAA00;">}</fontspan> \\
<fontspan style="color: = "#AAAA00;">\new Voice = "VoixDeux" {</fontspan>
<fontspan style="color: = "#AAAA00;">}</fontspan>
<fontspan style="color: = "#0000AA;">}</fontspan>
<fontspan style="color: = "#00AA00;">}</fontspan>
<fontspan style="color: = "#0000AA;">\new Staff = "VoixBasse" {</fontspan>
<fontspan style="color: = "#0000AA;">}</fontspan>
<fontspan style="color: = "#00AA00;">}</fontspan>
<fontspan style="color: = "#00AA00;">\new PianoStaff {</fontspan>
<fontspan style="color: = "#0000AA;">\new Staff = "PianoAigu" {</fontspan>
<fontspan style="color: = "#0000AA;">}</fontspan>
<fontspan style="color: = "#0000AA;">\new Staff = "PianoGrave" {</fontspan>
<fontspan style="color: = "#0000AA;">}</fontspan>
<fontspan style="color: = "#00AA00;">}</fontspan>
<fontspan style="color: = "#AA0000;">}</fontspan>
 
== Aide au déchiffrage ==
Ligne 311 ⟶ 308 :
 
; Exemple
<fontspan colorstyle="color: #AA0000;">\score {</fontspan>
<fontspan colorstyle="color: #00AA00;">\new Staff \relative c' {</fontspan>
\set Score.skipBars = ##t
Ligne 319 ⟶ 316 :
R1*18
<fontspan colorstyle="color: #0000AA;"><<</fontspan>
{\set fontSize = #-4 <fontspan colorstyle="color: #AAAA00;">% notes citées plus petite</fontspan>
bes'2^"hautbois" c a1 <fontspan colorstyle="color: #AAAA00;">% thème cité</fontspan>
} \\
{ r1 r1 } <fontspan colorstyle="color: #AAAA00;">% derniers silences de la partie</fontspan>
<fontspan colorstyle="color: #0000AA;">>></fontspan>
a16 bes c d e4
<fontspan colorstyle="color: #00AA00;">}</fontspan>
<fontspan colorstyle="color: #AA0000;">}</fontspan>
 
Il y a possibilité d'« automatiser » cela en utilisant les fonctions <code>\addquote</code> et <code>\quoteDuring</code> ou <code>\cueDuring</code>.