From: fred Date: Tue, 22 Oct 1996 22:11:24 +0000 (+0000) Subject: lilypond-0.0.4 X-Git-Tag: release/1.5.59~7037 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ed3815ebdb5238848893c8cbd942c009e23b2c16;p=lilypond.git lilypond-0.0.4 --- diff --git a/Sources.make b/Sources.make index 54ff23ac29..02eac2a6c0 100644 --- a/Sources.make +++ b/Sources.make @@ -1,22 +1,23 @@ hdr= qlp.hh \ linespace.hh qlpsolve.hh\ - cols.hh proto.hh pstaff.hh line.hh\ + pcol.hh proto.hh pstaff.hh line.hh\ const.hh glob.hh molecule.hh boxes.hh pscore.hh item.hh tex.hh\ request.hh voice.hh command.hh staff.hh linestaff.hh \ - tstream.hh mtime.hh rhythmstaf.hh\ + tstream.hh mtime.hh rhythmstaf.hh\ parseconstruct.hh debug.hh globvars.hh keyword.hh\ misc.hh score.hh notename.hh lexer.hh symtable.hh\ - symbol.hh main.hh + symbol.hh main.hh dimen.hh paper.hh lookupsyms.hh\ + sccol.hh stcol.hh scommands.hh -mycc= qlp.cc qlpsolve.cc \ - break.cc linespace.cc molecule.cc line.cc\ - pscore.cc tex.cc item.cc cols.cc staff.cc rhythmstaf.cc\ +mycc= qlp.cc qlpsolve.cc \ + break.cc linespace.cc molecule.cc line.cc\ + pscore.cc tex.cc item.cc pcol.cc staff.cc rhythmstaf.cc\ score.cc note.cc main.cc misc.cc \ symbol.cc request.cc notename.cc voice.cc\ keyword.cc linestaff.cc table.cc command.cc\ warn.cc debug.cc symtable.cc boxes.cc\ pstaff.cc tstream.cc version.cc\ calcideal.cc scores.cc identifier.cc \ + dimen.cc paper.cc lookupsyms.cc scommands.cc\ + sccol.cc stcol.cc\ template1.cc template2.cc template3.cc - - diff --git a/TODO b/TODO new file mode 100644 index 0000000000..3f91b6bbd8 --- /dev/null +++ b/TODO @@ -0,0 +1,7 @@ +bug in BAR. +dot spacing +typeset direction. +beam +stem + + diff --git a/cols.cc b/cols.cc deleted file mode 100644 index 0de683cc55..0000000000 --- a/cols.cc +++ /dev/null @@ -1,82 +0,0 @@ -#include "cols.hh" -#include "pstaff.hh" - -Idealspacing::Idealspacing(const PCol * l,const PCol * r) -{ - space = 0.0; - hooke = 0.0; - left = l; - right = r; -} -void -Idealspacing::OK() const -{ -#ifndef NDEBUG - assert(hooke >= 0 && left && right); -#endif -} - -Interval -PCol::width() const -{ - Interval w; - - for (PCursor ic(its); ic.ok(); ic++) - w.unite(ic->width()); - if (w.empty()) - w.unite(Interval(0,0)); - return w; -} -/****************************************************************/ - -int -PCol::compare(const PCol &c1, const PCol &c2) -{ - assert(false); - return 0 ; -} - -void -PCol::OK () const -{ - if (prebreak || postbreak ) { - assert(breakable); - } -} - -void -PCol::set_breakable() -{ - if (breakable) - return; - - prebreak = new PCol(this); - postbreak = new PCol(this); - breakable = true; - used = true; -} - -PCol::PCol(PCol *parent) { - daddy = parent; - prebreak=0; - postbreak=0; - breakable=false; - line=0; - used = false; -} - -PCol::~PCol() -{ - if (prebreak) - delete prebreak; // no recursion! - if (postbreak) - delete postbreak; -} - -void -PCol::add(const Item *i) -{ - its.bottom().add(i); - used = true; -} - diff --git a/cols.hh b/cols.hh deleted file mode 100644 index e51e2d56c0..0000000000 --- a/cols.hh +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef COLS_HH -#define COLS_HH - -#include "glob.hh" -#include "boxes.hh" -#include "list.hh" -#include "item.hh" - -/// stuff grouped vertically. -struct PCol { - List its; - List stoppers, starters; - - /// Can this be broken? true eg. for bars. - bool breakable; - - /// does this column have items, does it have spacings attached? - bool used; - - /// prebreak is put before end of line. - PCol *prebreak; - /** - if broken here, then (*this) column is discarded, and prebreak - is put at end of line, owned by Col - */ - - /// postbreak at beginning of the new line - PCol *postbreak; - /** \See{prebreak} - */ - PCol *daddy; - /* - if this column is pre or postbreak, then this field points to the parent. - */ - /// if lines are broken then this column is in #line# - const Line_of_score *line; - - /// if lines are broken then this column x-coord #hpos# - Real hpos; - - - /****************************************************************/ - - void add(const Item*i); - - Interval width() const; - ~PCol(); - PCol(PCol * parent); - /// initialize the prebreak and postbreak fields - setup_breaks(); - - /// which col comes first? - static int compare(const PCol &c1, const PCol &c2); - /** - signed compare on columns. - - return < 0 if c1 < c2. - */ - - void OK() const; - void set_breakable(); - -}; -/** - This is a class to address items vertically. It contains the data for: - \begin{itemize} - \item - unbroken score - \item - broken score - \item - the linespacing problem - \end{itemize} - */ - -#include "compare.hh" -instantiate_compare(const PCol &, PCol::compare); - - -/// ideal spacing between two columns -struct Idealspacing { - - /// the ideal distance - Real space; - - /// Hooke's constant: how strong are the "springs" attached to columns - Real hooke; - - /// the two columns - const PCol *left, *right; - - void OK() const ; - Idealspacing(const PCol *left,const PCol *right); -}; - -#endif diff --git a/depend b/depend deleted file mode 100644 index 3c3bccbdb5..0000000000 --- a/depend +++ /dev/null @@ -1,192 +0,0 @@ -qlp.o: qlp.cc debug.hh ../flower/dstream.hh ../flower/string.hh \ - ../flower/stringutil.hh ../flower/assoc.hh ../flower/vray.hh const.hh \ - ../flower/real.hh qlp.hh ../flower/matrix.hh ../flower/vsmat.hh \ - ../flower/vector.hh ../flower/choleski.hh -qlpsolve.o: qlpsolve.cc qlpsolve.hh qlp.hh ../flower/matrix.hh \ - ../flower/vsmat.hh ../flower/vray.hh ../flower/real.hh \ - ../flower/vector.hh const.hh debug.hh ../flower/dstream.hh \ - ../flower/string.hh ../flower/stringutil.hh ../flower/assoc.hh \ - ../flower/choleski.hh -break.o: break.cc linespace.hh glob.hh ../flower/real.hh proto.hh \ - const.hh ../flower/list.hh ../flower/list.inl ../flower/cursor.hh \ - ../flower/link.hh ../flower/link.inl ../flower/cursor.inl \ - ../flower/vray.hh cols.hh boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh ../flower/string.hh ../flower/stringutil.hh \ - item.hh tex.hh ../flower/compare.hh ../flower/matrix.hh \ - ../flower/vsmat.hh ../flower/vector.hh debug.hh ../flower/dstream.hh \ - ../flower/assoc.hh line.hh pstaff.hh pscore.hh -linespace.o: linespace.cc linespace.hh glob.hh ../flower/real.hh \ - proto.hh const.hh ../flower/list.hh ../flower/list.inl \ - ../flower/cursor.hh ../flower/link.hh ../flower/link.inl \ - ../flower/cursor.inl ../flower/vray.hh cols.hh boxes.hh \ - ../flower/textdb.hh ../flower/textstr.hh ../flower/string.hh \ - ../flower/stringutil.hh item.hh tex.hh ../flower/compare.hh \ - ../flower/matrix.hh ../flower/vsmat.hh ../flower/vector.hh debug.hh \ - ../flower/dstream.hh ../flower/assoc.hh qlp.hh ../flower/unionfind.hh -molecule.o: molecule.cc glob.hh ../flower/real.hh proto.hh const.hh \ - ../flower/string.hh ../flower/stringutil.hh molecule.hh \ - ../flower/list.hh ../flower/list.inl ../flower/cursor.hh \ - ../flower/link.hh ../flower/link.inl ../flower/cursor.inl boxes.hh \ - ../flower/textdb.hh ../flower/textstr.hh ../flower/vray.hh item.hh \ - tex.hh symbol.hh -line.o: line.cc line.hh ../flower/real.hh ../flower/list.hh \ - ../flower/list.inl ../flower/cursor.hh ../flower/link.hh \ - ../flower/link.inl ../flower/cursor.inl ../flower/vray.hh glob.hh \ - proto.hh const.hh pstaff.hh item.hh boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh ../flower/string.hh ../flower/stringutil.hh \ - tex.hh symbol.hh cols.hh ../flower/compare.hh pscore.hh -pscore.o: pscore.cc debug.hh ../flower/dstream.hh ../flower/string.hh \ - ../flower/stringutil.hh ../flower/assoc.hh ../flower/vray.hh line.hh \ - ../flower/real.hh ../flower/list.hh ../flower/list.inl \ - ../flower/cursor.hh ../flower/link.hh ../flower/link.inl \ - ../flower/cursor.inl glob.hh proto.hh const.hh pstaff.hh item.hh \ - boxes.hh ../flower/textdb.hh ../flower/textstr.hh tex.hh pscore.hh \ - cols.hh ../flower/compare.hh tstream.hh -tex.o: tex.cc tex.hh ../flower/string.hh ../flower/stringutil.hh \ - boxes.hh ../flower/textdb.hh ../flower/textstr.hh ../flower/vray.hh \ - ../flower/real.hh symbol.hh const.hh -item.o: item.cc line.hh ../flower/real.hh ../flower/list.hh \ - ../flower/list.inl ../flower/cursor.hh ../flower/link.hh \ - ../flower/link.inl ../flower/cursor.inl ../flower/vray.hh glob.hh \ - proto.hh const.hh pstaff.hh item.hh boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh ../flower/string.hh ../flower/stringutil.hh \ - tex.hh symbol.hh cols.hh ../flower/compare.hh -cols.o: cols.cc cols.hh glob.hh ../flower/real.hh proto.hh const.hh \ - boxes.hh ../flower/textdb.hh ../flower/textstr.hh ../flower/string.hh \ - ../flower/stringutil.hh ../flower/vray.hh ../flower/list.hh \ - ../flower/list.inl ../flower/cursor.hh ../flower/link.hh \ - ../flower/link.inl ../flower/cursor.inl item.hh tex.hh \ - ../flower/compare.hh pstaff.hh -staff.o: staff.cc staff.hh score.hh ../flower/vray.hh cols.hh glob.hh \ - ../flower/real.hh proto.hh const.hh boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh ../flower/string.hh ../flower/stringutil.hh \ - ../flower/list.hh ../flower/list.inl ../flower/cursor.hh \ - ../flower/link.hh ../flower/link.inl ../flower/cursor.inl item.hh \ - tex.hh ../flower/compare.hh mtime.hh command.hh voice.hh request.hh \ - debug.hh ../flower/dstream.hh ../flower/assoc.hh pscore.hh pstaff.hh -rhythmstaf.o: rhythmstaf.cc request.hh glob.hh ../flower/real.hh \ - proto.hh const.hh ../flower/string.hh ../flower/stringutil.hh \ - mtime.hh debug.hh ../flower/dstream.hh ../flower/assoc.hh \ - ../flower/vray.hh linestaff.hh pstaff.hh ../flower/list.hh \ - ../flower/list.inl ../flower/cursor.hh ../flower/link.hh \ - ../flower/link.inl ../flower/cursor.inl item.hh boxes.hh \ - ../flower/textdb.hh ../flower/textstr.hh tex.hh staff.hh score.hh \ - cols.hh ../flower/compare.hh command.hh voice.hh pscore.hh \ - molecule.hh rhythmstaf.hh symbol.hh -score.o: score.cc tstream.hh ../flower/string.hh \ - ../flower/stringutil.hh score.hh ../flower/vray.hh cols.hh glob.hh \ - ../flower/real.hh proto.hh const.hh boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh ../flower/list.hh ../flower/list.inl \ - ../flower/cursor.hh ../flower/link.hh ../flower/link.inl \ - ../flower/cursor.inl item.hh tex.hh ../flower/compare.hh mtime.hh \ - command.hh pscore.hh pstaff.hh staff.hh voice.hh request.hh misc.hh \ - debug.hh ../flower/dstream.hh ../flower/assoc.hh -note.o: note.cc ../flower/string.hh ../flower/stringutil.hh \ - ../flower/real.hh debug.hh ../flower/dstream.hh ../flower/assoc.hh \ - ../flower/vray.hh request.hh glob.hh proto.hh const.hh mtime.hh \ - voice.hh ../flower/list.hh ../flower/list.inl ../flower/cursor.hh \ - ../flower/link.hh ../flower/link.inl ../flower/cursor.inl notename.hh -main.o: main.cc ../flower/lgetopt.hh misc.hh mtime.hh \ - ../flower/real.hh ../flower/string.hh ../flower/stringutil.hh main.hh \ - proto.hh -misc.o: misc.cc misc.hh mtime.hh ../flower/real.hh glob.hh proto.hh \ - const.hh -symbol.o: symbol.cc symbol.hh ../flower/string.hh \ - ../flower/stringutil.hh boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh ../flower/vray.hh ../flower/real.hh -request.o: request.cc request.hh glob.hh ../flower/real.hh proto.hh \ - const.hh ../flower/string.hh ../flower/stringutil.hh mtime.hh -notename.o: notename.cc glob.hh ../flower/real.hh proto.hh const.hh \ - ../flower/string.hh ../flower/stringutil.hh -voice.o: voice.cc debug.hh ../flower/dstream.hh ../flower/string.hh \ - ../flower/stringutil.hh ../flower/assoc.hh ../flower/vray.hh voice.hh \ - mtime.hh ../flower/real.hh ../flower/list.hh ../flower/list.inl \ - ../flower/cursor.hh ../flower/link.hh ../flower/link.inl \ - ../flower/cursor.inl request.hh glob.hh proto.hh const.hh -keyword.o: keyword.cc glob.hh ../flower/real.hh proto.hh const.hh \ - lexer.hh -linestaff.o: linestaff.cc linestaff.hh pstaff.hh ../flower/list.hh \ - ../flower/list.inl ../flower/cursor.hh ../flower/link.hh \ - ../flower/link.inl ../flower/cursor.inl item.hh glob.hh \ - ../flower/real.hh proto.hh const.hh boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh ../flower/string.hh ../flower/stringutil.hh \ - ../flower/vray.hh tex.hh symbol.hh -table.o: table.cc glob.hh ../flower/real.hh proto.hh const.hh debug.hh \ - ../flower/dstream.hh ../flower/string.hh ../flower/stringutil.hh \ - ../flower/assoc.hh ../flower/vray.hh keyword.hh parser.hh -command.o: command.cc ../flower/string.hh ../flower/stringutil.hh \ - command.hh glob.hh ../flower/real.hh proto.hh const.hh mtime.hh \ - ../flower/vray.hh -warn.o: warn.cc debug.hh ../flower/dstream.hh ../flower/string.hh \ - ../flower/stringutil.hh ../flower/assoc.hh ../flower/vray.hh -debug.o: debug.cc debug.hh ../flower/dstream.hh ../flower/string.hh \ - ../flower/stringutil.hh ../flower/assoc.hh ../flower/vray.hh \ - ../flower/vector.hh ../flower/real.hh -symtable.o: symtable.cc misc.hh mtime.hh ../flower/real.hh debug.hh \ - ../flower/dstream.hh ../flower/string.hh ../flower/stringutil.hh \ - ../flower/assoc.hh ../flower/vray.hh symbol.hh boxes.hh \ - ../flower/textdb.hh ../flower/textstr.hh symtable.hh const.hh -boxes.o: boxes.cc boxes.hh ../flower/textdb.hh ../flower/textstr.hh \ - ../flower/string.hh ../flower/stringutil.hh ../flower/vray.hh \ - ../flower/real.hh const.hh -pstaff.o: pstaff.cc pstaff.hh ../flower/list.hh ../flower/list.inl \ - ../flower/cursor.hh ../flower/link.hh ../flower/link.inl \ - ../flower/cursor.inl item.hh glob.hh ../flower/real.hh proto.hh \ - const.hh boxes.hh ../flower/textdb.hh ../flower/textstr.hh \ - ../flower/string.hh ../flower/stringutil.hh ../flower/vray.hh tex.hh -tstream.o: tstream.cc tex.hh ../flower/string.hh \ - ../flower/stringutil.hh boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh ../flower/vray.hh ../flower/real.hh misc.hh \ - mtime.hh tstream.hh debug.hh ../flower/dstream.hh ../flower/assoc.hh -version.o: version.cc version.hh -calcideal.o: calcideal.cc tstream.hh ../flower/string.hh \ - ../flower/stringutil.hh score.hh ../flower/vray.hh cols.hh glob.hh \ - ../flower/real.hh proto.hh const.hh boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh ../flower/list.hh ../flower/list.inl \ - ../flower/cursor.hh ../flower/link.hh ../flower/link.inl \ - ../flower/cursor.inl item.hh tex.hh ../flower/compare.hh mtime.hh \ - command.hh pscore.hh pstaff.hh staff.hh voice.hh request.hh misc.hh \ - debug.hh ../flower/dstream.hh ../flower/assoc.hh -scores.o: scores.cc main.hh proto.hh ../flower/real.hh score.hh \ - ../flower/vray.hh cols.hh glob.hh const.hh boxes.hh \ - ../flower/textdb.hh ../flower/textstr.hh ../flower/string.hh \ - ../flower/stringutil.hh ../flower/list.hh ../flower/list.inl \ - ../flower/cursor.hh ../flower/link.hh ../flower/link.inl \ - ../flower/cursor.inl item.hh tex.hh ../flower/compare.hh mtime.hh \ - command.hh -identifier.o: identifier.cc keyword.hh lexer.hh proto.hh \ - ../flower/real.hh parser.hh -template1.o: template1.cc line.hh ../flower/real.hh ../flower/list.hh \ - ../flower/list.inl ../flower/cursor.hh ../flower/link.hh \ - ../flower/link.inl ../flower/cursor.inl ../flower/vray.hh glob.hh \ - proto.hh const.hh pstaff.hh item.hh boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh ../flower/string.hh ../flower/stringutil.hh \ - tex.hh cols.hh ../flower/compare.hh request.hh mtime.hh command.hh \ - ../flower/list.cc ../flower/cursor.cc -template2.o: template2.cc line.hh ../flower/real.hh ../flower/list.hh \ - ../flower/list.inl ../flower/cursor.hh ../flower/link.hh \ - ../flower/link.inl ../flower/cursor.inl ../flower/vray.hh glob.hh \ - proto.hh const.hh pstaff.hh item.hh boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh ../flower/string.hh ../flower/stringutil.hh \ - tex.hh symbol.hh voice.hh mtime.hh request.hh staff.hh score.hh \ - cols.hh ../flower/compare.hh command.hh ../flower/list.cc \ - ../flower/cursor.cc -template3.o: template3.cc request.hh glob.hh ../flower/real.hh \ - proto.hh const.hh ../flower/string.hh ../flower/stringutil.hh \ - mtime.hh command.hh ../flower/vray.hh molecule.hh ../flower/list.hh \ - ../flower/list.inl ../flower/cursor.hh ../flower/link.hh \ - ../flower/link.inl ../flower/cursor.inl boxes.hh ../flower/textdb.hh \ - ../flower/textstr.hh item.hh tex.hh ../flower/list.cc \ - ../flower/cursor.cc -parser.o: parser.cc lexer.hh proto.hh ../flower/real.hh staff.hh \ - score.hh ../flower/vray.hh cols.hh glob.hh const.hh boxes.hh \ - ../flower/textdb.hh ../flower/textstr.hh ../flower/string.hh \ - ../flower/stringutil.hh ../flower/list.hh ../flower/list.inl \ - ../flower/cursor.hh ../flower/link.hh ../flower/link.inl \ - ../flower/cursor.inl item.hh tex.hh ../flower/compare.hh mtime.hh \ - command.hh voice.hh request.hh main.hh keyword.hh debug.hh \ - ../flower/dstream.hh ../flower/assoc.hh parseconstruct.hh -lexer.o: lexer.cc glob.hh ../flower/real.hh proto.hh const.hh \ - ../flower/string.hh ../flower/stringutil.hh lexer.hh keyword.hh \ - ../flower/vray.hh parser.hh debug.hh ../flower/dstream.hh \ - ../flower/assoc.hh diff --git a/lilyponddefs.tex b/lilyponddefs.tex index 46da68d7fb..242a17d5f4 100644 --- a/lilyponddefs.tex +++ b/lilyponddefs.tex @@ -1,5 +1,3 @@ - - \def\musixtwentydefs{ \font\musicfnt=musix20 @@ -8,13 +6,9 @@ %\balkskip4pt } \def\interstaffline{ -% \vskip 20pt% -} -\def\interscoreline{ - \par\vskip 10pt\par - \hrule height 2pt width2cm - \vskip 10pt + \vskip 20pt% } + \musixtwentydefs \def\mdef#1#2{\def#1{{\musicfnt\char#2}}} \mdef\quartball{'007} @@ -32,11 +26,28 @@ \mdef\singledot{'00} \mdef\doubledot{'01} \mdef\tripledot{'02} -\def\maatstreep{\vrule height10pt } -\def\finishbar{\vrule height10pt width 1pt} +\def\maatstreep{\vrule height8pt depth8pt } +\def\finishbar{\vrule height8pt width 1pt depth8pt} \parindent0pt +\def\generalmeter#1#2{\vbox to 0pt{\vss\rm\hbox{#1}\hbox{#2}\vss}} + +\mdef\mussepline{155} +\def\lineseparator{\vbox{\mussepline\vskip -5pt\mussepline}} +\def\interscoreline{ + \par\vskip 10pt\par + \hskip -5pt\lineseparator% \hbox to 1cm{\kern -5mm\hrulefill} + \vskip 10pt +} + +\newcount\n +\def\linestafsym#1#2{\hbox to 0pt{\vbox to 0pt{\n=0% + \loop\ifnum\n<#1\advance\n by1 + \ifnum\n>1\vskip2pt\fi \hrule width#2\repeat\vss}\hss}} + \def\vcenter#1{\vbox to 0pt{\vss #1\vss}} \def\cquartrest{\vcenter\quartrest} - +\def\ceighthrest{\vcenter\eighthrest} +\def\csixteenthrest{\vcenter\sixteenthrest} +\def\cthirtysecondrest{\vcenter\thirtysecondrest} \ No newline at end of file diff --git a/maartje.ly b/maartje.ly index a0711079af..49665efd4d 100644 --- a/maartje.ly +++ b/maartje.ly @@ -7,13 +7,16 @@ score { voice { $ c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 $ } } rhythmstaff { - voice { $ c4 r4 c4 r4 c4 r4 c4 r4 c4 r4 c4 r4 c4 r4 c4 r4 + voice { $ c2.. r8 c4 r4 c4 r4 c4 r4 c4 r4 c4 r4 c4 r4 c4 r4 r2 r4 r1 $ } } -bar 0.5 + bar 2 bar 3 bar 4.5 bar 5 bar 5.5 bar 6 bar 7 bar 8 + + meter 2 4 4 % after bars. + } diff --git a/scommands.cc b/scommands.cc new file mode 100644 index 0000000000..82fe9a1691 --- /dev/null +++ b/scommands.cc @@ -0,0 +1,185 @@ +#include "scommands.hh" +#include "debug.hh" + +/* + maybe it's time for a "narrowing" cursor? + */ +PCursor +Score_commands::first(Real w) +{ + PCursor pc(*this); + while (pc.ok() && pc->when < w) + pc++; + + return pc; +} + +PCursor +Score_commands::last_insertion(Real w) +{ + PCursor pc(*this); + while (pc.ok() && pc->when <= w) + pc++; + return pc; +} + +void +Score_commands::add_seq(svec com) +{ + if (!com.sz()) + return; + Real when = com[0].when; + + PCursor pc(last_insertion(when)); + for (int i = 0; i < com.sz(); i++) { + Command *c = new Command(com[i]); + assert(com[i].when == when); + if (!pc.ok()) + pc.add(c); + else + pc.insert(c); + } +} + +void +Score_commands::set_breakable(Real when) +{ + bool found_typeset(false); + PCursor cc = first(when); + for (; cc.ok() && cc->when == when; cc++) { + if (cc->isbreak()) + return; + if (cc->code == TYPESET) + found_typeset=true; + } + + assert(!found_typeset); + + svec seq; + Command k(when); + k.code = BREAK_PRE; + seq.add(k); + k.code = BREAK_MIDDLE; + seq.add(k); + k.code = BREAK_POST; + seq.add(k); + k.code = BREAK_END; + seq.add(k); + + add_seq(seq); +} +bool +Score_commands::is_breakable(Real w) +{ + PCursor cc = first(w); + for (; cc.ok() && cc->when == w; cc++) { + if (cc->isbreak()) + return true; + } + return false; +} +void +Score_commands::add_command_to_break(Command pre, Command mid,Command post) +{ + Real w = pre.when; + + Command k(w); + + PCursor c ( first(w)); + while (!c->isbreak()) + c++; + c.add(new Command(pre)); + + while (!c->isbreak()) + c++; + c.add(new Command(mid)); + + while (!c->isbreak()) + c++; + c.add(new Command(post)); +} + +void +Score_commands::add(Command c) +{ + bool encapsulate =false; + + Command pre(c.when); + Command mid(c.when); + Command post(c.when); + + + if (c.code == TYPESET) { + if (c.args[0] == "BAR") { + set_breakable(c.when); + encapsulate = true; + mid = c; + pre = c; + } + if (c.args[0] == "METER" && is_breakable(c.when)) { + encapsulate = true; + mid = c; + pre = c; + post =c; + } + } + + if (encapsulate) + add_command_to_break(pre, mid, post); + else { + svec seq; + seq.add(c); + add_seq(seq); + } +} + +/* + first and last column should be breakable. + Remove any command past the last musical column. + */ +void +Score_commands::clean(Real l) +{ + assert(l>0); + if (!is_breakable(0.0)) { + Command c(0.0); + c.code = TYPESET; + c.args.add("BAR"); + c.args.add("empty"); + add(c); + } + + PCursor bot(bottom()); + + while (bot.ok() && bot->when > l) { + + mtor <<"removing "<< bot->code <<" at " << bot->when<<'\n'; + bot.del(); + bot = bottom(); + } + + if (!is_breakable(l)) { + Command c(l); + c.code = TYPESET; + c.args.add("BAR"); + c.args.add("||"); + add(c); + } + OK(); +} + +void +Score_commands::OK() const +{ + for (PCursor cc(*this); cc.ok() && (cc+1).ok(); cc++) { + assert(cc->when <= (cc+1)->when); + } +} + +void +Score_commands::print() const +{ + for (PCursor cc(*this); cc.ok() ; cc++) { + cc->print(); + } +} diff --git a/symbol.ini b/symbol.ini index d00e751dc5..459deb1f67 100644 --- a/symbol.ini +++ b/symbol.ini @@ -1,27 +1,42 @@ # index TeXstring, xmin xmax ymin ymax +# be careful with editing this: +# the "index" entry is hardwired into lilypond. + table balls - 1 \wholeball -5 5 -1 1 - 2 \halfball -5 5 -1 1 - 4 \quartball -5 5 -1 1 + 1 \wholeball -5pt 5pt -1pt 1pt + 2 \halfball -5pt 5pt -1pt 1pt + 4 \quartball -5pt 5pt -1pt 1pt end table bars - empty \emptybar 0 0 0 0 - | \maatstreep 0 1 0 10 - || \finishbar 0 2 0 10 + empty \emptybar 0pt 0pt 0pt 0pt + | \maatstreep 0pt 1pt -8pt 8pt + || \finishbar 0pt 2pt -8pt 8pt end table rests - 1 \wholerest -5 1 -1 1 - 2 \halfrest -5 1 -1 1 - 4 \cquartrest -5 2 -5 5 - 8 \eighthrest -5 1 -1 1 - 16 \sixteenthrest -5 1 -1 1 - 32 \thirtysecondrest -1 1 -1 1 + 1 \wholerest -5pt 1pt -1pt 1pt + 2 \halfrest -5pt 1pt -1pt 1pt + 4 \cquartrest -5pt 2pt -5pt 5pt + 8 \ceighthrest -5pt 1pt -1pt 1pt + 16 \csixteenthrest -5pt 1pt -1pt 1pt + 32 \cthirtysecondrest -1pt 1pt -1pt 1pt end +table meters + C \fourfourmeter 0pt 10pt -5pt 5pt + C2 \allabreve 0pt 10pt -5pt 5pt +end +# dims ignored for this table +table param + meter \generalmeter{%}{%} -3pt 10pt -5pt 5pt + linestaf \linestafsym{%}{%} 0pt 0pt 0pt 0pt +end - - +table dots + 1 \singledot 0pt 4pt -1pt 1pt + 2 \doubledot 0pt 8pt -1pt 1pt + 3 \tripledot 0pt 12pt -1pt 1pt +end