Re: page breaking (again)

2006-08-08 Thread Han-Wen Nienhuys

Joe Neeman wrote:

So I run
convert-ly -e ly/performer-init.ly input/test/* input/regression/*
and I get as far as input/regression/figured-bass.ly which fails as
reported on the bug list.

Based on the fact that the page-breaking patch was regression-free a
couple of weeks ago, can I commit anyway? Or should I wait until the
"make web" issues are fixed?


please commit.

--

Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen

LilyPond Software Design
 -- Code for Music Notation
http://www.lilypond-design.com



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


Re: page breaking (again)

2006-08-08 Thread Joe Neeman
On Mon, 2006-08-07 at 12:38 +0200, Han-Wen Nienhuys wrote:
> Joe Neeman wrote:
> >>> The new files are attached in a tar archive (I cc to Han-Wen just in
> >>> case the list strips it). There are 13 of them, so I thought it would be
> >>> easier.
> >> Looks good. Please apply, after fixing the following issues.

OK, the issues have been fixed. I'm unable to make web, however. I
applied the attached patch, but it aborts because input/test/*.ly and
ly/performer-init.ly still have references to "instrument" instead of
instrumentName.

So I run
convert-ly -e ly/performer-init.ly input/test/* input/regression/*
and I get as far as input/regression/figured-bass.ly which fails as
reported on the bug list.

Based on the fact that the page-breaking patch was regression-free a
couple of weeks ago, can I commit anyway? Or should I wait until the
"make web" issues are fixed?
? lily/out
? lily/out-www
? lily/include/out
? lily/include/out-www
Index: lily/music.cc
===
RCS file: /sources/lilypond/lilypond/lily/music.cc,v
retrieving revision 1.155
diff -u -r1.155 music.cc
--- lily/music.cc   2 Aug 2006 21:41:15 -   1.155
+++ lily/music.cc   8 Aug 2006 08:33:52 -
@@ -270,7 +270,8 @@
   SCM class_name = ly_symbol2scm (out);
 
   // catch mistakes.
-  assert (internal_is_music_type (class_name));
+  if (!internal_is_music_type (class_name))
+warning (_f ("this should be music: %s", out));
 
   Stream_event *e = new Stream_event (class_name, mutable_property_alist_);
   Moment length = get_length ();
Index: lily/spacing-loose-columns.cc
===
RCS file: /sources/lilypond/lilypond/lily/spacing-loose-columns.cc,v
retrieving revision 1.18
diff -u -r1.18 spacing-loose-columns.cc
--- lily/spacing-loose-columns.cc   4 Aug 2006 15:07:10 -   1.18
+++ lily/spacing-loose-columns.cc   8 Aug 2006 08:33:52 -
@@ -13,6 +13,7 @@
 #include "staff-spacing.hh"
 #include "note-spacing.hh"
 #include "spacing-spanner.hh"
+#include "warn.hh"
 
 #include "moment.hh"
 
@@ -86,7 +87,13 @@
{
  spacing = grace_spacing;
}
- 
+
+ if (!spacing)
+   {
+ programming_error ("clique-col has no spacing");
+ continue;
+   }
+
  Spacing_options options;
  options.init_from_grob (spacing);
 
___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: page breaking (again)

2006-08-07 Thread Han-Wen Nienhuys

Joe Neeman wrote:

The new files are attached in a tar archive (I cc to Han-Wen just in
case the list strips it). There are 13 of them, so I thought it would be
easier.

Looks good. Please apply, after fixing the following issues.


   for (vsize k = 0; k < lines_per_page[i] && systems != SCM_EOL; 
k++, systems = scm_cdr(systems))

 lines = scm_cons (scm_car (systems), lines);

this should be a generic Scheme function.


I would have thought so, but I can't find anything in R5RS. I can do it
with list-tail, length and reverse, but I don't know if it's any neater:

int len = scm_length (systems);
lines = scm_reverse (scm_c_list_tail (scm_reverse (systems),
  len - lines_per_page[i]));
systems = scm_c_list_tail (systems, lines_per_page[i]);


There's something in srfi-1 , but I'm not sure if you can call it 
conveniently from C++. If not, please add something to lily-guile.cc.


--

Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen

LilyPond Software Design
 -- Code for Music Notation
http://www.lilypond-design.com



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


Re: page breaking (again)

2006-08-06 Thread Joe Neeman
On Mon, 2006-08-07 at 00:31 +0200, Han-Wen Nienhuys wrote:
> Joe Neeman wrote:
> > Here is my latest patch to add a new page-breaker. This actually adds 2
> > page breakers now:
> 
> > Both page-breakers can be tuned with the (book-wide) paper block
> > variables "page-spacing-weight" (default 1.0) which specifies the
> > importance of good page spacing relative to line spacing and
> > "blank-last-page-force" (default 0) which specifies the penalty for
> > ending the piece on a left-hand page. ly:page-turn-breaking will also
> > consider leaving blank pages mid-score. The penalty for these pages can
> > be tuned with "blank-page-force" (default 10).
> > 
> > The new files are attached in a tar archive (I cc to Han-Wen just in
> > case the list strips it). There are 13 of them, so I thought it would be
> > easier.
> 
> Looks good. Please apply, after fixing the following issues.

>for (vsize k = 0; k < lines_per_page[i] && systems != SCM_EOL; 
> k++, systems = scm_cdr(systems))
>  lines = scm_cons (scm_car (systems), lines);
> 
> this should be a generic Scheme function.

I would have thought so, but I can't find anything in R5RS. I can do it
with list-tail, length and reverse, but I don't know if it's any neater:

int len = scm_length (systems);
lines = scm_reverse (scm_c_list_tail (scm_reverse (systems),
  len - lines_per_page[i]));
systems = scm_c_list_tail (systems, lines_per_page[i]);



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


Re: page breaking (again)

2006-08-06 Thread Han-Wen Nienhuys

Joe Neeman wrote:

Here is my latest patch to add a new page-breaker. This actually adds 2
page breakers now:



Both page-breakers can be tuned with the (book-wide) paper block
variables "page-spacing-weight" (default 1.0) which specifies the
importance of good page spacing relative to line spacing and
"blank-last-page-force" (default 0) which specifies the penalty for
ending the piece on a left-hand page. ly:page-turn-breaking will also
consider leaving blank pages mid-score. The penalty for these pages can
be tuned with "blank-page-force" (default 10).

The new files are attached in a tar archive (I cc to Han-Wen just in
case the list strips it). There are 13 of them, so I thought it would be
easier.


Looks good. Please apply, after fixing the following issues.

this looks as duplicate code.


if (d == DOWN &&
(!div.size () || this_best_result.systems_per_page_.size () !=
 original_page_count))
  {

  while (d == DOWN ||
   (div.size () && this_best_result.systems_per_page_.size () ==
original_page_count));




Line_details d;
d.force_ = 0;
d.extent_ = unsmob_stencil (p->get_property ("stencil")) ->extent 
(Y_AXIS);

etc.


You might want to have a Line_details::from_grob()

  for (vsize k = 0; k < lines_per_page[i] && systems != SCM_EOL; 
k++, systems = scm_cdr(systems))

lines = scm_cons (scm_car (systems), lines);

this should be a generic Scheme function.

  while (scm_is_pair (cs))
{
  SCM command = scm_car (cs);
  if (command == ly_symbol2scm ("start-repeat"))
start = true;
  else if (command == ly_symbol2scm ("end-repeat"))
end = true;
  cs = scm_cdr (cs);
}

use for-loop.



--

Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen

LilyPond Software Design
 -- Code for Music Notation
http://www.lilypond-design.com



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


Re: page breaking (again)

2006-07-25 Thread Joe Neeman
On Tue, 2006-07-25 at 16:43 +0200, Nicolas Sceaux wrote:
> Joe Neeman <[EMAIL PROTECTED]> writes:
> 
> > Here is my latest patch to add a new page-breaker.
> 
> May you not abbreviate that much variable names in scheme code?
> It's usual to write full names, eg. paper-book and page-number,
> iso. p-book and p-num.

OK, fixed.

Joe



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


Re: page breaking (again)

2006-07-25 Thread Nicolas Sceaux
Joe Neeman <[EMAIL PROTECTED]> writes:

> Here is my latest patch to add a new page-breaker.

May you not abbreviate that much variable names in scheme code?
It's usual to write full names, eg. paper-book and page-number,
iso. p-book and p-num.

nicolas


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


page breaking (again)

2006-07-24 Thread Joe Neeman
Here is my latest patch to add a new page-breaker. This actually adds 2
page breakers now:

ly:page-turn-breaking will only allow page turns at specified places
within the score. By default, a page turn can only appear at the end of
a score. This can be altered in two ways:
1) by adding \allowPageTurn or \pageTurn in certain places throughout
the score
2) by adding Page_turn_engraver to a Staff (or Voice) context.
Page_turn_engraver will scan the context for noteheads. Wherever there
is a sufficiently long gap in noteheads, a page turn will be permitted.
This length is tuned by the context property minPageTurnLength

ly:optimal-breaking does not care about page turns. The main advantage
over the current page breaker is that it is capable of changing the
horizontal spacing so that the vertical spacing is better. If you use
this, you probably want to set ragged-last-bottom = ##f.

I propose that ly:optimal-breaking be eventually made the default page
breaker (I'm sure there are plenty of issues to work out first, though).

Both page-breakers can be tuned with the (book-wide) paper block
variables "page-spacing-weight" (default 1.0) which specifies the
importance of good page spacing relative to line spacing and
"blank-last-page-force" (default 0) which specifies the penalty for
ending the piece on a left-hand page. ly:page-turn-breaking will also
consider leaving blank pages mid-score. The penalty for these pages can
be tuned with "blank-page-force" (default 10).

The new files are attached in a tar archive (I cc to Han-Wen just in
case the list strips it). There are 13 of them, so I thought it would be
easier.

2006-07-25  Joe Neeman  <[EMAIL PROTECTED]>

* scm/page.scm (make-page): make it friendlier to call (esp. from C++)

* scm/layout-page-layout.scm (make-page-from-systems): new function
(optimal-page-breaks): use the new page-breaking calling convention

* scm/define-context-properties.scm (all-user-translation-properties):
add revokePageTurns

* lily/paper-column-engraver.cc (stop_translation_timestep): add
revokePageTurns  functionality. If there is a special barline within
the breakable region, break there instead of at the end of the region.

* lily/paper-book.cc (pages): use the new page-breaking calling
convention


page_breaking_newfiles.tar.gz
Description: application/compressed-tar
Index: ChangeLog
===
RCS file: /sources/lilypond/lilypond/ChangeLog,v
retrieving revision 1.5202
diff -u -r1.5202 ChangeLog
--- ChangeLog	25 Jul 2006 01:16:05 -	1.5202
+++ ChangeLog	25 Jul 2006 01:34:03 -
@@ -1,5 +1,19 @@
 2006-07-25  Joe Neeman  <[EMAIL PROTECTED]>
 
+	* scm/page.scm (make-page): make it friendlier to call (esp. from C++)
+
+	* scm/layout-page-layout.scm (make-page-from-systems): new function
+	(optimal-page-breaks): use the new page-breaking calling convention
+
+	* scm/define-context-properties.scm (all-user-translation-properties):
+	add revokePageTurns
+
+	* lily/paper-column-engraver.cc (stop_translation_timestep): add
+	revokePageTurns  functionality. If there is a special barline within
+	the breakable region, break there instead of at the end of the region.
+
+	* lily/paper-book.cc (pages): use the new page-breaking calling convention
+
 	* lily/grob.cc:
 	* lily/gourlay-breaking.cc: Oops, these should have been included in my last
 	commit
Index: lily/paper-book.cc
===
RCS file: /sources/lilypond/lilypond/lily/paper-book.cc,v
retrieving revision 1.132
diff -u -r1.132 paper-book.cc
--- lily/paper-book.cc	15 Feb 2006 13:02:17 -	1.132
+++ lily/paper-book.cc	25 Jul 2006 01:24:47 -
@@ -381,7 +381,7 @@
 
   pages_ = SCM_EOL;
   SCM proc = paper_->c_variable ("page-breaking");
-  pages_ = scm_apply_0 (proc, scm_list_2 (systems (), self_scm ()));
+  pages_ = scm_apply_0 (proc, scm_list_1(self_scm ()));
   return pages_;
 }
 
Index: lily/paper-column-engraver.cc
===
RCS file: /sources/lilypond/lilypond/lily/paper-column-engraver.cc,v
retrieving revision 1.19
diff -u -r1.19 paper-column-engraver.cc
--- lily/paper-column-engraver.cc	11 Jul 2006 05:58:00 -	1.19
+++ lily/paper-column-engraver.cc	25 Jul 2006 01:24:47 -
@@ -8,6 +8,7 @@
 
 #include "paper-column-engraver.hh"
 #include "system.hh"
+#include "international.hh"
 #include "item.hh"
 #include "paper-column.hh"
 #include "staff-spacing.hh"
@@ -26,9 +27,9 @@
   musical_column_ = 0;
   breaks_ = 0;
   system_ = 0;
-  first_ = true;
+  last_special_barline_column_ = 0;
   last_breakable_column_ = 0;
-  last_breakable_moment_ = Moment (-1);
+  first_ = true;
 }
 
 void
@@ -84,6 +85,7 @@
  ly_symbol2scm ("spacing-wishes"),
  gi.grob ());
 }
+
 void
 Paper_column_engraver::acknowledge_note_spacing (Grob_info gi)
 {
@@ -169,6 +171,56 @@
 }
 }
 
+/*