From: Han-Wen Nienhuys Date: Tue, 1 Jul 1997 12:49:26 +0000 (+0200) Subject: release: 0.0.71pre X-Git-Tag: release/0.0.71pre X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b17fe8f245d6eab3eb1c8d66ee8a6f7acb94f85e;p=lilypond.git release: 0.0.71pre --- diff --git a/.version b/.version index 32b8cd6abf..e8b651c3d1 100644 --- a/.version +++ b/.version @@ -1,6 +1,6 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 0 -TOPLEVEL_PATCH_LEVEL = 70 +TOPLEVEL_PATCH_LEVEL = 71 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/ANNOUNCE b/ANNOUNCE index 7b4d64deed..3c1450f607 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -8,13 +8,13 @@ daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys -Lily is a healthy, bouncing baby weighing 340 kilobytes +Lily is a healthy, bouncing baby weighing 345 kilobytes Visiting hours: 24hrs a day at ftp://pcnov095.win.tue.nl, -you can see some diapers and pictures at +you can see some babyfood, diapers and pictures at http://www.stack.nl/~hanwen/lilypond/index.html @@ -29,8 +29,9 @@ Wendy (hanwen@stack.nl) Those deserving special mention (in no particular order): Esther, Marijke, Heike, Inge, Judith, Hannah, Auke, Ilse, Evelyn, -Maartje, Suzanne, Ilse (gee, again?), most members of the Eindhovens -Jongeren Ensemble and last (but certainly not least) Janneke! +Maartje, Suzanne, Ilse (gee, again?), my friends in the +Eindhovens Jongeren Ensemble and last (but certainly not least) +Janneke! HW diff --git a/AUTHORS.text b/AUTHORS.text index 7187b9e439..c5e26b01bc 100644 --- a/AUTHORS.text +++ b/AUTHORS.text @@ -30,7 +30,7 @@ CCCCOOOONNNNTTTTRRRRIIIIBBBBUUUUTTTTOOOORRRRSS reg.cc, clef-item.cc testing, general comments. +o Werner Lemberg , misc - bugfixes. + bugfixes, some Beam and Stem code. @@ -61,6 +61,6 @@ CCCCOOOONNNNTTTTRRRRIIIIBBBBUUUUTTTTOOOORRRRSS -19/May/97 LilyPond 0.0.68 1 +30/Jun/97 LilyPond 0.0.71 1 diff --git a/BUGS b/BUGS index b0b28cd6d1..76d2ecd7a5 100644 --- a/BUGS +++ b/BUGS @@ -1,5 +1,8 @@ This file documents bugs which were "re-introduced" in various pl's +pl 70 + * r^"simile" + pl69 * scales.ly @@ -7,6 +10,7 @@ pl69 * slurs.ly pl68: + * opening rests wohltemperirt * lyrics broken, diff --git a/Documentation/AUTHORS.pod b/Documentation/AUTHORS.pod index 7f343d780e..dc2f0b2431 100644 --- a/Documentation/AUTHORS.pod +++ b/Documentation/AUTHORS.pod @@ -39,7 +39,8 @@ testing, general comments. =item * -Werner Lemberg , misc bugfixes. +Werner Lemberg , misc bugfixes, some +Beam and Stem code. =back diff --git a/Documentation/lilygut.pod b/Documentation/lilygut.pod index 3278492c6b..52f787c2f7 100644 --- a/Documentation/lilygut.pod +++ b/Documentation/lilygut.pod @@ -30,36 +30,9 @@ might be integrated in larger systems. No difficult algorithms. Associated datastructures have prefix Input (eg Input_score, Input_command). The .ly file is read, and converted -to Requests, Voice_elements, Voices. +to -The result looks something like this (? = 0 or 1, * =0 or more, + = 1 -or more) - - Score { - Midi_def? - Paper_def? - Staff+ { - Voice+ { - start_moment - Voice_element* { - duration - Request* - } - } - Input_register { ..} - } - } - -Request is a baseclass for almost all kinds of information. As you can -see, the info is stored horizontally; horizontally is the natural form -for entering music. - -=item Setting up music - -Simultaneous Requests are grouped into columns. Vertical is the -natural form for processing music. - -=item Processing: +=item Creating elements Requests are processed and used to create elements (like balls, stems, slurs etc). This is done by a hierarchy of "brokers" (called @@ -104,51 +77,7 @@ determine what to output when. =head1 INTERNALS -This chapter deals with the internals of Mudela. In the end Mudela -converted to Voice, which contain Voice_elements which (in turn) -contain Requests. The former 2 types are basically containers (lists). -Consider the following simple mudela - - \music { c4 } - -After the parsing, this is converted to: (from the debug output) - - Voice { start: 0 - voice_element { dur :1/4 - Stem_req {duration { 4}} - Note_req {notename: 0 acc: 0 oct: -1 - duration { 4}} - Group_change_req {} - } - voice_element { dur :0 - Terminate_voice_req {} - } - } - - Voice { start: 1/4 - voice_element { dur :1/4 - Stem_req {duration { 4}} - Note_req {notename: 2 acc: 0 oct: -1 - duration { 4}} - Group_change_req {} - } - voice_element { dur :0 - Terminate_voice_req {} - } - } - - Voice { start: 1/4 - voice_element { dur :1/4 - Stem_req {duration { 4}} - Note_req {notename: 4 acc: 0 oct: -1 - duration { 4}} - Group_change_req {} - } - voice_element { dur :0 - Terminate_voice_req {} - } - } - +This chapter deals with the internals of Mudela. =head2 Requests @@ -224,15 +153,6 @@ Dynamic changes can occur in a smaller time than the length of its note, therefore fore each C request carries a time, measured from the start of its note. -=head2 Voice_element - -Voice_element is a list of requests together with a duration. It is -strictly horizontal - -=head2 Voice - -Voice is a list of Voice_elements together with a starting time. - =head2 Voice groups Voice group is a (time-dependent) collection of voices which share diff --git a/Documentation/lilyliterature.pod b/Documentation/lilyliterature.pod index e92cb72a9a..bb56b4a911 100644 --- a/Documentation/lilyliterature.pod +++ b/Documentation/lilyliterature.pod @@ -133,7 +133,7 @@ ISBN 3-9000 035-96-2. some of the conventions and difficulties in printing music] The University of Colorado Music Engraving page. -http://obenamots.cc.colorado.edu/cgi-bin/Musicpress/engraving.html +http://obenamots.cc.colorado.edu/Musicpress/engraving.html More on GNU Music: http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp diff --git a/Documentation/other-packages.pod b/Documentation/other-packages.pod index fc3a2585cd..55ecd4c6df 100644 --- a/Documentation/other-packages.pod +++ b/Documentation/other-packages.pod @@ -5,77 +5,80 @@ Other-packages -- related packages =head1 DESCRIPTION A (not-at-all complete) overview of other music-typesetting/notation -packages. Feel free to add info (and mail it to me). Partly based on -a reflist by Miguel Filgueiras . +packages. Feel free to add info (and mail it to me). =head2 Free packages (with source) G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp +An alpha version notation editor for X. Source available on request. + Rosegarden, http://www.math.bath.ac.uk/~masjpf/rose.html -Common Music/Common Notation, ftp://ccrma-ftp.stanford.edu/pub/Lisp +A Notation editor/Sequencer for X (win95 port underway). Outputs musictex. + +Common Notation, ftp://ccrma-ftp.stanford.edu/pub/Lisp + +A versatile lisp package. Part of the Common Music system. Input is in Lisp. + +Vivace, http:// -Vivace +A amateurish notation program for TclTk and X MPP, http://www.stack.nl/~hanwen/mpp-english.html -Jan Nieuwenhuizen, Using TeX and the MusiXTeX macro package to -write parts and scores of music. Department of Physics, Eindhoven -University of Technology, 1995. +A preprocessor to MusixTeX by Jan Nieuwenhuizen and Han-Wen Nienhuys. +It is outdated by its successor, LilyPond. -MusicEase, ftp://ftp.secret.com/ad-ftp +Music, http:// -Described in Computer vol 29(6) +A TROFF preprocessor by Eric Foxley +MusicEase, ftp://ftp.secret.com/ad-ftp +Described in Computer vol 29(6) MusE -A-R Editions, Inc. +A-R Music Engraving, by A-R Editions, Inc. Professional engraving on +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 ($ 29). -PMX +PMX, http://www.gmd.de/Misc/Music/ -Don Simons, PMX, A Preprocessor for MusiXTeX (Version 1.04). -dsimons@logicon.com. +A Preprocessor for MusiXTeX by Don Simons -Musi*TeX, http://www.gmd.de/misc/music +Musi*TeX, http://www.gmd.de/Misc/Music/ -Daniel Taupin, Ross Mitchell and Andreas Egler, MusixTeX: Using TeX -to Write Polyphonic or Instrumental Music (Version T.64). Laboratoire -de Physique des Solides, Centre Universitaire, Orsay, 1993. +MusixTeX is a macro package for TeX to typeset polyphonic or +instrumental music by Daniel Taupin, Ross Mitchell and Andreas +Egler. It includes a font set with lots symbols -ABC2MTeX +ABC2MTeX, http://www.gmd.de/Misc/Music/ -Chris Walshaw, ABC2MTeX --- An easy way of transcribing folk -and traditional music. School of Maths, University of Greenwich, 1993. +A preprocessor to MusixTeX by Chris Walshaw for way of transcribing folk +and traditional music. SceX -Miguel Filgueiras and Jos\'e Paulo Leal, A First Formulation of -SceX, a Music Typesetting System. Centro de Inform\'atica da -Universidade do Porto, 1993. +A preprocessor to MusixTeX by Miguel Filgueiras. Source in prolog +available on request. (?) -MUTEX +MUTEX, http://www.gmd.de/Misc/Music/ -Fran\ccois Jalbert, MuTeX User's Guide (Version 1.1). Computer -Science Department, University of British Columbia, 1989. +A TeX macro package for typesetting single-staff music by Angelika +Schofer & Andrea Steinbach. With some fonts =head2 Free (zero cents) Calliope, http://www.cl.cam.ac.uk/users/wfc/ -A NeXT package - -Mozart - -A windows package +A NeXT package by William F Clocksin. Requires Adobe fonts =head2 Proprietary @@ -87,6 +90,16 @@ Finale Score +Personal Composer + +Mozart, + +A shareware windows package, + +Capella + +Encore + Musicator =head2 Unknown diff --git a/INSTALL.text b/INSTALL.text index 128c028fac..8d66791533 100644 --- a/INSTALL.text +++ b/INSTALL.text @@ -61,7 +61,7 @@ CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG a -28/May/97 LilyPond 0.0.68 1 +28/May/97 LilyPond 0.0.71 1 @@ -127,7 +127,7 @@ INSTALL(1) LilyPond documentation INSTALL(1) -28/May/97 LilyPond 0.0.68 2 +28/May/97 LilyPond 0.0.71 2 @@ -193,7 +193,7 @@ RRRRUUUUNNNNNNNNIIIINNNNGGGG -28/May/97 LilyPond 0.0.68 3 +28/May/97 LilyPond 0.0.71 3 @@ -259,7 +259,7 @@ WWWWIIIINNNNDDDDOOOOZZZZEEEE -28/May/97 LilyPond 0.0.68 4 +28/May/97 LilyPond 0.0.71 4 @@ -325,6 +325,6 @@ AAAAUUUUTTTTHHHHOOOORRRRSSSS -28/May/97 LilyPond 0.0.68 5 +28/May/97 LilyPond 0.0.71 5 diff --git a/NEWS b/NEWS index 5ac7e17c28..78e451c794 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,18 @@ +pl 71pre + - init id's, Input_register aliases. + - bf: notehead x-swap + - bf: auto-keys. + - bf: first clef + - junked \init_end; construct + - Preparatory work for MIDI output: + * Acceptor as baseclass for Register_group_register + * Global_acceptor as interface of Register to Score + - bf: empty voice + - Lyrics: partially working + - some doco updates (junks, mostly) + + +****** june 30 pl 70pre - bf: text Script diff --git a/TODO b/TODO index 4350bd6d0b..1b65c99ac0 100644 --- a/TODO +++ b/TODO @@ -6,7 +6,7 @@ done, or is an idea that I want to think about Most of the items are marked in the code as well, with full explanation. grep for TODO and ugh/ugr - * + * whole head on ledger line * piano staff @@ -26,6 +26,8 @@ grep for TODO and ugh/ugr PROJECTS + * accidentals per Voice_group + * Convert all ref/bib stuff into BibTeX. * Output class, handles : (smallish) diff --git a/init/register.ini b/init/register.ini index a7d3257a9a..16b868b206 100644 --- a/init/register.ini +++ b/init/register.ini @@ -1,4 +1,6 @@ % +% setup for Request->Element conversion. Guru-only +% \requestregister { "Score_register" @@ -11,8 +13,8 @@ \consists "Score_horizontal_align_register"; \contains\requestregister { - "Staff_registers" - + "Staff_registers" + \alias "Staff"; \consists "Bar_register"; \consists "Clef_register"; \consists "Key_register"; @@ -37,6 +39,20 @@ } } } + + \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 d14a1037a0..df9c040652 100644 --- a/init/symbol.ini +++ b/init/symbol.ini @@ -7,5 +7,3 @@ \include "table_sixteen.ini" -%% Fix Me. This sux. -\init_end ; diff --git a/input/collisions.ly b/input/collisions.ly index 5edeb80f23..de6805fed9 100644 --- a/input/collisions.ly +++ b/input/collisions.ly @@ -3,7 +3,7 @@ filename: collisions.ly title: description: random counterpoint to test collisions - composer(s): HWN,JCN + composer(s): entered-by: HWN,JCN copyright: public domain diff --git a/input/kortjakje.ly b/input/kortjakje.ly index 95e8187dd9..91e733abe3 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -10,7 +10,7 @@ Tested Features: example file with comments EndMudelaHeader %} -\version "0.0.59"; +\version "0.0.60"; % the % is a comment. @@ -50,7 +50,7 @@ begeleiding = \melodic{ 'c4 % ' before note means one octave lower. % Similarly: ' after means one higher. c e c f c e c d 'b c 'a 'f 'g 'c2 | - \octave 'c ; + \octave c ; e4 'g d 'g c 'g 'b 'g e 'g d 'g c 'g 'b 'g %%%% var 1 r8 e8() c4 r8 e8() c4 r8 f8() c4 r8 e8() c4 @@ -64,7 +64,7 @@ begeleiding = \melodic{ \begeleiding > \paper{ - \unitspace 2.5\cm % a whole note takes 2.5 \cm ideally. + \unitspace 2.5\cm; % a whole note takes 2.5 \cm ideally. } } diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 769a032cc7..1af7644ba5 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -1,11 +1,11 @@ %{MudelaHeader filename: scsii-menuetto.ly - title:Solo Cello Suites, - description: Suite II part V, Menuetto I + title: Solo Cello Suites, Suite II part V, Menuetto I + description: Cello suite transcribed for Viola composers: Johann Sebastian Bach (1685-1750) entered-by: JCN - copyright: + copyright: public domain Tested Features:breaking algorithm, chords, multivoice, accents diff --git a/input/standchen.ly b/input/standchen.ly index 867b6caaa1..a4dd55c3fd 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -465,11 +465,13 @@ tekstII = \lyric{ } \score{ -% \staff{ lyricregs tekstI } -% \staff{ lyricregs tekstII } + < \multi 3; + { \id "Lyric" "1"; tekstI } % ugh + { \id "Lyric" "2"; tekstII } - \melodic < \multi 3; < \melodie \commands > - <\begeleiding \commands > + \melodic < \melodie \commands > + \melodic <\begeleiding \commands > + > \paper{ \width 195.\mm; diff --git a/input/twinkle.ly b/input/twinkle.ly index 8a17727959..fb986f1ae4 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -14,7 +14,7 @@ Tested Features: lyrics EndMudelaHeader %} -\version "0.0.58"; +\version "0.0.60"; melody = \melodic{ \clef\violin; @@ -22,8 +22,8 @@ melody = \melodic{ c4 c | g g | a a | g g | f f | e e | d d8.( e16 | )c2 | % :| - g g | f f | e e | d d | - g g | f f | e( e8. f16 | e )d | + g4 g | f f | e e | d d | + g g | f f | e( e8. f16 | e4 )d | c c | g g | a a | g g | f f | e e | d d8.( e16 | )c2 % :| @@ -37,8 +37,8 @@ accompany = \melodic { c4 c' | e' c' | f' c' | e' c' | d' b | c' a | f g | c2 | - e' g | d g | c' g | b g | - e' g | d' g | c' c'8.( d'16 | c' )b | + e'4 g | d g | c' g | b g | + e' g | d' g | c' c'8.( d'16 | c'4 )b | c c' | e' c' | f' c' | e' c' | d' b | c' a | f g | c2 @@ -52,78 +52,82 @@ global = \melodic { } tekst = \lyric{ - Al- tijd is Kort- jak- je ziek,2 - midden in_de week maar s'_zon- dags niet.2 - s'_Zon- dags gaat ze naar de kerk,2 - met een boek vol zil- ver werk.2 - Al- tijd is Kort- jak- je ziek,2 - midden in_de week maar s'_zon- dags niet.2 + Al-4 tijd is Kort- jak- je ziek,2 + midden4 in_de week maar s'_zon- dags niet.2 + s'_Zon-4 dags gaat ze naar de kerk,2 + met4 een boek vol zil- ver werk.2 + Al-4 tijd is Kort- jak- je ziek,2 + midden4 in_de week maar s'_zon- dags niet.2 } hegedraagjetekst = \lyric{ - Al- tijd zuigt Bill Gates mijn piek,2 - "\TeX" is slecht- ser dan mu- ziek.2 - s'_Zon- dags gaat het door een raam,2 - Weet dat ik me er- voor schaam.2 - Al- tijd zuigt Bill Gates mijn piek,2 - "\TeX" is slecht- ser dan mu- ziek.2 + Al-4 tijd zuigt Bill Gates mijn piek,2 + "\TeX"4 is slecht- ser dan mu- ziek.2 + s'_Zon-4 dags gaat het door een raam,2 + Weet4 dat ik me er- voor schaam.2 + Al-4 tijd zuigt Bill Gates mijn piek,2 + "\TeX"4 is slecht- ser dan mu- ziek.2 } texte = \lyric{ \textstyle "italic" ; - Ah! vous dir- ai_- je ma man2 - Ce qui cau- se mon tour- ment2 - Pa- pa veut que je rai- sonne2 - Comme un- e grand- e per- sonne2 - Moi je dis que les bon- bons2 - Val- ent mieux que la rai- son2 + Ah!4 vous dir- ai_- je ma man2 + Ce4 qui cau- se mon tour- ment2 + Pa-4 pa veut que je rai- sonne2 + Comme4 un- e grand- e per- sonne2 + Moi4 je dis que les bon- bons2 + Val-4 ent mieux que la rai- son2 } texti = \lyric{ \textstyle "roman"; - Twin- kle, twin- kle, lit- tle star,2 - How I won- der what you are.2 - Up a- bove the world so high,2 - Like a dia- mond in the sky.2 - Twin- kle, twin- kle, lit- tle star,2 - How I won- der what you are!2 + Twin-4 kle, twin- kle, lit- tle star,2 + How4 I won- der what you are.2 + Up4 a- bove the world so high,2 + Like4 a dia- mond in the sky.2 + Twin-4 kle, twin- kle, lit- tle star,2 + How4 I won- der what you are!2 } textii = \lyric{ - When the bla- zing sun is gone,2 - When he no- thing shines up- on,2 - Then you show your lit- tle light,2 - Twin- kle, twin- kle, all the night.2 - Twin- kle, twin- kle, lit- tle star,2 - How I won- der what you are!2 + When4 the bla- zing sun is gone,2 + When4 he no- thing shines up- on,2 + Then4 you show your lit- tle light,2 + Twin-4 kle, twin- kle, all the night.2 + Twin-4 kle, twin- kle, lit- tle star,2 + How4 I won- der what you are!2 } textiii = \lyric{ - Then the tra- veler in the dark2 - Thanks you for your ti- ny spark;2 - He_could not see which way to go,2 - If you did not twin- kle so.2 - Twin- kle, twin- kle, lit- tle star,2 - How I won- der what you are!2 + Then4 the tra- veler in the dark2 + Thanks4 you for your ti- ny spark;2 + He_could4 not see which way to go,2 + If4 you did not twin- kle so.2 + Twin-4 kle, twin- kle, lit- tle star,2 + How4 I won- der what you are!2 } \score{ - \staff{ melodicregs global melody } - \staff{ lyricregs global tekst hegedraagjetekst } - \staff{ lyricregs global texte } - \staff{ lyricregs global texti textii textiii } - \staff{ melodicregs global accompany } + < \multi 3; + \melodic <\global \melody > + + % ugh + \lyric < \id "Lyric" "1"; \global \tekst \hegedraagjetekst > +% \lyric < \id "Lyric" "2"; \global \texte > +% \lyric < \id "Lyric" "3"; \global \texti \textii \textiii > + \melodic < \global \accompany > + > \paper{ - \unitspace 2.5\cm + \unitspace 2.5\cm; } \midi{ - \tempo 4:120 + \tempo 4:120 ; } } diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index 00ad8716ac..ff2f0a6ef9 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -2,18 +2,11 @@ title: Das Wohltemperirte Clavier I, Fuga II (c-minor) description: following Henle's Urtext composer(s): JS Bach - entered-by: HWN - corrected-by: Werner Lemberg (tested with pl 64; 1997-05-17) + entered-by: HWN and Werner Lemberg copyright: Public Domain Tested Features: stem direction, multivoice, forced accidentals. - Remarks: the stem direction algorithm is severely broken (look at the -bass dux) with pl64. [this is supposedly fixed in pl68, can anybody -knowledgeable remove this comment if it's not appropriate anymore?] - - - %} \version "0.0.60"; @@ -38,9 +31,10 @@ dux = [es c' b a] [g f! es d] [c8 es' d' c'] | [bes a bes c'] [fis g a fis] | %% 5 - g4 r16 [c d es] [f g as8~] [as16 d es f]| - [g a bes8~] [bes16 es f g] [as g f es] [d8 c'16 b]| - c'4 r4 r8 [f' es' d'] + g4 r16 [c d es] [f g as8~] [as16 d es f] | + [g a bes8~] [bes16 es f g] [as g f es] [d8 c'16 b!] | + % forced accident! + c'4 r4 r8 [f' es' d'] | r8 [as g f] [g f16 es] [f8 d] | g4 r8 b [c' c'16 b] [c'8 g] | %% 10 @@ -50,16 +44,9 @@ dux = [bes8 c' bes as] [bes g f es] | [f des' c' bes] [c' as g f] | %% 15 - g8 \octave c'; [g16 fis] [g8 c] [es g16 fis] [g8 a] | -% [d g16 fis] [g8 a] [c16 d] es4 [d16 c] | - [d g16 fis] [g8 a] [c16 d] es4 [d16 c] | - % wouldn't it be better if I can write - % `a' instead of `a!' here to get really - % an `a natural'? Processing this melody - % alone (only having `a') would yield a - % different result! (WL) -%% I don't understand the complaint. The ! makes no difference in output. HWN - + g8 \octave c'; [g16 fis] [g8 c] [es g16 fis!] [g8 a] | + [d g16 fis] [g8 a!] [c16 d] es4 [d16 c] | + % forced accident! 'bes8 r8 r16 [d e fis] [g a bes8~] [bes16 e f g] | [a bes c'8~] [c'16 fis16 g a] [bes8 es!16 d] [es8 'g] | ['as f16 es] [f8 'a8] ['bes g16 f] [g8 'b] | @@ -77,12 +64,7 @@ dux = [f16 d es c]~ [c8 B] c4 r8 e | %% 30 f4 r8 f [f es16 d] [es8 | -% f4 r8 [f es16 d] [es8 | - % bug! if you say - % f4 r8 ... - % the chord overlaps. WL -%% confirmed. added to TODO. HWN - r r | + r r | } @@ -97,7 +79,7 @@ comes = %% 5 ['bes8 es16 d] [es8 'g8] ['as f16 es] [f8 'a] ['bes8 g16 f] [g8 'b] [c8 d16 es] f4~ | - [f8 es16 d] [c16 'bes 'as 'g] ['f8 as g f] + [f8 es16 d] [c16 'bes! 'as 'g] ['f8 as g f] [es d es f] ['b c d 'b] | [c g16 fis] [g8 d] es4 r8 e8 | %% 10 @@ -107,9 +89,9 @@ comes = [G16 Es F G] [As Bes c d] [es d c d] [es f g a] | [bes F G As] [Bes c d e] [f es d es] [ f g a b] | %% 15 - [c'8 b16 a] [g f es d] [c8 es d c] | + [c'8 b16 a] [g f! es d] [c8 es d c] | [Bes A Bes c] [Fis! G A Fis] | - % see comment above about forced acc. + % forced accident [G8 d16 c] d8 r8 r8 [e16 d] e8 r8 | r [fis16 e] fis8 r r [G16 F] G8 r8 | r8 [A16 G] A8 r r [B16 A] B8 r | @@ -144,13 +126,7 @@ bassdux = r8 [c16 B] [c8 G] [As c16 B] [c8 d] | [G c16 B] [c8 d] [F16 G] As4 [G16 F] | \octave c; [es c' b a] [g f es d] [c d es d] [c Bes! As! G] | - % I think we shouldn't need to force - % accidents here because they are in - % another octave range. WL - -%% I don't understand the complaint. Accidentals are valid for one octave range -%% only. Without ! (and printed flat), this still is valid. HWN - + % -> \classic_accidentals %% 10 [F bes as g] [f es d c] [Bes c d c] [Bes As G F] | [Es as g f] [es des c Bes] [As8 c' bes as] | @@ -164,13 +140,13 @@ bassdux = [f d'16 c'] [d'8 fis] g4 r16 [G A B] | [c16 d es8~] [es16 A Bes c] [d es f8~] [f16 'b c d] | %% 20 - es8 r r e [f F Es! D] | % see comment above about octave range + es8 r r e [f F Es! D] | % -> \classic_accidentals r [As G F] [G F16 Es] [F8 G] | [c16 d es d] [c Bes As G] [F bes as g] [f es d c] | [Bes c d c] [Bes As G F] [Es as g f] [es d c Bes] | [As Bes c Bes] [As G F Es] [D g f es] [d c B A] | %% 25 - g4 r4 r16 [G A B] [c d es f] | + G4 r4 r16 [G A B] [c d es f] | [g f as g] [f es d c] [B8 c16 B] [c8 G] | [As c16 B] [c8 d] [G c16 B] [c8 d] | [F16 G] As4 [G16 F] Es4 r8 es | @@ -182,22 +158,20 @@ bassdux = > } - - \score { - \melodic < \multi 1; - < \multi 2; - \global - \dux - \comes - > - < \multi 2; - \global - \bassdux - > - - > + \melodic < \multi 1; + < \multi 2; + \global + \dux + \comes + > + < \multi 2; + \global + \bassdux + > + > + \paper{} \midi { \tempo 4:84; @@ -205,5 +179,3 @@ bassdux = } % EOF - - diff --git a/lily/.version b/lily/.version index e613199be6..27a118a8d6 100644 --- a/lily/.version +++ b/lily/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 0 MINOR_VERSION = 0 -PATCH_LEVEL = 70 +PATCH_LEVEL = 71 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/lily/acceptor.cc b/lily/acceptor.cc new file mode 100644 index 0000000000..0164b83b24 --- /dev/null +++ b/lily/acceptor.cc @@ -0,0 +1,16 @@ +/* + 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/clef-reg.cc b/lily/clef-reg.cc index 4e3d25eb40..3f4c311937 100644 --- a/lily/clef-reg.cc +++ b/lily/clef-reg.cc @@ -56,10 +56,9 @@ void Clef_register::acknowledge_element(Score_elem_info info) { if (info.elem_l_->name() == Bar::static_name() ) { - if (!clef_p_){ - create_clef(); + create_clef(); + if ( !clef_req_l_ ) clef_p_->default_b_ = true; - } } } @@ -79,8 +78,7 @@ Clef_register::do_try_request(Request * r_l) clef_req_l_ = creq_l->clefchange(); - // do it now! Others have to read c0_pos. - read_req(creq_l->clefchange()); + read_req(clef_req_l_); return true; } @@ -89,13 +87,11 @@ Clef_register::create_clef() { if (!clef_p_) { clef_p_ = new Clef_item; - announce_element(Score_elem_info(clef_p_, - clef_req_l_)); - - clef_p_->read(*this); + announce_element(Score_elem_info(clef_p_,clef_req_l_)); } - + clef_p_->read(*this); } + void Clef_register::do_process_requests() { diff --git a/lily/global-acceptor.cc b/lily/global-acceptor.cc new file mode 100644 index 0000000000..057881adc7 --- /dev/null +++ b/lily/global-acceptor.cc @@ -0,0 +1,69 @@ +/* + global-acceptor.cc -- implement + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "music.hh" +#include "global-acceptor.hh" +#include "score.hh" +#include "score-column.hh" + +Global_acceptor::Global_acceptor() +{ + score_l_ = 0; + last_mom_ = 0; +} + +Acceptor* +Global_acceptor::ancestor_l(int) +{ + return this; +} + +void +Global_acceptor::add_moment_to_process(Moment m) +{ + if (m > last_mom_) + return; + + for (int i=0; i < extra_mom_pq_.size(); i++) + if (extra_mom_pq_[i] == m) + return; + extra_mom_pq_.insert(m); +} + +int +Global_acceptor::depth_i()const +{ + return 0; +} + +void +Global_acceptor::set_score(Score *s) +{ + score_l_ = s; + last_mom_ = score_l_->music_p_->time_int().max(); +} + +void +Global_acceptor::modify_next(Moment &w) +{ + while (extra_mom_pq_.size() && + extra_mom_pq_.front() <= w) + + w =extra_mom_pq_.get(); +} + +int +Global_acceptor::moments_left_i()const +{ + return extra_mom_pq_.size(); +} + +void +Global_acceptor::prepare(Moment) +{ +} diff --git a/lily/include/acceptor.hh b/lily/include/acceptor.hh new file mode 100644 index 0000000000..f298951081 --- /dev/null +++ b/lily/include/acceptor.hh @@ -0,0 +1,40 @@ +/* + acceptor.hh -- declare Acceptor + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef ACCEPTOR_HH +#define ACCEPTOR_HH + +#include "string.hh" +#include "lily-proto.hh" +#include "interpreter.hh" +#include "virtual-methods.hh" + +class Acceptor { +public: + String id_str_; + + int iterator_count_; + + virtual Interpreter * interpreter_l() { return 0; } + + /// Score_register = 0, Staff_registers = 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(){} + NAME_MEMBERS(); + Acceptor(); + virtual Acceptor *get_default_interpreter()=0; +}; + +class Interpreter : public virtual Acceptor { +public: + virtual bool interpret_request_b(Request*) { return false;} +}; +#endif // ACCEPTOR_HH diff --git a/lily/include/global-acceptor.hh b/lily/include/global-acceptor.hh new file mode 100644 index 0000000000..6d18720298 --- /dev/null +++ b/lily/include/global-acceptor.hh @@ -0,0 +1,38 @@ +/* + global-acceptor.hh -- declare Global_acceptor + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef GLOBAL_ACCEPTOR_HH +#define GLOBAL_ACCEPTOR_HH + +#include "acceptor.hh" +#include "pqueue.hh" + +class Global_acceptor : public virtual Acceptor { + PQueue extra_mom_pq_; + Moment last_mom_; +public: + Score *score_l_; + Global_acceptor(); + int moments_left_i()const; + void modify_next(Moment&); + void add_moment_to_process(Moment); + + virtual void set_score(Score*); + virtual void prepare(Moment); + virtual void process() {} + virtual void finish() {} + +protected: + virtual int depth_i() const; + virtual Acceptor *ancestor_l(int); +}; + + + +#endif // GLOBAL_ACCEPTOR_HH diff --git a/lily/include/input-register.hh b/lily/include/input-register.hh index 2d088a146b..f1988b0374 100644 --- a/lily/include/input-register.hh +++ b/lily/include/input-register.hh @@ -24,7 +24,7 @@ struct Input_register : Input { String name_str_; void add(Input_register *); - + bool is_name_b(String); bool accept_req_b(); bool accepts_b(String); void print() const; diff --git a/lily/include/interpreter.hh b/lily/include/interpreter.hh index 92541c7211..6645ab0052 100644 --- a/lily/include/interpreter.hh +++ b/lily/include/interpreter.hh @@ -12,12 +12,4 @@ #include "lily-proto.hh" -class Interpreter { -public: - int music_list_i_; - Interpreter(); - virtual ~Interpreter(); - virtual bool interpret_request_b(Request*) { return false;} -}; - #endif // INTERPRETER_HH diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index 447ea7e078..0d8505d425 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -16,6 +16,7 @@ struct Key_item : Item { Array pitch; Array acc; int c_position; + bool default_b_; /* *************** */ @@ -26,7 +27,7 @@ struct Key_item : Item { void add(int pitch, int acc); void read(const Key_register&); void set_c_position(int); - void preprocess(); + virtual void do_pre_processing(); Molecule* brew_molecule_p()const; }; diff --git a/lily/include/key-reg.hh b/lily/include/key-reg.hh index 39a416bb64..ec9b5a2ab9 100644 --- a/lily/include/key-reg.hh +++ b/lily/include/key-reg.hh @@ -29,6 +29,7 @@ struct Key_register : Request_register { Key_register(); NAME_MEMBERS(); private: + void create_key(); void read_req(Key_change_req * r); }; diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 380b5d1056..5a2a934578 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -12,7 +12,7 @@ struct My_lily_lexer; struct Absolute_dynamic_req; -struct Accidental; +struct Acceptor; struct Atom; struct Bar; struct Bar_register; @@ -50,6 +50,7 @@ struct Element_group; struct Element_group_item; struct Feature; struct General_script_def; +struct Global_acceptor; struct Group_change_req; struct Group_feature_req; struct Horizontal_align_item; diff --git a/lily/include/midi-walker.hh b/lily/include/midi-walker.hh index 96005c8931..dea2478d24 100644 --- a/lily/include/midi-walker.hh +++ b/lily/include/midi-walker.hh @@ -7,8 +7,35 @@ #ifndef MIDIWALKER_HH #define MIDIWALKER_HH -#if 0 + #include "lily-proto.hh" + +#if 0 + +// sketch. . . +class Midi_register { +}; + +class Midi_group_reg : public Midi_register, public Acceptor { + +}; + +class Midi_staff_reg : public Midi_group_reg { +}; + + +class Midi_note_reg : public Midi_register { + +}; + +class Midi_voice_reg : public Midi_group_reg, public Interpreter { + +}; + +class Midi_score_reg: public Midi_group_reg, public Global_acceptor { +}; + + #include "grouping.hh" #include "staff-walker.hh" #include "pcursor.hh" diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index a375dc35d1..d2326a6e53 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(); - Register_group_register *report_to_reg_l_; + Acceptor *report_to_l_; - static Music_iterator* static_get_iterator_p(Music*,Register_group_register*); + static Music_iterator* static_get_iterator_p(Music*,Acceptor*); Music_iterator* get_iterator_p(Music*)const; - void set_reg(Register_group_register*); + void set_acceptor(Acceptor*); 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 Register_group_register * get_req_acceptor_l(); + virtual Acceptor * get_req_acceptor_l(); }; // duh. diff --git a/lily/include/register-group.hh b/lily/include/register-group.hh index 0c47919b6b..466b47361b 100644 --- a/lily/include/register-group.hh +++ b/lily/include/register-group.hh @@ -14,17 +14,19 @@ #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 { +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_; - String id_str_; Array announce_info_arr_; @@ -33,25 +35,17 @@ protected: virtual bool removable_b()const; public: - int iterator_count_; + Input_register * ireg_l_; void check_removal(); Register_group_register(); ~Register_group_register(); - /// Score_register = 0, Staff_registers = 1, etc) - virtual int depth_i()const; - /** - Go up in the tree. default: choose next parent - */ - Register_group_register * ancestor_l(int l=1); - - Input_register * ireg_l_; + /** Junk #reg_l#. - Pre: - #reg_l# is in #reg_list_# + #reg_l# is in #reg_list_# */ virtual void terminate_register(Request_register * reg_l); @@ -75,12 +69,20 @@ public: virtual Register_group_register * find_register_l(String name,String id); virtual void do_announces(); virtual void announce_element(Score_elem_info); - virtual Register_group_register* find_get_reg_l(String name, String id); - virtual Register_group_register * get_default_interpreter(); - + + 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/register.hh b/lily/include/register.hh index c628276429..18a6e41a42 100644 --- a/lily/include/register.hh +++ b/lily/include/register.hh @@ -125,7 +125,6 @@ public: bool try_request(Request*); void post_move_processing(); - virtual Interpreter * interpreter_l() { return 0; } Register_group_register * daddy_reg_l_; diff --git a/lily/include/score-column.hh b/lily/include/score-column.hh index 80986a4f82..fb7f108729 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_walker; + friend class Score_register; bool musical_b_; Moment when_; diff --git a/lily/include/score-reg.hh b/lily/include/score-reg.hh index 569ddb7ac2..3c4c668ea6 100644 --- a/lily/include/score-reg.hh +++ b/lily/include/score-reg.hh @@ -11,11 +11,11 @@ #define SCORE_REG_HH #include "register-group.hh" -#include "pqueue.hh" +#include "global-acceptor.hh" -class Score_register : public Register_group_register { +class Score_register : public Register_group_register, public Global_acceptor { Line_of_score * scoreline_l_; - Score * score_l_; + Array nobreak_item_p_arr_; Link_array musical_item_p_arr_; @@ -27,18 +27,22 @@ class Score_register : public Register_group_register { void set_cols(Score_column*,Score_column*); void typeset_all(); - PQueue extra_mom_pq_; - Moment last_mom_; public: NAME_MEMBERS(); - void add_moment_to_process(Moment); Score_register(); - int depth_i() const; -protected: - void set_score(Score * score_l); - +protected: + /* Global_acceptor 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);} + +protected: + /* Register_group_register interface */ virtual Staff_info get_staff_info()const; virtual bool do_try_request(Request*); virtual void do_creation_processing(); @@ -49,7 +53,6 @@ protected: virtual void typeset_element(Score_elem*elem_p); virtual Paper_def * paper() const; virtual void do_pre_move_processing(); - }; #endif // SCORE_REG_HH diff --git a/lily/include/score.hh b/lily/include/score.hh index 846144d0cd..56e29b8513 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -64,8 +64,8 @@ public: Score(Score const&); private: + void run_acceptor(Global_acceptor*); void paper_output(); - void setup_music(); /// do midi stuff void midi(); diff --git a/lily/input-register.cc b/lily/input-register.cc index f946e622fe..d1a8b584e3 100644 --- a/lily/input-register.cc +++ b/lily/input-register.cc @@ -13,6 +13,15 @@ #include "input-register.hh" #include "register-group.hh" +bool +Input_register::is_name_b(String n) +{ + bool b = (n == name_str_); + for (int i=0; !b && i < alias_str_arr_.size(); i++) + b = b || (alias_str_arr_[i] == n); + return b; +} + void Input_register::print() const { @@ -42,16 +51,18 @@ Input_register * lookup_reg(String nm) { for (int i=0; i < iregs_p_arr.size(); i++) - if (iregs_p_arr[i]->name_str_ == nm) + if (iregs_p_arr[i]->is_name_b(nm)) return iregs_p_arr[i]; error("can't find reg `" + nm + "'"); } + + Input_register * Input_register::recursive_find(String nm) { - if ( nm == name_str_) + if ( is_name_b( nm) ) return this; Input_register * r =0; @@ -64,7 +75,7 @@ Input_register * Input_register::find_ireg_l(String nm) { for (iter(contains_ireg_p_list_.top(), i); i.ok(); i++) - if (i->name_str_ == nm) + if (i->is_name_b( nm)) return i; return 0; diff --git a/lily/interpreter.cc b/lily/interpreter.cc deleted file mode 100644 index 15f400bfc8..0000000000 --- a/lily/interpreter.cc +++ /dev/null @@ -1,20 +0,0 @@ -/* - interpreter.cc -- implement Interpreter - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - -#include -#include "interpreter.hh" - -Interpreter::Interpreter() -{ - music_list_i_ =0; -} - -Interpreter::~Interpreter() -{ -// assert(!music_list_i_ ); -} diff --git a/lily/key-item.cc b/lily/key-item.cc index 54ee56b195..bf64b3e979 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -10,10 +10,9 @@ const int FLAT_TOP_PITCH=2; /* fes,ges,as and bes typeset in lower octave */ const int SHARP_TOP_PITCH=4; /* ais and bis typeset in lower octave */ - - Key_item::Key_item(int c) { + default_b_ = false; set_c_position(c); } @@ -63,12 +62,22 @@ Key_item::brew_molecule_p()const Molecule m(a); output->add_right(m); } - Molecule m(paper()->lookup_l()->fill(Box( + if ( pitch.size() ) { + Molecule m(paper()->lookup_l()->fill(Box( Interval(0, paper()->note_width()), Interval(0,0)))); - if ( pitch.size() ) + output->add_right(m); + } return output; } IMPLEMENT_STATIC_NAME(Key_item); IMPLEMENT_IS_TYPE_B1(Key_item,Item); + +void +Key_item::do_pre_processing() +{ + if (default_b_ ) { + empty_b_ = transparent_b_ = (break_status_i() != 1); + } +} diff --git a/lily/key-reg.cc b/lily/key-reg.cc index 4effed1fee..70dea983e9 100644 --- a/lily/key-reg.cc +++ b/lily/key-reg.cc @@ -20,9 +20,22 @@ Key_register::Key_register() { + kit_p_ = 0; do_post_move_processing(); } +void +Key_register::create_key() +{ + if (!kit_p_) { + int c0_i= *get_staff_info().c0_position_i_l_; + + kit_p_ = new Key_item(c0_i); + announce_element(Score_elem_info(kit_p_,keyreq_l_)); + kit_p_->read(*this); + } +} + bool Key_register::do_try_request(Request * req_l) { @@ -33,7 +46,6 @@ Key_register::do_try_request(Request * req_l) if (keyreq_l_) return false; // TODO keyreq_l_ = creq_l->keychange(); - change_key_b_ = true; read_req(keyreq_l_); return true; } @@ -41,23 +53,13 @@ Key_register::do_try_request(Request * req_l) void Key_register::acknowledge_element(Score_elem_info info) { - int c0_i= *get_staff_info().c0_position_i_l_; - Command_req * r_l = info.req_l_->command() ; + Command_req * r_l = info.req_l_->command() ; if (r_l && r_l->clefchange()) { - - if (!kit_p_) { - kit_p_ = new Key_item(c0_i); - announce_element(Score_elem_info(kit_p_,0)); - } - change_key_b_ = true; - } - - if (info.elem_l_->name() == Bar::static_name()) { - default_key_b_ = true; - if (!kit_p_) { - kit_p_ = new Key_item(c0_i); - announce_element(Score_elem_info(kit_p_,0)); - } + create_key(); + } else if (info.elem_l_->name() == Bar::static_name()) { + if ( !keyreq_l_) + default_key_b_ = true; + create_key(); } } @@ -65,14 +67,10 @@ Key_register::acknowledge_element(Score_elem_info info) void Key_register::do_process_requests() { - int c0_i= *get_staff_info().c0_position_i_l_; - if (key_.multi_octave_b_) assert(false); // TODO . else if (keyreq_l_) { - kit_p_ = new Key_item(c0_i); - kit_p_->read(*this); - announce_element(Score_elem_info(kit_p_, keyreq_l_)); + create_key(); } } @@ -80,6 +78,7 @@ void Key_register::do_pre_move_processing() { if (kit_p_) { + kit_p_->default_b_ = default_key_b_; typeset_breakable_item( kit_p_); kit_p_ = 0; } @@ -110,9 +109,8 @@ Key_register::do_post_move_processing() { keyreq_l_ = 0; default_key_b_ = false; - kit_p_ = 0; - change_key_b_ = false; } + IMPLEMENT_STATIC_NAME(Key_register); IMPLEMENT_IS_TYPE_B1(Key_register,Request_register); ADD_THIS_REGISTER(Key_register); diff --git a/lily/main.cc b/lily/main.cc index 7fbaf0c24f..22f226d182 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -17,6 +17,7 @@ #include "path.hh" #include "config.hh" #include "source.hh" +#include "debug.hh" #include "my-lily-parser.hh" Sources* source_l_g = 0; @@ -98,14 +99,22 @@ notice() "USA.\n"; } -static File_path * path_l =0; + +static File_path path; void do_one_file(String init_str, String file_str) { + if ( "" == path.find( init_str ) ) + error ( "Can not find `" + init_str +"'"); + + if ( path.find( file_str ) == "" ) + error ( "Can not find `" + file_str + "'"); + + Sources sources; source_l_g = &sources; - source_l_g->set_path(path_l); + source_l_g->set_path(&path); { My_lily_parser parser(source_l_g); parser.set_version_check(version_ignore_b_); @@ -121,8 +130,6 @@ main (int argc, char **argv) debug_init(); // should be first - File_path path; - // must override (come before) "/usr/local/share/lilypond"! char const * env_l=getenv("LILYINCLUDE"); if (env_l) { @@ -131,8 +138,7 @@ main (int argc, char **argv) path.add( "" ); path.add( String( DIR_DATADIR ) + "/init/" ); - path_l = & path; - path_l->push(DIR_DATADIR ); + path.push(DIR_DATADIR ); Getopt_long oparser(argc, argv,theopts); cout << get_version_str() << endl; diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 2d404bfa5f..3e8befb193 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -8,8 +8,8 @@ #include "music-list.hh" #include "music-iterator.hh" -#include "register.hh" -#include "register-group.hh" +#include "acceptor.hh" +#include "request.hh" #include "interpreter.hh" #include "debug.hh" @@ -27,37 +27,37 @@ Music_iterator::print() const { #ifndef NPRINT mtor << name() << "{"; - mtor << "report to " << report_to_reg_l_ << " (" << report_to_reg_l_->name() << ")\n"; + mtor << "report to " << report_to_l_ << " (" << report_to_l_->name() << ")\n"; mtor << "next at " << next_moment() << " "; do_print(); mtor << "}\n"; #endif } -Register_group_register * +Acceptor* Music_iterator::get_req_acceptor_l() { - assert(report_to_reg_l_); - if (report_to_reg_l_->interpreter_l() ) - return report_to_reg_l_; + assert(report_to_l_); + if (report_to_l_->interpreter_l() ) + return report_to_l_; - set_reg( report_to_reg_l_->get_default_interpreter() ); - return report_to_reg_l_; + set_acceptor( report_to_l_->get_default_interpreter() ); + return report_to_l_; } void -Music_iterator::set_reg(Register_group_register*reg) +Music_iterator::set_acceptor(Acceptor*reg) { - if (report_to_reg_l_==reg) + if (report_to_l_==reg) return; - if (report_to_reg_l_) - report_to_reg_l_->iterator_count_ --; + if (report_to_l_) + report_to_l_->iterator_count_ --; - report_to_reg_l_ = reg; + report_to_l_ = reg; - if (report_to_reg_l_) - report_to_reg_l_->iterator_count_ ++; + if (report_to_l_) + report_to_l_->iterator_count_ ++; } void @@ -68,7 +68,7 @@ Music_iterator::construct_children() Music_iterator::~Music_iterator() { - set_reg(0); + set_acceptor(0); } Moment @@ -91,7 +91,7 @@ Music_iterator::ok()const Music_iterator* Music_iterator::static_get_iterator_p(Music *m, - Register_group_register *report_l) + Acceptor *report_l) { Music_iterator * p =0; if (m->is_type_b( Change_reg::static_name())) @@ -108,12 +108,16 @@ Music_iterator::static_get_iterator_p(Music *m, if ( m->is_type_b( Music_list::static_name())) { Music_list* ml = (Music_list*) m; if (ml -> type_str_ != "") { - p->set_reg(report_l->find_get_reg_l(ml-> type_str_, ml->id_str_)); + Acceptor * a =report_l-> + find_get_acceptor_l(ml-> type_str_, ml->id_str_); + + + p->set_acceptor( a); } } - if (! p->report_to_reg_l_ ) - p ->set_reg(report_l); + if (! p->report_to_l_ ) + p ->set_acceptor(report_l); return p; } @@ -121,7 +125,7 @@ Music_iterator::static_get_iterator_p(Music *m, Music_iterator* Music_iterator::get_iterator_p(Music*m)const { - Music_iterator*p = static_get_iterator_p(m,report_to_reg_l_); + Music_iterator*p = static_get_iterator_p(m,report_to_l_); p->daddy_iter_l_ = (Music_iterator*)this; p->construct_children(); return p; @@ -130,7 +134,7 @@ Music_iterator::get_iterator_p(Music*m)const Music_iterator::Music_iterator() { daddy_iter_l_ =0; - report_to_reg_l_ = 0; + report_to_l_ = 0; first_b_ = true; } @@ -148,8 +152,11 @@ Chord_iterator::construct_children() for(iter(chord_C_->music_p_list_.top(), i); i.ok(); j++, i++) { Music_iterator * mi = get_iterator_p( i.ptr()); - set_reg(mi->report_to_reg_l_->ancestor_l( chord_C_->multi_level_i_ )); - children_p_list_.bottom().add( mi ); + set_acceptor(mi->report_to_l_->ancestor_l( chord_C_->multi_level_i_ )); + if ( mi->ok() ) + children_p_list_.bottom().add( mi ); + else + delete mi; } } void @@ -221,8 +228,8 @@ Voice_iterator::construct_children() { if (ok()) { iter_p_ = Music_iterator::get_iterator_p( ptr() ); - if (iter_p_->report_to_reg_l_->depth_i() > report_to_reg_l_->depth_i()) - set_reg(iter_p_->report_to_reg_l_); + if (iter_p_->report_to_l_->depth_i() > report_to_l_->depth_i()) + set_acceptor(iter_p_->report_to_l_); } } @@ -292,7 +299,7 @@ void Request_iterator::next(Moment m) { if ( first_b_) { - bool gotcha = daddy_iter_l_->report_to_reg_l_-> + bool gotcha = daddy_iter_l_->report_to_l_-> interpreter_l()->interpret_request_b(req_l_); if (!gotcha) req_l_->warning("Junking request: " + String(req_l_->name())); @@ -337,13 +344,14 @@ IMPLEMENT_IS_TYPE_B1(Change_iterator,Music_iterator); void Change_iterator::next(Moment mom) { +#if 0 Register_group_register *group_l = - report_to_reg_l_->find_get_reg_l(change_l_->type_str_, + report_to_l_->find_get_reg_l(change_l_->type_str_, change_l_->id_str_); - report_to_reg_l_->daddy_reg_l_->remove_register_p(report_to_reg_l_); - group_l->add(report_to_reg_l_); - + report_to_l_->daddy_reg_l_->remove_register_p(report_to_l_); + group_l->add(report_to_l_); +#endif Music_iterator::next(mom); } @@ -361,7 +369,7 @@ Voice_element_iterator::construct_children() /* if ( daddy_iter_l_ && daddy_iter_l_->is_type_b(Voice_iterator::static_name() )) { - set_reg(daddy_iter_l_-> get_req_acceptor_l()); + set_acceptor(daddy_iter_l_-> get_req_acceptor_l()); } else if (daddy_iter_l_ && daddy_iter_l_-> is_type_b( Chord_iterator::static_name() )) { diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index a4b7f13a8e..69be888d94 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -42,6 +42,7 @@ My_lily_parser::print_declarations() { #ifndef NPRINT String s = ""; + if (init_parse_b_) s = "Init"; if (!monitor->silence(s+"Declarations") && check_debug) { @@ -50,31 +51,25 @@ My_lily_parser::print_declarations() #endif } -void -My_lily_parser::do_init_file() -{ - init_parse_b_ = true; - set_debug(); - lexer_p_->new_input(init_str_, source_l_); -} - void My_lily_parser::parse_file(String init, String s) { lexer_p_ = new My_lily_lexer; init_str_ = init; + *mlog << "Parsing ... "; + init_parse_b_ = true; + lexer_p_->new_input( init, source_l_); + do_yyparse(); + print_declarations(); - *mlog << "Parsing ... "; - lexer_p_->new_input(s, source_l_); - if (!lexer_p_->source_file_l()) { - warning("Can not find toplevel file. Ignoring " + s); - return; - } + init_parse_b_ = false; + lexer_p_->new_input( s , source_l_); do_yyparse(); print_declarations(); + if(!define_spot_array_.empty()) warning("Braces don't match."); } diff --git a/lily/notehead.cc b/lily/notehead.cc index 02033be2e4..acf7bb59d1 100644 --- a/lily/notehead.cc +++ b/lily/notehead.cc @@ -114,6 +114,7 @@ Note_head::brew_molecule_p() const s = p->lookup_l()->rest(balltype_i_, streepjes_b); } out = new Molecule(Atom(s)); + out->translate_x( x_dir_i_ * s.dim.x.length() ); if (dots_i_) { Symbol d = p->lookup_l()->dots(dots_i_ ); Molecule dm; diff --git a/lily/parser.y b/lily/parser.y index 1beab2956e..cf4b75c8c2 100644 --- a/lily/parser.y +++ b/lily/parser.y @@ -79,17 +79,13 @@ yylex(YYSTYPE *s, void * v_l) My_lily_parser *pars_l = (My_lily_parser*) v_l; My_lily_lexer * lex_l = pars_l->lexer_p_; - if (pars_l->first_b_) { - pars_l->first_b_ = false; - pars_l->do_init_file(); - } - lex_l->lexval_l = (void*) s; return lex_l->yylex(); } %} + %pure_parser /* tokens which are not keywords */ @@ -189,7 +185,7 @@ yylex(YYSTYPE *s, void * v_l) %type pitch_list %type midi_block midi_body %type duration_length -%type init_melodic init_lyrics init_music + %type Music transposed_music %type Voice Voice_body %type Chord Chord_body @@ -220,16 +216,9 @@ mudela: /* empty */ | mudela error | mudela check_version { } | mudela add_notenames { } - | mudela init_end {} | mudela input_register_spec { add_global_input_register($2); } ; -init_end: INIT_END ';' { - THIS->print_declarations(); - THIS->init_parse_b_ = false; - THIS->set_debug(); - } - ; check_version: VERSION STRING ';' { if (*$2 != MUDELA_VERSION) { @@ -299,7 +288,7 @@ declaration: $$ = new Script_id(*$1, $3, SCRIPT_IDENTIFIER); delete $1; } - | declarable_identifier '=' init_music { + | declarable_identifier '=' Music { $$ = new Music_id(*$1, $3, MUSIC_IDENTIFIER); delete $1; } @@ -370,7 +359,7 @@ score_body: { | SCORE_IDENTIFIER { $$ = $1->score(true); } - | score_body init_music { + | score_body Music { $$->music_p_ = $2; } | score_body paper_block { @@ -443,27 +432,6 @@ midi_body: { -/* - let the lexer switch mode. -*/ -init_music: - init_melodic { $$ = $1; } - | init_lyrics { $$ = $1; } - ; - -init_lyrics: - LYRIC - { THIS->lexer_p_->push_lyric_state(); } - Music - { $$ = $3; THIS->lexer_p_->pop_state(); } - ; - -init_melodic: - MELODIC - { THIS->lexer_p_->push_note_state(); } - Music - { $$=$3; THIS->lexer_p_->pop_state(); } - ; /* MUSIC @@ -497,6 +465,15 @@ Music: | Chord { $$ = $1; } | transposed_music { $$ = $1; } | MUSIC_IDENTIFIER { $$ = $1->music(true); } + | MELODIC + { THIS->lexer_p_->push_note_state(); } + Music + { $$=$3; THIS->lexer_p_->pop_state(); } + + | LYRIC + { THIS->lexer_p_->push_lyric_state(); } + Music + { $$ = $3; THIS->lexer_p_->pop_state(); } ; Chord: diff --git a/lily/register-group.cc b/lily/register-group.cc index 4d60d50fb5..5812b2fb04 100644 --- a/lily/register-group.cc +++ b/lily/register-group.cc @@ -42,7 +42,6 @@ Register_group_register::removable_b()const Register_group_register::Register_group_register() { ireg_l_ =0; - iterator_count_ =0; } void @@ -162,7 +161,7 @@ Register_group_register::terminate_register(Request_register*r_l) delete reg_p; } -IMPLEMENT_IS_TYPE_B1(Register_group_register,Request_register); +IMPLEMENT_IS_TYPE_B2(Register_group_register,Request_register, Acceptor); IMPLEMENT_STATIC_NAME(Register_group_register); ADD_THIS_REGISTER(Register_group_register); @@ -190,19 +189,28 @@ Register_group_register::find_register_l(String n, String id) return r; } -Register_group_register* -Register_group_register::find_get_reg_l(String n,String id) +Acceptor* +Register_group_register::find_get_acceptor_l(String n,String id) { - Register_group_register * ret=0; - if (ireg_l_-> find_ireg_l( n )) { + Acceptor * ret=0; + Input_register * ireg_l= ireg_l_-> recursive_find ( n ); + if (ireg_l ) { ret = find_register_l(n,id); if (!ret) { - ret = ireg_l_-> find_ireg_l(n) -> get_group_register_p(); - add ( ret ); - ret ->id_str_ = id; + Register_group_register * group = + ireg_l-> get_group_register_p(); + + add(group); + ret = group; + + if (group->ireg_l_->is_name_b( n ) ) + ret ->id_str_ = id; + else + return ret->find_get_acceptor_l(n,id); + } } else if (daddy_reg_l_) - ret =daddy_reg_l_->find_get_reg_l(n,id); + ret =daddy_reg_l_->find_get_acceptor_l(n,id); else { warning("Can't find or create `" + n + "' called `" + id + "'\n"); ret =0; @@ -216,7 +224,7 @@ Register_group_register::depth_i()const return daddy_reg_l_->depth_i() + 1; } -Register_group_register* +Acceptor* Register_group_register::ancestor_l(int l) { if (!l || !daddy_reg_l_) @@ -273,7 +281,7 @@ Register_group_register::get_staff_info()const return inf; } -Register_group_register* +Acceptor* Register_group_register::get_default_interpreter() { if ( interpreter_l() ) diff --git a/lily/score-reg.cc b/lily/score-reg.cc index b83c1e3872..35de3a344d 100644 --- a/lily/score-reg.cc +++ b/lily/score-reg.cc @@ -18,29 +18,44 @@ #include "musical-request.hh" #include "score-column.hh" -int -Score_register::depth_i()const -{ - return 0; -} void Score_register::set_score(Score *s) { - score_l_ = s; + Global_acceptor::set_score(s); scoreline_l_ = s->pscore_p_->super_elem_l_->line_of_score_l_; - last_mom_ = score_l_->music_p_->time_int().max(); } Score_register::Score_register() { - score_l_ = 0; scoreline_l_ =0; command_column_l_ =0; musical_column_l_ =0; } +void +Score_register::prepare(Moment w) +{ + Score_column* c1 = new Score_column(w); + Score_column* c2 = new Score_column(w); + + c1->musical_b_ = false; + c2->musical_b_ = true; + + score_l_->cols_.bottom().add(c1); + score_l_->cols_.bottom().add(c2); + set_cols(c1,c2); + + + post_move_processing(); +} +void +Score_register::finish() +{ + check_removal(); + do_removal_processing(); +} void Score_register::do_creation_processing() @@ -66,6 +81,14 @@ Score_register::do_removal_processing() typeset_all(); } +void +Score_register::process() +{ + process_requests(); + do_announces(); + pre_move_processing(); + check_removal(); +} void Score_register::announce_element(Score_elem_info info) @@ -120,6 +143,7 @@ Score_register::typeset_breakable_item(Item * nobreak_p) nobreak_item_p_arr_.push(nobreak_p); } } + void Score_register::typeset_all() { @@ -190,14 +214,3 @@ IMPLEMENT_IS_TYPE_B1(Score_register,Register_group_register); IMPLEMENT_STATIC_NAME(Score_register); ADD_THIS_REGISTER(Score_register); -void -Score_register::add_moment_to_process(Moment m) -{ - if (m > last_mom_) - return; - - for (int i=0; i < extra_mom_pq_.size(); i++) - if (extra_mom_pq_[i] == m) - return; - extra_mom_pq_.insert(m); -} diff --git a/lily/score.cc b/lily/score.cc index 3d7ad33de0..f2899451e7 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -34,55 +34,29 @@ Score::Score(Score const &s) } void -Score::setup_music() +Score::run_acceptor(Global_acceptor * acc_l) { - *mlog << "\nSetting up requests..." << flush; - - Score_register * score_reg = - (Score_register*)lookup_reg("Score_register")->get_group_register_p(); - - score_reg->set_score (this); + acc_l->set_score (this); Music_iterator * iter = Music_iterator::static_get_iterator_p(music_p_, - score_reg); + acc_l); iter->construct_children(); - while ( iter->ok() || score_reg->extra_mom_pq_.size() ) { + while ( iter->ok() || acc_l->moments_left_i() ) { Moment w = INFTY; if (iter->ok() ) { w = iter->next_moment(); iter->print(); } - if (score_reg->extra_mom_pq_.size() && - score_reg->extra_mom_pq_.front() <= w) - - w = score_reg->extra_mom_pq_.get(); - - mtor << "processing moment " << w << "\n"; - - Score_column* c1 = new Score_column(w); - Score_column* c2 = new Score_column(w); - - c1->musical_b_ = false; - c2->musical_b_ = true; - - cols_.bottom().add(c1); - cols_.bottom().add(c2); - score_reg->set_cols(c1,c2); - - score_reg->post_move_processing(); + acc_l->modify_next( w ); + acc_l->prepare(w); iter->next( w ); - - score_reg->process_requests(); - score_reg->do_announces(); - score_reg->pre_move_processing(); - score_reg->check_removal(); + acc_l->process(); } delete iter; - score_reg->check_removal(); - score_reg->do_removal_processing(); - delete score_reg; + acc_l->finish(); } + void Score::process() { @@ -94,14 +68,20 @@ Score::paper() { if (!paper_p_) return; - + + *mlog << "\nCreating elements ..." << flush; + pscore_p_ = new PScore(paper_p_); + + Score_register * score_reg = + (Score_register*)lookup_reg("Score_register")->get_group_register_p(); + run_acceptor( score_reg ); + delete score_reg; + if( errorlevel_i_){ // should we? hampers debugging. warning("Errors found, /*not processing score*/"); // return; } - pscore_p_ = new PScore(paper_p_); - setup_music(); do_cols(); clean_cols(); // can't move clean_cols() farther up. @@ -124,7 +104,6 @@ Score::paper() void Score::clean_cols() { -#if 1 for (iter_top(cols_,c); c.ok(); ) { if (!c->pcol_l_->used_b()) { delete c.remove_p(); @@ -133,7 +112,6 @@ Score::clean_cols() c++; } } -#endif } PCursor diff --git a/make/lilypond.lsm b/make/lilypond.lsm index 13303f5d72..4900432eea 100644 --- a/make/lilypond.lsm +++ b/make/lilypond.lsm @@ -2,8 +2,8 @@ Begin3 Title: LilyPond -Version: 0.0.70pre -Entered-date: 06/29/97 +Version: 0.0.71pre +Entered-date: 07/01/97 Description: LilyPond is a program which converts a music-script (mudela) into TeX output, or MIDI to produce multi-staff scores. Features include multiple meters, clefs, keys, lyrics, versatile input-language, cadenzas @@ -13,7 +13,7 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys) jan@digicash.com (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: pcnov095.win.tue.nl /pub/lilypond/ - 300k lilypond-0.0.70pre.tar.gz + 300k lilypond-0.0.71pre.tar.gz Alternate-site: Original-site: Platform: unix/win32, GNU C++ diff --git a/make/lilypond.spec b/make/lilypond.spec index ec4ab4ea4b..fcf5c03a72 100644 --- a/make/lilypond.spec +++ b/make/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 0.0.70pre +Version: 0.0.71pre Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.70pre.tar.gz +Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.71pre.tar.gz Summary: A preprocessor to make TeX typeset music. URL: http://www.stack.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys diff --git a/tex/taupindefs.tex b/tex/taupindefs.tex index 1622b990cb..0c71bea3a1 100644 --- a/tex/taupindefs.tex +++ b/tex/taupindefs.tex @@ -27,7 +27,7 @@ \font\hslurdfont=xslhd16 \font\hslurhfont=xslhz20 \font\musicfnt=musix16 - \font\dynfont=cmbxti12 + \font\dynfont=cmbxti10 \font\musicdraw=musixsps \font\mathfont=cmsy8 }