Efficient transposition

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Efficient transposition

Colin Tennyson
I have created my first LilyPond file, using Frescobaldi.
(LilyPond 2.18, Frescobaldi 2.0.12)

It's a madrigal by Verdelot, 4 voices, titled  Dormend'un giorn'a baia

I've  transposed it down a minor third. My question is: is the way I coded the transposition the most efficient one?

I uploaded the file.
Dormend__a_minor.ly

As instructed in the LilyPond manuals I separated the content and the structure. There is a variable 'sopranonotes', a variable 'sopranowords', etc. and those are inserted in the structure.

Now, of course I want the original and the transposed version both available, with the file remaining a single file. I don't want to create a situation where I have two versions, the original and the transposed version, and having to update both of them if the conductor asks for, say, a different text placement.

Currently the 4 voices are transposed individually. So if I want do undo/redo the transposition I have to comment out the transposition in 4 separate places.
Is there a way to use built-in LilyPond functionality so that there is a _single_ point in the code for setting the transposition?

I tried embracing the entire score part of the source in a  
\transpose a fs { ... }
but the parser didn't accept that.
Reply | Threaded
Open this post in threaded view
|

Re: Efficient transposition

David Kastrup
Colin Tennyson <[hidden email]> writes:

> I have created my first LilyPond file, using Frescobaldi.
> (LilyPond 2.18, Frescobaldi 2.0.12)

That must be the first documented use of LilyPond 2.18.

> I've  transposed it down a minor third. My question is: is the way I coded
> the transposition the most efficient one?

> Currently the 4 voices are transposed individually. So if I want do
> undo/redo the transposition I have to comment out the transposition in 4
> separate places.
> Is there a way to use built-in LilyPond functionality so that there is a
> _single_ point in the code for setting the transposition?
>
> I tried embracing the entire score part of the source in a  
> \transpose a fs { ... }
> but the parser didn't accept that.

A score cannot be transposed.  But its music can.

\score {
  \transpose c' a
  \new ChoirStaff <<
    \override Score.BarNumber.break-visibility = #'#(#f #t #t)
    \set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)
[...]

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Efficient transposition

Thomas Morley-2
In reply to this post by Colin Tennyson
2013/12/31 Colin Tennyson <[hidden email]>:

> Is there a way to use built-in LilyPond functionality so that there is a
> _single_ point in the code for setting the transposition?
>
> I tried embracing the entire score part of the source in a
> \transpose a fs { ... }
> but the parser didn't accept that.



Hi,

how about

\score {
  \transpose c' a
  \new ChoirStaff <<
   ... some-music...
  >>
}


HTH,
  Harm

P.S. Lot's of barcheck errors ...

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Efficient transposition

Thomas Morley-2
In reply to this post by David Kastrup
Hi David,

2013/12/31 David Kastrup <[hidden email]>:
> Colin Tennyson <[hidden email]> writes:
>
>> I have created my first LilyPond file, using Frescobaldi.
>> (LilyPond 2.18, Frescobaldi 2.0.12)
>
> That must be the first documented use of LilyPond 2.18.

well,
http://www.lilypondforum.de/index.php?topic=1639.msg9145#new
:)

Again, 1000 thanks for your fabulous work,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Efficient transposition

Urs Liska
In reply to this post by Colin Tennyson


Colin Tennyson <[hidden email]> schrieb:

>I have created my first LilyPond file, using Frescobaldi.
>(LilyPond 2.18, Frescobaldi 2.0.12)
>
>It's a madrigal by Verdelot, 4 voices, titled  Dormend'un giorn'a baia
>
>I've  transposed it down a minor third. My question is: is the way I
>coded
>the transposition the most efficient one?
>
>I uploaded the file.
>Dormend__a_minor.ly
><http://lilypond.1069038.n5.nabble.com/file/n156730/Dormend__a_minor.ly>
>
>
>As instructed in the LilyPond manuals I separated the content and the
>structure. There is a variable 'sopranonotes', a variable
>'sopranowords',
>etc. and those are inserted in the structure.
>
>Now, of course I want the original and the transposed version both
>available, with the file remaining a single file. I don't want to
>create a
>situation where I have two versions, the original and the transposed
>version, and having to update both of them if the conductor asks for,
>say, a
>different text placement.
>
>Currently the 4 voices are transposed individually. So if I want do
>undo/redo the transposition I have to comment out the transposition in
>4
>separate places.
>Is there a way to use built-in LilyPond functionality so that there is
>a
>_single_ point in the code for setting the transposition?
>
>I tried embracing the entire score part of the source in a  
>\transpose a fs { ... }
>but the parser didn't accept that.
>
>
>
>--
>View this message in context:
>http://lilypond.1069038.n5.nabble.com/Efficient-transposition-tp156730.html
>Sent from the User mailing list archive at Nabble.com.
>
>_______________________________________________
>lilypond-user mailing list
>[hidden email]
>https://lists.gnu.org/mailman/listinfo/lilypond-user

I don't know if that will be very clear to you but unfortunately I can't describe it better or more verbose right now.

When I have this situation (and I have it regularly as I'm engraving classical/romantic song) I do something like:

File a: music definition
vocals = \relative ...

File b: translation adaptor
vocals = \transpose g e \vocals

File c: score definition
using \vocals

My main file includes the other files.
Of course you have to do this for all parts, but the "adaptor" file redefines all variables.
Now when I have to add another transposition I add another adaptor file and include it in my main file.
Over time the main file contains a number of different include directives for the transposition adaptors, and I can choose which one to use by commenting out the others.

HTH
Urs
--
Urs Liska
openlilylib.org

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Efficient transposition

Colin Tennyson
In reply to this post by David Kastrup
David Kastrup wrote
A score cannot be transposed.  But its music can.

\score {
  \transpose c' a
  \new ChoirStaff <<
    \override Score.BarNumber.break-visibility = #'#(#f #t #t)
    \set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)
[...]
Wow, I could not have guessed that syntax will work.

You see, the way I understood the documentation was that the  \transpose [note] [note] _must_ be followed _directly_ by a pair of curly braces.
I'm pretty much stunned by your example, where the  \transpose c' a is followed by a \new ChoirStaff

I tried several things, but always with the form  \transpose c' a { ... }

Reply | Threaded
Open this post in threaded view
|

Re: Efficient transposition

David Kastrup
In reply to this post by Thomas Morley-2
Thomas Morley <[hidden email]> writes:

> Hi David,
>
> 2013/12/31 David Kastrup <[hidden email]>:
>> Colin Tennyson <[hidden email]> writes:
>>
>>> I have created my first LilyPond file, using Frescobaldi.
>>> (LilyPond 2.18, Frescobaldi 2.0.12)
>>
>> That must be the first documented use of LilyPond 2.18.
>
> well,
> http://www.lilypondforum.de/index.php?topic=1639.msg9145#new
> :)
>
> Again, 1000 thanks for your fabulous work,

Well, let's keep the perspective: LilyPond 2.18 is the work of a large
number of volunteers, including several who have contributed
organizational work rather than code.  In numbers of commits, I might be
the single largest contributor.  But for one part that is due to me
splitting contributions into separate commits more than others, for
another, the majority of commits is done by others, and I am not
involved with every part of LilyPond.  And of course I am in the unique
position of getting paid for the work I do, enabling me to put in more
time than others.

And Mike is correct that we want and need more active contributors.
I'll try to make some proposals early next year how we may increase the
number of people willing and able to improve LilyPond.  We also need to
revise our release and branching strategies in order to maximize
quality, output, and work morale.  We also need to work on LilyPond's
architecture to avoid the situation where it is falling apart as fast as
we are adding new functionality to it.

The backend is in a particularly unhealthy state regarding the
difficulty of adding new functionality without breaking existing
functionality.  This holds for both additions made by the user in
documents and include files as well as for extensions of the core C++
code.

2.18 is not revolutionary, but it still shows several sizable steps
forwards, both in output quality as well as usability.

And if you take a look at
<URL:http://code.google.com/p/lilypond/issues/list?can=1&q=Fixed_2_19_0>,
it is clear that 2.19 already is off to a running start.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Efficient transposition

David Kastrup
In reply to this post by Colin Tennyson
Colin Tennyson <[hidden email]> writes:

> David Kastrup wrote
>> A score cannot be transposed.  But its music can.
>>
>> \score {
>>   \transpose c' a
>>   \new ChoirStaff <<
>>     \override Score.BarNumber.break-visibility = #'#(#f #t #t)
>>     \set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)
>> [...]
>
> Wow, I could not have guessed that syntax will work.
>
> You see, the way I understood the documentation was that the  \transpose
> [note] [note] _must_ be followed _directly_ by a pair of curly braces.
> I'm pretty much stunned by your example, where the  \transpose c' a is
> followed by a \new ChoirStaff
>
> I tried several things, but always with the form  \transpose c' a { ... }

\transpose c' a { \new ChoirStaff << ... >> }

should work just as well as

\transpose c' a \new ChoirStaff << ... >>

but of course I am lazy.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Efficient transposition

Francisco Vila
In reply to this post by Colin Tennyson
2013/12/31 Colin Tennyson <[hidden email]>:
> You see, the way I understood the documentation was that the  \transpose
> [note] [note] _must_ be followed _directly_ by a pair of curly braces.
> I'm pretty much stunned by your example, where the  \transpose c' a is
> followed by a \new ChoirStaff

I think docs explain it and examples "do exemplify it": lilypond music
expressions are like math expressions: by adding new parts connected
by operators you can build bigger expressions such as -(2+3) from
smaller ones such as 2+3.

Now in lilypond you can have { f g a b } which is a music expression
and so are these:

\relative c { f g a b }
\transpose c c' \relative c { f g a b }
\new Staff \transpose c c' \relative c { f g a b }

et cetera.

--
Francisco Vila. Badajoz (Spain)
www.paconet.org , www.csmbadajoz.com

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Efficient transposition

Colin Tennyson
Francisco Vila wrote
I think docs explain it and examples "do exemplify it": lilypond music
expressions are like math expressions: by adding new parts connected
by operators you can build bigger expressions

Now in lilypond you can have { f g a b } which is a music expression
and so are these:

\relative c { f g a b }
\transpose c c' \relative c { f g a b }
\new Staff \transpose c c' \relative c { f g a b }

et cetera.
You are quite right of course.



My thinking was focused on the following kind of pattern:
The variable 'global' is called 4 times:

global = {
  \key a \minor
  \time 4/2
}

Level of indirection; you declare the key in a single place, and the compiler retrieves it there 4 times.
My underlying vague hope was that something along those lines would be available for transposition too.



I had tried:

\transpose c' a {
  \score { ... }
}

Which doesn't work.

My error was that on that negative result alone I jumped to the conclusion that \transpose cannot be used on any grouping, that it can only be used on otherwise uninterrupted sections.



Reply | Threaded
Open this post in threaded view
|

Re: Efficient transposition

David Kastrup
Colin Tennyson <[hidden email]> writes:

> My thinking was focused on the following kind of pattern:
> The variable 'global' is called 4 times:
>
> global = {
>   \key a \minor
>   \time 4/2
> }
>
> Level of indirection; you declare the key in a single place, and the
> compiler retrieves it there 4 times.
> My underlying vague hope was that something along those lines would be
> available for transposition too.
>
>
>
> I had tried:
>
> \transpose c' a {
>   \score { ... }
> }
>
> Which doesn't work.
>
> My error was that on that negative result alone I jumped to the conclusion
> that \transpose cannot be used on any grouping, that it can only be used on
> otherwise uninterrupted sections.

Well, you can use

targetpitch = a

at the top and then write something like

\transpose c' \targetpitch { ... }

once or repeatedly in the body.  Requires at least 2.15.30 at least.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Efficient transposition

janek.lilypond
In reply to this post by David Kastrup
2013/12/31 David Kastrup <[hidden email]>:
> [...] Mike is correct that we want and need more active contributors.
> I'll try to make some proposals early next year how we may increase the
> number of people willing and able to improve LilyPond.  We also need to
> revise our release and branching strategies in order to maximize
> quality, output, and work morale.  We also need to work on LilyPond's
> architecture to avoid the situation where it is falling apart as fast as
> we are adding new functionality to it.

This will be a very important discussion - bad luck that i'll probably
be quite busy...
Please make sure that you cc my other email address
([hidden email]) when such a discussion starts (i
may temporarily stop reading main arriving at
[hidden email], which is the address subscribed to mailing
lists).  I would very much like to participate in that discussion.

best,
Janek

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user