From 86d86173c41d3a4b832ce67768d58c6416c71d4e Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 17 Sep 1997 14:12:47 +0200 Subject: [PATCH] release: 0.1.15 --- Documentation/index.pod | 6 ++ Documentation/other-packages.pod | 15 +++-- NEWS | 14 ++++- TODO | 21 ++++--- VERSION | 4 +- bin/make-website.in | 30 ++++++++- init/table16.ly | 1 - input/coriolan-alto.ly | 78 +++++++++++------------ input/font.ly | 2 +- input/gallina.ly | 4 -- input/scsii-menuetto.ly | 3 + lily/VERSION | 2 +- lily/abbreviation-beam.cc | 2 +- lily/atom.cc | 27 ++++++-- lily/bar.cc | 2 +- lily/beam.cc | 5 +- lily/bow.cc | 6 +- lily/clef-item.cc | 2 +- lily/crescendo.cc | 8 +-- lily/dots.cc | 2 +- lily/dynamic-grav.cc | 6 +- lily/general-script-def.cc | 4 +- lily/gourlay-breaking.cc | 2 - lily/include/atom.hh | 37 +++++++++++ lily/include/crescendo.hh | 2 +- lily/include/lily-proto.hh | 2 +- lily/include/lookup.hh | 53 ++++++++-------- lily/include/musical-request.hh | 10 ++- lily/include/note-head.hh | 1 + lily/include/paper-def.hh | 1 - lily/include/span-bar.hh | 2 +- lily/include/span-score-bar.hh | 2 +- lily/include/stem.hh | 5 +- lily/include/symbol.hh | 47 +------------- lily/include/symtable.hh | 15 +++-- lily/key-item.cc | 31 +++++---- lily/local-key-item.cc | 8 +-- lily/lookup.cc | 104 +++++++++++++++---------------- lily/meter.cc | 2 +- lily/molecule.cc | 2 +- lily/musical-request.cc | 42 ++++++++----- lily/note.cc | 2 +- lily/notehead.cc | 15 ++++- lily/parser.y | 6 +- lily/rest.cc | 2 +- lily/score-elem.cc | 5 -- lily/scoreline.cc | 2 +- lily/script-def.cc | 2 +- lily/span-bar.cc | 9 +-- lily/span-score-bar.cc | 4 +- lily/stem-info.cc | 2 +- lily/stem.cc | 67 ++++++++++++-------- lily/symbol.cc | 21 ------- lily/symtable.cc | 8 +-- lily/template3.cc | 2 +- lily/tex-beam.cc | 32 +++++----- lily/tex-slur.cc | 57 ++++++++--------- lily/tex.cc | 2 +- lily/text-def.cc | 2 +- lily/text-item.cc | 2 +- lily/text-spanner.cc | 2 +- lily/translator-group.cc | 46 +++++++------- make/lilypond.lsm | 8 +-- make/lilypond.spec | 8 +-- make/lilypond.spec.in | 2 +- 65 files changed, 493 insertions(+), 427 deletions(-) create mode 100644 lily/include/atom.hh delete mode 100644 lily/symbol.cc diff --git a/Documentation/index.pod b/Documentation/index.pod index 767db76fe2..c9c213623a 100644 --- a/Documentation/index.pod +++ b/Documentation/index.pod @@ -23,6 +23,12 @@ examples of what LilyPond can do: MIDI, PS, .gif and input. +=head2 NEWS! + +This is what the latest version brings: + +top_of_NEWS + =head2 Documentation: Introduction =over 4 diff --git a/Documentation/other-packages.pod b/Documentation/other-packages.pod index 26b645fe06..49c2e7dbe4 100644 --- a/Documentation/other-packages.pod +++ b/Documentation/other-packages.pod @@ -45,20 +45,23 @@ A Preprocessor for MusiXTeX by Don Simons =item Musictex, http://www.gmd.de/Misc/Music/ MusicTeX is a macro package for TeX to typeset polyphonic or -instrumental music. It was written by Daniel Taupin. Now obsoleted -by MusiXTeX and OpusTeX. +instrumental music. It was originally written by Daniel Taupin. It includes a full-featured set of fonts. =item MusiXTeX, http://www.gmd.de/Misc/Music/ -Newer version of MusicTeX. It also contains contributions by Ross -Mitchell and Andreas Egler. Daniel Taupin's branch still carries this -name. +A rewrite of MusicTeX, originally by Ross Mitchell and Andreas Egler. +After quarrels, MusiXTeX has been split into two branches: + +=item MusiXTeX, http://www.gmd.de/Misc/Music/ + +Daniel Taupin's now maintains the branch that still carries +the name MusiXTeX. =item OpusTeX, http://www.inf.ethz.ch/people/achermann/opustex -Andreas Egler's branch of MusiXTeX. +Andreas Egler's branch is called MusiXTeX. =item ABC2MTeX, http://www.gre.ac.uk/~c.walshaw/abc diff --git a/NEWS b/NEWS index 8f004c6166..0946caab2d 100644 --- a/NEWS +++ b/NEWS @@ -1,10 +1,20 @@ +pl 15 + - put top of NEWS file in the webpage + - breadth first search for engravers. + - bf: coriolan-alto.ly + - Stem / Notehead width now properly calced + - Atom and Symbol merged + pl 14.jcn1 - - lily's own music bolletjes (font-en-tja*.mf) - - {table,paper}* and taupindefs adaptions (when are we moving?) + - lily's own noteheads (balls/globes :) (font-en-tja*.mf) + - {table,paper}* and taupindefs adaptations (when are we moving?) - fp, sf, sfz dynamics - font.ly - bf: dist mudela-mode +******* +sep 15 + pl 14 - Simple but nifty mudela-mode.el for Emacs - slightly better syntax for single-note-repeat, now default kept in diff --git a/TODO b/TODO index 47cd313b81..15869f6f39 100644 --- a/TODO +++ b/TODO @@ -6,8 +6,17 @@ done, or is an idea that I want to think about Most of the items are marked in the code as well, with full explanation. grep for TODO and ugh/ugr + - naming Mozarella, Madeira, Muella, Fontaigna? + - bf: abbrevs over whole note + - scoping for properties + + { \multi 2 < { \stemup .. } { \stemdown .. } > + c2 } + + this modifies \stem for the c2 + * use properties for: - Text_style - default_octave @@ -21,9 +30,9 @@ grep for TODO and ugh/ugr - cadenza mode? - MIDI instrument - staff title - + * check out egcs - + * give Items/Spanners access to unbroken originals 3RD PARTY BUGS: @@ -102,8 +111,8 @@ languages: \score { < \melodic \type Staff { c'4 g'4 } - \lyric { \id "Lyric" ""; hello4 bye4 < a chord > } - \lyric { \id "Lyric" ""; bye4 hello4 } + \lyric { \id "Lyric" ""; hello4 bye4 < a chord > } + \lyric { \id "Lyric" ""; bye4 hello4 } \melodic { \id "Staff" ""; c'4 g'4 } > } @@ -120,7 +129,7 @@ languages: (which is at Voice_gravs level) - make encapsulated spacing problems. - * On-demand loading of simple-engravers + * On-demand loading of simple-engravers? * accidentals per Voice_group @@ -260,8 +269,6 @@ SMALLISH PROJECTS * A range for context errors (eg. mark both { and }. ) - * merge Atom and Symbol - * lyric in staff (sharpsharp in staff, text below) * write Dynamic_line (to group dynamics horizontally) diff --git a/VERSION b/VERSION index 67ef9c7c00..e7f388b506 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 1 -TOPLEVEL_PATCH_LEVEL = 14 +TOPLEVEL_PATCH_LEVEL = 15 # use to send patches, always empty for released version: -TOPLEVEL_MY_PATCH_LEVEL = .jcn1 +TOPLEVEL_MY_PATCH_LEVEL = diff --git a/bin/make-website.in b/bin/make-website.in index 98b49fd31d..7f25e76d9f 100644 --- a/bin/make-website.in +++ b/bin/make-website.in @@ -221,9 +221,35 @@ sub copy_txt_file if (! $f =~ /.txt$/) { $d = "$f.txt"; } - print $f, $d; + print, $d; } +sub top_of_NEWS +{ + open NEWS, "NEWS.txt"; + input_record_separator NEWS "****"; + $desc = ; + chop ($desc); + close NEWS; + + return $desc; +} + +sub edit_index +{ + $ton = top_of_NEWS(); + $ton = "\n\n$ton\n\n"; + open INDEX, "index.html"; + input_record_separator NEWS undef; + $index = ; + close INDEX; + $index =~ s/top_of_NEWS/$ton/; + open INDEX, ">index.html"; + print INDEX $index; + close INDEX; +} + + sub copy_files { print "copying files\n"; @@ -302,6 +328,7 @@ sub main gen_html; copy_files; + if (! $opt_noexamples) { gen_examples; gen_list; @@ -310,6 +337,7 @@ sub main set_images; edit_html; + edit_index; docxx_update; do_tar; } diff --git a/init/table16.ly b/init/table16.ly index 6abe8df49c..5097530ac8 100644 --- a/init/table16.ly +++ b/init/table16.ly @@ -75,7 +75,6 @@ table_sixteen= "tenor_change" "\caltoclef" 0.0\pt 11.2\pt 0.0\pt 16.0\pt } - % dimens are ignored? "balls" = \table { "-2" "\longaball" 0.0\pt 6.0\pt -2.0\pt 2.0\pt "-1" "\breveball" 0.0\pt 6.0\pt -2.0\pt 2.0\pt diff --git a/input/coriolan-alto.ly b/input/coriolan-alto.ly index 8fd27dd47e..f580b6eb99 100644 --- a/input/coriolan-alto.ly +++ b/input/coriolan-alto.ly @@ -19,68 +19,60 @@ EndMudelaHeader \version "0.1.6"; -alto = \melodic{ - +alto1 = \melodic{ \meter 4/4; \key bes es as; \clef "alto"; % these are chords (i.e. non-divisi) - -%30 - < - { \octave c ; + { \octave c ; - [ c8 c-. ] c2.( | + [ c8 c8-. ] c2.( | %31 - [ ) c8 c-. ] c2.( | + [ ) c8 c8-. ] c2.( | %32 - [ ) c8 c-. ] c4. c-. c4( | + [ ) c8 c8-. ] c4. c8-. c4( | %33 - [ ) c8 c-. ] c4. c-. c4 - \group "+bla"; - \stemup[ c16^"div." c16 c16 c16 ] c4 c2 - \group "-"; - } + [ ) c8 c8-. ] c4. c8-. c4 | + + %% divisi + \type Voice="altodivisi1" {\stemup c4:16 ^"div." c4: c2: } + \stemboth + } %30:2 - { - \octave 'c ; - \textstyle "italic"; - % this should be a \dynamic, rather than text - [ c c_"cresc. \ \ - \ \ \ \ - \ \ \ \ - \ \ \ \ - - \ \ \ \ - \ \ \ \ - \ \ \ \ - \ \ \ \ - - \ \ \ \ - \ \ \ \ - \ \ \ \ - \ \ \ \ - - \ \ \ \ - \ \ \ \ -" ] c2.( | - \textstyle "roman"; +} + +alto2 = \melodic{ + \octave 'c ; + \textstyle "italic"; + % this should be a \dynamic, rather than text + [ c8 c8_"cresc. \ \ - \ \ \ \ - \ \ \ \ - \ \ \ \ + - \ \ \ \ - \ \ \ \ - \ \ \ \ - \ \ \ \ + - \ \ \ \ - \ \ \ \ - \ \ \ \ - \ \ \ \ + - \ \ \ \ - \ \ \ \ -" ] c2.( | + \textstyle "roman"; %31:2 - [ ) c8 c-. ] c2.( | + [ ) c8 c-. ] c2.( | %32:2 - [ ) c8 c-. ] c4. c-. c4( | + [ ) c8 c-. ] c4. c8-. c4( | %33:2 - [ ) c8 c-. ] c4. c-. c4 | - \octave c ; + [ ) c8 c-. ] c4. c8-. c4 | + \octave c ; %34 - \group "+b"; - % these are two \voices (i.e. divisi) - % the c4 and c2, however are really 16th... - % we-ll say "simile" for now... + % these are two \voices (i.e. divisi) + % the c4 and c2, however are really 16th... + % we-ll say "simile" for now... % - \octave 'c ; - \textstyle "italic"; - \stemdown - [ as16 \ff as16 as16 as16 ] as4_"simile" as2 - \textstyle "roman"; - \group "-"; - } - > - + \octave 'c ; + \type Voice="altodivisi2" { + \stemdown + as4: as4: as2} + \stemboth } \score{ - \staff{ melodicregs alto } + \type Voice < \alto1 \alto2 > \paper{ - \unitspace 14\mm - \geometric 1.4 } } diff --git a/input/font.ly b/input/font.ly index 1cc2af59bb..955c8d9b8f 100644 --- a/input/font.ly +++ b/input/font.ly @@ -14,7 +14,7 @@ TestedFeatures font-en-tja c2 g c' a' c4 g c' a' a\ppp a\pp a\p a\mp a\mf a\f a\ff a\fff - a\fp a\sf a\sfz + %a\fp a\sf a\sfz } \paper{ \paper_twenty diff --git a/input/gallina.ly b/input/gallina.ly index c13e9fdbf6..2d110e4a79 100644 --- a/input/gallina.ly +++ b/input/gallina.ly @@ -18,10 +18,6 @@ Subject: Re: brevis? [snip] -Here comes a sample score where I've tried to fiddle around with different -spacing parameters to get a decent layout, but it still looks quite strange. -For example is the second half of the bar more spread out than the first -half in many cases. Hopefully it could be useful input to future improvements. I've entered the music directly from the 1637 manuscript and intend to publish it public domain on for example ftp.gmd.de when finished. You could include it as an diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 4e3590437c..a2cb6fb0bd 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -63,6 +63,7 @@ IImenuetto = \melodic{ \multi 2 < {\stemup a4~ d'4 cis'4-. } { \stemdown f2 e4 } > | + \stemboth %%12 < [ g'8^"4" d8 > f' e' f' d'^"3"~ c' ] | %%13 @@ -71,6 +72,7 @@ IImenuetto = \melodic{ { \stemup bes2 c'4 } { \stemdown g4~ f4 e4 }% ugh > | + \stemboth %%14 < [ a8 f8 > g8 a8 f8 ] < d'4-\upbow e4 'bes4 > | %%15 @@ -90,6 +92,7 @@ IImenuetto = \melodic{ {\stemup d'4( \stemup )cis'4 d'4 } { \stemdown g2 f4 } > | + \stemboth %%22 < { [ g8 ~ f8 g8 e8 ] } cis8 > < f4 d4 > | %%23 diff --git a/lily/VERSION b/lily/VERSION index 7876a844d8..bb30177899 100644 --- a/lily/VERSION +++ b/lily/VERSION @@ -1,6 +1,6 @@ MAJOR_VERSION = 0 MINOR_VERSION = 1 -PATCH_LEVEL = 14 +PATCH_LEVEL = 15 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/lily/abbreviation-beam.cc b/lily/abbreviation-beam.cc index e47407cdc7..309337dffb 100644 --- a/lily/abbreviation-beam.cc +++ b/lily/abbreviation-beam.cc @@ -14,7 +14,7 @@ #include "abbreviation-beam.hh" #include "misc.hh" #include "debug.hh" -#include "symbol.hh" +#include "atom.hh" #include "molecule.hh" #include "leastsquares.hh" #include "stem.hh" diff --git a/lily/atom.cc b/lily/atom.cc index 00660aac55..0f1f205289 100644 --- a/lily/atom.cc +++ b/lily/atom.cc @@ -5,7 +5,7 @@ (c) 1997 Han-Wen Nienhuys */ -#include "symbol.hh" +#include "atom.hh" #include "tex.hh" #include "interval.hh" #include "dimen.hh" @@ -17,28 +17,43 @@ void Atom::print() const { #ifndef NPRINT - DOUT << "texstring: " <lookup_l()->bar (type_str_, + Atom s = p->lookup_l()->bar (type_str_, p->get_var ("bar_size")); Molecule*output = new Molecule (Atom (s)); return output; diff --git a/lily/beam.cc b/lily/beam.cc index 27825954b6..d2b5e1e3c6 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -21,7 +21,7 @@ #include "abbreviation-beam.hh" #include "misc.hh" #include "debug.hh" -#include "symbol.hh" +#include "atom.hh" #include "molecule.hh" #include "leastsquares.hh" #include "stem.hh" @@ -304,8 +304,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const int lhalfs= lhalfs = here->beams_left_i_ - prev->beams_right_i_ ; int lwholebeams= here->beams_left_i_ beams_right_i_ ; Real w = (here->hpos_f () - prev->hpos_f ())/4; - Symbol dummy; - Atom a (dummy); + Atom a; if (lhalfs) // generates warnings if not a = paper()->lookup_l ()->beam (sl, w); a.translate (Offset (-w, -w * sl)); diff --git a/lily/bow.cc b/lily/bow.cc index 1bd0a00762..34b7eb7794 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -44,12 +44,10 @@ Bow::brew_molecule_p() const w+= (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]) * nw_f ; Real round_w = w; // slur lookup rounds the slurwidth . - Symbol sl = paper()->lookup_l ()->slur (dy , round_w, dir_); + Atom a = paper()->lookup_l ()->slur (dy , round_w, dir_); Real error = w-round_w; - - Atom a (sl); - a.translate (Offset ((dx_f_drul_[LEFT] + 0.5)*nw_f + error/2, + a.translate (Offset ((dx_f_drul_[LEFT] + 0.5)*nw_f + error/2, pos_i_drul_[LEFT] * nh_f)); output->add (a); return output; diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 920d2c5512..a0ca99bcc5 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -59,7 +59,7 @@ Clef_item::brew_molecule_p() const String t = type_; if (change_b_) t += "_change"; - Symbol s = paper()->lookup_l ()->clef (t); + Atom s = paper()->lookup_l ()->clef (t); Molecule*output = new Molecule (Atom (s)); output->translate (paper()->internote_f () * y_off, Y_AXIS); return output; diff --git a/lily/crescendo.cc b/lily/crescendo.cc index 3fe1a4114c..1bd91d0f0c 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -24,12 +24,12 @@ Crescendo::Crescendo() Interval Crescendo::symbol_height() const { - return get_symbol().dim[Y_AXIS]; + return get_symbol().dim_[Y_AXIS]; } static Real absdyn_dim = 10 PT; // ugh -Symbol +Atom Crescendo::get_symbol() const { Real w_dim = width().length (); @@ -48,7 +48,7 @@ Crescendo::get_symbol() const w_dim = 0; } - return Symbol (paper()->lookup_l ()->hairpin (w_dim, grow_dir_ < 0)); + return Atom (paper()->lookup_l ()->hairpin (w_dim, grow_dir_ < 0)); } Molecule* @@ -60,7 +60,7 @@ Crescendo::brew_molecule_p() const x_off_dim += absdyn_dim; m_p = new Molecule; - Symbol s (get_symbol()); + Atom s (get_symbol()); m_p->add (Atom (s)); m_p->translate (Offset (x_off_dim, pos_i_ * paper()->internote_f ())); return m_p; diff --git a/lily/dots.cc b/lily/dots.cc index 0525aa1dda..946b74b195 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -27,7 +27,7 @@ Dots::do_post_processing () Molecule* Dots::brew_molecule_p () const { - Symbol d = paper ()->lookup_l ()->dots (no_dots_i_); + Atom d = paper ()->lookup_l ()->dots (no_dots_i_); Molecule *out = new Molecule (Atom (d)); Real inter_f = paper ()->internote_f (); out->translate (inter_f * position_i_, Y_AXIS); diff --git a/lily/dynamic-grav.cc b/lily/dynamic-grav.cc index 241737cf32..bd875bd839 100644 --- a/lily/dynamic-grav.cc +++ b/lily/dynamic-grav.cc @@ -51,10 +51,8 @@ Dynamic_engraver::do_process_requests() { Text_def * td_p = new Text_def; td_p->align_i_ = 0; - String loud =Dynamic_req::loudness_str ( - dreq_l->absdynamic()->loudness_); - - td_p->text_str_ = paper()->lookup_l ()->dynamic (loud).tex; + String loud = dreq_l->absdynamic()->loudness_str (); + td_p->text_str_ = paper()->lookup_l ()->dynamic (loud).tex_; td_p->style_str_ = "dynamic"; assert (!dynamic_p_) ; // TODO diff --git a/lily/general-script-def.cc b/lily/general-script-def.cc index 70c2b740af..2a014cc542 100644 --- a/lily/general-script-def.cc +++ b/lily/general-script-def.cc @@ -9,7 +9,7 @@ #include "general-script-def.hh" #include "debug.hh" -#include "symbol.hh" +#include "atom.hh" Direction General_script_def::staff_dir() const { @@ -65,7 +65,7 @@ General_script_def::do_print() const Atom General_script_def::get_atom (Paper_def*, Direction) const { - Symbol s; + Atom s; return Atom (s); } diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 9806130d14..3daa4ab12e 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -152,8 +152,6 @@ Gourlay_breaking::do_solve() const Array lines; - Real max_energy_f = 0; - /* skip 0-th element, since it is a "dummy" elt*/ for (int i = optimal_paths.size()-1; i> 0;) { diff --git a/lily/include/atom.hh b/lily/include/atom.hh new file mode 100644 index 0000000000..d25942c336 --- /dev/null +++ b/lily/include/atom.hh @@ -0,0 +1,37 @@ +/* + atom.hh -- declare Atom + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#ifndef ATOM_HH +#define ATOM_HH + +#include "string.hh" +#include "boxes.hh" +#include "lily-proto.hh" + + +/// a symbol which can be translated, and freely copied +struct Atom { + String tex_; + Box dim_; + Offset off_; + + String str() const; // for printing. + Atom (String, Box); + Atom (); + void translate (Offset o) { + off_ += o; + } + void translate (Real r,Axis a){ + off_[a] += r; + } + /// how big is #this#? + Box extent() const; + void print() const; + String TeX_string() const; +}; +#endif diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh index 99e0e287cc..6c8a9df805 100644 --- a/lily/include/crescendo.hh +++ b/lily/include/crescendo.hh @@ -30,7 +30,7 @@ protected: DECLARE_MY_RUNTIME_TYPEINFO; private: - Symbol get_symbol() const; + Atom get_symbol() const; }; #endif // CRESCENDO_HH diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 7c735faa27..d8b5b3bddc 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -199,7 +199,7 @@ struct Stem_beam_engraver; struct Stem_req; struct String; struct Subtle_req; -struct Symbol; +struct Atom; struct Symtable; struct Symtables; struct Super_elem; diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 638e8c3bdf..f4696f9faa 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -9,12 +9,13 @@ #ifndef LOOKUPSYMS_HH #define LOOKUPSYMS_HH -#include "symbol.hh" +#include "atom.hh" #include "fproto.hh" #include "scalar.hh" #include "direction.hh" -/// intuitive interface to symbol table +/** handy interface to symbol table + */ struct Lookup { Paper_def * paper_l_; Symtables *symtables_; @@ -23,40 +24,40 @@ struct Lookup { void add (String, Symtable*); void print() const; - Symbol linestaff (int n, Real w) const; - Symbol fill (Box b) const; - Symbol beam_element (int,int,Real=0) const; + Atom linestaff (int n, Real w) const; + Atom fill (Box b) const; + Atom beam_element (int,int,Real=0) const; /// round slope to closest TeXslope - Symbol beam (Real&,Real) const; + Atom beam (Real&,Real) const; /** pos == 3 : 3 lines above staff (extending below note) pos == -3: below staff */ - Symbol streepjes (int pos) const; + Atom streepjes (int pos) const; - Symbol vbrace (Real &dy) const; - Symbol meter (Array) const; - Symbol stem (Real y1_pos, Real y2_pos) const; - Symbol rule_symbol (Real height, Real width) const; - Symbol accidental (int) const; - Symbol ball (int) const; - Symbol flag (int, Direction) const; - Symbol rest (int, bool outside) const; - Symbol clef (String) const; - Symbol bar (String, Real height) const; + Atom vbrace (Real &dy) const; + Atom meter (Array) const; + Atom stem (Real y1_pos, Real y2_pos) const; + Atom rule_symbol (Real height, Real width) const; + Atom accidental (int) const; + Atom ball (int) const; + Atom flag (int, Direction) const; + Atom rest (int, bool outside) const; + Atom clef (String) const; + Atom bar (String, Real height) const; - Symbol dots (int) const; - Symbol slur (int dy, Real &dx, Direction dir) const; - Symbol half_slur (int dy, Real &dx, Direction dir, int xpart) const; - Symbol half_slur_middlepart (Real &dx, Direction dir) const; - Symbol big_slur (int dy, Real &dx, Direction dir) const; - Symbol text (String style, String text, int align = 1) const; - Symbol script (String idx) const; - Symbol hairpin (Real & width, bool decresc) const; - Symbol dynamic (String) const; + Atom dots (int) const; + Atom slur (int dy, Real &dx, Direction dir) const; + Atom half_slur (int dy, Real &dx, Direction dir, int xpart) const; + Atom half_slur_middlepart (Real &dx, Direction dir) const; + Atom big_slur (int dy, Real &dx, Direction dir) const; + Atom text (String style, String text, int align = 1) const; + Atom script (String idx) const; + Atom hairpin (Real & width, bool decresc) const; + Atom dynamic (String) const; Lookup(); Lookup (Lookup const &); ~Lookup(); diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 48e4a80258..5ebe4cb3a3 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -221,17 +221,23 @@ public: class Dynamic_req : public virtual Musical_req { public: - /// for absolute dynamics + /** + for absolute dynamics + + This sux. We'd want increasing numbers for FFF till PPP, but not + for FP, SF, SFZ (FP is *not* louder than FFF) + */ enum Loudness { FFF, FF, F, MF, MP, P, PP, PPP, FP, SF, SFZ }; - static String loudness_str (Loudness); + static String loudness_static_str (Loudness); REQUESTMETHODS(Dynamic_req, dynamic); }; class Absolute_dynamic_req : public Dynamic_req { public: Loudness loudness_; + String loudness_str () const; Absolute_dynamic_req(); REQUESTMETHODS(Absolute_dynamic_req, absdynamic); }; diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index 5039521223..2a18dff662 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -34,6 +34,7 @@ public: Note_head (); static int compare (Note_head * const &a, Note_head *const &b) ; protected: + virtual Interval do_width () const; virtual void do_pre_processing(); virtual Molecule* brew_molecule_p() const; }; diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index a06674be8d..e73959e435 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -60,7 +60,6 @@ public: /// thickness of the standard line Real rule_thickness() const; - Real whole_width() const; Real linewidth_f() const; /// height of the staff Real standard_height() const; diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index d49974c902..136564678f 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -29,7 +29,7 @@ protected: virtual void do_substitute_dependency (Score_elem*,Score_elem*); virtual Molecule * brew_molecule_p() const; - virtual Symbol get_bar_sym (Real dy) const; + virtual Atom get_bar_sym (Real dy) const; }; #endif // SPAN_BAR_HH diff --git a/lily/include/span-score-bar.hh b/lily/include/span-score-bar.hh index 5b25faa3ca..0639825180 100644 --- a/lily/include/span-score-bar.hh +++ b/lily/include/span-score-bar.hh @@ -32,7 +32,7 @@ public: SCORE_ELEM_CLONE(Piano_brace); protected: virtual Interval do_width() const; - virtual Symbol get_bar_sym (Real) const; + virtual Atom get_bar_sym (Real) const; }; #endif // SPAN_SCORE_BAR_HH diff --git a/lily/include/stem.hh b/lily/include/stem.hh index f7240397b3..7ed9e4615e 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -31,7 +31,7 @@ class Stem : public Item { Molecule abbrev_mol () const; - Real stem_bottom_f_, stem_top_f_; + Drul_array yextent_drul_; /// needed for determining direction/length int staff_size_i_; @@ -45,7 +45,7 @@ class Stem : public Item { geen gedonder, jij gaat onder. -1 stem points down, +1: stem points up */ - Real stem_xoffset_f_; + Direction stem_xdir_; Link_array head_l_arr_; Link_array rest_l_arr_; @@ -97,6 +97,7 @@ public: Real stem_length_f() const; Real stem_end_f() const; Real stem_start_f() const; + Real note_delta_f () const; bool invisible_b() const; diff --git a/lily/include/symbol.hh b/lily/include/symbol.hh index 09f7e14e4a..65296f8106 100644 --- a/lily/include/symbol.hh +++ b/lily/include/symbol.hh @@ -1,47 +1,2 @@ -/* - symbol.hh -- declare Symbol, Atom - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - -#ifndef SYMBOL_HH -#define SYMBOL_HH - -#include "string.hh" -#include "boxes.hh" -#include "lily-proto.hh" - -struct Symbol { - String tex; - Box dim; - - Symbol (String, Box); - Symbol(); - String str() const; // for printing. -}; - - -/// a symbol which can be translated, and freely copied -struct Atom { - Offset off_; - Symbol sym_; - - /* *************** */ - - void translate (Offset o) { - off_ += o; - } - void translate (Real r,Axis a){ - off_[a] += r; - } - /// how big is #this#? - Box extent() const; - Atom (Symbol s); - - void print() const; - - String TeX_string() const; -}; -#endif +#error diff --git a/lily/include/symtable.hh b/lily/include/symtable.hh index 1c37f7c565..8c36ee6cbf 100644 --- a/lily/include/symtable.hh +++ b/lily/include/symtable.hh @@ -1,16 +1,23 @@ /* - lilypond, (c) 1996,97 Han-Wen Nienhuys + symtable.hh -- declare + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys */ + + #ifndef SYMTABLE_HH #define SYMTABLE_HH + #include "dictionary.hh" #include "string.hh" -#include "symbol.hh" +#include "atom.hh" -struct Symtable : public Dictionary { +struct Symtable : public Dictionary { String id_str; - Symbol lookup (String) const; + Atom lookup (String) const; void print() const; }; diff --git a/lily/key-item.cc b/lily/key-item.cc index f3b57d20a1..4dd094b667 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -34,10 +34,10 @@ Key_item::read (Key_engraver const & key_grav_r) const Array &idx_arr =key_grav_r.accidental_idx_arr_; for (int i = 0 ; i< idx_arr.size(); i++) { - int note = idx_arr[i]; - int acc = ((Key &) key_grav_r.key_).oct (0).acc (note); + int note = idx_arr[i]; + int acc = ((Key &) key_grav_r.key_).oct (0).acc (note); - add (note, acc); + add (note, acc); } } @@ -54,8 +54,8 @@ Key_item::add (int p, int a) { if ((a<0 && p>FLAT_TOP_PITCH) || (a>0 && p>SHARP_TOP_PITCH)) - { - p -= 7; /* Typeset below c_position */ + { + p -= 7; /* Typeset below c_position */ } pitch.push (p); acc.push (a); @@ -70,19 +70,18 @@ Key_item::brew_molecule_p() const for (int i =0; i < pitch.size(); i++) { - Symbol s= paper()->lookup_l ()->accidental (acc[i]); - Atom a (s); - a.translate ((c_position + pitch[i]) * inter, Y_AXIS); - Molecule m (a); - output->add_at_edge (X_AXIS, RIGHT, m); + Atom a =paper()->lookup_l ()->accidental (acc[i]); + a.translate ((c_position + pitch[i]) * inter, Y_AXIS); + Molecule m (a); + output->add_at_edge (X_AXIS, RIGHT, m); } if (pitch.size()) { - Molecule m (paper()->lookup_l ()->fill (Box ( - Interval (0, paper()->note_width ()), - Interval (0,0)))); + Molecule m (paper()->lookup_l ()->fill (Box ( + Interval (0, paper()->note_width ()), + Interval (0,0)))); - output->add_at_edge (X_AXIS, RIGHT, m); + output->add_at_edge (X_AXIS, RIGHT, m); } return output; } @@ -94,7 +93,7 @@ Key_item::do_pre_processing() { if (default_b_) { - transparent_b_ = (break_status_i() != 1); - set_empty (transparent_b_); + transparent_b_ = (break_status_i() != 1); + set_empty (transparent_b_); } } diff --git a/lily/local-key-item.cc b/lily/local-key-item.cc index eab94bf659..65c5ad7253 100644 --- a/lily/local-key-item.cc +++ b/lily/local-key-item.cc @@ -76,12 +76,12 @@ Local_key_item::brew_molecule_p() const octmol= new Molecule; } lastoct = accs[i].octave_i_; - Symbol s =paper()->lookup_l ()->accidental (accs[i].accidental_i_); - Atom a (s); + Real dy = (accs[i].name_i_ + c0_position) * paper()->internote_f (); + Atom a (paper()->lookup_l ()->accidental (accs[i].accidental_i_)); a.translate (dy, Y_AXIS); - - octmol->add_at_edge (X_AXIS, RIGHT, a); + Molecule m(a); + octmol->add_at_edge (X_AXIS, RIGHT, m); } if (octmol) diff --git a/lily/lookup.cc b/lily/lookup.cc index 119c52e449..a706a36bd8 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -54,24 +54,24 @@ Lookup::print() const #endif } -Symbol +Atom Lookup::text (String style, String text, int dir) const { Array a; a.push (text); - Symbol tsym = (*symtables_)("style")->lookup (style); - a[0] = substitute_args (tsym.tex,a); + Atom tsym = (*symtables_)("style")->lookup (style); + a[0] = substitute_args (tsym.tex_,a); - Symbol s = (*symtables_)("align")->lookup (dir); - s.tex = substitute_args (s.tex,a); - s.dim = tsym.dim; + Atom s = (*symtables_)("align")->lookup (dir); + s.tex_ = substitute_args (s.tex_,a); + s.dim_ = tsym.dim_; return s; } -Symbol +Atom Lookup::ball (int j) const { if (j > 2) @@ -81,57 +81,57 @@ Lookup::ball (int j) const return st->lookup (String (j)); } -Symbol +Atom Lookup::rest (int j, bool o) const { return (*symtables_)("rests")->lookup (String (j) + (o ? "o" : "")); } -Symbol +Atom Lookup::fill (Box b) const { - Symbol s ((*symtables_)("param")->lookup ("fill")); - s.dim = b; + Atom s ((*symtables_)("param")->lookup ("fill")); + s.dim_ = b; return s; } -Symbol +Atom Lookup::accidental (int j) const { return (*symtables_)("accidentals")->lookup (String (j)); } -Symbol +Atom Lookup::bar (String s, Real h) const { Array a; a.push (print_dimen (h)); - Symbol ret=(*symtables_)("bars")->lookup (s);; - ret.tex = substitute_args (ret.tex, a); - ret.dim.y() = Interval (0, h); + Atom ret=(*symtables_)("bars")->lookup (s);; + ret.tex_ = substitute_args (ret.tex_, a); + ret.dim_.y() = Interval (0, h); return ret; } -Symbol +Atom Lookup::script (String s) const { return (*symtables_)("scripts")->lookup (s); } -Symbol +Atom Lookup::dynamic (String s) const { return (*symtables_)("dynamics")->lookup (s); } -Symbol +Atom Lookup::clef (String s) const { return (*symtables_)("clefs")->lookup (s); } -Symbol +Atom Lookup::dots (int j) const { if (j>3) @@ -142,14 +142,14 @@ Lookup::dots (int j) const return (*symtables_)("dots")->lookup (j); } -Symbol +Atom Lookup::flag (int j, Direction d) const { char c = (d == UP) ? 'u' : 'd'; return (*symtables_)("flags")->lookup (c + String (j)); } -Symbol +Atom Lookup::streepjes (int i) const { assert (i); @@ -167,63 +167,63 @@ Lookup::streepjes (int i) const arg = i; idx = "toplines"; } - Symbol ret = (*symtables_)("streepjes")->lookup (idx); + Atom ret = (*symtables_)("streepjes")->lookup (idx); Array a; a.push (arg); - ret.tex = substitute_args (ret.tex, a); + ret.tex_ = substitute_args (ret.tex_, a); return ret; } -Symbol +Atom Lookup::hairpin (Real &wid, bool decresc) const { int idx = int (rint (wid / 6 PT)); if (!idx) idx ++; wid = idx*6 PT; String idxstr = (decresc)? "decrescendosym" : "crescendosym"; - Symbol ret=(*symtables_)("param")->lookup (idxstr); + Atom ret=(*symtables_)("param")->lookup (idxstr); Array a; a.push (idx); - ret.tex = substitute_args (ret.tex, a); - ret.dim.x() = Interval (0,wid); + ret.tex_ = substitute_args (ret.tex_, a); + ret.dim_.x() = Interval (0,wid); return ret; } -Symbol +Atom Lookup::linestaff (int lines, Real wid) const { Real internote_f = paper_l_ ->internote_f(); - Symbol s; + Atom s; Real dy = (lines >0) ? (lines-1)*internote_f : 0; - s.dim = Box (Interval (0,wid), Interval (0,dy)); + s.dim_ = Box (Interval (0,wid), Interval (0,dy)); Array a; a.push (lines); a.push (print_dimen (wid)); - s.tex = (*symtables_)("param")->lookup ("linestaf").tex; - s.tex = substitute_args (s.tex, a); + s.tex_ = (*symtables_)("param")->lookup ("linestaf").tex_; + s.tex_ = substitute_args (s.tex_, a); return s; } -Symbol +Atom Lookup::meter (Array a) const { - Symbol s; - s.dim.x() = Interval (0 PT, 10 PT); - s.dim.y() = Interval (0, 20 PT); // todo - String src = (*symtables_)("param")->lookup ("meter").tex; - s.tex = substitute_args (src,a); + Atom s; + s.dim_.x() = Interval (0 PT, 10 PT); + s.dim_.y() = Interval (0, 20 PT); // todo + String src = (*symtables_)("param")->lookup ("meter").tex_; + s.tex_ = substitute_args (src,a); return s; } -Symbol +Atom Lookup::stem (Real y1,Real y2) const { if (y1 > y2) @@ -232,24 +232,24 @@ Lookup::stem (Real y1,Real y2) const y1 = y2; y2 = t; } - Symbol s; + Atom s; - s.dim.x() = Interval (0,0); - s.dim.y() = Interval (y1,y2); + s.dim_.x() = Interval (0,0); + s.dim_.y() = Interval (y1,y2); Array a; a.push (print_dimen (y1)); a.push (print_dimen (y2)); - String src = (*symtables_)("param")->lookup ("stem").tex; - s.tex = substitute_args (src,a); + String src = (*symtables_)("param")->lookup ("stem").tex_; + s.tex_ = substitute_args (src,a); return s; } /* - should be handled via TeX code and Lookup::bar() + should be handled via Tex_ code and Lookup::bar() */ -Symbol +Atom Lookup::vbrace (Real &y) const { if (y < 2* 20 PT) @@ -265,19 +265,19 @@ Lookup::vbrace (Real &y) const int idx = int (rint ((y/2.0 - 20) + 148)); - Symbol s = (*symtables_)("param")->lookup ("brace"); + Atom s = (*symtables_)("param")->lookup ("brace"); { Array a; a.push (idx); - s.tex = substitute_args (s.tex,a); - s.dim.y() = Interval (0,y); + s.tex_ = substitute_args (s.tex_,a); + s.dim_.y() = Interval (0,y); } { Array a; a.push (print_dimen (y/2)); a.push (print_dimen (0)); - a.push (s.tex); - s.tex = substitute_args ("\\placebox{%}{%}{%}", a); + a.push (s.tex_); + s.tex_ = substitute_args ("\\placebox{%}{%}{%}", a); } diff --git a/lily/meter.cc b/lily/meter.cc index aa41b7922b..0c4d4e0ad1 100644 --- a/lily/meter.cc +++ b/lily/meter.cc @@ -13,7 +13,7 @@ Meter::Meter (Arraya) Molecule* Meter::brew_molecule_p() const { - Symbol s = paper()->lookup_l ()->meter (args); + Atom s = paper()->lookup_l ()->meter (args); return new Molecule (Atom (s)); } diff --git a/lily/molecule.cc b/lily/molecule.cc index e37f9e7c33..4dfe7d6c13 100644 --- a/lily/molecule.cc +++ b/lily/molecule.cc @@ -10,7 +10,7 @@ #include "dimen.hh" #include "string.hh" #include "molecule.hh" -#include "symbol.hh" +#include "atom.hh" #include "debug.hh" #include "tex.hh" diff --git a/lily/musical-request.cc b/lily/musical-request.cc index c7a4b8fe9b..5b69a4f581 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -423,32 +423,44 @@ Absolute_dynamic_req::do_print() const { #ifndef NPRINT Dynamic_req::do_print(); - DOUT << " loudness " <dir_ =d; + script_req_p->dir_ =(Direction)d; script_req_p->scriptdef_p_=def; return script_req_p; } diff --git a/lily/notehead.cc b/lily/notehead.cc index 389ff0cf60..4d65dff62e 100644 --- a/lily/notehead.cc +++ b/lily/notehead.cc @@ -44,6 +44,15 @@ Note_head::compare (Note_head *const &a, Note_head * const &b) return a->position_i_ - b->position_i_; } +Interval +Note_head::do_width () const +{ + Atom a = paper ()->lookup_l()->ball (balltype_i_); + Interval i = a.dim_[X_AXIS]; + i+= x_dir_ * i.length (); + return i; +} + Molecule* Note_head::brew_molecule_p() const { @@ -54,9 +63,9 @@ Note_head::brew_molecule_p() const // ugh bool streepjes_b = (position_i_<-1) || (position_i_ > staff_size_i_+1); - Symbol s = p->lookup_l()->ball (balltype_i_); + Atom s = p->lookup_l()->ball (balltype_i_); out = new Molecule (Atom (s)); - out->translate (x_dir_ * s.dim.x().length (), X_AXIS); + out->translate (x_dir_ * s.dim_[X_AXIS].length (), X_AXIS); if (streepjes_b) { @@ -65,7 +74,7 @@ Note_head::brew_molecule_p() const ? -((-position_i_)/2) : (position_i_-staff_size_i_)/2; - Symbol str = p->lookup_l()->streepjes (s); + Atom str = p->lookup_l()->streepjes (s); Molecule sm; sm.add (Atom (str)); if (position_i_ % 2) diff --git a/lily/parser.y b/lily/parser.y index d7b2a0d4fa..8a60f8b3ab 100644 --- a/lily/parser.y +++ b/lily/parser.y @@ -82,7 +82,7 @@ General_script_def * script; Scalar *scalar; String *string; - Symbol * symbol; + Atom * symbol; Symtable * symtable; Symtables * symtables; Text_def * textdef; @@ -1180,13 +1180,13 @@ symtable_body: symboldef: STRING box { - $$ = new Symbol (*$1, *$2); + $$ = new Atom (*$1, *$2); delete $1; delete $2; } | STRING { Box b (Interval (0,0), Interval (0,0)); - $$ = new Symbol (*$1, b); + $$ = new Atom (*$1, b); delete $1; } ; diff --git a/lily/rest.cc b/lily/rest.cc index d2ccd2a01b..0a7dc7419a 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -37,7 +37,7 @@ Rest::brew_molecule_p () const int staff_size_i_ =8; bool streepjes_b = (position_i_<-1) || (position_i_ > staff_size_i_+1); - Symbol s(paper ()->lookup_l()->rest (balltype_i_, streepjes_b)); + Atom s(paper ()->lookup_l()->rest (balltype_i_, streepjes_b)); Molecule * m = new Molecule ( Atom (s)); m->translate (position_i_ * paper ()->internote_f (), Y_AXIS); return m; diff --git a/lily/score-elem.cc b/lily/score-elem.cc index c06ebd0d2c..3592033847 100644 --- a/lily/score-elem.cc +++ b/lily/score-elem.cc @@ -293,8 +293,6 @@ Score_elem::handle_broken_dependencies() remove_us_arr.uniq(); for (int i=0; i lookup_l ()->bar (type_str_, 40 PT).dim.x (); // ugh + return paper()->lookup_l ()->bar (type_str_, 40 PT).dim_.x (); // ugh } + void Span_bar::do_pre_processing() { @@ -85,7 +86,7 @@ Span_bar::do_pre_processing() } } -Symbol +Atom Span_bar::get_bar_sym (Real dy) const { return paper()->lookup_l ()->bar (type_str_, dy); @@ -107,7 +108,7 @@ Span_bar::brew_molecule_p() const y_int.unite (y + spanning_l_arr_[i]->height()); } - Symbol s = get_bar_sym (y_int.length()); + Atom s = get_bar_sym (y_int.length()); Molecule*output = new Molecule (Atom (s)); output->translate (y_int[-1], Y_AXIS); return output; diff --git a/lily/span-score-bar.cc b/lily/span-score-bar.cc index 97b195ef1e..5ad94b760d 100644 --- a/lily/span-score-bar.cc +++ b/lily/span-score-bar.cc @@ -7,7 +7,7 @@ */ #include "span-score-bar.hh" -#include "symbol.hh" +#include "atom.hh" #include "paper-def.hh" #include "lookup.hh" @@ -29,7 +29,7 @@ Span_score_bar::do_pre_processing() } -Symbol +Atom Piano_brace::get_bar_sym (Real dy) const { return paper()->lookup_l ()->vbrace (dy); diff --git a/lily/stem-info.cc b/lily/stem-info.cc index a3287ce55c..89cd395c0b 100644 --- a/lily/stem-info.cc +++ b/lily/stem-info.cc @@ -11,7 +11,7 @@ #include "dimen.hh" #include "misc.hh" #include "debug.hh" -#include "symbol.hh" +#include "atom.hh" #include "stem.hh" #include "paper-def.hh" #include "lookup.hh" diff --git a/lily/stem.cc b/lily/stem.cc index 60f7b1bad3..a2aa5c55c4 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -34,12 +34,12 @@ Stem::Stem () beams_left_i_ = 0; beams_right_i_ = 0; - stem_bottom_f_ = stem_top_f_ = 0; + yextent_drul_[DOWN] = yextent_drul_[UP] = 0; flag_i_ = 2; dir_ = CENTER; + stem_xdir_ = LEFT; staff_size_i_ = 8; - stem_xoffset_f_ =0; beam_gap_i_ = 0; } @@ -75,19 +75,19 @@ Stem::do_print () const Real Stem::stem_length_f () const { - return stem_top_f_-stem_bottom_f_ ; + return yextent_drul_[UP]-yextent_drul_[DOWN] ; } Real Stem::stem_start_f () const { - return (dir_ < 0)? stem_top_f_ : stem_bottom_f_; + return (dir_ < 0)? yextent_drul_[UP] : yextent_drul_[DOWN]; } Real Stem::stem_end_f () const { - return (dir_ < 0)? stem_bottom_f_ : stem_top_f_; + return (dir_ < 0)? yextent_drul_[DOWN] : yextent_drul_[UP]; } @@ -99,8 +99,8 @@ Stem::set_stemend (Real se) (se <= min_head_i () && dir_ <0))) warning ("Weird stem size; check for narrow beams"); - stem_top_f_ = (dir_ < 0) ? max_head_i () : se; - stem_bottom_f_ = (dir_ < 0) ? se : min_head_i (); + yextent_drul_[UP] = (dir_ < 0) ? max_head_i () : se; + yextent_drul_[DOWN] = (dir_ < 0) ? se : min_head_i (); } int @@ -207,13 +207,11 @@ Stem::set_default_extents () set_stemend ((dir_< 0) ? max_head_i ()-stem_length_f (): min_head_i () + stem_length_f ()); - // ugh, a whole ball is wider + + if (dir_ == UP) + stem_xdir_ = RIGHT; if (head_l_arr_[0]->balltype_i_ <= 0) - stem_xoffset_f_ = paper ()->note_width () / 2; - else if (dir_ > 0) - stem_xoffset_f_ = paper ()->note_width () - paper ()->rule_thickness (); - else - stem_xoffset_f_ = 0; + stem_xdir_ = CENTER; } /* @@ -242,7 +240,7 @@ Stem::set_noteheads () if (dy <= 1) { if (parity) - head_l_arr_[i]->x_dir_ = (stem_xoffset_f_>0) ? UP:DOWN; + head_l_arr_[i]->x_dir_ = (stem_xdir_ == LEFT) ? LEFT : RIGHT; parity = !parity; } else @@ -254,7 +252,7 @@ Stem::set_noteheads () void Stem::do_pre_processing () { - if (stem_bottom_f_== stem_top_f_) + if (yextent_drul_[DOWN]== yextent_drul_[UP]) set_default_extents (); set_noteheads (); flag_i_ = flag_i_; @@ -276,8 +274,8 @@ Stem::do_width () const else { Paper_def*p= paper (); - r = p->lookup_l ()->flag (flag_i_, dir_).dim.x (); - r+= stem_xoffset_f_; + r = p->lookup_l ()->flag (flag_i_, dir_).dim_.x (); + r += note_delta_f (); } return r; } @@ -285,10 +283,10 @@ Stem::do_width () const Molecule - Stem::abbrev_mol () const +Stem::abbrev_mol () const { Real dy = paper ()->interbeam_f (); - Real w = 1.5 * paper ()->lookup_l ()->ball (2).dim.x ().length (); + Real w = 1.5 * paper ()->lookup_l ()->ball (2).dim_.x ().length (); Real beamdy = paper ()->interline_f () / 2; int beams_i = 0; @@ -326,8 +324,8 @@ Molecule* { Molecule *mol_p =new Molecule; - Real bot = stem_bottom_f_; - Real top = stem_top_f_; + Real bot = yextent_drul_[DOWN]; + Real top = yextent_drul_[UP]; assert (bot!=top); @@ -336,28 +334,43 @@ Molecule* Real dy = p->internote_f (); if (!invisible_b ()) { - Symbol ss =p->lookup_l ()->stem (bot*dy,top*dy); + Atom ss =p->lookup_l ()->stem (bot*dy,top*dy); mol_p->add (Atom (ss)); } if (!beam_l_ &&abs (flag_i_) > 2) { - Symbol fl = p->lookup_l ()->flag (flag_i_, dir_); + Atom fl = p->lookup_l ()->flag (flag_i_, dir_); mol_p->add_at_edge (Y_AXIS, dir_, Molecule (Atom (fl))); assert (!abbrev_flag_i_); } if (abbrev_flag_i_) mol_p->add (abbrev_mol ()); - - mol_p->translate (stem_xoffset_f_, X_AXIS); + + if (head_l_arr_.size()) + { + mol_p->translate (note_delta_f (), X_AXIS); + } return mol_p; } +Real +Stem::note_delta_f () const +{ + Real r=0; + if (head_l_arr_.size()) + { + r += head_l_arr_[0]->width ().length() * (stem_xdir_+1.0)/2.0; + if (stem_xdir_ == RIGHT) + r -= paper ()->rule_thickness (); + } + return r; +} Real - Stem::hpos_f () const +Stem::hpos_f () const { - return Item::hpos_f () + stem_xoffset_f_; + return note_delta_f () +Item::hpos_f (); } diff --git a/lily/symbol.cc b/lily/symbol.cc deleted file mode 100644 index 9ba3d45f58..0000000000 --- a/lily/symbol.cc +++ /dev/null @@ -1,21 +0,0 @@ -#include "symbol.hh" -#include "varray.hh" - - -Symbol::Symbol() - : dim (Interval (0,0),Interval (0,0)) -{ - tex = "\\unknown"; -} -Symbol::Symbol (String s, Box b) - : dim (b) -{ - tex = s; -} - - -String -Symbol::str() const -{ - return "symbol (\'"+tex+"\', (" + dim.x().str () + ", " + dim.y ().str () + "))"; -} diff --git a/lily/symtable.cc b/lily/symtable.cc index 2bb6f53fa9..9098e18ad4 100644 --- a/lily/symtable.cc +++ b/lily/symtable.cc @@ -10,7 +10,7 @@ #include "dimen.hh" #include "debug.hh" #include "real.hh" -#include "symbol.hh" +#include "atom.hh" #include "assoc.hh" #include "assoc-iter.hh" #include "symtable.hh" @@ -35,7 +35,7 @@ Symtables::~Symtables() } } -Symbol +Atom Symtable::lookup (String s) const { if (elt_b (s)) @@ -43,7 +43,7 @@ Symtable::lookup (String s) const else { warning ("Symtable `" + id_str+ "\': unknown symbol `" +s+"'\n"); - Symbol sy; + Atom sy; return sy; } } @@ -66,7 +66,7 @@ Symtables::print() const void Symtable::print() const { - for (Assoc_iter i (*this); i.ok(); i++) + for (Assoc_iter i (*this); i.ok(); i++) { DOUT << "\'" << i.key() << "\'->" << i.val ().str () << "\n"; } diff --git a/lily/template3.cc b/lily/template3.cc index d9ea0deba2..e1e1b4d5f2 100644 --- a/lily/template3.cc +++ b/lily/template3.cc @@ -6,7 +6,7 @@ (c) 1997 Han-Wen Nienhuys */ -#include "symbol.hh" +#include "atom.hh" #include "molecule.hh" #include "plist.tcc" #include "pcursor.tcc" diff --git a/lily/tex-beam.cc b/lily/tex-beam.cc index c16a0e9c02..5bc8ebbfcc 100644 --- a/lily/tex-beam.cc +++ b/lily/tex-beam.cc @@ -11,7 +11,7 @@ */ #include -#include "symbol.hh" +#include "atom.hh" #include "molecule.hh" #include "tex.hh" #include "symtable.hh" @@ -19,19 +19,19 @@ #include "debug.hh" #include "lookup.hh" -Symbol +Atom Lookup::beam_element (int sidx, int widx, Real slope) const { - Symbol bs=(*symtables_)("beamslopes")->lookup ("slope"); + Atom bs=(*symtables_)("beamslopes")->lookup ("slope"); Array args; args.push (sidx); args.push (widx); - bs.tex = substitute_args (bs.tex,args); + bs.tex_ = substitute_args (bs.tex_,args); int w = 2 << widx; Real width = w PT; - bs.dim.x() = Interval (0,width); - bs.dim.y() = Interval (0,width*slope); + bs.dim_.x() = Interval (0,width); + bs.dim_.y() = Interval (0,width*slope); return bs; } @@ -54,20 +54,20 @@ slope_index (Real &s) return -6 * i+ 186; } -Symbol +Atom Lookup::rule_symbol (Real height, Real width) const { - Symbol bs=(*symtables_)("beamslopes")->lookup ("horizontal"); + Atom bs=(*symtables_)("beamslopes")->lookup ("horizontal"); Array args; args.push (print_dimen (height)); args.push (print_dimen (width)); - bs.tex = substitute_args (bs.tex,args); - bs.dim.x() = Interval (0,width); - bs.dim.y() = Interval (0,height); + bs.tex_ = substitute_args (bs.tex_,args); + bs.dim_.x() = Interval (0,width); + bs.dim_.y() = Interval (0,height); return bs; } -Symbol +Atom Lookup::beam (Real &slope, Real width) const { int sidx = slope_index (slope); @@ -105,10 +105,10 @@ Lookup::beam (Real &slope, Real width) const a.translate (Offset (last_x, (last_x) * slope)); m.add (a); - Symbol ret; - ret.tex = m.TeX_string(); - ret.dim.y() = Interval (0,width*slope); - ret.dim.x() = Interval (0,width); + Atom ret; + ret.tex_ = m.TeX_string(); + ret.dim_.y() = Interval (0,width*slope); + ret.dim_.x() = Interval (0,width); return ret; } diff --git a/lily/tex-slur.cc b/lily/tex-slur.cc index 27dede2e41..664460f8b9 100644 --- a/lily/tex-slur.cc +++ b/lily/tex-slur.cc @@ -36,7 +36,7 @@ direction_char (Direction y_sign) return c; } -Symbol +Atom Lookup::half_slur_middlepart (Real &dx, Direction dir) const { // todo @@ -53,10 +53,10 @@ Lookup::half_slur_middlepart (Real &dx, Direction dir) const WARN << "slur too narrow\n"; } - Symbol s; + Atom s; - s.dim.y() = Interval (min (0,0), max (0,0)); // todo - s.dim.x() = Interval (0,dx); + s.dim_.y() = Interval (min (0,0), max (0,0)); // todo + s.dim_.x() = Interval (0,dx); String f = String ("\\hslurchar"); f += direction_char (CENTER); @@ -67,16 +67,14 @@ Lookup::half_slur_middlepart (Real &dx, Direction dir) const assert (idx < 256); - f+=String ("{") + String (idx) + "}"; - s.tex = f; - Atom a (s); - a.translate (dx/2, X_AXIS); - s.tex = a.TeX_string(); + f +=String ("{") + String (idx) + "}"; + s.tex_ = f; + s.translate (dx/2, X_AXIS); return s; } -Symbol +Atom Lookup::half_slur (int dy, Real &dx, Direction dir, int xpart) const { Real orig_dx = dx; @@ -100,9 +98,9 @@ Lookup::half_slur (int dy, Real &dx, Direction dir, int xpart) const WARN << "slur too narrow " << print_dimen (orig_dx)<<"\n"; } - Symbol s; - s.dim.x() = Interval (0,dx); - s.dim.y() = Interval (min (0,dy), max (0,dy)); + Atom s; + s.dim_.x() = Interval (0,dx); + s.dim_.y() = Interval (min (0,dy), max (0,dy)); String f = String ("\\hslurchar"); @@ -123,12 +121,12 @@ Lookup::half_slur (int dy, Real &dx, Direction dir, int xpart) const f+=String ("{") + String (idx) + "}"; - s.tex = f; + s.tex_ = f; return s; } -Symbol +Atom Lookup::slur (int dy , Real &dx, Direction dir) const { @@ -172,9 +170,9 @@ Lookup::slur (int dy , Real &dx, Direction dir) const WARN<<"slur to steep: " << dy << " shrinking (ugh)\n"; } - Symbol s; - s.dim.x() = Interval (0,dx); - s.dim.y() = Interval (min (0,dy), max (0,dy)); + Atom s; + s.dim_.x() = Interval (-dx/2,dx/2); + s.dim_.y() = Interval (min (0,dy), max (0,dy)); String f = String ("\\slurchar") + String (direction_char (y_sign)); @@ -199,16 +197,14 @@ Lookup::slur (int dy , Real &dx, Direction dir) const assert (idx < 256); f+=String ("{") + String (idx) + "}"; - s.tex = f; + s.tex_ = f; + - Atom a (s); - a.translate (dx/2, X_AXIS); - s.dim = a.extent(); - s.tex = a.TeX_string(); + s.translate (dx/2, X_AXIS); return s; } -Symbol +Atom Lookup::big_slur (int dy , Real &dx, Direction dir) const { if (dx < 24 PT) @@ -229,18 +225,17 @@ Lookup::big_slur (int dy , Real &dx, Direction dir) const Atom r = half_slur (r_dy, right_wid, dir, 1); Real mid_wid = dx - left_wid - right_wid; - Atom m = half_slur (0, mid_wid, dir, 0); - Molecule mol; mol.add (l); - Atom a (m); + Atom a (half_slur (0, mid_wid, dir, 0)); a.translate (slur_extra * internote_f, Y_AXIS); - mol.add_at_edge (X_AXIS, RIGHT, m); + mol.add_at_edge (X_AXIS, RIGHT, a); mol.add_at_edge (X_AXIS, RIGHT, r); mol.translate (l_dy * internote_f, Y_AXIS); - Symbol s; - s.tex = mol.TeX_string(); - s.dim = mol.extent(); + + Atom s; + s.tex_ = mol.TeX_string(); + s.dim_ = mol.extent(); return s; } diff --git a/lily/tex.cc b/lily/tex.cc index 6e7bb4732b..19285561c1 100644 --- a/lily/tex.cc +++ b/lily/tex.cc @@ -8,7 +8,7 @@ #include "dimen.hh" #include "tex.hh" -#include "symbol.hh" +#include "atom.hh" #include "varray.hh" String diff --git a/lily/text-def.cc b/lily/text-def.cc index ead696b073..c41bfeb58a 100644 --- a/lily/text-def.cc +++ b/lily/text-def.cc @@ -18,7 +18,7 @@ Text_def::width (Paper_def * p) const { Atom a = get_atom (p,CENTER); - Real guess_width_f = text_str_.length_i() * a.sym_.dim.x ().length (); // ugh + Real guess_width_f = text_str_.length_i() * a.dim_.x ().length (); // ugh Interval i (0, guess_width_f); i += - (align_i_ + 1)* i.center(); return i; diff --git a/lily/text-item.cc b/lily/text-item.cc index 876acfde39..4701f2b109 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -36,7 +36,7 @@ Text_item::do_pre_processing() Interval Text_item::symbol_height() const { - return tdef_p_->get_atom (paper(), dir_).sym_.dim.y (); + return tdef_p_->get_atom (paper(), dir_).dim_.y (); } Molecule* diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index edf430aa13..c23bb7e645 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -12,7 +12,7 @@ #include "text-def.hh" #include "debug.hh" #include "paper-def.hh" -#include "symbol.hh" +#include "atom.hh" void diff --git a/lily/translator-group.cc b/lily/translator-group.cc index c824164d50..29bd652ded 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -80,31 +80,40 @@ Translator_group::find_existing_translator_l (String n, String id) Link_array Translator_group::path_to_acceptable_translator (String type) const { - Link_array retval; - - if (type_str_ == type) - { - retval.push (output_def_l ()->find_translator_l (type)->group_l ()); - } - else for (int i=0; i < accepts_str_arr_.size (); i++) + Link_array accepted_arr; + for (int i=0; i < accepts_str_arr_.size (); i++) { Translator *t = output_def_l ()->find_translator_l (accepts_str_arr_[i]); if (!t || !t->group_l ()) continue; - - Translator_group * g = t->group_l (); + accepted_arr.push (t->group_l()); + } + + + for (int i=0; i < accepted_arr.size (); i++) + if (accepted_arr[i]->type_str_ == type) + { + Link_array retval; + retval.push (accepted_arr[i]); + return retval; + } + + Link_array best_result; + int best_depth= INT_MAX; + for (int i=0; i < accepted_arr.size (); i++) + { + Translator_group * g = accepted_arr[i]; Link_array result = g->path_to_acceptable_translator (type); - if (result.size ()) + if (result.size () && result.size () < best_depth) { - retval.push (output_def_l ()->find_translator_l (type_str_)->group_l ()); - retval.concat (result); - break; + result.insert (g,0); + best_result = result; } } - return retval; + return best_result; } Translator_group* @@ -116,17 +125,12 @@ Translator_group::find_create_translator_l (String n, String id) Link_array path = path_to_acceptable_translator (n); - /* - if path.size () == 1, then - type_str_ == n, but not id == id_str_ - */ - if (path.size () > 1) + if (path.size ()) { - assert (path.size () > 1); Translator_group * current = this; // start at 1. The first one (index 0) will be us. - for (int i=1; i < path.size (); i++) + for (int i=0; i < path.size (); i++) { Translator_group * new_group = path[i]->clone ()->group_l (); current->add (new_group); diff --git a/make/lilypond.lsm b/make/lilypond.lsm index d554febe9e..4d819522c0 100644 --- a/make/lilypond.lsm +++ b/make/lilypond.lsm @@ -1,7 +1,7 @@ Begin3 Title: LilyPond -Version: 0.1.14 -Entered-date: 14SEP97 +Version: 0.1.15 +Entered-date: 17SEP97 Description: LilyPond is the GNU Project music typesetter. This program converts music definition files into visual or auditive output: it can typeset formatted @@ -14,8 +14,8 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys) jan@digicash.com (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps - 395k lilypond-0.1.14.tar.gz + 395k lilypond-0.1.15.tar.gz Original-site: pcnov095.win.tue.nl /pub/lilypond/ - 395k lilypond-0.1.14.tar.gz + 395k lilypond-0.1.15.tar.gz Copying-policy: GPL End diff --git a/make/lilypond.spec b/make/lilypond.spec index 4717e5d444..f848370fdf 100644 --- a/make/lilypond.spec +++ b/make/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 0.1.14 +Version: 0.1.15 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.1.14.tar.gz +Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.1.15.tar.gz Summary: A preprocessor to make TeX typeset music. URL: http://www.stack.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys @@ -28,8 +28,8 @@ strip lily/out/lilypond mi2mu/out/mi2mu make -C Documentation gifs make prefix="$RPM_BUILD_ROOT/usr" install %files -%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/internals.text Documentation/out/language.text Documentation/out/lilypond.text Documentation/out/links.text Documentation/out/literature.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/mutopia.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README -%doc input/abbrev.ly input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/gallina.ly input/gallina.tex input/header.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/slurs.ly input/standchen-16.tex input/standchen-20.tex input/standchen.ly input/toccata-fuga-E.ly input/twinkle-pop.ly input/twinkle.ly input/wtk1-fugue1.ly input/wtk1-fugue2.ly input/wtk1-prelude1.ly Documentation/mudela-course.doc Documentation/mudela-man.doc +%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/internals.text Documentation/out/language.text Documentation/out/lilypond.text Documentation/out/links.text Documentation/out/literature.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/mutopia.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README +%doc input/abbrev.ly input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/font.ly input/gallina.ly input/gallina.tex input/header.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/slurs.ly input/standchen-16.tex input/standchen-20.tex input/standchen.ly input/toccata-fuga-E.ly input/twinkle-pop.ly input/twinkle.ly input/wtk1-fugue1.ly input/wtk1-fugue2.ly input/wtk1-prelude1.ly Documentation/mudela-course.doc Documentation/mudela-man.doc %doc Documentation/out/lelie_logo.gif /usr/bin/convert-mudela /usr/bin/mudela-book diff --git a/make/lilypond.spec.in b/make/lilypond.spec.in index 2f04d5d6a5..7a871bacb4 100644 --- a/make/lilypond.spec.in +++ b/make/lilypond.spec.in @@ -28,7 +28,7 @@ strip lily/out/lilypond mi2mu/out/mi2mu make -C Documentation gifs make prefix="$RPM_BUILD_ROOT/usr" install %files -%doc @TEXT_DOCS@ +%doc @TEXT_DOCS@ %doc @EXAMPLE_LYS@ %doc Documentation/out/lelie_logo.gif /usr/bin/convert-mudela -- 2.39.2