From: Han-Wen Nienhuys Date: Fri, 16 May 1997 11:32:53 +0000 (+0200) Subject: release: 0.0.64 X-Git-Tag: release/0.0.64 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=ce5315498fcaaf17d5eb1b320014e96defbb7dfb;hp=b75137963d1390716d79dab8fd593daa2d56c94f;p=lilypond.git release: 0.0.64 --- diff --git a/.version b/.version index e94c2e0851..4615332859 100644 --- a/.version +++ b/.version @@ -1,6 +1,6 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 0 -TOPLEVEL_PATCH_LEVEL = 63 +TOPLEVEL_PATCH_LEVEL = 64 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/Documentation/INSTALL.pod b/Documentation/INSTALL.pod index 556f8690f8..ef26b32fd3 100644 --- a/Documentation/INSTALL.pod +++ b/Documentation/INSTALL.pod @@ -154,8 +154,9 @@ If you do make all everything will be compiled, but nothing will be installed. The -resulting binaries can be found in the subdirectory -F. +resulting binaries can be found in the subdirectories F (which +contain all files generated during compilation). + =head1 INSTALLING @@ -165,7 +166,7 @@ If you have done a successful C, then a simple should do the trick. -[todo] +[todo. Obsolete; fonts are in distribution now.] Install the musixtex fonts in a directory which TeX and MF knows (if you are root, look for a directory which contains the directories with diff --git a/Documentation/MANIFESTO.pod b/Documentation/MANIFESTO.pod index 35568361c1..04d220e96e 100644 --- a/Documentation/MANIFESTO.pod +++ b/Documentation/MANIFESTO.pod @@ -33,8 +33,8 @@ setting is not possible without a knowledgeable printer," untrue. =item * -Make a which system which fully tweakable. It should be possible to -typeset a book on how not to typeset music. +Make a system which is fully tweakable. It should be possible to +typeset a book on how not to typeset music. =back diff --git a/Documentation/faq.pod b/Documentation/faq.pod index e6ade53053..87a162c9c6 100644 --- a/Documentation/faq.pod +++ b/Documentation/faq.pod @@ -113,6 +113,12 @@ Q: How do I change the TeX layout? A: See lilyponddefs.tex, it has some comments. +Q: How do I learn the C++ code? + +A: The entry point is in main(). Good luck. :-) + +Seriously, read, reread and reread lilygut and CodingStyle, and +just start anywhere. Q: Why GPL? diff --git a/Documentation/gnu-music.pod b/Documentation/gnu-music.pod index 33a3aee7b3..cdd1ea3b70 100644 --- a/Documentation/gnu-music.pod +++ b/Documentation/gnu-music.pod @@ -132,6 +132,8 @@ A noninteractive typesetter, suited for batch jobs, and typesetting existing music. This would couple the ASCII language, the printing engine and the typesetting engine +LilyPond is currently representing this section. + =item * A GUI for composing. This would combine the display engine, the diff --git a/Documentation/index.pod b/Documentation/index.pod index 4dd3193944..b90e3b463c 100644 --- a/Documentation/index.pod +++ b/Documentation/index.pod @@ -142,6 +142,13 @@ The coding standards of the lilypond project. +=item * + +The GNU Music project + + =item * @@ -154,12 +161,14 @@ The DOC++ documentation of the C++ sources. Get it at ftp://pcnov095.win.tue.nl/pub/lilypond ! -=head1 AUTHOR - -Han-Wen Nienhuys , for this page - +=item * Stats on this page. + + +=back + + diff --git a/INSTALL.text b/INSTALL.text index 67ad8cdd50..2db81c4b0e 100644 --- a/INSTALL.text +++ b/INSTALL.text @@ -61,7 +61,7 @@ CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG a -2/May/97 LilyPond 0.0.62 1 +16/May/97 LilyPond 0.0.64 1 @@ -127,7 +127,7 @@ INSTALL(1) LilyPond documentation INSTALL(1) -2/May/97 LilyPond 0.0.62 2 +16/May/97 LilyPond 0.0.64 2 @@ -159,7 +159,8 @@ INSTALL(1) LilyPond documentation INSTALL(1) everything will be compiled, but nothing will be installed. The resulting binaries can be found in the - subdirectory _b_i_n_/. + subdirectories _o_u_t_/ (which contain all files generated + during compilation). IIIINNNNSSSSTTTTAAAALLLLLLLLIIIINNNNGGGG If you have done a successful make, then a simple @@ -168,7 +169,7 @@ IIIINNNNSSSSTTTTAAAALLLLLLLLIIIINNNNGGGG should do the trick. - [todo] + [todo. Obsolete; fonts are in distribution now.] Install the musixtex fonts in a directory which TeX and MF knows (if you are root, look for a directory which @@ -189,11 +190,10 @@ CCCCAAAAVVVVEEEEAAAATTTTSSSS RRRRUUUUNNNNNNNNIIIINNNNGGGG GNU LilyPond does use a lot of resources. For operation - you need the following: -2/May/97 LilyPond 0.0.62 3 +16/May/97 LilyPond 0.0.64 3 @@ -202,6 +202,8 @@ RRRRUUUUNNNNNNNNIIIINNNNGGGG INSTALL(1) LilyPond documentation INSTALL(1) + you need the following: + +o A fast computer (a full page of music typically takes 1 minute on my 486/66, using the --------eeeennnnaaaabbbblllleeee----cccchhhheeeecccckkkkiiiinnnngggg compile. It's lot slower than most MusiXTeX @@ -257,8 +259,6 @@ AAAAUUUUTTTTHHHHOOOORRRRSSSS - - -2/May/97 LilyPond 0.0.62 4 +16/May/97 LilyPond 0.0.64 4 diff --git a/NEWS b/NEWS index f2495c5234..5a66e820a8 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,16 @@ +pl 64 + - exe's now built in out/ + - toplevel Makefile dep from make/Toplevel.make.in + - make_website: add version fokoter + - make_website: bf dist *.txt + - bf: fix loose bars : \meter 4/4; c1. + - Staff_elem -> Score_elem + - bf + - vbrace lookup + - stop if barchecks failed + - resync barcheck + +******* pl 63 - bf: segfault during MIDI output with mi2mu output. - kludge: parse error beyond eof diff --git a/TODO b/TODO index 2a42edee5a..9bbc6f491a 100644 --- a/TODO +++ b/TODO @@ -112,13 +112,8 @@ BUGS * staccato dot positions. - * \meter 4/4; c1. doesn't gen bar. - * stacked scripts. - * redo timing stuff <-> pulk to allow \meter 2/4; e2. to work - out correctly - * key transposition. * help-lines for rests @@ -165,6 +160,8 @@ INPUTLANGUAGE SMALLISH PROJECTS + * Help_line, Help_line_reg + * --fast/--draft: leave out constraints * write Dynamic_line (to group dynamics horizontally) @@ -181,9 +178,11 @@ SMALLISH PROJECTS * cleanup lily-proto.hh and proto.hh * half-sharps, half-flats - - * resync barcheck. + * adaptive accidental spacing. + + * score_elem invible_b_ flag + * key undo * unix style paths for LILYINCLUDE env diff --git a/bin/Makefile b/bin/Makefile index faa5163efe..ad9f6bb05b 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -13,6 +13,7 @@ EXTRA_DISTFILES = $(SCRIPTS) # +EXECUTABLES=convert-mudela localinstall: all $(INSTALL) -d $(bindir) $(INSTALL) -m 755 convert-mudela $(bindir) diff --git a/bin/make_website b/bin/make_website index c9fc73dfb4..9586d88598 100755 --- a/bin/make_website +++ b/bin/make_website @@ -1,14 +1,55 @@ #!/usr/bin/perl -w - +# stupid script to generate WWW site. use FileHandle; +my $lily_version; +my $footstr; +my $mw_id = ""; +sub get_version +{ + my ($vstr)=(""); + open V, "$depth/.version"; + while () { + s/#.*$//g; + next if (/^ *$/); + s/^/\$/; + s/= *(.*)$/=\"$1\";/; + $vstr .= $_; + } + eval ($vstr); + + $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL"; + + # stupid checks. + $lily_version= "$TOPLEVEL_MAJOR_VERSION.$TOPLEVEL_MINOR_VERSION.$TOPLEVEL_PATCH_LEVEL$TOPLEVEL_MY_PATCH_LEVEL"; + + + close V; +} + +sub set_html_footer +{ + my $MAILADRESS=$ENV{MAILADRESS}; + my @pw=(getpwuid($<)); + my $username=$pw[6]; + + $footstr = + "\n
+ +This page was generated by make_website from lilypond-$lily_version by +

+


$username <$MAILADRESS>
+

" . `date` . " +

\n"; +} + # do something, check return status sub my_system { my (@cmds) = @_; foreach $cmd (@cmds) { - my $ret = ( system ($cmd))/256; + my $ret = ( system ($cmd)); if ($ret) { print STDERR "\nmake_website: failed on command \`$cmd\' (status $ret)\n"; exit 2; @@ -83,7 +124,7 @@ sub gen_list { print "generating HTML list\n"; open HTMLLIST, ">example_output.html"; - print HTMLLIST "LilyPond examples\n"; + print HTMLLIST "LilyPond examples\n"; foreach $a (@examples) { $name=$a; print HTMLLIST "

example file: $name

\n\n"; @@ -110,8 +151,40 @@ sub gen_list if ( -f $midif ); print HTMLLIST "</ul>"; } + print HTMLLIST "</BODY></HTML>"; close HTMLLIST; } + +sub edit_html +{ + print STDERR "adding footer\n"; + + OUTER: + foreach $a (<*.html>) { + open H, "$a"; + my $sep="</BODY>"; + input_record_separator H $sep; + my $file=""; + + while (<H>) { + if (/$mw_id/) { + close H; + next OUTER; + } + $file .= $_; + + } + close H; + + + $file =~ s/$sep/$footstr$sep/g ; + + open H, ">$a"; + print H $mw_id; + print H $file; + close H; + } +} sub copy_files { print "copying files\n"; @@ -126,28 +199,37 @@ sub docxx_update my_system "make -C $depth doc++"; } -sub - do_tar +sub do_tar { print "tarring.\n"; my_system - " tar vhcf website.tar *.html *.gif *.ps.gz *.ly.txt *.midi docxx/*;", + " tar vhcf website.tar *.html *.gif *.ps.gz *.txt *.midi docxx/*;", "gzip -f9 website.tar;"; } -$depth = "../../"; -$ENV{"TEXINPUTS"} .= ":$depth/input/:"; -$ENV{"LILYINCLUDE"} = "$depth/input/"; -my $cwd; -chomp($cwd = `pwd`); +sub main +{ + $depth = "../"; + my $cwd; + chomp($cwd = `pwd`); + die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/)); + get_version; + set_html_footer; + -die "need to be in directory Documentation\n" if ( ! ($cwd =~ /Documentation$/)); -chdir ("out"); + $depth = "../../"; + chdir ("out"); + $ENV{"TEXINPUTS"} .= ":$depth/input/:"; + $ENV{"LILYINCLUDE"} = "$depth/input/"; -gen_html; -gen_examples; -gen_list; -copy_files; -docxx_update; -do_tar; + + gen_html; + gen_examples; + gen_list; + copy_files; + edit_html; + docxx_update; + do_tar; +} +main; diff --git a/configure b/configure index a803ba3e29..73ea61d323 100755 --- a/configure +++ b/configure @@ -1363,9 +1363,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "make/out/Configure_variables.make:make/Configure_variables.make.in - Makefile:make/Toplevel.make.in - " | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "make/out/Configure_variables.make:make/Configure_variables.make.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <<EOF @@ -1454,9 +1452,7 @@ EOF cat >> $CONFIG_STATUS <<EOF -CONFIG_FILES=\${CONFIG_FILES-"make/out/Configure_variables.make:make/Configure_variables.make.in - Makefile:make/Toplevel.make.in - "} +CONFIG_FILES=\${CONFIG_FILES-"make/out/Configure_variables.make:make/Configure_variables.make.in"} EOF cat >> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then @@ -1630,7 +1626,7 @@ fi eval "DIR_DATADIR=$datadir" DIR_DATADIR="$DIR_DATADIR/lilypond" echo $ac_n "checking ""... $ac_c" 1>&6 -echo "configure:1634: checking " >&5 +echo "configure:1630: checking " >&5 cat << EOF > lib/out/config.hh diff --git a/configure.in b/configure.in index f8f095502d..95a848b476 100644 --- a/configure.in +++ b/configure.in @@ -224,9 +224,7 @@ fi AC_CHECK_HEADER(FlexLexer.h, true, AC_MSG_WARN(can't find flex header. Please install Flex headers correctly)) AC_CONFIG_SUBDIRS(flower) -AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in - Makefile:make/Toplevel.make.in - ) +AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in) diff --git a/flower/.version b/flower/.version index 10b5619315..c07a4a1e4e 100644 --- a/flower/.version +++ b/flower/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 1 MINOR_VERSION = 1 -PATCH_LEVEL = 16 +PATCH_LEVEL = 17 # use to send patches, always empty for released version: MY_PATCH_LEVEL = # include separator: "-1" or ".a" # diff --git a/flower/NEWS b/flower/NEWS index 727d9e2487..9c330b8005 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -1,5 +1,7 @@ version 1.1: +pl 17 + - naming: Pointer->Link, IPointer->Pointer pl 16 - Array::get() - P< > doco. diff --git a/flower/test/Makefile b/flower/test/Makefile index bf271c4d26..0cc3bb960c 100644 --- a/flower/test/Makefile +++ b/flower/test/Makefile @@ -42,7 +42,6 @@ MODULE_LIBES = -lflower # main target of this module: # -MAINTARGET = $(lily_bindir)/$(EXECUTABLE)# huh? BUILDSTRINGTEST=$(MAINTARGET) EXECSTRINGTEST=$(EXECUTABLE) diff --git a/input/rhythm.ly b/input/rhythm.ly index 068a30de4e..fe236e4dca 100644 --- a/input/rhythm.ly +++ b/input/rhythm.ly @@ -8,6 +8,7 @@ copyright:public domain Tested Features: multiple meters, beaming + unsynced bars EndMudelaHeader %} \version "0.0.57"; @@ -50,7 +51,7 @@ ritme = \staff { another = \staff { melodicregs \melodic{ \meter 4/4; - c1 c1 c1 c4 c4 c4 c4 \meter 4/4; c1 c1 c1 + c1. c1. c4 c4 c4 c4 \meter 4/4; c1 c1 c1 } } @@ -66,6 +67,7 @@ yanother = \staff { another yanother + \midi { } \paper{ \unitspace 2\cm \geometric 1.3 diff --git a/lib/include/moment.hh b/lib/include/moment.hh index 0037d94078..e742bee900 100644 --- a/lib/include/moment.hh +++ b/lib/include/moment.hh @@ -8,6 +8,7 @@ #include "rational.hh" class String; typedef Rational Moment; +void print(Moment); #endif // diff --git a/lib/include/proto.hh b/lib/include/proto.hh index 19273d0ab1..ab93a5472f 100644 --- a/lib/include/proto.hh +++ b/lib/include/proto.hh @@ -143,8 +143,6 @@ struct Spanner; struct Subtle_req; struct Staff; struct Staff_column; -struct Staff_elem; -struct Staff_elem_info; struct Staff_symbol; struct Staff_walker; struct Stem; diff --git a/lib/moment.cc b/lib/moment.cc new file mode 100644 index 0000000000..46ed554d50 --- /dev/null +++ b/lib/moment.cc @@ -0,0 +1,11 @@ +#include <iostream.h> +#include "string.hh" +#include "moment.hh" + +void +print(Moment m) +{ + cout << String(m) << flush; +} + + diff --git a/lily/.version b/lily/.version index e929572e51..a01151100b 100644 --- a/lily/.version +++ b/lily/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 0 MINOR_VERSION = 0 -PATCH_LEVEL = 63 +PATCH_LEVEL = 64 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/lily/Makefile b/lily/Makefile index 01503659df..08088271ff 100644 --- a/lily/Makefile +++ b/lily/Makefile @@ -46,9 +46,7 @@ MODULE_LIBES= -llily -lflower # main target of this module: # -MAINTARGET = $(lily_bindir)/$(EXECUTABLE)# huh? - -default: $(MAINTARGET) +default: $(EXECUTABLE) # # generic targets and rules: @@ -76,3 +74,8 @@ DEPFILES = $(wildcard $(depdir)/*.dep) localclean: rm -f $(outdir)/parser.* $(outdir)/lexer.cc + +#should merge with mi2mu rule +localinstall: installexe + +localuninstall: uninstallexe diff --git a/lily/bar-reg.cc b/lily/bar-reg.cc index 8450b6bf7e..4dd6199ce1 100644 --- a/lily/bar-reg.cc +++ b/lily/bar-reg.cc @@ -42,7 +42,7 @@ Bar_register::process_requests() } if (bar_p_){ - announce_element(Staff_elem_info(bar_p_, bar_req_l_) ); + announce_element(Score_elem_info(bar_p_, bar_req_l_) ); } } diff --git a/lily/clef-reg.cc b/lily/clef-reg.cc index f5687a1665..63e4a505fc 100644 --- a/lily/clef-reg.cc +++ b/lily/clef-reg.cc @@ -48,7 +48,7 @@ Clef_register::read_req(Clef_change_req*c_l) c_l->error("unknown clef type "); } void -Clef_register::acknowledge_element(Staff_elem_info info) +Clef_register::acknowledge_element(Score_elem_info info) { if (info.elem_l_->name() == Bar::static_name()) { if (!clef_p_){ @@ -76,7 +76,7 @@ Clef_register::create_clef() { clef_p_ = new Clef_item; clef_p_->read(*this); - announce_element(Staff_elem_info(clef_p_, + announce_element(Score_elem_info(clef_p_, clef_req_l_)); } diff --git a/lily/collision-reg.cc b/lily/collision-reg.cc index 954b999a24..6b9da77062 100644 --- a/lily/collision-reg.cc +++ b/lily/collision-reg.cc @@ -11,7 +11,7 @@ #include "collision.hh" void -Collision_register::acknowledge_element(Staff_elem_info i) +Collision_register::acknowledge_element(Score_elem_info i) { if (!(i.elem_l_->name() == Note_column::static_name())) return; @@ -19,7 +19,7 @@ Collision_register::acknowledge_element(Staff_elem_info i) if (!col_p_) col_p_ = new Collision; - col_p_->add((Note_column*)i.elem_l_); + col_p_->add((Note_column*)i.elem_l_->item()); } void diff --git a/lily/complex-walker.cc b/lily/complex-walker.cc index 134a4705a7..1e1ac452d7 100644 --- a/lily/complex-walker.cc +++ b/lily/complex-walker.cc @@ -68,7 +68,7 @@ Complex_walker::regs_process_requests() } void -Complex_walker::typeset_element(Staff_elem *elem_p) +Complex_walker::typeset_element(Score_elem *elem_p) { if (!elem_p) return; diff --git a/lily/dynamic-reg.cc b/lily/dynamic-reg.cc index 11a74756a7..20ffe5cfe3 100644 --- a/lily/dynamic-reg.cc +++ b/lily/dynamic-reg.cc @@ -58,7 +58,7 @@ Dynamic_register::process_requests() assert (!dynamic_p_) ; // TODO dynamic_p_ = new Text_item(td_p); - announce_element(Staff_elem_info(dynamic_p_, dreq_l)); + announce_element(Score_elem_info(dynamic_p_, dreq_l)); } else if (dreq_l->span_dynamic()) { Span_dynamic_req* span_l = dreq_l->span_dynamic(); @@ -75,7 +75,7 @@ Dynamic_register::process_requests() assert(!new_cresc_p); new_cresc_p = new Crescendo; new_cresc_p->grow_dir_i_ = span_l->dynamic_dir_i_; - announce_element(Staff_elem_info(new_cresc_p, span_l)); + announce_element(Score_elem_info(new_cresc_p, span_l)); } } } @@ -136,7 +136,7 @@ Dynamic_register::~Dynamic_register() delete cresc_p_; } void -Dynamic_register::acknowledge_element(Staff_elem_info i) +Dynamic_register::acknowledge_element(Score_elem_info i) { if (i.elem_l_->name() == Note_column::static_name()) { if (dynamic_p_) dynamic_p_->add_support(i.elem_l_); diff --git a/lily/head-reg.cc b/lily/head-reg.cc index 5b1557ea78..562dbea654 100644 --- a/lily/head-reg.cc +++ b/lily/head-reg.cc @@ -48,7 +48,7 @@ Notehead_register::process_requests() 6 * paper()->internote())); } - Staff_elem_info itinf(note_p_,note_req_l_); + Score_elem_info itinf(note_p_,note_req_l_); announce_element(itinf); } diff --git a/lily/include/clef-reg.hh b/lily/include/clef-reg.hh index 434ffcd958..a9f3426a12 100644 --- a/lily/include/clef-reg.hh +++ b/lily/include/clef-reg.hh @@ -23,7 +23,7 @@ protected: virtual void pre_move_processing(); virtual void post_move_processing(); virtual bool try_request(Request*); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); public: int c0_position_i_; String clef_type_str_; diff --git a/lily/include/collision-reg.hh b/lily/include/collision-reg.hh index 31de018f46..0dd8a66fca 100644 --- a/lily/include/collision-reg.hh +++ b/lily/include/collision-reg.hh @@ -16,7 +16,7 @@ class Collision_register : public Request_register { Collision* col_p_; protected: - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); public: Collision_register(); diff --git a/lily/include/complex-walker.hh b/lily/include/complex-walker.hh index a23371abea..44f445f069 100644 --- a/lily/include/complex-walker.hh +++ b/lily/include/complex-walker.hh @@ -27,8 +27,8 @@ public: /* *************** */ void regs_process_requests(); - void typeset_element(Staff_elem *elem_p); - void announce_element(Staff_elem_info); + void typeset_element(Score_elem *elem_p); + void announce_element(Score_elem_info); virtual void process_requests(); virtual void do_post_move(); virtual void do_pre_move(); diff --git a/lily/include/dynamic-reg.hh b/lily/include/dynamic-reg.hh index c56805d07d..cf23d007c3 100644 --- a/lily/include/dynamic-reg.hh +++ b/lily/include/dynamic-reg.hh @@ -25,7 +25,7 @@ public: ~Dynamic_register(); NAME_MEMBERS(Dynamic_register); protected: - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual bool try_request(Request *req_l); virtual void process_requests(); virtual void pre_move_processing(); diff --git a/lily/include/item.hh b/lily/include/item.hh index 622f0f0dea..f61a2f2765 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -23,7 +23,7 @@ spacing calculation. */ -class Item : public Staff_elem { +class Item : public virtual Score_elem { public: /// indirection to the column it is in PCol * pcol_l_; diff --git a/lily/include/key-reg.hh b/lily/include/key-reg.hh index a907434bf2..c674ca55a2 100644 --- a/lily/include/key-reg.hh +++ b/lily/include/key-reg.hh @@ -25,7 +25,7 @@ struct Key_register : Request_register { virtual void process_requests(); virtual void pre_move_processing(); virtual void post_move_processing(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); Key_register(); NAME_MEMBERS(Key_register); private: diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index d40e1616e6..7cffaced16 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -47,6 +47,8 @@ struct Request_column; struct Rest_req; struct Rhythmic_grouping_req; struct Rhythmic_req; +struct Score_elem; +struct Score_elem_info; struct Script_req; struct Skip_req; struct Slur_req; @@ -69,4 +71,6 @@ struct Script_column; struct Rest_column; struct Rest_collision_register; struct Rest_collision; +struct Vertical_spanner; +struct Vertical_brace; #endif // LILY_PROTO_HH diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh index dd4ae4b736..2371277bb0 100644 --- a/lily/include/local-key-item.hh +++ b/lily/include/local-key-item.hh @@ -10,7 +10,9 @@ #include "varray.hh" struct Local_acc { - int name , acc, octave; + int name_i_; + int accidental_i_; + int octave_i_; static int compare(Local_acc&, Local_acc&); }; diff --git a/lily/include/local-key-reg.hh b/lily/include/local-key-reg.hh index 19e11b9d4e..b7197d2743 100644 --- a/lily/include/local-key-reg.hh +++ b/lily/include/local-key-reg.hh @@ -21,7 +21,7 @@ struct Local_key_register : Request_register { Link_array<Item *> tied_l_arr_; /* *************** */ virtual void process_requests(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); Local_key_register(); NAME_MEMBERS(Local_key_register); diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index e850586626..42a2e03819 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -31,6 +31,7 @@ struct Lookup { */ Symbol streepjes(int pos)const; + Symbol vbrace(Real &dy) const; Symbol meter(Array<Scalar>)const; Symbol stem(Real y1_pos, Real y2_pos)const; Symbol rule_symbol(Real height, Real width)const; diff --git a/lily/include/note-column-reg.hh b/lily/include/note-column-reg.hh index d052d04983..d33dddf962 100644 --- a/lily/include/note-column-reg.hh +++ b/lily/include/note-column-reg.hh @@ -24,10 +24,10 @@ class Note_column_register :public Request_register { int dir_i_; /* *************** */ - bool acceptable_elem_b(Staff_elem const*)const; + bool acceptable_elem_b(Score_elem const*)const; protected: virtual void set_feature(Feature); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); virtual void post_move_processing(); public: diff --git a/lily/include/p-score.hh b/lily/include/p-score.hh index 33e066c3c7..1e283faf9e 100644 --- a/lily/include/p-score.hh +++ b/lily/include/p-score.hh @@ -12,6 +12,7 @@ #include "colhpos.hh" #include "varray.hh" +#include "lily-proto.hh" #include "p-col.hh" #include "p-staff.hh" @@ -45,6 +46,7 @@ struct PScore { /// broken spanners Pointer_list<Spanner*> broken_spans; + Pointer_list<Vertical_spanner*> vspan_p_list_; /* *************** */ /* CONSTRUCTION */ diff --git a/lily/include/pulk-voice.hh b/lily/include/pulk-voice.hh index 3b90063050..9d26d9798a 100644 --- a/lily/include/pulk-voice.hh +++ b/lily/include/pulk-voice.hh @@ -18,7 +18,9 @@ /** Align requests with starting time. - */ + + To our foreign readers "pulk"ing is what you do with the stuff in + your nose to get it out. (and I don't mean blowing) */ class Pulk_voice { PCursor<Voice_element*> cur_; @@ -34,6 +36,10 @@ public: bool ok()const { return cur_.ok() ; } Pulk_voice(Voice*, int staff_idx); + + /** + Get the requests at when(), and advance. + */ Array<Request*> get_req_l_arr(); }; diff --git a/lily/include/pulk-voices.hh b/lily/include/pulk-voices.hh index e6f9be9c11..9f01f4419e 100644 --- a/lily/include/pulk-voices.hh +++ b/lily/include/pulk-voices.hh @@ -12,13 +12,14 @@ #ifndef PULK_VOICES_HH #define PULK_VOICES_HH + #include "pqueue.hh" #include "plist.hh" #include "moment.hh" #include "proto.hh" #include "lily-proto.hh" #include "voice.hh" - +#include "time-description.hh" struct Voice_l { @@ -36,12 +37,14 @@ class Pulk_voices PQueue< Voice_l > voice_pq_; Pointer_list< Pulk_voice * > pulk_p_list_; Link_list<Staff *> staff_l_list_; + Array < Time_description > time_arr_; Moment next_mom_; public: Moment last_; + bool time_checks_failed_b() const; bool ok() const; - Moment next_mom() { return next_mom_; } + Moment next_mom() const; Pulk_voices(Link_list<Staff*> const&); void get_aligned_request(Request_column *col_l ); }; diff --git a/lily/include/register-group.hh b/lily/include/register-group.hh index 2156dbec80..2e13b51248 100644 --- a/lily/include/register-group.hh +++ b/lily/include/register-group.hh @@ -44,7 +44,7 @@ public: virtual void sync_features() ; virtual void pre_move_processing(); virtual void post_move_processing(); - virtual void acknowledge_element(Staff_elem_info info); + virtual void acknowledge_element(Score_elem_info info); virtual bool try_request(Request*); virtual void process_requests(); virtual ~Register_group_register(); diff --git a/lily/include/register.hh b/lily/include/register.hh index 5ba28600ad..dee7c512c8 100644 --- a/lily/include/register.hh +++ b/lily/include/register.hh @@ -17,7 +17,7 @@ #include "staff-info.hh" /** - a struct which processes requests, and creates the #Staff_elem#s. + a struct which processes requests, and creates the #Score_elem#s. It may use derived classes. Hungarian postfix: register */ class Request_register { @@ -69,7 +69,7 @@ protected: /** Invoke walker method to typeset element. Default: pass on to daddy. */ - virtual void typeset_element(Staff_elem*elem_p); + virtual void typeset_element(Score_elem*elem_p); /** take note of item/spanner @@ -77,11 +77,11 @@ protected: Default: ignore the info */ - virtual void acknowledge_element(Staff_elem_info) {} + virtual void acknowledge_element(Score_elem_info) {} /** Announce element. Default: pass on to daddy. Utility */ - virtual void announce_element(Staff_elem_info); + virtual void announce_element(Score_elem_info); /** Set Feature of the register(s). Default: ignore Feature. */ diff --git a/lily/include/request-column.hh b/lily/include/request-column.hh index ad198f3f04..19876c9e37 100644 --- a/lily/include/request-column.hh +++ b/lily/include/request-column.hh @@ -28,6 +28,7 @@ public: bool used_b()const; Moment when(); void add_reqs(int staff_idx, Array<Request*> const&); + void update_time(int staff_idx, Time_description &); void set_score_cols(Score_column*, Score_column*); }; diff --git a/lily/include/rest-collision-reg.hh b/lily/include/rest-collision-reg.hh index da2992b65c..a572ee6449 100644 --- a/lily/include/rest-collision-reg.hh +++ b/lily/include/rest-collision-reg.hh @@ -17,7 +17,7 @@ class Rest_collision_register : public Request_register { Rest_collision* rest_collision_p_; Array< Collision *> collision_l_arr_; protected: - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); public: Rest_collision_register(); diff --git a/lily/include/script-reg.hh b/lily/include/script-reg.hh index 67d1215b9a..f7fc05d9eb 100644 --- a/lily/include/script-reg.hh +++ b/lily/include/script-reg.hh @@ -16,14 +16,14 @@ class Script_register : public Request_register { Array<Script_req *> script_req_l_arr_; /* *************** */ - bool acceptable_elem_b(Staff_elem*); + bool acceptable_elem_b(Score_elem*); public: NAME_MEMBERS(Script_register); Script_register(); protected: virtual bool try_request(Request*); virtual void process_requests(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); virtual void post_move_processing(); diff --git a/lily/include/slur-reg.hh b/lily/include/slur-reg.hh index cca97e0f13..9ac27e5916 100644 --- a/lily/include/slur-reg.hh +++ b/lily/include/slur-reg.hh @@ -23,7 +23,7 @@ protected: virtual void set_feature(Feature); virtual bool acceptable_request_b(Request*); virtual void process_requests(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); virtual void post_move_processing(); public: diff --git a/lily/include/spanner.hh b/lily/include/spanner.hh index d3ca04af5e..df5e9e58e9 100644 --- a/lily/include/spanner.hh +++ b/lily/include/spanner.hh @@ -31,7 +31,7 @@ length of stems of notes they encompass. */ -class Spanner:public Staff_elem { +class Spanner:public virtual Score_elem { public: PCol *left_col_l_, *right_col_l_; diff --git a/lily/include/staff-column.hh b/lily/include/staff-column.hh index b0624664be..7550ae27fa 100644 --- a/lily/include/staff-column.hh +++ b/lily/include/staff-column.hh @@ -35,6 +35,7 @@ public: void add_reqs (Array<Request*> req_l_arr); void OK() const; ~Staff_column(); + void update_time(Time_description&, Rhythmic_grouping*); void typeset_breakable_items(Array<Item *> &pre_p_arr, Array<Item *> &nobreak_p_arr, Array<Item *> &post_p_arr); diff --git a/lily/include/staff-elem-info.hh b/lily/include/staff-elem-info.hh index 25fa480170..7d5955a2a7 100644 --- a/lily/include/staff-elem-info.hh +++ b/lily/include/staff-elem-info.hh @@ -1,5 +1,5 @@ /* - staff-elem-info.hh -- declare Staff_elem_info + staff-elem-info.hh -- declare Score_elem_info source file of the LilyPond music typesetter @@ -11,19 +11,19 @@ #define STAFFELEMINFO_HH #include "scalar.hh" -#include "proto.hh" +#include "lily-proto.hh" #include "varray.hh" /// data container. -struct Staff_elem_info { - Staff_elem * elem_l_; +struct Score_elem_info { + Score_elem * elem_l_; Request*req_l_; Voice const * voice_l_; Array<Request_register*> origin_reg_l_arr_; /* *** */ - Staff_elem_info(Staff_elem*, Request*); - Staff_elem_info(); + Score_elem_info(Score_elem*, Request*); + Score_elem_info(); }; diff --git a/lily/include/staff-elem.hh b/lily/include/staff-elem.hh index a1524a1bd6..fa459f9e76 100644 --- a/lily/include/staff-elem.hh +++ b/lily/include/staff-elem.hh @@ -13,14 +13,14 @@ #include "class-name.hh" -/** Both Spanner and Item are Staff_elem's. Most Staff_elem's depend - on other Staff_elem's, eg, Beam needs to know and set direction of +/** Both Spanner and Item are Score_elem's. Most Score_elem's depend + on other Score_elem's, eg, Beam needs to know and set direction of Stem. So the Beam has to be calculated *before* Stem. This is - accomplished with the dependencies field of struct Staff_elem. + accomplished with the dependencies field of struct Score_elem. (elem) */ -class Staff_elem { +class Score_elem { /// member: the symbols Molecule *output; // should scrap, and use temp var? @@ -31,7 +31,7 @@ class Staff_elem { NULL. */ Offset offset_; - Array<Staff_elem*> dependancy_l_arr_; + Array<Score_elem*> dependancy_l_arr_; public: enum Status { ORPHAN, // not yet added to pstaff @@ -40,6 +40,8 @@ public: PRECALCED, // calcs before spacing done POSTCALCING, // busy calculating. This is used to trap cyclic deps. POSTCALCED, // after spacing calcs done + VERTICALCING, // height determined + VERTICALCED, OUTPUT, // molecule has been output DELETED, // to catch malloc mistakes. } status; @@ -48,15 +50,15 @@ public: PStaff *pstaff_l_; /* *************** */ - Staff_elem(Staff_elem const&); + Score_elem(Score_elem const&); String TeXstring () const ; virtual void print() const; virtual Interval width() const; virtual Interval height() const; Paper_def *paper() const; - virtual ~Staff_elem(); - Staff_elem(); - NAME_MEMBERS(Staff_elem); + virtual ~Score_elem(); + Score_elem(); + NAME_MEMBERS(Score_elem); /** translate the symbol. The symbol does not have to be created yet. @@ -74,8 +76,8 @@ public: /** add a dependency. It may be the 0 pointer, in which case, it is ignored. */ - void add_dependency(Staff_elem* ); - void substitute_dependency(Staff_elem* old, Staff_elem * newdep); + void add_dependency(Score_elem* ); + void substitute_dependency(Score_elem* old, Score_elem * newdep); protected: virtual Interval do_height()const; @@ -92,7 +94,9 @@ protected: /// do calculations after determining horizontal spacing virtual void do_post_processing(); - Array<Staff_elem*> dependant_l_arr_; + /// do calculations after height of spanners/items is determined. + virtual void do_verticalcing(); + Array<Score_elem*> dependant_l_arr_; }; diff --git a/lily/include/staff-regs.hh b/lily/include/staff-regs.hh index 88c41f8999..69f1f5356e 100644 --- a/lily/include/staff-regs.hh +++ b/lily/include/staff-regs.hh @@ -25,7 +25,7 @@ protected: virtual bool try_request(Request * r); virtual Staff_info get_staff_info(); virtual bool acceptable_request_b(Request*) const ; - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); public: /* *************** */ diff --git a/lily/include/staff-side.hh b/lily/include/staff-side.hh index 1300871023..c81353f0cb 100644 --- a/lily/include/staff-side.hh +++ b/lily/include/staff-side.hh @@ -14,9 +14,9 @@ /// A symbol which sits along the staff class Staff_side { - Array<Staff_elem*> support_l_arr_; + Array<Score_elem*> support_l_arr_; int staff_size_i_; - Staff_elem * elem_l_; + Score_elem * elem_l_; Interval support_height()const; Staff_symbol* staff_sym_l_; void read_staff_sym(); @@ -32,8 +32,8 @@ public: void set_staffsym(Staff_symbol*); - Staff_side(Staff_elem*); - void add_support(Staff_elem*); + Staff_side(Score_elem*); + void add_support(Score_elem*); protected: int get_position_i()const; diff --git a/lily/include/staffeleminfo.hh b/lily/include/staffeleminfo.hh index 14652899d4..ef9f3c196f 100644 --- a/lily/include/staffeleminfo.hh +++ b/lily/include/staffeleminfo.hh @@ -1,5 +1,5 @@ /* - staffeleminfo.hh -- declare Staff_elem_info + staffeleminfo.hh -- declare Score_elem_info source file of the LilyPond music typesetter @@ -13,16 +13,16 @@ #include "proto.hh" /// data container. -struct Staff_elem_info { - Staff_elem * elem_p_; +struct Score_elem_info { + Score_elem * elem_p_; Request*req_l_; Voice const * voice_l_; Voice_group_registers * group_regs_l_; Request_register * origin_reg_l_; /* *** */ - Staff_elem_info(Staff_elem*, Request*, Request_register*); - Staff_elem_info(); + Score_elem_info(Score_elem*, Request*, Request_register*); + Score_elem_info(); }; #endif // STAFFELEMINFO_HH diff --git a/lily/include/stem-beam-reg.hh b/lily/include/stem-beam-reg.hh index f5a3c6452b..f63f1ad6de 100644 --- a/lily/include/stem-beam-reg.hh +++ b/lily/include/stem-beam-reg.hh @@ -33,7 +33,7 @@ protected: virtual void set_feature(Feature dir_i_); virtual bool try_request(Request*); virtual void process_requests(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void pre_move_processing(); virtual void post_move_processing(); }; diff --git a/lily/include/text-reg.hh b/lily/include/text-reg.hh index f3544b3ec7..4b251aef97 100644 --- a/lily/include/text-reg.hh +++ b/lily/include/text-reg.hh @@ -20,7 +20,7 @@ protected: virtual void process_requests(); virtual void pre_move_processing(); virtual void post_move_processing(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); public: Text_register(); NAME_MEMBERS(Text_register); diff --git a/lily/include/tie-reg.hh b/lily/include/tie-reg.hh index 5a0028f83e..b0cd227625 100644 --- a/lily/include/tie-reg.hh +++ b/lily/include/tie-reg.hh @@ -24,7 +24,7 @@ class Tie_register : public Request_register { protected: virtual ~Tie_register(); - virtual void acknowledge_element(Staff_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual bool try_request(Request*); virtual bool acceptable_request_b(Request*); virtual void sync_features(); diff --git a/lily/include/time-description.hh b/lily/include/time-description.hh index 1bfd5820e6..c4edb172bf 100644 --- a/lily/include/time-description.hh +++ b/lily/include/time-description.hh @@ -8,11 +8,16 @@ #define tdes_HH #include "moment.hh" +#include "lily-proto.hh" +#include "varray.hh" /// full info on where we are struct Time_description { Moment when_; + /// found an error so far? + bool error_b_ ; + /// if true, no bars needed, no reduction of whole_in_measure bool cadenza_b_; @@ -38,7 +43,8 @@ struct Time_description { void print() const; void setpartial(Moment p); String try_set_partial_str(Moment)const; - Moment barleft(); + Moment barleft()const; + Moment next_bar_moment()const; void set_meter(int,int); static int compare (const Time_description&, const Time_description&); }; @@ -48,5 +54,10 @@ struct Time_description { instantiate_compare(Time_description&,Time_description::compare); + +void +process_timing_reqs(Time_description &time_, + Rhythmic_grouping *default_grouping, + Array<Timing_req*> const& timing_req_l_arr); #endif // Time_description_HH diff --git a/lily/include/vertical-brace.hh b/lily/include/vertical-brace.hh new file mode 100644 index 0000000000..c0b368e2d2 --- /dev/null +++ b/lily/include/vertical-brace.hh @@ -0,0 +1,20 @@ +/* + vertical-brace.hh -- declare + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl> +*/ + + +#ifndef VERTICAL_BRACE_HH +#define VERTICAL_BRACE_HH + +#include "vertical-spanner.hh" + +class Vertical_brace : public Vertical_spanner { +public: + +}; + +#endif // VERTICAL_BRACE_HH diff --git a/lily/include/vertical-spanner.hh b/lily/include/vertical-spanner.hh new file mode 100644 index 0000000000..be0aee63cc --- /dev/null +++ b/lily/include/vertical-spanner.hh @@ -0,0 +1,24 @@ +/* + vertical-spanner.hh -- declare Vertical_spanner + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl> +*/ + + +#ifndef VERTICAL_SPANNER_HH +#define VERTICAL_SPANNER_HH + +#include "staff-elem.hh" + +class Vertical_spanner: virtual public Score_elem { +public: + PStaff *lower_pstaff_l_; + PStaff *upper_pstaff_l_; + NAME_MEMBERS(Vertical_spanner); + + Vertical_spanner(); + +}; +#endif // VERTICAL_SPANNER_HH diff --git a/lily/include/voice-regs.hh b/lily/include/voice-regs.hh index 818f32d71c..4586f40ab2 100644 --- a/lily/include/voice-regs.hh +++ b/lily/include/voice-regs.hh @@ -25,7 +25,7 @@ public: protected: virtual void pre_move_processing(); virtual bool acceptable_request_b(Request*); - virtual void acknowledge_element(Staff_elem_info info); + virtual void acknowledge_element(Score_elem_info info); virtual bool try_request(Request*); virtual void do_print() const; }; diff --git a/lily/include/walk-regs.hh b/lily/include/walk-regs.hh index 7739ed269b..3326daad80 100644 --- a/lily/include/walk-regs.hh +++ b/lily/include/walk-regs.hh @@ -22,22 +22,22 @@ struct Walker_registers : Register_group_register { Array<Item*> prebreak_item_p_arr_; Array<Item*> nobreak_item_p_arr_; Array<Item*> postbreak_item_p_arr_; - Array<Staff_elem_info> announce_info_arr_; + Array<Score_elem_info> announce_info_arr_; Complex_walker * walk_l_; /* *************** */ - void typeset_musical_item(Staff_elem * elem_p); + void typeset_musical_item(Score_elem * elem_p); Walker_registers(Complex_walker*); void do_announces(); virtual Staff_info get_staff_info(); - virtual void announce_element(Staff_elem_info); - virtual void acknowledge_element(Staff_elem_info); + virtual void announce_element(Score_elem_info); + virtual void acknowledge_element(Score_elem_info); virtual void typeset_breakable_item(Item * pre_p , Item * nobreak_p, Item * post_p); - virtual void typeset_element(Staff_elem*elem_p); + virtual void typeset_element(Score_elem*elem_p); virtual void pre_move_processing(); virtual void post_move_processing(); virtual Paper_def * paper() const; diff --git a/lily/key-reg.cc b/lily/key-reg.cc index c1268181ae..fe2371e349 100644 --- a/lily/key-reg.cc +++ b/lily/key-reg.cc @@ -39,7 +39,7 @@ Key_register::try_request(Request * req_l) } void -Key_register::acknowledge_element(Staff_elem_info info) +Key_register::acknowledge_element(Score_elem_info info) { Command_req * r_l = info.req_l_->command() ; if (r_l && r_l->clefchange()) { @@ -61,7 +61,7 @@ Key_register::process_requests() else kit_p_ = new Key_item(c0_i); kit_p_->read(*this); - announce_element(Staff_elem_info(kit_p_, keyreq_l_)); + announce_element(Score_elem_info(kit_p_, keyreq_l_)); } void diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index 6a658b64c2..f6d8b9ba7f 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -1,3 +1,11 @@ +/* + local-key-item.cc -- implement Local_key_item, Local_acc + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl> +*/ + #include "local-key-item.hh" #include "molecule.hh" #include "scalar.hh" @@ -26,13 +34,18 @@ Local_key_item::add(Melodic_req*m_l) { add(m_l->octave_i_, m_l->notename_i_, m_l->accidental_i_); } + void Local_key_item::add (int o, int p , int a) { Local_acc l; - l.octave = o; - l.name = p; - l.acc = a; + l.octave_i_ = o; + l.name_i_ = p; + l.accidental_i_ = a; + for (int i=0; i< accs.size(); i++) + if (!Local_acc::compare(l, accs[i])) + return; + accs.push(l); } @@ -50,7 +63,7 @@ Local_key_item::brew_molecule_p()const int lastoct = -100; for (int i = 0; i < accs.size(); i++) { // do one octave - if (accs[i].octave != lastoct) { + if (accs[i].octave_i_ != lastoct) { if (octmol){ Real dy =lastoct*7*paper()->internote(); octmol->translate(Offset(0, dy)); @@ -59,10 +72,10 @@ Local_key_item::brew_molecule_p()const } octmol= new Molecule; } - lastoct = accs[i].octave; - Symbol s =paper()->lookup_l()->accidental(accs[i].acc); + lastoct = accs[i].octave_i_; + Symbol s =paper()->lookup_l()->accidental(accs[i].accidental_i_); Atom a(s); - Real dy = (accs[i].name + c0_position) * paper()->internote(); + Real dy = (accs[i].name_i_ + c0_position) * paper()->internote(); a.translate(Offset(0,dy)); octmol->add_right(a); @@ -84,11 +97,11 @@ Local_key_item::brew_molecule_p()const int Local_acc::compare(Local_acc&a, Local_acc&b) { - if (a.octave - b.octave) - return a.octave - b.octave; - if (a.name - b.name) - return a.name - b.name; + if (a.octave_i_ - b.octave_i_) + return a.octave_i_ - b.octave_i_; + if (a.name_i_ - b.name_i_) + return a.name_i_ - b.name_i_; - assert(false); + return a.accidental_i_ - b.accidental_i_; }; IMPLEMENT_STATIC_NAME(Local_key_item); diff --git a/lily/local-key-reg.cc b/lily/local-key-reg.cc index 2fac0d573d..9e014e7c75 100644 --- a/lily/local-key-reg.cc +++ b/lily/local-key-reg.cc @@ -29,7 +29,8 @@ Local_key_register::pre_move_processing() Item * support_l = support_l_arr_[i]; Note_req * note_l = mel_l_arr_[i]; - if (tied_l_arr_.find_l(support_l) && !forced_l_arr_.find_l(support_l)) + if (tied_l_arr_.find_l(support_l) && + !forced_l_arr_.find_l(support_l)) continue; if (!key_item_p) @@ -49,9 +50,9 @@ Local_key_register::pre_move_processing() } void -Local_key_register::acknowledge_element(Staff_elem_info info) +Local_key_register::acknowledge_element(Score_elem_info info) { - Staff_elem * elem_l = info.elem_l_; + Score_elem * elem_l = info.elem_l_; if (info.req_l_->note()) { Note_req * note_l = info.req_l_->note(); Item * item_l = info.elem_l_->item(); @@ -75,7 +76,7 @@ Local_key_register::acknowledge_element(Staff_elem_info info) (Key_register*)info.origin_reg_l_arr_[0]; key_C_ = &key_reg_l->key_; } else if (elem_l->name() == Tie::static_name()) { - Tie * tie_l = (Tie*)elem_l; + Tie * tie_l = (Tie*)elem_l->spanner(); if (tie_l->same_pitch_b_) tied_l_arr_.push(tie_l-> right_head_l_ ); } diff --git a/lily/lookup.cc b/lily/lookup.cc index 08591cfe7c..12684d539d 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -232,3 +232,26 @@ Lookup::stem(Real y1,Real y2) const s.tex = substitute_args(src,a); return s; } + +Symbol +Lookup::vbrace(Real &y) const +{ + if (y < 2* 20 PT) { + warning ( "piano brace too small (" + print_dimen(y)+ ")"); + y = 2*20 PT; + } + if (y > 67 * 2 PT) { + warning ( "piano brace too big (" + print_dimen(y)+ ")"); + y = 67 *2 PT; + } + + int idx = (y/2.0 - 20 ) + 148; + + Symbol s = (*symtables_)("param")->lookup("brace"); + + Array<String> a; + a.push(idx); + s.tex = substitute_args(s.tex,a); + s.dim.y = Interval(0,y); + return s; +} diff --git a/lily/meter-reg.cc b/lily/meter-reg.cc index c4ef7b9bb1..338ea7e10f 100644 --- a/lily/meter-reg.cc +++ b/lily/meter-reg.cc @@ -41,7 +41,7 @@ Meter_register::process_requests() } if (meter_p_) - announce_element(Staff_elem_info(meter_p_, meter_req_l_) ); + announce_element(Score_elem_info(meter_p_, meter_req_l_) ); } void diff --git a/lily/note-column-reg.cc b/lily/note-column-reg.cc index cb8129d5bc..feee0c66b5 100644 --- a/lily/note-column-reg.cc +++ b/lily/note-column-reg.cc @@ -14,7 +14,7 @@ #include "rest-column.hh" bool -Note_column_register::acceptable_elem_b(Staff_elem const*elem_C)const +Note_column_register::acceptable_elem_b(Score_elem const*elem_C)const { char const*nC = elem_C->name(); return (nC == Script::static_name() || nC == Notehead::static_name() @@ -25,7 +25,7 @@ Note_column_register::note_col_l() { if (!ncol_p_){ ncol_p_ = new Note_column; - announce_element(Staff_elem_info(ncol_p_, 0)); + announce_element(Score_elem_info(ncol_p_, 0)); } return ncol_p_; } @@ -35,13 +35,13 @@ Note_column_register::rest_col_l() { if (!restcol_p_) { restcol_p_ = new Rest_column; - announce_element(Staff_elem_info(restcol_p_,0)); + announce_element(Score_elem_info(restcol_p_,0)); } return restcol_p_; } void -Note_column_register::acknowledge_element(Staff_elem_info i) +Note_column_register::acknowledge_element(Score_elem_info i) { if (!acceptable_elem_b(i.elem_l_)) return; @@ -50,16 +50,16 @@ Note_column_register::acknowledge_element(Staff_elem_info i) char const*nC = i.elem_l_->name(); if (nC == Script::static_name()) { - script_l_arr_.push((Script*)i.elem_l_); + script_l_arr_.push((Script*)i.elem_l_->item()); } else if (nC == Notehead::static_name()) { - Notehead * h_l = (Notehead*)i.elem_l_; + Notehead * h_l = (Notehead*)i.elem_l_->item(); if (h_l->rest_b_) rest_col_l()->add(h_l); else note_col_l()->add(h_l); } else if (nC == Stem::static_name()){ - stem_l_ = (Stem*)i.elem_l_; + stem_l_ = (Stem*)i.elem_l_->item(); } } diff --git a/lily/pulk-voices.cc b/lily/pulk-voices.cc index f2c26cbe25..b4127af90c 100644 --- a/lily/pulk-voices.cc +++ b/lily/pulk-voices.cc @@ -31,10 +31,11 @@ Pulk_voices::Pulk_voices(Link_list<Staff*> const& l) last_ = last_ >? staff_last; } next_mom_ = voice_pq_.front().l_->start_; - + time_arr_.set_size(staff_i); if (last_ != min_staff_last_mom) warning("Not all staffs end simultaneously"); + } void @@ -46,7 +47,11 @@ Pulk_voices::get_aligned_request(Request_column* col_l) } /* hairy. #i# is a cursor which points to Pulk_voice (which a - cursor, essentially) */ + cursor, essentially) + + + At the same time bookkeeping of measures is done. + */ Moment new_next_mom = last_; iter(pulk_p_list_.top() , i); @@ -55,18 +60,35 @@ Pulk_voices::get_aligned_request(Request_column* col_l) assert (i->when() >= next_mom_); if (i->when() == next_mom_) { col_l->add_reqs(i->staff_idx_, i->get_req_l_arr() ); + Time_description &t_r = time_arr_[i->staff_idx_]; + col_l->update_time(i->staff_idx_, t_r); + + if (! t_r.cadenza_b_ && t_r.next_bar_moment() > next_mom_) { + mtor << "next bar at: " << t_r.next_bar_moment(); + new_next_mom = new_next_mom <? t_r.next_bar_moment(); + } if (!i->ok()) { i.del(); continue; } } + assert( i->when() > next_mom_); + /* no need to call i->next(), since this is done automatically */ new_next_mom = new_next_mom <? i->when(); - i++; + + i++; + } if (voice_pq_.size() ) new_next_mom = new_next_mom <? voice_pq_.front().l_->start_; + + for (int j=0; j < time_arr_.size(); j++) + time_arr_[j].add( new_next_mom - next_mom_ ); + + if (pulk_p_list_.size()) + assert( new_next_mom > next_mom_); next_mom_ = new_next_mom; } @@ -77,8 +99,23 @@ Pulk_voices::ok() const return pulk_p_list_.size() || voice_pq_.size(); } -int compare(Voice_l const& v1, Voice_l const& v2) +int +compare(Voice_l const& v1, Voice_l const& v2) { return sign(v1.l_->start_ - v2.l_->start_); } +Moment +Pulk_voices::next_mom()const +{ + return next_mom_; +} + +bool +Pulk_voices::time_checks_failed_b()const +{ + bool b = false; + for (int i=0; !b && i < time_arr_.size(); i++) + b|=time_arr_[i].error_b_; + return b; +} diff --git a/lily/register-group.cc b/lily/register-group.cc index 6e516df21b..e80afd48e1 100644 --- a/lily/register-group.cc +++ b/lily/register-group.cc @@ -77,7 +77,7 @@ Register_group_register::post_move_processing() } void -Register_group_register::acknowledge_element(Staff_elem_info info) +Register_group_register::acknowledge_element(Score_elem_info info) { Request_register* origin = info.origin_reg_l_arr_[0]; if (!contains_b(origin) && !origin->contains_b(this)) // am i sure? diff --git a/lily/register.cc b/lily/register.cc index 08c3feaa00..7710ddf87d 100644 --- a/lily/register.cc +++ b/lily/register.cc @@ -34,14 +34,14 @@ Request_register::Request_register() } void -Request_register::announce_element(Staff_elem_info i) +Request_register::announce_element(Score_elem_info i) { i.origin_reg_l_arr_.push(this); daddy_reg_l_->announce_element(i); } void -Request_register::typeset_element(Staff_elem*p) +Request_register::typeset_element(Score_elem*p) { daddy_reg_l_->typeset_element(p); } diff --git a/lily/request-column.cc b/lily/request-column.cc index 9b896cf8f3..2913dae13b 100644 --- a/lily/request-column.cc +++ b/lily/request-column.cc @@ -56,3 +56,8 @@ Request_column::used_b() const b |= command_column_l_->used_b(); return b; } +void +Request_column::update_time(int idx, Time_description&t) +{ + staff_col_l_arr_[idx]->update_time(t, 0); +} diff --git a/lily/rest-collision-reg.cc b/lily/rest-collision-reg.cc index b5a286f284..a9ca851cd4 100644 --- a/lily/rest-collision-reg.cc +++ b/lily/rest-collision-reg.cc @@ -13,16 +13,16 @@ #include "note-column.hh" void -Rest_collision_register::acknowledge_element(Staff_elem_info i) +Rest_collision_register::acknowledge_element(Score_elem_info i) { char const * nC = i.elem_l_->name(); if (nC == Collision::static_name()) { - collision_l_arr_.push((Collision*)i.elem_l_); + collision_l_arr_.push((Collision*)i.elem_l_->item()); } else if (nC == Rest_column ::static_name()) { if (!rest_collision_p_) rest_collision_p_ = new Rest_collision; - rest_collision_p_->add((Rest_column*)i.elem_l_); + rest_collision_p_->add((Rest_column*)i.elem_l_->item()); } } diff --git a/lily/score.cc b/lily/score.cc index 8ec3049f48..e04f20468c 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -36,8 +36,11 @@ Score::setup_music() input_.error("Need to have music in a score."); } + Moment previous_mom = -1; while (pulk.ok()) { + Moment w= pulk.next_mom(); + assert(w > previous_mom); Request_column* rcol_p = new Request_column( staffs_ ); Score_column* c1 = new Score_column(w); @@ -54,7 +57,10 @@ Score::setup_music() rcol_p->set_score_cols(c1, c2); rcols_.bottom().add(rcol_p); pulk.get_aligned_request( rcol_p ); + previous_mom =w; } + + errorlevel_i_ |= pulk.time_checks_failed_b(); } void @@ -80,7 +86,11 @@ Score::paper() { if (!paper_p_) return; - + if( errorlevel_i_){ + // should we? hampers debugging. + warning("Errors found, /*not processing score*/"); +// return; + } pscore_p_ = new PScore(paper_p_); do_cols(); diff --git a/lily/script-reg.cc b/lily/script-reg.cc index b68298d5de..be12028c17 100644 --- a/lily/script-reg.cc +++ b/lily/script-reg.cc @@ -38,28 +38,28 @@ Script_register::process_requests() Script_req* l=script_req_l_arr_[i]; Script *p =new Script( l); script_p_arr_.push(p); - announce_element(Staff_elem_info(p, l)); + announce_element(Score_elem_info(p, l)); } } bool -Script_register::acceptable_elem_b(Staff_elem*s_l) +Script_register::acceptable_elem_b(Score_elem*s_l) { char const *nC = s_l->name(); return (nC == Stem::static_name()); } void -Script_register::acknowledge_element(Staff_elem_info info) +Script_register::acknowledge_element(Score_elem_info info) { - Staff_elem *elem_l = info.elem_l_; + Score_elem *elem_l = info.elem_l_; if (!acceptable_elem_b(elem_l)) return; for (int i=0; i < script_p_arr_.size(); i++) { Script*script_l = script_p_arr_[i]; if (elem_l->name() == Stem::static_name()) - script_l->set_stem((Stem*)elem_l); + script_l->set_stem((Stem*)elem_l->item()); } } diff --git a/lily/slur-reg.cc b/lily/slur-reg.cc index 20a3c5415e..d08488e371 100644 --- a/lily/slur-reg.cc +++ b/lily/slur-reg.cc @@ -30,10 +30,10 @@ Slur_register::try_request(Request *req_l) } void -Slur_register::acknowledge_element(Staff_elem_info info) +Slur_register::acknowledge_element(Score_elem_info info) { if (info.elem_l_->name() == Note_column::static_name()) { - Note_column *col_l =(Note_column*) info.elem_l_ ;// ugh + Note_column *col_l =(Note_column*) info.elem_l_->item() ;// ugh for (int i = 0; i < slur_l_stack_.size(); i++) slur_l_stack_[i]->add(col_l ); for (int i = 0; i < end_slur_l_arr_.size(); i++) @@ -76,7 +76,7 @@ Slur_register::process_requests() Slur * s_p =new Slur; requests_arr_.push(slur_req_l); start_slur_l_arr_.push(s_p); - announce_element(Staff_elem_info(s_p, slur_req_l)); + announce_element(Score_elem_info(s_p, slur_req_l)); } } for (int i=0; i < start_slur_l_arr_.size(); i++) diff --git a/lily/slur.cc b/lily/slur.cc index 1b7bb0f76a..1fa1ad2885 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -75,11 +75,11 @@ Slur::do_post_processing() set_default_dir(); Real inter_f = paper()->internote(); if (encompass_arr_[0]->stem_l_) - left_pos_i_ = encompass_arr_[0]->stem_l_->height()[dir_i_]/inter_f; + left_pos_i_ = rint(encompass_arr_[0]->stem_l_->height()[dir_i_]/inter_f); else left_pos_i_ = 0; if (encompass_arr_.top()->stem_l_) - right_pos_i_ = encompass_arr_.top()->stem_l_->height()[dir_i_]/inter_f; + right_pos_i_ = rint(encompass_arr_.top()->stem_l_->height()[dir_i_]/inter_f); else right_pos_i_ = 0; diff --git a/lily/spanner.cc b/lily/spanner.cc index 2df030dd5b..53d7bca6b1 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -19,7 +19,7 @@ Spanner::broken_at(PCol*c1, PCol *c2)const for (int i=0; i < dependant_l_arr_.size(); i++) { dependant_l_arr_[i]-> - substitute_dependency((Staff_elem*)this, span_p); + substitute_dependency((Score_elem*)this, span_p); } span_p->left_col_l_ = c1; diff --git a/lily/staff-column.cc b/lily/staff-column.cc index 31454230ce..bfff878ea8 100644 --- a/lily/staff-column.cc +++ b/lily/staff-column.cc @@ -19,6 +19,7 @@ #include "item.hh" #include "p-col.hh" #include "request-column.hh" +#include "grouping.hh" void Staff_column::OK() const @@ -182,3 +183,52 @@ Staff_column::musical_column_l() { return req_col_l_->musical_column_l_; } + +void +Staff_column::update_time(Time_description &time_, + Rhythmic_grouping *default_grouping) +{ + // first all meter changes + for (int i=0; i < timing_req_l_arr_.size(); i++) { + Timing_req * tr_l = timing_req_l_arr_[i]; + if (tr_l->meterchange()) { + int b_i=tr_l->meterchange()->beats_i_; + int o_i = tr_l->meterchange()->one_beat_i_; + if (! time_.allow_meter_change_b() ) + tr_l->warning("Meter change not allowed here"); + else{ + time_.set_meter(b_i, o_i); + if (default_grouping) + *default_grouping = + Rhythmic_grouping(MInterval(0,Moment(b_i, o_i)), b_i); + } + } + } + + // then do the rest + for (int i=0; i < timing_req_l_arr_.size(); i++) { + Timing_req * tr_l = timing_req_l_arr_[i]; + if (tr_l->partial()) { + Moment m = tr_l->partial()->duration_; + String error = time_.try_set_partial_str(m); + if (error != "") { + tr_l->warning(error); + } else + time_.setpartial(m); + } else if (tr_l->barcheck() && time_.whole_in_measure_) { + tr_l ->warning( "Barcheck failed"); + + time_.whole_in_measure_ = 0; // resync + time_.error_b_ = true; + } else if (tr_l->cadenza()) { + time_.set_cadenza(tr_l->cadenza()->on_b_); + } else if (tr_l->measuregrouping()) { + if (default_grouping) + *default_grouping = parse_grouping( + tr_l->measuregrouping()->beat_i_arr_, + tr_l->measuregrouping()->elt_length_arr_); + } + } + time_.OK(); +} + diff --git a/lily/staff-elem-info.cc b/lily/staff-elem-info.cc index 0bef384db6..669c0244ce 100644 --- a/lily/staff-elem-info.cc +++ b/lily/staff-elem-info.cc @@ -1,5 +1,5 @@ /* - staff-elem-info.cc -- implement Staff_elem_info + staff-elem-info.cc -- implement Score_elem_info source file of the LilyPond music typesetter @@ -9,14 +9,14 @@ #include "staff-elem-info.hh" #include "request.hh" -Staff_elem_info::Staff_elem_info(Staff_elem*s_l, Request*r_l) +Score_elem_info::Score_elem_info(Score_elem*s_l, Request*r_l) { elem_l_ = s_l; voice_l_ = (r_l)?r_l->voice_l():0; req_l_ = r_l; } -Staff_elem_info::Staff_elem_info() +Score_elem_info::Score_elem_info() { elem_l_ = 0; voice_l_ = 0; diff --git a/lily/staff-elem.cc b/lily/staff-elem.cc index 331ffbe92f..ec4f851922 100644 --- a/lily/staff-elem.cc +++ b/lily/staff-elem.cc @@ -1,5 +1,5 @@ /* - staff-elem.cc -- implement Staff_elem + staff-elem.cc -- implement Score_elem source file of the LilyPond music typesetter @@ -16,14 +16,14 @@ #include "debug.hh" String -Staff_elem::TeXstring() const +Score_elem::TeXstring() const { Molecule m(*output); m.translate(offset_); // ugh? return m.TeXstring(); } -Staff_elem::Staff_elem(Staff_elem const&s) +Score_elem::Score_elem(Score_elem const&s) :dependancy_l_arr_(s.dependancy_l_arr_), dependant_l_arr_(s.dependant_l_arr_) { @@ -38,7 +38,7 @@ Staff_elem::Staff_elem(Staff_elem const&s) TODO: If deleted, then remove dependant_l_arr_ depency! */ -Staff_elem::~Staff_elem() +Score_elem::~Score_elem() { assert(status < DELETED); delete output; @@ -47,13 +47,13 @@ Staff_elem::~Staff_elem() } void -Staff_elem::translate(Offset O) +Score_elem::translate(Offset O) { offset_ += O; } Interval -Staff_elem::do_width() const +Score_elem::do_width() const { Interval r; @@ -67,7 +67,7 @@ Staff_elem::do_width() const } Interval -Staff_elem::width() const +Score_elem::width() const { Interval r=do_width(); @@ -77,7 +77,7 @@ Staff_elem::width() const return r; } Interval -Staff_elem::do_height() const +Score_elem::do_height() const { Interval r; if (!output){ @@ -90,7 +90,7 @@ Staff_elem::do_height() const } Interval -Staff_elem::height() const +Score_elem::height() const { Interval r=do_height(); @@ -102,7 +102,7 @@ Staff_elem::height() const } void -Staff_elem::print()const +Score_elem::print()const { #ifndef NPRINT mtor << name() << "{\n"; @@ -116,7 +116,7 @@ Staff_elem::print()const -Staff_elem::Staff_elem() +Score_elem::Score_elem() { pstaff_l_=0; offset_ = Offset(0,0); @@ -126,14 +126,14 @@ Staff_elem::Staff_elem() Paper_def* -Staff_elem::paper() const +Score_elem::paper() const { assert(pstaff_l_); return pstaff_l_->pscore_l_->paper_l_; } void -Staff_elem::add_processing() +Score_elem::add_processing() { if (status >= VIRGIN) return; @@ -142,7 +142,7 @@ Staff_elem::add_processing() } void -Staff_elem::pre_processing() +Score_elem::pre_processing() { if (status >= PRECALCED ) return; @@ -158,7 +158,7 @@ Staff_elem::pre_processing() status = PRECALCED; } void -Staff_elem::post_processing() +Score_elem::post_processing() { if (status >= POSTCALCED) return; @@ -173,7 +173,7 @@ Staff_elem::post_processing() } void -Staff_elem::molecule_processing() +Score_elem::molecule_processing() { if (status >= OUTPUT) return; @@ -186,22 +186,26 @@ Staff_elem::molecule_processing() } void -Staff_elem::do_post_processing() +Score_elem::do_post_processing() { } void -Staff_elem::do_pre_processing() +Score_elem::do_pre_processing() +{ +} +void +Score_elem::do_verticalcing() { } void -Staff_elem::do_add_processing() +Score_elem::do_add_processing() { } void -Staff_elem::substitute_dependency(Staff_elem * old, Staff_elem * newdep) +Score_elem::substitute_dependency(Score_elem * old, Score_elem * newdep) { bool hebbes_b=false; for (int i=0; i < dependancy_l_arr_.size(); i++) { @@ -217,7 +221,7 @@ Staff_elem::substitute_dependency(Staff_elem * old, Staff_elem * newdep) } void -Staff_elem::add_dependency(Staff_elem * p) +Score_elem::add_dependency(Score_elem * p) { for (int i=0; i < dependancy_l_arr_.size(); i ++) if (dependancy_l_arr_[i] == p) @@ -226,16 +230,16 @@ Staff_elem::add_dependency(Staff_elem * p) dependancy_l_arr_.push(p); p->dependant_l_arr_.push(p); } -IMPLEMENT_STATIC_NAME(Staff_elem); +IMPLEMENT_STATIC_NAME(Score_elem); Molecule* -Staff_elem::brew_molecule_p()const +Score_elem::brew_molecule_p()const { Atom a(paper()->lookup_l()->fill(Box(Interval(0,0), Interval(0,0)))); return new Molecule (a); } Offset -Staff_elem::offset() const +Score_elem::offset() const { return offset_; } diff --git a/lily/staff-regs.cc b/lily/staff-regs.cc index b6dc1165b7..7a0abadd96 100644 --- a/lily/staff-regs.cc +++ b/lily/staff-regs.cc @@ -121,9 +121,9 @@ Staff_registers::acceptable_request_b(Request*r)const } void -Staff_registers::acknowledge_element(Staff_elem_info i) +Staff_registers::acknowledge_element(Score_elem_info i) { Register_group_register::acknowledge_element(i); if ( i.elem_l_->name() == Staff_symbol::static_name()) - staff_sym_l_ = (Staff_symbol*)i.elem_l_; + staff_sym_l_ = (Staff_symbol*)i.elem_l_->item(); } diff --git a/lily/staff-side.cc b/lily/staff-side.cc index 29c584822f..1435f5daa9 100644 --- a/lily/staff-side.cc +++ b/lily/staff-side.cc @@ -17,7 +17,7 @@ Staff_side::set_staffsym(Staff_symbol* s_l) staff_sym_l_ = s_l; } -Staff_side::Staff_side(Staff_elem * elem_l) +Staff_side::Staff_side(Score_elem * elem_l) { inter_f_ = 2 PT; staff_size_i_ = 0; @@ -51,7 +51,7 @@ Staff_side::support_height() const } void -Staff_side::add_support(Staff_elem*i) +Staff_side::add_support(Score_elem*i) { support_l_arr_.push(i); elem_l_->add_dependency(i); diff --git a/lily/staff-sym-reg.cc b/lily/staff-sym-reg.cc index 60be9b0814..e8863369ac 100644 --- a/lily/staff-sym-reg.cc +++ b/lily/staff-sym-reg.cc @@ -35,7 +35,7 @@ Staff_sym_register::post_move_processing() void Staff_sym_register::process_requests() { - announce_element(Staff_elem_info(span_p_, 0)); + announce_element(Score_elem_info(span_p_, 0)); } void diff --git a/lily/staff-walker.cc b/lily/staff-walker.cc index 97080b8949..ca6cbf500f 100644 --- a/lily/staff-walker.cc +++ b/lily/staff-walker.cc @@ -48,48 +48,10 @@ Staff_walker::when() const return ptr()->when(); } - void Staff_walker::process_timing_reqs() { - // first all meter changes - for (int i=0; i < ptr()->timing_req_l_arr_.size(); i++) { - Timing_req * tr_l = ptr()->timing_req_l_arr_[i]; - if (tr_l->meterchange()) { - int b_i=tr_l->meterchange()->beats_i_; - int o_i = tr_l->meterchange()->one_beat_i_; - if (! time_.allow_meter_change_b() ) - - tr_l->warning("Meterchange should be at start of measure"); - else - time_.set_meter(b_i, o_i); - - *default_grouping = Rhythmic_grouping( - MInterval(0,Moment(b_i, o_i)), b_i); - } - } - - // then do the rest - for (int i=0; i < ptr()->timing_req_l_arr_.size(); i++) { - Timing_req * tr_l = ptr()->timing_req_l_arr_[i]; - if (tr_l->partial()) { - Moment m = tr_l->partial()->duration_; - String error = time_.try_set_partial_str(m); - if (error != "") { - tr_l->warning(error); - } else - time_.setpartial(m); - } else if (tr_l->barcheck() && time_.whole_in_measure_) { - tr_l ->warning( "Barcheck failed"); - } else if (tr_l->cadenza()) { - time_.set_cadenza(tr_l->cadenza()->on_b_); - } else if (tr_l->measuregrouping()) { - *default_grouping = parse_grouping( - tr_l->measuregrouping()->beat_i_arr_, - tr_l->measuregrouping()->elt_length_arr_); - } - } - time_.OK(); + ptr()->update_time(time_, default_grouping); } void diff --git a/lily/stem-beam-reg.cc b/lily/stem-beam-reg.cc index 95f8979803..6304020500 100644 --- a/lily/stem-beam-reg.cc +++ b/lily/stem-beam-reg.cc @@ -97,19 +97,19 @@ Stem_beam_register::process_requests() stem_p_->print_flag_b_ = true; } - announce_element(Staff_elem_info(stem_p_, stem_req_l_)); + announce_element(Score_elem_info(stem_p_, stem_req_l_)); } } void -Stem_beam_register::acknowledge_element(Staff_elem_info info) +Stem_beam_register::acknowledge_element(Score_elem_info info) { if (!stem_p_) return; if (info.elem_l_->name() == Notehead::static_name() && stem_req_l_->duration() == info.req_l_->rhythmic()->duration()){ - Notehead * n_l= (Notehead*)info.elem_l_; + Notehead * n_l= (Notehead*)info.elem_l_->item(); stem_p_->add(n_l); } } diff --git a/lily/stem.cc b/lily/stem.cc index 7fb36e3005..7c57aa80e6 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -203,7 +203,7 @@ Stem::brew_molecule_p()const { Molecule *out =0; if ( invisible_b() ) - return Staff_elem::brew_molecule_p(); + return Score_elem::brew_molecule_p(); Real bot = stem_bottom_f_; Real top = stem_top_f_; diff --git a/lily/template1.cc b/lily/template1.cc index 23c68dd011..0e1b7258b9 100644 --- a/lily/template1.cc +++ b/lily/template1.cc @@ -7,6 +7,7 @@ #include "spanner.hh" #include "scoreline.hh" #include "staffline.hh" +#include "vertical-spanner.hh" #include "pcursor.tcc" #include "plist.tcc" @@ -19,6 +20,7 @@ IPLC_instantiate(Line_of_score); IPLC_instantiate(Line_of_staff); IPLC_instantiate(Item); IPLC_instantiate(Spanner); +IPLC_instantiate(Vertical_spanner); IPLC_instantiate(PStaff); IPLC_instantiate(Idealspacing); IPLC_instantiate(PCol); diff --git a/lily/text-reg.cc b/lily/text-reg.cc index a3231cec41..afbf035d22 100644 --- a/lily/text-reg.cc +++ b/lily/text-reg.cc @@ -29,7 +29,7 @@ Text_register::try_request(Request*req_l) return true; } void -Text_register::acknowledge_element(Staff_elem_info i) +Text_register::acknowledge_element(Score_elem_info i) { if (text_p_ && i.elem_l_->name() == Note_column::static_name()) { text_p_->add_support(i.elem_l_); @@ -40,7 +40,7 @@ Text_register::process_requests() { if (text_req_l_) { text_p_ = new Text_item(text_req_l_->tdef_p_, text_req_l_->dir_i_); // ugh - announce_element(Staff_elem_info(text_p_, text_req_l_)); + announce_element(Score_elem_info(text_p_, text_req_l_)); } } void diff --git a/lily/tie-reg.cc b/lily/tie-reg.cc index c1c5b0bc83..3d75818870 100644 --- a/lily/tie-reg.cc +++ b/lily/tie-reg.cc @@ -71,19 +71,19 @@ Tie_register::process_requests() } void -Tie_register::acknowledge_element(Staff_elem_info i) +Tie_register::acknowledge_element(Score_elem_info i) { if (i.elem_l_->name() == Notehead::static_name()) { if (tie_p_) { - tie_p_->set_head(-1, (Notehead*)i.elem_l_); + tie_p_->set_head(-1, (Notehead*)i.elem_l_->item()); melodic_req_l_ = i.req_l_->musical()->melodic(); } if (end_tie_p_) { - end_tie_p_->set_head(1, (Notehead*)i.elem_l_); + end_tie_p_->set_head(1, (Notehead*)i.elem_l_->item()); if (!Melodic_req::compare ( *end_melodic_req_l_, *melodic_req_l_)) end_tie_p_->same_pitch_b_ = true; - announce_element(Staff_elem_info(end_tie_p_,end_req_l_)); + announce_element(Score_elem_info(end_tie_p_,end_req_l_)); } } } diff --git a/lily/time-description.cc b/lily/time-description.cc index e6945ba482..c56a0375d0 100644 --- a/lily/time-description.cc +++ b/lily/time-description.cc @@ -55,6 +55,7 @@ Time_description::set_cadenza(bool b) Time_description::Time_description() { + error_b_ = false; whole_per_measure_ = 1; whole_in_measure_ =0; one_beat_ = Moment(1,4); @@ -112,7 +113,7 @@ Time_description::setpartial(Moment p) } Moment -Time_description::barleft() +Time_description::barleft()const { assert(!cadenza_b_); return whole_per_measure_-whole_in_measure_; @@ -132,3 +133,10 @@ Time_description::compare(Time_description const &t1, Time_description const&t2 return i; } + +Moment +Time_description::next_bar_moment() const +{ + return when_ + barleft(); +} + diff --git a/lily/vertical-brace.cc b/lily/vertical-brace.cc new file mode 100644 index 0000000000..0bd59e7768 --- /dev/null +++ b/lily/vertical-brace.cc @@ -0,0 +1,9 @@ +/* + vertical-brace.cc -- implement + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl> +*/ + +#include "vertical-brace.hh" diff --git a/lily/vertical-spanner.cc b/lily/vertical-spanner.cc new file mode 100644 index 0000000000..bea6834c19 --- /dev/null +++ b/lily/vertical-spanner.cc @@ -0,0 +1,17 @@ +/* + vertical-spanner.cc -- implement Vertical_spanner + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl> +*/ + +#include "vertical-spanner.hh" + +Vertical_spanner::Vertical_spanner() +{ + upper_pstaff_l_ = lower_pstaff_l_ = 0; +} + +IMPLEMENT_STATIC_NAME(Vertical_spanner); + diff --git a/lily/voice-regs.cc b/lily/voice-regs.cc index 7545442c6e..77fd724552 100644 --- a/lily/voice-regs.cc +++ b/lily/voice-regs.cc @@ -25,7 +25,7 @@ Voice_registers::Voice_registers(Voice *v_p, Input_register const*ireg_C) } void -Voice_registers::acknowledge_element(Staff_elem_info i) +Voice_registers::acknowledge_element(Score_elem_info i) { if (i.voice_l_ != voice_l_) return; diff --git a/lily/walk-regs.cc b/lily/walk-regs.cc index da852c79ac..404500dcee 100644 --- a/lily/walk-regs.cc +++ b/lily/walk-regs.cc @@ -28,7 +28,7 @@ Walker_registers::Walker_registers(Complex_walker *w) } void -Walker_registers::announce_element(Staff_elem_info info) +Walker_registers::announce_element(Score_elem_info info) { if (info.elem_l_->name() == Bar::static_name()) { walk_l_->allow_break(); @@ -37,7 +37,7 @@ Walker_registers::announce_element(Staff_elem_info info) } void -Walker_registers::acknowledge_element(Staff_elem_info ) +Walker_registers::acknowledge_element(Score_elem_info ) { assert(false); } @@ -47,7 +47,7 @@ Walker_registers::do_announces() { Request dummy_req; for (int i = 0; i < announce_info_arr_.size(); i++){ - Staff_elem_info info = announce_info_arr_[i]; + Score_elem_info info = announce_info_arr_[i]; mtor << "Announcing " << info.elem_l_->name()<<"\n"; if (!info.req_l_) @@ -58,13 +58,13 @@ Walker_registers::do_announces() } void -Walker_registers::typeset_element(Staff_elem *elem_p) +Walker_registers::typeset_element(Score_elem *elem_p) { typeset_musical_item(elem_p); } void -Walker_registers::typeset_musical_item(Staff_elem * elem_p) +Walker_registers::typeset_musical_item(Score_elem * elem_p) { walk_l_->typeset_element(elem_p); } diff --git a/make/Targets.make b/make/Targets.make index 52f0f96e6a..0a5a87b613 100644 --- a/make/Targets.make +++ b/make/Targets.make @@ -29,7 +29,7 @@ include ./$(depth)/make/out/Site.make # dependency list of executable: # -EXECUTABLE = $(lily_bindir)/$(NAME) + $(EXECUTABLE): $(build) $(OFILES) $(MAKE) $(MODULE_LIBDEPS) $(INCREASE_BUILD) @@ -64,14 +64,19 @@ $(SHAREDLIBRARY): $(build) $(OFILES) $(MODULE_LIBDEPS) lib: $(LIBRARY) # TOCLEAN= $(allobs) $(alldeps) + +# be careful about deletion. clean: localclean + rm -f core +ifdef EXECUTABLE + rm -f $(EXECUTABLE) +endif ifdef allobs rm -f $(allobs) endif ifdef alldeps rm -f $(alldeps) endif - rm -f core ifdef SUBDIRS set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done endif @@ -222,3 +227,9 @@ rpm: rpm -ba $(makeout)/lilypond.spec # +installexe: + $(INSTALL) -d $(bindir) + $(INSTALL) -m 755 $(EXECUTABLES) $(bindir) + +uninstallexe: + for a in $(EXECUTABLES); do rm -f $(bindir)/`basename $a`; done diff --git a/make/Toplevel.make.in b/make/Toplevel.make.in index 346b2898ce..b4949cdb0f 100644 --- a/make/Toplevel.make.in +++ b/make/Toplevel.make.in @@ -1,13 +1,5 @@ # -*-Makefile-*- ######################################################## -# -# WARNING!WARNING!WARNING!WARNING!WARNING!WARNING! -# -# DO NOT EDIT! -# -# -# @configure_input@ -######################################################## # project LilyPond -- the musical typesetter # title top level makefile for LilyPond # file Makefile @@ -67,12 +59,11 @@ localdistclean: localclean: - rm -f $(allexe) core config.cache config.log config.status + rm -f core config.cache config.log config.status rm -f $(outdir)/*.{class,html,gif} -localinstall: all - $(INSTALL) -d $(bindir) - $(INSTALL) -m 755 $(allexe) $(bindir) +Makefile: make/Toplevel.make.in + echo '# WARNING WARNING WARNING WARNING' > $@ + echo '# do not edit! this is generated from make/Toplevel.make.in' >> $@ + cat $< >> $@ -localuninstall: - for i in $(allexe); do rm -f $(bindir)/`basename $$i`; done diff --git a/make/Variables.make b/make/Variables.make index 4cc56e118b..9ddf1d5691 100644 --- a/make/Variables.make +++ b/make/Variables.make @@ -95,7 +95,6 @@ DUMMYDEPS=\ # ERROR_LOG = 2> /dev/null SILENT_LOG = 2>&1 > /dev/null -allexe = $(lily_bindir)/lilypond $(lily_bindir)/mi2mu date = $(shell date +%x) allhh := $(shell $(FIND) ./ -name "*.hh" $(ERROR_LOG)) allcc := $(shell $(FIND) ./ -name "*.cc" $(ERROR_LOG)) @@ -170,7 +169,8 @@ DODEP=rm -f $(depfile); DEPENDENCIES_OUTPUT="$(depfile) $(outdir)/$(notdir $@)" # generic target names: # -EXECUTABLE = $(NAME)$(EXE) +EXECUTABLE = $(outdir)/$(NAME)$(EXE) +EXECUTABLES = $(EXECUTABLE) LIB_PREFIX = lib ifndef LIB_SUFFIX diff --git a/make/lilypond.lsm b/make/lilypond.lsm index f3dea72647..b6fee6afc2 100644 --- a/make/lilypond.lsm +++ b/make/lilypond.lsm @@ -2,8 +2,8 @@ Begin3 Title: LilyPond -Version: 0.0.63 -Entered-date: 05/15/97 +Version: 0.0.64 +Entered-date: 05/16/97 Description: LilyPond is a program which converts a music-script (mudela) into TeX output, or MIDI to produce multi-staff scores. Features include multiple meters, clefs, keys, lyrics, versatile input-language, cadenzas @@ -13,7 +13,7 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys) jan@digicash.com (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: pcnov095.win.tue.nl /pub/lilypond/ - 300k lilypond-0.0.63.tar.gz + 300k lilypond-0.0.64.tar.gz Alternate-site: Original-site: Platform: unix/win32, GNU C++ diff --git a/make/lilypond.spec b/make/lilypond.spec index fef4517805..5b6d3b19ce 100644 --- a/make/lilypond.spec +++ b/make/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 0.0.63 +Version: 0.0.64 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.63.tar.gz +Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.64.tar.gz Summary: A preprocessor to make TeX typeset music. URL: http://www.stack.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys <hanwen@stack.nl> diff --git a/mi2mu/Makefile b/mi2mu/Makefile index 1009a20bc4..1afa1ac1f8 100644 --- a/mi2mu/Makefile +++ b/mi2mu/Makefile @@ -50,14 +50,9 @@ MODULE_LIBDEPS=check-flower-deps check-lily-deps MODULE_LIBES=-llily -lflower # -# main target of this module: -# -# MAINTARGET = $(EXECUTABLE) -# MAINTARGET = $(LIBRARY) -MAINTARGET = $(lily_bindir)/$(EXECUTABLE)# huh? -# MAINTARGET = $(libdir)/$(LIBRARY)# huh? -default: $(MAINTARGET) +default: $(EXECUTABLE) + # # generic targets and rules: @@ -82,3 +77,6 @@ DEPFILES = $(wildcard $(depdir)/*.dep) localclean: rm -f $(outdir)/{midi-parser,midi-lexer}.* +localinstall: installexe + +localuninstall: uninstallexe diff --git a/mi2mu/main.cc b/mi2mu/main.cc index 200c96a606..5009b8dd7b 100644 --- a/mi2mu/main.cc +++ b/mi2mu/main.cc @@ -76,18 +76,18 @@ int main( int argc_i, char* argv_sz_a[] ) { Long_option_init long_option_init_a[] = { - 0, "be-blonde", 'b', - 0, "debug", 'd', - 0, "help", 'h', - 0, "no-silly", 'n', - 1, "output", 'o', - 0, "no-plets", 'p', - 0, "quiet", 'q', - 1, "smallest", 's', - 0, "verbose", 'v', - 0, "warranty", 'w', - 0, "no-double-dots", 'x', - 0,0,0 + {0, "be-blonde", 'b'}, + {0, "debug", 'd'}, + {0, "help", 'h'}, + {0, "no-silly", 'n'}, + {1, "output", 'o'}, + {0, "no-plets", 'p'}, + {0, "quiet", 'q'}, + {1, "smallest", 's'}, + {0, "verbose", 'v'}, + {0, "warranty", 'w'}, + {0, "no-double-dots", 'x'}, + {0,0,0} }; Getopt_long getopt_long( argc_i, argv_sz_a, long_option_init_a ); diff --git a/tex/dimen.tex b/tex/dimen.tex index 4ae5e1376c..6eae855c67 100644 --- a/tex/dimen.tex +++ b/tex/dimen.tex @@ -1,4 +1,4 @@ -\font\musicfont=musix16 +\font\musicfont=musixsps \font\slurfont=xslu16 \def\thefont{\musicfont}