Re: Notating same part in two different mixtures of clefs
On Wed, May 16, 2012 at 10:30 AM, Christopher Webster wrote: > It works like a charm. Big thank-you from me. Glad i helped :) I see that Urs already answered your questions about paralell voices. cheers, Janek ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Notating same part in two different mixtures of clefs
Urs Liska writes: > No you don't have to edit the ly-file. > You can write sth like: > > music = { ... } > > myClefI = { \clef tenor } > myClefII = { \clef bass > > \score ... % references \music > > % and then redefine the variables > myClefI = { \clef treble } > myClefII = { \clef bass > > \score ... % references \music > > If your clef layers are independent (as I assume) you could define > four variables trebleClef, altoClef, tenorClef, bassClef and leave two > of them empty. > > music = { > % contains all four clefs as references. > % If you have e.g. alto and bass clef at the same time you write > % \altoClef \bassClef > } > % define clefs for first score > trebleClef = {} > altoClef = {} > tenorClef = { \clef tenor } > bassClef = { \clef bass } > > \score { \music } % in this score the treble and alto clefs are just > ignored > > %then define the clefs the other way roung > % ... > \score % now the tenor and bass clefs are ignored. > > I find this solution looks nicer than with tags, but the functionality > is nearly identical. Not quite. It does not work, which is an important difference. It will actually already bomb out when defining "music" because \xxx references are expanded when encountered. If you want delayed action, you could make a music function music = #(define-music-function (parser location high low) (string? string?) #{ ... ... \clef #high ... ... \clef #low ... ... #}) { \music tenor bass \music alto tenor } However, as compared to the tag solution, the music is here indeed being parsed twice, once for every call of \music. So the tag solution is likely to be faster. > I have come to find the redefinition of variables a _very_ useful > concept. Sure, but redefining them after they have already been used is not all that helpful. -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Notating same part in two different mixtures of clefs
Am 16.05.2012 10:30, schrieb Christopher Webster: Yes - just to confirm that the tags were exactly what I needed. Here's the sort of thing I wanted to do: highClef = { \tag #'cello { \clef "tenor" } \tag #'gamba { \clef "alto" } } dots = \relative c { \clef "bass" g'4 a b r \highClef d4 cis d r \clef "bass" g,1 } \book { \score { \keepWithTag #'gamba \dots } \score { \keepWithTag #'cello \dots } } It works like a charm. Big thank-you from me. /Christopher/. OK. If you run into trouble because you come across clef changes that have to be applied only in one of the instruments (or a treble clef in the cello part), you can still use the tag directly in the music variable (although this is more typing and it doesn't look as smooth). Best Urs On 2012-05-16 09:30, Christopher Webster wrote: Thank you! Of your three proposed solutions, the one with tags looks like the winner. I didn't know about tags - they look ideally suited. A feature of your first solution which I would have hoped to avoid is that you do seem to have duplicated notation - the "s1*3" and the "s1*2" - in the source. Or did I misunderstand what you were suggesting? And the feature of the third solution which I would have hoped to avoid is that I would need to edit and re-process the input to get the output with the other set of clefs. I was looking for a solution in which one input, processed once, would produce both outputs. But the tags - they look just right! I'll try those. Many thanks again /Christopher/. On 2012-05-16 09:04, Janek Warcho? wrote: On Wed, May 16, 2012 at 8:53 AM, Christopher Webster wrote: What's the most elegant way in which I can enter the notes just once, but generate two output scores - one with bass and tenor clefs, the other with bass and alto clefs? what about separate voices for clefs? something like: << { music } { \clef bass s1*3 \clef alto s1*2 } %{ \clef bass s1*3 \clef tenor s1*2 } you could also try tags http://lilypond.org/doc/v2.14/Documentation/notation/different-editions-from-one-source#using-tags Or simply store the clef in a variable - that's probably the simplest method: myclef = { \clef alto } % or \clef tenor { \clef bass c c \myclef f' f' } hope this helps, Janek ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Notating same part in two different mixtures of clefs
Yes - just to confirm that the tags were exactly what I needed. Here's the sort of thing I wanted to do: highClef = { \tag #'cello { \clef "tenor" } \tag #'gamba { \clef "alto" } } dots = \relative c { \clef "bass" g'4 a b r \highClef d4 cis d r \clef "bass" g,1 } \book { \score { \keepWithTag #'gamba \dots } \score { \keepWithTag #'cello \dots } } It works like a charm. Big thank-you from me. /Christopher/. On 2012-05-16 09:30, Christopher Webster wrote: Thank you! Of your three proposed solutions, the one with tags looks like the winner. I didn't know about tags - they look ideally suited. A feature of your first solution which I would have hoped to avoid is that you do seem to have duplicated notation - the "s1*3" and the "s1*2" - in the source. Or did I misunderstand what you were suggesting? And the feature of the third solution which I would have hoped to avoid is that I would need to edit and re-process the input to get the output with the other set of clefs. I was looking for a solution in which one input, processed once, would produce both outputs. But the tags - they look just right! I'll try those. Many thanks again /Christopher/. On 2012-05-16 09:04, Janek Warchoł wrote: On Wed, May 16, 2012 at 8:53 AM, Christopher Webster wrote: What's the most elegant way in which I can enter the notes just once, but generate two output scores - one with bass and tenor clefs, the other with bass and alto clefs? what about separate voices for clefs? something like: << { music } { \clef bass s1*3 \clef alto s1*2 } %{ \clef bass s1*3 \clef tenor s1*2 } you could also try tags http://lilypond.org/doc/v2.14/Documentation/notation/different-editions-from-one-source#using-tags Or simply store the clef in a variable - that's probably the simplest method: myclef = { \clef alto } % or \clef tenor { \clef bass c c \myclef f' f' } hope this helps, Janek ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Notating same part in two different mixtures of clefs
Am 16.05.2012 09:30, schrieb Christopher Webster: Thank you! Of your three proposed solutions, the one with tags looks like the winner. I didn't know about tags - they look ideally suited. Yes, that's exactly what they are for. A feature of your first solution which I would have hoped to avoid is that you do seem to have duplicated notation - the "s1*3" and the "s1*2" - in the source. Or did I misunderstand what you were suggesting? Yes, you would have to write out the whole piece for both \voices and apply one or the other. Whether this makes sense, depends a little bit, whether the clef changes necessarily occur at the same places, which I assume they don't. In this case the solution with separate voices provides you with quite fine control. But you have to manage a separate layer that you don't enter directly into the music. And the feature of the third solution which I would have hoped to avoid is that I would need to edit and re-process the input to get the output with the other set of clefs. I was looking for a solution in which one input, processed once, would produce both outputs. No you don't have to edit the ly-file. You can write sth like: music = { ... } myClefI = { \clef tenor } myClefII = { \clef bass \score ... % references \music % and then redefine the variables myClefI = { \clef treble } myClefII = { \clef bass \score ... % references \music If your clef layers are independent (as I assume) you could define four variables trebleClef, altoClef, tenorClef, bassClef and leave two of them empty. music = { % contains all four clefs as references. % If you have e.g. alto and bass clef at the same time you write % \altoClef \bassClef } % define clefs for first score trebleClef = {} altoClef = {} tenorClef = { \clef tenor } bassClef = { \clef bass } \score { \music } % in this score the treble and alto clefs are just ignored %then define the clefs the other way roung % ... \score % now the tenor and bass clefs are ignored. I find this solution looks nicer than with tags, but the functionality is nearly identical. Only if you consider that the cello might also have a treble clef, this one won't work anymore. But this again is no problem when you work with clefs. I have come to find the redefinition of variables a _very_ useful concept. HTH Urs But the tags - they look just right! I'll try those. Many thanks again /Christopher/. On 2012-05-16 09:04, Janek Warcho? wrote: On Wed, May 16, 2012 at 8:53 AM, Christopher Webster wrote: What's the most elegant way in which I can enter the notes just once, but generate two output scores - one with bass and tenor clefs, the other with bass and alto clefs? what about separate voices for clefs? something like: << { music } { \clef bass s1*3 \clef alto s1*2 } %{ \clef bass s1*3 \clef tenor s1*2 } you could also try tags http://lilypond.org/doc/v2.14/Documentation/notation/different-editions-from-one-source#using-tags Or simply store the clef in a variable - that's probably the simplest method: myclef = { \clef alto } % or \clef tenor { \clef bass c c \myclef f' f' } hope this helps, Janek ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Notating same part in two different mixtures of clefs
Thank you! Of your three proposed solutions, the one with tags looks like the winner. I didn't know about tags - they look ideally suited. A feature of your first solution which I would have hoped to avoid is that you do seem to have duplicated notation - the "s1*3" and the "s1*2" - in the source. Or did I misunderstand what you were suggesting? And the feature of the third solution which I would have hoped to avoid is that I would need to edit and re-process the input to get the output with the other set of clefs. I was looking for a solution in which one input, processed once, would produce both outputs. But the tags - they look just right! I'll try those. Many thanks again /Christopher/. On 2012-05-16 09:04, Janek Warchoł wrote: On Wed, May 16, 2012 at 8:53 AM, Christopher Webster wrote: What's the most elegant way in which I can enter the notes just once, but generate two output scores - one with bass and tenor clefs, the other with bass and alto clefs? what about separate voices for clefs? something like: << { music } { \clef bass s1*3 \clef alto s1*2 } %{ \clef bass s1*3 \clef tenor s1*2 } you could also try tags http://lilypond.org/doc/v2.14/Documentation/notation/different-editions-from-one-source#using-tags Or simply store the clef in a variable - that's probably the simplest method: myclef = { \clef alto } % or \clef tenor { \clef bass c c \myclef f' f' } hope this helps, Janek ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Notating same part in two different mixtures of clefs
On Wed, May 16, 2012 at 8:53 AM, Christopher Webster wrote: > What's the most elegant way in which I can enter the notes just once, but > generate two output scores - one with bass and tenor clefs, the other with > bass and alto clefs? what about separate voices for clefs? something like: << { music } { \clef bass s1*3 \clef alto s1*2 } %{ \clef bass s1*3 \clef tenor s1*2 } >> you could also try tags http://lilypond.org/doc/v2.14/Documentation/notation/different-editions-from-one-source#using-tags Or simply store the clef in a variable - that's probably the simplest method: myclef = { \clef alto } % or \clef tenor { \clef bass c c \myclef f' f' } hope this helps, Janek ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Notating same part in two different mixtures of clefs
Suppose I have a solo part which can be played either on cello or on viola da gamba. Cello solo parts are normally written in a mixture of bass and tenor clefs; gamba parts in a mixture of bass and alto clefs. In either case it's quite possible to encounter a change of clef every few bars. What's the most elegant way in which I can enter the notes just once, but generate two output scores - one with bass and tenor clefs, the other with bass and alto clefs? I can see that I could assign strings containing notation for one pair of clefs to Scheme variables, generate corresponding strings for the other pair of clefs by Scheme string operations, and then invoke the LilyPond parser explicitly on the two sets of strings. It doesn't feel to me like a natural solution. Is there an obviously better one? Thanks in advance. /Christopher/. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user