Re: Extend Whiteout property

2018-09-10 Thread Lukas-Fabian Moser

Hi Urs,

thanks for all the detailed explanations!

So it would be nice if someone with the C++ knowledge could have a 
look at https://github.com/lilypond/lilypond/pull/3 and comment on it 
there.
Note: the goal is not to merge the branch into the Github mirror but 
only to provide review. Once there is agreement on the code someone 
should sheperd the patch through the regular review process.


I just might add that, I think, the C++ part of the changes is almost 
"trivial" (one had to make sure that the stencil-whiteout gets activated 
not only for boolean- or number-valued 'whiteout' property, but for 
pairs [of numbers] as well). The real work is all scheme, namely in 
scm/stencil.scm.


Best
Lukas

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


Re: Extend Whiteout property

2018-09-10 Thread Urs Liska

Hi Lukas-Fabian,


Am 10.09.2018 um 18:23 schrieb Lukas-Fabian Moser:



What you can do now is

  * fork this repository
  * register the fork and the main Github repository as "remotes" in
your local repository (I suggest to name them "github" and
"" if you have the Savannah
repository as "origin")
  * create a branch for your path
  * commit
  * push to your fork
  * create a Pull Request on Github
  * tell us here about it because we won't be automatically notified
about it.

That way anyone can look at your code, and you should be able to 
refine the code together with others.
At some point you may then do the required registrations and upload 
your patch for review (as per LilyPond's Contributrs' Guide), or you 
may ask someone else to "sheperd" your patch through the review process.


Thanks much for the step-by-step description! 


You're welcome. I wasn't in the situation to do an actual description at 
the time, but you seem to have managed going through the outline 
yourself :-)


I think I managed to follow it through, now. (I admit I was a bit 
shocked by my own courage after reading the line "lfm83 
 wants to merge 1 commit into 
lilypond:master from lfm83:snapshot/whiteout-nonquadratic" - but if I 
understand it correctly, a) this is what indeed should appear


Yes, that's the point of "pull requests" (or "merge requests" as they 
are named in some other systems).


and b) the github repository is not the 'real' repository and I 
couldn't do too much harm there anyway?)


That's correct too, actually there are even two layers in play here: as 
you noticed it's not the real repository but "only" a mirror, *and* you 
don't have any privileges even on that mirror. You have created a 
"fork", which is yet another mirror, but on Github itself. In that 
mirror you can do what you want, but merging anything into the 
"lilypond" repository would only be possible for someone with "push 
access" to that repository.




But apologies in advance in case I messed up; this whole 
distributed-development business is still a bit of a mystery to me. :-)


AFAICS you didn't mess up, the pull request looks like a pull request 
should look like (I'm not speaking about the code itself, I have no idea 
about that).


So it would be nice if someone with the C++ knowledge could have a look 
at https://github.com/lilypond/lilypond/pull/3 and comment on it there.
Note: the goal is not to merge the branch into the Github mirror but 
only to provide review. Once there is agreement on the code someone 
should sheperd the patch through the regular review process.


Best
Urs



Best
Lukas

PS. Kieren, by now it works for box and rounded-box style whiteouts.


___
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: Extend Whiteout property

2018-09-10 Thread Lukas-Fabian Moser



What you can do now is

  * fork this repository
  * register the fork and the main Github repository as "remotes" in
your local repository (I suggest to name them "github" and
"" if you have the Savannah
repository as "origin")
  * create a branch for your path
  * commit
  * push to your fork
  * create a Pull Request on Github
  * tell us here about it because we won't be automatically notified
about it.

That way anyone can look at your code, and you should be able to 
refine the code together with others.
At some point you may then do the required registrations and upload 
your patch for review (as per LilyPond's Contributrs' Guide), or you 
may ask someone else to "sheperd" your patch through the review process.


Thanks much for the step-by-step description! I think I managed to 
follow it through, now. (I admit I was a bit shocked by my own courage 
after reading the line "lfm83  wants to merge 
1 commit into lilypond:master from lfm83:snapshot/whiteout-nonquadratic" 
- but if I understand it correctly, a) this is what indeed should appear 
and b) the github repository is not the 'real' repository and I couldn't 
do too much harm there anyway?)


But apologies in advance in case I messed up; this whole 
distributed-development business is still a bit of a mystery to me. :-)


Best
Lukas

PS. Kieren, by now it works for box and rounded-box style whiteouts.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Extend Whiteout property

2018-09-08 Thread Lukas-Fabian Moser

Hi Harm,


Is there a way that one of the more experienced developers might take a look at 
what I produced at help me in getting it up to scratch?

A look at what you did would be helpful. ;)
Could you post a git formated patch?
Or a diff?


Good idea - thanks for the suggestion! A diff is what I indeed did 
manage. :-)

Here we go:

*diff --git a/lily/grob.cc b/lily/grob.cc*
index fddef87..cc81781 100644
--- a/lily/grob.cc
+++ b/lily/grob.cc
@@ -147,6 +147,7 @@ Grob::get_print_stencil () const
   /* A grob has to be visible, otherwise the whiteout property has no 
effect. */
   /* Calls the scheme procedure stencil-whiteout in scm/stencils.scm */
   if (!transparent && (scm_is_number (get_property ("whiteout"))
+ || scm_is_pair (get_property ("whiteout")) /* We actually would need 
number-pair */

|| to_boolean (get_property ("whiteout"
 {
   Real line_thickness = layout ()->get_dimension (ly_symbol2scm 
("line-thickness"));
*diff --git a/scm/c++.scm b/scm/c++.scm*
index cd2806f..4b2f555 100644
--- a/scm/c++.scm
+++ b/scm/c++.scm
@@ -57,6 +57,9 @@
 (define-public (boolean-or-number? x)
   (or (boolean? x) (number? x)))
 
+(define-public (boolean-or-number-or-number-pair? x)

+ (or (boolean? x) (number? x) (number-pair? x)))
+
 (define-public (boolean-or-symbol? x)
   (or (boolean? x) (symbol? x)))
 
*diff --git a/scm/define-grob-properties.scm 
b/scm/define-grob-properties.scm*

index f6952d9..3f242dd 100644
--- a/scm/define-grob-properties.scm
+++ b/scm/define-grob-properties.scm
@@ -1168,15 +1168,16 @@ one below this grob.")
 ;;; w
 ;;;
  (when ,ly:moment? "Global time step associated with this column.")
- (whiteout ,boolean-or-number? "If a number or true, the grob is
-printed over a white background to white-out underlying material, if
+ (whiteout ,boolean-or-number-or-number-pair? "If a number, number-pair
+ or true, the grob is printed over a white background to white-out 
underlying material, if

 the grob is visible.  A number indicates how far the white background
 extends beyond the bounding box of the grob as a multiple of the
-staff-line thickness. The @code{LyricHyphen} grob uses a special
+staff-line thickness. A number pair is interpreted as giving
+X- and Y-extent separately. The @code{LyricHyphen} grob uses a special
 implementation of whiteout:  A positive number indicates how far the
 white background extends beyond the bounding box in multiples of
 @code{line-thickness}.  The shape of the background is determined by
-@code{whiteout-style}. Usually @code{#f} by default. ")
+@code{whiteout-style}. Usually @code{#f} by default. ")
  (whiteout-style ,symbol? "Determines the shape of the
 @code{whiteout} background.  Available are @code{'outline},
 @code{'rounded-box}, and the default @code{'box}.  There is one
*diff --git a/scm/stencil.scm b/scm/stencil.scm*
index cc61a13..dcee256 100644
--- a/scm/stencil.scm
+++ b/scm/stencil.scm
@@ -782,13 +782,13 @@ of the white stencil we make between 0 and 2*pi."
 stil)
 
 (define*-public (stencil-whiteout-box stil

- #:optional (thickness 0) (blot 0) (color white))
- "@var{thickness} is how far, as a multiple of line-thickness,
-the white outline extends past the extents of stencil @var{stil}."
+ #:optional (thickness '(0 . 0)) (blot 0) (color white))
+ "@var{thickness} is a pair giving how far, as a multiple of 
line-thickness,

+the white outline extends past the extents of stencil @var{stil}
+horizontally/vertically."
   (let*
- ((x-ext (interval-widen (ly:stencil-extent stil X) thickness))
- (y-ext (interval-widen (ly:stencil-extent stil Y) thickness)))
-
+ ((x-ext (interval-widen (ly:stencil-extent stil X) (car thickness)))
+ (y-ext (interval-widen (ly:stencil-extent stil Y) (cdr thickness
(ly:stencil-add
 (stencil-with-color (ly:round-filled-box x-ext y-ext blot) color)
 stil)))
@@ -806,18 +806,24 @@ specified it determines how far, as a multiple of 
@var{line-thickness},

 the white background extends past the extents of stencil @var{stil}.  If
 @var{thickness} has not been specified, an appropriate default is chosen
 based on @var{style}."
- (let ((thick (* line-thickness
- (if (number? thickness)
- thickness
+ (let* ((finalize-thickness (lambda (x)
+ (* line-thickness
+ (if (number? x)
+ x
  (cond
   ((eq? style 'outline) 3)
   ((eq? style 'rounded-box) 3)
   (else 0))
+ (X-thick (finalize-thickness (if (pair? thickness) (car thickness) 
thickness)))
+ (Y-thick (finalize-thickness (if (pair? thickness) (cdr thickness) 
thickness

+
 (cond
  ((eq? style 'special) stil)
- ((eq? style 'outline) (stencil-whiteout-outline stil thick))
- ((eq? style 'rounded-box) (stencil-whiteout-box stil thick (* 2 thick)))
- (else (stencil-whiteout-box stil thick)
+ ; giving thickness as a number-pair makes no sense for style 'outline, 
so only X dimension is 

Re: Extend Whiteout property

2018-09-08 Thread foxfanfare
Lukas-Fabian Moser wrote
> I took this as an intencive to take a stab at delving into the source 
> code (which I always did read-only up to now). I think I managed to 
> create a working branch from current master (I also never got the hang 
> of git...) that allows for
> 
> \version "2.21"
> 
> \new Staff {
>    \override NoteHead.whiteout = #'(5 . 40)   % Pair of X-thickness and 
> Y-thickness
>    g'4
>    r2
>    \override NoteHead.whiteout = #'(40 . 5)
>    g'4
> }
> 
> producing
> 
> 
> 
> But, to be honest, I
> a) am a bit ashamed because I certainly produced quite a mess in terms 
> of code quality (being a once-a-year programmer),
> b) don't quite now how to proceed with it from now.
> 
> Is there a way that one of the more experienced developers might take a 
> look at what I produced at help me in getting it up to scratch?
> 
> Best
> Lukas
> 
> ___
> lilypond-user mailing list

> lilypond-user@

> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 
> gjpmndgipmfcbcgg.png (10K)
> http://lilypond.1069038.n5.nabble.com/attachment/215907/0/gjpmndgipmfcbcgg.png;

Thank you all for your interest in solving this problem!
For now I will use a white markup, but I look forward to your new solution,
this looks very promising Lukas!



--
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: Extend Whiteout property

2018-09-07 Thread Thomas Morley
2018-09-07 16:39 GMT+02:00 Lukas-Fabian Moser :

> I took this as an intencive to take a stab at delving into the source code 
> (which I always did read-only up to now). I think I managed to create a 
> working branch from current master (I also never got the hang of git...) that 
> allows for

[...]

>
> Is there a way that one of the more experienced developers might take a look 
> at what I produced at help me in getting it up to scratch?

A look at what you did would be helpful. ;)
Could you post a git formated patch?
Or a diff?

Cheers,
  Harm

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


Re: Extend Whiteout property

2018-09-07 Thread Lukas-Fabian Moser

Hi Kieren,


Well done. Does it also work with other whiteout styles (e.g., outline)?

Not yet. Of course, "rounded-box" would be nice to have (and probably 
not too hard to implement). I expect "outline" would be more involved; 
tbh, I'm not quite certain what the precise meaning would be for that 
style, anyway.


In any case, I haven't yet taken a look at how "outline" actually works.

Best
Lukas

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


Re: Extend Whiteout property

2018-09-07 Thread Urs Liska



Am 07.09.2018 um 16:39 schrieb Lukas-Fabian Moser:


Dear Kieren,

Am 07.09.2018 um 15:24 schrieb Kieren MacMillan:

Hi Fox & folks,


I wonder if it is possible to extend in the X-direction the whiteout property 
on a grob?

This is something I’ve been musing about for about six months now. There are 
definitely situations where I want to have independent control of the 
[thickness/extent of the] X- and Y- directions of the whiteout.

Looking forward to hearing any solutions offered (beyond the obvious markup 
solution you posted).
I took this as an intencive to take a stab at delving into the source 
code (which I always did read-only up to now). I think I managed to 
create a working branch from current master (I also never got the hang 
of git...) that allows for


\version "2.21"

\new Staff {
  \override NoteHead.whiteout = #'(5 . 40)   % Pair of X-thickness and 
Y-thickness

  g'4
  r2
  \override NoteHead.whiteout = #'(40 . 5)
  g'4
}

producing



But, to be honest, I
a) am a bit ashamed because I certainly produced quite a mess in terms 
of code quality (being a once-a-year programmer),

b) don't quite now how to proceed with it from now.

Is there a way that one of the more experienced developers might take 
a look at what I produced at help me in getting it up to scratch?


I assume you won't get push access to the official Git repository on 
Savannah too soon.
A significantly lower threshold is on the Github mirror 
(https://github.com/lilypond/lilypond). This is only partially 
up-to-date, but I have right now pushed the latest state of the master 
and the staging branches, so they are in sync with the Savannah repository.


What you can do now is

 * fork this repository
 * register the fork and the main Github repository as "remotes" in
   your local repository (I suggest to name them "github" and
   "" if you have the Savannah repository
   as "origin")
 * create a branch for your path
 * commit
 * push to your fork
 * create a Pull Request on Github
 * tell us here about it because we won't be automatically notified
   about it.

That way anyone can look at your code, and you should be able to refine 
the code together with others.
At some point you may then do the required registrations and upload your 
patch for review (as per LilyPond's Contributrs' Guide), or you may ask 
someone else to "sheperd" your patch through the review process.


HTH
Urs




Best
Lukas


___
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: Extend Whiteout property

2018-09-07 Thread Kieren MacMillan
Hi Lukas,

> I took this as an intencive to take a stab at delving into the source code 
> (which I always did read-only up to now).

Nice!

> I think I managed to create a working branch from current master (I also 
> never got the hang of git...)

Ugh… I have to do that someday, too.

> that allows for
> 
> \version "2.21"
> 
> \new Staff {
>   \override NoteHead.whiteout = #'(5 . 40)   % Pair of X-thickness and 
> Y-thickness
>   g'4
>   r2
>   \override NoteHead.whiteout = #'(40 . 5) 
>   g'4
> }

Well done. Does it also work with other whiteout styles (e.g., outline)?

> Is there a way that one of the more experienced developers might take a look 
> at what I produced at help me in getting it up to scratch?

I hope so! I’ve copied this to -devel, just in case that helps get the word out.

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: Extend Whiteout property

2018-09-07 Thread Lukas-Fabian Moser

Dear Kieren,

Am 07.09.2018 um 15:24 schrieb Kieren MacMillan:

Hi Fox & folks,


I wonder if it is possible to extend in the X-direction the whiteout property 
on a grob?

This is something I’ve been musing about for about six months now. There are 
definitely situations where I want to have independent control of the 
[thickness/extent of the] X- and Y- directions of the whiteout.

Looking forward to hearing any solutions offered (beyond the obvious markup 
solution you posted).
I took this as an intencive to take a stab at delving into the source 
code (which I always did read-only up to now). I think I managed to 
create a working branch from current master (I also never got the hang 
of git...) that allows for


\version "2.21"

\new Staff {
  \override NoteHead.whiteout = #'(5 . 40)   % Pair of X-thickness and 
Y-thickness

  g'4
  r2
  \override NoteHead.whiteout = #'(40 . 5)
  g'4
}

producing



But, to be honest, I
a) am a bit ashamed because I certainly produced quite a mess in terms 
of code quality (being a once-a-year programmer),

b) don't quite now how to proceed with it from now.

Is there a way that one of the more experienced developers might take a 
look at what I produced at help me in getting it up to scratch?


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


Re: Extend Whiteout property

2018-09-07 Thread Kieren MacMillan
Hi Fox & folks,

> I wonder if it is possible to extend in the X-direction the whiteout property 
> on a grob?

This is something I’ve been musing about for about six months now. There are 
definitely situations where I want to have independent control of the 
[thickness/extent of the] X- and Y- directions of the whiteout.

Looking forward to hearing any solutions offered (beyond the obvious markup 
solution you posted).

Best,
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