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