]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/changing-midi-output-to-one-channel-per-voice.ly
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond into...
[lilypond.git] / Documentation / snippets / changing-midi-output-to-one-channel-per-voice.ly
1 %% Do not edit this file; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% This file is in the public domain.
4 \version "2.12.2"
5
6 \header {
7   lsrtags = "contexts-and-engravers, midi"
8
9 %% Translation of GIT committish: fa19277d20f8ab0397c560eb0e7b814bd804ecec
10   texidoces = "
11 Al producir una salida MIDI, el comportamiento predeterminado es
12 que cada pentagrama representa un canal MIDI, con todas las voces
13 de dicho pentagrama mezcladas.  Esto reduce al mínimo el riesgo de
14 que se agote el número de canales MIDI disponibles, pues existe un
15 máximo de 16 canales por pista.
16
17 Sin embargo, cuando se traslada el interpretador
18 @code{Staff_performer} al contexto @code{Voice}, cada voz de un
19 pentagrama puede tener su propio canal MIDI, como se muestra en el
20 siguiente ejemplo: a pesar de estar sobre el mismo pentagrama, se
21 crean dos canales MIDI, cada uno con un @code{midiInstrument}
22 distinto.
23
24 "
25   doctitlees = "Modificar la salida MIDI para que tenga un canal por cada voz"
26
27 %% Translation of GIT committish: d7cf09411ee80eaf0092af0aa532de64c0c6248e
28   texidocfr = "
29 Lorsque LilyPond génère un fichier MIDI, chaque portée sera par défaut
30 affectée à un canal, quel que soit le nombre de voix qu'elle contient.
31 Ceci permet d'éviter de se retrouver à court de canaux, sachant qu'il
32 n'y en a que seize de disponibles.
33
34 Le fait de déplacer le @code{Staff_performer} dans le contexte
35 @code{Voice} permet d'affecter à chaque voix d'une même portée un canal
36 MIDI spécifique.  Dans l'exemple suivant, la même portée donnera lieu à
37 deux canaux MIDI différents, chacun étant affecté de son propre
38 @code{midiInstrument}.
39
40 "
41   doctitlefr = "Affectation d'un canal MIDI par voix"
42
43   texidoc = "
44 When outputting MIDI, the default behavior is for each staff to
45 represent one MIDI channel, with all the voices on a staff amalgamated.
46 This minimizes the risk of running out of MIDI channels, since there
47 are only 16 available per track.
48
49 However, by moving the @code{Staff_performer} to the @code{Voice}
50 context, each voice on a staff can have its own MIDI channel, as is
51 demonstrated by the following example: despite being on the same staff,
52 two MIDI channels are created, each with a different
53 @code{midiInstrument}.
54
55 "
56   doctitle = "Changing MIDI output to one channel per voice"
57 } % begin verbatim
58
59 \score {
60   \new Staff <<
61     \new Voice \relative c''' {
62       \set midiInstrument = #"flute"
63       \voiceOne
64       \key g \major
65       \time 2/2
66       r2 g-"Flute" ~
67       g fis ~
68       fis4 g8 fis e2 ~
69       e4 d8 cis d2
70     }
71     \new Voice \relative c'' {
72       \set midiInstrument = #"clarinet"
73       \voiceTwo
74       b1-"Clarinet"
75       a2. b8 a
76       g2. fis8 e
77       fis2 r
78     }
79   >>
80   \layout { }
81   \midi {
82     \context {
83       \Staff
84       \remove "Staff_performer"
85     }
86     \context {
87       \Voice
88       \consists "Staff_performer"
89     }
90     \context {
91       \Score
92       tempoWholesPerMinute = #(ly:make-moment 72 2)
93     }
94   }
95 }
96