Re: Peculiar behavior of barlines

2020-03-17 Thread Sami Amiris
Dear all,

The more I see this, it looks like I either did something totally wrong, or
it is a bug. I tried all sorts of combinations, but the behavior remains the
same. If it looks like a bug and smells like a bug (it could very well NOT
be a bug, I know it by now...). I would truly appreciate any insights
here...

Thank you all...

-S.A.



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



Re: Peculiar behavior of barlines

2020-03-18 Thread Thomas Morley
Am Mo., 16. März 2020 um 19:23 Uhr schrieb Sami Amiris :
>
> Hello all.
>
> I would like the barlines that span both staves (not the barlines in each
> individual staff alone) at the middle of the line to have the same behaviour
> at the next end (to the right) and the start of the line below at the very
> left. In other words, A1, A2 and A3 should all be the same as A1, likewise
> for the B's and C's in the example provided- at least I think so. Currently
> this doesn't happen. Is it possible?
>
> http://lilybin.com/soj3yd/2 
>
> In general, bottom staff wins at A2 and A3 (and B's and C's accordingly),
> overriding the middle inter-staff portion of the barlines which shows nicely
> at A1. Any remedy?
>
> Also, can the single barline be aligned with the second line of the double
> barline at the end, to avoid showing that little portion of the staff? Start
> and middle of line are fine as placements, but the end is a bit off
> (consistent though).
>
> I put the example in the lilybin to not burden the post with a lot of
> clutter. I hope I did not overstep my bounds.
>
> Thank you.
>
>
>
> --
> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
>

Hi,

there are two reasons why you've got no reply so far.

(1) The matter is not uncomplicated.
(2) Your code is far from minimal.
You ask about BarLines. Why do you code all that clutter, like \paper
\key \time \scaleDurations \set Timing.measureLength \set
Timing.baseMoment?
Indentation is bad as well.

Speaking only for me (2) is the reason why your request was placed at
the bottom of my TODO-list.

That said and if I understand correctly...

You seem to think the last entry of the list provided to
\defineBarline will set the behaviour of the SpanBar.
That's not the whole story. Let's take a pseudo-code example:

\defineBarline "a" #'("b" "c" "d")

In the middle of a line \bar "a" will print a SpanBar as defined by
(the hopefully predefined) "d"
But:
At the end of a line \bar "a" will print a SpanBar as defined by (the
hopefully predefined) "b"
At the begin of a line \bar "a" will print a SpanBar as defined by
(the hopefully predefined) "c"

Your own BarLine-definitions always refer to the defaults, "|" and
"||", for end and begin of lines.
Btw, it makes no sense to define identically BarLines.

\defineBarLine "||-end" #'("||" #f " !")
\defineBarLine "||-beg"  #'("||" #f "!")
\defineBarLine "||-!"  #'("||-end" "||-beg" "!")
\defineBarLine "|-dashedSpan" #'("|" "|" "!")
\defineBarLine "|-!" #'("|-dashedSpan" "|-dashedSpan" "!")

Should do the trick.
Use \bar "||-!" and \bar "|-!"

Cheers,
  Harm



Re: Peculiar behavior of barlines

2020-03-18 Thread Sami Amiris
Hello and thank you for your reply.

The reason for the not minimal example is because each staff has its own
timing. This is polymetric notation, not simple notation. Each staff has its
very own barlines, and when I put them in a group, the barlines are united
only when the timing of the two staves coincides. This is my situation. I
had no interest in non-polymetric notation for this effect at this time,
although now that we are discussing this, it might come up. The reason for
the many instances is to show how the bottom staff takes priority in
different cases. My main issue is that what happens at the end and start of
a staff system is not the same as in the middle.

I will try out your suggestions and get back to you. Thank you once again
for your reply.

S.A.



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



Re: Peculiar behavior of barlines

2020-03-18 Thread Werner LEMBERG


> The reason for the not minimal example is because each staff has its
> own timing.  [...]

Well, the problem at hand is not related to polymetric notation at
all, AFAICS; you can use standard stuff also to demonstrate the
problem...


Werner



Re: Peculiar behavior of barlines

2020-03-18 Thread Sami Amiris
Werner LEMBERG wrote
>> The reason for the not minimal example is because each staff has its
>> own timing.  [...]
> 
> Well, the problem at hand is not related to polymetric notation at
> all, AFAICS; you can use standard stuff also to demonstrate the
> problem...

Thank you for your response.

Ι respectfully disagree for one reason only: with the indicidual barlines
per staff, I could see that the inter-staff portion becomes the same as the
barline of the lower staff, never of the higher staff, when at the end or
beginning of a system. I do concur, now that I have received this messages,
that I could simply use just different barlines on each staff but without
the actual polymeter. I will do such an example to experiment, and will get
back here to report what I saw.

Thank you once again.



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



Re: Peculiar behavior of barlines

2020-03-18 Thread Sami Amiris
Hello all.


Thomas Morley-2 wrote
> \defineBarLine "||-end" #'("||" #f " !")
> \defineBarLine "||-beg"  #'("||" #f "!")
> \defineBarLine "||-!"  #'("||-end" "||-beg" "!")
> \defineBarLine "|-dashedSpan" #'("|" "|" "!")
> \defineBarLine "|-!" #'("|-dashedSpan" "|-dashedSpan" "!")
> 
> Should do the trick.
> Use \bar "||-!" and \bar "|-!"

I tried the solution you told me, at the most minimal example I can think of
(keeping the labels intact for reference). It is  here
  . Unfortunately, it doesn't seem to compile.
What did I do wrong?

S.A.



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



Re: Peculiar behavior of barlines

2020-03-18 Thread Noeck
> What did I do wrong?

You didn't finish the bar line definition in line 24:

\defineBarLine "|-!" #'("|-dashedSpan" "|-dashedSpan" "



Re: Peculiar behavior of barlines

2020-03-18 Thread Sami Amiris
Actually I stand corrected! I made a mistake, I corrected it and it works
fine! Thank you very much! This is the snippet! I know that it would do a
lot for people like me, maybe it should be included in the section about
barlines?

Thank you once again! 

S.A.

  



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



Re: Peculiar behavior of barlines

2020-03-19 Thread Werner LEMBERG


> [...] This is the snippet! I know that it would do a lot for people
> like me, maybe it should be included in the section about barlines?

Mhmm, this is very special, and LilyPond's documentation is already
more than 2000 pages...

I rather suggest that you contribute a well-documented snippet to the
LilyPond Snippet Repository.

  http://lsr.di.unimi.it/

This might then eventually become a part of the documentation.


 Werner



Re: Peculiar behavior of barlines

2020-03-19 Thread Sami Amiris
Thank you, that is what I meant. Thank you for the link as well.

I would like to take the opportunity to that all of you great people.
Lilypond plays basically without opponents when it comes to more
"out-of-the-box" things, like polymeter and polytemporality, and I
understand more and more every day that almost everything is possible with
it, but one has to know how to do things. The problem with lilypond is not
what it can do, is understanding how to do it. 

Once again, a big thanks to all!

-S.A.



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



Re: Peculiar behavior of barlines

2020-03-19 Thread Sami Amiris
I apologise for flooding your email. Just found out another issue that I
would like your help, again with the barlines. Should I open another thread?
I thought they were in the same topic as before.

The question is: Is there a way to align the barlines correctly at the end
of the system?

I have written a  minimal example    and a 
less minimal    if one wants to see more
barline types (the problem area is highlighted).

Thank you,

S.A.



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



Re: Peculiar behavior of barlines

2020-03-19 Thread Kevin Barry
Hi Sami,

I think your alignment problem arises because you moved the barline
engraver from the score context to the staff context. Each staff
doesn't seem to "know" about the alignment of bars in other staves so
it cannot align with them. Since it seems you need different bar types
in different staves I think you will have to manually modify the
position of a barline with stuff like:
\once \override Staff.Barline.X-offset = 0.5 \bar "||-!"

If that works for you and you need to do it frequently in the score it
would be worth putting it in a variable or a function (my simple
attempts at this produced different output though so perhaps someone
else will best know how).

Kevin

On Thu, 19 Mar 2020 at 14:26, Sami Amiris  wrote:
>
> I apologise for flooding your email. Just found out another issue that I
> would like your help, again with the barlines. Should I open another thread?
> I thought they were in the same topic as before.
>
> The question is: Is there a way to align the barlines correctly at the end
> of the system?
>
> I have written a  minimal example    and a
> less minimal    if one wants to see more
> barline types (the problem area is highlighted).
>
> Thank you,
>
> S.A.
>
>
>
> --
> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
>



Re: Peculiar behavior of barlines

2020-03-20 Thread Sami Amiris
Thank you for the suggestion. I tried it, so far I haven't got results. One
case that I actually aligned them well, I lost the "!" part of the barline
in between. I will continue, though. It maybe that one particular
combination of all things will produce a result. 

Thank you once again.

-S.A.



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



Re: Peculiar behavior of barlines

2020-03-21 Thread Kevin Barry
On Fri, Mar 20, 2020 at 06:55:44AM -0700, Sami Amiris wrote:
> Thank you for the suggestion. I tried it, so far I haven't got results.

I was able to get what you want (I think) from your minimal example from
an earlier email. The code is below (reformatted - your indentation/code
style is really hard to read). I hope this helps. Note that I modified
the barline in the lower staff not the upper one (where your comments
suggest you think the problem is).

\version "2.18.2"

\header {tagline = ""}

\layout {
  indent = 0\cm
  \context {
\Score
\remove "Timing_translator"
\remove "Default_bar_line_engraver"
  }
  \context {
\Staff
\consists "Timing_translator"
\consists "Default_bar_line_engraver"
  }
}

% barlines for bottom staff - double line
%
\defineBarLine "||-end" #'("||" #f " !")
\defineBarLine "||-beg"  #'("||" #f "!")
\defineBarLine "||-!"  #'("||-end" "||-beg" "!")

% PROBLEM - barlines for top staff - single thick
%
\defineBarLine ".-end" #'("." "." " !") % here
\defineBarLine ".-beg" #'("." "." "!")
\defineBarLine ".-!" #'(".-end" ".-beg" "!")

\new StaffGroup
{
  << 
% Top staff
\new Staff 
{
  \time 4/4
  \bar".-!" 
  c'1 \bar".-!" % <<< here
}
% bottom, double-line
\new Staff 
{
  \time 4/4
  \bar"||-!" 
  c'1 \once \override Staff.BarLine.X-offset = #0.5 \bar"||-!" 
}   
  >>
}



Re: Peculiar behavior of barlines

2020-03-21 Thread Sami Amiris
Thank you for the suggestion once again.

I thank you for having spent some time on it. The whole idea is to create a
mirror image of the compound barline on the beginning of the example, which
means that they must align to the right, not to the left. Now it is a copy
of the system at the beginning, and you can also get there  inserting a
space in the barline definition of the \bar"||-!", without needing the
actual movement. 

I have tried moving the lower and middle portion of the barline so as to
force the program to build the compound barline correctly, but so far it
simply makes the dotted portion disappear. I believe the problem is that
with the solid barline, the program seems to count distances from the left
side of the construct rather than the right when alligning it with other
barlines in the same part of the system. I am not sure as I haven't seen the
source code (and most probably wouldn't see it if it hit me in the face with
a 10-foot pole tbh, I need to brush up my programming skills a few thousand
parsecs to match), but this is a "phenomenological" interpretation of the
facts, if you like. It "seems" to count distances from the left. However, I
could VERY EASILY be wrong, and by all means I hope I am.

Thanks again!

S.A.



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



Re: Peculiar behavior of barlines

2020-03-21 Thread Kevin Barry
On Sat, Mar 21, 2020 at 06:26:13AM -0700, Sami Amiris wrote:
> I thank you for having spent some time on it. The whole idea is to create a
> mirror image of the compound barline on the beginning of the example, which
> means that they must align to the right, not to the left.

I didn't understand much of what you wrote, but if I understand the
above correctly, then all you need to do in the minimal example is shift
the second SpanBar to the right, which you can do with:

\once \override StaffGroup.SpanBar.X-offset = #0.5

Adding that to the same place as the other override I added makes it
"mirror" the compound barline at the beginning of the example. I hope
that helps.

Kevin



Re: Peculiar behavior of barlines

2020-03-21 Thread Sami Amiris
Thank you for the suggestion.

I have been playing around with your suggestions - which I am truly very
thankful for, btw - and I have come to this so far:

1) The spanbar seems to be created at the bottom staff, at the "||-end"
definition. 

2) If the spanbar is double, like the bottom double barline - the thick line
above is also as thick as a double bar - then things seem ok:

Double SpanBar   

3) If the spanbar is single, I would like it to be in the same place as the
further right barline of the double. Unfortunately, in all my attempts it
remains at the left no matter what I do:

Single SpanBar   

If you have managed to get the single spanbar at the far right place, I
would be most grateful if you would post me a solution.

Thank you once again,

S.A.



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



Re: Peculiar behavior of barlines

2020-03-21 Thread Kevin Barry
On Sat, Mar 21, 2020 at 09:34:08AM -0700, Sami Amiris wrote:
> 3) If the spanbar is single, I would like it to be in the same place as the
> further right barline of the double. Unfortunately, in all my attempts it
> remains at the left no matter what I do:

The \override I sent in the last email will move it. I guess you didn't
try it? I added it to your minimal example here:


hope that helps,

Kevin



Re: Peculiar behavior of barlines

2020-03-21 Thread Sami Amiris
Thank you, very much indeed.

I obviously did some stupid mistake(s) of some sort or another, so once
again thank you very much. Ptoblem solved!

Cheers!

-S.A.



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



Re: Peculiar behavior of barlines

2020-03-22 Thread Thomas Morley
Am Sa., 21. März 2020 um 14:26 Uhr schrieb Sami Amiris :
>
> Thank you for the suggestion once again.
>
> I thank you for having spent some time on it. The whole idea is to create a
> mirror image of the compound barline on the beginning of the example, which
> means that they must align to the right, not to the left. Now it is a copy
> of the system at the beginning, and you can also get there  inserting a
> space in the barline definition of the \bar"||-!", without needing the
> actual movement.
>
> I have tried moving the lower and middle portion of the barline so as to
> force the program to build the compound barline correctly, but so far it
> simply makes the dotted portion disappear. I believe the problem is that
> with the solid barline, the program seems to count distances from the left
> side of the construct rather than the right when alligning it with other
> barlines in the same part of the system. I am not sure as I haven't seen the
> source code (and most probably wouldn't see it if it hit me in the face with
> a 10-foot pole tbh, I need to brush up my programming skills a few thousand
> parsecs to match), but this is a "phenomenological" interpretation of the
> facts, if you like. It "seems" to count distances from the left. However, I
> could VERY EASILY be wrong, and by all means I hope I am.
>
> Thanks again!
>
> S.A.

Instead of manually applying X-offset-overrides you may try:

#(define end-of-line-right-aligned-sencil
  (lambda (grob)
(let* ((break-dir (ly:item-break-dir grob))
   (basic-props (ly:grob-basic-properties grob))
   (stil-proc (assoc-get 'stencil (reverse basic-props)))
   (stil
 (if (procedure? stil-proc)
 (stil-proc grob)
 point-stencil)))

  (if (negative? break-dir)
  (ly:stencil-aligned-to stil X RIGHT)
  stil


\layout {
  \context {
\Score
\override SpanBar.stencil = #end-of-line-right-aligned-sencil
  }
  \context {
\Staff
\override BarLine.stencil = #end-of-line-right-aligned-sencil
  }
}

Should do the trick in most cases.

Cheers,
  Harm



Re: Peculiar behavior of barlines

2020-03-22 Thread Sami Amiris


> Instead of manually applying X-offset-overrides you may try:
> 
> #(define end-of-line-right-aligned-sencil
>   (lambda (grob)
> (let* ((break-dir (ly:item-break-dir grob))
>(basic-props (ly:grob-basic-properties grob))
>(stil-proc (assoc-get 'stencil (reverse basic-props)))
>(stil
>  (if (procedure? stil-proc)
>  (stil-proc grob)
>  point-stencil)))
> 
>   (if (negative? break-dir)
>   (ly:stencil-aligned-to stil X RIGHT)
>   stil
> 
> 
> \layout {
>   \context {
> \Score
> \override SpanBar.stencil = #end-of-line-right-aligned-sencil
>   }
>   \context {
> \Staff
> \override BarLine.stencil = #end-of-line-right-aligned-sencil
>   }
> }
> 
> Should do the trick in most cases.
> 
> Cheers,
>   Harm

Thank you very much!

Do I understand correctly that you make it count from the right at the end
of the staff system, but in all other cases it does what it usually does?
Whatever it may have at that point, barline, spanline, whatever? 

Thank you very, very much! That will probably end the problem for good
then!!

Cheers,

S.A.



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



Re: Peculiar behavior of barlines

2020-03-22 Thread Thomas Morley
Am So., 22. März 2020 um 16:39 Uhr schrieb Sami Amiris :
>
>
> > Instead of manually applying X-offset-overrides you may try:
> >
> > #(define end-of-line-right-aligned-sencil
> >   (lambda (grob)
> > (let* ((break-dir (ly:item-break-dir grob))
> >(basic-props (ly:grob-basic-properties grob))
> >(stil-proc (assoc-get 'stencil (reverse basic-props)))
> >(stil
> >  (if (procedure? stil-proc)
> >  (stil-proc grob)
> >  point-stencil)))
> >
> >   (if (negative? break-dir)
> >   (ly:stencil-aligned-to stil X RIGHT)
> >   stil
> >
> >
> > \layout {
> >   \context {
> > \Score
> > \override SpanBar.stencil = #end-of-line-right-aligned-sencil
> >   }
> >   \context {
> > \Staff
> > \override BarLine.stencil = #end-of-line-right-aligned-sencil
> >   }
> > }
> >
> > Should do the trick in most cases.
> >
> > Cheers,
> >   Harm
>
> Thank you very much!
>
> Do I understand correctly that you make it count from the right at the end
> of the staff system, but in all other cases it does what it usually does?

I'm not exactly sure what you mean with "count from the right"

Though, usually compound BarLines are build from a certain point of
the X-axis, for now let us call said point ZERO.
Other stuff is usually added to the RIGHT.
Example for "|||": "|" is placed at ZERO, next "|" is palced to the
RIGHT, third "|" is placed to the RIGHT. Always taking 'kern' into
account.
So _all_ BarLines are aligned to said ZERO.
Exceptions are made for ":" in repeat-bar-lines (sometimes added to
the LEFT) and those with the segno-sign (sometimes overlying other
stuff, p.e "||").
So most Barlines have an extent like '(0 . ),
little different for some repeat Barlines.
The right border of the BarLine is finally aligned to the StaffSymbol.

This works nicely if the "Default_bar_line_engraver" is in Score-context.

Alas, you moved said engraver (similar could be done adhoc by setting
the whichBar-property).
In either case it is then possible to use different BarLines for
different Staffs. Ofcourse now the  is
different.

My provided overrides reset the extent, _if_ the BarLines is printed
at line-end.
Example: (0.0 . 1.2) becomes (-1.2 . 0.0)
And all BarLines are right-aligned (at line-end).

> Whatever it may have at that point, barline, spanline, whatever?

Well, makes little sense to apply 'end-of-line-right-aligned-stencil'
to other grobs than BarLine and SpanBar, I'd say...

Btw, there was a typo
end-of-line-right-aligned-sencil
should read:
end-of-line-right-aligned-stencil

> Thank you very, very much! That will probably end the problem for good
> then!!

Regrettable, nope.
Try those segne-bar-lines...


Cheers,
  Harm



Re: Peculiar behavior of barlines

2020-03-22 Thread Sami Amiris
Thomas Morley-2 wrote
> Regrettable, nope.
> Try those segne-bar-lines...

Thank you very much for your very detailed explanation! I appreciate it very
much. Once I fully understand the technicals of lilypond and the scheme
program that you wrote (I think I get it, I just need to play around with it
to understand it better), I will try to see what happens with that as well.

In any case, thank you very much for your insights. They have been very
helpful.

Kind regards,

S.A.



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