« Introduction à LilyPond/Structure du fichier » : différence entre les versions

Contenu supprimé Contenu ajouté
→‎Autre types d'éléments d'une partition : syntaxhighlight ; syntaxe plus simple
Ligne 149 :
Une portée peut avoir plusieurs voix : les mélodies jouées par deux instruments sont représentées sur la même portée, ou bien les mélodies jouées par deux mains (piano, harpe…). Une voix est un contexte <code>'''Voice'''</code>. Une portée peut alors avoir la structure suivante :
 
<syntaxhighlight lang="tex">
<code>
'''{{bleu|\new}} Staff \with {''' ''[informations sur la portée]'' '''} \relative''' ''[note de référence]'' '''{'''<br />
\clef [clef]
<span style="padding-left:1em"></span>{{bleu|'''\clef'''}} ''[clef]''<br />
<span style="padding-left:1em"></span>{{bleu|''' \key'''}} ''[tonalité]''<br />
<span style="padding-left:1em"></span>{{bleu|''' \tempo'''}} ''[durée]'' = ''[pulsation]''<br />
<span style="padding-left:1em"></span>{{bleu|''' \time'''}} ''[chiffrage de la mesure]''<br />
<<
<span style="padding-left:1em"></span>'''<<'''<br />
\new Voice {
<span style="padding-left:2em"></span>'''{{bleu|\new}} Voice {'''<br />
<span style="padding-left:3em"></span>'' [notes et indications]''<br />
\bar "|."
<span style="padding-left:3em"></span>'''{{bleu|\bar}}''' {{rouge|"<nowiki>|</nowiki>."}}<br />
}
<span style="padding-left:2em"></span>'''}'''<br />
\new Voice {
<span style="padding-left:2em"></span>'''{{bleu|\new}} Voice {'''<br />
<span style="padding-left:3em"></span>'' [notes et indications]''<br />
}
<span style="padding-left:2em"></span>'''}'''<br />
>>
<span style="padding-left:1em"></span>'''>>'''<br />
}
'''}'''
</syntaxhighlight>
</code>
 
Par exemple :
<syntaxhighlight lang="tex">
\new Staff \with { instrumentName = "Soprano" } \relative c'' {
\clef "G"
\key c \major
\tempo 4 = 60
\time 4/4
<<
\new Voice {
c2 d
e c
\bar "|."
}
\new Voice \with { instrumentName = "Ténor" } {
c,2 g'
c1,
}
>>
}
</syntaxhighlight>
 
== Création automatique ==