CVSROOT: /cvsroot/lilypond
Module name: lilypond
Branch:
Changes by: Han-Wen Nienhuys <[EMAIL PROTECTED]> 05/10/07 09:12:03
Modified files:
. : ChangeLog THANKS
Documentation/topdocs: NEWS.tely
lily : lilypond-version.cc lyric-hyphen.cc
new-figured-bass-engraver.cc
scm : define-context-properties.scm
define-music-properties.scm titling.scm
Added files:
input/regression: figured-bass-continuation.ly
Log message:
(marked-up-headfoot): change tagline
handling. tagline = ##f will blank the tagline as well.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.4158&tr2=1.4159&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/THANKS.diff?tr1=1.153&tr2=1.154&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/Documentation/topdocs/NEWS.tely.diff?tr1=1.95&tr2=1.96&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/input/regression/figured-bass-continuation.ly?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/lilypond-version.cc.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/lyric-hyphen.cc.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/new-figured-bass-engraver.cc.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/define-context-properties.scm.diff?tr1=1.52&tr2=1.53&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/define-music-properties.scm.diff?tr1=1.41&tr2=1.42&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/titling.scm.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.4158 lilypond/ChangeLog:1.4159
--- lilypond/ChangeLog:1.4158 Thu Oct 6 13:12:56 2005
+++ lilypond/ChangeLog Fri Oct 7 09:12:01 2005
@@ -1,4 +1,17 @@
+2005-10-07 Han-Wen Nienhuys <[EMAIL PROTECTED]>
+
+ * scm/titling.scm (marked-up-headfoot): change tagline
+ handling. tagline = ##f will blank the tagline as well.
+
2005-10-06 Han-Wen Nienhuys <[EMAIL PROTECTED]>
+
+ * Documentation/topdocs/NEWS.tely: add entry for Figured bass.
+
+ * lily/new-figured-bass-engraver.cc (struct
+ New_figured_bass_engraver): add new_music_found_ member.
+
+ * lily/lilypond-version.cc (Lilypond_version): deal with
+ incorrectly formatted version strings.
* ly/engraver-init.ly (AncientRemoveEmptyStaffContext): switch on
New_figured_bass_engraver by default.
Index: lilypond/Documentation/topdocs/NEWS.tely
diff -u lilypond/Documentation/topdocs/NEWS.tely:1.95
lilypond/Documentation/topdocs/NEWS.tely:1.96
--- lilypond/Documentation/topdocs/NEWS.tely:1.95 Tue Oct 4 20:56:07 2005
+++ lilypond/Documentation/topdocs/NEWS.tely Fri Oct 7 09:12:02 2005
@@ -45,6 +45,20 @@
@itemize @bullet
[EMAIL PROTECTED]
+Support for figured bass has been rewritten. Now it supports continuation
lines.
+
[EMAIL PROTECTED],fragment]
+<<
+\relative { c4 c c c }
+\figures {
+ \set useBassFigureExtenders = ##t
+ <6+ 4 3> <6 4 3> <4 3+>
+} >>
[EMAIL PROTECTED] lilypond
+
+This feature was sponsored by Trent Johnston.
+
@item
Vertical alignments of staves can now be tuned easily for individual
systems.
Index: lilypond/THANKS
diff -u lilypond/THANKS:1.153 lilypond/THANKS:1.154
--- lilypond/THANKS:1.153 Mon Sep 12 12:20:25 2005
+++ lilypond/THANKS Fri Oct 7 09:12:02 2005
@@ -29,8 +29,10 @@
Kieren MacMillan
Kris Shaffer
Nancho Alvarez
+Nicolas Sceaux
Steve Doonan
Sven Axelsson
+Trent Johnston
Trevor BaÄa
Yoshinobu Ishizaki
Vicente Solsona Dellá
Index: lilypond/lily/lilypond-version.cc
diff -u lilypond/lily/lilypond-version.cc:1.13
lilypond/lily/lilypond-version.cc:1.14
--- lilypond/lily/lilypond-version.cc:1.13 Sat Aug 13 21:35:23 2005
+++ lilypond/lily/lilypond-version.cc Fri Oct 7 09:12:03 2005
@@ -6,6 +6,8 @@
(c) 1998--2005 Jan Nieuwenhuizen <[EMAIL PROTECTED]>
*/
+#include <ctype.h>
+
#include "lilypond-input-version.hh"
#include "string-convert.hh"
#include "array.hh"
@@ -19,13 +21,21 @@
Lilypond_version::Lilypond_version (String str)
{
+ major_ = 0;
+ minor_ = 0;
+ patch_ = 0;
+
Array<String> version;
version = String_convert::split (str, '.');
- major_ = version[0].to_int ();
- minor_ = version[1].to_int ();
+ if (version.size () > 0 && isdigit (version[0][0]))
+ major_ = version[0].to_int ();
+ if (version.size () > 1 && isdigit (version[1][0]))
+ minor_ = version[1].to_int ();
+
patch_ = 0;
- if (version.size () >= 3)
+ if (version.size () >= 3
+ && isdigit (version[2][0]))
patch_ = version[2].to_int ();
if (version.size () >= 4)
Index: lilypond/lily/lyric-hyphen.cc
diff -u lilypond/lily/lyric-hyphen.cc:1.22 lilypond/lily/lyric-hyphen.cc:1.23
--- lilypond/lily/lyric-hyphen.cc:1.22 Mon Sep 12 23:33:24 2005
+++ lilypond/lily/lyric-hyphen.cc Fri Oct 7 09:12:03 2005
@@ -23,7 +23,8 @@
me->get_bound (RIGHT));
if (bounds[LEFT]->break_status_dir ()
- && Paper_column::when_mom (bounds[LEFT]) == Paper_column::when_mom
(bounds[RIGHT]->get_column ()))
+ && (Paper_column::when_mom (bounds[LEFT])
+ == Paper_column::when_mom (bounds[RIGHT]->get_column ())))
return SCM_EOL;
Grob *common = bounds[LEFT]->common_refpoint (bounds[RIGHT], X_AXIS);
Index: lilypond/lily/new-figured-bass-engraver.cc
diff -u lilypond/lily/new-figured-bass-engraver.cc:1.3
lilypond/lily/new-figured-bass-engraver.cc:1.4
--- lilypond/lily/new-figured-bass-engraver.cc:1.3 Thu Oct 6 13:12:57 2005
+++ lilypond/lily/new-figured-bass-engraver.cc Fri Oct 7 09:12:03 2005
@@ -28,19 +28,26 @@
SCM number_;
SCM alteration_;
- bool is_continuation_;
Item *figure_item_;
Music *current_music_;
Figure_group ()
{
- is_continuation_ = false;
continuation_line_ = 0;
number_ = SCM_EOL;
alteration_ = SCM_EOL;
group_ = 0;
current_music_ = 0;
}
+ bool is_continuation () const
+ {
+ return
+ current_music_
+ && ly_is_equal (number_,
+ current_music_->get_property ("figure"))
+ && ly_is_equal (alteration_,
+ current_music_->get_property ("alteration"));
+ }
};
struct New_figured_bass_engraver : public Engraver
@@ -48,11 +55,14 @@
TRANSLATOR_DECLARATIONS(New_figured_bass_engraver);
void clear_spanners();
void add_brackets ();
+ void create_grobs ();
protected:
Array<Figure_group> groups_;
Spanner *alignment_;
Link_array<Music> new_musics_;
bool continuation_;
+ bool new_music_found_;
+
Moment stop_moment_;
Music *rest_event_;
@@ -94,6 +104,7 @@
alignment_ = 0;
continuation_ = false;
rest_event_ = 0;
+ new_music_found_ = false;
}
void
@@ -107,7 +118,6 @@
for (int i = 0; i < groups_.size (); i++)
{
groups_[i].current_music_ = 0;
- groups_[i].is_continuation_ = false;
}
continuation_ = false;
}
@@ -115,35 +125,33 @@
bool
New_figured_bass_engraver::try_music (Music *m)
{
- if (m->is_mus_type ("rest-event"))
+ new_music_found_ = true;
+ if (m->is_mus_type ("rest-event"))
{
rest_event_ = m;
return true;
}
- else
- {
- SCM fig = m->get_property ("figure");
- for (int i = 0; i < groups_.size (); i++)
- {
- if (!groups_[i].current_music_
- && ly_is_equal (groups_[i].number_, fig))
- {
- groups_[i].current_music_ = m;
- groups_[i].is_continuation_ =
- ly_is_equal (groups_[i].alteration_,
- m->get_property ("alteration"));
+ else
+ {
+ stop_moment_ = now_mom () + m->get_length ();
+
+ SCM fig = m->get_property ("figure");
+ for (int i = 0; i < groups_.size (); i++)
+ {
+ if (!groups_[i].current_music_
+ && ly_is_equal (groups_[i].number_, fig))
+ {
+ groups_[i].current_music_ = m;
- continuation_ = true;
- return true;
- }
- }
+ continuation_ = true;
+ return true;
+ }
+ }
- new_musics_.push (m);
+ new_musics_.push (m);
- stop_moment_ = now_mom () + m->get_length ();
-
- return true;
- }
+ return true;
+ }
}
void
@@ -205,15 +213,31 @@
clear_spanners ();
return;
}
+
+ if (!new_music_found_)
+ return ;
+ new_music_found_ = false;
+
+ /*
+ Don't need to sync alignments, if we're not using extenders.
+ */
+ bool use_extenders = to_boolean (get_property ("useBassFigureExtenders"));
+ if (!use_extenders)
+ {
+ alignment_ = 0;
+ for (int i = 0; i < groups_.size (); i++)
+ {
+ groups_[i].group_ = 0;
+ groups_[i].continuation_line_ = 0;
+ }
+ }
- Grob *muscol = dynamic_cast<Item*> (unsmob_grob (get_property
("currentMusicalColumn")));
if (!continuation_)
{
clear_spanners ();
- alignment_ = make_spanner ("BassFigureAlignment", SCM_EOL);
- alignment_->set_bound (LEFT, muscol);
}
+
int k = 0;
for (int i = 0; i < new_musics_.size (); i++)
{
@@ -234,20 +258,18 @@
for (int i = 0; i < groups_.size (); i++)
{
- if (!groups_[i].is_continuation_)
+ if (!groups_[i].is_continuation ())
{
groups_[i].number_ = SCM_BOOL_F;
groups_[i].alteration_ = SCM_BOOL_F;
}
}
- SCM proc = get_property ("newFiguredBassFormatter");
- alignment_->set_bound (RIGHT, muscol);
-
- if (to_boolean (get_property ("useBassFigureExtenders")))
+ if (use_extenders)
+
for (int i = 0; i < groups_.size(); i++)
{
- if (groups_[i].is_continuation_)
+ if (groups_[i].is_continuation ())
{
if (!groups_[i].continuation_line_)
{
@@ -269,16 +291,27 @@
else
groups_[i].continuation_line_ = 0;
}
-
+ create_grobs ();
+ add_brackets ();
+}
+
+void
+New_figured_bass_engraver::create_grobs ()
+{
+ Grob *muscol = dynamic_cast<Item*> (unsmob_grob (get_property
("currentMusicalColumn")));
+ if (!alignment_)
+ {
+ alignment_ = make_spanner ("BassFigureAlignment", SCM_EOL);
+ alignment_->set_bound (LEFT, muscol);
+ }
+ alignment_->set_bound (RIGHT, muscol);
+
+ SCM proc = get_property ("newFiguredBassFormatter");
for (int i = 0; i < groups_.size(); i++)
{
Figure_group &group = groups_[i];
- if (group.continuation_line_)
- {
- group.continuation_line_->set_bound (RIGHT, muscol);
- }
- else if (group.current_music_)
+ if (group.current_music_)
{
Item *item
= make_item ("NewBassFigure",
@@ -312,12 +345,21 @@
group.figure_item_ = item;
}
- groups_[i].group_->set_bound (RIGHT, muscol);
+ if (group.continuation_line_)
+ {
+ /*
+ UGH should connect to the bass staff, and get the note heads.
+ */
+ group.figure_item_->set_property ("transparent", SCM_BOOL_T);
+ group.continuation_line_->set_bound (RIGHT, group.figure_item_);
+ }
+
+
+ if (groups_[i].group_)
+ groups_[i].group_->set_bound (RIGHT, muscol);
}
- add_brackets ();
}
-
ADD_TRANSLATOR (New_figured_bass_engraver,
/* doc */
Index: lilypond/scm/define-context-properties.scm
diff -u lilypond/scm/define-context-properties.scm:1.52
lilypond/scm/define-context-properties.scm:1.53
--- lilypond/scm/define-context-properties.scm:1.52 Wed Oct 5 13:05:45 2005
+++ lilypond/scm/define-context-properties.scm Fri Oct 7 09:12:03 2005
@@ -26,6 +26,7 @@
;; TODO FIXME
(useBassFigureExtenders ,boolean? "")
(figuredBassAlterationDirection ,ly:dir? "")
+ (newFiguredBassFormatter ,procedure? "")
(aDueText ,string? "Text to print at a unisono passage.")
(alignBelowContext ,string? "Where to insert newly created context in
vertiical alignment.")
Index: lilypond/scm/define-music-properties.scm
diff -u lilypond/scm/define-music-properties.scm:1.41
lilypond/scm/define-music-properties.scm:1.42
--- lilypond/scm/define-music-properties.scm:1.41 Fri Sep 30 21:38:18 2005
+++ lilypond/scm/define-music-properties.scm Fri Oct 7 09:12:03 2005
@@ -106,8 +106,7 @@
"Change to what kind of state? Options are
solo1, solo2 and unisono")
- (figure ,markup? "a `figure' (which may be
-a string) for figured bass")
+ (figure ,integer? "a bass figure")
(alteration ,number? "alteration for figured bass")
(bracket-start ,boolean? "start a bracket
here. TODO: use SpanEvents?")
Index: lilypond/scm/titling.scm
diff -u lilypond/scm/titling.scm:1.17 lilypond/scm/titling.scm:1.18
--- lilypond/scm/titling.scm:1.17 Thu May 26 09:11:53 2005
+++ lilypond/scm/titling.scm Fri Oct 7 09:12:03 2005
@@ -36,16 +36,11 @@
(cdr entry)))
alist))
alists))
- (tagline (ly:modules-lookup scopes 'tagline))
- (default-tagline (ly:output-def-lookup layout 'tagline))
-
(pgnum-alist
(list
(cons 'header:tagline
- (cond
- ((markup? tagline) tagline)
- ((markup? default-tagline) default-tagline)
- (else "")))
+ (ly:modules-lookup scopes 'tagline
+ (ly:output-def-lookup layout
'tagline)))
(cons 'page:last? last?)
(cons 'page:page-number-string
(number->string page-number))
@@ -54,7 +49,7 @@
(list pgnum-alist)
prefixed-alists
(layout-extract-page-properties layout))))
-
+ (display prefixed-alists)
(interpret-markup layout props potential-markup))
empty-stencil))
_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs