doc fix for lily/stem-engraver.cc (issue 198820043 by david.nales...@gmail.com)

2015-01-18 Thread david . nalesnik

Reviewers: ,

Message:
Please review.

Description:
doc fix for lily/stem-engraver.cc

This engraver also creates Flag and StemStub grobs.

Please review this at https://codereview.appspot.com/198820043/

Affected files (+3, -1 lines):
  M lily/stem-engraver.cc


Index: lily/stem-engraver.cc
diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc
index  
62c0974f9f3a04627b807c70f0d76581fadcfb14..45c777fb04091e61574ba5ccd444cea96c1c658b  
100644

--- a/lily/stem-engraver.cc
+++ b/lily/stem-engraver.cc
@@ -236,11 +236,13 @@ ADD_ACKNOWLEDGER (Stem_engraver, rhythmic_head);

 ADD_TRANSLATOR (Stem_engraver,
 /* doc */
-Create stems and single-stem tremolos.  It also works
+Create stems, flags and single-stem tremolos.  It also  
works

  together with the beam engraver for overriding beaming.,

 /* create */
+Flag 
 Stem 
+StemStub 
 StemTremolo ,

 /* read */



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


Re: making measure-counter-stencil public (issue 203130043 by thomasmorle...@gmail.com)

2015-02-17 Thread david . nalesnik

LGTM.  Thanks!

https://codereview.appspot.com/203130043/

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


Re: 'measure-counter-stencil' not public?

2015-02-17 Thread David Nalesnik
Hi Harm,

On Tue, Feb 17, 2015 at 5:09 PM, Thomas Morley thomasmorle...@gmail.com
wrote:

 2015-02-17 21:35 GMT+01:00 David Nalesnik david.nales...@gmail.com:
  Hi Harm,
 
  On Tue, Feb 17, 2015 at 2:21 PM, Thomas Morley thomasmorle...@gmail.com
 
  wrote:
 
  Hi,
 
  is there any reason the stencil-procedure for
  'measure-counter-stencil' isn't public?
  It doesn't works with 'make-stencil-boxer' etc
 
 
  Apparently, for no good reason!  Do you want to change it?
 
  --David

 Hi David,

 if you don't mind I'll provide a patch, soon.


Thanks--I appreciate that!

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


Re: Make Grob::name accessible to Scheme (issue 203090043 by david.nales...@gmail.com)

2015-02-16 Thread David Nalesnik
On Mon, Feb 16, 2015 at 1:30 PM, David Kastrup d...@gnu.org wrote:

 David Nalesnik david.nales...@gmail.com writes:

  I suppose even better would be to come up with a way to automatically
  document public Scheme functions, but I wouldn't know how to do that
  at this point.

 Shouldn't actually be too hard.  But I doubt that all functions with doc
 strings would actually make sense in the internals manual.


True.  It could be something sloppy which is introduced with a warning to
that effect.  Functions might be organized by the source file.
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Make Grob::name accessible to Scheme (issue 203090043 by david.nales...@gmail.com)

2015-02-16 Thread David Nalesnik
On Mon, Feb 16, 2015 at 10:04 AM, Paul Morris p...@paulwmorris.com wrote:

P.S. FWIW, here's one marginal use case.  I've been using grob names to
 differentiate key signature grobs from key cancellation grobs, within a
 custom engraver that acknowledges the key-signature-interface.  I could add
 a second engraver for the key-cancellation-interface to deal with key
 cancellation grobs, but since both key signatures and key cancellations
 have
 the key-signature-interface, I would still need a way to differentiate
 between them in the engraver that acknowledges the key-signature-interface.
 Either ly:grob-name or (better yet) ly:grob-has-interface would be helpful
 to have for this kind of thing.


In this case, KeySignature has both key-signature-interface and
key-cancellation-interface, but KeyCancellation only has
key-cancellation-interface, so you can still use interfaces here.
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Make Grob::name accessible to Scheme (issue 203090043 by david.nales...@gmail.com)

2015-02-16 Thread David Nalesnik
On Mon, Feb 16, 2015 at 12:20 PM, David Kastrup d...@gnu.org wrote:

 Paul Morris p...@paulwmorris.com writes:

  dak wrote
  Paul Morris lt;
 
  paul@
 
  gt; writes:
  Hmmm... would it be a good idea to also have a ly:grob-has-interface
  scheme
  function?
 
  How would it differ from the existing grob::has-interface
 
  Um... oops, I guess it wouldn't...  Never mind, I just didn't know
  about grob::has-interface. (I usually just look on the
  internals/scheme-functions manual page for this kind of thing.)

 That only documents functions written in C++.  We don't really have a
 reasonably complete compendium of user-accessible LilyPond programming
 resources.


This is a good argument for creating ly:grob-has-interface.  I only know
about grob::has-interface through stumbling onto it in an email.  A user
wouldn't know about it unless they saw that email from Neil Puttock (I
believe it was), saw some code inspired by it, or noticed it in
scm/output-library,scm, or wherever it is.   I've searched for it in scm
files a number of times, because its name is odd.  (I'm not even sure about
the two colons as I type this, but then again, my memory is bad.)   The
Scheme functions page would be a great place to see documentation for this.

I suppose even better would be to come up with a way to automatically
document public Scheme functions, but I wouldn't know how to do that at
this point.
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Function to display the rhythmic location of a grob (issue 197690044 by david.nales...@gmail.com)

2015-02-18 Thread david . nalesnik

On 2015/02/18 18:08:32, david.nalesnik wrote:

Putting it into Scheme will need to wait for Issue 4289 to make it to
master, since I'll be able to use ly:item-get-column here.



https://codereview.appspot.com/197690044/

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


Re: Function to display the rhythmic location of a grob (issue 197690044 by david.nales...@gmail.com)

2015-02-18 Thread david . nalesnik

On 2015/02/18 18:02:38, dak wrote:

On 2015/02/18 17:53:44, david.nalesnik wrote:
 Please review.  Thanks!



Can't this be done just as easily in Scheme?


Sure--that crossed my mind.  The reason I went with C++ is so that it
would be documented prominently, but I could change it if that's not a
sufficient reason.

https://codereview.appspot.com/197690044/

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


Re: Function to display the rhythmic location of a grob (issue 197690044 by david.nales...@gmail.com)

2015-02-18 Thread david . nalesnik

On 2015/02/18 18:07:19, dak wrote:

On 2015/02/18 18:05:17, david.nalesnik wrote:
 On 2015/02/18 18:02:38, dak wrote:
  On 2015/02/18 17:53:44, david.nalesnik wrote:
   Please review.  Thanks!
 
  Can't this be done just as easily in Scheme?

 Sure--that crossed my mind.  The reason I went with C++ is so that

it would be

 documented prominently, but I could change it if that's not a

sufficient

reason.



It should not be a sufficient reason.  Document-string it just as you

would the

C++ version, and we'll need to come up with a good way to pull those

into the

internals manual anyway.


OK, will do.

https://codereview.appspot.com/197690044/

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


Function to display the rhythmic location of a grob (issue 197690044 by david.nales...@gmail.com)

2015-02-18 Thread david . nalesnik

Reviewers: ,

Message:
Please review.  Thanks!

Description:
Function to display the rhythmic location of a grob

A convenient way to return the musical position of a grob within
a score will be very helpful in debugging, among other uses.

This patch creates a function ly:grob-rhythmic-location which
returns location as a list with the following structure:

(global-timestep (measure-number . measure-position))

Please review this at https://codereview.appspot.com/197690044/

Affected files (+33, -0 lines):
  M lily/grob-scheme.cc


Index: lily/grob-scheme.cc
diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc
index  
238a0af7518189024210bda07cc9ee70aa515c40..1a1692962967208915492d9b39ce3b9a6ef506b7  
100644

--- a/lily/grob-scheme.cc
+++ b/lily/grob-scheme.cc
@@ -21,9 +21,12 @@
 #include font-interface.hh
 #include grob-array.hh
 #include item.hh
+#include moment.hh
 #include output-def.hh
+#include paper-column.hh
 #include paper-score.hh
 #include simple-closure.hh
+#include spanner.hh
 #include system.hh
 #include unpure-pure-container.hh
 #include warn.hh  // error ()
@@ -482,3 +485,33 @@ LY_DEFINE  
(ly_grob_get_vertical_axis_group_index, ly:grob-get-vertical-axis-gro


   return scm_from_int (Grob::get_vertical_axis_group_index (gr));
 }
+
+LY_DEFINE (ly_grob_rhythmic_location, ly:grob-rhythmic-location,
+   1, 0, 0, (SCM g),
+   Return the rhythmic position of grob @var{g} as a list.
+ The @code{car} of the list is the global timestep, a
+moment.  The @code{cadr} is a pair consisting of the
+measure number and the position (moment) within
+the measure.)
+{
+  LY_ASSERT_SMOB (Grob, g, 1);
+  Grob *me = Grob::unsmob (g);
+
+  Paper_column *col = 0;
+
+  if (Spanner *sp = dynamic_castSpanner *(me))
+{
+  if (Item *left_bound = sp-get_bound (LEFT))
+col = left_bound-get_column ();
+}
+  else if (Item *it = dynamic_castItem *(me))
+col = it-get_column ();
+
+  if (!col) return 0;
+
+  Moment when = Paper_column::when_mom (col);
+
+  SCM rhythmic_location = col-get_property (rhythmic-location);
+
+  return scm_list_2 (when.smobbed_copy (), rhythmic_location);
+}



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


Re: Make Grob::name accessible to Scheme (issue 203090043 by david.nales...@gmail.com)

2015-02-18 Thread david . nalesnik

Hmmm.  Since this is no longer just a wrapper for Grob::name, I suppose
I should rewrite it in Scheme.

https://codereview.appspot.com/203090043/

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


Re: Function to display the rhythmic location of a grob (issue 197690044 by david.nales...@gmail.com)

2015-02-18 Thread david . nalesnik

On 2015/02/18 18:12:58, david.nalesnik wrote:

On 2015/02/18 18:08:32, david.nalesnik wrote:



Putting it into Scheme will need to wait for Issue 4289 to make it to

master,

since I'll be able to use ly:item-get-column here.


However, we lose the nice error reporting which happens when you do
(ly:grob-name 2) for example.

https://codereview.appspot.com/197690044/

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


Re: Function to display the rhythmic location of a grob (issue 197690044 by david.nales...@gmail.com)

2015-02-18 Thread david . nalesnik

On 2015/02/18 20:39:19, david.nalesnik wrote:

On 2015/02/18 18:12:58, david.nalesnik wrote:
 On 2015/02/18 18:08:32, david.nalesnik wrote:

 Putting it into Scheme will need to wait for Issue 4289 to make it

to master,

 since I'll be able to use ly:item-get-column here.



However, we lose the nice error reporting which happens when you do
(ly:grob-name 2) for example.


Arghh,  Comment attached to wrong issue.  But the same applies: it seems
that a drawback of using Scheme is losing the nice error messages that
result from doing LY_ASSERT_SMOB.

https://codereview.appspot.com/197690044/

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


Re: Make Grob::name accessible to Scheme (issue 203090043 by david.nales...@gmail.com)

2015-02-18 Thread david . nalesnik

On 2015/02/18 19:32:57, david.nalesnik wrote:

Hmmm.  Since this is no longer just a wrapper for Grob::name, I

suppose I should

rewrite it in Scheme.


Not so sure now.  Error reporting options in Scheme aren't as good.

https://codereview.appspot.com/203090043/

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


Re: 'measure-counter-stencil' not public?

2015-02-17 Thread David Nalesnik
Hi Harm,

On Tue, Feb 17, 2015 at 2:21 PM, Thomas Morley thomasmorle...@gmail.com
wrote:

 Hi,

 is there any reason the stencil-procedure for
 'measure-counter-stencil' isn't public?
 It doesn't works with 'make-stencil-boxer' etc


Apparently, for no good reason!  Do you want to change it?

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


Re: Make Grob::name accessible to Scheme (issue 203090043 by david.nales...@gmail.com)

2015-02-16 Thread David Nalesnik
On Mon, Feb 16, 2015 at 4:01 PM, Paul Morris p...@paulwmorris.com wrote:

  On Feb 16, 2015, at 2:06 PM, David Nalesnik david.nales...@gmail.com
 wrote:
 
  In this case, KeySignature has both key-signature-interface and
 key-cancellation-interface, but KeyCancellation only has
 key-cancellation-interface, so you can still use interfaces here.

 Thanks David N.  Yes, I see.  Although I think you meant that it’s
 KeyCancellation that has both interfaces. :-)


Ah, right you are!  All these pesky details...
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Function to display the rhythmic location of a grob (issue 197690044 by david.nales...@gmail.com)

2015-02-19 Thread david . nalesnik

On 2015/02/18 20:43:51, david.nalesnik wrote:


it seems that a
drawback of using Scheme is losing the nice error messages that result

from

doing LY_ASSERT_SMOB.


False alarm.



https://codereview.appspot.com/197690044/

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


Add Scheme function to return column associated with Item. (issue 203910043 by david.nales...@gmail.com)

2015-02-15 Thread david . nalesnik

Reviewers: ,

Message:
Please review.

Description:
Add Scheme function to return column associated with Item.

The C++ function PaperColumn::get_column is used frequently,
and it makes sense to have a Scheme function which performs
the same task.  An example of a practical application
is the request by users to return the location of a particular
grob in a score: this is done by examining the PaperColumn
or NonMusicalPaperColumn associated with the grob.

Please review this at https://codereview.appspot.com/203910043/

Affected files (+15, -0 lines):
  M lily/item-scheme.cc


Index: lily/item-scheme.cc
diff --git a/lily/item-scheme.cc b/lily/item-scheme.cc
index  
0e6b71ef30a8191931495c3ff16bd6d9bb5fcadb..24ccf5bf0de97ba751afa514b2e777392c73  
100644

--- a/lily/item-scheme.cc
+++ b/lily/item-scheme.cc
@@ -19,6 +19,7 @@
 */

 #include item.hh
+#include paper-column.hh

 LY_DEFINE (ly_item_p, ly:item?,
1, 0, 0, (SCM g),
@@ -39,3 +40,17 @@ LY_DEFINE (ly_item_break_dir, ly:item-break-dir,
   Item *me = Item::unsmob (it);
   return scm_from_int (me-break_status_dir ());
 }
+
+LY_DEFINE (ly_item_get_column, ly:item-get-column,
+   1, 0, 0, (SCM it),
+   Return the @code{PaperColumn} or @code{NonMusicalPaperColumn}
+associated with this @code{Item}.)
+{
+  LY_ASSERT_SMOB (Item, it, 1);
+  Item *me = Item::unsmob (it);
+
+  if (Paper_column *col = me-get_column ())
+return col-self_scm ();
+
+  return SCM_EOL;
+}



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


Re: Make Grob::name accessible to Scheme (issue 203090043 by david.nales...@gmail.com)

2015-02-16 Thread david . nalesnik

On 2015/02/16 07:56:10, dak wrote:

On 2015/02/15 19:54:19, david.nalesnik wrote:
 Please review.  Thanks!



Needing to determine the name of a grob should actually rarely be

necessary:

the pervasive information connected to the functionality of a grob is

rather its

interfaces.  That's the usual criterion for deciding whether to deal

with a

particular grob.  Relaying on the name makes it harder to create

variants of

existing grobs.


I see what you are saying.  I'm aware that grob recognition takes place
through interfaces, and that the user could use grob::has-interface.
(This does lead to awkwardness when, for example, you want a
NonMusicalPaperColumn, since there is no
nonmusical-paper-column-interface.)

There are uses for the name of a grob, say for inclusion in text.  Also,
ly:context-grob-name and ly:engraver-make-grob accept a name as
argument.

This function would one of a group: ly:context-name, ly:translator-name,
and ly:font-name.


https://codereview.appspot.com/203090043/

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


Re: Make Grob::name accessible to Scheme (issue 203090043 by david.nales...@gmail.com)

2015-02-19 Thread david . nalesnik

On 2015/02/18 20:46:03, david.nalesnik wrote:

On 2015/02/18 19:32:57, david.nalesnik wrote:
 Hmmm.  Since this is no longer just a wrapper for Grob::name, I

suppose I

should
 rewrite it in Scheme.



Not so sure now.  Error reporting options in Scheme aren't as good.


I take that back.  If I don't specifically meddle with the error
message--as with grob::has-interface--I get what appear to be the same
results.

https://codereview.appspot.com/203090043/

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


Re: Make Grob::name accessible to Scheme (issue 203090043 by david.nales...@gmail.com)

2015-02-19 Thread david . nalesnik

And in a few moments a version where I didn't strip the docstring...


https://codereview.appspot.com/203090043/

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


Issue 2535: Staccato on stem side alignment when other articulations are present (issue 196260043 by david.nales...@gmail.com)

2015-01-26 Thread david . nalesnik

Reviewers: ,

Message:
Please review.

Description:
Issue 2535: Staccato on stem side alignment when other articulations are
present

The default positioning of staccato dots in combination with other
articulations
is poor, because the dot is positioned midway between the center of the
note head
and the stem, while all other scripts are centered on the note head.

A mechanism is needed to allow a staccato dot to be positioned
differently when alone
and when in combination with other articulations.  The property
'toward-stem-shift
controls the alignment of scripts appearing on the side of the stem.
This patch
changes the type of 'toward-stem-shift to number-pair rather than
number.  The first
member of the pair indicates the shift when alone, the second the shift
when the
script is contained by a ScriptColumn object.  The vast majority of
articulations
default to '(0.0 . 0.0), indicating that they are always centered above
the note head
when on the stem side.  Three articulations--staccato, staccatissimo,
and stopped--are
set to '(1.0 . 0.0), either directly above the stem or centered on the
note head,
ensuring that combinations like accent-staccato will be properly aligned
by default.

The previous default of 0.5 for staccato has been modified, in
accordance with Gould's
recommendation.

In order to allow a script to recognize the column organizing it, a
pointer to
ScriptColumn, called 'script-column, has been added to script-interface.

Please review this at https://codereview.appspot.com/196260043/

Affected files (+30, -15 lines):
  M input/regression/script-shift.ly
  M lily/script-column.cc
  M lily/script-interface.cc
  M scm/define-grob-properties.scm
  M scm/output-lib.scm
  M scm/script.scm


Index: input/regression/script-shift.ly
diff --git a/input/regression/script-shift.ly  
b/input/regression/script-shift.ly
index  
88f8f72f02524535330d94df8dc9bfa4001cc4a3..512fc9184617950dee0fe354aeb8286cfd912ac8  
100644

--- a/input/regression/script-shift.ly
+++ b/input/regression/script-shift.ly
@@ -2,17 +2,24 @@
 \header {
   texidoc = The @code{toward-stem-shift} property controls the precise
 horizontal location of scripts that are placed above an upstem or below
-a downstem note (@code{0.0} means centered on the note head, @code{1.0}
-means centered on the stem).
+a downstem note.  The first number of the pair indicates the shift
+applied when the script is alone, the second when present with other
+scripts.  (@code{0.0} means centered on the note head, @code{1.0}
+means centered on the stem.)
 
 }

-\version 2.17.6
+\version 2.19.16
 \relative c''
 {
-  \override Script.toward-stem-shift = #0.0
+  \override Script.toward-stem-shift = #'(0.0 . 0.0)
   a4^. c_.

-  \override Script.toward-stem-shift = #1.0
+  \override Script.toward-stem-shift = #'(1.0 . 0.0)
   a4^. c_.
+
+  a4^.^- c_._-
+
+  a4-\tweak toward-stem-shift #'(1.0 . 1.0) ^.^-
+  c4_. -\tweak toward-stem-shift #'(1.0 . 1.0) _-
 }
Index: lily/script-column.cc
diff --git a/lily/script-column.cc b/lily/script-column.cc
index  
0e797b543f2948cccd5495686ceb3895a76dd16c..2456f8b00b05d5c13e9969fce2bb5ea77fe408b5  
100644

--- a/lily/script-column.cc
+++ b/lily/script-column.cc
@@ -39,6 +39,7 @@ Script_column::add_side_positioned (Grob *me, Grob  
*script)

 return;

   Pointer_group_interface::add_grob (me, ly_symbol2scm (scripts),  
script);

+  script-set_object (script-column, me-self_scm ());
 }

 LY_DEFINE (ly_grob_script_priority_less, ly:grob-script-priority-less,
Index: lily/script-interface.cc
diff --git a/lily/script-interface.cc b/lily/script-interface.cc
index  
8778f5c6d316b8dbda9b4157aa81906260ac1fcf..bf0e96dacb554d0b9e4f0153936b1764f09a056f  
100644

--- a/lily/script-interface.cc
+++ b/lily/script-interface.cc
@@ -153,6 +153,7 @@ ADD_INTERFACE (Script_interface,
avoid-slur 
direction-source 
positioning-done 
+   script-column 
script-priority 
script-stencil 
side-relative-direction 
Index: scm/define-grob-properties.scm
diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm
index  
b850a18e8beb3c39cb0786c3b695916cae3e106f..77b392425f393cc6d5a9e5d703d8bf4da6aaf34c  
100644

--- a/scm/define-grob-properties.scm
+++ b/scm/define-grob-properties.scm
@@ -1086,11 +1086,12 @@ in the list causes the corresponding tie to be  
formatted

 automatically.)
  (to-barline ,boolean? If true, the spanner will stop at the bar
 line just before it would otherwise stop.)
- (toward-stem-shift ,number? Amount by which scripts are shifted
-toward the stem if their direction coincides with the stem direction.
-@code{0.0} means keep the default position (centered on the note
-head), @code{1.0} means centered on the stem.  Interpolated values are
-possible.)
+ (toward-stem-shift ,number-pair? Amount by which scripts are shifted
+toward the stem if their direction coincides with the stem direction.  The

Re: Issue 2535: Staccato on stem side alignment when other articulations are present (issue 196260043 by david.nales...@gmail.com)

2015-01-27 Thread david . nalesnik


https://codereview.appspot.com/196260043/diff/20001/input/regression/script-shift.ly
File input/regression/script-shift.ly (right):

https://codereview.appspot.com/196260043/diff/20001/input/regression/script-shift.ly#newcode6
input/regression/script-shift.ly:6: means centered on the stem.)
On 2015/01/27 20:43:56, lemzwerg wrote:

The old code is correct...


I'm going by the American practice that the period goes inside the
parentheses if the parentheses enclose the sentence, outside if the
sentence begins outside the parentheses.  I'm happy to change it back
though--it's kind of pedantic of me!

https://codereview.appspot.com/196260043/

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


Re: Issue 2535: Staccato on stem side alignment when other articulations are present (issue 196260043 by david.nales...@gmail.com)

2015-01-27 Thread david . nalesnik

Eek.  Sorry for overquoting.

https://codereview.appspot.com/196260043/

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


Re: Issue 2535: Staccato on stem side alignment when other articulations are present (issue 196260043 by david.nales...@gmail.com)

2015-01-27 Thread david . nalesnik

On 2015/01/27 07:32:24, dak wrote:

Aaaand another thought: wouldn't it make more sense instead of having
independent shifts for with other articulations and without other
articulations when the articulation closest to the notehead is

responsible for

aligning the whole stack of articulations?


Not in the case of staccatos, however.  Staccatos are ideally (according
to Gould) centered on the stem when alone, and centered on the notehead
when with others.  I can't think of an example of a compound
articulation where staccato is at the bottom.


Which would be the extreme case of a weighted average where

articulations

closest to the notehead count most towards alignment.  But I suspect

that

looking at more than just the closest articulation would likely be

overkill and

not an actual improvement.


Yes, I think weighting different toward-stem-shift values is too much.
After all, articulations ought to be vertically aligned, and if a user
for some reason wants to shift a single member of the stack, the numbers
they use ought to reflect exactly the position relative to notehead and
stem.

https://codereview.appspot.com/196260043/

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


Re: Issue 2535: Staccato on stem side alignment when other articulations are present (issue 196260043 by david.nales...@gmail.com)

2015-01-27 Thread david . nalesnik

On 2015/01/27 08:50:36, dak wrote:

On 2015/01/27 07:52:05, lemzwerg wrote:
 On 2015/01/27 07:26:53, dak wrote:
  It seems to me like this number-pair consists of two settings that

would

 almost
  always be adjusted independently.  Wouldn't it make more sense to

make a

  separate property here?  That way, the user would not need to

remember and

  restate the setting he is not interested in.

 IMHO it's better to logically stick stuff together.  We already have

far too

 much properties, and in this particular case I doubt that the user

will change

 the values very often so I think the benefits of having a single

property are

 exceeding the potential disadvantages.



You can logically stick stuff together by naming it appropriately,

making them

come next to each other in alphabet and thus in documentation.  You

state the

benefits of having a single property are exceeding the potential

disadvantages

but don't actually name a single such benefit.



The main problem with having far too many properties is that one has

a lot of

individual controls.  But you don't actually propose having fewer

controls but

rather making it impossible to use one control without specifying a

value for

the other one.  That's not a simplification but a complication.  And

we are not

talking about something where the two values are related like in an

interval.

This change is motivated by the very small numbers of articulations
which behave differently when alone or in a compound articulation, so it
would make sense to add another property instead of requiring a longer
specification.  Only accidentals which belong to a ScriptColumn and
which have the new property set would be affected.

What would this property be named? snap-to-column? shift-in-column?

While I see the arguments for adding another property, I worry that in
so doing there is a risk of making all of this even more obscure.


At any rate, this discussion may be idle: it is likely that we don't

need two

separate settings anyway if it is feasible to align the whole accent

stack based

on its notehead-closest member.  The only time when this might not

work is when

stem and accents are on the same side of the notehead and wide accents

like --

(or was that -_ ?) come into play.  I don't think this should happen

often, but

at least with double-stemmed noteheads it would be hard to avoid.




https://codereview.appspot.com/196260043/

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


Re: Issue 2535: Staccato on stem side alignment when other articulations are present (issue 196260043 by david.nales...@gmail.com)

2015-01-27 Thread david . nalesnik

On 2015/01/27 22:00:49, lemzwerg wrote:

https://codereview.appspot.com/196260043/diff/20001/input/regression/script-shift.ly

File input/regression/script-shift.ly (right):



https://codereview.appspot.com/196260043/diff/20001/input/regression/script-shift.ly#newcode6

input/regression/script-shift.ly:6: means centered on the stem.)
 I'm going by the American practice that the period goes
 inside the parentheses if the parentheses enclose the
 sentence, outside if the sentence begins outside
 the parentheses.  I'm happy to change it back though--it's
 kind of pedantic of me!



I fully agree with what you say, however, parentheses do *not* enclose

a full

sentence here (contrary to another place of the patch).


You're certainly right. Seems like I imagined a period!  OK, will
change.

https://codereview.appspot.com/196260043/

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


Re: Issue 2535: Staccato on stem side alignment when other articulations are present (issue 196260043 by david.nales...@gmail.com)

2015-01-29 Thread david . nalesnik


https://codereview.appspot.com/196260043/diff/20001/input/regression/script-shift.ly
File input/regression/script-shift.ly (right):

https://codereview.appspot.com/196260043/diff/20001/input/regression/script-shift.ly#newcode6
input/regression/script-shift.ly:6: means centered on the stem.)
On 2015/01/27 22:00:49, lemzwerg wrote:

 I'm going by the American practice that the period goes
 inside the parentheses if the parentheses enclose the
 sentence, outside if the sentence begins outside
 the parentheses.  I'm happy to change it back though--it's
 kind of pedantic of me!



I fully agree with what you say, however, parentheses do *not* enclose

a full

sentence here (contrary to another place of the patch).


Done.

https://codereview.appspot.com/196260043/

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


Re: Issue 2535: Staccato on stem side alignment when other articulations are present (issue 196260043 by david.nales...@gmail.com)

2015-01-27 Thread david . nalesnik

On 2015/01/27 15:07:24, dak wrote:

On 2015/01/27 14:37:27, david.nalesnik wrote:



 What would this property be named? snap-to-column? shift-in-column?



I suggest picking a name that starts in the same way as the existing

property.

toward-stem-shift-in-column would be unambiguous.  Long, perhaps, but
its 27 characters are exceeded by several properties, like
beamlet-max-length-proportion and outside-staff-placement-directive.


I am not sure we want another

numeric property if its value is just some trial-and-error offset

(possibly

unlikely to work with different notehead styles or values) to arrive

at

centered on notehead.


I do think that another numeric property is necessary.  After all, this
new property boils down to an alternate value of 'toward-stem-shift
(which is one of the principal motivations for including it in a number
pair).  As to potential problems with other sorts of noteheads, I'd have
to check, but that would mean that 'toward-stem-shift itself is flawed.
From the X-offset callback for Script in scm/output-lib, it appears that
the interpretation of this property is sound.



https://codereview.appspot.com/196260043/

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


Issue 4238: Glissando overlaps dot (issue 194920043 by david.nales...@gmail.com)

2015-01-06 Thread david . nalesnik

Reviewers: ,

Message:
Please review.

Description:
Issue 4238: Glissando overlaps dot

Glissandi will now begin after augmentation dots by default.  This
behavior may be changed by overriding a new subproperty named
'start-at-dot, set by default to #t.

Please review this at https://codereview.appspot.com/194920043/

Affected files (+29, -0 lines):
  A input/regression/glissando-dots.ly
  M lily/line-spanner.cc
  M scm/define-grobs.scm


Index: input/regression/glissando-dots.ly
diff --git a/input/regression/glissando-dots.ly  
b/input/regression/glissando-dots.ly

new file mode 100644
index  
..c0c6621231896bf6e605f1816978c79473ffca39

--- /dev/null
+++ b/input/regression/glissando-dots.ly
@@ -0,0 +1,24 @@
+\version 2.19.16
+
+\header {
+  texidoc = Glissandi begin after dots by default.  This behavior may
+be changed by overriding the @code{start-at-dot} property.
+
+}
+
+\layout {
+  indent = 0
+  ragged-right = ##t
+}
+
+\relative c'' {
+  c2.\glissando b4
+  c2..\glissando b8
+  c2...\glissando b16
+  \bar ||
+  c e g2. -\tweak style #'trill \glissando g b d4
+  \bar ||
+  c2...\glissando g''16
+  \override Glissando.bound-details.left.start-at-dot = ##f
+  c,,2...\glissando g''16
+}
Index: lily/line-spanner.cc
diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc
index  
6921ba058ec8e8d440218b4babf076773be0585a..5184d396a6ce84745599032c0cebdb4db8e86276  
100644

--- a/lily/line-spanner.cc
+++ b/lily/line-spanner.cc
@@ -118,6 +118,10 @@ Line_spanner::calc_bound_info (SCM smob, Direction dir)
   if (acc  to_boolean (ly_assoc_get (ly_symbol2scm  
(end-on-accidental), details, SCM_BOOL_F)))
 x_coord = robust_relative_extent (acc, commonx,  
X_AXIS).linear_combination (attach);


+  Grob *dot = Grob::unsmob (bound_grob-get_object (dot));
+  if (dot  to_boolean (ly_assoc_get (ly_symbol2scm (start-at-dot),  
details, SCM_BOOL_F)))
+x_coord = robust_relative_extent (dot, commonx,  
X_AXIS).linear_combination (attach);

+
   details = scm_acons (ly_symbol2scm (X),
scm_from_double (x_coord),
details);
Index: scm/define-grobs.scm
diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm
index  
e939ac9b5249f66aa5a6b22a712d83300ca80e4d..c859b52bcbeee1d59a9b8af1f758246eab43b940  
100644

--- a/scm/define-grobs.scm
+++ b/scm/define-grobs.scm
@@ -1067,6 +1067,7 @@
 ))
   (left . ((attach-dir .  ,RIGHT)
(padding . 0.5)
+   (start-at-dot . #t)
))
   ))
 (cross-staff . ,ly:line-spanner::calc-cross-staff)



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


Re: Add Scheme function to return column associated with Item. (issue 203910043 by david.nales...@gmail.com)

2015-02-15 Thread David Nalesnik
On Sun, Feb 15, 2015 at 7:58 AM, Urs Liska u...@openlilylib.org wrote:

 Can't judge the code but the idea looks great :-)


Thanks--I'm noticing that bits of code get reused on the lists, so there's
a need.   This will help tuck away some of the code gobbledygook that is so
off-putting..

It occurs to me that it shouldn't be any trouble to add something like
ly:item-location later on.  It could return (global-timestep . (measure .
measure-position))..

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


Re: Add Scheme function to return column associated with Item. (issue 203910043 by david.nales...@gmail.com)

2015-02-15 Thread David Nalesnik
On Sun, Feb 15, 2015 at 12:34 PM, Thomas Morley thomasmorle...@gmail.com
wrote:

 2015-02-15 19:28 GMT+01:00 Thomas Morley thomasmorle...@gmail.com:




 Oops, definition for 'grob-name' is missing:

 #(define grob-name
   (lambda (x)
 (if (ly:grob? x)
 (assq-ref (ly:grob-property x 'meta) 'name)
 (ly:error ~a is not a grob x


Now, a function to get a grob's name would certainly be useful.  I'm sick
to death of constantly recreating it or looking it up (as I bet you are)!
If there's a question of usefulness, I think we've established the need...

The benefit of doing this in C++ is that there's probably something in
place already and it will get automatically documented in the Scheme
functions list.
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Make Grob::name accessible to Scheme (issue 203090043 by david.nales...@gmail.com)

2015-02-15 Thread david . nalesnik

Reviewers: ,

Message:
Please review.  Thanks!

Description:
Make Grob::name accessible to Scheme

Needing to determine the name of a grob is extremely common to users
of Scheme.

Please review this at https://codereview.appspot.com/203090043/

Affected files (+11, -0 lines):
  M lily/grob-scheme.cc


Index: lily/grob-scheme.cc
diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc
index  
238a0af7518189024210bda07cc9ee70aa515c40..c2609a09d3926cfe19f5cdf60626bb2eaa7a5252  
100644

--- a/lily/grob-scheme.cc
+++ b/lily/grob-scheme.cc
@@ -482,3 +482,14 @@ LY_DEFINE  
(ly_grob_get_vertical_axis_group_index, ly:grob-get-vertical-axis-gro


   return scm_from_int (Grob::get_vertical_axis_group_index (gr));
 }
+
+LY_DEFINE (ly_grob_name, ly:grob-name,
+   1, 0, 0, (SCM grob),
+   Return the name of the grob @var{grob}.)
+{
+  Grob *gr = Grob::unsmob (grob);
+
+  LY_ASSERT_SMOB (Grob, grob, 1);
+
+  return ly_string2scm (gr-name ());
+}



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


Re: Add Scheme function to return column associated with Item. (issue 203910043 by david.nales...@gmail.com)

2015-02-15 Thread David Nalesnik
Hi Harm,

On Sun, Feb 15, 2015 at 12:28 PM, Thomas Morley thomasmorle...@gmail.com
wrote:



 Some time ago I wrote a more generic code:

 #(define (look-up-for-parent name-symbol axis grob)
 
  Return the parent of @var{grob}, specified by it's @var{name-symbol} in
  axis @var{axis}.
  If not found, look up for the next parent.
 
  (let* ((parent (ly:grob-parent grob axis)))
  (cond
((not (ly:grob? parent))
 (ly:error
(_Perhaps typing error for \~a\ or \~a\ is not in the
 parent-tree.)
name-symbol name-symbol))
((not (equal? name-symbol (grob-name parent)))
 (look-up-for-parent name-symbol axis parent))
(else parent


 I wonder whether something like this may be implemented at C++ level
 and your ly:item-get-column as a special case of it.

 What do you think?


The patch simply makes a commonly used C++ function available through
Scheme, on the model of functions like ly:grob-system.  Now I couldn't say
whether the function it wraps--Paper_column::get_column--could benefit from
a different approach.  In any case, this patch just provides an interface
for it, whatever its implementation details are.

 I do think that what you're describing would be very useful as another
function usable in C++ and Scheme: given a grob, check whether it related
by parentage to some other grob.  (I know that ly:grob-extent and
ly:grob-relative-coordinate require this, so your function would help
finding appropriate input for them.)

I wonder if it should operate by the actual grob pointer instead of its
name, in line with the way other functions work.

This is so useful, that I wonder if there's a C++ function which just
hasn't been made accessible yet!
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Add Scheme function to return column associated with Item. (issue 203910043 by david.nales...@gmail.com)

2015-02-15 Thread David Nalesnik
On Sun, Feb 15, 2015 at 1:14 PM, David Nalesnik david.nales...@gmail.com
wrote:


 Now, a function to get a grob's name would certainly be useful.  I'm sick
 to death of constantly recreating it or looking it up (as I bet you are)!
 If there's a question of usefulness, I think we've established the need...

 The benefit of doing this in C++ is that there's probably something in
 place already and it will get automatically documented in the Scheme
 functions list.


Yup--there's Grob::name.  Couldn't resist--patch up for ly:grob-name.

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


Re: Add Scheme function to return column associated with Item. (issue 203910043 by david.nales...@gmail.com)

2015-02-15 Thread David Nalesnik
Harm,

On Sun, Feb 15, 2015 at 2:42 PM, Thomas Morley thomasmorle...@gmail.com
wrote:


 Can't review C++, so I'll not post there.


There IS something you can help with, though.  In the patch as it stands,
I'm simply making Grob::name available through Scheme.  It thus returns a
string.  (Grob::name actually converts the Scheme symbol into a string.)
 Do you think that the Scheme function ought to return a symbol?  This is
doable, but I'd have to think of the best way.


 But:
 YIPEE!


Yeah, life is way too short...
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: git fetch returns fatal error

2015-01-03 Thread David Nalesnik
On Sat, Jan 3, 2015 at 4:13 PM, Thomas Morley thomasmorle...@gmail.com
wrote:

 Hi,

 after some months without own computer I've a new one and lilydevel
 working.


Good to hear it!

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


Re: ly:line-interface::print should read ly:line-spanner::print in NR (issue 186650043 by thomasmorle...@gmail.com)

2015-01-04 Thread david . nalesnik

LGTM.

https://codereview.appspot.com/186650043/

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


Update docstring in lily/note-head-line-engraver.cc (issue 194900043 by david.nales...@gmail.com)

2015-01-06 Thread david . nalesnik

Reviewers: ,

Message:
Please review.

Description:
Update docstring in lily/note-head-line-engraver.cc

As of commit 06dbc712c654888708b9feabbd0affe9ff2e4902
(May 27, 2003), this file is not involved in the creation
of Glissando grobs.

Please review this at https://codereview.appspot.com/194900043/

Affected files (+2, -4 lines):
  M lily/note-head-line-engraver.cc


Index: lily/note-head-line-engraver.cc
diff --git a/lily/note-head-line-engraver.cc  
b/lily/note-head-line-engraver.cc
index  
046a26423126567b9bfcd33e7979e49f8f1276ba..f9a6c91b2c690195188b5a0813fad2d98e98d137  
100644

--- a/lily/note-head-line-engraver.cc
+++ b/lily/note-head-line-engraver.cc
@@ -113,12 +113,10 @@ Note_head_line_engraver::stop_translation_timestep ()
 ADD_ACKNOWLEDGER (Note_head_line_engraver, rhythmic_head);
 ADD_TRANSLATOR (Note_head_line_engraver,
 /* doc */
-Engrave a line between two note heads, for example a
- glissando.  If @code{followVoice} is set, staff switches
- also generate a line.,
+Engrave a line between two note heads in a staff
+ switch if @code{followVoice} is set.,

 /* create */
-Glissando 
 VoiceFollower ,

 /* read */



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


toward-stem-shift-in-column should only consider 'script-interface (issue 207620043 by david.nales...@gmail.com)

2015-03-09 Thread david . nalesnik

Reviewers: ,

Message:
Please review.  Thanks.

Description:
toward-stem-shift-in-column should only consider 'script-interface

Previously, toward-stem-shift-in-column did not discriminate between
different types of grobs in the 'scripts grob-array.  This meant that
TextScript, StringNumber, and Fingering objects would be caught as well.
This patch only shifts an articulation in the presence of another Script
grob.

Please review this at https://codereview.appspot.com/207620043/

Affected files (+8, -1 lines):
  M scm/output-lib.scm


Index: scm/output-lib.scm
diff --git a/scm/output-lib.scm b/scm/output-lib.scm
index  
96456b1b77fb436ae4a90b6b7ae851c30fa01678..23de7381f62b4c8d8d1c0186e6f33bffd2d9d01f  
100644

--- a/scm/output-lib.scm
+++ b/scm/output-lib.scm
@@ -1187,7 +1187,14 @@ parent or the parent has no setting.
   (let* ((shift-when-alone (ly:grob-property grob 'toward-stem-shift 0.0))
  (shift-in-column (ly:grob-property  
grob 'toward-stem-shift-in-column))

  (script-column (ly:grob-object grob 'script-column))
- (shift (if (and (ly:grob? script-column) (number?  
shift-in-column))

+ (shift (if (and (ly:grob? script-column)
+ (number? shift-in-column)
+ ;; ScriptColumn can contain grobs other than  
Script.  These

+ ;; should not result in a shift.
+ (any (lambda (s)
+(and (not (eq? s grob))
+ (grob::has-interface  
s 'script-interface)))
+  (ly:grob-array-list (ly:grob-object  
script-column 'scripts

 shift-in-column shift-when-alone))
  (note-head-location
   (ly:self-alignment-interface::aligned-on-x-parent grob))



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


Re: toward-stem-shift-in-column should only consider 'script-interface (issue 207620043 by david.nales...@gmail.com)

2015-03-09 Thread david . nalesnik


https://codereview.appspot.com/207620043/diff/20001/scm/output-lib.scm
File scm/output-lib.scm (right):

https://codereview.appspot.com/207620043/diff/20001/scm/output-lib.scm#newcode1195
scm/output-lib.scm:1195: (and (not (eq? s grob))
I am recognizing Script grobs in the orthodox way--i.e., through
interfaces.  This would be considerably less cluttered if I used
(grob::name s 'Script)
instead.

https://codereview.appspot.com/207620043/

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


Re: toward-stem-shift-in-column should only consider 'script-interface (issue 207620043 by david.nales...@gmail.com)

2015-03-09 Thread david . nalesnik


https://codereview.appspot.com/207620043/diff/20001/scm/output-lib.scm
File scm/output-lib.scm (right):

https://codereview.appspot.com/207620043/diff/20001/scm/output-lib.scm#newcode1195
scm/output-lib.scm:1195: (and (not (eq? s grob))
On 2015/03/09 17:09:23, david.nalesnik wrote:

I am recognizing Script grobs in the orthodox way--i.e., through

interfaces.

This would be considerably less cluttered if I used
(grob::name s 'Script)
instead.


That would be

(eq? (grob::name s) 'Script)

https://codereview.appspot.com/207620043/

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


Re: toward-stem-shift-in-column should only consider 'script-interface (issue 207620043 by david.nales...@gmail.com)

2015-03-12 Thread david . nalesnik

Thanks for the review!


https://codereview.appspot.com/207620043/diff/20001/scm/output-lib.scm
File scm/output-lib.scm (right):

https://codereview.appspot.com/207620043/diff/20001/scm/output-lib.scm#newcode1190
scm/output-lib.scm:1190: (shift (if (and (ly:grob? script-column)
On 2015/03/11 23:49:44, thomasmorley651 wrote:

minor nit:
Is it possible to stick to the 80 characters line-width?


Done.

https://codereview.appspot.com/207620043/diff/20001/scm/output-lib.scm#newcode1196
scm/output-lib.scm:1196: (grob::has-interface s 'script-interface)
On 2015/03/12 00:01:35, thomasmorley651 wrote:

On 2015/03/11 23:49:44, thomasmorley651 wrote:
 Is there any need to go for AccidentalSuggestion and DynamicText?
 Deleting these conditions seems to make no difference:

 {
   \time 3/4
   \voiceOne
   c'!2.-.
   c'2.-. \
 }

 Looks ok, even with unpatched 2.19.16



Ok, I'm wrong with Accidentalsuggestion, it makes a difference!
Though, I found no example for DynamicText, returning bad output with

2.19.16



Done.

You are right about DynamicText.  Though it has script-interface, it
will not be caught in the 'scripts array of ScriptColumn.  Check
removed.

https://codereview.appspot.com/207620043/

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


Re: Add means to display objects accessible from a grob (issue 217260043 by david.nales...@gmail.com)

2015-03-24 Thread david . nalesnik


https://codereview.appspot.com/217260043/diff/1/scm/output-lib.scm
File scm/output-lib.scm (right):

https://codereview.appspot.com/217260043/diff/1/scm/output-lib.scm#newcode165
scm/output-lib.scm:165: (use-modules (ice-9 pretty-print))
On 2015/03/24 21:58:28, thomasmorley651 wrote:

I always regretted that (ice-9 pretty-print) is not included per

default.

Is there any reason not to do so?


It isn't loaded in scm/lily.scm where a number of basic modules are
loaded.  However, it is loaded in one of the first files in the load
path: scm/lily-library.scm.  This file is loaded even before this file,
so I wonder if I should consider my inclusion redundant.  In fact,
(ice-9 pretty-print) is included elsewhere, for example in
scm/music-functions.scm--and it appears that there are redundant
inclusions of other modules elsewhere.  I wonder--is this bad form?
Will it increase memory consumption?

Yet, why does the module need to be added in a ly file for pretty-print
to be defined?

https://codereview.appspot.com/217260043/

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


Re: Add means to display objects accessible from a grob (issue 217260043 by david.nales...@gmail.com)

2015-03-24 Thread david . nalesnik


https://codereview.appspot.com/217260043/diff/1/scm/output-lib.scm
File scm/output-lib.scm (right):

https://codereview.appspot.com/217260043/diff/1/scm/output-lib.scm#newcode165
scm/output-lib.scm:165: (use-modules (ice-9 pretty-print))
On 2015/03/25 00:15:45, david.nalesnik wrote:

On 2015/03/24 21:58:28, thomasmorley651 wrote:
 I always regretted that (ice-9 pretty-print) is not included per

default.

 Is there any reason not to do so?



It isn't loaded in scm/lily.scm where a number of basic modules are

loaded.

However, it is loaded in one of the first files in the load path:
scm/lily-library.scm.  This file is loaded even before this file, so I

wonder if

I should consider my inclusion redundant.  In fact, (ice-9

pretty-print) is

included elsewhere, for example in scm/music-functions.scm--and it

appears that

there are redundant inclusions of other modules elsewhere.  I

wonder--is this

bad form?  Will it increase memory consumption?



Yet, why does the module need to be added in a ly file for

pretty-print to be

defined?


Well, it's not much code of course.  Would it even be reloaded?  Anyway,
I wonder if redundant use-modules invocations should be removed, or at
least reduced to comments.

https://codereview.appspot.com/217260043/

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


Add means to display objects accessible from a grob (issue 217260043 by david.nales...@gmail.com)

2015-03-24 Thread david . nalesnik

Reviewers: ,

Message:
Please review.  Thanks!

Description:
Add means to display objects accessible from a grob

A convenient means of displaying the grobs and grob-arrays pointed to by
various internal properties of a given grob would be very helpful for
debugging and development purposes.  For example, it would facilitate
the
creation of advanced tweaks, which frequently require lateral access
to other grobs.

The output of the function 'grob::display-objects' shows all of the
grobs
accessible to a given grob through ly:grob-object, along with the
relevant
interfaces and properties.  It includes properties which are empty: not
all
properties within an interface may be set for or used by a grob
supporting
that interface.

Please review this at https://codereview.appspot.com/217260043/

Affected files (+38, -0 lines):
  M scm/output-lib.scm


Index: scm/output-lib.scm
diff --git a/scm/output-lib.scm b/scm/output-lib.scm
index  
2b2a65c719f12ec575c6587c206180e8bf89fb8b..a73e2c0324977e6046d45c8cfb736bd59ec4c644  
100644

--- a/scm/output-lib.scm
+++ b/scm/output-lib.scm
@@ -130,6 +130,44 @@

 line-thickness))

+(define (grob::objects-from-interface grob iface)
+  For grob @var{grob} return the name and contents of all properties
+ within interface @var{iface} having type @code{ly:grob?} or
+ @code{ly:grob-array?}.
+  (let* ((iface-entry (hashq-ref (ly:all-grob-interfaces) iface))
+ (props (if iface-entry (last iface-entry) '()))
+ (pointer-props
+  (filter
+   (lambda (prop)
+ (let ((type (object-property prop 'backend-type?)))
+   (or (eq? type ly:grob?)
+   (eq? type ly:grob-array?
+   props)))
+(if (null? pointer-props)
+'()
+(list iface
+  (map
+   (lambda (prop) (list prop (ly:grob-object grob prop)))
+   pointer-props)
+
+(define-public (grob::all-objects grob)
+  Return a list of the names and contents of all properties having type
+ @code{ly:grob?} or @code{ly:grob-array?} for all interfaces supported by
+ grob @var{grob}.
+  (let loop ((ifaces (ly:grob-interfaces grob)) (result '()))
+(if (null? ifaces)
+(cons grob (list result))
+(let ((entry (grob::objects-from-interface grob (car ifaces
+  (if (pair? entry)
+  (loop (cdr ifaces) (append result (list entry)))
+  (loop (cdr ifaces) result))
+
+(use-modules (ice-9 pretty-print))
+(define-public (grob::display-objects grob)
+  Display all objects stored in properties of grob @var{grob}.
+  (pretty-print (grob::all-objects grob))
+  (newline))
+
 
 ;; beam slope




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


Re: Add means to display objects accessible from a grob (issue 217260043 by david.nales...@gmail.com)

2015-03-25 Thread david . nalesnik


https://codereview.appspot.com/217260043/diff/1/scm/output-lib.scm
File scm/output-lib.scm (right):

https://codereview.appspot.com/217260043/diff/1/scm/output-lib.scm#newcode165
scm/output-lib.scm:165: (use-modules (ice-9 pretty-print))
On 2015/03/24 21:58:28, thomasmorley651 wrote:

I always regretted that (ice-9 pretty-print) is not included per

default.

Is there any reason not to do so?


Looks like all that needs to be done is to add
(use-modules (ice-9 pretty-print))
to ly/init.ly

Then, pretty-print is available to ly files, including within music
functions.

Shall I submit a patch?

https://codereview.appspot.com/217260043/

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


Re: Add means to display objects accessible from a grob (issue 217260043 by david.nales...@gmail.com)

2015-03-25 Thread david . nalesnik

On 2015/03/25 05:35:28, ul_openlilylib.org wrote:



Well, it's not much code of course.  Would it even be reloaded?
Anyway,
I wonder if redundant use-modules invocations should be removed, or
at
least reduced to comments.



Scheme modules are loaded only once so thee is no overhead involved.




https://codereview.appspot.com/217260043/

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



OK, so I may as well leave it as-is, especially as it's not part of the
Guile core.  (See
http://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/SRFI_002d0.html#SRFI_002d0
.)

https://codereview.appspot.com/217260043/

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


Re: Issue 3615: more consistency with key sig grobs (issue 219460043 by paulwmor...@gmail.com)

2015-03-30 Thread david . nalesnik

On 2015/03/30 16:36:20, david.nalesnik wrote:

On 2015/03/29 20:33:33, pwm wrote:
 Please review, thanks.



Could you provide an example where this would be useful?



Thanks,
David


OK, drat.  Ignore that!! See Issue 3615, of course :)

https://codereview.appspot.com/219460043/

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


Re: Issue 3615: more consistency with key sig grobs (issue 219460043 by paulwmor...@gmail.com)

2015-03-30 Thread david . nalesnik

On 2015/03/29 20:33:33, pwm wrote:

Please review, thanks.


Could you provide an example where this would be useful?

Thanks,
David

https://codereview.appspot.com/219460043/

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


Remove unused event-type general-music (issue 222090043 by david.nales...@gmail.com)

2015-04-01 Thread david . nalesnik

Reviewers: ,

Message:
Please review.  Thanks!

Description:
Remove unused event-type general-music

Please review this at https://codereview.appspot.com/222090043/

Affected files (+105, -109 lines):
  M input/regression/scheme-text-spanner.ly
  M scm/define-music-types.scm



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


Re: Fix issue 4040: Dots ignoring shifted ledger lines (issue 220090043 by paulwmor...@gmail.com)

2015-03-26 Thread david . nalesnik

Aside from whitespace issue, LGTM.  I assume this could be fixed when
pushing, and there's no need to put this back on review?


https://codereview.appspot.com/220090043/diff/1/input/regression/staff-ledger-positions-dotted-notes.ly
File input/regression/staff-ledger-positions-dotted-notes.ly (right):

https://codereview.appspot.com/220090043/diff/1/input/regression/staff-ledger-positions-dotted-notes.ly#newcode2
input/regression/staff-ledger-positions-dotted-notes.ly:2:
minor nit: trailing spaces on following three lines

https://codereview.appspot.com/220090043/

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


Re: Language selection code

2015-03-27 Thread David Nalesnik
Hi Simon,


On Thu, Mar 26, 2015 at 6:43 PM, Simon Albrecht simon.albre...@mail.de
wrote:

[...]


 So the roadmap would include
 – discussing design and coding (?)


I haven't gone through this thoroughly, but I did notice that an invalid
statement like this
\language general.deutsch.foo
isn't gracefully dealt with.

I haven't studied this enough to diagnose the problem, but I did notice the
following:

% extended from music-functions-init.ly:603
language =
#(define-void-function
  (parser location arg)
  ;; Usage:
  ;; \language input.LANG or
  ;; \language output.LANG or
  ;; \language LANG—which is equivalent to
  ;; \language general.LANG or to the first two combined
  (symbol-list-or-symbol?)
  (_i Define languages for input (i.e. set note names for @var{language}),
output (i.e. display tagline and table of contents in @var{language}), or
both.)


  (let* ((correct-input (if ( (length arg) 2) #f #t))
 (channel (if (= 2 (length arg)) ;if a channel is given,
  (car arg)  ;use it
  'general)) ;else apply to both
 (language (cond ((= 1 (length arg)) (list-ref arg 0))
 ((= 2 (length arg)) (list-ref arg 1


If correct-input is #f, language will be undefined.  You could add
(else #f)


 (input-lang (if language ;if input isn’t wrong
 language
 'nederlands)) ;default


The boolean value of #unspecified is ... #t, so input-lang will select
language if the input is not correct.  language will be #unspecified.

 (output-lang (if language
  language
  'english)))

As above.

Possibly you shouldn't bind the variables after correct-input unless the
input is correct.

HTH,
David

P.S.  Thanks for working on this!
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Language selection code

2015-03-27 Thread David Nalesnik
On Fri, Mar 27, 2015 at 8:38 AM, David Nalesnik david.nales...@gmail.com
wrote:


 I haven't gone through this thoroughly, but I did notice that an invalid
 statement like this
 \language general.deutsch.foo
 isn't gracefully dealt with.

 [...]



 If correct-input is #f, language will be undefined.  You could add

(else #f)


Yes, doing this:

(language (cond ((= 1 (length arg)) (list-ref arg 0))
 ((= 2 (length arg)) (list-ref arg 1))
 (else #f)))


(and changing the German note-name in the example)
cleans up the output.

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


make pretty-print available in ly files (issue 222810043 by david.nales...@gmail.com)

2015-03-27 Thread david . nalesnik

Reviewers: ,

Message:
Please review.  Thanks!

Description:
make pretty-print available in ly files

Please review this at https://codereview.appspot.com/222810043/

Affected files (+1, -0 lines):
  M ly/init.ly


Index: ly/init.ly
diff --git a/ly/init.ly b/ly/init.ly
index  
8265d171cf2ab3f9ae632ddf722ab4a3a402f99e..d014a401ab506a11213cd1d127108f78e5ef9693  
100644

--- a/ly/init.ly
+++ b/ly/init.ly
@@ -35,6 +35,7 @@

 #(use-modules (scm clip-region))
 #(use-modules (srfi srfi-1))
+#(use-modules (ice-9 pretty-print))

 $(if (ly:get-option 'include-settings)
   (ly:parser-include-string parser



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


Re: Remove unused event-type general-music (issue 222090043 by david.nales...@gmail.com)

2015-04-01 Thread david . nalesnik


https://codereview.appspot.com/222090043/diff/1/scm/define-music-types.scm
File scm/define-music-types.scm (right):

https://codereview.appspot.com/222090043/diff/1/scm/define-music-types.scm#newcode343
scm/define-music-types.scm:343: (types . ())
Should Music be given a type? According to pattern, music with
lowercase m?

https://codereview.appspot.com/222090043/

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


Re: [PATCH] support for flagged crotchets in mensural notation

2015-02-28 Thread David Nalesnik
On Sat, Feb 28, 2015 at 10:14 AM, Lukas Pietsch lukas.piet...@freenet.de
wrote:

 Werner LEMBERG wl at gnu.org writes:

   hollow=1 would then be the default for modern notation.
  
   minHollowDurationLog would be more descriptive.
 
  What an ugly name, but I agree that it is more descriptive than
  `hollow' and thus probably better.

 Shouldn't grob properties be spelled with hypens, rather than camelCase?


Yes, unless the implication was that this should be a context property
instead of a grob property.

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


Re: [PATCH] Add scheme engraver for StaffTab notation

2015-03-01 Thread David Nalesnik
Hi Ricardo,

On Sun, Mar 1, 2015 at 8:31 AM, Ricardo Wurmus rek...@elephly.net wrote:

 I already implemented the following changes:

 - added context definitions for \midi in addition to \layout
 - restricted maximum line length to 80 chars

 Attached is a new patch.


This patch fails to apply in ly/string-tunings-init.ly  I imagine that is
because current master incorporates a more recent change to this file:
commit 67ed495d4f5e6a02224f87faf4c00979996675e0.

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


Re: [PATCH] Add scheme engraver for StaffTab notation

2015-03-01 Thread David Nalesnik
On Sun, Mar 1, 2015 at 10:32 AM, David Nalesnik david.nales...@gmail.com
wrote:

 Hi Ricardo,

 On Sun, Mar 1, 2015 at 8:31 AM, Ricardo Wurmus rek...@elephly.net wrote:

 I already implemented the following changes:

 - added context definitions for \midi in addition to \layout
 - restricted maximum line length to 80 chars

 Attached is a new patch.


 This patch fails to apply in ly/string-tunings-init.ly  I imagine that is
 because current master incorporates a more recent change to this file:
 commit 67ed495d4f5e6a02224f87faf4c00979996675e0.


Yes--the patch applies to an earlier checkout.
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Function to display the rhythmic location of a grob (issue 197690044 by david.nales...@gmail.com)

2015-02-22 Thread david . nalesnik


https://codereview.appspot.com/197690044/diff/20001/scm/output-lib.scm
File scm/output-lib.scm (right):

https://codereview.appspot.com/197690044/diff/20001/scm/output-lib.scm#newcode29
scm/output-lib.scm:29: (define-public (grob::rhythmic-location grob)
On 2015/02/22 07:59:40, dak wrote:

The function is misnamed since rhythmic-location is an established

term in the

code base with a number of operators that will not work on the result

from this

function.  A rhythmic location is just the cadr of what you return

here.


So you should split this function into two, one for returning the

global

timestep (there probably is an established term for that, but if not,

grob::when

would be an obvious candidate), and one for returning the rhythmic

location.


There is likely some duplication of code then, but since it will be

the

exception rather than rule that one needs both values, the resulting

code will

likely be more rather than less efficient for the typical use case.


Done.

https://codereview.appspot.com/197690044/diff/20001/scm/output-lib.scm#newcode30
scm/output-lib.scm:30: Return the rhythmic position of grob @var{g} as
a list.  The
On 2015/02/22 03:01:04, pwm wrote:

Do you mean @var{grob} ?  That would be more in line with other

functions in

this file.


Done.

https://codereview.appspot.com/197690044/diff/20001/scm/output-lib.scm#newcode42
scm/output-lib.scm:42: (list when rl))
On 2015/02/22 03:01:04, pwm wrote:

Instead of this let block I'd probably just do:



(list (ly:grob-property col 'when)
   (ly:grob-property col 'rhythmic-location))



But either way is fine with me.


Done--in a way!

https://codereview.appspot.com/197690044/

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


Re: [PATCH] Add scheme engraver for StaffTab notation

2015-02-23 Thread David Nalesnik
Hi Ricardo,

On Mon, Feb 23, 2015 at 4:42 PM, Ricardo Wurmus rek...@elephly.net wrote:


 Here's the patch:


When I apply your patch and try to compile the example file I get:

warning: cannot find or create new `StaffTab'
warning: cannot find or create new `StaffTab'
warning: cannot find or create new `StickVoice'
warning: cannot find or create new `StickVoice'
MIDI output to `nyan.midi'...

I notice that the version statement in nyan.ly is 2.14.2.  Are you working
off 2.19.16?

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


Re: [PATCH] Add scheme engraver for StaffTab notation

2015-02-23 Thread David Nalesnik
On Mon, Feb 23, 2015 at 5:15 PM, David Nalesnik david.nales...@gmail.com
wrote:

 Hi Ricardo,

 On Mon, Feb 23, 2015 at 4:42 PM, Ricardo Wurmus rek...@elephly.net
 wrote:


 Here's the patch:


 When I apply your patch and try to compile the example file I get:

 warning: cannot find or create new `StaffTab'
 warning: cannot find or create new `StaffTab'
 warning: cannot find or create new `StickVoice'
 warning: cannot find or create new `StickVoice'
 MIDI output to `nyan.midi'...

 I notice that the version statement in nyan.ly is 2.14.2.  Are you
 working off 2.19.16?


Oh, sorry.  My dumb mistake!  Need to alter the path on the \include...

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


Re: [PATCH] Add scheme engraver for StaffTab notation

2015-02-23 Thread David Nalesnik
On Mon, Feb 23, 2015 at 5:24 PM, David Nalesnik david.nales...@gmail.com
wrote:



 On Mon, Feb 23, 2015 at 5:15 PM, David Nalesnik david.nales...@gmail.com
 wrote:

 Hi Ricardo,

 On Mon, Feb 23, 2015 at 4:42 PM, Ricardo Wurmus rek...@elephly.net
 wrote:


 Here's the patch:


 When I apply your patch and try to compile the example file I get:

 warning: cannot find or create new `StaffTab'
 warning: cannot find or create new `StaffTab'
 warning: cannot find or create new `StickVoice'
 warning: cannot find or create new `StickVoice'
 MIDI output to `nyan.midi'...

 I notice that the version statement in nyan.ly is 2.14.2.  Are you
 working off 2.19.16?


 Oh, sorry.  My dumb mistake!  Need to alter the path on the \include...


Hmmm... moved the contents of stafftab.ly directly into the example file,
same result.  Not sure what is happening here.

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


Re: make pretty-print available in ly files (issue 222810043 by david.nales...@gmail.com)

2015-04-07 Thread david . nalesnik


https://codereview.appspot.com/222810043/diff/1/ly/init.ly
File ly/init.ly (right):

https://codereview.appspot.com/222810043/diff/1/ly/init.ly#newcode38
ly/init.ly:38: #(use-modules (ice-9 pretty-print))
On 2015/04/07 16:13:44, dak wrote:

Uh, where is the point?  Why wouldn't a user include a module he wants

himself?

Other modules are included because LilyPond itself uses them

generously.  But

this would not appear to be the case here.


It's a convenience for people who work with Scheme in .ly files, the
same motivation behind use of pretty-printing with \displayMusic.  I
know that Harm frequently uses pretty-print, and I was prompted to make
this change at his suggestion.  (See comments here:
https://codereview.appspot.com/217260043 )

If you think this should be reverted we could do that of course;
however, I think its inclusion is helpful.

https://codereview.appspot.com/222810043/

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


Re: PATCHES: Countdown for April 6th 2015

2015-04-04 Thread David Nalesnik
On Sat, Apr 4, 2015 at 3:42 AM, Trevor Daniels t.dani...@treda.co.uk
wrote:


 James Lowe wrote Saturday, April 04, 2015 9:27 AM
 
  On 04/04/15 08:49, David Kastrup wrote:
 
  If we freeze patches only on countdown state and nothing else I hope not
  to curb the holiday rush of activity too much.
 
  Would people be ok with that?  If not, I'll try to compile a shortlist
  of patches I'd like to see delayed this evening in order to give them
  proper attention and let the rest pass normally.
 
  What I can do, so as to not put of people submitting patches in the
  meantime, is to continue test/review/countdown and just not go through
  to the push stage until the 8th (Wednesday) review. So things sit on
  'countdown' until then.

 Thanks James, I agree with doing that.


I agree too.

I do have a question on Rietveld that is bugging me concerning my issue --
https://code.google.com/p/lilypond/issues/detail?id=4335

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


Re: Remove unused event-type general-music (issue 222090043 by david.nales...@gmail.com)

2015-04-04 Thread david . nalesnik


https://codereview.appspot.com/222090043/diff/1/scm/define-music-types.scm
File scm/define-music-types.scm (right):

https://codereview.appspot.com/222090043/diff/1/scm/define-music-types.scm#newcode343
scm/define-music-types.scm:343: (types . ())
On 2015/04/04 15:25:27, Trevor Daniels wrote:

On 2015/04/01 15:16:07, david.nalesnik wrote:
 Should Music be given a type? According to pattern, music with

lowercase

m?



Well, if general-music is unused presumably a type of music would

also be

unused.  I'm rather outside my knowledge zone here, but is an entry of

Music

required at all?  If general-music is being removed I'd have thought

the Music

entry should be removed too.



Trevor


Music is used.  For example, looking at what sort of object must be
produced by \shape:

#(display (car (ly:music-function-signature shape)))

==

(#primitive-procedure ly:music? . #Prob: Music C++: Music((void .
#t))((name . Music) (types general-music)) 
)

This patch would leave an empty entry for types.  That doesn't matter
here -- The predicate ly:music? works just fine.  I just wonder if there
would ever be cause to recognize Music by its types, as for example, a
engraver would recognize NoteEvent by note-event.

https://codereview.appspot.com/222090043/

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


Re: Remove unused event-type general-music (issue 222090043 by david.nales...@gmail.com)

2015-04-04 Thread david . nalesnik


https://codereview.appspot.com/222090043/diff/1/scm/define-music-types.scm
File scm/define-music-types.scm (right):

https://codereview.appspot.com/222090043/diff/1/scm/define-music-types.scm#newcode343
scm/define-music-types.scm:343: (types . ())
On 2015/04/04 16:17:20, david.nalesnik wrote:


 On 2015/04/01 15:16:07, david.nalesnik wrote:



I just wonder if there would ever be
cause to recognize Music by its types, as for example, a engraver

would

recognize NoteEvent by note-event.


Well, an engraver would be looking at stream events, so my for example
doesn't apply.

https://codereview.appspot.com/222090043/

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


Re: make pretty-print available in ly files (issue 222810043 by david.nales...@gmail.com)

2015-04-08 Thread david . nalesnik

On 2015/04/08 11:14:54, dak wrote:

On 2015/04/08 10:43:09, thomasmorley651 wrote:
 On 2015/04/08 10:21:55, dak wrote:

  value-lily-string is probably the most useful reasonably generic

printing

  facility right now.  But nobody really knows it.

 At least, I wasn't aware of it, because of (in a ly-file)

 #(display value-lily-string)
 - Unbound variable: value-lily-string



Like with much of the Scheme-level printing you'll need
#(use-modules (scm display-lily))



It's not been around for long in its current form (and name) anyway.

It became

an exported function under that name with
commit 8d8e8aec6388fbb08ed2219884b82ecf53a9dbcd
Author: David Kastrup mailto:d...@gnu.org
Date:   Wed Jan 1 20:54:15 2014 +0100



 Provide value-lily-string function



because I really needed that facility in order to make nice error

messages.

It's in 2.19.1 and 2.18.0 I think, as part of issue 3770.


But doesn't this just return a string?  Also, it requires a parser
argument.



At some point of time, somebody needs to make some sort of plan along

the lines

of what kind of functions and programming facilities are needed for

working

with LilyPond in a coherent and predictable and comfortable manner

and put it

into code.  It is quite too often that one runs into the I cannot

believe

LilyPond does not have something obvious for such an obvious task like

$x

situation.


And of course documenting it in a convenient way, like Resources for
... Can't think of a nice summary word and easier tampering or
hacking wouldn't send the right message.

It's worth noting that the ~y option IS available within ly files,
though not in scm files, where format has been redefined as
simple-format.  So something like this produces nice results:

#(format #t ~y (procedure-source grob::rhythmic-location))

==

(lambda (grob)
  Return a pair consisting of the measure number and moment within
   the measure of grob @var{grob}.
  (let* ((item (if (grob::has-interface
 grob
 'spanner-interface)
 (ly:spanner-bound grob LEFT)
 grob))
 (col (ly:item-get-column item)))
(if (ly:grob? col)
  (ly:grob-property col (quote rhythmic-location))
  '(

__

So I guess the way to proceed now is to make a patch reverting this
commit, and then just push it to staging as soon as it passes tests,
rather than going through a review cycle?


https://codereview.appspot.com/222810043/

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


Re: make pretty-print available in ly files (issue 222810043 by david.nales...@gmail.com)

2015-04-08 Thread david . nalesnik

On 2015/04/08 16:06:47, david.nalesnik wrote:

On 2015/04/08 11:14:54, dak wrote:



 commit 8d8e8aec6388fbb08ed2219884b82ecf53a9dbcd
 Author: David Kastrup mailto:d...@gnu.org
 Date:   Wed Jan 1 20:54:15 2014 +0100

 Provide value-lily-string function

 because I really needed that facility in order to make nice error

messages.

 It's in 2.19.1 and 2.18.0 I think, as part of issue 3770.



But doesn't this just return a string?  Also, it requires a parser

argument.

I mean that when we pass through scheme-expr-lily-string, the Scheme
expression is not formatted with nice identation, line breaking, as with
pretty-print.

https://codereview.appspot.com/222810043/

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


Re: Remove unused event-type general-music (issue 222090043 by david.nales...@gmail.com)

2015-04-04 Thread david . nalesnik

On 2015/04/04 20:20:33, dak wrote:

On 2015/04/04 16:17:20, david.nalesnik wrote:



 Music is used.  For example, looking at what sort of object must be

produced

by
 \shape:

 #(display (car (ly:music-function-signature shape)))

 ==

 (#primitive-procedure ly:music? . #Prob: Music C++: Music((void .
#t))((name
 . Music) (types general-music)) 
 )

 This patch would leave an empty entry for types.  That doesn't

matter here --

 The predicate ly:music? works just fine.  I just wonder if there

would ever be

 cause to recognize Music by its types, as for example, a engraver

would

 recognize NoteEvent by note-event.



The usual way to recognize music types is by music-is-of-type? and the

name is

not generally used except for subclassing.  Music would likely not be
interesting though.


Of course general-music could be used to group music objects, too.
However, from what I can gather, it is a remnant of times past when
engravers accepted Music objects by way of general music (instead of
stream events) and figured out what specific kind they were there.


https://codereview.appspot.com/222090043/

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


Re: interactive sheet music experiment

2015-07-01 Thread David Nalesnik
Hi Urs,

On Wed, Jul 1, 2015 at 2:24 AM, Urs Liska u...@openlilylib.org wrote:


 What I see after choosing a song is that seemingly arbitrary letters in
 a  Courier-like font are placed above the noteheads. If these letters
 should be the note names then it seems to be not working properly. If
 these should *not* be note names I'm dearly missing an
 explanation/introduction on the website.


Looks like a typing practice program--type the letters and you hear the
note.

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


Re: Shared Rests

2015-08-22 Thread David Nalesnik
Dan,


 Am 22. August 2015 05:19:43 MESZ, schrieb Dan Eble d...@faithful.be:
 Can anyone offer general architectural advice for adding the option for
 parts on the same staff to share rests when possible?  I mean without
 using \partcombine.  I’d like to focus on multi-measure rests first.
 Roughly, I guess there should be something that watches for notes and
 rests in all voices, and if there are only multi-measure rests in the
 current measure, eliminate all but one MultiMeasureRest grob (or
 eliminate them all and create a new one?).  Would that be a new kind of
 engraver placed at staff level that works independent of the
 multi-measure rest engraver, which remains at voice level?  Are there
 engravers that work similarly that I should study?
 


There is an engraver in circulation which merges rests: see
http://www.mail-archive.com/lilypond-user%40gnu.org/msg69645.html.

(There's also a snippet here: http://lsr.di.unimi.it/LSR/Item?id=336.  It
doesn't handle MultiMeasureRest, though.)

HTH,
David
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Issue 4516: Make \offset handle unpure/pure containers (issue 250590043 by d...@gnu.org)

2015-07-22 Thread david . nalesnik

Yet compare the output of

{
  \offset Y-offset #-5 DynamicLineSpanner
  \repeat unfold 200 {
c'2\f\ c'2\!
  }
}

with

{
  \override DynamicLineSpanner.Y-offset = #-15
  \repeat unfold 200 {
c'2\f\ c'2\!
  }
}

Shouldn't the offset to the result of calling the pure function result
in better vertical spacing?

https://codereview.appspot.com/250590043/

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


Issue 4516: Make \offset handle unpure/pure containers (issue 250590043 by d...@gnu.org)

2015-07-22 Thread david . nalesnik

Thanks for doing this.  The restructuring is a big improvement.


https://codereview.appspot.com/250590043/diff/1/scm/music-functions.scm
File scm/music-functions.scm (right):

https://codereview.appspot.com/250590043/diff/1/scm/music-functions.scm#newcode2331
scm/music-functions.scm:2331: (offset-multiple-types vals (car
offsets)
Yup--missing parenthesis.

https://codereview.appspot.com/250590043/diff/1/scm/music-functions.scm#newcode2337
scm/music-functions.scm:2337: (ly:unpure-pure-container
(ly:make-unpure-pure-container

https://codereview.appspot.com/250590043/diff/1/scm/music-functions.scm#newcode2342
scm/music-functions.scm:2342: vals
(extra paren)

https://codereview.appspot.com/250590043/

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


Re: Issue 4516: Make \offset handle unpure/pure containers (issue 250590043 by d...@gnu.org)

2015-07-22 Thread david . nalesnik

Here's two snippets that show \offset working with unpure-pure
containers, one with the override form, the second using the tweak form.

{
 c'4\f\
 c'4\!
 \offset Y-offset -2 DynamicLineSpanner
 c'4\f\
 c'4\!
 c'2
 \offset length 2 Stem
 c'2
}

{
 c'4\f\
 c'4\!
 c'4\f-\offset DynamicLineSpanner.Y-offset -3 \
 c'4\!
 c'2
 \offset Stem.length 2
 c'2
}

https://codereview.appspot.com/250590043/

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


Re: Issue 4516: Make \offset handle unpure/pure containers (issue 250590043 by d...@gnu.org)

2015-07-23 Thread david . nalesnik

LGTM.

Thanks again!

https://codereview.appspot.com/250590043/

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


Re: multiple TextSpanners per voice

2015-10-20 Thread David Nalesnik
On Tue, Oct 20, 2015 at 11:50 AM, David Kastrup  wrote:

> Trevor Bača  writes:
>
> > Hi,
> >
> > I'd like to add that I'm *incredibly* excited by this work. The ability
> to
> > have multiple text spanners in a voice -- and to tweak each independently
> > -- is something I've wanted in LilyPond for many years. (I responded to a
> > different thread about this a touch too early only moments ago;
> apologies,
> > catching up on list mail.) This is really incredibly exciting to me, and
> I
> > think it will be to very many other composers once the ability is made
> > clear in a public release (and in the docs).
> >
> > For what it's worth, I'd very much like to request the promotion of this
> > work to a fully acknowledged new feature (respecting, of course, the
> needs
> > of feature sequencing in the release process).
> >
> > I'm not quite sure what the best (user) interface for this is. I suppose
> > \startTextSpan[One|Two|Three|Four] will work. Though it seems like
> > \startTextSpan #1 or \startTextSpan #"fancy-spanner-name" would be a more
> > complete generalization of the feature.
>
> \=1\startTextSpan ... \=1\endTextSpan already work as a user interface.
> It's just that there is nothing that would actually _heed_ the settings
> of "spanner-id" achieved in that manner yet.
>
>
This works wonderfully well as an interface with the engraver I posted.
Thank you so much!  Now it is possible to remove all the extra definitions
of \startTextSpanEightyFour and the like.

See attached.

DN

%
\version "2.19"

%% Incorporating some code from the rewrite in Scheme of
%% Text_spanner_engraver in input/regression/scheme-text-spanner.ly

#(define (add-bound-item spanner item)
   (if (null? (ly:spanner-bound spanner LEFT))
   (ly:spanner-set-bound! spanner LEFT item)
   (ly:spanner-set-bound! spanner RIGHT item)))

#(define (axis-offset-symbol axis)
   (if (eq? axis X) 'X-offset 'Y-offset))

#(define (set-axis! grob axis)
   (if (not (number? (ly:grob-property grob 'side-axis)))
   (begin
(set! (ly:grob-property grob 'side-axis) axis)
(ly:grob-chain-callback
 grob
 (if (eq? axis X)
 ly:side-position-interface::x-aligned-side
 side-position-interface::y-aligned-side)
 (axis-offset-symbol axis)

#(define (assign-spanner-index spanner orig-ls)
   "Determine the position of a new spanner in an ordered sequence
of spanners.  The goal is for the sequence to begin with zero and
contain no gaps.  Return the index representing the spanner's position."
   (if (null? orig-ls)
   0
   (let loop ((ls orig-ls) (insert? #t) (result 0))
 (cond
  ((null? ls) result)
  ;; position at head of list
  ((and insert? (> (caar orig-ls) 0))
   (loop ls #f 0))
  ;; no gaps, put at end of list
  ((and insert? (null? (cdr ls)))
   (loop (cdr ls) #f (1+ (caar ls
  ;; fill lowest position of gap
  ((and insert?
(> (caadr ls) (1+ (caar ls
   (loop (cdr ls) #f (1+ (caar ls
  (else (loop (cdr ls) insert? result))

alternateTextSpannerEngraver =
#(lambda (context)
   (let (;; a list of pairs comprising a spanner index
  ;;  (not spanner-id) and a spanner which has been begun
  (spanners '())
  (finished '()) ; list of spanners in completion stage
  (start-events '()) ; list of START events
  (stop-events '())) ; list of STOP events
 (make-engraver
  ;; \startTextSpan, \stopTextSpan, and the like create events
  ;; which we collect here.
  (listeners
   ((text-span-event engraver event)
(if (= START (ly:event-property event 'span-direction))
(set! start-events (cons event start-events))
(set! stop-events (cons event stop-events)
  ;; Populate 'note-columns property of spanners.  Bounds are
  ;; set to note columns, and each spanner keeps a record of
  ;; the note columns it traverses.
  (acknowledgers
   ((note-column-interface engraver grob source-engraver)
(for-each (lambda (s)
(ly:pointer-group-interface::add-grob
 (cdr s) 'note-columns grob)
(add-bound-item (cdr s) grob))
  spanners)
;; finished only contains spanners, no indices
(for-each (lambda (f)
(ly:pointer-group-interface::add-grob
 f 'note-columns grob)
(add-bound-item f grob))
  finished)))

  ((process-music trans)
   ;; Move begun spanners from 'spanners' to 'finished'.  We do this
   ;; on the basis of 'spanner-id.  If we find a match--either
   ;; the strings are the same, or both are unset--a transfer
   ;; can be made.  Return a warning if we find no match: spanner
   ;; hasn't been properly begun.
   (for-each
   

Rietveld diff annoyance

2015-08-26 Thread David Nalesnik
Hi all,

I just posted a patch on Rietveld,  It adds a new file, which I partially
constructed by cutting and pasting from
lily/pointer-group-interface-scheme.cc into Leafpad (just the initial
comment). Unfortunately, Rietveld now shows the diff with that file, though
the patch doesn't touch it.

https://codereview.appspot.com/260450043/

Is there a way to avoid this?

Thanks,
David
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Rietveld diff annoyance

2015-08-26 Thread David Nalesnik
On Wed, Aug 26, 2015 at 12:18 PM, David Nalesnik david.nales...@gmail.com
wrote:

 Hi all,

 I just posted a patch on Rietveld,  It adds a new file, which I partially
 constructed by cutting and pasting from
 lily/pointer-group-interface-scheme.cc into Leafpad (just the initial
 comment). Unfortunately, Rietveld now shows the diff with that file, though
 the patch doesn't touch it.


The patch I uploaded with git-cl is attached.

DN
From aeba1aa3fb93c1ac5dbe25ffdbc45ca28e7cce74 Mon Sep 17 00:00:00 2001
From: David Nalesnik david.nales...@gmail.com
Date: Wed, 26 Aug 2015 09:46:07 -0500
Subject: [PATCH] Scheme function to draw lines based on grob layout

A number of C++ stencil callbacks use Line_interface::line to draw
lines based on line-interface properties defining a particular grob.
This allows control of aspects such as line style (based on the setting
of Grob.style) and fine-tuning of dashed lines through dash-fraction
and dash-period.

This patch gives access to Line_interface::line in Scheme through the
callback ly:line-interface::line.  (The simpler name ly:line was ruled
out in an effort to distinguish it from other functions such as
ly:bracket and ly:circle which do not take a grob argument.)  Users
will be able to create custom stencils with more functionality
(including rewriting certain C++ callbacks--such as Hairpin::print--to
allow for easy modifications without loss of capability.)
---
 lily/line-interface-scheme.cc | 44 +++
 1 file changed, 44 insertions(+)
 create mode 100644 lily/line-interface-scheme.cc

diff --git a/lily/line-interface-scheme.cc b/lily/line-interface-scheme.cc
new file mode 100644
index 000..dee6a15
--- /dev/null
+++ b/lily/line-interface-scheme.cc
@@ -0,0 +1,44 @@
+/*
+  This file is part of LilyPond, the GNU music typesetter.
+
+  Copyright (C) 2010--2015 Han-Wen Nienhuys han...@xs4all.nl
+
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see http://www.gnu.org/licenses/.
+*/
+
+#include line-interface.hh
+
+#include stencil.hh
+#include grob.hh
+
+LY_DEFINE (ly_line_interface__line, ly:line-interface::line,
+   5, 0, 0, (SCM grob, SCM startx, SCM starty, SCM endx, SCM endy),
+   Make a line using layout information from grob @var{grob}.)
+{
+  LY_ASSERT_SMOB (Grob, grob, 1);
+
+  Grob *me = unsmobGrob (grob);
+
+  LY_ASSERT_TYPE (scm_is_number, startx, 2);
+  LY_ASSERT_TYPE (scm_is_number, starty, 3);
+  LY_ASSERT_TYPE (scm_is_number, endx, 4);
+  LY_ASSERT_TYPE (scm_is_number, endy, 5);
+
+  Offset from = Offset (scm_to_double (startx), scm_to_double (starty));
+  Offset to = Offset (scm_to_double (endx), scm_to_double (endy));
+
+  Stencil stil = Line_interface::line (me, from, to);
+
+  return stil.smobbed_copy ();
+}
-- 
1.9.1

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


Re: Fix regtest "dynamics-broken-hairpin.ly" (issue 258470044 by simon.albre...@mail.de)

2015-08-31 Thread david . nalesnik


https://codereview.appspot.com/258470044/diff/1/input/regression/dynamics-broken-hairpin.ly
File input/regression/dynamics-broken-hairpin.ly (right):

https://codereview.appspot.com/258470044/diff/1/input/regression/dynamics-broken-hairpin.ly#newcode1
input/regression/dynamics-broken-hairpin.ly:1: \version "2.19.25"
\version "2.19.27"

https://codereview.appspot.com/258470044/

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


Re: Doc: Usage - Updated 'Running LilyPond' intros (issue 261240043 by pkx1...@gmail.com)

2015-09-13 Thread david . nalesnik


https://codereview.appspot.com/261240043/diff/1/Documentation/usage/running.itely
File Documentation/usage/running.itely (right):

https://codereview.appspot.com/261240043/diff/1/Documentation/usage/running.itely#newcode36
Documentation/usage/running.itely:36: information on where to download
or these applications.
extra "or"

Otherwise, LGTM.

https://codereview.appspot.com/261240043/

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


Re: multiple TextSpanners per voice

2015-10-03 Thread David Nalesnik
On Fri, Oct 2, 2015 at 5:59 PM, David Nalesnik <david.nales...@gmail.com>
wrote:

>
>
> On Fri, Oct 2, 2015 at 5:49 PM, David Nalesnik <david.nales...@gmail.com>
> wrote:
>
>>
>> Horizontal_bracket_engraver achieves correct ordering of nested brackets
>> through the side-position-interface array 'side-position-elements.
>> Brackets closer to the staff are added to the support of brackets further
>> away.  However, this only works because 'outside-staff-priority is set to
>> #f by default.  As soon as you set it to a numerical value, chaos ensues:
>> the initial ordering is flipped AND the brackets flip orientation across
>> line breaks.  (See attached images.)
>>
>>
> So much for my analytical skills.  The blue bracket simply changes
> orientation across the line break with outside-staff-priority set to a
> number.
>
>
The problems with HorizontalBracket and TextSpanner may be "fixed" by
setting 'padding to a value ever-so-slightly higher than the value of
'outside-staff-padding. Both grobs are assigned an outside-staff-padding of
0.46 in lily/axis-group-interface.cc.  So, if we set padding to
0.46001, the ordering comes out OK when staff-priority is set.  (My
conjecture is that by setting 'padding higher than 'outside-staff-padding
we are signalling a collision, which is resolved by
avoid_outside_staff_collisions in axis-group-interface.cc.)

So here is a revised version of the TextSpanner code.  The intention is to
allow as many spanners per voice as you'd like.  This works with
'outside-staff-priority (set to 350 for TextSpanner, by default), but for
the time being, you need to add the 'padding override to handle line
breaks.  (Alternately, you could specify different staff-priorities for
individual spanners, as was done earlier in this thread.)

I hope this is useful.  Suggestions for improvement welcome!

DN
\version "2.19.12"

\header {
  texidoc = "Use @code{define-event-class}, scheme engraver methods,
and grob creation methods to create a fully functional text spanner
in scheme."
}

#(define-event-class 'scheme-text-span-event 'span-event)

#(define (add-grob-definition grob-name grob-entry)
   (let* ((meta-entry   (assoc-get 'meta grob-entry))
  (class(assoc-get 'class meta-entry))
  (ifaces-entry (assoc-get 'interfaces meta-entry)))
 (set-object-property! grob-name 'translation-type? ly:grob-properties?)
 (set-object-property! grob-name 'is-grob? #t)
 (set! ifaces-entry (append (case class
  ((Item) '(item-interface))
  ((Spanner) '(spanner-interface))
  ((Paper_column) '((item-interface
 paper-column-interface)))
  ((System) '((system-interface
   spanner-interface)))
  (else '(unknown-interface)))
  ifaces-entry))
 (set! ifaces-entry (uniq-list (sort ifaces-entry symbol___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: multiple TextSpanners per voice

2015-10-03 Thread David Nalesnik
On Sat, Oct 3, 2015 at 12:02 PM, David Nalesnik <david.nales...@gmail.com>
wrote:

>
>
> So here is a revised version of the TextSpanner code.
>
>
Oh *drat*  Attached the wrong file.  Apologies...

DN
\version "2.19"

%% Based on the rewrite of Text_spanner_engraver in
%% input/regression/scheme-text-spanner.ly

#(define (add-bound-item spanner item)
   (if (null? (ly:spanner-bound spanner LEFT))
   (ly:spanner-set-bound! spanner LEFT item)
   (ly:spanner-set-bound! spanner RIGHT item)))

#(define (axis-offset-symbol axis)
   (if (eq? axis X) 'X-offset 'Y-offset))

#(define (set-axis! grob axis)
   (if (not (number? (ly:grob-property grob 'side-axis)))
   (begin
(set! (ly:grob-property grob 'side-axis) axis)
(ly:grob-chain-callback
 grob
 (if (eq? axis X)
 ly:side-position-interface::x-aligned-side
 side-position-interface::y-aligned-side)
 (axis-offset-symbol axis)

schemeTextSpannerEngraver =
#(lambda (context)
   (let ((span '()) ; list of started spanners
  (finished '()) ; list of spanners in completion stage
  (event-start '()) ; list of START events
  (event-stop '())) ; list of STOP events
 (make-engraver
  ;; \startTextSpan, \stopTextSpan, and the like create events
  ;; which we collect here.
  (listeners
   ((text-span-event engraver event)
(if (= START (ly:event-property event 'span-direction))
(set! event-start (cons event event-start))
(set! event-stop (cons event event-stop)
  ;; Populate 'note-columns property of spanners.  Bounds are
  ;; set to note columns, and each spanner keeps a record of
  ;; the note columns it traverses.
  (acknowledgers
   ((note-column-interface engraver grob source-engraver)
(for-each (lambda (s)
(ly:pointer-group-interface::add-grob
 s 'note-columns grob)
(add-bound-item s grob))
  span)
(for-each (lambda (f)
(ly:pointer-group-interface::add-grob
 f 'note-columns grob)
(add-bound-item f grob))
  finished)))

  ((process-music trans)
   ;; Move begun spanners from 'span' to 'finished'.  We do this
   ;; on the basis of 'spanner-id.  If we find a match--either
   ;; the strings are the same, or both are unset--a transfer
   ;; can be made.  Return a warning if we find no match: spanner
   ;; hasn't been properly begun.
   (for-each
(lambda (es)
  (let ((es-id (ly:event-property es 'spanner-id)))
(let loop ((sp span))
  (let ((sp-id (ly:event-property
(event-cause (car sp)) 'spanner-id)))
(cond
 ((null? sp) (ly:warning "No spanner to end!!"))
 ((and
   (string? sp-id)
   (string? es-id)
   (string=? sp-id es-id))
  (set! finished (cons (car sp) finished))
  (set! span (remove (lambda (s) (eq? s (car sp))) span)))
 ((and
   (null? sp-id)
   (null? es-id))
  (set! finished (cons (car sp) finished))
  (set! span (remove (lambda (s) (eq? s (car sp))) span)))
 (else (loop (cdr sp
event-stop)

   ;; The end of our spanners can be acknowledged by other engravers.
   (for-each
(lambda (f)
  (ly:engraver-announce-end-grob trans f (event-cause f)))
finished)

   ;; Make spanners called for by START events.  To each new spanner,
   ;; add any existing spanners to the 'side-support-elements array.
   ;; This ensures correct ordering over line breaks when 'outside-
   ;; staff-priority is set to #f.  Ordinarily, for TextSpanner this
   ;; is 350.
   (for-each
(lambda (es)
  (let ((new (ly:engraver-make-grob trans 'TextSpanner es)))
(for-each
 (lambda (sp)
   (ly:pointer-group-interface::add-grob new
 'side-support-elements sp))
 span)
(set! span (cons new span))
(set-axis! (car span) Y)))
event-start)

   ;; Events have served their purpose for this timestep.  Clear
   ;; the way for new events in later timesteps.
   (set! event-start '())
   (set! event-stop '()))

  ((stop-translation-timestep trans)
   ;; Set bounds of spanners to PaperColumns if they haven't been set.
   ;; This allows spanners to be drawn between spacers.  Other uses?
   ;; Doesn't appear to affect whether spanners can de drawn between
   ;; rests.
   (for-each
(lambda (s)
  (if (null? (ly:spanner-bound s LEFT))
  (ly:spanner-set-bound! s LEFT
(ly:conte

Re: multiple TextSpanners per voice

2015-10-02 Thread David Nalesnik
On Fri, Oct 2, 2015 at 10:00 AM, David Nalesnik <david.nales...@gmail.com>
wrote:

> Hi all,
>
> I'm experimenting with a way to support multiple text spanners in a single
> voice, using the 'spanner-id property which already enables multiple slurs
> and phrasing slurs.
>
> The attached code works--until the spanners cross a line break.  Then the
> order of the spanners is reversed.  I've experimented with different start
> and end points of the spanners, reversing lists within the engraver--no
> change.
>
> The second example shows that tweaks can mess up this reversed ordering
> even further.
>
> Does anyone know what is happening here?  I really have no idea :(
>

Here's an image.

(I'm running 2.19.27 with Windows 10, 64-bit, if that's has anything to do
with it.)

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


multiple TextSpanners per voice

2015-10-02 Thread David Nalesnik
Hi all,

I'm experimenting with a way to support multiple text spanners in a single
voice, using the 'spanner-id property which already enables multiple slurs
and phrasing slurs.

The attached code works--until the spanners cross a line break.  Then the
order of the spanners is reversed.  I've experimented with different start
and end points of the spanners, reversing lists within the engraver--no
change.

The second example shows that tweaks can mess up this reversed ordering
even further.

Does anyone know what is happening here?  I really have no idea :(

Thanks,

David
\version "2.19"

%% Based on the rewrite of Text_spanner_engraver in
%% input/regression/scheme-text-spanner.ly

#(define (add-bound-item spanner item)
   (if (null? (ly:spanner-bound spanner LEFT))
   (ly:spanner-set-bound! spanner LEFT item)
   (ly:spanner-set-bound! spanner RIGHT item)))

#(define (axis-offset-symbol axis)
   (if (eq? axis X) 'X-offset 'Y-offset))

#(define (set-axis! grob axis)
   (if (not (number? (ly:grob-property grob 'side-axis)))
   (begin
(set! (ly:grob-property grob 'side-axis) axis)
(ly:grob-chain-callback
 grob
 (if (eq? axis X)
 ly:side-position-interface::x-aligned-side
 side-position-interface::y-aligned-side)
 (axis-offset-symbol axis)

schemeTextSpannerEngraver =
#(lambda (context)
   (let ((span '()) ; list of started spanner
  (finished '()) ; list of spanners in completion stage
  (event-start '()) ; list of START events
  (event-stop '())) ; list of STOP events
 (make-engraver
  ;; \startTextSpan, \stopTextSpan, and the like create events
  ;; which we collect here.
  (listeners
   ((text-span-event engraver event)
(if (= START (ly:event-property event 'span-direction))
(set! event-start (cons event event-start))
(set! event-stop (cons event event-stop)
  ;; Populate 'note-columns property of spanners.  Bounds are
  ;; set to note columns, and each spanner keeps a record of
  ;; the note columns it traverses.
  (acknowledgers
   ((note-column-interface engraver grob source-engraver)
(for-each (lambda (s)
(ly:pointer-group-interface::add-grob
 s 'note-columns grob)
(add-bound-item s grob))
  span)
(for-each (lambda (f)
(ly:pointer-group-interface::add-grob
 f 'note-columns grob)
(add-bound-item f grob))
  finished)))

  ((process-music trans)
   ;; Move begun spanners from 'span' to 'finished'.  We do this
   ;; on the basis of 'spanner-id.  If we find a match--either
   ;; the strings are the same, or both are unset--a transfer
   ;; can be made.  Return a warning if we find no match: spanner
   ;; hasn't been properly begun.
   (for-each
(lambda (es)
  (let ((es-id (ly:event-property es 'spanner-id)))
(let loop ((sp span))
  (let ((sp-id (ly:event-property
(event-cause (car sp)) 'spanner-id)))
(cond
 ((null? sp) (ly:warning "No spanner to end!!"))
 ((and
   (string? sp-id)
   (string? es-id)
   (string=? sp-id es-id))
  (set! finished (cons (car sp) finished))
  (set! span (remove (lambda (s) (eq? s (car sp))) span)))
 ((and
   (null? sp-id)
   (null? es-id))
  (set! finished (cons (car sp) finished))
  (set! span (remove (lambda (s) (eq? s (car sp))) span)))
 (else (loop (cdr sp
event-stop)

   ;; The end of our spanners can be acknowledged by other engravers.
   (for-each
(lambda (f)
  (ly:engraver-announce-end-grob trans f (event-cause f)))
finished)

   ;; Make spanners called for by START events.
   (for-each
(lambda (es)
  (set! span
(cons
 (ly:engraver-make-grob trans 'TextSpanner es)
 span))
  (set-axis! (car span) Y))
event-start)

   ;; Events have served their purpose for this timestep.  Clear
   ;; the way for new events in later timesteps.
   (set! event-start '())
   (set! event-stop '()))

  ((stop-translation-timestep trans)
   ;; Set bounds of spanners to PaperColumns if they haven't been set.
   ;; This allows spanners to be drawn between spacers.  Other uses?
   ;; Doesn't appear to affect whether spanners can de drawn between
   ;; rests.
   (for-each
(lambda (s)
  (if (null? (ly:spanner-bound s LEFT))
  (ly:spanner-set-bound! s LEFT
(ly:context-property context 'currentMusicalColumn
span)

   (for-each

Re: multiple TextSpanners per voice

2015-10-02 Thread David Nalesnik
David,

On Fri, Oct 2, 2015 at 11:26 AM, David Kastrup <d...@gnu.org> wrote:

> David Nalesnik <david.nales...@gmail.com> writes:
>
> > Hi all,
> >
> > I'm experimenting with a way to support multiple text spanners in a
> single
> > voice, using the 'spanner-id property which already enables multiple
> slurs
> > and phrasing slurs.
> >
> > The attached code works--until the spanners cross a line break.  Then the
> > order of the spanners is reversed.  I've experimented with different
> start
> > and end points of the spanners, reversing lists within the engraver--no
> > change.
> >
> > The second example shows that tweaks can mess up this reversed ordering
> > even further.
> >
> > Does anyone know what is happening here?  I really have no idea :(
>
> Sounds like room-saving stacking of elements with equal
> outside-staff-priority (?).  Perhaps distribute ascending priorities?


Exactly!  Thanks so much.

The following is one of the examples from the file, with
outside-staff-priority tweaks.  The order is preserved.

\relative c' {
  \override TextSpanner.outside-staff-padding = 2
  \override TextSpanner.thickness = 4
  \override TextSpanner.style = ##f
  a4
  -\tweak color #red
  \startTextSpan
  b c
  -\tweak color #darkred
  -\offset outside-staff-priority 1
  \startTextSpanOne
  d

  a4
  -\tweak color #magenta
  -\offset outside-staff-priority 2
  \startTextSpanTwo
  b c
  -\tweak style #'zigzag
  -\offset outside-staff-priority 3
  \startTextSpanThree
  d
  \break

  a4 b c d\stopTextSpanThree

  a4 b\stopTextSpanTwo
  c d\stopTextSpanOne
  a4 b c d\stopTextSpan
}

%

Naturally, it would be nice to do this without needing the extra tweaks.
 outside-staff-priority could be altered behind-the-scenes, but that seems
somehow...dishonest.  Though, of course, two spanner with priorities 350
and 351 would be unlikely to interfere with placement of other objects.

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


Re: multiple TextSpanners per voice

2015-10-02 Thread David Nalesnik
Michael,

On Fri, Oct 2, 2015 at 11:33 AM, Michael Gerdau  wrote:

> > > The second example shows that tweaks can mess up this reversed ordering
> > > even further.
> > >
> > > Does anyone know what is happening here?  I really have no idea :(
> >
> > Here's an image.
> >
> > (I'm running 2.19.27 with Windows 10, 64-bit, if that's has anything to
> do
> > with it.)
>
> Just for the record:
> I'm running 2.19.28 on Linux 4.2.2-1-ARCH x86_64 and see the very same
> image you posted.
>
>
Thanks for trying that out!

Looks like David Kastrup has identified the cross-platform cause.

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


Re: multiple TextSpanners per voice

2015-10-02 Thread David Nalesnik
On Fri, Oct 2, 2015 at 12:09 PM, David Nalesnik <david.nales...@gmail.com>
wrote:

> David,
>
> On Fri, Oct 2, 2015 at 11:26 AM, David Kastrup <d...@gnu.org> wrote:
>
>> David Nalesnik <david.nales...@gmail.com> writes:
>>
>> > Hi all,
>> >
>> > I'm experimenting with a way to support multiple text spanners in a
>> single
>> > voice, using the 'spanner-id property which already enables multiple
>> slurs
>> > and phrasing slurs.
>> >
>> > The attached code works--until the spanners cross a line break.  Then
>> the
>> > order of the spanners is reversed.  I've experimented with different
>> start
>> > and end points of the spanners, reversing lists within the engraver--no
>> > change.
>> >
>> > The second example shows that tweaks can mess up this reversed ordering
>> > even further.
>> >
>> > Does anyone know what is happening here?  I really have no idea :(
>>
>> Sounds like room-saving stacking of elements with equal
>> outside-staff-priority (?).  Perhaps distribute ascending priorities?
>
>
>
Horizontal_bracket_engraver achieves correct ordering of nested brackets
through the side-position-interface array 'side-position-elements.
Brackets closer to the staff are added to the support of brackets further
away.  However, this only works because 'outside-staff-priority is set to
#f by default.  As soon as you set it to a numerical value, chaos ensues:
the initial ordering is flipped AND the brackets flip orientation across
line breaks.  (See attached images.)

Try this code:

\version "2.19.27"

\new Staff {
  \override HorizontalBracket.direction = #UP
  \override HorizontalBracket.thickness = 4
  c
  -\tweak color #red
  \startGroup
  -\tweak color #green
  \startGroup d
  -\tweak color #blue
  \startGroup
  e f
  \break
  c d e f
  c\stopGroup d\stopGroup e d\stopGroup
  \bar "||"
  \override HorizontalBracket.outside-staff-priority = 100
  c
  -\tweak color #red
  \startGroup
  -\tweak color #green
  \startGroup d
  -\tweak color #blue
  \startGroup
  e f
  \break
  c d e f
}

\layout {
  \context {
\Voice
\consists #"Horizontal_bracket_engraver"
  }
}

%

This must be a bug...

BTW, correct ordering is achieved with the TextSpanner code if the same
approach is taken: any spanner in force is added to the
'side-support-elements of a new spanner.  Again, this works only if
'outside-staff-priority is set to #f.

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


Re: multiple TextSpanners per voice

2015-10-02 Thread David Nalesnik
On Fri, Oct 2, 2015 at 5:49 PM, David Nalesnik <david.nales...@gmail.com>
wrote:

>
> Horizontal_bracket_engraver achieves correct ordering of nested brackets
> through the side-position-interface array 'side-position-elements.
> Brackets closer to the staff are added to the support of brackets further
> away.  However, this only works because 'outside-staff-priority is set to
> #f by default.  As soon as you set it to a numerical value, chaos ensues:
> the initial ordering is flipped AND the brackets flip orientation across
> line breaks.  (See attached images.)
>
>
So much for my analytical skills.  The blue bracket simply changes
orientation across the line break with outside-staff-priority set to a
number.

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


Re: multiple TextSpanners per voice

2015-10-05 Thread David Nalesnik
Ok, this should do it.

The intention is to provide extra functionality to text spanners.  By using
this code, you have all the functionality of normal text spanners, but you
are able to have multiple spanners per voice.

You simply need to swap the regular engraver for this one in a layout
block, and use the commands I've defined: \startTextSpanOne, and the like.
 (You can change the names, of course, and add more.  This is crying out
for a better interface, I know,)

Regarding difficulties mentioned earlier in the thread:

The spanners should nest properly and maintain their orientation across
line breaks.  Here this is achieved by assigning minute variations of
outside-staff-priority behind the scenes.  (Turns out you can use
outside-staff-priorities like 350.0001 ) You can still override and
tweak outside-staff-priority of TextSpanner if you want.

I believe that this manipulation may be avoided by inventing a new
alignment grob "to bind them all." but I'm not sure.  Since the attached
seems sufficient, this could wait until time came (if ever) to add this to
the code base.

DN

%%%
\version "2.19"

%% Incorporating some code from the rewrite in Scheme of
%% Text_spanner_engraver in input/regression/scheme-text-spanner.ly

#(define (add-bound-item spanner item)
   (if (null? (ly:spanner-bound spanner LEFT))
   (ly:spanner-set-bound! spanner LEFT item)
   (ly:spanner-set-bound! spanner RIGHT item)))

#(define (axis-offset-symbol axis)
   (if (eq? axis X) 'X-offset 'Y-offset))

#(define (set-axis! grob axis)
   (if (not (number? (ly:grob-property grob 'side-axis)))
   (begin
(set! (ly:grob-property grob 'side-axis) axis)
(ly:grob-chain-callback
 grob
 (if (eq? axis X)
 ly:side-position-interface::x-aligned-side
 side-position-interface::y-aligned-side)
 (axis-offset-symbol axis)

#(define (assign-spanner-index spanner orig-ls)
   "Determine the position of a new spanner in an ordered sequence
of spanners.  The goal is for the sequence to begin with zero and
contain no gaps.  Return the index representing the spanner's position."
   (if (null? orig-ls)
   0
   (let loop ((ls orig-ls) (insert? #t) (result 0))
 (cond
  ((null? ls) result)
  ;; position at head of list
  ((and insert? (> (caar orig-ls) 0))
   (loop ls #f 0))
  ;; no gaps, put at end of list
  ((and insert? (null? (cdr ls)))
   (loop (cdr ls) #f (1+ (caar ls
  ;; fill lowest position of gap
  ((and insert?
(> (caadr ls) (1+ (caar ls
   (loop (cdr ls) #f (1+ (caar ls
  (else (loop (cdr ls) insert? result))

alternateTextSpannerEngraver =
#(lambda (context)
   (let (;; a list of pairs comprising a spanner index
  ;;  (not spanner-id) and a spanner which has been begun
  (spanners '())
  (finished '()) ; list of spanners in completion stage
  (start-events '()) ; list of START events
  (stop-events '())) ; list of STOP events
 (make-engraver
  ;; \startTextSpan, \stopTextSpan, and the like create events
  ;; which we collect here.
  (listeners
   ((text-span-event engraver event)
(if (= START (ly:event-property event 'span-direction))
(set! start-events (cons event start-events))
(set! stop-events (cons event stop-events)
  ;; Populate 'note-columns property of spanners.  Bounds are
  ;; set to note columns, and each spanner keeps a record of
  ;; the note columns it traverses.
  (acknowledgers
   ((note-column-interface engraver grob source-engraver)
(for-each (lambda (s)
(ly:pointer-group-interface::add-grob
 (cdr s) 'note-columns grob)
(add-bound-item (cdr s) grob))
  spanners)
;; finished only contains spanners, no indices
(for-each (lambda (f)
(ly:pointer-group-interface::add-grob
 f 'note-columns grob)
(add-bound-item f grob))
  finished)))

  ((process-music trans)
   ;; Move begun spanners from 'span' to 'finished'.  We do this
   ;; on the basis of 'spanner-id.  If we find a match--either
   ;; the strings are the same, or both are unset--a transfer
   ;; can be made.  Return a warning if we find no match: spanner
   ;; hasn't been properly begun.
   (for-each
(lambda (es)
  (let ((es-id (ly:event-property es 'spanner-id)))
(let loop ((sp spanners))
  (if (null? sp)
  (ly:warning "No spanner to end!!")
  (let ((sp-id (ly:event-property
(event-cause (cdar sp)) 'spanner-id)))
(cond
 ((or
   (and
(string? sp-id)
 

Re: ly:moment<=? ??

2015-12-20 Thread David Nalesnik
On Sun, Dec 20, 2015 at 7:08 PM, Simon Albrecht 
wrote:

> Hello,
>
> while getting to terms with the accidentalStyle code I found that it would
> be useful (currently only for dodecaphonic-no-repeat-rule,
> scm/music-functions.scm:line 1682f.) to have a ly:moment<=? Scheme
> predicate function. It’s easy to do in Scheme:
>
> (define (ly:moment<=? a b)
>  (or (equal? a b)
>   (ly:moment
> but I see that the ly:moment lily/moment-scheme.cc.
> Do you think it’s worth it to generally provide such a procedure? Or just
> define it locally in music-functions.scm?
>
>
It has already been provided: see moment<=? in scm/lily-library,scm.

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


Re: make pretty-print available in ly files (issue 222810043 by david.nales...@gmail.com)

2016-01-23 Thread david . nalesnik

On 2016/01/23 22:11:03, david.nalesnik wrote:

The patch was pushed after much of the discussion above.  Shall I make

another

patch removing the functionality>


Ugh--I mean pushed *before* much of the discussion.

https://codereview.appspot.com/222810043/

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


Re: make pretty-print available in ly files (issue 222810043 by david.nales...@gmail.com)

2016-01-23 Thread david . nalesnik

The patch was pushed after much of the discussion above.  Shall I make
another patch removing the functionality>

https://codereview.appspot.com/222810043/

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


Re: scriptDefinitions context property

2016-05-24 Thread David Nalesnik
On Tue, May 24, 2016 at 7:12 PM, Carl Sorensen  wrote:
> According to the Internals Reference, scriptDefinitions is an internal
> context property, meaning that the user should not change it.
>
> Why is this so?  As far as I can see, scriptDefinitions is not defined
> during engraving, but during initialization.  So it ought to be
> user-settable, it seems to me.

I don't know for sure, but possibly it has to do with the lack of a
good user interface for altering it.  See
https://sourceforge.net/p/testlilyissues/issues/4276/ and the
suggestion of a scriptExceptions property (a patch that I never put
forward...)

David

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


trouble uploading a patch

2017-02-03 Thread David Nalesnik
Hi,

I'm trying to upload a patch for review, and I'm running into difficulties.

Using git-cl, I get this output:

Issue created. URL: http://codereview.appspot.com/320140043
Uploading base file for Documentation/changes.tely
Uploading base file for scm/define-grob-properties.scm
Uploading base file for scm/define-grobs.scm
Uploading base file for
Documentation/snippets/new/analysis-brackets-with-labels.ly
Traceback (most recent call last):
  File "/home/david/git-cl/git-cl", line 628, in 
sys.exit(main(sys.argv))
  File "/home/david/git-cl/git-cl", line 622, in main
return func(argv[2:])
  File "/home/david/git-cl/git-cl", line 335, in CmdUpload
issue, patchset = upload.RealMain(['upload'] + upload_args + args)
  File "/home/david/git-cl/upload.py", line 2693, in RealMain
vcs.UploadBaseFiles(issue, rpc_server, patches, patchset, options, files)
  File "/home/david/git-cl/upload.py", line 1220, in UploadBaseFiles
print t.get(timeout=60)
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
raise self._value
urllib2.URLError: 

The patch is visible here: https://codereview.appspot.com/320140043/
but no issue has been created.

Any help would be appreciated!

Thanks,
David

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


Re: trouble uploading a patch

2017-02-03 Thread David Nalesnik
On Fri, Feb 3, 2017 at 7:27 PM, David Nalesnik <david.nales...@gmail.com> wrote:
> Hi,
>
> I'm trying to upload a patch for review, and I'm running into difficulties.
>
> Using git-cl, I get this output:
>
> Issue created. URL: http://codereview.appspot.com/320140043
> Uploading base file for Documentation/changes.tely
> Uploading base file for scm/define-grob-properties.scm
> Uploading base file for scm/define-grobs.scm
> Uploading base file for
> Documentation/snippets/new/analysis-brackets-with-labels.ly
> Traceback (most recent call last):
>   File "/home/david/git-cl/git-cl", line 628, in 
> sys.exit(main(sys.argv))
>   File "/home/david/git-cl/git-cl", line 622, in main
> return func(argv[2:])
>   File "/home/david/git-cl/git-cl", line 335, in CmdUpload
> issue, patchset = upload.RealMain(['upload'] + upload_args + args)
>   File "/home/david/git-cl/upload.py", line 2693, in RealMain
> vcs.UploadBaseFiles(issue, rpc_server, patches, patchset, options, files)
>   File "/home/david/git-cl/upload.py", line 1220, in UploadBaseFiles
> print t.get(timeout=60)
>   File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
> raise self._value
> urllib2.URLError: 
>
> The patch is visible here: https://codereview.appspot.com/320140043/
> but no issue has been created.

Except that two files show "Error: old chunk mismatch":
scm/define-grob-interfaces.scm and lily/horizontal-bracket.cc

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


Re: trouble uploading a patch

2017-02-04 Thread David Nalesnik
On Sat, Feb 4, 2017 at 6:28 PM, David Kastrup <d...@gnu.org> wrote:
> David Nalesnik <david.nales...@gmail.com> writes:
>
>> On Fri, Feb 3, 2017 at 7:35 PM, David Nalesnik <david.nales...@gmail.com> 
>> wrote:
>>> On Fri, Feb 3, 2017 at 7:27 PM, David Nalesnik
>>> <david.nales...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I'm trying to upload a patch for review, and I'm running into difficulties.
>>>>
>>>> Using git-cl, I get this output:
>>>>
>>>> Issue created. URL: http://codereview.appspot.com/320140043
>>>> Uploading base file for Documentation/changes.tely
>>>> Uploading base file for scm/define-grob-properties.scm
>>>> Uploading base file for scm/define-grobs.scm
>>>> Uploading base file for
>>>> Documentation/snippets/new/analysis-brackets-with-labels.ly
>>>> Traceback (most recent call last):
>>>>   File "/home/david/git-cl/git-cl", line 628, in 
>>>> sys.exit(main(sys.argv))
>>>>   File "/home/david/git-cl/git-cl", line 622, in main
>>>> return func(argv[2:])
>>>>   File "/home/david/git-cl/git-cl", line 335, in CmdUpload
>>>> issue, patchset = upload.RealMain(['upload'] + upload_args + args)
>>>>   File "/home/david/git-cl/upload.py", line 2693, in RealMain
>>>> vcs.UploadBaseFiles(issue, rpc_server, patches, patchset, options, 
>>>> files)
>>>>   File "/home/david/git-cl/upload.py", line 1220, in UploadBaseFiles
>>>> print t.get(timeout=60)
>>>>   File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
>>>> raise self._value
>>>> urllib2.URLError: 
>>>>
>>>> The patch is visible here: https://codereview.appspot.com/320140043/
>>>> but no issue has been created.
>>>
>>> Except that two files show "Error: old chunk mismatch":
>>> scm/define-grob-interfaces.scm and lily/horizontal-bracket.cc
>>
>> I've tried uploading this a number of times, always the same results.
>> The base files aren't uploaded for these two files.  (Current attempt:
>> https://codereview.appspot.com/316280043/)
>>
>> Is the patch simply too large, and I'm losing the connection before
>> all of the base files have been uploaded?
>>
>> If this is so, is there any way to get all of this uploaded and
>> associated with a single issue?
>
> What command line have you been using for the upload attempt?
>

git-cl upload origin/master

Has worked with all recent patches I've done.  They've all been
noticeably smaller, though.

DN

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


Re: trouble uploading a patch

2017-02-04 Thread David Nalesnik
On Sat, Feb 4, 2017 at 7:02 PM, David Nalesnik <david.nales...@gmail.com> wrote:
> On Sat, Feb 4, 2017 at 6:45 PM, David Kastrup <d...@gnu.org> wrote:
>> David Nalesnik <david.nales...@gmail.com> writes:
>>
>>> On Sat, Feb 4, 2017 at 6:28 PM, David Kastrup <d...@gnu.org> wrote:
>>>> David Nalesnik <david.nales...@gmail.com> writes:
>>>>
>>>>> On Fri, Feb 3, 2017 at 7:35 PM, David Nalesnik
>>>>> <david.nales...@gmail.com> wrote:
>>>>>> On Fri, Feb 3, 2017 at 7:27 PM, David Nalesnik
>>>>>> <david.nales...@gmail.com> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm trying to upload a patch for review, and I'm running into 
>>>>>>> difficulties.
>>>>>>>
>>>>>>> Using git-cl, I get this output:
>>>>>>>
>>>>>>> Issue created. URL: http://codereview.appspot.com/320140043
>>>>>>> Uploading base file for Documentation/changes.tely
>>>>>>> Uploading base file for scm/define-grob-properties.scm
>>>>>>> Uploading base file for scm/define-grobs.scm
>>>>>>> Uploading base file for
>>>>>>> Documentation/snippets/new/analysis-brackets-with-labels.ly
>>>>>>> Traceback (most recent call last):
>>>>>>>   File "/home/david/git-cl/git-cl", line 628, in 
>>>>>>> sys.exit(main(sys.argv))
>>>>>>>   File "/home/david/git-cl/git-cl", line 622, in main
>>>>>>> return func(argv[2:])
>>>>>>>   File "/home/david/git-cl/git-cl", line 335, in CmdUpload
>>>>>>> issue, patchset = upload.RealMain(['upload'] + upload_args + args)
>>>>>>>   File "/home/david/git-cl/upload.py", line 2693, in RealMain
>>>>>>> vcs.UploadBaseFiles(issue, rpc_server, patches, patchset, options, 
>>>>>>> files)
>>>>>>>   File "/home/david/git-cl/upload.py", line 1220, in UploadBaseFiles
>>>>>>> print t.get(timeout=60)
>>>>>>>   File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
>>>>>>> raise self._value
>>>>>>> urllib2.URLError: 
>>>>>>>
>>>>>>> The patch is visible here: https://codereview.appspot.com/320140043/
>>>>>>> but no issue has been created.
>>>>>>
>>>>>> Except that two files show "Error: old chunk mismatch":
>>>>>> scm/define-grob-interfaces.scm and lily/horizontal-bracket.cc
>>>>>
>>>>> I've tried uploading this a number of times, always the same results.
>>>>> The base files aren't uploaded for these two files.  (Current attempt:
>>>>> https://codereview.appspot.com/316280043/)
>>>>>
>>>>> Is the patch simply too large, and I'm losing the connection before
>>>>> all of the base files have been uploaded?
>>>>>
>>>>> If this is so, is there any way to get all of this uploaded and
>>>>> associated with a single issue?
>>>>
>>>> What command line have you been using for the upload attempt?
>>>>
>>>
>>> git-cl upload origin/master
>>>
>>> Has worked with all recent patches I've done.  They've all been
>>> noticeably smaller, though.
>>
>> Have you tried
>>
>> git rebase origin/master
>>
>> before calling git-cl?  I could imagine problems due to master not being
>> in your ancestry.
>
> Yes, I've run it a number of times.
>
> All I can think is that somewhere during the upload process I lose my
> authenticated connection with www.google.com.
>
> Hmmm.  I've rebased everything to a single commit, and that's what I'm
> uploading.  Maybe I should break it down into several commits?

Nope.  Broke it up into 4 commits.  Same result.

Always the same two files lead to "error: old chunk mismatch"--so the
base files aren't getting uploaded.

DN

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


Re: trouble uploading a patch

2017-02-04 Thread David Nalesnik
On Fri, Feb 3, 2017 at 7:35 PM, David Nalesnik <david.nales...@gmail.com> wrote:
> On Fri, Feb 3, 2017 at 7:27 PM, David Nalesnik <david.nales...@gmail.com> 
> wrote:
>> Hi,
>>
>> I'm trying to upload a patch for review, and I'm running into difficulties.
>>
>> Using git-cl, I get this output:
>>
>> Issue created. URL: http://codereview.appspot.com/320140043
>> Uploading base file for Documentation/changes.tely
>> Uploading base file for scm/define-grob-properties.scm
>> Uploading base file for scm/define-grobs.scm
>> Uploading base file for
>> Documentation/snippets/new/analysis-brackets-with-labels.ly
>> Traceback (most recent call last):
>>   File "/home/david/git-cl/git-cl", line 628, in 
>> sys.exit(main(sys.argv))
>>   File "/home/david/git-cl/git-cl", line 622, in main
>> return func(argv[2:])
>>   File "/home/david/git-cl/git-cl", line 335, in CmdUpload
>> issue, patchset = upload.RealMain(['upload'] + upload_args + args)
>>   File "/home/david/git-cl/upload.py", line 2693, in RealMain
>> vcs.UploadBaseFiles(issue, rpc_server, patches, patchset, options, files)
>>   File "/home/david/git-cl/upload.py", line 1220, in UploadBaseFiles
>> print t.get(timeout=60)
>>   File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
>> raise self._value
>> urllib2.URLError: 
>>
>> The patch is visible here: https://codereview.appspot.com/320140043/
>> but no issue has been created.
>
> Except that two files show "Error: old chunk mismatch":
> scm/define-grob-interfaces.scm and lily/horizontal-bracket.cc

I've tried uploading this a number of times, always the same results.
The base files aren't uploaded for these two files.  (Current attempt:
https://codereview.appspot.com/316280043/)

Is the patch simply too large, and I'm losing the connection before
all of the base files have been uploaded?

If this is so, is there any way to get all of this uploaded and
associated with a single issue?

Thanks,
David

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


Re: trouble uploading a patch

2017-02-08 Thread David Nalesnik
Hi Harm,

On Tue, Feb 7, 2017 at 7:46 PM, Thomas Morley <thomasmorle...@gmail.com> wrote:
> 2017-02-08 0:08 GMT+00:00 David Nalesnik <david.nales...@gmail.com>:
>> Harm,
>>
>> On Tue, Feb 7, 2017 at 5:57 PM, Thomas Morley <thomasmorle...@gmail.com> 
>> wrote:
>>> 2017-02-08 0:26 GMT+01:00 David Nalesnik <david.nales...@gmail.com>:
>>>
>>>>
>>>> I don't want to put anyone to the trouble of shepherding this for me,
>>>> since I can't predict how drawn out the review process will be.
>>>
>>>
>>> Nevertheless, how about sending me a git-formated patch?
>>> I could try to to upload. At least we could check whether it's a
>>> general git-cl problem or whether it's related to your setup.
>>> Though, I'll not able to do anything before tomorrow evening.
>>>
>>
>> OK, that would be much appreciated.  Patch attached.
>>
>> Thanks,
>> David
>
> Hi David,
>
> I found some time and had no problems uploading it.
>
> Although, I needed to do
> sudo /sbin/vboxconfig
> on my VirtualBox, which is $ uname -a
> Linux my-host 3.16.0-4-686-pae #1 SMP Debian 3.16.7-ckt11-1+deb8u3
> (2015-08-04) i686 GNU/Linux
>
> Here the terminal output for the upload
>
>
> [lilypond-git (dev/david-patch-test)]$ git cl upload origin/master
>  Documentation/changes.tely  | 18
> ++
>  Documentation/notation/editorial.itely  | 13 
> ++---
>  Documentation/snippets/new/analysis-brackets-with-labels.ly | 38
> ++
>  input/regression/horizontal-bracket-broken-texted.ly| 25
> +
>  input/regression/horizontal-bracket-texted.ly   | 33
> +
>  lily/horizontal-bracket-engraver.cc | 31
> +++
>  lily/horizontal-bracket.cc  |  6 +-
>  scm/define-grob-interfaces.scm  |  5 +
>  scm/define-grob-properties.scm  |  1 +
>  scm/define-grobs.scm| 18
> ++
>  scm/output-lib.scm  | 27
> +++
>  11 files changed, 203 insertions(+), 12 deletions(-)
> Upload server: codereview.appspot.com (change with -s/--server)
> Your browser has been opened to visit:
>
> https://codereview.appspot.com/get-access-token?port=8001
>
> If your browser is on a different machine then exit and re-run
> upload.py with the command-line parameter
>
>   --no_oauth2_webbrowser
>
> Issue created. URL: http://codereview.appspot.com/315570043
> Uploading base file for Documentation/changes.tely
> Uploading base file for scm/define-grob-properties.scm
> Uploading base file for scm/define-grobs.scm
> Uploading base file for
> Documentation/snippets/new/analysis-brackets-with-labels.ly
> Uploading base file for input/regression/horizontal-bracket-broken-texted.ly
> Uploading base file for lily/horizontal-bracket.cc
> Uploading base file for input/regression/horizontal-bracket-texted.ly
> Uploading base file for scm/define-grob-interfaces.scm
> Uploading base file for Documentation/notation/editorial.itely
> Uploading base file for lily/horizontal-bracket-engraver.cc
> Uploading base file for scm/output-lib.scm
> We were not able to associate this patch with a tracker issue.
> Please enter a valid tracker issue number
> (or enter nothing to create a new issue):
> Ticket created at: https://sourceforge.net/p/testlilyissues/issues/5064/
> Tracker issue done: 5064
>

Thanks for testing this!  It confirms what I was thinking--that this
is a problem on my end.

Though I do have an internet connection in my VirtualBox VM (on a
Win10 system), I seem not to be able to maintain a connection to
https://codereview.appspot.com for long enough for the uploads of all
the base files to happen.  Maybe something to do with a VirtualBox
configuration, maybe I have to figure out a way to request another
connection authomatically when one fails, I'm afraid I'm way out of my
depth here.

I notice that the patch has gotten swept up into the review process.
If you like, I will tell James to remove it, or maybe put it into
waiting so I can figure out how to fix my machine?  (It's already
gotten a review!) I don't want to put you or anybody to extra trouble.

Thanks again--
David

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


<    1   2   3   4   5   >