[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: inputting with explicit voices
From: |
karl |
Subject: |
Re: inputting with explicit voices |
Date: |
Fri, 31 Oct 2014 22:09:04 +0100 (CET) |
Mark:
> When inputting code for polyphony, e.g. a fugue, using explicit voices (<<
> \new voice { voiceOne . } \new voice { voiceTwo } >> ), the first note of
> voiceTwo is placed, octave wise, in relation to the last note set in
> voiceOne. As the last note entered in voiceOne changes octave, all of
> voiceTwo moves up or down. The only way I could find to avoid this was to
> set all of voiceOne and then set voiceTwo.
> Does an alternative exist?
%% You are probably using something like:
score {
\new Staff \relative f' { <<
\new voice { f2 f4 a }
\new voice { c2 c }
>> }
}
%% To break the "\relative" chain, you can write the above like:
score {
\new Staff \relative f' { <<
\new voice { f2 f4 a }
\new voice \relative f' { c2 c }
>> }
}
%% or
score {
\new Staff <<
\new voice \relative f' { f2 f4 a }
\new voice \relative f' { c2 c }
>>
}
%% or
a = \new voice \relative f' { f2 f4 a }
b = \new voice \relative f' { c2 c }
score {
\new Staff <<
\a
\b
>>
}
%% a more elaborate example, giving you two ways to present
%% the same music, would be:
% file music.ily
Lsop = \context Lyrics = Lsop \lyricmode { sop -- ra -- no }
Lalt = \context Lyrics = Lalt \lyricmode { al -- tus }
Msop = \context Voice = Vsop \relative f {
\mus_sop
f'2 f4 a |
}
Malt = \context Voice = Valt \relative f {
\mus_alt
c'2 c |
}
% file score_A.ly
mus_sop = {
\voiceOne
\clef treble
}
mus_alt = {
\voiceTwo
\clef treble
}
\include "music.ily"
\score {
\new ChoirStaff <<
\context Lyrics = Lsop
\new Staff << \Msop \Malt >>
\context Lyrics = Lalt
\lyricsto Vsop \Lsop
\lyricsto Valt \Lalt
>>
}
% file score_B.ly
mus_sop = {
\clef soprano
}
mus_alt = {
\clef alto
}
\include "music.ily"
\score {
\new ChoirStaff <<
\new Staff \Msop
\lyricsto Vsop \Lsop
\new Staff \Malt
\lyricsto Valt \Lalt
>>
}
Regards,
/Karl Hammar
-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57