Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-19 Thread Thomas Morley
2018-02-19 9:35 GMT+01:00 David Kastrup :
> Saul Tobin  writes:
>
>> I probably will write such a function to deal with my immediate needs, but
>> I raise the issue because this is a case where Lilypond has well defined
>> behavior MOST of the time, and then sometimes violates it.
>
> No, it doesn't.  Short of other information, it arranges stuff such that
> it fits best.  You can easily provide such other information by creating
> your own specialized TextScript functions with dedicated ordering
> priority.
>
>> Normally, when you write ^"one"^"two" you expect "two" to be displayed
>> above "one."
>
> I repeat: LilyPond is not a typewriter.

Hi Saul,

David is right.

Though, it's always difficult to discuss without actual example.
So here's some code where LilyPond doesn't follow the entered order of
TextScripts.

\version "2.19.65"

{
  <>^"foo"
  c'4^"a"^""^"ccc"^"dd"^"e"
  c'4^"a"^""^"ccc"^"dd"^"e"
}

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-19 Thread David Kastrup
Saul Tobin  writes:

> I probably will write such a function to deal with my immediate needs, but
> I raise the issue because this is a case where Lilypond has well defined
> behavior MOST of the time, and then sometimes violates it.

No, it doesn't.  Short of other information, it arranges stuff such that
it fits best.  You can easily provide such other information by creating
your own specialized TextScript functions with dedicated ordering
priority.

> Normally, when you write ^"one"^"two" you expect "two" to be displayed
> above "one."

I repeat: LilyPond is not a typewriter.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
Is that the same scenario? By "encountered first" is the doc referring to
the parser or to the moment in musical time?

I can attempt turning off skylines, but I suspect the score will just
explode. I haven't had time to construct a controlled example of the
squished spacing. Seems hard to make it "tiny."

On Sun, Feb 18, 2018 at 6:47 PM, Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi Saul,
>
> > I'm actually surprised that ordering behavior isn't documented. It's so
> consistent 99% of the time I just assumed it was officially defined
> behavior.
>
> Well,  automatic-behavior> says “If two objects have the same
> outside-staff-priority the one encountered first will be placed closer to
> the staff.” It continues: “In the following example all the markup texts
> have the same priority (since it is not explicitly set).” So far, so good.
>
> But then: “Note that ‘Text3’ is automatically positioned close to the
> staff again, nestling under ‘Text2’.” [!!] So there is some skyline
> (vertical and/or horizontal) calculation going on. Have you tried your
> "problem" score with all skylines turned off (etc.), to see if it makes a
> difference? That's not something you probably want to have as a global
> setting, but it might give you more insight into why you’re seeing the
> current behaviour.
>
> Hope that helps!
> Kieren.
> 
>
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: i...@kierenmacmillan.info
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Kieren MacMillan
Hi Saul,

> I'm actually surprised that ordering behavior isn't documented. It's so 
> consistent 99% of the time I just assumed it was officially defined behavior.

Well,  
says “If two objects have the same outside-staff-priority the one encountered 
first will be placed closer to the staff.” It continues: “In the following 
example all the markup texts have the same priority (since it is not explicitly 
set).” So far, so good.

But then: “Note that ‘Text3’ is automatically positioned close to the staff 
again, nestling under ‘Text2’.” [!!] So there is some skyline (vertical and/or 
horizontal) calculation going on. Have you tried your "problem" score with all 
skylines turned off (etc.), to see if it makes a difference? That's not 
something you probably want to have as a global setting, but it might give you 
more insight into why you’re seeing the current behaviour. 

Hope that helps!
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
I'm actually surprised that ordering behavior isn't documented. It's so
consistent 99% of the time I just assumed it was officially defined
behavior.

On Sun, Feb 18, 2018 at 6:30 PM, Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi Saul,
>
> > I probably will write such a function
>
> Excellent! Be sure to share it with the list.
>
> > when you write ^"one"^"two" you expect "two" to be displayed above "one."
>
> I've actually never had that expectation! (Perhaps I should have? I guess
> I just assumed it works like every other post-event in Lilypond does, which
> is that the display order is not determined by the order of entry, but
> instead by a rather complex combination of parameters known to me and
> otherwise.)
>
> Cheers,
> Kieren.
> 
>
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: i...@kierenmacmillan.info
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Kieren MacMillan
Hi Saul,

> I probably will write such a function

Excellent! Be sure to share it with the list.

> when you write ^"one"^"two" you expect "two" to be displayed above "one."

I've actually never had that expectation! (Perhaps I should have? I guess I 
just assumed it works like every other post-event in Lilypond does, which is 
that the display order is not determined by the order of entry, but instead by 
a rather complex combination of parameters known to me and otherwise.)

Cheers,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
I probably will write such a function to deal with my immediate needs, but
I raise the issue because this is a case where Lilypond has well defined
behavior MOST of the time, and then sometimes violates it. Normally, when
you write ^"one"^"two" you expect "two" to be displayed above "one." It
seems rather odd to need to write a special workaround to ensure that the
normal behavior happens all the time, particularly since Lilypond's spacing
algorithm in this case can violate notational conventions relating to the
content of the text.

On Sun, Feb 18, 2018 at 2:21 PM, Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi Torsten,
>
> > Sometimes, the order of stacks /is/ important and you even can't always
> put
> > them together into a \markup column
>
> I didn’t refute that. I simply pointed out there is nothing in Lilypond to
> distinguish between when script order is important and when it's not — so
> she does what she does.
>
> If someone requires order-dependent scripts, they should just write a
> little syntactic sugar to handle the situation.
>
> Cheers,
> Kieren.
> 
>
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: i...@kierenmacmillan.info
>
>
> ___
> 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: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
This is exactly my point. All of the suggested solutions to maintain
consistent vertical ordering require using a case-by-case override or
markup function. There is no way to create a global setting to force
Lilypond to respect text vertical ordering.

MOST of the time, Lilypond respects the order of TextScripts specified in
the music expression: ^"one"^"two" will print "two" above "one." Since
Lilypond can't tell whether text is an instrument shift, number of players,
technique, etc., the correct order can only be specified by the human
engraver.

On Sun, Feb 18, 2018 at 6:18 PM, Mason Hock  wrote:

> On 02/18, Saul Tobin wrote:
> > This is exactly the sort of situation I'm talking about. You're correct
> > that the order doesn't change the meaning, just as changing the vertical
> > order of instruments in the score doesn't change the scoring. But there
> is
> > a strong convention of how to order different types of text instructions
>
> Indeed, but as layout these decisions are not part of the musical
> information. When you include these instuctions in an include file
> containing the musical content of a player's part, you are only indicating
> that and when these instructions apply. If the order in which you enter the
> instructions were to affect their placement in the score, one of Lilypond's
> greatest strengths, the ability to separate layout from content, would be
> compromised. Any override to Lilypond's behavior that applies to the entire
> score is better off done globally, in a separate file from those containing
> content.
>
> Mason
>
> > (who plays first, then instrument changes, then technical instructions,
> > then style of expression), similar to the conventions for score order.
> You
> > don't want a "solo" indication buried in between three technical
> > instructions, because it could easily get missed by sightreading players.
> > Also, in a full score if several staves have the same three text
> > instructions, it is more readable if they are in the same vertical order
> > for each staff.
> >
> > On Sun, Feb 18, 2018 at 5:51 PM, Mason Hock  wrote:
> >
> > > > Indeed. However, the vertical order of expressions is part of
> content,
> > > not
> > > > a purely graphical layout issue.
> > >
> > > With the composer:content::editor:layout, vertical order of
> expressions
> > > seems like layout for most cases that come to mind. A composer might
> decide
> > > to have a violist switch to arco and ponticello simultaneously. The
> > > vertical order of those expressions does not affect what the violist
> does.
> > > I struggle to think of a situation in which the vertical order of
> > > simultaneous instructions would change the meaning of those
> instructions.
> > >
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Mason Hock
On 02/18, Saul Tobin wrote:
> This is exactly the sort of situation I'm talking about. You're correct
> that the order doesn't change the meaning, just as changing the vertical
> order of instruments in the score doesn't change the scoring. But there is
> a strong convention of how to order different types of text instructions

Indeed, but as layout these decisions are not part of the musical information. 
When you include these instuctions in an include file containing the musical 
content of a player's part, you are only indicating that and when these 
instructions apply. If the order in which you enter the instructions were to 
affect their placement in the score, one of Lilypond's greatest strengths, the 
ability to separate layout from content, would be compromised. Any override to 
Lilypond's behavior that applies to the entire score is better off done 
globally, in a separate file from those containing content.

Mason

> (who plays first, then instrument changes, then technical instructions,
> then style of expression), similar to the conventions for score order. You
> don't want a "solo" indication buried in between three technical
> instructions, because it could easily get missed by sightreading players.
> Also, in a full score if several staves have the same three text
> instructions, it is more readable if they are in the same vertical order
> for each staff.
> 
> On Sun, Feb 18, 2018 at 5:51 PM, Mason Hock  wrote:
> 
> > > Indeed. However, the vertical order of expressions is part of content,
> > not
> > > a purely graphical layout issue.
> >
> > With the composer:content::editor:layout, vertical order of expressions
> > seems like layout for most cases that come to mind. A composer might decide
> > to have a violist switch to arco and ponticello simultaneously. The
> > vertical order of those expressions does not affect what the violist does.
> > I struggle to think of a situation in which the vertical order of
> > simultaneous instructions would change the meaning of those instructions.
> >

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Kieren MacMillan
Hi Torsten,

> Sometimes, the order of stacks /is/ important and you even can't always put
> them together into a \markup column

I didn’t refute that. I simply pointed out there is nothing in Lilypond to 
distinguish between when script order is important and when it's not — so she 
does what she does.

If someone requires order-dependent scripts, they should just write a little 
syntactic sugar to handle the situation.

Cheers,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Torsten Hämmerle
Hi Kieren,

Sometimes, the order of stacks /is/ important and you even can't always put
them together into a \markup column:

Fingering, for example, uses script-priority, too.
This time, it does not depend on any input order, but the script-priority is
calculated from the Y-position of the noteheads in a chord (centre of the
stave means zero offset). The order of entry doesn't matter, but the order
of fingering numbers has to be the exact same order as the (graphical) order
of noteheads in a chord.

It's the same mechanism, though.
And a lot has to happen before LilyPond starts messing with that
well-defined order. At least that's what I always thought up to now... (?)

Cheerio,
Torsten




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Kieren MacMillan
Hi Saul,

> However, the vertical order of expressions is part of content, not a purely 
> graphical layout issue.

Hmmm… I'm not sold on that.

If I write  versus , is the order part of the content? All 
three notes appear at the same musical moment, and will appear vertically as 
 either way — and that's how I would expect it. Similarly, 
c4\f\tenuto and c4\tenuto\f will appear the same way (as Lilypond determines), 
unless I specifically tweak one or more of the elements.

Why should multiple expressions be handled differently?

Thanks,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
Indeed. However, the vertical order of expressions is part of content, not
a purely graphical layout issue.

On Sun, Feb 18, 2018 at 1:08 PM, David Kastrup  wrote:

> Saul Tobin  writes:
>
> > It seems very un-Lilypond-like for the output to be so unpredictable,
>
> No.  It is the job of LilyPond to arrange elements in the best possible
> manner representing the input, and that is what it does.
>
> LilyPond is not a music typewriter, but a typesetting program.  It
> doesn't principally work left-to-right and top-to-bottom.
>
> --
> David Kastrup
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread David Kastrup
Saul Tobin  writes:

> It seems very un-Lilypond-like for the output to be so unpredictable,

No.  It is the job of LilyPond to arrange elements in the best possible
manner representing the input, and that is what it does.

LilyPond is not a music typewriter, but a typesetting program.  It
doesn't principally work left-to-right and top-to-bottom.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Kieren MacMillan
Hi Saul,

> It seems very un-Lilypond-like for the output to be so unpredictable, given 
> that the order is well defined most of the time. It is hard to predict from 
> the code when Lilypond will violate the specified order, so the only real 
> solution is to combine expressions into a single markup 100% of the time.

No… Another real solution would be to write a function that takes an ordered 
list of markups and outputs them with tweaks that guarantee they appear in that 
order.

Hope this helps!
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Torsten Hämmerle
Hi Joram,

TextScript.script-priority has a default value of 200.
Each concurrent TextScript will be counted up (starting with 200+0 = 200,
200+1 = 201, 200+2 = 202, etc.) by default.
The smaller the number, the closer to the notehead.

So, by default, LilyPond will keep the order of TextScripts intact and I'm
really wondering what happened in your original non-working example...

*Caveat:*
Your first \tweak may be dangerous, because LilyPond will automatically
count up the value of script-priority, i.e. when saying
{ a-\tweak script-priority #201 -"one" -"two" }
then both "one" and "two" will have the same script-priority value 201 and
anything could happen.

All the best,
Torsten







--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
It seems very un-Lilypond-like for the output to be so unpredictable, given
that the order is well defined most of the time. It is hard to predict from
the code when Lilypond will violate the specified order, so the only real
solution is to combine expressions into a single markup 100% of the time.
IMO this workaround amounts to deprecating the use of multiple TextScripts
as undefined behavior.

On Sun, Feb 18, 2018 at 3:30 AM, David Kastrup  wrote:

> Saul Tobin  writes:
>
> > That's a reasonable workaround, but it's not semantic. A single column
> > markup is appropriate for one expression split across lines IMO. If it's
> > multiple expressions communicating distinct things, it makes sense to
> keep
> > them separate, particularly if one or more of them are predefined
> markups.
>
> If their vertical order is seminal to the reading, you need to either
> make them a single markup or give them different outside-staff-priority
> values.
>
> --
> David Kastrup
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Noeck
Hi,

Am 18.02.2018 um 14:16 schrieb Torsten Hämmerle:
> How about script-priority?


That seems to work:

{
   a-\tweak script-priority #201 -"p=201" -"p default"
   a a a
   a-\tweak script-priority #202 -"p=202" -"p default"
   a a a
}

According to this example the default priority seems to be 201 but
perhaps that depends on other things?

Cheers,
Joram

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Torsten Hämmerle
How about script-priority?

I always thought that concurrent (Text)Scripts will be internally numbered
by counting up script-priority in the order given and the first
(Text)Scripts will be printed closest to the noteheads (depending on whether
the scripts are above or below the stave).

So, even all have the same outside-staff-priority, their order can still be
manipulated by using script-priority, that's what script-priority has been
designed for.

Or did I get something wrong?

Torsten



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread David Kastrup
Saul Tobin  writes:

> That's a reasonable workaround, but it's not semantic. A single column
> markup is appropriate for one expression split across lines IMO. If it's
> multiple expressions communicating distinct things, it makes sense to keep
> them separate, particularly if one or more of them are predefined markups.

If their vertical order is seminal to the reading, you need to either
make them a single markup or give them different outside-staff-priority
values.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
That's a reasonable workaround, but it's not semantic. A single column
markup is appropriate for one expression split across lines IMO. If it's
multiple expressions communicating distinct things, it makes sense to keep
them separate, particularly if one or more of them are predefined markups.

On Sun, Feb 18, 2018 at 12:03 AM, David Kastrup  wrote:

> Saul Tobin  writes:
>
> > Hi all,
> >
> > I've noticed that under certain circumstances (I think if the page
> spacing
> > needs to be compressed?) Lilypond will disregard the vertical order of
> > TextScripts. So something like:
> >
> > \relative c'' {
> >   f4^"long long long"^"short" e'2.
> > }
> >
> > By itself, this correctly displays the short indication above the long
> one.
> > But sometimes Lilypond, in order to save space, will move the short
> > indication below the long one. This is understandable, but it can lead to
> > incorrect notation if the order matters. For example, indications of who
> is
> > playing (e.g. solo or tutti) are generally supposed to go above
> indications
> > of playing style or technique.
> >
> > Is there a way to force Lilypond to respect the specified vertical order
> of
> > TextScripts? Ideally, not as a one time override or tweak but throughout
> an
> > entire score.
>
> Why don't you use a single textscript then?  Like
>
> \relative c'' {
>   f4^\markup \column { "long long long" "short" } e'2.
> }
>
> That way the order is strictly under your control.
>
> --
> David Kastrup
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Simon Albrecht

On 18.02.2018 01:19, Saul Tobin wrote:
Is there a way to force Lilypond to respect the specified vertical 
order of TextScripts? Ideally, not as a one time override or tweak but 
throughout an entire score.


The solution that comes to mind is assigning different values of 
outside-staff-priority, but of course that does require tweaking.


Best, Simon

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread David Kastrup
Saul Tobin  writes:

> Hi all,
>
> I've noticed that under certain circumstances (I think if the page spacing
> needs to be compressed?) Lilypond will disregard the vertical order of
> TextScripts. So something like:
>
> \relative c'' {
>   f4^"long long long"^"short" e'2.
> }
>
> By itself, this correctly displays the short indication above the long one.
> But sometimes Lilypond, in order to save space, will move the short
> indication below the long one. This is understandable, but it can lead to
> incorrect notation if the order matters. For example, indications of who is
> playing (e.g. solo or tutti) are generally supposed to go above indications
> of playing style or technique.
>
> Is there a way to force Lilypond to respect the specified vertical order of
> TextScripts? Ideally, not as a one time override or tweak but throughout an
> entire score.

Why don't you use a single textscript then?  Like

\relative c'' {
  f4^\markup \column { "long long long" "short" } e'2.
}

That way the order is strictly under your control.

-- 
David Kastrup

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user