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