]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/changing-midi-output-to-one-channel-per-voice.ly
8949b825b4213bb3739980705a9b405269359706
[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.13.39"
5
6 \header {
7   lsrtags = "contexts-and-engravers, midi"
8
9 %% Translation of GIT committish: 5160eccb26cee0bfd802d844233e4a8d795a1e94
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   texidoc = "
28 When outputting MIDI, the default behavior is for each staff to
29 represent one MIDI channel, with all the voices on a staff amalgamated.
30 This minimizes the risk of running out of MIDI channels, since there
31 are only 16 available per track.
32
33 However, by moving the @code{Staff_performer} to the @code{Voice}
34 context, each voice on a staff can have its own MIDI channel, as is
35 demonstrated by the following example: despite being on the same staff,
36 two MIDI channels are created, each with a different
37 @code{midiInstrument}.
38
39 "
40   doctitle = "Changing MIDI output to one channel per voice"
41 } % begin verbatim
42
43 \score {
44   \new Staff <<
45     \new Voice \relative c''' {
46       \set midiInstrument = #"flute"
47       \voiceOne
48       \key g \major
49       \time 2/2
50       r2 g-"Flute" ~
51       g fis ~
52       fis4 g8 fis e2 ~
53       e4 d8 cis d2
54     }
55     \new Voice \relative c'' {
56       \set midiInstrument = #"clarinet"
57       \voiceTwo
58       b1-"Clarinet"
59       a2. b8 a
60       g2. fis8 e
61       fis2 r
62     }
63   >>
64   \layout { }
65   \midi {
66     \context {
67       \Staff
68       \remove "Staff_performer"
69     }
70     \context {
71       \Voice
72       \consists "Staff_performer"
73     }
74     \context {
75       \Score
76       tempoWholesPerMinute = #(ly:make-moment 72 2)
77     }
78   }
79 }
80