]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/changing-midi-output-to-one-channel-per-voice.ly
Merge master into nested-bookparts
[lilypond.git] / input / lsr / changing-midi-output-to-one-channel-per-voice.ly
1 %% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
2 %% This file is in the public domain.
3 \version "2.11.62"
4
5 \header {
6   lsrtags = "contexts-and-engravers, midi"
7
8   texidoces = "
9 Al producir una salida MIDI, el comportamiento predeterminado es
10 que cada pentagrama representa un canal MIDI, con todas las voces
11 de dicho pentagrama mezcladas.  Esto reduce al mínimo el riesgo de
12 que se agote el número de canales MIDI disponibles, pues existe un
13 máximo de 16 canales por pista.
14
15 Sin embargo, cuando se traslada el interpretador
16 @code{Staff_performer} al contexto @code{Voice}, cada voz de un
17 pentagrama puede tener su propio canal MIDI, como se muestra en el
18 siguiente ejemplo: a pesar de estar sobre el mismo pentagrama, se
19 crean dos canales MIDI, cada uno con un @code{midiInstrument}
20 distinto.
21
22 "
23   doctitlees = "Modificar la salida MIDI para que tenga un canal por cada voz"
24
25   texidoc = "
26 When outputting MIDI, the default behavior is for each staff to
27 represent one MIDI channel, with all the voices on a staff amalgamated.
28 This minimizes the risk of running out of MIDI channels, since there
29 are only 16 available per track.
30
31 However, by moving the @code{Staff_performer} to the @code{Voice}
32 context, each voice on a staff can have its own MIDI channel, as is
33 demonstrated by the following example: despite being on the same staff,
34 two MIDI channels are created, each with a different
35 @code{midiInstrument}. 
36
37 "
38   doctitle = "Changing MIDI output to one channel per voice"
39 } % begin verbatim
40 \score {
41   \new Staff <<
42     \new Voice \relative c''' {
43       \set midiInstrument = #"flute"
44       \voiceOne
45       \key g \major
46       \time 2/2
47       r2 g-"Flute" ~
48       g fis ~
49       fis4 g8 fis e2 ~
50       e4 d8 cis d2
51     }
52     \new Voice \relative c'' {
53       \set midiInstrument = #"clarinet"
54       \voiceTwo
55       b1-"Clarinet"
56       a2. b8 a
57       g2. fis8 e
58       fis2 r
59     }
60   >>
61   \layout { }
62   \midi {
63     \context {
64       \Staff
65       \remove "Staff_performer"
66     }
67     \context {
68       \Voice
69       \consists "Staff_performer"      
70     }
71     \context {
72       \Score
73       tempoWholesPerMinute = #(ly:make-moment 72 2)
74     }
75   }
76 }