From a2896b23ce12cc61e9cd4495324c9ca5551cb947 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 3 Jul 1997 16:00:54 +0200 Subject: [PATCH] release: 0.0.72pre --- .dstreamrc | 2 +- .version | 2 +- ANNOUNCE | 2 +- AUTHORS.text | 2 +- BUGS | 17 - Documentation/INSTALL.pod | 12 +- Documentation/lilygut.pod | 51 +-- Documentation/other-packages.pod | 26 +- INSTALL.text | 30 +- NEWS | 22 +- TODO | 9 +- bin/convert-mudela | 11 +- bin/release | 13 +- configure | 65 +++- configure.in | 1 + flower/.version | 2 +- flower/NEWS | 5 + flower/flower-debug.cc | 3 +- init/engraver.ini | 59 ++++ init/paper.ini | 23 ++ init/paper16.ini | 16 + init/register.ini | 59 ---- init/symbol.ini | 6 +- init/{table_sixteen.ini => table16.ini} | 2 +- input/cadenza.ly | 7 +- input/collisions.ly | 6 +- input/header.ly | 2 +- input/kortjakje.ly | 5 +- input/multi.ly | 2 +- input/scales.ly | 38 ++- input/scsii-menuetto.ly | 8 +- input/slurs.ly | 2 +- input/standchen.ly | 16 +- input/toccata-fuga-E.ly | 2 +- input/twinkle.ly | 4 +- input/wohltemperirt.ly | 4 +- lily/.version | 4 +- lily/Stable.make | 2 +- lily/acceptor.cc | 16 - lily/{bar-reg.cc => bar-grav.cc} | 20 +- lily/beam.cc | 33 +- lily/break.cc | 2 +- lily/{clef-reg.cc => clef-grav.cc} | 34 +- lily/clef-item.cc | 4 +- lily/{collision-reg.cc => collision-grav.cc} | 16 +- lily/crescendo.cc | 1 + lily/{dynamic-reg.cc => dynamic-grav.cc} | 26 +- lily/engraver-group.cc | 297 ++++++++++++++++++ lily/engraver.cc | 137 ++++++++ lily/global-gravs.cc | 49 +++ lily/global-regs.cc | 49 --- ...lobal-acceptor.cc => global-translator.cc} | 22 +- lily/{head-reg.cc => head-grav.cc} | 18 +- lily/identifier.cc | 16 +- lily/include/acceptor.hh | 18 +- lily/include/bar-align-grav.hh | 13 + lily/include/bar-align-reg.hh | 13 - lily/include/{bar-reg.hh => bar-grav.hh} | 14 +- lily/include/{clef-reg.hh => clef-grav.hh} | 6 +- lily/include/clef-item.hh | 2 +- .../{collision-reg.hh => collision-grav.hh} | 14 +- .../{dynamic-reg.hh => dynamic-grav.hh} | 16 +- lily/include/engraver-group.hh | 90 ++++++ lily/include/{register.hh => engraver.hh} | 47 +-- ...lobal-acceptor.hh => global-translator.hh} | 8 +- lily/include/{head-reg.hh => head-grav.hh} | 14 +- lily/include/identifier.hh | 7 +- lily/include/input-engraver.hh | 42 +++ lily/include/input-register.hh | 42 --- lily/include/interpretor.hh | 32 -- lily/include/{key-reg.hh => key-grav.hh} | 14 +- lily/include/key-item.hh | 2 +- lily/include/lily-proto.hh | 44 +-- .../{local-key-reg.hh => local-key-grav.hh} | 14 +- lily/include/lookup.hh | 3 +- .../{lyric-register.hh => lyric-engraver.hh} | 14 +- lily/include/{meter-reg.hh => meter-grav.hh} | 14 +- lily/include/midi-walker.hh | 109 ++++--- lily/include/music-iterator.hh | 8 +- ...note-column-reg.hh => note-column-grav.hh} | 14 +- lily/include/paper-def.hh | 28 +- lily/include/register-group.hh | 90 ------ ...ollision-reg.hh => rest-collision-grav.hh} | 14 +- ...score-align-reg.hh => score-align-grav.hh} | 14 +- lily/include/score-column.hh | 2 +- lily/include/score-elem-info.hh | 2 +- lily/include/{score-reg.hh => score-grav.hh} | 26 +- ...ore-halign-reg.hh => score-halign-grav.hh} | 14 +- lily/include/score.hh | 5 +- .../include/{script-reg.hh => script-grav.hh} | 14 +- lily/include/{slur-reg.hh => slur-grav.hh} | 16 +- .../include/{staff-regs.hh => staff-gravs.hh} | 16 +- lily/include/staff-info.hh | 2 +- .../{staff-sym-reg.hh => staff-sym-grav.hh} | 14 +- .../{stem-beam-reg.hh => stem-beam-grav.hh} | 16 +- .../{swallow-reg.hh => swallow-grav.hh} | 14 +- lily/include/{text-reg.hh => text-grav.hh} | 14 +- lily/include/{tie-reg.hh => tie-grav.hh} | 16 +- lily/include/translator.hh | 40 +++ .../include/{voice-regs.hh => voice-gravs.hh} | 12 +- ...ice-group-regs.hh => voice-group-gravs.hh} | 14 +- lily/input-engraver.cc | 117 +++++++ lily/input-register.cc | 117 ------- lily/{key-reg.cc => key-grav.cc} | 28 +- lily/key-item.cc | 12 +- lily/lexer.l | 6 +- lily/{local-key-reg.cc => local-key-grav.cc} | 32 +- lily/lookup.cc | 29 +- lily/{lyric-register.cc => lyric-engraver.cc} | 18 +- lily/{meter-reg.cc => meter-grav.cc} | 36 +-- lily/midi-walker.cc | 131 -------- lily/music-iterator.cc | 38 +-- lily/my-lily-lexer.cc | 2 +- ...note-column-reg.cc => note-column-grav.cc} | 26 +- lily/paper-def.cc | 77 +++-- lily/parser.y | 51 +-- lily/register-group.cc | 297 ------------------ lily/register.cc | 137 -------- ...ollision-reg.cc => rest-collision-grav.cc} | 20 +- ...score-align-reg.cc => score-align-grav.cc} | 14 +- ...ore-align-regs.cc => score-align-gravs.cc} | 14 +- lily/{score-reg.cc => score-grav.cc} | 58 ++-- lily/score-halign-grav.cc | 50 +++ lily/score-halign-reg.cc | 50 --- lily/score.cc | 32 +- lily/{script-reg.cc => script-grav.cc} | 24 +- lily/{slur-reg.cc => slur-grav.cc} | 26 +- lily/staff-gravs.cc | 82 +++++ lily/staff-regs.cc | 82 ----- lily/{staff-sym-reg.cc => staff-sym-grav.cc} | 20 +- lily/{stem-beam-reg.cc => stem-beam-grav.cc} | 24 +- lily/swallow-grav.cc | 19 ++ lily/swallow-reg.cc | 19 -- lily/template3.cc | 4 +- lily/template6.cc | 4 +- lily/tex-slur.cc | 18 +- lily/{text-reg.cc => text-grav.cc} | 24 +- lily/{tie-reg.cc => tie-grav.cc} | 30 +- lily/translator.cc | 16 + lily/voice-gravs.cc | 27 ++ lily/voice-group-gravs.cc | 62 ++++ lily/voice-group-regs.cc | 62 ---- lily/voice-regs.cc | 27 -- make/Configure_variables.make.in | 1 + make/Targets.make | 5 +- make/Variables.make | 2 +- make/lilypond.lsm | 6 +- make/lilypond.spec | 4 +- mf/README | 3 +- mf/musixgen.mf | 11 +- mf/xgreggen.mf | 4 +- 151 files changed, 2161 insertions(+), 2116 deletions(-) delete mode 100644 BUGS create mode 100644 init/engraver.ini create mode 100644 init/paper.ini create mode 100644 init/paper16.ini delete mode 100644 init/register.ini rename init/{table_sixteen.ini => table16.ini} (99%) delete mode 100644 lily/acceptor.cc rename lily/{bar-reg.cc => bar-grav.cc} (69%) rename lily/{clef-reg.cc => clef-grav.cc} (70%) rename lily/{collision-reg.cc => collision-grav.cc} (53%) rename lily/{dynamic-reg.cc => dynamic-grav.cc} (83%) create mode 100644 lily/engraver-group.cc create mode 100644 lily/engraver.cc create mode 100644 lily/global-gravs.cc delete mode 100644 lily/global-regs.cc rename lily/{global-acceptor.cc => global-translator.cc} (62%) rename lily/{head-reg.cc => head-grav.cc} (71%) create mode 100644 lily/include/bar-align-grav.hh delete mode 100644 lily/include/bar-align-reg.hh rename lily/include/{bar-reg.hh => bar-grav.hh} (70%) rename lily/include/{clef-reg.hh => clef-grav.hh} (89%) rename lily/include/{collision-reg.hh => collision-grav.hh} (54%) rename lily/include/{dynamic-reg.hh => dynamic-grav.hh} (72%) create mode 100644 lily/include/engraver-group.hh rename lily/include/{register.hh => engraver.hh} (73%) rename lily/include/{global-acceptor.hh => global-translator.hh} (80%) rename lily/include/{head-reg.hh => head-grav.hh} (63%) create mode 100644 lily/include/input-engraver.hh delete mode 100644 lily/include/input-register.hh delete mode 100644 lily/include/interpretor.hh rename lily/include/{key-reg.hh => key-grav.hh} (77%) rename lily/include/{local-key-reg.hh => local-key-grav.hh} (68%) rename lily/include/{lyric-register.hh => lyric-engraver.hh} (61%) rename lily/include/{meter-reg.hh => meter-grav.hh} (75%) rename lily/include/{note-column-reg.hh => note-column-grav.hh} (72%) delete mode 100644 lily/include/register-group.hh rename lily/include/{rest-collision-reg.hh => rest-collision-grav.hh} (59%) rename lily/include/{score-align-reg.hh => score-align-grav.hh} (59%) rename lily/include/{score-reg.hh => score-grav.hh} (67%) rename lily/include/{score-halign-reg.hh => score-halign-grav.hh} (50%) rename lily/include/{script-reg.hh => script-grav.hh} (69%) rename lily/include/{slur-reg.hh => slur-grav.hh} (71%) rename lily/include/{staff-regs.hh => staff-gravs.hh} (64%) rename lily/include/{staff-sym-reg.hh => staff-sym-grav.hh} (65%) rename lily/include/{stem-beam-reg.hh => stem-beam-grav.hh} (73%) rename lily/include/{swallow-reg.hh => swallow-grav.hh} (54%) rename lily/include/{text-reg.hh => text-grav.hh} (70%) rename lily/include/{tie-reg.hh => tie-grav.hh} (76%) create mode 100644 lily/include/translator.hh rename lily/include/{voice-regs.hh => voice-gravs.hh} (56%) rename lily/include/{voice-group-regs.hh => voice-group-gravs.hh} (63%) create mode 100644 lily/input-engraver.cc delete mode 100644 lily/input-register.cc rename lily/{key-reg.cc => key-grav.cc} (76%) rename lily/{local-key-reg.cc => local-key-grav.cc} (76%) rename lily/{lyric-register.cc => lyric-engraver.cc} (65%) rename lily/{meter-reg.cc => meter-grav.cc} (72%) delete mode 100644 lily/midi-walker.cc rename lily/{note-column-reg.cc => note-column-grav.cc} (77%) delete mode 100644 lily/register-group.cc delete mode 100644 lily/register.cc rename lily/{rest-collision-reg.cc => rest-collision-grav.cc} (67%) rename lily/{score-align-reg.cc => score-align-grav.cc} (60%) rename lily/{score-align-regs.cc => score-align-gravs.cc} (58%) rename lily/{score-reg.cc => score-grav.cc} (74%) create mode 100644 lily/score-halign-grav.cc delete mode 100644 lily/score-halign-reg.cc rename lily/{script-reg.cc => script-grav.cc} (73%) rename lily/{slur-reg.cc => slur-grav.cc} (79%) create mode 100644 lily/staff-gravs.cc delete mode 100644 lily/staff-regs.cc rename lily/{staff-sym-reg.cc => staff-sym-grav.cc} (55%) rename lily/{stem-beam-reg.cc => stem-beam-grav.cc} (86%) create mode 100644 lily/swallow-grav.cc delete mode 100644 lily/swallow-reg.cc rename lily/{text-reg.cc => text-grav.cc} (68%) rename lily/{tie-reg.cc => tie-grav.cc} (75%) create mode 100644 lily/translator.cc create mode 100644 lily/voice-gravs.cc create mode 100644 lily/voice-group-gravs.cc delete mode 100644 lily/voice-group-regs.cc delete mode 100644 lily/voice-regs.cc diff --git a/.dstreamrc b/.dstreamrc index 8087569c36..0d6086e1ea 100644 --- a/.dstreamrc +++ b/.dstreamrc @@ -15,7 +15,7 @@ Idealspacing 0 # yydebug InitParser 1 Parser 1 -InitDeclarations 1 +InitDeclarations 0 Declarations 1 # FlexLexer debug InitLexer 1 diff --git a/.version b/.version index e8b651c3d1..7be2ab2cec 100644 --- a/.version +++ b/.version @@ -1,6 +1,6 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 0 -TOPLEVEL_PATCH_LEVEL = 71 +TOPLEVEL_PATCH_LEVEL = 72 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/ANNOUNCE b/ANNOUNCE index 3c1450f607..96ae973635 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -121,7 +121,7 @@ dynamics (both absolute and hairpin style) clef changes, meter changes, cadenza-mode, key changes, repeat bars [Kudos to the FSF, all linux hackers, and --of course-- especially -GrandMaster Linus T, for the OS-kernel and The Announce :-] +GrandMaster Linus T, for The Kernel and The Announce :-] Han-Wen Nienhuys Jan Nieuwenhuizen diff --git a/AUTHORS.text b/AUTHORS.text index c5e26b01bc..52c105b36c 100644 --- a/AUTHORS.text +++ b/AUTHORS.text @@ -61,6 +61,6 @@ CCCCOOOONNNNTTTTRRRRIIIIBBBBUUUUTTTTOOOORRRRSS -30/Jun/97 LilyPond 0.0.71 1 +30/Jun/97 LilyPond 0.0.72 1 diff --git a/BUGS b/BUGS deleted file mode 100644 index 76d2ecd7a5..0000000000 --- a/BUGS +++ /dev/null @@ -1,17 +0,0 @@ -This file documents bugs which were "re-introduced" in various pl's - -pl 70 - * r^"simile" - - -pl69 - * scales.ly - - * slurs.ly - -pl68: - * opening rests wohltemperirt - - * lyrics broken, - - * midi broken diff --git a/Documentation/INSTALL.pod b/Documentation/INSTALL.pod index 23a464b0a4..2fc99a0933 100644 --- a/Documentation/INSTALL.pod +++ b/Documentation/INSTALL.pod @@ -209,7 +209,7 @@ TeX =item * The MusixTeX fonts. (I use those found in MusixTeX T.59). Beware, the -clef symbol has changed position in recent versions of MusixTeX) +clef symbol has changed position in the Egler version, aka. OpusTeX) =back @@ -222,11 +222,13 @@ quality. If you're not discouraged; this is what I type in my xterm: This is what the output looks like over here: - hw:~/musix/spacer$ GNU LilyPond 0.0.60 #8/FlowerLib 1.1.14 #2 - Parsing ... [./input/kortjakje.ly[lots of stuff]] - Setting up requests...Processing requests ...[8][16][24][25] + hw:~/musix/spacer$ lilypond input/kortjakje.ly + GNU LilyPond 0.0.71 #20/FlowerLib 1.1.20 #0 + Parsing ... [/home/hw/share/lilypond/init//symbol.ini <..snip..> + .. .ini]][input/kortjakje.ly] + Creating elements ... Preprocessing elements... - Calculating column positions ... [3][7][12][16][20][25] + Calculating column positions ... [3][8][13][17][21][25] Postprocessing elements... TeX output to lelie.tex ... diff --git a/Documentation/lilygut.pod b/Documentation/lilygut.pod index 52f787c2f7..ef3249ec8a 100644 --- a/Documentation/lilygut.pod +++ b/Documentation/lilygut.pod @@ -36,8 +36,9 @@ to Requests are processed and used to create elements (like balls, stems, slurs etc). This is done by a hierarchy of "brokers" (called -Register), which swallow requests, broadcast them and couple different -elements. +Translators: the ones for paper output are Engravers, for MIDI +Performers), which swallow requests, broadcast them and couple +different elements. In this step data-structures for the next steps are created and filled with data: PScore, PCol. @@ -158,7 +159,7 @@ from the start of its note. Voice group is a (time-dependent) collection of voices which share some characteristics (slurs, stems) at some time. -=head1 Request_register +=head1 Request_engraver In the previous section the idea of Request has been explained, but this only solves one half of the problem. The other half is @@ -176,18 +177,18 @@ should be merged. The slurs OTOH are specific for each voice, so they should not be shared. The judge in this "allocation" problem is Staff (actually, it's child -C). It uses the C to do most of the +C). It uses the C to do most of the work. For each request C queries so-called -Cs if they want to accept a request eg, the -C will accept Cs, and turn down -Cs. If C cannot find a register that wants +Cs if they want to accept a request eg, the +C will accept Cs, and turn down +Cs. If C cannot find a engraver that wants the request, it is junked (with a warning message). -After all requests have been either assigned, or junked, the Register +After all requests have been either assigned, or junked, the Engraver will process the requests (which usually means creating an C or -C). If a C creates something, it tells +C). If a C creates something, it tells C. If all requests have been processed, then each -Register is notified of any created Staff_element. +Engraver is notified of any created Staff_element. =head2 example: @@ -198,15 +199,15 @@ produces: note_request (duration 1/4) stem_request (duration 1/4) -note_request will be taken by a C, stem_request -will be taken by a C. C creates -a C, C creates a C. Both announce -this to the Staff. Staff will tell C about the +note_request will be taken by a C, stem_request +will be taken by a C. C creates +a C, C creates a C. Both announce +this to the Staff. Staff will tell C about the C, which will add the C to the C it just created. To decide on merging, C has grouped several -registers. There are a few groups: +engravers. There are a few groups: =over 4 @@ -214,26 +215,26 @@ registers. There are a few groups: Staff wide, contains - Local_key_register - Bar_register - Key_register - Meter_register - Clef_register + Local_key_engraver + Bar_engraver + Key_engraver + Meter_engraver + Clef_engraver =item * Voice group, contains - Stem_beam_register - Script_register - Text_register + Stem_beam_engraver + Script_engraver + Text_engraver =item * Voice, contains - Slur_register - Notehead_register + Slur_engraver + Notehead_engraver =back diff --git a/Documentation/other-packages.pod b/Documentation/other-packages.pod index 55ecd4c6df..c52c1dbb00 100644 --- a/Documentation/other-packages.pod +++ b/Documentation/other-packages.pod @@ -17,27 +17,23 @@ Rosegarden, http://www.math.bath.ac.uk/~masjpf/rose.html A Notation editor/Sequencer for X (win95 port underway). Outputs musictex. -Common Notation, ftp://ccrma-ftp.stanford.edu/pub/Lisp +Common Notation, http://www-ccrma.stanford.edu/ccrma/Software/cmn/cmn.html A versatile lisp package. Part of the Common Music system. Input is in Lisp. -Vivace, http:// +Vivace, http://www.calband.berkeley.edu/~gmeeker/vivace -A amateurish notation program for TclTk and X +A amateurish notation program for TclTk and X. MPP, http://www.stack.nl/~hanwen/mpp-english.html A preprocessor to MusixTeX by Jan Nieuwenhuizen and Han-Wen Nienhuys. It is outdated by its successor, LilyPond. -Music, http:// +Music, http://www.cs.nott.ac.uk/Departement/Staff/ef/printing.html A TROFF preprocessor by Eric Foxley -MusicEase, ftp://ftp.secret.com/ad-ftp - -Described in Computer vol 29(6) - MusE A-R Music Engraving, by A-R Editions, Inc. Professional engraving on @@ -46,7 +42,7 @@ Sun boxen. Mup, http://www.arkkra.com/ A program which creates PS from a script input. Although it comes with -C source code, it is Shareware ($ 29). +C source code, it is Shareware. PMX, http://www.gmd.de/Misc/Music/ @@ -63,7 +59,7 @@ ABC2MTeX, http://www.gmd.de/Misc/Music/ A preprocessor to MusixTeX by Chris Walshaw for way of transcribing folk and traditional music. -SceX +SceX http://www.ncc.up.pt/~mig/SceX.html A preprocessor to MusixTeX by Miguel Filgueiras. Source in prolog available on request. (?) @@ -78,10 +74,14 @@ Schofer & Andrea Steinbach. With some fonts Calliope, http://www.cl.cam.ac.uk/users/wfc/ -A NeXT package by William F Clocksin. Requires Adobe fonts +A NeXT package by William F Clocksin. Requires Adobe fonts. =head2 Proprietary +MusicEase, http://mesa.colorado.edu/~grader/musicez.html + +Described in Computer vol 29(6). Shareware + LIME, http://datura.cerl.uiuc.edu/ Sibelius, http://www.acorn.co.uk/developers/sibelius @@ -92,9 +92,9 @@ Score Personal Composer -Mozart, +Mozart, http://www.mozart.co.uk/ -A shareware windows package, +A shareware windows package Capella diff --git a/INSTALL.text b/INSTALL.text index 8d66791533..3710c04ef9 100644 --- a/INSTALL.text +++ b/INSTALL.text @@ -61,7 +61,7 @@ CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG a -28/May/97 LilyPond 0.0.71 1 +3/Jul/97 LilyPond 0.0.72 1 @@ -127,7 +127,7 @@ INSTALL(1) LilyPond documentation INSTALL(1) -28/May/97 LilyPond 0.0.71 2 +3/Jul/97 LilyPond 0.0.72 2 @@ -193,7 +193,7 @@ RRRRUUUUNNNNNNNNIIIINNNNGGGG -28/May/97 LilyPond 0.0.71 3 +3/Jul/97 LilyPond 0.0.72 3 @@ -213,7 +213,7 @@ INSTALL(1) LilyPond documentation INSTALL(1) +o The MusixTeX fonts. (I use those found in MusixTeX T.59). Beware, the clef symbol has changed position - in recent versions of MusixTeX) + in the Egler version, aka. OpusTeX) At this time, GNU LilyPond output looks nice, but is not of production quality. If you're not discouraged; this is @@ -225,11 +225,13 @@ INSTALL(1) LilyPond documentation INSTALL(1) This is what the output looks like over here: - hw:~/musix/spacer$ GNU LilyPond 0.0.60 #8/FlowerLib 1.1.14 #2 - Parsing ... [./input/kortjakje.ly[lots of stuff]] - Setting up requests...Processing requests ...[8][16][24][25] + hw:~/musix/spacer$ lilypond input/kortjakje.ly + GNU LilyPond 0.0.71 #20/FlowerLib 1.1.20 #0 + Parsing ... [/home/hw/share/lilypond/init//symbol.ini <..snip..> + .. .ini]][input/kortjakje.ly] + Creating elements ... Preprocessing elements... - Calculating column positions ... [3][7][12][16][20][25] + Calculating column positions ... [3][8][13][17][21][25] Postprocessing elements... TeX output to lelie.tex ... @@ -253,13 +255,11 @@ RRRREEEEDDDDHHHHAAAATTTT LLLLIIIINNNNUUUUXXXX create an rpm as a normal user. Be sure you have a ~/.rpmrc, and edit the RPM-dir in _V_a_r_i_a_b_l_e_s_._m_a_k_e -WWWWIIIINNNNDDDDOOOOZZZZEEEE - Windows NT: -28/May/97 LilyPond 0.0.71 4 +3/Jul/97 LilyPond 0.0.72 4 @@ -268,6 +268,9 @@ WWWWIIIINNNNDDDDOOOOZZZZEEEE INSTALL(1) LilyPond documentation INSTALL(1) +WWWWIIIINNNNDDDDOOOOZZZZEEEE + Windows NT: + you need the cygnus windows32 gnu port development stuff; have a look at http://www.cygnus.com/gnu-win32. @@ -322,9 +325,6 @@ AAAAUUUUTTTTHHHHOOOORRRRSSSS - - - -28/May/97 LilyPond 0.0.71 5 +3/Jul/97 LilyPond 0.0.72 5 diff --git a/NEWS b/NEWS index 78e451c794..71128cd93f 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,22 @@ +july 2 +pl 72pre + - paper{} syntax: var = 1.0\pt;, with an Assoc array + - sketch of MIDI Performer classes. + - bf: memleak in parser + - naming: Acceptor -> Translator + - input: bf collisions.ly, scales.ly + - bf: [r8 c8] + - naming: Register -> Engraver + - force \\ on identifiers + - doco updates + - musixtex T73 fonts + +pl 70.mb + - bf: find syntax in Variables.make +***** +july 1 pl 71pre + - nested \melodic and \lyric constructs - init id's, Input_register aliases. - bf: notehead x-swap - bf: auto-keys. @@ -14,6 +32,8 @@ pl 71pre ****** june 30 + + pl 70pre - bf: text Script - bf: Script::dir_i_ checks. @@ -190,7 +210,7 @@ pl 63 - accumulate \kern in TeX output. - bf: try to prevent long lines; TeX breaks on them. - naming: Pointer->Link, IPointer->Pointer - - undocced fix (MB) + - bf: \plet didn't work (MB) - GMP manifesto. pl 61.jcn4 diff --git a/TODO b/TODO index 1b65c99ac0..cd3a973460 100644 --- a/TODO +++ b/TODO @@ -71,7 +71,7 @@ PROJECTS - separate visual from rhythmic info even more - beams over bars - * Redo MIDI output to use Registers: (Difficult) + * Redo MIDI output to use Translators - remember more horizontal info than melodics: - tempo change - repeat @@ -88,7 +88,7 @@ PROJECTS read AFM/TFM directly, for text too) * lines: - - Ledger lines, should be separate item: Ledger_lines, Ledger_lines_reg + - Ledger lines, should be separate item: Ledger_lines, Ledger_lines - set different line sizes / thicknesses - stem down too far right - beam stem showthrough, inter beam sizes (french vs german style) @@ -323,7 +323,8 @@ IDEAS * use an embedded language: Python for: - Score_elems - - Registers + - Engraver + - Translators - Complex mudela? * y -dims in internote? @@ -361,3 +362,5 @@ IDEAS * move towards incremental algorithms. + + * design meta-language like TeX and Metafont diff --git a/bin/convert-mudela b/bin/convert-mudela index 744059c67c..000f5059cb 100755 --- a/bin/convert-mudela +++ b/bin/convert-mudela @@ -87,7 +87,7 @@ sub convert_0_0_57_to_0_0_58 s/\[ *([^\[\]]*)\] *([1-9]*) *\/ *([1-9]*)/[$2\/$3 $1]1\/1/g; } -sub convert_0_0_58_to_0_0_58 +sub convert_0_0_58_to_0_0_59 { die "Not smart enough to convert 0.0.58 to 0.0.59\n"; } @@ -99,6 +99,12 @@ sub convert_0_0_59_to_0_0_60 s/(\\tempo [0-9: ]+)/$1;/; } +sub convert_0_0_60_to_0_0_61 +{ + s/(\\unitspace|\\geometric|\\width)/$1=/g; + +} + ############################################################### sub last_conversion @@ -137,7 +143,8 @@ my %minor_conversions = ("0.0.50" => \&no_conv, "0.0.57" => \&convert_0_0_56_to_0_0_57, "0.0.58" => \&convert_0_0_57_to_0_0_58, "0.0.59" => \&convert_0_0_58_to_0_0_59, - "0.0.60" => \&convert_0_0_59_to_0_0_60 + "0.0.60" => \&convert_0_0_59_to_0_0_60, + "0.0.61" => \&convert_0_0_60_to_0_0_61 ); diff --git a/bin/release b/bin/release index 58de89b692..0cd180d68b 100755 --- a/bin/release +++ b/bin/release @@ -11,12 +11,13 @@ fi function setversion() { eval `sed -n 's/^\([A-Z_]*\) *= *\(.*\)$/\1=\2/p' .version` + MJ=$TOPLEVEL_MAJOR_VERSION MI=$TOPLEVEL_MINOR_VERSION PA=$TOPLEVEL_PATCH_LEVEL MP=$TOPLEVEL_MY_PATCH_LEVEL NEWVER=$MJ.$MI.$PA$MP -if [ -z $MP -o x$MP = xpre ] +if [ x$MP = x -o x$MP = xpre ] then LASTVER=$MJ.$MI.`expr $PA - 1` @@ -35,7 +36,11 @@ echo heredir=`pwd` releasedir=`pwd`/../releases patchdir=`pwd`/../patches -make dist; +MAKE=${MAKE:-"make"} +TAR=${TAR:-"tar"} + + +$MAKE dist; setversion LILYVER=$NEWVER @@ -63,6 +68,6 @@ ln $patchdir//$patch . if [ ! -z "$RPMS" ]; then RPMS="lilypond-$LILYVER-1.i386.rpm lilypond-$LILYVER-1.src.rpm" fi -tar cf updeet $tarball $patch $RPMS -tar tfv updeet +$TAR cf updeet $tarball $patch $RPMS +$TAR tfv updeet diff --git a/configure b/configure index 69cb91109b..e409e1430d 100755 --- a/configure +++ b/configure @@ -889,12 +889,46 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -for ac_prog in find +for ac_prog in tar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:898: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$TAR"; then + ac_cv_prog_TAR="$TAR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_TAR="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +TAR="$ac_cv_prog_TAR" +if test -n "$TAR"; then + echo "$ac_t""$TAR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$TAR" && break +done +test -n "$TAR" || TAR="error" + +for ac_prog in find +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:932: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -948,7 +982,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:952: checking for $ac_word" >&5 +echo "configure:986: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -982,7 +1016,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:986: checking for $ac_word" >&5 +echo "configure:1020: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1016,7 +1050,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1020: checking for $ac_word" >&5 +echo "configure:1054: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1050,7 +1084,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1054: checking for $ac_word" >&5 +echo "configure:1088: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PODMAN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1086,7 +1120,7 @@ if test "x$TEXPREFIX" = xauto ; then echo $ac_n "checking TeX/MF root dir directory""... $ac_c" 1>&6 -echo "configure:1090: checking TeX/MF root dir directory" >&5 +echo "configure:1124: checking TeX/MF root dir directory" >&5 find_root_prefix="$prefix" @@ -1124,7 +1158,7 @@ if test "x$TEXDIR" = xauto ; then echo $ac_n "checking TeX input directory""... $ac_c" 1>&6 -echo "configure:1128: checking TeX input directory" >&5 +echo "configure:1162: checking TeX input directory" >&5 find_dirdir=`(cd $find_texprefix; $FIND ./ -type d -a -name tex -print |sort|head -1|sed 's#^\./##')` @@ -1146,7 +1180,7 @@ if test "x$MFDIR" = xauto; then echo $ac_n "checking MF input directory""... $ac_c" 1>&6 -echo "configure:1150: checking MF input directory" >&5 +echo "configure:1184: checking MF input directory" >&5 find_dirdir=`(cd $find_texprefix; $FIND ./ -type d -a -name source -print |sort|head -1|sed 's#^\./##')` @@ -1202,7 +1236,7 @@ else fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:1206: checking how to run the C++ preprocessor" >&5 +echo "configure:1240: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1215,12 +1249,12 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1240,17 +1274,17 @@ echo "$ac_t""$CXXCPP" 1>&6 ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6 -echo "configure:1244: checking for FlexLexer.h" >&5 +echo "configure:1278: checking for FlexLexer.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1421,6 +1455,7 @@ s%@CXX@%$CXX%g s%@RANLIB@%$RANLIB%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@TAR@%$TAR%g s%@FIND@%$FIND%g s%@ICFLAGS@%$ICFLAGS%g s%@ILDFLAGS@%$ILDFLAGS%g @@ -1652,7 +1687,7 @@ fi eval "DIR_DATADIR=$datadir" DIR_DATADIR="$DIR_DATADIR/lilypond" echo $ac_n "checking ""... $ac_c" 1>&6 -echo "configure:1656: checking " >&5 +echo "configure:1691: checking " >&5 cat << EOF > lib/out/config.hh diff --git a/configure.in b/configure.in index 9cffeaeae8..5fbb758a3e 100644 --- a/configure.in +++ b/configure.in @@ -158,6 +158,7 @@ CXXFLAGS=${CXXFLAGS:-""} # we don't want -g -O junk AC_PROG_CXX AC_PROG_RANLIB AC_PROG_INSTALL +AC_CHECK_PROGS(TAR, tar, error) AC_CHECK_PROGS(FIND, find, error) dnl should check out -print diff --git a/flower/.version b/flower/.version index 7a6f85cea4..4575a2e82a 100644 --- a/flower/.version +++ b/flower/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 1 MINOR_VERSION = 1 -PATCH_LEVEL = 20 +PATCH_LEVEL = 21 # 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 a642a93eba..40740f0bb1 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -1,4 +1,9 @@ version 1.1: + +pl 21: +pl 20.mb + - bf: Warning about NPRINT only if debugging requested. + pl 20 - List::junk_links() pl 19 diff --git a/flower/flower-debug.cc b/flower/flower-debug.cc index 702304e71f..7e0e519f57 100644 --- a/flower/flower-debug.cc +++ b/flower/flower-debug.cc @@ -13,7 +13,8 @@ Dstream *flower_dstream = &default_flower_stream; void set_flower_debug(Dstream&ds, bool b) { #ifdef NPRINT - cout << "Debug printout disabled, see the installation guide." << endl; + if (b) + cout << "Debug printout disabled, see the installation guide." << endl; #endif flower_check_debug = b; flower_dstream = &ds; diff --git a/init/engraver.ini b/init/engraver.ini new file mode 100644 index 0000000000..086e378ae1 --- /dev/null +++ b/init/engraver.ini @@ -0,0 +1,59 @@ +% +% setup for Request->Element conversion. Guru-only +% + +\requestengraver { + "Score_engraver" + \alias "Score"; +% \consists "Score_bar_engraver"; + \consists "Bar_align_engraver"; + \consists "Clef_align_engraver"; + \consists "Key_align_engraver"; + \consists "Meter_align_engraver"; + \consists "Score_horizontal_align_engraver"; + + \contains\requestengraver { + "Staff_engravers" + \alias "Staff"; + \consists "Bar_engraver"; + \consists "Clef_engraver"; + \consists "Key_engraver"; + \consists "Meter_engraver"; + \consists "Local_key_engraver"; + \consists "Staff_sym_engraver"; + \consists "Collision_engraver"; + \consists "Rest_collision_engraver"; + \contains \requestengraver { + "Voice_group_engravers" + \alias "Voice_group"; + \consists "Dynamic_engraver"; + \consists "Stem_beam_engraver"; + \consists "Script_engraver"; + \consists "Note_column_engraver"; + \consists "Slur_engraver"; + \contains \requestengraver { + "Voice_engravers" + \alias "Voice"; + \consists "Note_head_engraver" ; + \consists "Tie_engraver"; + } + } + } + + \contains\requestengraver { + "Staff_engravers" + \alias "Lyric"; + \contains\requestengraver{ + "Voice_group_engravers" + \alias "Voice_group"; + \contains\requestengraver{ + "Voice_engravers" + \consists "Lyric_engraver"; + \consists "Swallow_engraver"; + } + } + } +} + + + diff --git a/init/paper.ini b/init/paper.ini new file mode 100644 index 0000000000..1c15975a9e --- /dev/null +++ b/init/paper.ini @@ -0,0 +1,23 @@ + + [todo] + * runtime + +%{ "french" style: interbeam = intenote; + "german" style: interbeam = 2/3 * interline +%} + as lily's style is currently german, we'll hardcode german style + */ + // it seems that "interline" means _between_ lines +// return ball(4).dim.y.length() * 2 / 3; + return ball(4).dim.y.length() * 2 / 3 + 0.4; //ugh +} +\include "table_sixteen.ini" + +default_paper = paper { + linewidth = 15 \cm; + rule_thickness = 0.4\pt; + interline = 4\pt; + notewidth = 4\pt; + interbeam = 7\pt; + \symboltables { \table_sixteen } +} diff --git a/init/paper16.ini b/init/paper16.ini new file mode 100644 index 0000000000..7854e3850a --- /dev/null +++ b/init/paper16.ini @@ -0,0 +1,16 @@ + +\include "table16.ini" + +default_paper = \paper { + linewidth = 15.0 \cm; + rule_thickness = 0.4\pt; + interline = 4.\pt; + notewidth = 4.0\pt; + wholewidth = 5.\pt; + unitspace = 30.\pt; + + % + interbeam = 2.667\pt; + geometric = 1.414; + \symboltables { \table_sixteen } +} diff --git a/init/register.ini b/init/register.ini deleted file mode 100644 index 16b868b206..0000000000 --- a/init/register.ini +++ /dev/null @@ -1,59 +0,0 @@ -% -% setup for Request->Element conversion. Guru-only -% - -\requestregister { - "Score_register" - \alias "Score"; -% \consists "Score_bar_register"; - \consists "Bar_align_register"; - \consists "Clef_align_register"; - \consists "Key_align_register"; - \consists "Meter_align_register"; - \consists "Score_horizontal_align_register"; - - \contains\requestregister { - "Staff_registers" - \alias "Staff"; - \consists "Bar_register"; - \consists "Clef_register"; - \consists "Key_register"; - \consists "Meter_register"; - \consists "Local_key_register"; - \consists "Staff_sym_register"; - \consists "Collision_register"; - \consists "Rest_collision_register"; - \contains \requestregister { - "Voice_group_registers" - \alias "Voice_group"; - \consists "Dynamic_register"; - \consists "Stem_beam_register"; - \consists "Script_register"; - \consists "Note_column_register"; - \consists "Slur_register"; - \contains \requestregister { - "Voice_registers" - \alias "Voice"; - \consists "Note_head_register" ; - \consists "Tie_register"; - } - } - } - - \contains\requestregister { - "Staff_registers" - \alias "Lyric"; - \contains\requestregister{ - "Voice_group_registers" - \alias "Voice_group"; - \contains\requestregister{ - "Voice_registers" - \consists "Lyric_register"; - \consists "Swallow_register"; - } - } - } -} - - - diff --git a/init/symbol.ini b/init/symbol.ini index df9c040652..bb067af6b2 100644 --- a/init/symbol.ini +++ b/init/symbol.ini @@ -1,9 +1,9 @@ -\version "0.0.60"; +\version "0.0.61"; -\include "register.ini" +\include "engraver.ini" \include "dynamic.ini" \include "dutch.ini" % do not include init/ path \include "script.ini" -\include "table_sixteen.ini" +\include "paper16.ini" diff --git a/init/table_sixteen.ini b/init/table16.ini similarity index 99% rename from init/table_sixteen.ini rename to init/table16.ini index f012438622..62abd29e37 100644 --- a/init/table_sixteen.ini +++ b/init/table16.ini @@ -160,4 +160,4 @@ table_sixteen= } } -default_table = \symboltables { table_sixteen } + diff --git a/input/cadenza.ly b/input/cadenza.ly index 3bdc51e5a3..90f7c45c8f 100644 --- a/input/cadenza.ly +++ b/input/cadenza.ly @@ -10,7 +10,7 @@ EndMudelaHeader %} -\version "0.0.60"; +\version "0.0.61"; cad = \melodic { @@ -59,7 +59,8 @@ cad = \melodic { \melodic{ \cad } \paper { - \unitspace 14.0\mm; - \geometric 1.4;} + unitspace= 14.0\mm; + geometric= 1.4; + } % \midi { \tempo 4:90 } } diff --git a/input/collisions.ly b/input/collisions.ly index de6805fed9..fa1c3f71c0 100644 --- a/input/collisions.ly +++ b/input/collisions.ly @@ -10,7 +10,7 @@ Tested Features:test the Collision resolution EndMudelaHeader %} -\version "0.0.60"; +\version "0.0.61"; @@ -52,7 +52,7 @@ rests = \melodic } { \stem -1; [c8 d e f] [g a b c'] - r r r r r r r r r + r r r r r r r r } > @@ -66,7 +66,7 @@ restsII = \melodic { { \stem 1; r r r r r r r r r r r r } { \stem -1; c d e f g a b c' d' e' f' g' } > - r8 + r8 r4 < \multi2; r8 r8 > < \multi2; r8 r8 r8 > < \multi2; r8 r8 r8 r8 > diff --git a/input/header.ly b/input/header.ly index e983bcb8df..f7ab263e0a 100644 --- a/input/header.ly +++ b/input/header.ly @@ -10,4 +10,4 @@ Tested Features: EndMudelaHeader %} -\version "0.0.60"; +\version "0.0.61"; diff --git a/input/kortjakje.ly b/input/kortjakje.ly index 91e733abe3..16099a6ec9 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -10,7 +10,7 @@ Tested Features: example file with comments EndMudelaHeader %} -\version "0.0.60"; +\version "0.0.61"; % the % is a comment. @@ -63,8 +63,5 @@ begeleiding = \melodic{ \melodie \begeleiding > - \paper{ - \unitspace 2.5\cm; % a whole note takes 2.5 \cm ideally. - } } diff --git a/input/multi.ly b/input/multi.ly index caafc66d16..275db41102 100644 --- a/input/multi.ly +++ b/input/multi.ly @@ -12,7 +12,7 @@ EndMudelaHeader %} -\version "0.0.60"; +\version "0.0.61"; \score{ \melodic diff --git a/input/scales.ly b/input/scales.ly index 7f7b935fcb..c1f32c13bc 100644 --- a/input/scales.ly +++ b/input/scales.ly @@ -2,7 +2,7 @@ % scales with accents. % -\version "0.0.60"; +\version "0.0.61"; blah = \melodic { \meter 6/8; \octave 'c ; @@ -14,21 +14,31 @@ blah = \melodic { \octave c' ; \transpose d { e f } \octave c'' ; - c d - \duration 8 ; + c4. d %ugr - |[6/9 a \< a a a a a a \! a a \ff \> ]1/1 + |[6/9 a8 \< a a a a a a \! a a \ff \> ]1/1 | \octave c' ; - |[6/9 a a a a a a a a \! a ]1/1 + |[6/9 a a a a a a a a \! a ]1/1 | \octave c'' ; + + [6/9'c->-.-\fermata \< 'g->-.-\fermata + d->-.-\fermata a->-.-\fermata + e'->-.-\fermata b'-. f''-. c'''->-.-\fermata + \! g'''->-.-\fermata \> ]1/1 - ['c->-.-\fermata \< 'g->-.-\fermata d->-.-\fermata a->-.-\fermata - e'->-.-\fermata b'-. f''-. c'''->-.-\fermata \! g'''->-.-\fermata \> ]6/9 - [6/9 g'''->-.-\fermata c'''->-.-\fermata f''->-.-\fermata b'->-.-\fermata e'->-.-\fermata a->-.-\fermata d->-.-\fermata 'g->-.-\fermata \! 'c->-.-\fermata ]1/1 + [6/9 g'''->-.-\fermata c'''->-.-\fermata + f''->-.-\fermata b'->-.-\fermata e'->-.-\fermata + a->-.-\fermata d->-.-\fermata 'g->-.-\fermata \! + 'c->-.-\fermata ]1/1 \octave c; - ['c->-.-\fermata \< 'g->-.-\fermata d->-.-\fermata a->-.-\fermata - e'->-.-\fermata b'-. f''-. c'''->-.-\fermata \! g'''->-.-\fermata \> ]6/9 - [6/9 g'''->-.-\fermata c'''->-.-\fermata f''->-.-\fermata b'->-.-\fermata e'->-.-\fermata a->-.-\fermata d->-.-\fermata 'g->-.-\fermata \! 'c->-.-\fermata ]1/1 + [6/9'c->-.-\fermata \< 'g->-.-\fermata d->-.-\fermata + a->-.-\fermata + e'->-.-\fermata b'-. f''-. + c'''->-.-\fermata \! g'''->-.-\fermata \> ]1/1 + [6/9 g'''->-.-\fermata c'''->-.-\fermata + f''->-.-\fermata b'->-.-\fermata e'->-.-\fermata + a->-.-\fermata d->-.-\fermata + 'g->-.-\fermata \! 'c->-.-\fermata ]1/1 \octave c' ; \octave c' ; [2/3 c g d' ]1/1 @@ -42,7 +52,7 @@ blah = \melodic { [2/3 g' c' f ]1/1 [2/3 g' c' f ]1/1 \meter 4/4; - + c1 \duration 8; r8-"text" r8^. r8_. r8 r8 r8 r8 r8 @@ -66,7 +76,7 @@ c1 \score{ \melodic {\blah} \paper{ - \unitspace 1.5 \cm; - \geometric 1.4; + unitspace= 1.5 \cm; + geometric= 1.4; } } diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 1af7644ba5..8f4b5daa77 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -13,7 +13,7 @@ EndMudelaHeader %} -\version "0.0.60"; +\version "0.0.61"; %% Stuff from MPP version % \lefttitle{Menuetto} @@ -103,9 +103,9 @@ IImenuetto = \melodic{ \score{ \melodic { \IImenuetto } \paper{ - \width 195.0\mm; - \unitspace 9.0\mm ;% to get lily to use only three lines - \geometric 1.40; + width= 195.0\mm; + unitspace= 9.0\mm ;% to get lily to use only three lines + geometric= 1.40; \output "scsii-menuetto.out"; } \midi{ diff --git a/input/slurs.ly b/input/slurs.ly index 8da7292ed5..29ad8cf5c0 100644 --- a/input/slurs.ly +++ b/input/slurs.ly @@ -11,7 +11,7 @@ EndMudelaHeader %} -\version "0.0.60"; +\version "0.0.61"; \score{ \melodic{\octave c'; diff --git a/input/standchen.ly b/input/standchen.ly index a4dd55c3fd..516a503309 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -13,7 +13,7 @@ EndMudelaHeader %} -\version "0.0.60"; +\version "0.0.61"; commands = \melodic{ \skip 2.*4; @@ -29,7 +29,7 @@ commands = \melodic{ melodie = \melodic{ \meter 3/4; - \clef\violin; + \clef "violin"; \key bes; \octave c'; \duration 8; @@ -184,7 +184,7 @@ melodie = \melodic{ begeleiding = \melodic{ \meter 3/4; - \clef\bass; + \clef"bass"; \key bes; \octave c'; \duration 2; @@ -466,19 +466,19 @@ tekstII = \lyric{ \score{ < \multi 3; - { \id "Lyric" "1"; tekstI } % ugh - { \id "Lyric" "2"; tekstII } + { \id "Lyric" "1"; \tekstI } % ugh + { \id "Lyric" "2"; \tekstII } \melodic < \melodie \commands > \melodic <\begeleiding \commands > > \paper{ - \width 195.\mm; + width= 195.\mm; % on two pages... - \unitspace 9.\mm; - \geometric 1.2; + unitspace= 9.\mm; + geometric= 1.2; \output "standchen.out"; } \midi{ diff --git a/input/toccata-fuga-E.ly b/input/toccata-fuga-E.ly index f34df19761..b912fb5f0b 100644 --- a/input/toccata-fuga-E.ly +++ b/input/toccata-fuga-E.ly @@ -20,7 +20,7 @@ EndMudelaHeader %} -\version "0.0.60"; +\version "0.0.61"; toccata_commands = \melodic{ \meter 4/4; diff --git a/input/twinkle.ly b/input/twinkle.ly index fb986f1ae4..e3f0619b63 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -14,7 +14,7 @@ Tested Features: lyrics EndMudelaHeader %} -\version "0.0.60"; +\version "0.0.61"; melody = \melodic{ \clef\violin; @@ -124,7 +124,7 @@ textiii = \lyric{ \melodic < \global \accompany > > \paper{ - \unitspace 2.5\cm; + unitspace= 2.5\cm; } \midi{ \tempo 4:120 ; diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index ff2f0a6ef9..89970f8776 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -1,7 +1,7 @@ %{ title: Das Wohltemperirte Clavier I, Fuga II (c-minor) description: following Henle's Urtext - composer(s): JS Bach + composer(s): J.S. Bach entered-by: HWN and Werner Lemberg copyright: Public Domain @@ -9,7 +9,7 @@ %} -\version "0.0.60"; +\version "0.0.61"; % should add \need{dutch.ini} for % correct parsing of note names diff --git a/lily/.version b/lily/.version index 27a118a8d6..01a36845dc 100644 --- a/lily/.version +++ b/lily/.version @@ -1,7 +1,7 @@ MAJOR_VERSION = 0 MINOR_VERSION = 0 -PATCH_LEVEL = 71 +PATCH_LEVEL = 72 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf -MY_PATCH_LEVEL = +MY_PATCH_LEVEL = pre diff --git a/lily/Stable.make b/lily/Stable.make index 3d50ce8261..71e49f46c8 100644 --- a/lily/Stable.make +++ b/lily/Stable.make @@ -7,4 +7,4 @@ stablecc=atom.cc command-request.cc musical-request.cc bar.cc boxes.cc \ paper-def.cc parser.cc lexer.cc qlp.cc qlpsolve.cc\ template1.cc template2.cc template3.cc template4.cc\ template5.cc template6.cc version.cc tex-stream.cc tex.cc\ - identifier.cc note.cc voice-regs.cc\ + identifier.cc note.cc voice-gravs.cc\ diff --git a/lily/acceptor.cc b/lily/acceptor.cc deleted file mode 100644 index 0164b83b24..0000000000 --- a/lily/acceptor.cc +++ /dev/null @@ -1,16 +0,0 @@ -/* - acceptor.cc -- implement Acceptor - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - -#include "acceptor.hh" -Acceptor::Acceptor() -{ - iterator_count_ = 0; -} - -IMPLEMENT_STATIC_NAME(Acceptor); -IMPLEMENT_IS_TYPE_B(Acceptor); diff --git a/lily/bar-reg.cc b/lily/bar-grav.cc similarity index 69% rename from lily/bar-reg.cc rename to lily/bar-grav.cc index 46f7bf3b82..4282803b05 100644 --- a/lily/bar-reg.cc +++ b/lily/bar-grav.cc @@ -1,23 +1,23 @@ /* - bar-reg.cc -- implement Bar_register + bar-reg.cc -- implement Bar_engraver source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys */ -#include "bar-reg.hh" +#include "bar-grav.hh" #include "bar.hh" #include "command-request.hh" #include "time-description.hh" -Bar_register::Bar_register() +Bar_engraver::Bar_engraver() { do_post_move_processing(); } bool -Bar_register::do_try_request(Request*r_l) +Bar_engraver::do_try_request(Request*r_l) { Command_req* c_l = r_l->command(); if (!c_l|| !c_l->bar()) @@ -32,7 +32,7 @@ Bar_register::do_try_request(Request*r_l) } void -Bar_register::do_process_requests() +Bar_engraver::do_process_requests() { if (bar_req_l_ ) { bar_p_ = new Bar; @@ -48,7 +48,7 @@ Bar_register::do_process_requests() void -Bar_register::do_pre_move_processing() +Bar_engraver::do_pre_move_processing() { if (bar_p_) { typeset_breakable_item(bar_p_); @@ -57,14 +57,14 @@ Bar_register::do_pre_move_processing() } void -Bar_register::do_post_move_processing() +Bar_engraver::do_post_move_processing() { bar_req_l_ = 0; bar_p_ =0; } -IMPLEMENT_STATIC_NAME(Bar_register); -IMPLEMENT_IS_TYPE_B1(Bar_register,Request_register); -ADD_THIS_REGISTER(Bar_register); +IMPLEMENT_STATIC_NAME(Bar_engraver); +IMPLEMENT_IS_TYPE_B1(Bar_engraver,Request_engraver); +ADD_THIS_ENGRAVER(Bar_engraver); diff --git a/lily/beam.cc b/lily/beam.cc index 9902998235..9e9f30eaff 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -1,7 +1,7 @@ /* beam.cc -- implement Beam - source file of the GNU GNU LilyPond music typesetter + source file of the GNU LilyPond music typesetter (c) 1997 Han-Wen Nienhuys @@ -69,7 +69,6 @@ Stem_info::Stem_info(Stem const *s) // huh? why do i need the / 2 // Real interbeam_f = s->paper()->interbeam_f(); Real interbeam_f = s->paper()->interbeam_f() / 2; - Real interline_f = s->paper()->interline_f(); /* well eh, huh? idealy_f_ = dir_i_ * s->stem_start_f() + beams_i_ * interbeam_f; @@ -169,14 +168,23 @@ Beam::solve_slope() Stem_info info(i); sinfo.push(info); } - Real leftx = sinfo[0].x; - Least_squares l; - for (int i=0; i < sinfo.size(); i++) { - sinfo[i].x -= leftx; - l.input.push(Offset(sinfo[i].x, sinfo[i].idealy_f_)); - } + if (! sinfo.size() ) + slope = left_pos = 0; + else if (sinfo.size() == 1) { + slope = 0; + left_pos = sinfo[0].idealy_f_; + } else { + + Real leftx = sinfo[0].x; + Least_squares l; + for (int i=0; i < sinfo.size(); i++) { + sinfo[i].x -= leftx; + l.input.push(Offset(sinfo[i].x, sinfo[i].idealy_f_)); + } - l.minimise(slope, left_pos); + l.minimise(slope, left_pos); + } + Real dy = 0.0; for (int i=0; i < sinfo.size(); i++) { Real y = sinfo[i].x * slope + left_pos; @@ -189,7 +197,12 @@ Beam::solve_slope() left_pos *= dir_i_; slope *= dir_i_; - slope = 0.6 * tanh(slope); // damping + + /* + This neat trick is by Werner Lemberg, damped = tanh(slope) corresponds + with some tables in [Wanske] + */ + slope = 0.6 * tanh(slope); // ugh Real sl = slope*paper()->internote_f(); diff --git a/lily/break.cc b/lily/break.cc index 1513046a91..0f0aabe681 100644 --- a/lily/break.cc +++ b/lily/break.cc @@ -74,7 +74,7 @@ Break_algorithm::solve_line(Line_of_cols curline) const Break_algorithm::Break_algorithm(PScore&s) :pscore_(s) { - linelength = s.paper_l_->linewidth; + linelength = s.paper_l_->linewidth_f(); } bool diff --git a/lily/clef-reg.cc b/lily/clef-grav.cc similarity index 70% rename from lily/clef-reg.cc rename to lily/clef-grav.cc index 3f4c311937..ab5177674a 100644 --- a/lily/clef-reg.cc +++ b/lily/clef-grav.cc @@ -1,5 +1,5 @@ /* - clef.cc -- implement Clef_register + clef.cc -- implement Clef_engraver source file of the GNU LilyPond music typesetter @@ -8,13 +8,13 @@ */ #include "bar.hh" -#include "clef-reg.hh" +#include "clef-grav.hh" #include "clef-item.hh" #include "debug.hh" #include "command-request.hh" #include "time-description.hh" -Clef_register::Clef_register() +Clef_engraver::Clef_engraver() { clef_p_ = 0; clef_req_l_ =0; @@ -23,7 +23,7 @@ Clef_register::Clef_register() } bool -Clef_register::set_type(String s) +Clef_engraver::set_type(String s) { clef_type_str_ = s; if (clef_type_str_ == "violin") { @@ -41,19 +41,19 @@ Clef_register::set_type(String s) } void -Clef_register::fill_staff_info(Staff_info &i) +Clef_engraver::fill_staff_info(Staff_info &i) { i.c0_position_i_l_ = &c0_position_i_; } void -Clef_register::read_req(Clef_change_req*c_l) +Clef_engraver::read_req(Clef_change_req*c_l) { if (!set_type(c_l->clef_str_)) c_l->error("unknown clef type "); } void -Clef_register::acknowledge_element(Score_elem_info info) +Clef_engraver::acknowledge_element(Score_elem_info info) { if (info.elem_l_->name() == Bar::static_name() ) { create_clef(); @@ -63,14 +63,14 @@ Clef_register::acknowledge_element(Score_elem_info info) } void -Clef_register::do_creation_processing() +Clef_engraver::do_creation_processing() { create_clef(); clef_p_->default_b_ = false; } bool -Clef_register::do_try_request(Request * r_l) +Clef_engraver::do_try_request(Request * r_l) { Command_req* creq_l= r_l->command(); if (!creq_l || !creq_l->clefchange()) @@ -83,7 +83,7 @@ Clef_register::do_try_request(Request * r_l) } void -Clef_register::create_clef() +Clef_engraver::create_clef() { if (!clef_p_) { clef_p_ = new Clef_item; @@ -93,7 +93,7 @@ Clef_register::create_clef() } void -Clef_register::do_process_requests() +Clef_engraver::do_process_requests() { if (clef_req_l_) { create_clef(); @@ -102,7 +102,7 @@ Clef_register::do_process_requests() } void -Clef_register::do_pre_move_processing() +Clef_engraver::do_pre_move_processing() { if (!clef_p_) return; @@ -111,18 +111,18 @@ Clef_register::do_pre_move_processing() } void -Clef_register::do_post_move_processing() +Clef_engraver::do_post_move_processing() { clef_req_l_ = 0; } void -Clef_register::do_removal_processing() +Clef_engraver::do_removal_processing() { delete clef_p_; clef_p_ =0; } -IMPLEMENT_STATIC_NAME(Clef_register); -IMPLEMENT_IS_TYPE_B1(Clef_register,Request_register); -ADD_THIS_REGISTER(Clef_register); +IMPLEMENT_STATIC_NAME(Clef_engraver); +IMPLEMENT_IS_TYPE_B1(Clef_engraver,Request_engraver); +ADD_THIS_ENGRAVER(Clef_engraver); diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 626cfe64be..7e399f37c3 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -11,7 +11,7 @@ #include "molecule.hh" #include "paper-def.hh" #include "lookup.hh" -#include "clef-reg.hh" +#include "clef-grav.hh" void @@ -46,7 +46,7 @@ Clef_item::read(String t) y_off = 6; } void -Clef_item::read(Clef_register const &k) +Clef_item::read(Clef_engraver const &k) { read(k.clef_type_str_); } diff --git a/lily/collision-reg.cc b/lily/collision-grav.cc similarity index 53% rename from lily/collision-reg.cc rename to lily/collision-grav.cc index 8a895d79c8..428924d891 100644 --- a/lily/collision-reg.cc +++ b/lily/collision-grav.cc @@ -1,5 +1,5 @@ /* - collision-reg.cc -- implement Collision_register + collision-reg.cc -- implement Collision_engraver source file of the GNU LilyPond music typesetter @@ -7,11 +7,11 @@ */ #include "note-column.hh" -#include "collision-reg.hh" +#include "collision-grav.hh" #include "collision.hh" void -Collision_register::acknowledge_element(Score_elem_info i) +Collision_engraver::acknowledge_element(Score_elem_info i) { if (!(i.elem_l_->name() == Note_column::static_name())) return; @@ -23,18 +23,18 @@ Collision_register::acknowledge_element(Score_elem_info i) } void -Collision_register::do_pre_move_processing() +Collision_engraver::do_pre_move_processing() { if (col_p_) { typeset_element(col_p_); col_p_ =0; } } -Collision_register::Collision_register() +Collision_engraver::Collision_engraver() { col_p_ =0; } -IMPLEMENT_STATIC_NAME(Collision_register); -IMPLEMENT_IS_TYPE_B1(Collision_register,Request_register); -ADD_THIS_REGISTER(Collision_register); +IMPLEMENT_STATIC_NAME(Collision_engraver); +IMPLEMENT_IS_TYPE_B1(Collision_engraver,Request_engraver); +ADD_THIS_ENGRAVER(Collision_engraver); diff --git a/lily/crescendo.cc b/lily/crescendo.cc index d3731bed19..995e45b476 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -18,6 +18,7 @@ Crescendo::Crescendo() grow_dir_i_ =0; dir_i_ = -1 ; left_dyn_b_ = right_dyn_b_ =false; + inside_staff_b_ = false; } Molecule* diff --git a/lily/dynamic-reg.cc b/lily/dynamic-grav.cc similarity index 83% rename from lily/dynamic-reg.cc rename to lily/dynamic-grav.cc index 3e953a6519..716abae463 100644 --- a/lily/dynamic-reg.cc +++ b/lily/dynamic-grav.cc @@ -1,5 +1,5 @@ /* - dynamic-reg.cc -- implement Dynamic_register + dynamic-reg.cc -- implement Dynamic_engraver source file of the GNU LilyPond music typesetter @@ -7,7 +7,7 @@ */ #include "debug.hh" #include "crescendo.hh" -#include "dynamic-reg.hh" +#include "dynamic-grav.hh" #include "musical-request.hh" #include "text-item.hh" #include "lookup.hh" @@ -16,7 +16,7 @@ #include "staff-sym.hh" #include "note-column.hh" -Dynamic_register::Dynamic_register() +Dynamic_engraver::Dynamic_engraver() { dir_i_ =0; do_post_move_processing(); @@ -26,13 +26,13 @@ Dynamic_register::Dynamic_register() } void -Dynamic_register::do_post_move_processing() +Dynamic_engraver::do_post_move_processing() { dynamic_req_l_arr_.set_size(0); } bool -Dynamic_register::do_try_request(Request * r) +Dynamic_engraver::do_try_request(Request * r) { Musical_req * m = r->musical(); if (!m || !m->dynamic()) @@ -41,7 +41,7 @@ Dynamic_register::do_try_request(Request * r) return true; } void -Dynamic_register::do_process_requests() +Dynamic_engraver::do_process_requests() { Crescendo* new_cresc_p=0; for (int i=0; i < dynamic_req_l_arr_.size(); i++) { @@ -90,7 +90,7 @@ Dynamic_register::do_process_requests() } void -Dynamic_register::do_pre_move_processing() +Dynamic_engraver::do_pre_move_processing() { Staff_symbol* s_l = get_staff_info().staff_sym_l_; if (dynamic_p_) { @@ -110,17 +110,17 @@ Dynamic_register::do_pre_move_processing() } void -Dynamic_register::set_feature(Feature i) +Dynamic_engraver::set_feature(Feature i) { if (i.type_ == "vdir") dir_i_ = i.value_; } -IMPLEMENT_STATIC_NAME(Dynamic_register); -IMPLEMENT_IS_TYPE_B1(Dynamic_register,Request_register); -ADD_THIS_REGISTER(Dynamic_register); +IMPLEMENT_STATIC_NAME(Dynamic_engraver); +IMPLEMENT_IS_TYPE_B1(Dynamic_engraver,Request_engraver); +ADD_THIS_ENGRAVER(Dynamic_engraver); -Dynamic_register::~Dynamic_register() +Dynamic_engraver::~Dynamic_engraver() { delete dynamic_p_; delete to_end_cresc_p_; @@ -130,7 +130,7 @@ Dynamic_register::~Dynamic_register() delete cresc_p_; } void -Dynamic_register::acknowledge_element(Score_elem_info i) +Dynamic_engraver::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/engraver-group.cc b/lily/engraver-group.cc new file mode 100644 index 0000000000..bcfa32a034 --- /dev/null +++ b/lily/engraver-group.cc @@ -0,0 +1,297 @@ +/* + engravergroup.cc -- implement Engraver_group_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "proto.hh" +#include "plist.hh" +#include "engraver-group.hh" +#include "engraver.hh" +#include "debug.hh" +#include "p-score.hh" +#include "score-elem.hh" +#include "input-engraver.hh" + +Engraver_group_engraver::~Engraver_group_engraver() +{ + assert(removable_b()); +} + +void +Engraver_group_engraver::check_removal() +{ + for (int i =0; i < group_l_arr_.size(); ) { + group_l_arr_[i]->check_removal(); + if (group_l_arr_[i]->removable_b()) + terminate_engraver(group_l_arr_[i]); + else + i++; + } + +} + +bool +Engraver_group_engraver::removable_b()const +{ + return !iterator_count_&& !group_l_arr_.size() ; +} + +Engraver_group_engraver::Engraver_group_engraver() +{ + igrav_l_ =0; +} + +void +Engraver_group_engraver::set_feature(Feature d) +{ + iter_top(grav_list_, i); + while (i.ok()) { + // this construction to ensure clean deletion + Request_engraver *grav_l = i++; + grav_l->set_feature(d); + } +} + +void +Engraver_group_engraver::sync_features() +{ + iter_top(grav_list_, i); + while (i.ok()) { + + Request_engraver *grav_l = i++; + grav_l->sync_features(); + } +} + +void +Engraver_group_engraver::do_pre_move_processing() +{ + iter_top(grav_list_, i); + while (i.ok()) { + + Request_engraver *grav_l = i++; + grav_l->pre_move_processing(); + } +} + +void +Engraver_group_engraver::do_process_requests() +{ + iter_top(grav_list_, i); + while (i.ok()) { + + Request_engraver *grav_l = i++; + grav_l->process_requests(); + } +} + + +void +Engraver_group_engraver::do_post_move_processing() +{ + iter_top(grav_list_, i); + while (i.ok()) { + // this construction to ensure clean deletion + Request_engraver *grav_l = i++; + grav_l->post_move_processing(); + } +} + + +bool +Engraver_group_engraver::contains_b(Request_engraver* grav_l)const +{ + bool parent_b = Request_engraver::contains_b(grav_l); + + if (parent_b) + return true; + for (iter_top(grav_list_, j); j.ok(); j++) + if (j->contains_b(grav_l)) + return true; + return false; +} + + + +bool +Engraver_group_engraver::do_try_request(Request*req_l) +{ + bool hebbes_b =false; + for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++) + hebbes_b =nongroup_l_arr_[i]->try_request(req_l); + if (!hebbes_b) + hebbes_b = daddy_grav_l_->try_request(req_l); + return hebbes_b ; +} + +void +Engraver_group_engraver::add(Request_engraver *grav_p) +{ + grav_list_.bottom().add(grav_p); + grav_p->daddy_grav_l_ = this; + + if (grav_p->is_type_b(Engraver_group_engraver::static_name())) { + group_l_arr_.push((Engraver_group_engraver*)grav_p); + } else { + nongroup_l_arr_ .push(grav_p); + } +} + + +Request_engraver * +Engraver_group_engraver::remove_engraver_p(Request_engraver*grav_l) +{ + group_l_arr_.substitute((Engraver_group_engraver*)grav_l,0); + nongroup_l_arr_.substitute(grav_l,0); + iterator(grav_list_) grav_cur= grav_list_.find(grav_l); + + return grav_cur.remove_p(); +} + +void +Engraver_group_engraver::terminate_engraver(Request_engraver*r_l) +{ + mtor << "Removing " << r_l->name() << " at " << get_staff_info().when() << "\n"; + r_l->do_removal_processing(); + Request_engraver * grav_p =remove_engraver_p(r_l); + + delete grav_p; +} + +IMPLEMENT_IS_TYPE_B2(Engraver_group_engraver,Request_engraver, Translator); +IMPLEMENT_STATIC_NAME(Engraver_group_engraver); +ADD_THIS_ENGRAVER(Engraver_group_engraver); + +void +Engraver_group_engraver::do_print()const +{ +#ifndef NPRINT + mtor << "ID: " << id_str_ << "\n"; + for (iter_top(grav_list_, i); i.ok(); i++) + i->print(); +#endif +} + + +Engraver_group_engraver* +Engraver_group_engraver::find_engraver_l(String n, String id) +{ + if (name() == n && id_str_ == id) + return this; + Engraver_group_engraver * r = 0; + for (int i =0; !r && i< group_l_arr_.size(); i++) { + r = group_l_arr_[i]->find_engraver_l(n,id); + } + + return r; +} + +Translator* +Engraver_group_engraver::find_get_translator_l(String n,String id) +{ + Translator * ret=0; + Input_engraver * igrav_l= igrav_l_-> recursive_find ( n ); + if (igrav_l ) { + ret = find_engraver_l(n,id); + if (!ret) { + Engraver_group_engraver * group = + igrav_l-> get_group_engraver_p(); + + add(group); + ret = group; + + if (group->igrav_l_->is_name_b( n ) ) + ret ->id_str_ = id; + else + return ret->find_get_translator_l(n,id); + + } + } else if (daddy_grav_l_) + ret =daddy_grav_l_->find_get_translator_l(n,id); + else { + warning("Can't find or create `" + n + "' called `" + id + "'\n"); + ret =0; + } + return ret; +} + +int +Engraver_group_engraver::depth_i()const +{ + return daddy_grav_l_->depth_i() + 1; +} + +Translator* +Engraver_group_engraver::ancestor_l(int l) +{ + if (!l || !daddy_grav_l_) + return this; + + return daddy_grav_l_->ancestor_l(l-1); +} + +void +Engraver_group_engraver::announce_element(Score_elem_info info) +{ + announce_info_arr_.push(info); + Request_engraver::announce_element(info); +} + +void +Engraver_group_engraver::do_announces() +{ + for (int i=0; i < group_l_arr_.size(); i++) { + group_l_arr_[i]->do_announces(); + } + + Request dummy_req; + + for (int j =0; j < announce_info_arr_.size(); j++){ + Score_elem_info info = announce_info_arr_[j]; + + if (!info.req_l_) + info.req_l_ = &dummy_req; + for (int i=0; i < nongroup_l_arr_.size(); i++) { + if (nongroup_l_arr_[i] != info.origin_grav_l_arr_[0]) + nongroup_l_arr_[i]->acknowledge_element(info); + } + } + announce_info_arr_.set_size(0); +} + + +void +Engraver_group_engraver::do_removal_processing() +{ + for (iter( grav_list_.top(), i); i.ok(); i++) + i->do_removal_processing(); +} + +Staff_info +Engraver_group_engraver::get_staff_info()const +{ + Staff_info inf = Request_engraver::get_staff_info(); + + for (int i=0; i < nongroup_l_arr_.size(); i++) + nongroup_l_arr_[i]->fill_staff_info(inf); + + return inf; +} + +Translator* +Engraver_group_engraver::get_default_interpreter() +{ + if ( interpreter_l() ) + return daddy_grav_l_->get_default_interpreter(); + + Engraver_group_engraver *grav_p= igrav_l_-> + get_default_igrav_l()->get_group_engraver_p(); + add(grav_p ); + if (grav_p->interpreter_l()) + return grav_p; + else + return grav_p->get_default_interpreter(); +} diff --git a/lily/engraver.cc b/lily/engraver.cc new file mode 100644 index 0000000000..78fa6ca623 --- /dev/null +++ b/lily/engraver.cc @@ -0,0 +1,137 @@ +/* + engraver.cc -- implement Request_engraver + + Sourcefile of GNU LilyPond musictypesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "music-list.hh" +#include "musical-request.hh" +#include "engraver.hh" +#include "engraver-group.hh" +#include "debug.hh" + +void +Request_engraver::post_move_processing() +{ + + if (status < CREATION_INITED) { + do_creation_processing(); + status = CREATION_INITED; + } + if (status >= MOVE_INITED) + return; + + do_post_move_processing(); + status = MOVE_INITED; +} + +bool +Request_engraver::try_request(Request * r) +{ + if (status < MOVE_INITED) + post_move_processing(); + + return do_try_request(r); +} + +void +Request_engraver::process_requests() +{ + if (status < PROCESSED_REQS) + post_move_processing(); + else if (status >= PROCESSED_REQS) + return; + + status = PROCESSED_REQS; + do_process_requests(); +} + +void +Request_engraver::pre_move_processing() +{ + do_pre_move_processing(); + status = CREATION_INITED; +} + +void +Request_engraver::fill_staff_info(Staff_info&) +{ + +} + +Scalar +Request_engraver::get_feature(String t) +{ + return daddy_grav_l_->get_feature(t); +} + +bool +Request_engraver::do_try_request(Request*) +{ + return false; +} + +Request_engraver::Request_engraver() +{ + status = VIRGIN; + daddy_grav_l_ = 0; +} + +void +Request_engraver::announce_element(Score_elem_info i) +{ + i.origin_grav_l_arr_.push(this); + daddy_grav_l_->announce_element(i); +} + +void +Request_engraver::typeset_element(Score_elem*p) +{ + daddy_grav_l_->typeset_element(p); +} + +Paper_def* +Request_engraver::paper()const +{ + return daddy_grav_l_->paper(); +} + +void +Request_engraver::typeset_breakable_item(Item * nobreak_p) +{ + daddy_grav_l_->typeset_breakable_item(nobreak_p); +} + +bool +Request_engraver::contains_b(Request_engraver *grav_l)const +{ + return this == grav_l; +} + +Staff_info +Request_engraver::get_staff_info() const +{ + return daddy_grav_l_->get_staff_info(); +} + +void +Request_engraver::print() const +{ +#ifndef NPRINT + mtor << "\n" << name() << " {"; + do_print(); + mtor << "}"; +#endif +} + +IMPLEMENT_STATIC_NAME(Request_engraver); +IMPLEMENT_IS_TYPE_B(Request_engraver); + +void +Request_engraver::do_print()const +{ +} + + diff --git a/lily/global-gravs.cc b/lily/global-gravs.cc new file mode 100644 index 0000000000..6dcc07b791 --- /dev/null +++ b/lily/global-gravs.cc @@ -0,0 +1,49 @@ +/* + global-gravs.cc -- implement + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "proto.hh" +#include "plist.hh" +#include "input-engraver.hh" +#include "debug.hh" +#include "engraver.hh" + +struct Request_engraver_table_entry { + String name_str_; + Grav_ctor ctor_l_; + Request_engraver_table_entry(String s, Grav_ctor f) { + name_str_ =s; + ctor_l_ = f; + } + Request_engraver_table_entry() + { + ctor_l_ =0; + } +}; + +static Array *grav_table=0; + +void +add_request_engraver(String s, Grav_ctor f) +{ + if (!grav_table) + grav_table = new Array; + + grav_table->push(Request_engraver_table_entry(s, f)); +} + + +Request_engraver* +get_engraver_p(String s) +{ + for (int i=0; i < grav_table->size(); i++) { + if ((*grav_table)[i].name_str_ == s) + return (*(*grav_table)[i].ctor_l_)(); + } + error("Unknown engraver `" + s +"\'"); + return 0; +} diff --git a/lily/global-regs.cc b/lily/global-regs.cc deleted file mode 100644 index ca027af462..0000000000 --- a/lily/global-regs.cc +++ /dev/null @@ -1,49 +0,0 @@ -/* - global-regs.cc -- implement - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - -#include "proto.hh" -#include "plist.hh" -#include "input-register.hh" -#include "debug.hh" -#include "register.hh" - -struct Request_register_table_entry { - String name_str_; - Reg_ctor ctor_l_; - Request_register_table_entry(String s, Reg_ctor f) { - name_str_ =s; - ctor_l_ = f; - } - Request_register_table_entry() - { - ctor_l_ =0; - } -}; - -static Array *reg_table=0; - -void -add_request_register(String s, Reg_ctor f) -{ - if (!reg_table) - reg_table = new Array; - - reg_table->push(Request_register_table_entry(s, f)); -} - - -Request_register* -get_register_p(String s) -{ - for (int i=0; i < reg_table->size(); i++) { - if ((*reg_table)[i].name_str_ == s) - return (*(*reg_table)[i].ctor_l_)(); - } - error("Unknown register `" + s +"\'"); - return 0; -} diff --git a/lily/global-acceptor.cc b/lily/global-translator.cc similarity index 62% rename from lily/global-acceptor.cc rename to lily/global-translator.cc index 057881adc7..62cbb284e4 100644 --- a/lily/global-acceptor.cc +++ b/lily/global-translator.cc @@ -1,5 +1,5 @@ /* - global-acceptor.cc -- implement + global-translator.cc -- implement source file of the GNU LilyPond music typesetter @@ -7,24 +7,24 @@ */ #include "music.hh" -#include "global-acceptor.hh" +#include "global-translator.hh" #include "score.hh" #include "score-column.hh" -Global_acceptor::Global_acceptor() +Global_translator::Global_translator() { score_l_ = 0; last_mom_ = 0; } -Acceptor* -Global_acceptor::ancestor_l(int) +Translator* +Global_translator::ancestor_l(int) { return this; } void -Global_acceptor::add_moment_to_process(Moment m) +Global_translator::add_moment_to_process(Moment m) { if (m > last_mom_) return; @@ -36,20 +36,20 @@ Global_acceptor::add_moment_to_process(Moment m) } int -Global_acceptor::depth_i()const +Global_translator::depth_i()const { return 0; } void -Global_acceptor::set_score(Score *s) +Global_translator::set_score(Score *s) { score_l_ = s; last_mom_ = score_l_->music_p_->time_int().max(); } void -Global_acceptor::modify_next(Moment &w) +Global_translator::modify_next(Moment &w) { while (extra_mom_pq_.size() && extra_mom_pq_.front() <= w) @@ -58,12 +58,12 @@ Global_acceptor::modify_next(Moment &w) } int -Global_acceptor::moments_left_i()const +Global_translator::moments_left_i()const { return extra_mom_pq_.size(); } void -Global_acceptor::prepare(Moment) +Global_translator::prepare(Moment) { } diff --git a/lily/head-reg.cc b/lily/head-grav.cc similarity index 71% rename from lily/head-reg.cc rename to lily/head-grav.cc index b55f36b4be..bc70563126 100644 --- a/lily/head-reg.cc +++ b/lily/head-grav.cc @@ -5,18 +5,18 @@ */ #include "note-head.hh" -#include "head-reg.hh" +#include "head-grav.hh" #include "paper-def.hh" #include "musical-request.hh" -Note_head_register::Note_head_register() +Note_head_engraver::Note_head_engraver() { note_p_ = 0; do_post_move_processing(); } bool -Note_head_register::do_try_request(Request *req_l) +Note_head_engraver::do_try_request(Request *req_l) { if (note_req_l_) return false; @@ -30,7 +30,7 @@ Note_head_register::do_try_request(Request *req_l) } void -Note_head_register::do_process_requests() +Note_head_engraver::do_process_requests() { if (!note_req_l_) return; @@ -51,7 +51,7 @@ Note_head_register::do_process_requests() } void -Note_head_register::do_pre_move_processing() +Note_head_engraver::do_pre_move_processing() { if (note_p_) { typeset_element(note_p_); @@ -59,11 +59,11 @@ Note_head_register::do_pre_move_processing() } } void -Note_head_register::do_post_move_processing() +Note_head_engraver::do_post_move_processing() { note_req_l_ = 0; } -IMPLEMENT_STATIC_NAME(Note_head_register); -IMPLEMENT_IS_TYPE_B1(Note_head_register,Request_register); -ADD_THIS_REGISTER(Note_head_register); +IMPLEMENT_STATIC_NAME(Note_head_engraver); +IMPLEMENT_IS_TYPE_B1(Note_head_engraver,Request_engraver); +ADD_THIS_ENGRAVER(Note_head_engraver); diff --git a/lily/identifier.cc b/lily/identifier.cc index 7e1e43e45f..60831cef13 100644 --- a/lily/identifier.cc +++ b/lily/identifier.cc @@ -7,17 +7,17 @@ */ #include - +#include "paper-def.hh" #include "score.hh" #include "identifier.hh" #include "my-lily-lexer.hh" #include "debug.hh" -#include "input-register.hh" +#include "input-engraver.hh" #include "symtable.hh" #include "lookup.hh" #include "script-def.hh" #include "request.hh" -#include "input-register.hh" +#include "input-engraver.hh" IMPLEMENT_STATIC_NAME(Identifier); IMPLEMENT_IS_TYPE_B(Identifier); @@ -65,8 +65,8 @@ DEFAULT_PRINT(Symtables_id, Symtables, symtables); DEFAULT_PRINT(Music_id,Music , music); DEFAULT_PRINT(Request_id, Request, request); DEFAULT_PRINT(Score_id, Score, score); -DEFAULT_PRINT(Input_regs_id, Input_register, iregs); - +DEFAULT_PRINT(Input_gravs_id, Input_engraver, igravs); +DEFAULT_PRINT(Paper_def_id,Paper_def, paperdef); void Real_id::do_print() const { @@ -110,7 +110,8 @@ implement_id_class(Symtables_id, Symtables, symtables); implement_id_class(Music_id, Music, music); implement_id_class(Score_id, Score, score); implement_id_class(Request_id, Request, request); -implement_id_class(Input_regs_id, Input_register, iregs); +implement_id_class(Input_gravs_id, Input_engraver, igravs); +implement_id_class(Paper_def_id, Paper_def, paperdef); Identifier::Identifier(Identifier const&) { @@ -125,4 +126,5 @@ default_accessor(Symtables_id, Symtables, symtables); virtual_accessor(Music_id, Music, music); default_accessor(Score_id, Score, score); virtual_accessor(Request_id, Request, request); -default_accessor(Input_regs_id, Input_register, iregs); +default_accessor(Input_gravs_id, Input_engraver, igravs); +default_accessor(Paper_def_id, Paper_def, paperdef); diff --git a/lily/include/acceptor.hh b/lily/include/acceptor.hh index f298951081..aabbcf5337 100644 --- a/lily/include/acceptor.hh +++ b/lily/include/acceptor.hh @@ -1,5 +1,5 @@ /* - acceptor.hh -- declare Acceptor + acceptor.hh -- declare Translator source file of the GNU LilyPond music typesetter @@ -15,7 +15,7 @@ #include "interpreter.hh" #include "virtual-methods.hh" -class Acceptor { +class Translator { public: String id_str_; @@ -23,17 +23,17 @@ public: virtual Interpreter * interpreter_l() { return 0; } - /// Score_register = 0, Staff_registers = 1, etc) + /// Score_engraver = 0, Staff_engravers = 1, etc) virtual int depth_i()const=0; - virtual Acceptor *find_get_acceptor_l(String name, String id)=0; - virtual Acceptor *ancestor_l(int l=1)=0; - virtual ~Acceptor(){} + virtual Translator *find_get_translator_l(String name, String id)=0; + virtual Translator *ancestor_l(int l=1)=0; + virtual ~Translator(){} NAME_MEMBERS(); - Acceptor(); - virtual Acceptor *get_default_interpreter()=0; + Translator(); + virtual Translator *get_default_interpreter()=0; }; -class Interpreter : public virtual Acceptor { +class Interpreter : public virtual Translator { public: virtual bool interpret_request_b(Request*) { return false;} }; diff --git a/lily/include/bar-align-grav.hh b/lily/include/bar-align-grav.hh new file mode 100644 index 0000000000..7da9dfaf3d --- /dev/null +++ b/lily/include/bar-align-grav.hh @@ -0,0 +1,13 @@ +/* + bar-align-grav.hh -- declare + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef BAR_ALIGN_GRAV_HH +#define BAR_ALIGN_GRAV_HH + +#endif // BAR_ALIGN_GRAV_HH diff --git a/lily/include/bar-align-reg.hh b/lily/include/bar-align-reg.hh deleted file mode 100644 index 7219cf4bac..0000000000 --- a/lily/include/bar-align-reg.hh +++ /dev/null @@ -1,13 +0,0 @@ -/* - bar-align-reg.hh -- declare - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - - -#ifndef BAR_ALIGN_REG_HH -#define BAR_ALIGN_REG_HH - -#endif // BAR_ALIGN_REG_HH diff --git a/lily/include/bar-reg.hh b/lily/include/bar-grav.hh similarity index 70% rename from lily/include/bar-reg.hh rename to lily/include/bar-grav.hh index 8a6d1606c5..173d15e201 100644 --- a/lily/include/bar-reg.hh +++ b/lily/include/bar-grav.hh @@ -1,5 +1,5 @@ /* - bar-reg.hh -- declare Bar_register + bar-grav.hh -- declare Bar_engraver source file of the GNU LilyPond music typesetter @@ -7,18 +7,18 @@ */ -#ifndef BARREG_HH -#define BARREG_HH -#include "register.hh" +#ifndef BARGRAV_HH +#define BARGRAV_HH +#include "engraver.hh" /** generate bars. Either user ("|:"), or default (new measure) */ -class Bar_register : public Request_register { +class Bar_engraver : public Request_engraver { Bar_req * bar_req_l_; Bar * bar_p_; public: - Bar_register(); + Bar_engraver(); NAME_MEMBERS(); @@ -29,4 +29,4 @@ protected: virtual void do_post_move_processing(); }; -#endif // BARREG_HH +#endif // BARGRAV_HH diff --git a/lily/include/clef-reg.hh b/lily/include/clef-grav.hh similarity index 89% rename from lily/include/clef-reg.hh rename to lily/include/clef-grav.hh index 91dd8d57e7..5346c0b6e3 100644 --- a/lily/include/clef-reg.hh +++ b/lily/include/clef-grav.hh @@ -9,10 +9,10 @@ #include "scalar.hh" #include "varray.hh" -#include "register.hh" +#include "engraver.hh" /// where is c-0 in the staff? -class Clef_register : public Request_register { +class Clef_engraver : public Request_engraver { Clef_item *clef_p_; Clef_change_req * clef_req_l_; void create_clef(); @@ -33,7 +33,7 @@ public: /* ************** */ - Clef_register(); + Clef_engraver(); NAME_MEMBERS(); }; diff --git a/lily/include/clef-item.hh b/lily/include/clef-item.hh index a3c9053b34..162cf813eb 100644 --- a/lily/include/clef-item.hh +++ b/lily/include/clef-item.hh @@ -30,7 +30,7 @@ public: NAME_MEMBERS(); SCORE_ELEM_CLONE(Clef_item); Clef_item(); - void read(Clef_register const&); + void read(Clef_engraver const&); void read(String); }; diff --git a/lily/include/collision-reg.hh b/lily/include/collision-grav.hh similarity index 54% rename from lily/include/collision-reg.hh rename to lily/include/collision-grav.hh index d0affb0df4..0b46db58c3 100644 --- a/lily/include/collision-reg.hh +++ b/lily/include/collision-grav.hh @@ -1,5 +1,5 @@ /* - collision-reg.hh -- declare Collision_register + collision-grav.hh -- declare Collision_engraver source file of the GNU LilyPond music typesetter @@ -7,19 +7,19 @@ */ -#ifndef COLLISION_REG_HH -#define COLLISION_REG_HH +#ifndef COLLISION_GRAV_HH +#define COLLISION_GRAV_HH -#include "register.hh" +#include "engraver.hh" -class Collision_register : public Request_register { +class Collision_engraver : public Request_engraver { Collision* col_p_; protected: virtual void acknowledge_element(Score_elem_info); virtual void do_pre_move_processing(); public: - Collision_register(); + Collision_engraver(); NAME_MEMBERS(); }; -#endif // COLLISION_REG_HH +#endif // COLLISION_GRAV_HH diff --git a/lily/include/dynamic-reg.hh b/lily/include/dynamic-grav.hh similarity index 72% rename from lily/include/dynamic-reg.hh rename to lily/include/dynamic-grav.hh index 4e13d25a6f..791b2f129e 100644 --- a/lily/include/dynamic-reg.hh +++ b/lily/include/dynamic-grav.hh @@ -1,5 +1,5 @@ /* - dynamic-reg.hh -- declare Dynamic_register + dynamic-grav.hh -- declare Dynamic_engraver source file of the GNU LilyPond music typesetter @@ -7,12 +7,12 @@ */ -#ifndef DYNAMIC_REG_HH -#define DYNAMIC_REG_HH +#ifndef DYNAMIC_GRAV_HH +#define DYNAMIC_GRAV_HH -#include "register.hh" +#include "engraver.hh" -class Dynamic_register : public Request_register { +class Dynamic_engraver : public Request_engraver { int dir_i_; Text_item * dynamic_p_; Crescendo * to_end_cresc_p_; @@ -21,8 +21,8 @@ class Dynamic_register : public Request_register { Array dynamic_req_l_arr_; /* ************** */ public: - Dynamic_register(); - ~Dynamic_register(); + Dynamic_engraver(); + ~Dynamic_engraver(); NAME_MEMBERS(); protected: virtual void acknowledge_element(Score_elem_info); @@ -33,4 +33,4 @@ protected: virtual void set_feature(Feature); }; -#endif // DYNAMIC_REG_HH +#endif // DYNAMIC_GRAV_HH diff --git a/lily/include/engraver-group.hh b/lily/include/engraver-group.hh new file mode 100644 index 0000000000..fc76fd7bd5 --- /dev/null +++ b/lily/include/engraver-group.hh @@ -0,0 +1,90 @@ +/* + engravergroup.hh -- declare Engraver_group_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef ENGRAVERGROUP_HH +#define ENGRAVERGROUP_HH + +#include "parray.hh" +#include "plist.hh" +#include "score-elem-info.hh" +#include "engraver.hh" +#include "translator.hh" + + +/** + Group a number of engravers. Usually delegates everything to its contents. + Postfix: group + */ +class Engraver_group_engraver : public Request_engraver, public virtual Translator { +protected: + + Pointer_list grav_list_; + Link_array group_l_arr_; + Link_array nongroup_l_arr_; + + Array announce_info_arr_; + + virtual void do_print()const; + + virtual bool removable_b()const; + +public: + Input_engraver * igrav_l_; + void check_removal(); + Engraver_group_engraver(); + ~Engraver_group_engraver(); + + + + /** + Junk #grav_l#. + Pre: + #grav_l# is in #grav_list_# + */ + virtual void terminate_engraver(Request_engraver * grav_l); + + NAME_MEMBERS(); + + /** + Remove #grav_l# from the list, and return it. + */ + virtual Request_engraver * remove_engraver_p(Request_engraver*grav_l); + virtual void set_feature(Feature i); + virtual void sync_features() ; + virtual void do_pre_move_processing(); + virtual void do_post_move_processing(); + + virtual void do_removal_processing(); + virtual bool do_try_request(Request*); + virtual void do_process_requests(); + + virtual Staff_info get_staff_info()const; + + virtual Engraver_group_engraver * find_engraver_l(String name,String id); + virtual void do_announces(); + virtual void announce_element(Score_elem_info); + + + virtual void add(Request_engraver* grav_p); + + virtual bool contains_b(Request_engraver*)const; + + virtual Translator* find_get_translator_l(String name, String id); + virtual Translator * get_default_interpreter(); + /** + Go up in the tree. default: choose next parent + */ + Translator * ancestor_l(int l=1); + int depth_i() const; + +}; + +#endif // ENGRAVERGROUP_HH + + diff --git a/lily/include/register.hh b/lily/include/engraver.hh similarity index 73% rename from lily/include/register.hh rename to lily/include/engraver.hh index 18a6e41a42..320bdd3256 100644 --- a/lily/include/register.hh +++ b/lily/include/engraver.hh @@ -1,5 +1,5 @@ /* - register.hh -- declare Request_register + engraver.hh -- declare Request_engraver source file of the GNU LilyPond music typesetter @@ -7,8 +7,8 @@ */ -#ifndef REGISTER_HH -#define REGISTER_HH +#ifndef ENGRAVER_HH +#define ENGRAVER_HH #include "lily-proto.hh" #include "varray.hh" @@ -21,14 +21,17 @@ /** a struct which processes requests, and creates the #Score_elem#s. - It may use derived classes. Hungarian postfix: register + It may use derived classes. Hungarian postfix: grav + */ -class Request_register { - friend class Register_group_register; + +class Request_engraver { + + friend class Engraver_group_engraver; /** - You cannot copy a Request_register + You cannot copy a Request_engraver */ - Request_register(const Request_register&){} + Request_engraver(const Request_engraver&){} enum { VIRGIN, @@ -83,7 +86,7 @@ protected: */ virtual void announce_element(Score_elem_info); /** - Set Feature of the register(s). Default: ignore Feature. + Set Feature of the engraver(s). Default: ignore Feature. */ virtual void set_feature(Feature){} /** @@ -91,12 +94,12 @@ protected: */ virtual Scalar get_feature(String type_str); /** - Does this equal or contain a certain register? + Does this equal or contain a certain engraver? */ virtual void sync_features() {} - virtual bool contains_b(Request_register*reg_l)const; + virtual bool contains_b(Request_engraver*grav_l)const; /** Get information on the staff. Default: ask daddy. */ @@ -114,7 +117,7 @@ public: void pre_move_processing(); void process_requests(); /** - try to fit the request in this register + try to fit the request in this engraver @return false: not noted, not taken. @@ -126,30 +129,30 @@ public: void post_move_processing(); - Register_group_register * daddy_reg_l_; + Engraver_group_engraver * daddy_grav_l_; - Request_register(); - virtual ~Request_register(){} + Request_engraver(); + virtual ~Request_engraver(){} NAME_MEMBERS(); void print() const; }; /** - A macro to automate administration of registers. + A macro to automate administration of engravers. */ -#define ADD_THIS_REGISTER(c) \ +#define ADD_THIS_ENGRAVER(c) \ struct c ## init { \ - static Request_register * globalctor (){ \ + static Request_engraver * globalctor (){ \ return new c; \ } \ c ## init () { \ - add_request_register(c::static_name(), globalctor); \ + add_request_engraver(c::static_name(), globalctor); \ \ } \ } _ ## c ## init; -typedef Request_register*(*Reg_ctor)(void); -void add_request_register(String s, Reg_ctor f); +typedef Request_engraver*(*Grav_ctor)(void); +void add_request_engraver(String s, Grav_ctor f); -#endif // REGISTER_HH +#endif // ENGRAVER_HH diff --git a/lily/include/global-acceptor.hh b/lily/include/global-translator.hh similarity index 80% rename from lily/include/global-acceptor.hh rename to lily/include/global-translator.hh index 6d18720298..ce34cfb527 100644 --- a/lily/include/global-acceptor.hh +++ b/lily/include/global-translator.hh @@ -13,12 +13,12 @@ #include "acceptor.hh" #include "pqueue.hh" -class Global_acceptor : public virtual Acceptor { +class Global_translator : public virtual Translator { PQueue extra_mom_pq_; Moment last_mom_; public: Score *score_l_; - Global_acceptor(); + Global_translator(); int moments_left_i()const; void modify_next(Moment&); void add_moment_to_process(Moment); @@ -30,9 +30,9 @@ public: protected: virtual int depth_i() const; - virtual Acceptor *ancestor_l(int); + virtual Translator *ancestor_l(int); }; -#endif // GLOBAL_ACCEPTOR_HH +#endif // Global_translator_HH diff --git a/lily/include/head-reg.hh b/lily/include/head-grav.hh similarity index 63% rename from lily/include/head-reg.hh rename to lily/include/head-grav.hh index e4e3c1ef16..07f7210925 100644 --- a/lily/include/head-reg.hh +++ b/lily/include/head-grav.hh @@ -1,20 +1,20 @@ /* - headreg.hh -- part of GNU LilyPond + head-grav.hh -- part of GNU LilyPond (c) 1997 Han-Wen Nienhuys */ -#ifndef HEADREG_HH -#define HEADREG_HH -#include "register.hh" +#ifndef HEADGRAV_HH +#define HEADGRAV_HH +#include "engraver.hh" -struct Note_head_register : Request_register { +struct Note_head_engraver : Request_engraver { Note_head* note_p_; Rhythmic_req * note_req_l_; /* *************** */ - Note_head_register(); + Note_head_engraver(); virtual bool do_try_request(Request *req_l) ; virtual void do_process_requests(); virtual void do_pre_move_processing(); @@ -23,4 +23,4 @@ struct Note_head_register : Request_register { }; -#endif // HEADREG_HH +#endif // HEADGRAV_HH diff --git a/lily/include/identifier.hh b/lily/include/identifier.hh index bd45068ab4..1fca04eee3 100644 --- a/lily/include/identifier.hh +++ b/lily/include/identifier.hh @@ -31,9 +31,10 @@ struct Identifier : public Input { NAME_MEMBERS(); void error(String); IDACCESSOR(Music, music) - IDACCESSOR(Input_register, iregs) + IDACCESSOR(Input_engraver, igravs) IDACCESSOR(General_script_def, script) IDACCESSOR(Symtables, symtables) + IDACCESSOR(Paper_def, paperdef) IDACCESSOR(Lookup,lookup) IDACCESSOR(Real,real) IDACCESSOR(Request, request) @@ -65,6 +66,6 @@ declare_id_class(Music_id, Music, music); declare_id_class(Int_id, int, intid); declare_id_class(Score_id, Score, score); declare_id_class(Request_id, Request, request); -declare_id_class(Input_regs_id, Input_register, iregs); - +declare_id_class(Input_gravs_id, Input_engraver, igravs); +declare_id_class(Paper_def_id,Paper_def, paperdef); #endif // IDENTIFIER_ diff --git a/lily/include/input-engraver.hh b/lily/include/input-engraver.hh new file mode 100644 index 0000000000..5894a1db64 --- /dev/null +++ b/lily/include/input-engraver.hh @@ -0,0 +1,42 @@ +/* + input-engraver.hh -- declare Input_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef INPUT_ENGRAVER_HH +#define INPUT_ENGRAVER_HH + +#include "plist.hh" +#include "string.hh" +#include "lily-proto.hh" +#include "input.hh" +#include "string.hh" +#include "varray.hh" + +struct Input_engraver : Input { + Pointer_list contains_igrav_p_list_; + Array consists_str_arr_; + Array alias_str_arr_; + String name_str_; + + void add(Input_engraver *); + bool is_name_b(String); + bool accept_req_b(); + bool accepts_b(String); + void print() const; + Engraver_group_engraver * get_group_engraver_p(); + Input_engraver * get_default_igrav_l(); + Input_engraver * recursive_find(String nm); + Input_engraver * find_igrav_l(String nm); +}; + + +void add_global_input_engraver(Input_engraver* igrav_p); +Input_engraver*lookup_grav(String); +Request_engraver*get_engraver_p(String s); + +#endif // INPUT_ENGRAVER_HH diff --git a/lily/include/input-register.hh b/lily/include/input-register.hh deleted file mode 100644 index f1988b0374..0000000000 --- a/lily/include/input-register.hh +++ /dev/null @@ -1,42 +0,0 @@ -/* - input-register.hh -- declare Input_register - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - - -#ifndef INPUT_REGISTER_HH -#define INPUT_REGISTER_HH - -#include "plist.hh" -#include "string.hh" -#include "lily-proto.hh" -#include "input.hh" -#include "string.hh" -#include "varray.hh" - -struct Input_register : Input { - Pointer_list contains_ireg_p_list_; - Array consists_str_arr_; - Array alias_str_arr_; - String name_str_; - - void add(Input_register *); - bool is_name_b(String); - bool accept_req_b(); - bool accepts_b(String); - void print() const; - Register_group_register * get_group_register_p(); - Input_register * get_default_ireg_l(); - Input_register * recursive_find(String nm); - Input_register * find_ireg_l(String nm); -}; - - -void add_global_input_register(Input_register* ireg_p); -Input_register*lookup_reg(String); -Request_register*get_register_p(String s); - -#endif // INPUT_REGISTER_HH diff --git a/lily/include/interpretor.hh b/lily/include/interpretor.hh deleted file mode 100644 index b13582f45a..0000000000 --- a/lily/include/interpretor.hh +++ /dev/null @@ -1,32 +0,0 @@ -/* - interpretor.hh -- declare - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - - -#ifndef Interpreter_HH -#define Interpreter_HH - -class Interpreter { -public: - /// link to my definition - Input_register * ireg_l_; - void interpret_request(Request *); - NAME_MEMBERS(); - ~Interpreter(); - /** typeset any items/spanners. Default: do nothing - */ - virtual void do_pre_move_processing(){} -}; - -class Paper_interpreter : Interpreter { - -}; - -class Midi_interpreter : Interpreter { -}; - -#endif // Interpreter_HH diff --git a/lily/include/key-reg.hh b/lily/include/key-grav.hh similarity index 77% rename from lily/include/key-reg.hh rename to lily/include/key-grav.hh index ec9b5a2ab9..8f9b9ecdf1 100644 --- a/lily/include/key-reg.hh +++ b/lily/include/key-grav.hh @@ -1,5 +1,5 @@ /* - key-reg.hh -- declare Key_register + key-grav.hh -- declare Key_engraver source file of the GNU LilyPond music typesetter @@ -7,13 +7,13 @@ */ -#ifndef KEYREG_HH -#define KEYREG_HH +#ifndef KEYGRAV_HH +#define KEYGRAV_HH -#include "register.hh" +#include "engraver.hh" #include "key.hh" -struct Key_register : Request_register { +struct Key_engraver : Request_engraver { Key key_; Key_change_req * keyreq_l_; Key_item * kit_p_; @@ -26,7 +26,7 @@ struct Key_register : Request_register { virtual void do_pre_move_processing(); virtual void do_post_move_processing(); virtual void acknowledge_element(Score_elem_info); - Key_register(); + Key_engraver(); NAME_MEMBERS(); private: void create_key(); @@ -34,4 +34,4 @@ private: void read_req(Key_change_req * r); }; -#endif // KEYREG_HH +#endif // KEYGRAV_HH diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index 0d8505d425..759e6d1123 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -25,7 +25,7 @@ struct Key_item : Item { Key_item(int cposition); void add(int pitch, int acc); - void read(const Key_register&); + void read(const Key_engraver&); void set_c_position(int); virtual void do_pre_processing(); Molecule* brew_molecule_p()const; diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 5a2a934578..321ea3382c 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -12,10 +12,10 @@ struct My_lily_lexer; struct Absolute_dynamic_req; -struct Acceptor; +struct Translator; struct Atom; struct Bar; -struct Bar_register; +struct Bar_engraver; struct Bar_req; struct Barcheck_req; struct Beam; @@ -30,12 +30,12 @@ struct Change_reg; struct Chord; struct Clef_change_req; struct Clef_item; -struct Clef_register; +struct Clef_engraver; struct Col_hpositions; struct Chord; struct Colinfo; struct Collision; -struct Collision_register; +struct Collision_engraver; struct Command_req; struct Command_script_req; struct Complex_music; @@ -50,7 +50,7 @@ struct Element_group; struct Element_group_item; struct Feature; struct General_script_def; -struct Global_acceptor; +struct Global_translator; struct Group_change_req; struct Group_feature_req; struct Horizontal_align_item; @@ -61,13 +61,13 @@ struct Idealspacing; struct Identifier; struct Interpreter; struct Input_file; -struct Input_register; +struct Input_engraver; struct Input_score; struct Item; struct Key; struct Key_change_req; struct Key_item; -struct Key_register; +struct Key_engraver; struct Keyword; struct Keyword_table; struct Lily_stream; @@ -76,7 +76,7 @@ struct Line_of_staff; struct Linestaff; struct Local_key; struct Local_key_item; -struct Local_key_register; +struct Local_key_engraver; struct Lookup; struct Lyric_item; struct Lyric_req; @@ -84,7 +84,7 @@ struct Measure_grouping_req; struct Melodic_req; struct Meter; struct Meter_change_req; -struct Meter_register; +struct Meter_engraver; struct Midi_def; struct Midi_duration; struct Midi_header; @@ -104,10 +104,10 @@ struct Music; struct Music_list; struct My_lily_parser; struct Note_column; -struct Note_column_register; +struct Note_column_engraver; struct Note_req; struct Note_head; -struct Note_head_register; +struct Note_head_engraver; struct Notename_table; struct Offset; struct Output; @@ -119,13 +119,13 @@ struct Plet; struct Pulk_voice; struct Pulk_voices; struct Rational; -struct Register_group_register; +struct Engraver_group_engraver; struct Request; struct Request_column; -struct Request_register; +struct Request_engraver; struct Rest; struct Rest_collision; -struct Rest_collision_register; +struct Rest_collision_engraver; struct Rest_column; struct Rest_req; struct Rhythmic_grouping; @@ -138,12 +138,12 @@ struct Score_elem_info; struct Script; struct Script_column; struct Script_def; -struct Script_register; +struct Script_engraver; struct Script_req; struct Simple_music; struct Skip_req; struct Slur; -struct Slur_register; +struct Slur_engraver; struct Slur_req; struct Spacing_req ; struct Span_dynamic_req; @@ -152,7 +152,7 @@ struct Spanner; struct Staff_side; struct Staff_symbol; struct Stem; -struct Stem_beam_register; +struct Stem_beam_engraver; struct Stem_req; struct String; struct Subtle_req; @@ -165,10 +165,10 @@ struct Tex_stream; struct Text_def; struct Text_gob; struct Text_item ; -struct Text_register; +struct Text_engraver; struct Text_req; struct Tie; -struct Tie_register; +struct Tie_engraver; struct Tie_req; struct Time_description; struct Timing_req; @@ -178,10 +178,10 @@ struct Vertical_group; struct Voice; struct Voice_element; -struct Voice_group_registers; +struct Voice_group_engravers; struct Voice_list; -struct Voice_registers; +struct Voice_engravers; struct Voicegroup; -struct Walker_registers; +struct Walker_engravers; typedef Rational Moment; #endif // LILY_PROTO_HH diff --git a/lily/include/local-key-reg.hh b/lily/include/local-key-grav.hh similarity index 68% rename from lily/include/local-key-reg.hh rename to lily/include/local-key-grav.hh index 41088f7c60..6ed5d78ac5 100644 --- a/lily/include/local-key-reg.hh +++ b/lily/include/local-key-grav.hh @@ -1,18 +1,18 @@ /* - local-key-reg.hh -- declare Local_key_register + local-key-grav.hh -- declare Local_key_engraver (c) 1997 Han-Wen Nienhuys */ -#ifndef LOCALKEYREG_HH -#define LOCALKEYREG_HH +#ifndef LOCALKEYGRAV_HH +#define LOCALKEYGRAV_HH -#include "register.hh" +#include "engraver.hh" #include "key.hh" #include "parray.hh" -struct Local_key_register : Request_register { +struct Local_key_engraver : Request_engraver { Key local_key_; Key const *key_C_; Array mel_l_arr_; @@ -23,8 +23,8 @@ struct Local_key_register : Request_register { virtual void do_process_requests(); virtual void acknowledge_element(Score_elem_info); virtual void do_pre_move_processing(); - Local_key_register(); + Local_key_engraver(); NAME_MEMBERS(); }; -#endif // LOCALKEYREG_HH +#endif // LOCALKEYGRAV_HH diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index 4b1479090a..aff20862d7 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -15,13 +15,12 @@ /// intuitive interface to symbol table struct Lookup { + Paper_def * paper_l_; Symtables *symtables_; String texsetting; /* *************** */ void add(String, Symtable*); void print()const; - Real internote_f()const; - Real interbeam_f()const; Symbol linestaff(int n, Real w)const; Symbol fill(Box b)const; diff --git a/lily/include/lyric-register.hh b/lily/include/lyric-engraver.hh similarity index 61% rename from lily/include/lyric-register.hh rename to lily/include/lyric-engraver.hh index e8468f0b9f..8771d4b3cd 100644 --- a/lily/include/lyric-register.hh +++ b/lily/include/lyric-engraver.hh @@ -1,5 +1,5 @@ /* - lyric-register.hh -- declare Lyric_register + lyric-engraver.hh -- declare Lyric_engraver source file of the GNU LilyPond music typesetter @@ -7,20 +7,20 @@ */ -#ifndef LYRIC_REGISTER_HH -#define LYRIC_REGISTER_HH -#include "register.hh" +#ifndef LYRIC_ENGRAVER_HH +#define LYRIC_ENGRAVER_HH +#include "engraver.hh" #include "varray.hh" #include "lily-proto.hh" -class Lyric_register : public Request_register { +class Lyric_engraver : public Request_engraver { Array lreq_arr_; virtual bool do_try_request(Request*); virtual void do_process_requests(); virtual void do_post_move_processing(); public: NAME_MEMBERS(); - Lyric_register(); + Lyric_engraver(); }; -#endif // LYRIC_REGISTER_HH +#endif // LYRIC_ENGRAVER_HH diff --git a/lily/include/meter-reg.hh b/lily/include/meter-grav.hh similarity index 75% rename from lily/include/meter-reg.hh rename to lily/include/meter-grav.hh index 26f9eaf0bf..38fe040450 100644 --- a/lily/include/meter-reg.hh +++ b/lily/include/meter-grav.hh @@ -1,5 +1,5 @@ /* - meter-reg.hh -- declare Meter_register + meter-grav.hh -- declare Meter_engraver source file of the GNU LilyPond music typesetter @@ -7,16 +7,16 @@ */ -#ifndef METERREG_HH -#define METERREG_HH -#include "register.hh" +#ifndef METERGRAV_HH +#define METERGRAV_HH +#include "engraver.hh" #include "time-description.hh" #include "grouping.hh" /** generate meters. */ -class Meter_register : public Request_register { +class Meter_engraver : public Request_engraver { public: Time_description time_; Rhythmic_grouping default_grouping_; @@ -30,7 +30,7 @@ public: virtual void do_pre_move_processing(); virtual void do_creation_processing(); virtual void do_post_move_processing(); - Meter_register(); + Meter_engraver(); NAME_MEMBERS(); }; -#endif // METERREG_HH +#endif // METERGRAV_HH diff --git a/lily/include/midi-walker.hh b/lily/include/midi-walker.hh index dea2478d24..d99b6efe67 100644 --- a/lily/include/midi-walker.hh +++ b/lily/include/midi-walker.hh @@ -12,69 +12,88 @@ #if 0 -// sketch. . . -class Midi_register { -}; - -class Midi_group_reg : public Midi_register, public Acceptor { +/* + sketch. . . + + It would be totally cool to share code with the Engraver hierarchy, + but this is very tough i think. + + */ +class Performer { + Performer_group_performer * daddy_perf_l_; + virtual bool try_request(Request*r) + { + return daddy_perf_l_->try_request(r); + } + virtual void play_event( Midi_item i ) { daddy_perf_l_->play_event (i ); } }; -class Midi_staff_reg : public Midi_group_reg { -}; - - -class Midi_note_reg : public Midi_register { +class Performer_group_performer : public Performer, public Translator { + Pointer_list perf_p_list_; -}; - -class Midi_voice_reg : public Midi_group_reg, public Interpreter { + Link_array group_l_arr_; + Link_array nongroup_l_arr_; + + bool try_request(Request*r) + { + bool hebbes_b =false; + for (int i =0; !hebbes_b && i < nongroup_l_arr_.size() ; i++) + hebbes_b =nongroup_l_arr_[i]->try_request(req_l); + if (!hebbes_b) + hebbes_b = daddy_grav_l_->try_request(req_l); + return hebbes_b ; + } }; -class Midi_score_reg: public Midi_group_reg, public Global_acceptor { +class Staff_performer : public Performer_group_performer +{ + int midi_track_i_; + String instrument_str() { + return Translator::id_str_; + } + virtual void play_event ( Midi_item i) + { + i.track_i_ = midi_track_i_; + Performer::play_event(i); + } }; +class Voice_performer_group_performer : public Performer_group_performer { -#include "grouping.hh" -#include "staff-walker.hh" -#include "pcursor.hh" -#include "pqueue.hh" - - -struct Note_event : PQueue_ent -{ - bool ignore_b_; - Note_event() { - ignore_b_ = false; - } }; -int compare(Note_event const&, Note_event const&); +class Note_performer : public Performer { + Melodic_req * current_l_; + Moment switch_off_at_,switch_on_at_; -/** - a simple walker which collects midi stuff, and then outputs. - Should derive from Staff_walker - */ -class Midi_walker : public PCursor + virtual void process_request() { + if (when() == switch_off_at_ ) + play_event( Note_event(current_l_->pitch() )) +}; + +class Voice_performer : + public Performer_group_performer, public Interpreter { - Midi_track *track_l_; - PQueue< Note_event > stop_notes; - - Moment last_moment_; +}; - /* *************** */ - void do_stop_notes(Moment); - void do_start_note(Note_req *note_l); - void output_event(Midi_item&, Moment); -public: - - Midi_walker(Staff*, Midi_track*); - void do_process_requests(); - ~Midi_walker(); +class Score_performer: + public Performer_group_performer, public Global_translator +{ + Midi_file * file_p_; + Moment prev_; + virtual void play_event(Midi_item i) + { + file_p_->output (i); + } + virtual void prepare(Moment m){ + file_p_->move ( m -prev_ ); + } }; + #endif #endif // MIDIWALKER_HH diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index d2326a6e53..c4fc80655c 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -22,11 +22,11 @@ protected: public: Music_iterator *daddy_iter_l_; NAME_MEMBERS(); - Acceptor *report_to_l_; + Translator *report_to_l_; - static Music_iterator* static_get_iterator_p(Music*,Acceptor*); + static Music_iterator* static_get_iterator_p(Music*,Translator*); Music_iterator* get_iterator_p(Music*)const; - void set_acceptor(Acceptor*); + void set_translator(Translator*); Music_iterator(); virtual void next(Moment until); virtual Moment next_moment()const; @@ -34,7 +34,7 @@ public: virtual ~Music_iterator(); virtual void construct_children(); void print()const; - virtual Acceptor * get_req_acceptor_l(); + virtual Translator * get_req_translator_l(); }; // duh. diff --git a/lily/include/note-column-reg.hh b/lily/include/note-column-grav.hh similarity index 72% rename from lily/include/note-column-reg.hh rename to lily/include/note-column-grav.hh index a15cd9108b..141fe4b93f 100644 --- a/lily/include/note-column-reg.hh +++ b/lily/include/note-column-grav.hh @@ -1,5 +1,5 @@ /* - note-column-reg.hh -- declare Note_column_register + note-column-grav.hh -- declare Note_column_engraver source file of the GNU LilyPond music typesetter @@ -7,12 +7,12 @@ */ -#ifndef NOTE_COLUMN_REG_HH -#define NOTE_COLUMN_REG_HH +#ifndef NOTE_COLUMN_GRAV_HH +#define NOTE_COLUMN_GRAV_HH -#include "register.hh" +#include "engraver.hh" -class Note_column_register :public Request_register { +class Note_column_engraver :public Request_engraver { Rest_column * rest_col_l(); Note_column * note_col_l(); @@ -31,7 +31,7 @@ protected: virtual void do_pre_move_processing(); virtual void do_post_move_processing(); public: - Note_column_register(); + Note_column_engraver(); NAME_MEMBERS(); }; -#endif // NOTE_COLUMN_REG_HH +#endif // NOTE_COLUMN_GRAV_HH diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index 21423cf5bc..98c9e11acd 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -10,6 +10,7 @@ #ifndef PAPER_DEF_HH #define PAPER_DEF_HH #include "lily-proto.hh" + #include "real.hh" #include "string.hh" #include "moment.hh" @@ -27,25 +28,24 @@ add support for multiple fontsizes split into "Input_paper_def" and Paper_def + add support for other len->wid conversions. - + + Input_engraver should be in here. */ class Paper_def { Lookup *lookup_p_; -public: - String outfile; - - Real linewidth; + Assoc *real_vars_p_; - /// how much space does a whole note take (ideally?) - Real whole_width; - - /// ideal = geometric_ ^ log2(duration) - Real geometric_; +public: + String outfile_str_; + /* *************** */ + void set_var(String, Real); + Real get_var (String)const; void reinit(); - Paper_def(Lookup*); + Paper_def(); void set(Lookup*); ~Paper_def(); Paper_def(Paper_def const&); @@ -60,17 +60,19 @@ 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; /// width of a quaver ball Real note_width() const; void print() const; + Lookup const * lookup_l(); // TODO naming /** convert a duration to an idealspacing - influence using the geometric_ and whole_width parameters. + influence using the geometric_ and parameters. */ Real duration_to_dist(Moment); }; diff --git a/lily/include/register-group.hh b/lily/include/register-group.hh deleted file mode 100644 index 466b47361b..0000000000 --- a/lily/include/register-group.hh +++ /dev/null @@ -1,90 +0,0 @@ -/* - registergroup.hh -- declare Register_group_register - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - - -#ifndef REGISTERGROUP_HH -#define REGISTERGROUP_HH - -#include "parray.hh" -#include "plist.hh" -#include "score-elem-info.hh" -#include "register.hh" -#include "acceptor.hh" - - -/** - Group a number of registers. Usually delegates everything to its contents. - Postfix: group - */ -class Register_group_register : public Request_register, public virtual Acceptor { -protected: - - Pointer_list reg_list_; - Link_array group_l_arr_; - Link_array nongroup_l_arr_; - - Array announce_info_arr_; - - virtual void do_print()const; - - virtual bool removable_b()const; - -public: - Input_register * ireg_l_; - void check_removal(); - Register_group_register(); - ~Register_group_register(); - - - - /** - Junk #reg_l#. - Pre: - #reg_l# is in #reg_list_# - */ - virtual void terminate_register(Request_register * reg_l); - - NAME_MEMBERS(); - - /** - Remove #reg_l# from the list, and return it. - */ - virtual Request_register * remove_register_p(Request_register*reg_l); - virtual void set_feature(Feature i); - virtual void sync_features() ; - virtual void do_pre_move_processing(); - virtual void do_post_move_processing(); - - virtual void do_removal_processing(); - virtual bool do_try_request(Request*); - virtual void do_process_requests(); - - virtual Staff_info get_staff_info()const; - - virtual Register_group_register * find_register_l(String name,String id); - virtual void do_announces(); - virtual void announce_element(Score_elem_info); - - - virtual void add(Request_register* reg_p); - - virtual bool contains_b(Request_register*)const; - - virtual Acceptor* find_get_acceptor_l(String name, String id); - virtual Acceptor * get_default_interpreter(); - /** - Go up in the tree. default: choose next parent - */ - Acceptor * ancestor_l(int l=1); - int depth_i() const; - -}; - -#endif // REGISTERGROUP_HH - - diff --git a/lily/include/rest-collision-reg.hh b/lily/include/rest-collision-grav.hh similarity index 59% rename from lily/include/rest-collision-reg.hh rename to lily/include/rest-collision-grav.hh index ecde3d6f96..2d67a1bde0 100644 --- a/lily/include/rest-collision-reg.hh +++ b/lily/include/rest-collision-grav.hh @@ -1,5 +1,5 @@ /* - rest-collision-reg.hh -- declare Rest_collision_register + rest-collision-grav.hh -- declare Rest_collision_engraver source file of the GNU LilyPond music typesetter @@ -7,13 +7,13 @@ */ -#ifndef REST_COLLISION_REG_HH -#define REST_COLLISION_REG_HH +#ifndef REST_COLLISION_GRAV_HH +#define REST_COLLISION_GRAV_HH #include "varray.hh" -#include "register.hh" +#include "engraver.hh" -class Rest_collision_register : public Request_register { +class Rest_collision_engraver : public Request_engraver { Rest_collision* rest_collision_p_; Array< Collision *> collision_l_arr_; protected: @@ -21,7 +21,7 @@ protected: virtual void do_print() const; virtual void do_pre_move_processing(); public: - Rest_collision_register(); + Rest_collision_engraver(); NAME_MEMBERS(); }; -#endif // REST_COLLISION_REG_HH +#endif // REST_COLLISION_GRAV_HH diff --git a/lily/include/score-align-reg.hh b/lily/include/score-align-grav.hh similarity index 59% rename from lily/include/score-align-reg.hh rename to lily/include/score-align-grav.hh index 3f7e15ca4f..72777e2dae 100644 --- a/lily/include/score-align-reg.hh +++ b/lily/include/score-align-grav.hh @@ -1,5 +1,5 @@ /* - score-align-reg.hh -- declare Score_align_reg + score-align-grav.hh -- declare Score_align_reg source file of the GNU LilyPond music typesetter @@ -7,22 +7,22 @@ */ -#ifndef SCORE_ALIGN_REG_HH -#define SCORE_ALIGN_REG_HH +#ifndef SCORE_ALIGN_GRAV_HH +#define SCORE_ALIGN_GRAV_HH -#include "register.hh" +#include "engraver.hh" -class Score_align_register: public Request_register +class Score_align_engraver: public Request_engraver { Horizontal_group_item * align_p_; public: const char* type_ch_C_; int priority_i_; - Score_align_register(); + Score_align_engraver(); NAME_MEMBERS(); protected: virtual void acknowledge_element(Score_elem_info); virtual void do_pre_move_processing(); }; -#endif // SCORE_ALIGN_REG_HH +#endif // SCORE_ALIGN_GRAV_HH diff --git a/lily/include/score-column.hh b/lily/include/score-column.hh index fb7f108729..b8daacd176 100644 --- a/lily/include/score-column.hh +++ b/lily/include/score-column.hh @@ -27,7 +27,7 @@ class Score_column { friend class Score; - friend class Score_register; + friend class Score_engraver; bool musical_b_; Moment when_; diff --git a/lily/include/score-elem-info.hh b/lily/include/score-elem-info.hh index b4d4fb748a..871634214f 100644 --- a/lily/include/score-elem-info.hh +++ b/lily/include/score-elem-info.hh @@ -19,7 +19,7 @@ struct Score_elem_info { Score_elem * elem_l_; Request*req_l_; Voice const * voice_l_; - Array origin_reg_l_arr_; + Array origin_grav_l_arr_; /* *** */ Score_elem_info(Score_elem*, Request*); diff --git a/lily/include/score-reg.hh b/lily/include/score-grav.hh similarity index 67% rename from lily/include/score-reg.hh rename to lily/include/score-grav.hh index 3c4c668ea6..92b659a377 100644 --- a/lily/include/score-reg.hh +++ b/lily/include/score-grav.hh @@ -1,5 +1,5 @@ /* - score-reg.hh -- declare Score_register + score-grav.hh -- declare Score_engraver source file of the GNU LilyPond music typesetter @@ -7,13 +7,15 @@ */ -#ifndef SCORE_REG_HH -#define SCORE_REG_HH +#ifndef SCORE_GRAV_HH +#define SCORE_GRAV_HH -#include "register-group.hh" -#include "global-acceptor.hh" +#include "engraver-group.hh" +#include "global-translator.hh" -class Score_register : public Register_group_register, public Global_acceptor { +class Score_engraver : + public Engraver_group_engraver, public Global_translator +{ Line_of_score * scoreline_l_; @@ -30,19 +32,19 @@ class Score_register : public Register_group_register, public Global_acceptor { public: NAME_MEMBERS(); - Score_register(); + Score_engraver(); protected: - /* Global_acceptor interface */ + /* Global_translator interface */ virtual void set_score(Score * score_l); virtual void prepare(Moment); virtual void finish(); virtual void process(); - virtual int depth_i() const { return Global_acceptor::depth_i();} - virtual Acceptor* ancestor_l(int l) { return Global_acceptor::ancestor_l(l);} + virtual int depth_i() const { return Global_translator::depth_i();} + virtual Translator* ancestor_l(int l) { return Global_translator::ancestor_l(l);} protected: - /* Register_group_register interface */ + /* Engraver_group_engraver interface */ virtual Staff_info get_staff_info()const; virtual bool do_try_request(Request*); virtual void do_creation_processing(); @@ -55,4 +57,4 @@ protected: virtual void do_pre_move_processing(); }; -#endif // SCORE_REG_HH +#endif // SCORE_GRAV_HH diff --git a/lily/include/score-halign-reg.hh b/lily/include/score-halign-grav.hh similarity index 50% rename from lily/include/score-halign-reg.hh rename to lily/include/score-halign-grav.hh index 8a0559ff8d..fef509157a 100644 --- a/lily/include/score-halign-reg.hh +++ b/lily/include/score-halign-grav.hh @@ -1,5 +1,5 @@ /* - score-halign-reg.hh -- declare Score_horizontal_align_register + score-halign-grav.hh -- declare Score_horizontal_align_engraver source file of the GNU LilyPond music typesetter @@ -7,17 +7,17 @@ */ -#ifndef SCORE_HALIGN_REG_HH -#define SCORE_HALIGN_REG_HH -#include "register.hh" -class Score_horizontal_align_register : public Request_register { +#ifndef SCORE_HALIGN_GRAV_HH +#define SCORE_HALIGN_GRAV_HH +#include "engraver.hh" +class Score_horizontal_align_engraver : public Request_engraver { Break_align_item * halign_p_; public: NAME_MEMBERS(); - Score_horizontal_align_register(); + Score_horizontal_align_engraver(); protected: virtual void acknowledge_element(Score_elem_info); virtual void do_pre_move_processing(); }; -#endif // SCORE_HALIGN_REG_HH +#endif // SCORE_HALIGN_GRAV_HH diff --git a/lily/include/score.hh b/lily/include/score.hh index 56e29b8513..b11118f17f 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -58,13 +58,10 @@ public: /// find a column. PCursor find_col(Moment,bool); - /// when does the last *musical* element finish? - Moment last() const; - Score(Score const&); private: - void run_acceptor(Global_acceptor*); + void run_translator(Global_translator*); void paper_output(); /// do midi stuff void midi(); diff --git a/lily/include/script-reg.hh b/lily/include/script-grav.hh similarity index 69% rename from lily/include/script-reg.hh rename to lily/include/script-grav.hh index 41dccfb6c3..fc8f02980d 100644 --- a/lily/include/script-reg.hh +++ b/lily/include/script-grav.hh @@ -1,17 +1,17 @@ /* - script-reg.hh -- part of GNU LilyPond + script-grav.hh -- part of GNU LilyPond (c) 1997 Han-Wen Nienhuys */ -#ifndef SCRIPTREG_HH -#define SCRIPTREG_HH +#ifndef SCRIPTGRAV_HH +#define SCRIPTGRAV_HH -#include "register.hh" +#include "engraver.hh" -class Script_register : public Request_register { +class Script_engraver : public Request_engraver { Array