lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Back to the drawing board (Sib->Ly)! And question about voices


From: Mats Bengtsson
Subject: Re: Back to the drawing board (Sib->Ly)! And question about voices
Date: Sun, 15 Oct 2006 08:47:03 +0200
User-agent: Internet Messaging Program (IMP) H3 (4.0.5)

Quoting Kirill <address@hidden>:

Mats Bengtsson <mats.bengtsson <at> ee.kth.se> writes:


Possibly, \partcombine can handle this, otherwise I'm afraid
the best solution is to implement a music function in Scheme
that goes through the music and adds \voiceOne and \oneVoice
at the appropriate places.

At second thought, I guess you generate the .ly file from your
program, so what you really want is to be able to specify
\voiceOne / \oneVoice for the upper Voice context while
generating the .ly code for the lower Voice. In that case, one
possible solution would be to define your own macros that do
the same as \voiceOne and \oneVoice but do the settings at the
Staff context level instead of Voice level. Then, for the lower voice,
you can still use \voiceTwo, since settings at the Voice level will
override those from the Staff level. Then you can generate code like
lower_voice = {\voiceTwo some music \oneVoiceInStaff s1*5
\twoVoicesInStaff more music ...}

   /Mats



Thanks, Mats.

That's exactly what I have done yesterday.
Now, the script generates the voices as before, except:
1) Voice 2 has always \voiceTwo command in the beginning.
2) Voice 1 has \voiceOne when some music appears in voice 2, and \oneVoice
command is generated whenever voice 2 disappears (i.e. has s1 rests).

This works fine.

(Now I do not understand the rest of your message: why do I need
"\oneVoiceInStaff" in the second voice?)

Just if you had some program and data structure so that voice 1 was already generated and forgotten at the time when you generated the .ly
code for voice 2, but apparently that's not the case.

   /Mats





reply via email to

[Prev in Thread] Current Thread [Next in Thread]