From 6a62932652940f4ac2931f75d48796887fbc5fdc Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 14 Aug 1997 02:41:33 +0200 Subject: [PATCH] release: 0.1.7 --- .dstreamrc | 136 +++++----- ANNOUNCE | 41 +++- AUTHORS.text | 14 +- BUGS | 25 +- COPYING | 9 +- Documentation/AUTHORS.pod | 10 +- Documentation/INSTALL.pod | 17 +- Documentation/Makefile | 3 +- Documentation/Rules.make | 21 +- Documentation/faq.pod | 32 ++- Documentation/gnu-music.pod | 95 ++++--- Documentation/index.pod | 15 +- Documentation/{lilygut.pod => internals.pod} | 0 Documentation/lilypond.pod | 68 ++--- Documentation/links.pod | 24 +- .../{lilyliterature.pod => literature.pod} | 12 +- Documentation/mi2mu.pod | 4 +- Documentation/mudela-course.doc | 3 +- Documentation/mudela-man.doc | 17 +- Documentation/mutopia.pod | 35 +++ Documentation/other-packages.pod | 7 +- INSTALL.text | 30 +-- NEWS | 98 +++++++- README | 35 +-- TODO | 67 +++-- VERSION | 4 +- bin/convert-mudela.in | 17 +- bin/make-version | 9 +- bin/make-website.in | 29 ++- bin/mudela-book.in | 14 +- configure | 80 +++--- configure.in | 24 +- flower/Makefile | 2 +- flower/NEWS | 3 + flower/README | 4 +- flower/VERSION | 2 +- flower/aclocal.m4 | 2 + flower/dstream.cc | 4 +- flower/include/dstream.hh | 5 +- flower/include/lgetopt.hh | 74 +++--- flower/lgetopt.cc | 197 ++++++++------- flower/path.cc | 2 +- init/dutch.ly | 6 +- init/engraver.ly | 14 +- init/german.ly | 93 +++++++ init/midi.ly | 2 +- init/script.ly | 2 + init/swedish.ly | 2 +- init/symbol.ly | 3 +- init/table16.ly | 1 + input/beams.ly | 2 +- input/cadenza.ly | 19 +- input/collisions.ly | 2 +- input/coriolan-alto.ly | 2 +- input/gallina.ly | 232 ++++++++++++++++++ input/header.ly | 8 +- input/keys.ly | 2 +- input/kortjakje.ly | 4 +- input/multi.ly | 2 +- input/pedal.ly | 2 +- input/rhythm.ly | 2 +- input/rock.ly | 4 - input/scales.ly | 2 +- input/scripts.ly | 2 +- input/scsii-menuetto.ly | 6 +- input/slurs.ly | 4 +- input/standchen.ly | 15 +- input/toccata-fuga-E.ly | 11 +- input/twinkle-pop.ly | 47 ++++ input/twinkle.ly | 17 +- input/wohltemperirt.ly | 19 +- lib/Makefile | 9 +- lib/binary-source-file.cc | 2 +- lib/config.hh.in | 2 +- lib/duration-convert.cc | 17 +- lib/duration.cc | 19 +- lib/file-storage.cc | 98 ++++++++ lib/include/duration.hh | 9 +- lib/include/file-storage.hh | 62 +++++ lib/include/proto.hh | 3 + lib/include/source-file.hh | 31 ++- lib/include/source.hh | 1 + lib/simple-file-storage.cc | 63 +++++ lib/source-file.cc | 139 +++-------- lib/source.cc | 3 + lily/Makefile | 7 +- lily/Stable.make | 6 +- lily/VERSION | 2 +- lily/atom.cc | 12 +- lily/audio-element.cc | 13 + lily/audio-item.cc | 14 +- lily/audio-score.cc | 93 +++++-- lily/axis-group-item.cc | 50 ++++ lily/axis-group-spanner.cc | 115 +++++++++ lily/axis-group.cc | 76 ++++++ lily/axis.cc | 16 ++ lily/bar-column-grav.cc | 69 ++++++ lily/bar-column.cc | 35 +++ lily/bar-grav.cc | 4 +- lily/bar-number-grav.cc | 51 ++++ lily/bar.cc | 13 +- lily/beam.cc | 8 +- lily/boxes.cc | 4 +- lily/break.cc | 2 +- lily/clef-grav.cc | 2 +- lily/clef-item.cc | 3 +- lily/collision-grav.cc | 5 +- lily/collision.cc | 15 +- lily/command-request.cc | 73 +++++- lily/crescendo.cc | 2 +- lily/dynamic-grav.cc | 2 +- lily/elem-group-item.cc | 4 +- lily/elem-group.cc | 178 ++++---------- lily/engraver-group.cc | 28 ++- lily/engraver.cc | 15 +- lily/general-script-def.cc | 4 +- lily/gourlay-breaking.cc | 6 +- lily/grouping.cc | 2 +- lily/head-column.cc | 12 +- lily/head-grav.cc | 6 +- lily/horizontal-align-item.cc | 8 +- lily/horizontal-group-item.cc | 31 +-- lily/include/audio-element.hh | 19 ++ lily/include/audio-item.hh | 28 +-- lily/include/audio-score.hh | 16 +- lily/include/axes.hh | 24 ++ lily/include/axis-group-item.hh | 30 +++ lily/include/axis-group-spanner.hh | 29 +++ lily/include/axis-group.hh | 53 ++++ lily/include/bar-column-grav.hh | 31 +++ lily/include/bar-column.hh | 30 +++ lily/include/bar-number-grav.hh | 29 +++ lily/include/bar.hh | 2 + lily/include/boxes.hh | 23 +- lily/include/break.hh | 4 +- lily/include/collision.hh | 10 +- lily/include/command-request.hh | 29 ++- lily/include/elem-group-item.hh | 18 +- lily/include/elem-group.hh | 71 +++--- lily/include/engraver-group.hh | 10 +- lily/include/engraver.hh | 6 +- lily/include/general-script-def.hh | 2 +- lily/include/head-column.hh | 5 +- lily/include/head-grav.hh | 11 +- lily/include/horizontal-group-item.hh | 16 +- lily/include/input-translator.hh | 5 +- lily/include/item.hh | 8 +- lily/include/key-grav.hh | 15 +- lily/include/key-item.hh | 2 +- lily/include/lily-proto.hh | 21 +- lily/include/local-key-item.hh | 12 +- lily/include/main.hh | 1 + lily/include/midi-def.hh | 4 +- lily/include/midi-item.hh | 116 +++++---- lily/include/midi-output.hh | 30 --- lily/include/midi-stream.hh | 26 +- lily/include/midi-walker.hh | 48 ++++ lily/include/molecule.hh | 3 +- lily/include/music-iterator.hh | 34 ++- lily/include/music.hh | 12 +- lily/include/musical-request.hh | 12 +- lily/include/my-lily-parser.hh | 2 + lily/include/note-column-grav.hh | 2 +- lily/include/note-performer.hh | 2 - lily/include/offset.hh | 40 ++- lily/include/p-col.hh | 6 +- lily/include/p-score.hh | 14 +- lily/include/paper-def.hh | 4 +- lily/include/performer-group-performer.hh | 16 +- lily/include/performer.hh | 12 +- lily/include/request.hh | 7 +- lily/include/rest-column.hh | 6 +- lily/include/score-align-grav.hh | 3 + lily/include/score-column.hh | 16 +- lily/include/score-elem.hh | 59 +++-- lily/include/score-grav.hh | 6 +- lily/include/score-performer.hh | 18 +- lily/include/score.hh | 4 +- lily/include/script-column.hh | 2 +- lily/include/script-def.hh | 2 +- lily/include/script-grav.hh | 3 - lily/include/script.hh | 2 +- lily/include/span-bar-grav.hh | 6 + lily/include/span-bar.hh | 2 +- lily/include/span-score-bar-grav.hh | 7 + lily/include/spanner-elem-group.hh | 2 +- lily/include/spanner.hh | 2 +- lily/include/spring-spacer.hh | 2 +- lily/include/staff-performer.hh | 14 +- lily/include/staff-side.hh | 3 +- lily/include/staffline.hh | 26 -- lily/include/super-elem.hh | 4 +- lily/include/symbol.hh | 8 +- lily/include/text-def.hh | 3 +- lily/include/timing-grav.hh | 38 +++ lily/include/vertical-align-elem.hh | 1 + lily/include/vertical-group-spanner.hh | 23 +- lily/item.cc | 48 ++-- lily/key-grav.cc | 14 +- lily/key-item.cc | 15 +- lily/leastsquares.cc | 6 +- lily/lexer.l | 26 +- lily/line-group-grav.cc | 3 +- lily/local-key-grav.cc | 27 +- lily/local-key-item.cc | 8 +- lily/lookup.cc | 17 +- lily/lyric-grav.cc | 2 +- lily/main.cc | 27 +- lily/meter-grav.cc | 2 +- lily/meter.cc | 1 + lily/midi-def.cc | 23 +- lily/midi-item.cc | 141 +++++++---- lily/midi-stream.cc | 19 +- lily/midi-walker.cc | 173 ++++++------- lily/molecule.cc | 30 +-- lily/music-iterator.cc | 135 +++++----- lily/music-list.cc | 12 +- lily/musical-request.cc | 87 ++++--- lily/my-lily-lexer.cc | 6 - lily/my-lily-parser.cc | 6 +- lily/note-column-grav.cc | 6 +- lily/note-performer.cc | 28 +-- lily/notehead.cc | 8 +- lily/p-score.cc | 65 ++--- lily/paper-def.cc | 1 - lily/parser.y | 79 +++--- lily/performer-group-performer.cc | 114 ++++----- lily/performer.cc | 40 +-- lily/request.cc | 18 ++ lily/rest-collision-grav.cc | 4 +- lily/score-align-grav.cc | 9 +- lily/score-elem.cc | 226 ++++++++++++----- lily/score-grav.cc | 65 +++-- lily/score-halign-grav.cc | 3 +- lily/score-performer.cc | 116 ++------- lily/score.cc | 82 ++++--- lily/scoreline.cc | 26 +- lily/scores.cc | 5 +- lily/script-column.cc | 3 +- lily/script-def.cc | 12 +- lily/script-grav.cc | 32 +-- lily/script.cc | 10 +- lily/slur-grav.cc | 4 +- lily/span-bar-grav.cc | 8 +- lily/span-bar.cc | 36 +-- lily/span-score-bar-grav.cc | 1 - lily/spanner-elem-group.cc | 4 +- lily/spanner.cc | 3 + lily/staff-info.cc | 1 + lily/staff-performer.cc | 91 ++----- lily/staff-side.cc | 8 +- lily/staffline.cc | 21 -- lily/stem-beam-grav.cc | 4 +- lily/stem.cc | 4 +- lily/symbol.cc | 2 +- lily/template8.cc | 6 +- lily/tex-beam.cc | 12 +- lily/tex-slur.cc | 20 +- lily/text-def.cc | 9 +- lily/text-grav.cc | 4 +- lily/text-item.cc | 6 +- lily/text-spanner.cc | 2 +- lily/timing-grav.cc | 27 ++ lily/vertical-align-elem.cc | 9 +- lily/vertical-align-grav.cc | 4 +- lily/vertical-group-spanner.cc | 93 +------ make/Makefile | 3 +- make/Rules.make | 2 +- make/Targets.make | 6 +- make/Variables.make | 10 +- make/debian/Makefile | 20 ++ make/debian/README.debian.ex | 6 + make/debian/changelog | 10 + make/debian/control | 22 ++ make/debian/copyright | 36 +++ make/debian/dirs | 2 + make/debian/diversions.ex | 1 + make/debian/docs | 3 + make/debian/examples | 2 + make/debian/info.ex | 15 ++ make/debian/menu.ex | 1 + make/debian/postinst | 7 + make/debian/postrm | 28 +++ make/debian/rules | 57 +++++ make/debian/watch | 5 + make/lilypond.lsm | 8 +- make/lilypond.spec | 8 +- mi2mu/Makefile | 7 +- mi2mu/TODO | 2 + mi2mu/VERSION | 2 +- mi2mu/include/lily-stream.hh | 24 +- mi2mu/include/midi-track.hh | 1 + mi2mu/lily-stream.cc | 149 ++++++----- mi2mu/main.cc | 8 +- mi2mu/midi-event.cc | 9 +- mi2mu/midi-parser.y | 2 - mi2mu/midi-score.cc | 54 ++-- mi2mu/midi-track.cc | 31 +-- mi2mu/my-midi-parser.cc | 3 +- tex/dimen.tex | 27 +- tex/taupindefs.tex | 3 + 301 files changed, 4493 insertions(+), 2713 deletions(-) rename Documentation/{lilygut.pod => internals.pod} (100%) rename Documentation/{lilyliterature.pod => literature.pod} (96%) create mode 100644 Documentation/mutopia.pod create mode 100644 flower/aclocal.m4 create mode 100644 init/german.ly create mode 100644 input/gallina.ly delete mode 100644 input/rock.ly create mode 100644 input/twinkle-pop.ly create mode 100644 lib/file-storage.cc create mode 100644 lib/include/file-storage.hh create mode 100644 lib/simple-file-storage.cc create mode 100644 lily/audio-element.cc create mode 100644 lily/axis-group-item.cc create mode 100644 lily/axis-group-spanner.cc create mode 100644 lily/axis-group.cc create mode 100644 lily/axis.cc create mode 100644 lily/bar-column-grav.cc create mode 100644 lily/bar-column.cc create mode 100644 lily/bar-number-grav.cc create mode 100644 lily/include/audio-element.hh create mode 100644 lily/include/axes.hh create mode 100644 lily/include/axis-group-item.hh create mode 100644 lily/include/axis-group-spanner.hh create mode 100644 lily/include/axis-group.hh create mode 100644 lily/include/bar-column-grav.hh create mode 100644 lily/include/bar-column.hh create mode 100644 lily/include/bar-number-grav.hh delete mode 100644 lily/include/midi-output.hh create mode 100644 lily/include/midi-walker.hh delete mode 100644 lily/include/staffline.hh create mode 100644 lily/include/timing-grav.hh delete mode 100644 lily/staffline.cc create mode 100644 lily/timing-grav.cc create mode 100644 make/debian/Makefile create mode 100644 make/debian/README.debian.ex create mode 100644 make/debian/changelog create mode 100644 make/debian/control create mode 100644 make/debian/copyright create mode 100644 make/debian/dirs create mode 100644 make/debian/diversions.ex create mode 100644 make/debian/docs create mode 100644 make/debian/examples create mode 100644 make/debian/info.ex create mode 100644 make/debian/menu.ex create mode 100644 make/debian/postinst create mode 100644 make/debian/postrm create mode 100644 make/debian/rules create mode 100644 make/debian/watch diff --git a/.dstreamrc b/.dstreamrc index 2ec9f75879..ae0b1b1143 100644 --- a/.dstreamrc +++ b/.dstreamrc @@ -14,83 +14,83 @@ Lexer 1 Matrix 1 +# flower lib +File_path 0 -Atom 1 -Bar 1 -Beam 1 -Change_iterator 1 +Atom 0 +Bar 0 +Beam 0 +Change_iterator 0 Chord 0 -Chord_iterator 1 -Clef_item 1 -Col_configuration 1 -Colinfo 1 -Colinfo 1 -Collision 1 -Command 1 +Chord_iterator 0 +Clef_item 0 +Col_configuration 0 +Colinfo 0 +Colinfo 0 +Collision 0 # E l b e ment? search/replace typo. # Yeah. kind of. Looks cute though -Elbement_group 1 -Engraver 1 -Engraver_group_engraver 1 -File_path 1 -Group_change_req 1 -Head_column 1 -Idealspacing 1 -Ineq_constrained_qp 1 -Input_translator 1 -Item 1 -Key_item 1 -Lookup 1 -Line_spacer 1 +Elbement_group 0 +Engraver 0 +Engraver_group_engraver 0 +Group_change_req 0 +Head_column 0 +Idealspacing 0 +Ineq_constrained_qp 0 +Input_translator 0 +Item 0 +Key_item 0 +Lookup 0 +Line_spacer 0 Melodic_req 0 -Midi_def 1 -Mixed_qp 1 -Music 1 -Music_iterator 1 +Midi_def 0 +Mixed_qp 0 +Music 0 +Music_iterator 0 My_lily_lexer 1 -Note_head 1 -Note_performer 1 +Note_head 0 +Note_performer 0 Note_req 0 -PCol 1 -PScore 1 -Paper_def 1 -Paperdef 1 -Performer 1 -Performer_group_performer 1 -Request 1 -Request_iterator 1 -Rest_collision 1 -Rest_collision_engraver 1 -Rest_req 1 +PCol 0 +PScore 0 +Paper_def 0 +Paperdef 0 +Performer 0 +Performer_group_performer 0 +Request 0 +Request_iterator 0 +Rest_collision 0 +Rest_collision_engraver 0 +Rest_req 0 Rhythmic_req 0 -Score 1 -Score_column 1 -Score_elem 1 -Score_engraver 1 -Score_performer 1 -Script_column 1 -Script_def 1 -Script_req 1 -Slur 1 -Spacing_problem 1 -Spanner 1 -Spring_spacer 1 -Staff 1 -Staff_commands 1 -Stem 1 -Stem 1 -Stem_req 1 -Symtable 1 -Symtables 1 -Text_def 1 -Text_req 1 -Time_description 1 -Voice 1 -Voice_element 1 -Voice_element_iterator 1 -Voice_iterator 1 -Word_wrap 1 +Score 0 +Score_column 0 +Score_elem 0 +Score_engraver 0 +Score_performer 0 +Script_column 0 +Script_def 0 +Script_req 0 +Slur 0 +Spacing_problem 0 +Spanner 0 +Spring_spacer 0 +Staff 0 +Staff_commands 0 +Stem 0 +Stem 0 +Stem_req 0 +Symtable 0 +Symtables 0 +Text_def 0 +Text_req 0 +Time_description 0 +Voice 0 +Voice_element 0 +Voice_element_iterator 0 +Voice_iterator 0 +Word_wrap 0 delete_identifiers 1 parse_duration 1 parse_pitchmod 1 diff --git a/ANNOUNCE b/ANNOUNCE index 8cabfbcdef..9f7d6e2e37 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,3 +1,4 @@ +Keywords: midi notation music typesetting gnu Subject: LilyPond 0.1 released - The GNU Project music typesetter BORN @@ -8,8 +9,7 @@ Subject: LilyPond 0.1 released - The GNU Project music typesetter (GNU LilyPond 0.1) - daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' - Nienhuys + daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys Lily is a healthy, bouncing baby weighing 345 kilobytes @@ -126,3 +126,40 @@ THANK YOU, Thanks go out to Mats Bengtsson, Werner Lemberg and Richard Stallman for comments and contributions. + + +**** NOTE + +LilyPond might have a minor bug if you use glibc-2; we will look into it +If you use glibc-2, please try 0.1.0 to see if it works and, download 0.1.1 +when it's available. + +LilyPond might exhibit a g++ bug on Solaris 1.5 (The stack frame gets corrupted +by a constructor) if you compile with -O2. We don't know workarounds. + + --- * --- + + We would like to dedicate this program to all the friends that we + met through music. + + + Those deserving special mention (in no particular order): +Esther, Marijke, Heike, Inge, Judith, Hannah, Auke, Ilse, Evelyn, +Maartje, Suzanne, Ilse (gee, again?) and last (but certainly not least) +Janneke! + + HWN + + That's a nice thought, Wendy. I've got a few too, to spread +the credits a bit (Again, no particular order) Michelle, Illushka, +Ruth, Eva, Fro/ydis, Monique, Noor, Sascha, Monique, Ilse, Monique, +Eva, Roos, Judith, Tim and, of course, Wendy! + + JCN + + +Of course, our other friends in the `Eindhovens Jongeren Ensemble' +(http://www.stack.nl/~hanwen/eje.html) cannot go unmentioned either. + + + --- * --- diff --git a/AUTHORS.text b/AUTHORS.text index 4ebcd69823..a035909c09 100644 --- a/AUTHORS.text +++ b/AUTHORS.text @@ -31,12 +31,16 @@ AAAAUUUUTTTTHHHHOOOORRRRSSSS CCCCOOOONNNNTTTTRRRRIIIIBBBBUUUUTTTTOOOORRRRSSSS +o Mats Bengtsson , parts of clef- - reg.cc, clef-item.cc testing, general comments. + reg.cc, clef-item.cc swedish notenames, testing, + general comments. +o Werner Lemberg , misc bugfixes, some Beam and Stem code. - +o Alexandre Oliva + +o Alexandre Oliva , testing + + +o Anthony Fok , debian + package: make/debian/* Your name could be here! If you want to help, then take a look at the SMALLISH PROJECTS section of in the file _T_O_D_O. @@ -57,10 +61,6 @@ CCCCOOOONNNNTTTTRRRRIIIIBBBBUUUUTTTTOOOORRRRSS - - - - -30/Jul/97 LilyPond 0.1.1 1 +12/Aug/97 LilyPond 0.1.7 1 diff --git a/BUGS b/BUGS index 84a3fddf93..1f811c90c9 100644 --- a/BUGS +++ b/BUGS @@ -1,22 +1,11 @@ +Document reintroduced deficiencies. -[document reintroduced deficiencies.] +* placement of bar-numbers -******************* - '.' -> lilypond: lexer.l:258: int My_lily_lexer::yylex(): Assertion `cnv == 1' failed. +* -*********************** +hw:~/musix/spacer/Documentation/out$ LILYINCLUDE=../../input lilypond -o wohltemperirt ../../input/wohltemperirt.ly - -\score { < - \melodic { \id "Staff" ""; c'4 g'4 } - \lyric { \id "Lyric" ""; hello4 bye4 < a chord > } - \lyric { \id "Lyric" ""; bye4 hello4 } - \melodic { \id "Staff" ""; c'4 g'4 } - > -} - -******************* - -Stack frame overwrite in on Solaris 2.5. -Engraver_group_engraver::Engraver_group_engraver() called from -Score_engraver::Score_engraver() +GNU LilyPond 0.1.7 #10/FlowerLib 1.1.26 #1 +Parsing ... [/home/hw/share/lilypond/init//symbol.ly[/home/hw/share/lilypond/init//dynamic.ly][/home/hw/share/lilypond/init//dutch.ly][/home/hw/share/lilypond/init//script.ly][/home/hw/share/lilypond/init//paper16.ly[/home/hw/share/lilypond/init//table16.ly^[[B][/home/hw/share/lilypond/init//engraver.ly]][/home/hw/share/lilypond/init//midi.lySegmentation fault (core dumped) +hw:~/musix/spacer/Documentation/out$ diff --git a/COPYING b/COPYING index da81602209..34d69e4336 100644 --- a/COPYING +++ b/COPYING @@ -1,8 +1,11 @@ -This license applies to all files except: - - the included input files which explicitly state a different -copyright policy +*** NOTE + + This license applies to all files except the included input files + (which are in the subdirectory input/ + +*** END NOTE GNU GENERAL PUBLIC LICENSE Version 2, June 1991 diff --git a/Documentation/AUTHORS.pod b/Documentation/AUTHORS.pod index cab146ee80..f6366d5e00 100644 --- a/Documentation/AUTHORS.pod +++ b/Documentation/AUTHORS.pod @@ -36,7 +36,7 @@ and corresponding header files. =item * Mats Bengtsson , parts of clef-reg.cc, clef-item.cc -testing, general comments. +swedish notenames, testing, general comments. =item * @@ -45,12 +45,14 @@ Beam and Stem code. =item * -Alexandre Oliva +Alexandre Oliva , testing + +=item * + +Anthony Fok , debian package: make/debian/* =back Your name could be here! If you want to help, then take a look at the SMALLISH PROJECTS section of in the file F. Some do not involve coding C++ - - diff --git a/Documentation/INSTALL.pod b/Documentation/INSTALL.pod index 82d5e944fd..ae5da8da87 100644 --- a/Documentation/INSTALL.pod +++ b/Documentation/INSTALL.pod @@ -95,8 +95,8 @@ Although not strictly necessary, these are recommended to have. =item * -Perl. Most scripts are written in Perl. Most documentation was created -with the perl's Plain Old Documentation. +Perl-5. Most scripts are written in Perl. Most documentation was created +with the perl's Plain Old Documentation. (I use 5.003) =item * @@ -311,18 +311,17 @@ permissions will not be set correctly, unfortunately) A Debian package is in the works -=head1 WINDOZE +=head1 WINDOWS NT/95 -Windows NT: +So, you're stuck with Windows, eh? Well, don't worry, you just +need (to get) Cygnus' windows32 port of gnu development stuff; +have a look at http://www.cygnus.com/gnu-win32. -you need the cygnus windows32 gnu port development stuff; have a look -at http://www.cygnus.com/gnu-win32. - -to make GNU LilyPond under, brr, aargh, shudder.. windows32, well, +To make GNU LilyPond under, brr, aargh, shudder... windows32, well, simply type: bash configure - make windows32 + make =head1 AUTHORS diff --git a/Documentation/Makefile b/Documentation/Makefile index edd922ce57..1bc695200e 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -31,7 +31,8 @@ DVIFILES = $(addprefix $(outdir)/, $(DOCFILES:.doc=.dvi)) # # list of distribution files: # -EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif $(DOCFILES) +EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif $(DOCFILES) +# $(wildcard Vocab*) default: do-doc diff --git a/Documentation/Rules.make b/Documentation/Rules.make index 7724807799..bf32a8d067 100644 --- a/Documentation/Rules.make +++ b/Documentation/Rules.make @@ -23,8 +23,13 @@ $(outdir)/%.text: $(outdir)/%.1 $(depth)/%.text: $(outdir)/%.text cp $< $@ -$(outdir)/%.html: %.pod - $(pod2html) $< +do_pod2html=$(pod2html) $< + +# do this for perl 5.004 +# $ make do_pod2html='$(pod2html) --infile $< --outfile=$@' html +# +$(outdir)/%.html: %.pod $(depth)/VERSION + $(do_pod2html) mv $(notdir $@) $(outdir)/ $(outdir)/%.5: %.pod @@ -36,16 +41,20 @@ $(outdir)/%.1: %.pod $(outdir)/%.gz: $(outdir)/% gzip -c9 $< > $@ -$(outdir)/%.dvi: $(depth)/input/%.ly $(lilyout)/lilypond - (cd $(outdir); lilypond ../$< ;\ +name-stem= $(notdir $(basename $<)) +$(outdir)/%.dvi: $(depth)/input/%.ly + (cd $(outdir); \ + rm lelie.midi ; \ + lilypond -o $(name-stem) ../$< ) + (cd $(outdir); \ if [ -f ../$(basename $< ).tex ]; \ then \ latex ../$(basename $< ) ;\ else \ - tex '\nonstopmode \input lelie' ;\ - mv lelie.dvi ../$@ ; \ + tex $(name-stem) ;\ fi) + # generate the pixmap at twice the size, then rescale (for antialiasing) $(outdir)/%.gif: $(outdir)/%.ps gs -q -sDEVICE=ppmraw -sOutputFile=- -r200 -dNOPAUSE $< -c quit |pnmscale 0.5| ppmtogif > $@ diff --git a/Documentation/faq.pod b/Documentation/faq.pod index ac6aa0637f..9d58aaec2f 100644 --- a/Documentation/faq.pod +++ b/Documentation/faq.pod @@ -138,6 +138,22 @@ output PostScript or render to an X window too) =head2 Miscellaneous +Q: Do you support pop songs (chords, single staff, lyrics)? + +A: Yes, see the twinkle-pop example + +Q: Do you support guitar chord diagrams? + +A: No, not yet. We ourselves don't play guitar, and don't know the +fine points of this notation. We would welcome anyone who could give +this a try. + +Q: Do you support TAB notation + +A: No. The same as for the previous question goes, but TAB is a lot +more work than diagrams (TAB needs modification of Parser, Lexer, +Notehead, Stem, and stem-code. ) + Q: How do I change the TeX layout? A: See lilyponddefs.tex, it has some comments. @@ -199,21 +215,21 @@ Q: I want a DOS/NT/W95 port. A.0: Reconsider. Try Linux. It's fun! -A.1: Currently (patchlevel 27), GNU LilyPond (and flowerLib) compiles, links -and runs on windhoos-nt, using the cygnus gnu port (release b17.1). +A.1: Currently (patchlevel 27), GNU LilyPond (and flowerLib) compiles, +links and runs on Windows-nt, using Cygnus' gnu port (release b17.1). I (JCN) only had to make a minor workaround for missing library calls. -Have a look at http://www.cygnus.com/gnu-win32. To make GNU LilyPond type -C. (I am not promising to maintain this platform, it is just -that when having to use doze, i-m sometimes too lazy to reboot.) +Have a look at http://www.cygnus.com/gnu-win32. To make GNU LilyPond +type C. (I am not promising to maintain this platform, it is just +that when forced into doze, i'm sometimes too lazy to reboot.) A.2: I haven't had time to find a GCC crosscompiler (I g++ and -libg++, mind you) to DOS/win (in rpm, please :-) +libg++, mind you) to DOS/Windows (in rpm, please :-) -Q: I-m dozed enough to run the (sometimes bit stale) .exe-s you distribute. +Q: I just love to blindly run the (sometimes bit stale) .exe's you distribute. Why do i need cygwin.dll? -A: It-s all in this cut-n-paste: +A: It's all in this cut-n-paste: Minimalist GNU-Win32 Readme version 0.1.3 diff --git a/Documentation/gnu-music.pod b/Documentation/gnu-music.pod index fbb2d7402f..c209f2a31a 100644 --- a/Documentation/gnu-music.pod +++ b/Documentation/gnu-music.pod @@ -6,27 +6,61 @@ GNU Music project - manifesto Random ranting about the GNU Music project. -=head2 Note +=head2 History of the GNU Music Project -The GNU Music project was started by a few people (among others Robert Strandh, -Robert.Strandh@labri.u-bordeaux.fr), who wanted to create free software -for music printing and composing. After its initiation, its -development efforts slowed down. +Please note that this all happened when I wasn't around yet. If you +think that I am a biased, unfair, predisposed hypocrite, then don't +bother flaming me; I already know that. -Independently, I started LilyPond. When I showed it to +The GNU Music project is a project which aims to create free software +for music printing and composing. It was started in november '92 by a +core team of four members (Bryan Ford , David Linn +, Francois Pinard , +Neil Jerram and in January '93 Robert Strandh + joined. + +After serious disputes with Robert Strandh + and the FSF staff in '94, the +project core team got divided. The development efforts of GMP stopped. + +Independently, I (HWN) started LilyPond. When I showed it to RMS, he was very enthousiastic about having LilyPond in the GNU project. I subsequently learned about the GNU Music project, and -contacted them. We (the GNU Music project people and us, LilyPond -people) agreed that cooperation would be desirable. Although merging -of both efforts is technically infeasible at this point, we did decide -that LilyPond should also be part of the GNU Music project (when it is -really released). - -In summary, LilyPond is part of the GNU project, and part of the (yet -to be created) GNU Music project. LilyPond 's existence does not mean -that other efforts for free music tools have come to a halt. In -particular, the following document is entirely mine, and is not meant -to reflect anyone else's opinion. +contacted them. + +What was left of the GMP (Robert Strandh) and us, LilyPond people, +agreed that cooperation would be desirable. Although merging of both +efforts was and is technically infeasible, we did decide that LilyPond +should also be part of the GNU Music project. + +Only later did I discover the previous quarrels about the GMP-"take +1". To show that I am aware of the history, and to make sure nobody +gets me wrong or is angry at me because I stole a project or a +project's name, I wrote this note. + +In summary, LilyPond is now the only substantial embodiment of the GNU Music +Project, and it is part of the GNU project. + +For completeness' sake, I will mention the other efforts here: + +=over 4 + +=item G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp + +An alpha version notation editor for X in Scheme. Source available on +request. + +=item GNU music, + +An alpha version of a music editing system with Musictex +output. Pretest versions of GNU Music (v0.3) can still be obtained from +Francois Pinard. + +=back + +This history note is probably biased in some way, because I wrote it. +The rest of this document is also entirely mine, and is not meant to +reflect anyone else's opinion. =head1 GOAL @@ -70,25 +104,12 @@ performing =back -Music publishers make lots of money out of selling sheet music which -is in the public domain (the composers died a long time ago). It is -usually prohibited to xerox the sheet music. Publishers have two -arguments to justify this policy: the high prices are there to guarantee -diversity (keeping lots of stock is expensive), and to encourage new -work being composed. - -LilyPond addresses the first issue: storing mudelas takes up almost no -space at all. Other systems should address the other issue: -encouraging laymen to take up composing, in the same way that GNU -tools have created a whole new generation of programmers. - -The public deserves to get public domain music for free (zero cents). +These systems should encourage laymen to take up composing, in the +same way that GNU tools have created a whole new generation of +programmers. The public deserves free tools for composing and printing. -In general, the same arguments as for software hold for music. See -Stallmans articles on free software. - =head1 REQUIREMENTS @@ -146,8 +167,7 @@ but it is not (yet) suited to interactive typesetting which can display clear notewriting in (say) an X-window -G-Sharp is there, but far from finished. Ideally the system should -cooperate with the typesetting engine +Ideally the system should cooperate with the typesetting engine =item An ASCII language @@ -180,11 +200,6 @@ simplifies creating a collection of music (difficult) A system to generate accompaniments, figured bass, automatic accompaniment, etc. -=item An internet archive of free music - -The complete works by Bach, Beethoven, and any other ancient composer -should be electronically retrievable. This might be a separate -project: the Free Music Project. =back diff --git a/Documentation/index.pod b/Documentation/index.pod index 43f6c2b1e0..992009edc9 100644 --- a/Documentation/index.pod +++ b/Documentation/index.pod @@ -8,6 +8,9 @@ GNU LilyPond is a program which converts music definition files into visual or auditive output: it can typeset formatted sheet music to a TeX file and and (mechanical) performances to MIDI files. +This is not a Fanmail/Hype page. These pages were entirely created from +the LilyPond package-sources + =head2 Examples +=item * + +Mutopia -- Music To the People + + + =item * @@ -141,7 +152,7 @@ The Change log > =item * - internal structures. Papers, books and online-resources on music typesetting to the search path for input files. =item B<-M,--midi> -do midi output only +do midi output only. =item B<-d,--debug>, -Turn debugging info. GNU LilyPond will read the file F<.dstreamrc>, which -tells for what functions and classes may produce copious debugging +Turn debugging info on. GNU LilyPond reads the file F<.dstreamrc>, +which lists what functions and classes may produce copious debugging output. =item B<-w,--warranty>, @@ -41,11 +41,11 @@ Set the default output file to F. =item B<-h,--help>, -Show a summary of usage +Show a summary of usage. =item B<-i,--init=>F -set init file to F (default: F) +set init file to F (default: F). =item B<--include, -I>=F @@ -53,21 +53,21 @@ add F to the search path for input files. =item B<--ignore-version, -V> -make incompatible mudela version non-fatal +make incompatible mudela version non-fatal. =back =head1 FEATURES -This is an overview of the features that GNU LilyPond supports. For -details on how to use them, you should consult mudela(5) +This is an overview of the features that GNU LilyPond supports. For +details on how to use them, you should consult mudela(5). =over 5 =item * ASCII script input, with identifiers (for music reuse), -customizable notenames, customizable fontset +customizable notenames, customisable fontset. =item * @@ -79,7 +79,7 @@ MIDI to Mudela conversion through the mi2mu program. =item * -Multiple staffs in one score. Each staff can have a different meters. +Multiple staffs in one score. Each staff can have a different meters. =item * @@ -90,11 +90,11 @@ transposition dynamics (both absolute and hairpin style) =item * multiple voices within one staff; beams optionally shared -between voices. Up to four voices is handled cleanly. +between voices. Up to four voices is handled cleanly. =item * -multiple scores within one input file. Each score is output to +multiple scores within one input file. Each score is output to a different file. =item * @@ -105,11 +105,11 @@ clef changes, meter changes, cadenza-mode, key changes, repeat bars =head1 DISCLAIMER & COPYING POLICY -GNU LilyPond is copyright 1996,97 by its authors. GNU LilyPond is -distributed under the terms of the GNU General Public -License. GNU LilyPond is provided without any warranty what so ever. -GNU LilyPond may be freely distributed. For further information consult -the GNU General Public License, which is in the file F +GNU LilyPond is copyright 1996, 1997 by its authors. GNU LilyPond is +distributed under the terms of the GNU General Public License. GNU LilyPond +is provided without any warranty what so ever. +GNU LilyPond may be freely distributed. For further information consult +the GNU General Public License, from the file F. =head1 AUTHORS @@ -132,7 +132,7 @@ Jan Nieuwenhuizen , http://www.digicash.com/~jan. =head1 PROBLEMS -There is an extensive list of todoes and bugs. See F. In +There is an extensive list of todoes and bugs. See F. In general, try to find out =over 4 @@ -159,7 +159,7 @@ send a description of the platform you use =item * send a description of the LilyPond version you use (with -compile/config options please) +compile/configure options please) =item * send a description of the bug itself. @@ -171,8 +171,8 @@ send it to bug-gnu-music@vuse.vanderbilt.edu It does help if you can find out where the bug comes from: if GNU LilyPond bombs out, then please recompile using with debugging info -turned on, and send gdb stacktrace of the crash. It also helps if you -can print the values of the objects. So if your trace is +turned on, and send gdb stacktrace of the crash. It also helps if you +can print the values of the objects. So if your trace is received SIGSEGV (gdb) backtrace 12 @@ -193,7 +193,7 @@ Than it would help if you send a dump of the Interval and the Item =item F -The initialisation file with symbol tables etc. It +The initialisation file with symbol tables etc. It includes files from the directory F. =back @@ -214,7 +214,7 @@ On technical details of LilyPond =item mudela-man -On the input format. This is a LilyPond-enhanced LaTeX document. +On the input format. This is a LilyPond-enhanced LaTeX document. =item MANIFESTO @@ -227,7 +227,7 @@ The GNU LilyPond FAQ list =item http://www.stack.nl/~hanwen/lilypond/index.html GNU LilyPond has her own webpage. This webpage contains the MIDI, GIF -and PS files for some standard music files. It also has the complete +and PS files for some standard music files. It also has the complete LilyPond documentation =back @@ -235,7 +235,7 @@ LilyPond documentation GNU LilyPond is updated very frequently, the latest version is always available at: ftp://pcnov095.win.tue.nl/pub/lilypond and -ftp://alpha.gnu.ai.mit.edu/gnu/ +ftp://alpha.gnu.ai.mit.edu/gnu/lilypond/ For programs which are part of the GNU music project, the following @@ -251,13 +251,13 @@ subject "subscribe" to info-gnu-music-request@vuse.vanderbilt.edu =item help-gnu-music@vuse.vanderbilt.edu -For help with programs from the GNU music project. To subscribe: send +For help with programs from the GNU music project. To subscribe: send mail with subject "subscribe" to help-gnu-music-request@vuse.vanderbilt.edu =item bug-gnu-music@vuse.vanderbilt.edu -If you have bugreports, you should send them to this list. If you want +If you have bugreports, you should send them to this list. If you want to read all bugreports, you should subscribe to this list. To subscribe: send mail with subject "subscribe" to bug-gnu-music-request@vuse.vanderbilt.edu @@ -284,19 +284,19 @@ than the names being similar :-) (for a detailed changelog, see F) GNU LilyPond's roots lie in MPP, a preprocessor to the rather arcane -MusiXTeX macro package for TeX. A friend of mine, Jan Nieuwenhuizen +MusiXTeX macro package for TeX. A friend of mine, Jan Nieuwenhuizen wrote the first 44 versions (0.01 to 0.44), then his program caught my attention, and I was slowly sucked in to the interesting problem of -easily producing beautifully printed music. I contributed some -code. We soon realised that MPP's design was too fundamentally broken +easily producing beautifully printed music. I contributed some +code. We soon realised that MPP's design was too fundamentally broken to be repaired, so it was decided to rewrite MPP. We debated a lot about -the requirements to an inputformat (fall 1995). I sat down and started +the requirements to an inputformat (fall 1995). I sat down and started with a parser-first, bottom-up rewrite called mpp95 (which totally failed, obviously). After long and hard thinking, I came up with an algorithm for the horizontal spacing of multiple staffs (april 1996) I coded it (and did -not test it). After starting with this fundamental piece, I slowly +not test it). After starting with this fundamental piece, I slowly added the stages which come before spacing, and after. A half year later, I had a first working version, (october 1996). I announced Patchlevel 0.0.7 (or 8) to the mutex list after asking some technical @@ -304,7 +304,7 @@ details on spacing; it was downloaded approximately 4 times. Then I got the hang of it, and in the subsequent two months, I coded until it had doubled in size (pl 23). -Most the other history is described in the NEWS file. The first large +Most the other history is described in the NEWS file. The first large scale release (0.1) was done after approximately 78 patchlevels on August 1, 1997. diff --git a/Documentation/links.pod b/Documentation/links.pod index c5fadae003..ab1adf7a3e 100644 --- a/Documentation/links.pod +++ b/Documentation/links.pod @@ -16,6 +16,11 @@ of interest to LilyPond users. LilyPond is part of the GNU Project started by the Free Software Foundation to create a system of free software for the world-community +=item http://www.zib.de/Visual/software/doc++/index.html + +The documentation system for C++ sources, which the LilyPond sources use. + + =back =head2 Ftp @@ -34,8 +39,8 @@ An ftp site which is in CTAN. =item ftp://ftp.redhat.com/pub/contrib/ -RedHat Software develops and markets a GNU/Linux distribution (of -which we are avid users) +The FTP site of RedHat Software. + =back @@ -45,7 +50,7 @@ Beta releases will also be at =item ftp://pcnov095.win.tue.nl/pub/lilypond -=item ftp://alpha.gnu.ai.mit.edu/gnu/ +=item ftp://alpha.gnu.ai.mit.edu/gnu/lilypond/ =back @@ -73,8 +78,9 @@ mailing list have been setup: =item info-gnu-music@vuse.vanderbilt.edu -For information on the GNU Music project, to subscribe: send mail with -subject "subscribe" to info-gnu-music-request@vuse.vanderbilt.edu +A moderated list for information on the GNU Music project, to +subscribe: send mail with subject "subscribe" to +info-gnu-music-request@vuse.vanderbilt.edu =item help-gnu-music@vuse.vanderbilt.edu @@ -93,7 +99,7 @@ bug-gnu-music-request@vuse.vanderbilt.edu For discussions concerning the GNU Music project, to subscribe: send mail with subject "subscribe" to -gnu-music-discuss-request@vuse.vanderbilt.edu, +gnu-music-discuss-request@vuse.vanderbilt.edu =back @@ -126,4 +132,10 @@ The Linux webwatcher. Transcriptions of the music of Thomas Ravenscroft, partly using LilyPond +=item http://www.redhat.com/ + +develops and markets a GNU/Linux distribution (of +which we are avid users) + + =back diff --git a/Documentation/lilyliterature.pod b/Documentation/literature.pod similarity index 96% rename from Documentation/lilyliterature.pod rename to Documentation/literature.pod index 5bba17b138..f96915a22c 100644 --- a/Documentation/lilyliterature.pod +++ b/Documentation/literature.pod @@ -250,9 +250,6 @@ Kurt Stone. Music Notation in the Twentieth Century. New York: Norton, =head2 Other stuff -More on GNU Music: -http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp - Peter S. Langston, ``Unix music tools at Bellcore''. Software --- Practice and Experience, Vol. 20(S1), S1/47--S1/61, 1990. @@ -272,8 +269,13 @@ http://www.jtauber.com/music/encoding/niff/ [Specs for NIFF, a comprehensive but binary (yuk) format for notation HWN] -SMDL, Standard Musical Description Language -ftp://ftp.ornl.gov/pub/sgml/wg8/smdl/10743.pdf +SMDL, Standard Musical Description Language, +ftp://ftp.ornl.gov/pub/sgml/wg8/smdl/10743.pdf. ISO/IEC DIS 10743. + +[An ISO defined SGML language. A much more thorough treatment of music +definition than Mudela (but not suited for manual entry). It deals +with notation and perfomance issues by (basically) saying "You can +embed a MIDI or NIFF file" (sic) HWN] MPDL, diff --git a/Documentation/mi2mu.pod b/Documentation/mi2mu.pod index 77a68f1f52..1e35a7547a 100644 --- a/Documentation/mi2mu.pod +++ b/Documentation/mi2mu.pod @@ -80,11 +80,11 @@ This is an overview of the features that Mi2mu supports. =head1 DISCLAIMER & COPYING POLICY -Mi2mu is copyright 1996,97 by its authors. Mi2mu is distributed +Mi2mu is copyright 1996, 1997 by its authors. Mi2mu is distributed as part of GNU LilyPond, under the terms of the GNU General Public License. Mi2mu is provided without any warranty what so ever. Mi2mu may be freely distributed. For further information consult -the GNU General Public License, which is in the file F. +the GNU General Public License, from the file F. =head1 AUTHORS diff --git a/Documentation/mudela-course.doc b/Documentation/mudela-course.doc index a918c5df2e..369cfc745c 100644 --- a/Documentation/mudela-course.doc +++ b/Documentation/mudela-course.doc @@ -41,7 +41,8 @@ chords by \verb+<+ and \verb+>+. \begin[verbatim]{mudela} \score { \melodic { % {...} is a voice - c'4 g'4 % c and g are pitches, 4 is the duration (quaver) + c'4 g'4 % c and g are pitches, 4 is the duration + % (crotchet/quarter note) c''4 ''c4 % c' is 1 octave up, 'c 1 down. % <...> is a chord } diff --git a/Documentation/mudela-man.doc b/Documentation/mudela-man.doc index 8e3d0de2ea..a4cb803430 100644 --- a/Documentation/mudela-man.doc +++ b/Documentation/mudela-man.doc @@ -24,7 +24,8 @@ effective language for defining music. We call this language (rather arrogantly) The Musical Definition Language or Mudela, for short.\footnote{If anybody comes up with a better name, we'd gladly take this. Gourlay already uses Musical Description Language, - G-Sharp Score Definition Language. We're not being original here} + G-Sharp Score Definition Language. ISO standard 10743 defines a + Standard Music Description Language. We're not being original here} The first aim of Mudela is to define a piece of music, being complete from both from a musical typesetting, as from a musical performing @@ -218,10 +219,10 @@ meaning of \verb+_+ and the resolution of words You enter a note by giving the name and the reciprocal of the duration: \begin[fragment,verbatim]{mudela} -a'4 % dutch names +a'4 % Dutch names \end{mudela} -is a A-1 pitched quaver. The ' signifies an octave change. A-1 is 440 +is a A-1 pitched crotchet. The ' signifies an octave change. A-1 is 440 Hz concert-pitch. \verb+c'+ is also known as the central c. More examples: \begin[fragment,verbatim]{mudela} @@ -235,11 +236,11 @@ a'' % 880 The last one is an A flat, (just below 110 Hz concert-pitch). The \verb+*2/3+ signifies that this note is part of a triplet (3 in stead of 2). The -duration is one and a half quaver (\verb+4.+) times 2/3. +duration is one and a half quarter note (\verb+4.+) times 2/3. Notenames are just a special kind of identifiers, and can be declared for any language appropriate (see \file{init/dutch.ly}). The default language -for notenames is defined to be dutch. In dutch, the notenames are +for notenames is defined to be Dutch. In Dutch, the notenames are a,b,c,d,e,f and g. Sharps are formed by adding the extension "is", flats by adding ``es'' @@ -334,7 +335,7 @@ a4 \dynamic { 0 } % 0 = fff, 7 = ppp Mudela defines the following dynamic identifiers: \begin{verbatim} -ppp pp p mp mf df ff fff % df iso f, f is a notename. +ppp pp p mp mf f ff fff \end{verbatim} and the following abbreviations: \begin{verbatim} @@ -492,7 +493,7 @@ You can set the voicegroup of a voice with the command \verb+\group+, e.g., In this example, the two oboe voices share one staff and are initially in the voicegroup called "oboes". They will share beams, dynamics etc. -After two quavers, oboeI "pushes" its group: a new voicegroup is +After two quarter notes, oboeI "pushes" its group: a new voicegroup is created, called "oboes+solo". The \verb+\group "-"+ command makes the voice enter "oboes" again. @@ -547,7 +548,7 @@ same syntax as grouping: \end{verbatim} Make the piece start with a partial measure [english translation?] -lasting 1 3/4 quaver. +lasting 1 3/4 quarter notes. These commands are also "voice elements", and constitute simple mudela (consisting of stuff with duration 0). diff --git a/Documentation/mutopia.pod b/Documentation/mutopia.pod new file mode 100644 index 0000000000..bdefc53132 --- /dev/null +++ b/Documentation/mutopia.pod @@ -0,0 +1,35 @@ +=head1 NAME + +Mutopia project - manifesto + +=head1 DESCRIPTION + +Random ranting about the Mutopia project, aka "Music To the People." +[Not yet finished, so this is unpolished] + +=head1 WHY + +Music publishers make lots of money out of selling sheet music which +is in the public domain (the composers died a long time ago). It is +usually prohibited to xerox the sheet music. Publishers have two +arguments to justify this policy: the high prices are there to guarantee +diversity (keeping lots of stock is expensive), and to encourage new +work being composed. + +This is bad. Storing a Mudela file takes almost no space at all, and +if sheet music could be had for free, then it would be much easier +obtain less famous music. These composers have died long ago, and not +having their music available only discourages people from +experimenting with it. You deserve to get public domain music for +free (zero cents) + +=head1 WHAT + +For literature, the project Gutenberg has an archive of public domain +literary works. For music, this does not exist yet. + +We also need an archive of public domain sheet music; this is what we +call The Mutopia Project. + + + diff --git a/Documentation/other-packages.pod b/Documentation/other-packages.pod index 9da5f26af9..3049783499 100644 --- a/Documentation/other-packages.pod +++ b/Documentation/other-packages.pod @@ -9,11 +9,6 @@ packages. Feel free to add info (and mail it to me). =head2 Free packages (with source) -=item G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp - -An alpha version notation editor for X in Scheme. Source available on -request. - =item Rosegarden, http://www.bath.ac.uk/~masjpf/rose.html A Notation editor/Sequencer for X (windows95 port underway). Outputs musictex. @@ -51,7 +46,7 @@ MusixTeX is a macro package for TeX to typeset polyphonic or instrumental music by Daniel Taupin, Ross Mitchell and Andreas Egler. It includes a full-featured set of fonts. -=item ABC2MTeX, http://www.gmd.de/Misc/Music/ +=item ABC2MTeX, http://www.gre.ac.uk/~c.walshaw/abc A preprocessor to MusixTeX by Chris Walshaw for transcribing folk and traditional music. diff --git a/INSTALL.text b/INSTALL.text index 3a2b240602..a91ed8b4ef 100644 --- a/INSTALL.text +++ b/INSTALL.text @@ -61,7 +61,7 @@ RRRRUUUUNNNNNNNNIIIINNNNGGGG -3/Aug/97 LilyPond 0.1.1 1 +8/Aug/97 LilyPond 0.1.7 1 @@ -89,9 +89,9 @@ RRRREEEECCCCOOOOMMMMMMMMEEEENNNNDDDDEEEEDDDD Although not strictly necessary, these are recommended to have. - +o Perl. Most scripts are written in Perl. Most + +o Perl-5. Most scripts are written in Perl. Most documentation was created with the perl's Plain - Old Documentation. + Old Documentation. (I use 5.003) +o GNU find @@ -127,7 +127,7 @@ CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG a -3/Aug/97 LilyPond 0.1.1 2 +8/Aug/97 LilyPond 0.1.7 2 @@ -193,7 +193,7 @@ INSTALL(1) LilyPond documentation INSTALL(1) -3/Aug/97 LilyPond 0.1.1 3 +8/Aug/97 LilyPond 0.1.7 3 @@ -259,7 +259,7 @@ IIIINNNNSSSSTTTTAAAALLLLLLLLIIIINNNNGGGG -3/Aug/97 LilyPond 0.1.1 4 +8/Aug/97 LilyPond 0.1.7 4 @@ -325,7 +325,7 @@ RRRREEEEDDDDHHHHAAAATTTT LLLLIIIINNNNUUUUXXXX -3/Aug/97 LilyPond 0.1.1 5 +8/Aug/97 LilyPond 0.1.7 5 @@ -337,17 +337,17 @@ INSTALL(1) LilyPond documentation INSTALL(1) DDDDEEEEBBBBIIIIAAAANNNN GGGGNNNNUUUU////LLLLIIIINNNNUUUUXXXX A Debian package is in the works -WWWWIIIINNNNDDDDOOOOZZZZEEEE - Windows NT: +WWWWIIIINNNNDDDDOOOOWWWWSSSS NNNNTTTT////99995555 + So, you're stuck with Windows, eh? Well, don't worry, you + just need (to get) Cygnus' windows32 port of gnu + development stuff; have a look at + http://www.cygnus.com/gnu-win32. - you need the cygnus windows32 gnu port development stuff; - have a look at http://www.cygnus.com/gnu-win32. - - to make GNU LilyPond under, brr, aargh, shudder.. + To make GNU LilyPond under, brr, aargh, shudder... windows32, well, simply type: bash configure - make windows32 + make AAAAUUUUTTTTHHHHOOOORRRRSSSS @@ -391,6 +391,6 @@ AAAAUUUUTTTTHHHHOOOORRRRSSSS -3/Aug/97 LilyPond 0.1.1 6 +8/Aug/97 LilyPond 0.1.7 6 diff --git a/NEWS b/NEWS index 140b08c42a..cdf96ae04f 100644 --- a/NEWS +++ b/NEWS @@ -1,11 +1,105 @@ +pl 7 + - Audio_element as base for Audio_item and Audio_staff. fixes +midi-lyric segfault + - added "Gallina a due violini" + - make MIDI files on website. + - Collision now also is an Element_group. + - bf: announce Collision when created + +******** +aug 13 +pl 6 + - bf: 13 shift/reduce in parser fixed + - bf: plets in parser + - bf: main.o (again) + - german notenames (RM) + - Score_elem::offset_ now relative to its X/Y groups. Slight +speed increase? + +******** +aug 12 +pl 5 + + - Wordwrap revert + - added LilyPond in WWW titles + - oops. A quaver is a 8th note, not a 4th + - bf: main.o remaking in lily/Makefile + - unhair Voice_iterator + - bf: error if no music in score + - bf: don't create translators if Chord element is empty + - bf: ctor of Tempo_req + - use virtual do_equal_b() for request comparison + - bf: turned off default plets: c4*2/3 c4*2/3 -> c4*2/3 c4*4/9 + - bf: time_int() of an empty chord/voice + - more corrections to GMP Manifesto + - debian updates (AF) + - bf: g++ ICE in Performer_group_performer + - use fread() for reading in Simple_file_storage + +pl 0.1.3.jcn1 + - mi2mu: simplification +bf lily_stream: indentation and wordwrap + - mi2mu: bf: blunt: non-alpha(num) chars from identifiers + +********* +aug 11 +pl 4 + - correction of GNU Music Manifesto + - moved lowlevel stuff of Source_file to Mapped_file_storage. +Interface via File_storage. (Now using Simple_file_storage) + - bf: c4-"A"-"B" + - bf: exit status + - declarable keys + - Engraver_group_engraver::find_simple_engraver() + - bf: lily/Makefile + - bf: Midi_note_event ctor + - bf: tempo request + - popular twinkle twinkle (JV) + - mudela: parse tempo requests, \midi{ \tempo 4= 60;} + +****** +aug 8 +pl 3 + - don't crash if no Clef_engraver. + - PScore -> Paper_score + - bf: Score_elem::extent() init of interval + - bfs: {Horizontal,Vertical}_group related + - bf: don't change original Item while doing making + multiple copies + - bf: configure DATADIR + - bf: type of spanbar. + +pl 0.1.2.jcn1 + - minor doco fixes + - revived Midi_walker + - moved midi out of performer-* to audio-* + - Audio_staff + - removed all members from performers + +******* +aug 7 +pl 2 + - junked Line_of_staff + - bf: --output + - bf: . in lexer + - bf: mi2mu version number. + - bf: in mudela-book + - bf: don't forget to make mi2mu + - Bar_number_grav: measure numbers (experimental) + - Bar_column_engraver, Bar_column: scripts on bars + - rewrite of {Horizontal,Vertical}_group. Yes, again. +Now neatly integrated into class hierarchy + - Axis, Axis_group + - Debian rules (AF) + pl 0.1.1.jcn1 - Audio{column,score,item,...}, more generic audio - bf: Makefiles - - added empty flower/aclocal.m4? - bf: mi2mu mudela version +********* +aug 5 pl 0.1.1 - - {Horizontal, Vertical}_group. A score_element may be in at most one. + - {Horizontal, Vertical}_group. A score_element may be in at most one. - This means Horizontal_group_item and Vertical_group_spanner need special support. - This also means a big speed increase - configure cleanup diff --git a/README b/README index 81977e3603..5b975730b5 100644 --- a/README +++ b/README @@ -5,6 +5,7 @@ GNU LilyPond which converts music definition files into visual or audio output: it can typeset formatted sheet music in TeX and and (mechanical) perfomances to MIDI files. + 1. VERSIONING if you have downloaded a @@ -46,30 +47,17 @@ You can also simply read the .pod sources. They are ASCII text. LilyPond is a long way from finished and polished. I do appreciate criticism, comments, bugreports, patches, etc. Please send e-mail to -the mailing lists - - - info-gnu-music@vuse.vanderbilt.edu - help-gnu-music@vuse.vanderbilt.edu - bug-gnu-music@vuse.vanderbilt.edu - gnu-music-discuss@vuse.vanderbilt.edu, - -See the man page on what to use for what. Or you can send it directly -to us: hanwen@stack.nl, jan@digicash.com. - - - +the mailing lists. See Documentation/links.pod for more info -Have fun! 6. DOZE If you have received this file as part of a DOS/Window32 distribution (lilypond-*.zip ), then it is advisable to also download the source -package, since it contains the complete documentation +package, since it might contain more documentation ftp://pcnov095.win.tue.nl/pub/lilypond/ (Europe) - ftp://alpha.gnu.ai.mit.edu/gnu/ (US) + ftp://alpha.gnu.ai.mit.edu/gnu/lilypond/ (US) The website also contains the complete documentation @@ -77,5 +65,20 @@ The website also contains the complete documentation +7. CAVEATS + +Solaris + +Stack frame overwrite on Solaris 2.x (this will produce a seg +fault, signal 11). Stacktrace + + Engraver_group_engraver::Engraver_group_engraver(int) + Score_engraver::Score_engraver( ) + get_group_engraver_p() + +We don't know a fix or workaround, but compiling without optimisation +might help (Without -O2 optimisation, my execs run fine on Solaris; +without -O2, but with purify, it dumps core) + diff --git a/TODO b/TODO index f617a2a566..66701d0090 100644 --- a/TODO +++ b/TODO @@ -5,13 +5,25 @@ 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 + * Generate TeX titles from MudelaHeader - * generate stuff in out/default, out/sun5-irix etc iso out/ -and out-sun5/ + * integrate midi-elts from mi2mu and lily + + * virtualise PCols to make encapsulated spacing problems + + * fix spacing: standchen: distance bar-note, + strange stretching and compressing of 8's + + * Doc Mutopia (Music To The People) + + * context in spring-spacer. - * derive dstream, texstream from ostream? + * don't count bars which are not on first beat. - * A typical pop-music example. + * generate stuff in out/default, out/sun5-irix etc iso out/ + and out-sun5/ + + * derive lily_stream, Dstream, texstream from ostream? * check libtool, automake @@ -31,21 +43,21 @@ and out-sun5/ * get rid of gif files. - * set_midi_channel/staff() out of performer. - * dots into separate item. * use String iso Text_def for lyrics. * use position 0 for center of staff iso bottom. + * Klavarskribo? + * return status on exit * lyrics in chords still fuck up. * rewire acknowledge_element() logic with a process_acknowledged() - * Global type registration. + * Global type registration. My_class * p = create_object( My_class ) Type t = get_type ( *p ); @@ -68,10 +80,12 @@ and out-sun5/ 3RD PARTY BUGS: + * collision.cc: 138, g++ errors + * bugreport to doc++ devel: struct not in class hier; public virtual baseclasses - * DOC++ bugs/ newer version? + * DOC++ bugs/newer version? * Rational infty(HUGE_VAL) on glibc / w32 @@ -81,10 +95,20 @@ and out-sun5/ yy_scan_buffer in C++.. * (where are the) gcc compile warnings on linux - + +LILY BUGS + + \score { < + \melodic { \id "Staff" ""; c'4 g'4 } + \lyric { \id "Lyric" ""; hello4 bye4 < a chord > } + \lyric { \id "Lyric" ""; bye4 hello4 } + \melodic { \id "Staff" ""; c'4 g'4 } + > } PROJECTS + * emacs-mode for mudela + * input converters - NIFF? - ABC? @@ -174,17 +198,23 @@ PROJECTS besides lists of flats/sharps, possibly via declaration - key transposition. - key undo: \key bes; .. . \key; should print natural - - special key: \key 'b bes bis'; + - special key: \key bes 'b bis'; - spacing, national styles? -PARSER - * Duration -> Musical_duration, typedef Rational Duration? + * Support for TAB + - redo Notehead to allow digits as heads + - add a \tablature {} lexer mode for easy entering -BUGS * should adjust stemlength for flag number. - * lilypond - -> crash + * breaking: + - caching breakpoints + - saving them + - allowing users to set them. + - penalties + - specify number of lines + - set linelength per line SEVERELY LACKING: @@ -272,8 +302,6 @@ SMALLISH PROJECTS * centered whole rest - * caching breakpoints / saving them. - * use dstream feature in mi2mu * qtor, btor, mtor-> tor( QUIET_ver ), tor( DEBUG_ver ), etc. @@ -308,10 +336,6 @@ SMALLISH PROJECTS * configure idealspacing: arithmetic spacing - * LilyPond .deb. Other packaging methods? - - * detect -pipe - DOC * Score_elem structure. @@ -346,7 +370,6 @@ FUTURE * volta IDEAS - * check out CORBA for Score_elems? * derive PCol from Score_elem? More in Score_elems? Spacing? @@ -388,7 +411,7 @@ IDEAS % fingering: footing: < a-4 c-2 g-1 > < c-\ltoe e-\lheel > - * parameterised scripts for fingering and footing: + * stackparameterised scripts for fingering and footing: % toe to bheel four to five % ^_u 4_5 diff --git a/VERSION b/VERSION index 1a78f879c5..a0f69a468e 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 1 -TOPLEVEL_PATCH_LEVEL = 1 +TOPLEVEL_PATCH_LEVEL = 7 # use to send patches, always empty for released version: -TOPLEVEL_MY_PATCH_LEVEL = .jcn1 +TOPLEVEL_MY_PATCH_LEVEL = diff --git a/bin/convert-mudela.in b/bin/convert-mudela.in index f1b640c0ae..bad1df51ec 100644 --- a/bin/convert-mudela.in +++ b/bin/convert-mudela.in @@ -1,4 +1,5 @@ #!@PERL@ -w +# -*-perl-*- =head1 TODO @@ -105,6 +106,10 @@ sub convert_0_0_60_to_0_0_61 } +sub convert_0_1_0_to_0_1_1 +{ + s/\\tempo (.*):(.*);/\\tempo $1 = $2;/g +} ############################################################### sub last_conversion @@ -144,19 +149,22 @@ my %minor_conversions = ("0.0.50" => \&no_conv, "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.61" => \&convert_0_0_60_to_0_0_61 + "0.0.61" => \&convert_0_0_60_to_0_0_61, + "0.1.1" => \&convert_0_1_0_to_0_1_1 ); sub versions { - return (sort keys %minor_conversions); + return (sort { cmpver; } (keys %minor_conversions)); } -sub show_rules +sub show_rules { - print "Rules: ", join(", ", sort keys %minor_conversions), "\n"; + my (@v) = versions; + + print "Rules: ", join(", ", @v), "\n"; } @@ -167,7 +175,6 @@ sub do_conversion my @applicable_conversion; my @mudela_levels; -# die "This is too old to convert " if $from < 50; my @v = versions; foreach $ver (@v) { if (version_compare($ver, $from) > 0 && version_compare($ver,$to) <= 0 ){ diff --git a/bin/make-version b/bin/make-version index d8e79346cd..3be14353cb 100755 --- a/bin/make-version +++ b/bin/make-version @@ -10,11 +10,4 @@ fi cat $versionfile| sed 's/#.*$//g'|sed 's/\([^ ]*\)[\t ]*=[ \t]*\([^ ]*\)$/#define \1 \"\2\"/g' echo -if [ -z $CXX ] -then - COMPILER=unknown -else - COMPILER="$CXX `$CXX --version`" -fi - -echo "#define COMPILER "\"$COMPILER\" + diff --git a/bin/make-website.in b/bin/make-website.in index 28f85f79ba..e6796215f3 100644 --- a/bin/make-website.in +++ b/bin/make-website.in @@ -1,12 +1,12 @@ #!@PERL@ -w -# stupid script to generate WWW site. +# stupid script to generate WWW site. -*-Perl-*- use FileHandle; use Getopt::Long; my $lily_version; my $footstr; my $mw_id = ""; -my $id_str = "make-website 0.3"; +my $id_str = "make-website 0.4"; my $TAR="tar"; my $MAKE="make"; @@ -40,12 +40,11 @@ sub set_html_footer my $username=$pw[6]; $footstr = - "\n
Please take me back to the index\n
+ "\n
Please take me back to the LilyPond index\n
-This page was generated by " . $id_str . " from lilypond-$lily_version by +This page was built using " . $id_str . " from lilypond-$lily_version by


$username <$MAILADRESS>
-

" . `date` . "

"; } @@ -76,7 +75,7 @@ sub my_system local $base="lilypond/"; local @examples=("twinkle", "multi", "wohltemperirt" ,"standchen", "toccata-fuga-E", - "scsii-menuetto", "collisions", "cadenza", "scales"); + "scsii-menuetto", "collisions", "cadenza", "scales", "twinkle-pop"); # rhythm, scales, @@ -104,7 +103,7 @@ sub gen_manuals { print "generating TeX doco list\n"; open HTMLLIST, ">tex_manuals.html"; - print HTMLLIST "LilyPond manuals\n" ; + print HTMLLIST "PostScript Manuals\n" ; print HTMLLIST "

LilyPond manuals (in PostScript)

"; print HTMLLIST "
    \n"; my @todo=(); @@ -124,7 +123,7 @@ sub gen_list { print "generating HTML list\n"; open HTMLLIST, ">example_output.html"; - print HTMLLIST "LilyPond examples\n + print HTMLLIST "Rendered Examples\n These example files are taken from the LilyPond distribution.\n LilyPond currently only outputs TeX and MIDI. The pictures and\n PostScript files were generated using TeX, Ghostscript and some graphics tools. \n @@ -192,8 +191,10 @@ sub edit_html $subst .= $back if (! $a =~ /index.html/ ); $file =~ s/$sep/$subst$sep/g ; $file =~ s/\.gif/\.$image/g; + $file =~ s!(.*)!LilyPond WWW: $1!g; open H, ">$a"; print H $mw_id; + print H $file; close H; } @@ -213,7 +214,7 @@ sub copy_txt_file sub copy_files { print "copying files\n"; - print `ln -s $depth/out ./docxx` if ( ! -x "docxx" ) ; + my_system "ln -s $depth/out ./docxx" if ( ! -x "docxx" ) ; my_system "cp $depth/TODO ./TODO.txt", "cp $depth/ANNOUNCE ./ANNOUNCE.txt", "cp $depth/NEWS ./NEWS.txt", @@ -237,7 +238,13 @@ sub set_images sub docxx_update { - my_system "$MAKE -C $depth doc++"; + open BANNER, ">/tmp/lilybanner.html"; + my $ban = $footstr; + $ban =~ s!index.html!../index.html!g; + print BANNER $ban; + close BANNER; + my_system "$MAKE -C $depth docxx-opts=\"-p -S -k -B /tmp/lilybanner.html\" doc++"; + # should add a cute header. } sub do_tar @@ -283,8 +290,8 @@ sub main if (! $opt_noexamples) { gen_examples; gen_list; + gen_manuals; } - gen_manuals; set_images; edit_html; diff --git a/bin/mudela-book.in b/bin/mudela-book.in index 11f27a40aa..374f223a1f 100644 --- a/bin/mudela-book.in +++ b/bin/mudela-book.in @@ -3,6 +3,7 @@ my $mudcount = 0; my $mudela_b = 0; my $outname = "-"; +my $outdir; use Getopt::Long; sub gen_mufile @@ -99,7 +100,7 @@ sub main if (defined ($opt_outdir)) { $outdir = $opt_outdir . "/"; } else { - $outdir = ""; + $outdir = "."; } if (defined ($ARGV[0])) { @@ -110,12 +111,17 @@ sub main if (defined ($opt_outname)) { $outname = $opt_outname ; } else { - die "Need to have an output name, use --outname" if ( $infile == "-"); + die "Need to have an output name, use --outname" if ( $infile eq "-"); $outname = "$infile.tex"; } - + + my $openout ="$outdir$outname"; + if ( $infile eq $openout ) { + die "The input can't be the output\n"; + } + open INFILE, "<$infile"; - open BOOK, ">$outdir$outname"; + open BOOK, ">$openout"; while () { if ($mudela_b) { if (end_b "mudela") { diff --git a/configure b/configure index ab1ca42f27..3042b7989d 100755 --- a/configure +++ b/configure @@ -542,7 +542,10 @@ if test x$srcdir != x.; then echo Please look in the INSTALL instructions for echo directions for multi-architecture building - { echo "configure: error: This package does not support --srcdir." 1>&2; exit 1; } + + echo "configure: warning: This package does not support --srcdir!" 1>&2 + warn_b=yes + fi # if given here, these vars are initted at the checking point. @@ -557,7 +560,6 @@ checking_b=yes debug_b=yes optimise_b=no profile_b=no -warn_b=no ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -684,7 +686,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:688: checking for $ac_word" >&5 +echo "configure:690: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -715,7 +717,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:719: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:721: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -725,11 +727,11 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -749,12 +751,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:753: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:755: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:758: checking whether we are using GNU C++" >&5 +echo "configure:760: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -763,7 +765,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -778,7 +780,7 @@ if test $ac_cv_prog_gxx = yes; then ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:782: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:784: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -808,7 +810,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:812: checking for $ac_word" >&5 +echo "configure:814: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -864,7 +866,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:868: checking for a BSD compatible install" >&5 +echo "configure:870: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -918,7 +920,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:922: checking for $ac_word" >&5 +echo "configure:924: 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 @@ -952,7 +954,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:956: checking for $ac_word" >&5 +echo "configure:958: 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 @@ -982,14 +984,18 @@ done test -n "$FIND" || FIND="error" -if test FIND = error; then - - echo "configure: warning: Couldn't find \`find'. Please use --enable-tex-dir" 1>&2 + + if test $FIND = "error" + then + + echo "configure: warning: can't find \`find\'. Please use --enable-tex-dir. " 1>&2 warn_b=yes -fi + fi + + @@ -1014,7 +1020,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:1018: checking for $ac_word" >&5 +echo "configure:1024: 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 @@ -1048,7 +1054,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:1052: checking for $ac_word" >&5 +echo "configure:1058: 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 @@ -1082,7 +1088,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:1086: checking for $ac_word" >&5 +echo "configure:1092: 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 @@ -1114,7 +1120,7 @@ test -n "$MAKE" || MAKE="error" # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1118: checking for $ac_word" >&5 +echo "configure:1124: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1148,7 +1154,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:1152: checking for $ac_word" >&5 +echo "configure:1158: 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 @@ -1184,7 +1190,7 @@ if test "x$TEXPREFIX" = xauto ; then echo $ac_n "checking TeX/MF root dir directory""... $ac_c" 1>&6 -echo "configure:1188: checking TeX/MF root dir directory" >&5 +echo "configure:1194: checking TeX/MF root dir directory" >&5 find_root_prefix="$prefix" @@ -1225,7 +1231,7 @@ if test "x$TEXDIR" = xauto ; then echo $ac_n "checking TeX input directory""... $ac_c" 1>&6 -echo "configure:1229: checking TeX input directory" >&5 +echo "configure:1235: checking TeX input directory" >&5 find_dirdir=`(cd $find_texprefix; $FIND ./ -type d -a -name tex -print |sort|head -1|sed 's#^\./##')` @@ -1245,7 +1251,9 @@ echo "configure:1229: checking TeX input directory" >&5 fi - + + + if test $MAKE = "error" @@ -1326,7 +1334,7 @@ else fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:1330: checking how to run the C++ preprocessor" >&5 +echo "configure:1338: 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 @@ -1339,12 +1347,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:1348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1364,17 +1372,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:1368: checking for FlexLexer.h" >&5 +echo "configure:1376: 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:1378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1400,7 +1408,7 @@ else fi -for a in `find -type d -and -not -name 'out*'`; do +for a in `find . -type d -and -not -name 'out*' -print`; do if test ! -d $a/$OUTDIR_NAME; then mkdir $a/$OUTDIR_NAME fi @@ -1409,8 +1417,6 @@ done subdirs="flower" -# ugh -eval "DIR_DATADIR=$datadir/lilypond" trap '' 1 2 15 cat > confcache <<\EOF @@ -1526,7 +1532,6 @@ ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "make/$OUTDIR_NAME/Configure_variables.make:make/Configure_variables.make.in - lib/$OUTDIR_NAME/config.hh:lib/config.hh.in Makefile:make/Toplevel.make.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF @@ -1812,7 +1816,7 @@ If you want to make site-wide extensions to the makefiles, please use END -if test $warn_b = "yes" ; then +if test x$warn_b = "xyes" ; then cat < -It is licensed under the GNU GPL. \ No newline at end of file +It is licensed under the GNU GPL. diff --git a/flower/VERSION b/flower/VERSION index d05f7ff918..7aec79ceb0 100644 --- a/flower/VERSION +++ b/flower/VERSION @@ -1,6 +1,6 @@ MAJOR_VERSION = 1 MINOR_VERSION = 1 -PATCH_LEVEL = 25 +PATCH_LEVEL = 26 # use to send patches, always empty for released version: MY_PATCH_LEVEL = # include separator: "-1" or ".a" # diff --git a/flower/aclocal.m4 b/flower/aclocal.m4 new file mode 100644 index 0000000000..57ac6967aa --- /dev/null +++ b/flower/aclocal.m4 @@ -0,0 +1,2 @@ + +dnl this file intentionally left blank :) diff --git a/flower/dstream.cc b/flower/dstream.cc index 23b77bbbc4..ce0a51d363 100644 --- a/flower/dstream.cc +++ b/flower/dstream.cc @@ -13,6 +13,7 @@ #include "text-db.hh" #include "string-convert.hh" #include "assoc-iter.hh" + /// indent of each level const INDTAB = 2; @@ -75,8 +76,6 @@ Dstream::silence(String s) return (*silent_assoc_p_)[s]; } -/** Output a string via the Dstream. This is the only output - interface. It delegates all conversion to String class. */ Dstream & Dstream::operator<<(String s) { @@ -172,5 +171,4 @@ Dstream::clear_silence() for (Assoc_iter i(*silent_assoc_p_); i.ok(); i++) { i.val() = 0; } - } diff --git a/flower/include/dstream.hh b/flower/include/dstream.hh index 63130d1204..19fd8acab2 100644 --- a/flower/include/dstream.hh +++ b/flower/include/dstream.hh @@ -16,7 +16,7 @@ const char eol= '\n'; template struct Assoc; -/** debug stream. +/** Debug stream. a class for providing debug output of nested structures, with indents according to \{\}()[]. @@ -47,11 +47,12 @@ public: /** if rcfile == 0, then do not read any rc file. */ - Dstream(ostream *r, char const * rcfile); virtual ~Dstream(); Dstream &identify_as(String s); +/** Output a string via the Dstream. This is the only output + interface. It delegates all conversion to String class. */ Dstream &operator << (String s); /** Output memory locations. diff --git a/flower/include/lgetopt.hh b/flower/include/lgetopt.hh index 6db9cd4dfd..89b0196bf2 100644 --- a/flower/include/lgetopt.hh +++ b/flower/include/lgetopt.hh @@ -14,7 +14,7 @@ struct Long_option_init { char const * longname; char shortname; - ostream &printon(ostream &errorout); + void printon(ostream &errorout)const ; }; @@ -28,54 +28,56 @@ struct Long_option_init { argument reordering */ class Getopt_long { -public: - /** errorcodes: no error, argument expected, no argument expected, - unknown option, illegal argument (eg. int expected). */ - enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION, - E_ILLEGALARG } ; - - -private: /// the option info. - Long_option_init *the_opts; - int table_len; + const Long_option_init *option_a_; + int table_len_i_; - /// if doing short option, argv[optind][optindind] is processed next. - int optindind; + /// if doing short option, arg_value_ch_a_a_[optind][optindind] is processed next. + int argument_index_i_; /// the option found - Long_option_init *beet; + const Long_option_init *found_option_l_; - /// get ready for processing next error. - bool next(); - Long_option_init *parselong(); - Long_option_init *parseshort(); - - ostream *errorout; - /// report an error and abort - void report(Errorcod c); -public: +public: + /** errorcodes: no error, argument expected, no argument expected, + unknown option, illegal argument (eg. int expected). */ + enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION, + E_ILLEGALARG } ; /// argument. Set to 0 if not present - char* optarg; + char const * optional_argument_ch_C_; /// current error status - Errorcod error; + Errorcod error_; - /// return an integer (with err. detect) - long intarg(); - /// argv[optind] will be processed next. - int optind; + /// arg_value_ch_a_a_[array_index_i_] will be processed next. + int array_index_i_; /// the arguments - char **argv; + char **arg_value_ch_a_a_; /// the arg. count - int argc; - - /* *************** */ + int argument_count_i_; + + ostream *error_ostream_l_; + +public: + /// get ready for processing next error. + void next(); + const Long_option_init *parselong(); + const Long_option_init *parseshort(); + void OK()const; + bool ok() const; + + /// report an error and abort + void report(Errorcod c); + + + /// return an integer (with err. detect) + long argument_to_i(); + /** What to do with errors. @@ -92,9 +94,9 @@ public: @return pointer to next option found. 0 if error occurred, or next argument is no option. */ - Long_option_init *operator()(); + const Long_option_init *operator()(); - char *current_arg(); - char * get_next_arg(); + char const *current_arg(); + char const * get_next_arg(); }; #endif diff --git a/flower/lgetopt.cc b/flower/lgetopt.cc index c2e5a3b790..afffc2f4b2 100644 --- a/flower/lgetopt.cc +++ b/flower/lgetopt.cc @@ -9,64 +9,65 @@ #include "lgetopt.hh" long -Getopt_long::intarg() +Getopt_long::argument_to_i() { long l; - if (sscanf(optarg, "%ld", &l) != 1) + if (!optional_argument_ch_C_ + || sscanf(optional_argument_ch_C_, "%ld", &l) != 1) report(E_ILLEGALARG); return l; } -Long_option_init * +const Long_option_init * Getopt_long::parselong() { - char const *optnm = argv[optind] + 2 ; + char const *optnm = arg_value_ch_a_a_[array_index_i_] + 2 ; assert(*optnm); - char *endopt = strchr(optnm, '='); + char const *endopt = strchr(optnm, '='); int searchlen = (endopt) ? endopt - optnm : strlen(optnm); - beet=0; - for (int i=0; i< table_len; i++) { - char const *ln = the_opts[i].longname; + found_option_l_=0; + for (int i=0; i< table_len_i_; i++) { + char const *ln = option_a_[i].longname; if (ln && !strncmp(ln, optnm, searchlen)) { - beet = the_opts+i; + found_option_l_ = option_a_+i; break; } } - if (!beet) { + if (!found_option_l_) { report(E_UNKNOWNOPTION); return 0; } - optind++; - optindind = 0; + array_index_i_++; + argument_index_i_ = 0; - if (beet->take_arg) { + if (found_option_l_->take_arg) { if (endopt) - optarg = endopt +1; // a '=' + optional_argument_ch_C_ = endopt +1; // a '=' else { - optarg = argv[optind]; - optind++; + optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_]; + array_index_i_++; } - if (!optarg) + if (!optional_argument_ch_C_) report(E_ARGEXPECT); } else { - optarg = 0; + optional_argument_ch_C_ = 0; if (endopt) report(E_NOARGEXPECT); } - return beet; + return found_option_l_; } -ostream & -Long_option_init::printon(ostream &errorout) +void +Long_option_init::printon(ostream &errorout)const { if (shortname) errorout <<"-" << shortname; @@ -74,150 +75,164 @@ Long_option_init::printon(ostream &errorout) errorout << ", "; if (longname) errorout << "`--" << longname << "'"; - return errorout; } // report an error, GNU style. void Getopt_long::report(Errorcod c) { - error = c; - if (!errorout) + error_ = c; + if (!error_ostream_l_) return; - *errorout << argv[0] << ": "; + *error_ostream_l_ << arg_value_ch_a_a_[0] << ": "; switch (c) { case E_ARGEXPECT: - *errorout<< "option "; - beet->printon(*errorout); - *errorout << "requires an argument"<printon(*error_ostream_l_); + *error_ostream_l_ << "requires an argument"<longname << "' does not allow an argument"<longname << "' does not allow an argument"<printon(*errorout); - *errorout << '\n'; + *error_ostream_l_ << "illegal argument `" << optional_argument_ch_C_ << "\'to option "; + found_option_l_->printon(*error_ostream_l_); + *error_ostream_l_ << '\n'; default: assert(false); } exit(2); } -Long_option_init * +const Long_option_init * Getopt_long::parseshort() { - char c=argv[optind][optindind]; - beet=0; + char c=arg_value_ch_a_a_[array_index_i_][argument_index_i_]; + found_option_l_=0; assert(c); - for (int i=0; i < table_len; i++) - if (the_opts[i].shortname == c) { - beet = the_opts+i; + for (int i=0; i < table_len_i_; i++) + if (option_a_[i].shortname == c) { + found_option_l_ = option_a_+i; break; } - if (!beet){ + if (!found_option_l_){ report(E_UNKNOWNOPTION); return 0; } - optindind++; - if (!beet->take_arg){ - optarg = 0; - return beet; + argument_index_i_++; + if (!found_option_l_->take_arg){ + optional_argument_ch_C_ = 0; + return found_option_l_; } - optarg = argv[optind] + optindind; + optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_] + argument_index_i_; - optind ++; - optindind = 0; + array_index_i_ ++; + argument_index_i_ = 0; - if (!optarg[0]) { - optarg = argv[optind]; - optind ++; + if (!optional_argument_ch_C_[0]) { + optional_argument_ch_C_ = arg_value_ch_a_a_[array_index_i_]; + array_index_i_ ++; } - if (!optarg) { + if (!optional_argument_ch_C_) { report(E_ARGEXPECT); } - return beet; + return found_option_l_; } -Long_option_init * +const Long_option_init * Getopt_long::operator()() { - if (!next()) + if (!ok()) return 0; - if (optindind) - return parseshort(); + next(); + + if (argument_index_i_) + return parseshort(); + + const char * argument_C = arg_value_ch_a_a_[array_index_i_]; - if (argv[optind][0] != '-') + if (argument_C[0] != '-') return 0; - if (argv[optind][1] == '-') {// what to do with "command -- bla" - return parselong(); + if (argument_C[1] == '-') {// what to do with "command -- bla" + if ( argument_C[2] ) + return parselong(); + else + return 0; } else { - optindind = 1; - return parseshort(); + if (argument_C[ 1 ]) { + argument_index_i_ = 1; + return parseshort(); + } else { + return 0; + } } } -Getopt_long::Getopt_long(int c, char **v, Long_option_init *lo) +Getopt_long::Getopt_long(int c, char **v, Long_option_init *lo) { - the_opts = lo; - errorout = &cerr; - argv = v; - argc = c; - optind = 1; - optindind = 0; + option_a_ = lo; + error_ostream_l_ = &cerr; + arg_value_ch_a_a_ = v; + argument_count_i_ = c; + array_index_i_ = 1; + argument_index_i_ = 0; // reached end of option table? - int i; - for (i = 0; the_opts[i].longname ||the_opts[i].shortname; i++) - ; - table_len = i; + table_len_i_ =0; + for (int i = 0; option_a_[i].longname ||option_a_[i].shortname; i++) + table_len_i_ ++; } bool -Getopt_long::next() +Getopt_long::ok()const { + return array_index_i_ < argument_count_i_; +} - error = E_NOERROR; - while (optind < argc && !argv[optind][optindind]) { - optind++; - optindind = 0; +void +Getopt_long::next() +{ + error_ = E_NOERROR; + while (array_index_i_ < argument_count_i_ + && !arg_value_ch_a_a_[array_index_i_][argument_index_i_]) { + array_index_i_++; + argument_index_i_ = 0; } - return (optind < argc); } -char * +char const * Getopt_long::current_arg() { - if (optind >= argc) + if (array_index_i_ >= argument_count_i_) return 0; - char * a = argv[optind]; - return a + optindind; + char const * a = arg_value_ch_a_a_[array_index_i_]; + return a + argument_index_i_; } -char * +char const * Getopt_long::get_next_arg() { - char * a = current_arg(); - if ( a) { - optind ++; - optindind = 0; + char const * a = current_arg(); + if (a) { + array_index_i_ ++; + argument_index_i_= 0; } return a; } diff --git a/flower/path.cc b/flower/path.cc index bd6a6660d2..5674ca90a3 100644 --- a/flower/path.cc +++ b/flower/path.cc @@ -66,7 +66,7 @@ File_path::find(String nm)const path+= String(path.length_i()? "/":"")+nm; fdebug << path << "? "; - FILE *f = fopen(path, "r"); // ugh! + FILE *f = fopen(path.ch_C(), "r"); // ugh! if (f) { fdebug << "found\n"; fclose(f); diff --git a/init/dutch.ly b/init/dutch.ly index b3d80dc62d..0a7c423ff5 100644 --- a/init/dutch.ly +++ b/init/dutch.ly @@ -30,7 +30,7 @@ eisis = \melodic_request { -1 2 2 } feses = \melodic_request { -1 3 -2 } fes = \melodic_request { -1 3 -1 } - "f" = \melodic_request { -1 3 0 } + f = \melodic_request { -1 3 0 } fis = \melodic_request { -1 3 1 } fisis = \melodic_request { -1 3 2 } geses = \melodic_request { -1 4 -2 } @@ -97,3 +97,7 @@ } + + + +keyCminor = \key \bes \es \as; diff --git a/init/engraver.ly b/init/engraver.ly index 5fe3255194..c80d39e6fe 100644 --- a/init/engraver.ly +++ b/init/engraver.ly @@ -5,7 +5,6 @@ staff_engraver = \requesttranslator { Engraver "Engraver_group_engraver" \alias "Staff"; - \consists "Line_group_engraver"; \consists "Bar_engraver"; \consists "Clef_engraver"; \consists "Key_engraver"; @@ -14,6 +13,8 @@ staff_engraver = \requesttranslator { \consists "Staff_sym_engraver"; \consists "Collision_engraver"; \consists "Rest_collision_engraver"; + + \consists "Line_group_engraver"; \contains \requesttranslator { Engraver "Voice_group_engravers" \alias "Voice_group"; @@ -37,8 +38,10 @@ piano_staff_engraver = \requesttranslator { \alias "Hoenoemjedat"; \consists "Span_bar_engraver"; \consists "Vertical_align_engraver"; - \consists "Line_group_engraver"; \consists "Piano_bar_engraver"; + + % This should come last + \consists "Line_group_engraver"; \contains\requesttranslator { \staff_engraver } } @@ -50,6 +53,7 @@ staff_group_engraver = \requesttranslator { \consists "Line_group_engraver"; \contains\requesttranslator { \staff_engraver } } + lyric_engraver = \requesttranslator { Engraver "Engraver_group_engraver" \alias "Lyric"; @@ -68,6 +72,9 @@ orchestral_score_translator = \requesttranslator { Engraver Score_engraver \alias "Score"; + \consists "Bar_column_engraver"; + \consists "Bar_number_grav"; + \consists "Bar_align_engraver"; \consists "Clef_align_engraver"; \consists "Key_align_engraver"; @@ -76,11 +83,10 @@ orchestral_score_translator = \requesttranslator { \consists "Vertical_align_engraver"; \consists "Span_score_bar_engraver"; + \contains \requesttranslator { \staff_group_engraver } \contains \requesttranslator { \lyric_engraver } \contains \requesttranslator { \piano_staff_engraver } - - } diff --git a/init/german.ly b/init/german.ly new file mode 100644 index 0000000000..7defccdd64 --- /dev/null +++ b/init/german.ly @@ -0,0 +1,93 @@ +% +% common german names for notes. "es" means flat, "is" means sharp +% +% by Roland Meier +% based on swedish.ly by Mats Bengtsson. + + +% +% Please note that, while these names are used to enter *notes*, they +% actually are *melodic*s, i.e. they represent a pitch solely. Notes +% have a rhythmic part too. This is the reason that we don't write 'note { .. }' +% +\notenames { + ceses = \melodic_request { -1 0 -2 } + ces = \melodic_request { -1 0 -1 } + c = \melodic_request { -1 0 0 } + cis = \melodic_request { -1 0 1 } + cisis = \melodic_request { -1 0 2 } + deses = \melodic_request { -1 1 -2 } + des = \melodic_request { -1 1 -1 } + d = \melodic_request { -1 1 0 } + dis = \melodic_request { -1 1 1 } + disis = \melodic_request { -1 1 2 } + eses = \melodic_request { -1 2 -2 } + es = \melodic_request { -1 2 -1 } + e = \melodic_request { -1 2 0 } + eis = \melodic_request { -1 2 1 } + eisis = \melodic_request { -1 2 2 } + feses = \melodic_request { -1 3 -2 } + fes = \melodic_request { -1 3 -1 } + f = \melodic_request { -1 3 0 } + fis = \melodic_request { -1 3 1 } + fisis = \melodic_request { -1 3 2 } + geses = \melodic_request { -1 4 -2 } + ges = \melodic_request { -1 4 -1 } + g = \melodic_request { -1 4 0 } + gis = \melodic_request { -1 4 1 } + gisis = \melodic_request { -1 4 2 } + ases = \melodic_request { -1 5 -2 } + as = \melodic_request { -1 5 -1 } + a = \melodic_request { -1 5 0 } + ais = \melodic_request { -1 5 1 } + aisis = \melodic_request { -1 5 2 } + heses = \melodic_request { -1 6 -2 } + b = \melodic_request { -1 6 -1 } + h = \melodic_request { -1 6 0 } + his = \melodic_request { -1 6 1 } + hisis = \melodic_request { -1 6 2 } + + + % + % upper case: 1 octave lower. + % + + + Ceses = \melodic_request { -2 0 -2 } + Ces = \melodic_request { -2 0 -1 } + C = \melodic_request { -2 0 0 } + Cis = \melodic_request { -2 0 1 } + Cisis = \melodic_request { -2 0 2 } + Deses = \melodic_request { -2 1 -2 } + Des = \melodic_request { -2 1 -1 } + D = \melodic_request { -2 1 0 } + Dis = \melodic_request { -2 1 1 } + Disis = \melodic_request { -2 1 2 } + Eses = \melodic_request { -2 2 -2 } + Es = \melodic_request { -2 2 -1 } + E = \melodic_request { -2 2 0 } + Eis = \melodic_request { -2 2 1 } + Eisis = \melodic_request { -2 2 2 } + Feses = \melodic_request { -2 3 -2 } + Fes = \melodic_request { -2 3 -1 } + F = \melodic_request { -2 3 0 } + Fis = \melodic_request { -2 3 1 } + Fisis = \melodic_request { -2 3 2 } + Geses = \melodic_request { -2 4 -2 } + Ges = \melodic_request { -2 4 -1 } + G = \melodic_request { -2 4 0 } + Gis = \melodic_request { -2 4 1 } + Gisis = \melodic_request { -2 4 2 } + Ases = \melodic_request { -2 5 -2 } + As = \melodic_request { -2 5 -1 } + A = \melodic_request { -2 5 0 } + Ais = \melodic_request { -2 5 1 } + Aisis = \melodic_request { -2 5 2 } + Heses = \melodic_request { -2 6 -2 } + B = \melodic_request { -2 6 -1 } + H = \melodic_request { -2 6 0 } + His = \melodic_request { -2 6 1 } + Hisis = \melodic_request { -2 6 2 } + + +} diff --git a/init/midi.ly b/init/midi.ly index 0ee376eac4..95602c3235 100644 --- a/init/midi.ly +++ b/init/midi.ly @@ -1,6 +1,6 @@ \include "performer.ly" default_midi = \midi { - \tempo 4:60; + \tempo 4=60; \requesttranslator{ \default_midi_perf } } diff --git a/init/script.ly b/init/script.ly index 6a1c283df0..9f37993065 100644 --- a/init/script.ly +++ b/init/script.ly @@ -25,6 +25,8 @@ lfheel = \script { "fheel" 0 0 -1 0 0 } rfheel = \script { "fheel" 0 0 1 0 0 } lftoe = \script { "ftoe" 0 0 -1 0 0 } rftoe = \script { "ftoe" 0 0 1 0 0 } +turn = \script { "turn" 0 0 1 0 0 } + % % left toe: right heel: % diff --git a/init/swedish.ly b/init/swedish.ly index 22f16645e0..f679da1195 100644 --- a/init/swedish.ly +++ b/init/swedish.ly @@ -27,7 +27,7 @@ eississ = \melodic_request { -1 2 2 } fessess = \melodic_request { -1 3 -2 } fess = \melodic_request { -1 3 -1 } - "f" = \melodic_request { -1 3 0 } + f = \melodic_request { -1 3 0 } fiss = \melodic_request { -1 3 1 } fississ = \melodic_request { -1 3 2 } gessess = \melodic_request { -1 4 -2 } diff --git a/init/symbol.ly b/init/symbol.ly index 62baead466..8d84256d94 100644 --- a/init/symbol.ly +++ b/init/symbol.ly @@ -1,4 +1,4 @@ -\version "0.1.0"; +\version "0.1.1"; \include "dynamic.ly" \include "dutch.ly" @@ -8,6 +8,7 @@ % ugh \include "midi.ly" +% declarations for standard directions left = -1 right = 1 up = 1 diff --git a/init/table16.ly b/init/table16.ly index ebc9c375a4..f3fdd6de45 100644 --- a/init/table16.ly +++ b/init/table16.ly @@ -36,6 +36,7 @@ table_sixteen= "ftoe" "\ftoe" 0.0\pt 6.0\pt -1.0\pt 5.0\pt "-back" "\backorfront" 0.0\pt 6.0\pt 0.0\pt 3.0\pt "front" "\backorfront" 0.0\pt 6.0\pt 0.0\pt 3.0\pt + "turn" "\turn" -2.0\pt 7.0\pt 0.0\pt 4.0\pt } "style" = \table { diff --git a/input/beams.ly b/input/beams.ly index ff17863b40..7b18bfbf52 100644 --- a/input/beams.ly +++ b/input/beams.ly @@ -5,7 +5,7 @@ description: composer(s): heu entered-by: jcn - copyright: GPL + copyright: PD Tested Features: beams and beamflags EndMudelaHeader diff --git a/input/cadenza.ly b/input/cadenza.ly index 2201747c62..9814cad784 100644 --- a/input/cadenza.ly +++ b/input/cadenza.ly @@ -1,8 +1,9 @@ %{MudelaHeader - title: - description:Cadenza to Mozart Horn concerto 3 - composer(s):unknown - entered-by:HWN + filename: cadenza.ly + title: Cadenza ad libitum + description: Cadenza to Mozart Horn concerto 3 + composer(s): unknown + entered-by: HWN copyright: public domain Tested Features: cadenza mode @@ -10,7 +11,7 @@ EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; cad = \melodic {\id "Staff" "french horn"; @@ -42,7 +43,7 @@ cad = \melodic {\id "Staff" "french horn"; r8 'a ['b cis] \duration 16; [d cis d e] f4~ [f e d c] - 'b4 + 'b4-\turn \octave c'; [2/3 d'8 c'8 a8]1/1 g2 \bar "" ; @@ -51,15 +52,15 @@ cad = \melodic {\id "Staff" "french horn"; \bar "" ; [g8.(_"a tempo" e g8. )e] a4. g8 [f8 e8 d8 c8] - 'g2 d2^"tr" + 'g2 d2^"\tr" c4 } \score { \melodic { \cad } \paper { - unitspace= 14.0\mm; + unitspace= 16.0\mm; geometric= 1.4; } - \midi { \tempo 4:90; } + \midi { \tempo 4 = 90; } } diff --git a/input/collisions.ly b/input/collisions.ly index d281dc0e74..2a9505752b 100644 --- a/input/collisions.ly +++ b/input/collisions.ly @@ -10,7 +10,7 @@ Tested Features:test the Collision resolution EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; diff --git a/input/coriolan-alto.ly b/input/coriolan-alto.ly index ac772fdf9f..8dc5c69796 100644 --- a/input/coriolan-alto.ly +++ b/input/coriolan-alto.ly @@ -17,7 +17,7 @@ EndMudelaHeader % (maybe even sooner :-) % -\version "0.0.58"; +\version "0.1.1"; alto = \melodic{ diff --git a/input/gallina.ly b/input/gallina.ly new file mode 100644 index 0000000000..08f9b997b0 --- /dev/null +++ b/input/gallina.ly @@ -0,0 +1,232 @@ +%{ +From mats.bengtsson@s3.kth.seThu Aug 14 02:11:19 1997 +Date: Wed, 13 Aug 1997 18:24:53 +0200 +From: Mats Bengtsson +To: Han-Wen Nienhuys +Subject: Re: brevis? + +[snip] + +Here comes a sample score where I've tried to fiddle around with different +spacing parameters to get a decent layout, but it still looks quite strange. +For example is the second half of the bar more spread out than the first +half in many cases. +Hopefully it could be useful input to future improvements. I've entered the +music directly from the 1637 manuscript and intend to publish it public +domain on for example ftp.gmd.de when finished. You could include it as an +example in the distribution, but in that case I could add a LaTeX title file. +There were no beams in the manuscript so I didn't use them in this edition +either. + + /Mats + +-------------------------------------------------- +%} +%{ + title: La Gallina a 2 violini + date: 1637 + source: the manuscript of Canzoni overo Sonate Concertate + libro terzo, opera duodecima + composer(s): Tarquinio Merula (?-?) + entered-by: Mats Bengtsson + copyright: Public Domain + + + Tested Features: Note placement, multipart score, figured base + +%} + +vi1=\melodic{ + \meter 4/4; + \octave c''; + + d8 d d d d4 A16 B c A | + B8 G G G16 A B8 G G G16 A | + B8 G G A16 B c4 B | + A8 D G4. Fis16 E Fis4 | + G2 r2 | + r1 | + d8 d d d d4 A16 B c A | + B8 G G G16 A B8 G G G16 A | + B8 G G A16 B c8 e d c | + B G c2 B4 | + c2 r | + r1 | + g8 g g g g4 d16 e f d | + e8 c c c16 d e8 c c c16 d | + e8 c c d16 e f4 e | + d8 G c2 B4 | + c8 G G G16 A B4 G | + r8 G G G16 A B4 G | + r8 E16 Fis G8 G Fis G G Fis| + G2 r | + r1 | + r16 d c B A G Fis E D8 d d d16 c | + B8 d d d16 c B8 d d d16 e | + fis4 g2 fis4 | + r16 g f e d c B A G8 g g g16 f | + e8 g g g16 f e8 g g g16 a | + b4 c'2 b4 | + c'8 g g g16 f e4 d | + r8 g g g16 f e4 d | + r8 d16 A B8 B16 c A2 | + B1 | + \meter 3/2; + r4 d d d d d | + e1. | + r4 c c c c c | + d1. | + r4 d8 c B4 c8 d G4 A8 B | + E1. | + r4 e8 d cis4 d8 e A4 B8 cis | + Fis1. | + r4 d d d d d | + e e8 d c4 d8 e A4 B8 c | + Fis4 fis8 e d4 e8 fis B4 c8 d | + G4 g g g g g | + a4 c'8 b a4 b8 c' f4 g8 a | + d4 g g g g g | + a d8 c B4 c8 d A2 | + \meter 4/4; + B1 | + d8 d d d d4 A16 B c A | + B8 G G G16 A B8 G G G16 A | + B8 G c2 B4 | + c2 r | + g8 g g g g4 d16 e f d | + e8 G G G16 A B8 d d d16 e | + fis4 g2 fis4 | + r16 g f e d c B A G8 g g g16 f | + e2 r8 d d d16 e | + fis a g fis e d c B A8 d d d16 e | + fis4 g2 fis4 | + g1 + \bar "|."; +} + +vi2=\melodic{ + \meter 4/4; + \octave c''; + + r1 | r | r | + d8 d d d d4 A16 B c A | + B8 G G G16 A B8 G G G16 A | + B8 G G A16 B c4 B | + A8 D G4. Fis16 E Fis4 | + G2 r2 | + r1 | + g8 g g g g4 d16 e f d | + e8 c c c16 d e8 c c c16 d | + e8 c c d16 e f4 e | + d8 G c2 B4 | + c2 r | + r1 | + g8 g g g g4 d16 e f d | + e2 r8 G G G16 A | + B4 G r8 G G A16 B + c4 B A2 | + G r16 d c B A G Fis E | + D8 d d d16 c B8 d d d16 e | + fis4 g g4. fis8 | + g2 r | + r16 d c B A G Fis E D8 d d d16 c | + B4 c2 B4 | + c d G2 | + r16 g f e d c B A G8 g g g16 f | + e4 d r8 g g g16 f | + e4 d r8 c16 G B8 B16 c | + A4 G2 Fis4 | + G1 | + \meter 3/2; + r1. | + r4 g8 f e4 f8 g c4 d8 e | + A1. | + r4 a8 g fis4 g8 a d4 e8 fis | + B1. | + r4 g g g g g | + a1. | + r4 a a a a a | + b d8 c B4 c8 d G4 A8 B | + E4 g8 f e4 f8 g c4 d8 e | + A4 a8 g fis4 g8 a d4 e8 fis | + B4 b8 a g4 a8 b e4 fis8 g | + c4 A A A A A | + B d8 c B4 c8 d D4 E | + Fis2 G Fis | + \meter 4/4; + G1 | + r1 | r1 | + g8 g g g g4 d16 e f d | + e8 c c c16 d e8 G G G16 A | + B8 G c2 B4 | + c2 r | + r16 d c B A G Fis E D8 d d d16 c | + B4 c2 B4 | + c8 G G G16 A B d c B A G Fis E | + D8 d d d16 e fis16 a g fis e d c B | + A d c B A G Fis E D4 d | + B1 + \bar "|."; +} + +bc=\melodic{ + \clef "bass"; + \meter 4/4; + \octave c; + + G2 d^"4 3" | G1 | + g2 c4 G | d1^"3 4 3" | + G1 | g2 c4 G | + d1^"3 4 3" | G | + g2 c4 d | G1^"3 4 3" | + c1 | c2 F4 c | + G1^"3 4 3" | c | + c2 F4 c | G1^"3 4 3" | + c2 G | g G | + c4 G d2^"3 4 3" | G g | + fis g | d1^"3 4 3" | + G2 B | d1^"3 4 3" | + G^"3 4 3" | c4 B c2 | + G1^"3 4 3" | c4 B c g | + c B c G | d1^"3 4 3" | + G1 | + \meter 3/2; + g1. | c | + f | d^"\sharp" | + g | c | + A | d^"\sharp" | + G | c | + d^"\sharp" | e | + f | g1 B2 | + d1.^"3 4 3" | + \meter 4/4; + G1 | + g2 fis | g G | + g1^"3 4 3" | c | + G^"3 4 3" | c2 G | + d1^"3 4 3" | G^"3 4 3" | + c2 G | d1^"\sharp" ( | + ) d^"3 4 3" | G | + \bar "|."; +} + +\score{ + < \multi 3; + \vi1 + \vi2 + \bc + > + \paper{ + geometric=1.2; + unitspace=8.\mm; + linewidth=18.\cm; + gourlay_maxmeasures=4.; + gourlay_energybound = 70000.; + basicspace = 2.8\pt; + } +} + + + + + diff --git a/input/header.ly b/input/header.ly index 3baaadf9e1..71b146c913 100644 --- a/input/header.ly +++ b/input/header.ly @@ -2,12 +2,16 @@ filename: title: + date: description: + opus: + source: composers: entered-by: copyright: - + remarks: Tested Features: + EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; diff --git a/input/keys.ly b/input/keys.ly index 45237a2d7e..5d79a70223 100644 --- a/input/keys.ly +++ b/input/keys.ly @@ -10,7 +10,7 @@ Tested Features: local key, key, forced accidentals EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; blah = \melodic{ diff --git a/input/kortjakje.ly b/input/kortjakje.ly index 0ba3de2f78..6f0451ef6f 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -5,12 +5,12 @@ description: bare bones version. (written down from memory :-) composers: Mozart, KV 265 entered-by: HWN - copyright: none + copyright: PD Tested Features: example file with comments EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; % the % is a comment. diff --git a/input/multi.ly b/input/multi.ly index 141d191a9e..90ce751c7a 100644 --- a/input/multi.ly +++ b/input/multi.ly @@ -12,7 +12,7 @@ EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; \score{ \melodic diff --git a/input/pedal.ly b/input/pedal.ly index da3290ec44..76ef376884 100644 --- a/input/pedal.ly +++ b/input/pedal.ly @@ -24,7 +24,7 @@ % \lbheel \lbheel \lfheel \lftoe % \rbheel \rbtoe \rfheel \rftoe -\version "0.1.0"; +\version "0.1.1"; \score{ \melodic { diff --git a/input/rhythm.ly b/input/rhythm.ly index a321ca34a7..a2ab538381 100644 --- a/input/rhythm.ly +++ b/input/rhythm.ly @@ -14,7 +14,7 @@ EndMudelaHeader -\version "0.1.0"; +\version "0.1.1"; ritme = \melodic{ %\octave ; \partial 8; diff --git a/input/rock.ly b/input/rock.ly deleted file mode 100644 index b6434ab2b8..0000000000 --- a/input/rock.ly +++ /dev/null @@ -1,4 +0,0 @@ - -mel = \melodic { - [c8 c32 c16] -} diff --git a/input/scales.ly b/input/scales.ly index 0e30979237..f69bc1b650 100644 --- a/input/scales.ly +++ b/input/scales.ly @@ -15,7 +15,7 @@ EndMudelaHeader % scales with accents. % -\version "0.1.0"; +\version "0.1.1"; blah = \melodic { \meter 6/8; \octave 'c ; diff --git a/input/scripts.ly b/input/scripts.ly index 51d8a9093f..8e005edee9 100644 --- a/input/scripts.ly +++ b/input/scripts.ly @@ -10,7 +10,7 @@ Tested Features: scripts, text. EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; blah = \melodic { diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 1c69f21f99..35ba9023f2 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -3,6 +3,8 @@ filename: scsii-menuetto.ly title: Solo Cello Suites, Suite II part V, Menuetto I description: Cello suite transcribed for Viola + source: ? + opus: BWV 1008 no. 5 composers: Johann Sebastian Bach (1685-1750) entered-by: JCN copyright: public domain @@ -13,7 +15,7 @@ EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; %% Stuff from MPP version % \lefttitle{Menuetto} @@ -111,7 +113,7 @@ IImenuetto = \melodic{ \output "scsii-menuetto.out"; } \midi{ - \tempo 4:120; + \tempo 4 = 120; \output "scsii-menuetto.midi"; } } diff --git a/input/slurs.ly b/input/slurs.ly index 87223a1b04..b49616ff9e 100644 --- a/input/slurs.ly +++ b/input/slurs.ly @@ -5,13 +5,13 @@ description: composer(s): HWN entered-by: HWN - copyright: GPL + copyright: PD Tested Features: test slurs and ties EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; \score{ \melodic{\octave c'; diff --git a/input/standchen.ly b/input/standchen.ly index 1769e18564..58d1dd27c1 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -2,18 +2,18 @@ filename: standchen.ly title: St\"andchen (Serenade) "Leise flehen meine Lieder" - description: D.957 No.4 + opus: D. 957 No. 4 composers: Franz Schubert (1797-1828) Text by Ludwig Rellstab (1799-1860) entered-by:JCN - copyright: + copyright: public domain Tested Features: multivoice, accents, lyrics, chords, piano music EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; commands = \melodic{ \skip 2.*4; @@ -152,8 +152,11 @@ melodie = \melodic{ %%48 \textstyle "italic"; < - { fis2.~ \group "+1"; \stem \down; f2. } - { d'2. ~ \stem \up; d'4 r4_"decresc." d'4 } + { fis2.~ + %\group "+1"; + \stem \down; f2. } + { d'2. ~ \stem \up; + d'4 r4_"decresc." d'4 } > \textstyle "roman"; | %%50 @@ -485,6 +488,6 @@ tekstII = \lyric{ \output "standchen.out"; } \midi{ - \tempo 4:54; + \tempo 4 = 54; } } diff --git a/input/toccata-fuga-E.ly b/input/toccata-fuga-E.ly index a1d59b84c9..828796f9d0 100644 --- a/input/toccata-fuga-E.ly +++ b/input/toccata-fuga-E.ly @@ -1,14 +1,14 @@ %{MudelaHeader filename: toccata-fuga-E.ly - title: toccata and fuga in E-major bwv 566 - description: + title: toccata and fuga in E-major + opus: BWV 566 toccata: 3 bar excerpt 2nd fuga: transposed subject --- 4 bar excerpt composers: Johann Sebastian Bach (1685-1750) entered-by: JCN - copyright: + copyright: public domain Tested Features: purpose of this file is testing: @@ -20,7 +20,7 @@ EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; toccata_commands = \melodic{ \meter 4/4; @@ -72,6 +72,7 @@ fuga2_commands = \melodic{ fuga2_right = \melodic{ \$fuga2_commands + \clef violin; % 15 \octave c'; <\multi 2; @@ -151,7 +152,7 @@ break = \melodic{ > \paper{} \midi{ - \tempo 4:96; + \tempo 4 = 96; } } diff --git a/input/twinkle-pop.ly b/input/twinkle-pop.ly new file mode 100644 index 0000000000..41561e6a44 --- /dev/null +++ b/input/twinkle-pop.ly @@ -0,0 +1,47 @@ +%{MudelaHeader + + filename: twinkle.ly + title: Ah, vous dirais-je, maman + description: twinkle twinkle in pop-song-settings + composers: traditional + + entered-by: HWN, chords by Johan Vromans + copyright: public domain + + Tested Features: lyrics and chords +EndMudelaHeader +%} + +\version "0.1.1"; + +melodie = \melodic { + \clef"violin"; + \meter 2/4 ; + \octave c'; + + c4^"C" c | g g | a^"F" a | g2^"C" | + f4^"F" f | e^"C" e | d^"G7" d | c2^"C" | + g4^"G" g | f^"F" f | e^"C" e | d^"G7" d | + g^"G" g | f^"F" f | e^"C" e | d^"G7" d | + c4^"C" c | g g | a^"F" a | g2^"C" | + f4^"F" f | e^"C" e | d^"G7" d | c2^"C" | +} + +texte = \lyric{ + + \textstyle "italic"; + Ah!4 vous dir- ai_- je ma man2 + Ce4 qui cau- se mon tour- ment2 + Pa-4 pa veut que je rai- so- nne + Comme4 un- e grand- e per- so- nne + Moi4 je dis que les bon- bons2 + Val-4 ent mieux que la rai- son2 + +} + +\score { + < \melodic < \id "Piano" ""; \melodie > + \lyric < \id "Lyric" ""; \texte > + > + \paper { unitspace= 2.5\cm; } +} diff --git a/input/twinkle.ly b/input/twinkle.ly index 4835e7783a..ba47c25d35 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -3,18 +3,19 @@ filename: twinkle.ly title: twinkle twinkle little star description: + traditional song in various languages. "Ah, vous dirais-je, maman" "Altijd is Kortjakje ziek" "Twinkle twinkle little star" - composers: ? + composers: Traditional entered-by: HWN & JCN copyright: public domain Tested Features: lyrics EndMudelaHeader %} -\version "0.1.0"; +\version "0.1.1"; melody = \melodic{ \clef violin; @@ -32,7 +33,7 @@ melody = \melodic{ accompany = \melodic { \clef "bass"; - \octave'c; + \octave 'c; \duration 4; c4 c' | e' c' | f' c' | e' c' | d' b | c' a | f g | c2 | @@ -60,6 +61,12 @@ tekst = \lyric{ midden4 in_de week maar s'_zon- dags niet.2 } +%{ + +Ja inderdaad. Dit is geen educatieve danwel muzikaal verantwoorde +tekst. Mogen wij ook af en toe ergens op afgeven? + +%} hegedraagjetekst = \lyric{ Al-4 tijd zuigt Bill Gates mijn piek,2 "\TeX"4 is slecht- ser dan mu- ziek.2 @@ -125,7 +132,7 @@ textiii = \lyric{ % ugh \lyric < \id "Lyric" "1"; - \global \tekst \hegedraagjetekst > + \global \tekst > \lyric < \id "Lyric" "2"; \global \texte > \lyric < \id "Lyric" "3"; \global @@ -136,7 +143,7 @@ textiii = \lyric{ unitspace= 2.5\cm; } \midi{ - \tempo 4:120 ; + \tempo 4 = 120 ; } } diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index 6807b651d5..b3c6234a82 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -1,7 +1,10 @@ %{ - title: Das Wohltemperirte Clavier I, Fuga II (c-minor) - description: following Henle's Urtext - composer(s): J.S. Bach + filename: wohltemperirt.ly + title: Fuga a 3 + description: Das Wohltemperirte Clavier I, Fuga II (c-minor) + Opus: BWV ? + source: Henle's Urtext + composer(s): Johann Sebastian Bach (1685-1750) entered-by: HWN and Werner Lemberg copyright: Public Domain @@ -9,7 +12,7 @@ %} -\version "0.1.0"; +\version "0.1.1"; % should add \need{dutch.ini} for % correct parsing of note names @@ -17,7 +20,7 @@ global = \melodic { \meter 4/4; % should be \meter C - \key bes es as; + \keyCminor } dux = @@ -173,11 +176,9 @@ bassdux = > > - \paper{ -% castingalgorithm=0.; - } + \paper{} \midi { - \tempo 4:84; + \tempo 4 = 84; } } diff --git a/lib/Makefile b/lib/Makefile index 1fbb2d83c2..9538b989ae 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -52,7 +52,7 @@ LOADLIBES += # MAINTARGET = $(bindir)/$(EXECUTABLE)# huh? MAINTARGET = $(outdir)/$(LIBRARY)# huh? -default: $(MAINTARGET) +default: configheader $(MAINTARGET) # localclean: @@ -68,3 +68,10 @@ include ./$(depth)/make/Rules.make -include $(DEPFILES) # +.PHONY: configheader + +configheader: $(outdir)/config.hh + +# Ugh ugh +$(outdir)/config.hh: config.hh.in + sed 's!@datadir@!$(datadir)!'< $< > $@ diff --git a/lib/binary-source-file.cc b/lib/binary-source-file.cc index c2e3c152be..666012f0c6 100644 --- a/lib/binary-source-file.cc +++ b/lib/binary-source-file.cc @@ -34,7 +34,7 @@ Binary_source_file::error_str( char const* pos_ch_c_l ) return ""; char const* begin_ch_c_l = pos_ch_c_l - 8 >? ch_C(); - char const* end_ch_c_l = pos_ch_c_l + 7 + Jan Nieuwenhuizen */ #include #include "duration-convert.hh" @@ -115,9 +116,7 @@ Duration_convert::mom2standardised_dur( Moment mom ) // if ( !dur_array_s.length_i() ) if ( !dur_array_s.size() ) set_array(); -// assert( dur_array_s.length_i() ); assert( dur_array_s.size() ); -// for ( int i = 0; i < dur_array_s.length_i() - 1; i++ ) { for ( int i = 0; i < dur_array_s.size() - 1; i++ ) { Moment lower_mom = dur2_mom( dur_array_s[ i ] ); if ( mom <= lower_mom ) { @@ -125,22 +124,18 @@ Duration_convert::mom2standardised_dur( Moment mom ) // kinda ok if ( i || ( mom / lower_mom > Moment( 3, 4 ) ) ) return dur_array_s[ i ]; - else - return Duration( 0 ); + else { + Duration d; + d.type_i_ = 0; + return d; + } } Moment upper_mom = dur2_mom( dur_array_s[ i + 1 ] ); -#if 0 // % deviation of upper/lower from mom, perhaps it's better to use - if ( ( mom < upper_mom ) - && ( ( mom - lower_mom ) / mom - < ( upper_mom - mom ) / mom ) ) -#else // % deviation of mom from lower/upper? if ( ( mom < upper_mom ) && ( ( mom - lower_mom ) / lower_mom < ( upper_mom - mom ) / upper_mom ) ) -#endif return dur_array_s[ i ]; } -// return dur_array_s[ dur_array_s.length_i() ]; return dur_array_s[ dur_array_s.size() - 1 ]; } diff --git a/lib/duration.cc b/lib/duration.cc index 8c08c12802..fab55e756c 100644 --- a/lib/duration.cc +++ b/lib/duration.cc @@ -3,9 +3,8 @@ source file of the LilyPond music typesetter - copyright 1997 Jan Nieuwenhuizen - - (c) 1997 Han-Wen Nienhuys + (c) 1997 Jan Nieuwenhuizen + Han-Wen Nienhuys */ #include "proto.hh" @@ -21,12 +20,10 @@ int Duration::division_1_i_s = 384 * 4; -Duration::Duration( int type_i, int dots_i = 0) +Duration::Duration() { -// this breaks mi2mu quite effectively -// assert(duration_type_b(type_i)); - type_i_ = type_i; - dots_i_ = dots_i; + type_i_ = 1; + dots_i_ = 0; ticks_i_ = 0; } @@ -85,12 +82,6 @@ Plet::Plet() iso_i_ = 1; } -Plet::Plet( int iso_i, int type_i ) -{ - iso_i_ = iso_i; - type_i_ = type_i; -} - Moment Plet::mom()const { diff --git a/lib/file-storage.cc b/lib/file-storage.cc new file mode 100644 index 0000000000..16bee29c68 --- /dev/null +++ b/lib/file-storage.cc @@ -0,0 +1,98 @@ +/* + file-storage.cc -- implement Mapped_file_storage + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys + Jan Nieuwenhuizen +*/ +#include // open, mmap +#include // open +#include // mmap +#include // INT_MAX +#include // open +#include // close, stat +#include // fdopen +#include // strerror +#include // errno + + + +#include "string.hh" +#include "proto.hh" +#include "warn.hh" +#include "file-storage.hh" + +Mapped_file_storage::Mapped_file_storage(String s) +{ + data_caddr_ = 0; + fildes_i_ = 0; + size_off_ = 0; + open(s); +} + +char const* +Mapped_file_storage::ch_C()const +{ + return (char const*)data_caddr_; +} + +void +Mapped_file_storage::map() +{ + if ( fildes_i_ == -1 ) + return; + + data_caddr_ = (caddr_t)mmap( (void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0 ); + + if ( (int)data_caddr_ == -1 ) + warning( String( "can't map: error no: " ) + strerror( errno )); +} + + +void +Mapped_file_storage::open(String name_str) +{ + fildes_i_ = ::open( name_str, O_RDONLY ); + + if ( fildes_i_ == -1 ) { + warning( String( "can't open: " ) + name_str + String( ": " ) + strerror( errno )); + return; + } + + struct stat file_stat; + fstat( fildes_i_, &file_stat ); + size_off_ = file_stat.st_size; + map(); +} + +void +Mapped_file_storage::unmap() +{ + if ( data_caddr_ ) { + munmap( data_caddr_, size_off_ ); + data_caddr_ = 0; + size_off_ = 0; + } +} + +void +Mapped_file_storage::close() +{ + unmap(); + if ( fildes_i_ ) { + ::close( fildes_i_ ); + fildes_i_ = 0; + } +} + +int +Mapped_file_storage::length_i()const +{ + return size_off_; +} + +Mapped_file_storage::~Mapped_file_storage() +{ + close(); +} diff --git a/lib/include/duration.hh b/lib/include/duration.hh index c8554f343a..c46fc5a7c0 100644 --- a/lib/include/duration.hh +++ b/lib/include/duration.hh @@ -18,11 +18,12 @@ // ugh, to get me in lily lib extern bool no_triplets_bo_g; -/** (plet) - The type and replacement value of a plet (triplet, quintuplet.) Conceptually the same as a rational, but 4/6 != 2/3 +/** + The type and replacement value of a plet (triplet, quintuplet.) Conceptually the same as a rational, but 4/6 != 2/3. + + (plet) */ struct Plet { - Plet( int replace_i, int type_i ); Plet(); Moment mom()const; bool unit_b()const; @@ -39,7 +40,7 @@ struct Duration { /** Ctor of Duration. type_i should be a power of 2. */ - Duration( int type_i = 1, int dots_i = 0); + Duration(); /// is the "plet factor" of this note != 1 ? bool plet_b(); String str()const; diff --git a/lib/include/file-storage.hh b/lib/include/file-storage.hh new file mode 100644 index 0000000000..850046236c --- /dev/null +++ b/lib/include/file-storage.hh @@ -0,0 +1,62 @@ +/* + file-storage.hh -- declare File_storage, Mapped_file_storage, Simple_file_storage + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef FILE_STORAGE_HH +#define FILE_STORAGE_HH + +#include "proto.hh" + +/** + store a file in-memory. + */ +class File_storage +{ +public: + virtual char const* ch_C()const=0; + virtual int length_i()const=0; + virtual ~File_storage(){} +}; + +/** + Use mmap to "copy" a file into memory + */ +class Mapped_file_storage:public File_storage +{ +public: + Mapped_file_storage(String); +protected: + virtual char const* ch_C()const; + virtual int length_i()const; + virtual ~Mapped_file_storage(); +private: + void open(String name); + void close(); + + void map(); + void unmap(); + int fildes_i_; + off_t size_off_; + caddr_t data_caddr_; +}; + +/** + read file char by char and copy into a malloc array. + */ +class Simple_file_storage : public File_storage +{ + char * data_p_; + int len_i_; +protected: + virtual char const*ch_C()const; + virtual int length_i()const; + virtual ~Simple_file_storage(); +public: + Simple_file_storage(String); +}; +#endif // FILE_STORAGE_HH diff --git a/lib/include/proto.hh b/lib/include/proto.hh index 17a7b341a8..21cadf9b79 100644 --- a/lib/include/proto.hh +++ b/lib/include/proto.hh @@ -14,4 +14,7 @@ struct Duration; struct Duration_iterator; struct Source_file; struct Sources; +struct File_storage; +struct Mapped_file_storage; +struct Simple_file_storage; #endif // PROTO_HH diff --git a/lib/include/source-file.hh b/lib/include/source-file.hh index 6fdcc5d88a..39cd533e41 100644 --- a/lib/include/source-file.hh +++ b/lib/include/source-file.hh @@ -5,9 +5,13 @@ #ifndef SOURCE_FILE_HH #define SOURCE_FILE_HH -#include "fproto.hh" + +#include "proto.hh" #include "string.hh" + class istream; + + /// class for reading and mapping a file. class Source_file { @@ -17,26 +21,19 @@ public: Source_file( String filename_str_r ); virtual ~Source_file(); - char const* ch_C(); - virtual String error_str( char const* pos_ch_c_l ); + char const* ch_C()const; + virtual String error_str( char const* pos_ch_c_l )const; istream * istream_l(); - bool in_b( char const* pos_ch_c_l ); - off_t length_off(); - virtual int line_i( char const* pos_ch_c_l ); - String name_str(); - String file_line_no_str( char const* ch_c_l ); + bool in_b( char const* pos_ch_c_l )const; + int length_i()const; + virtual int line_i( char const* pos_ch_c_l )const; + String name_str()const; + String file_line_no_str( char const* ch_c_l )const; private: - void close(); - void map(); - void open(); - void unmap(); - - istream* istream_p_; - int fildes_i_; String name_str_; - off_t size_off_; - caddr_t data_caddr_; + istream* istream_p_; + File_storage * storage_p_; }; #endif // SOURCE_FILE_HH // diff --git a/lib/include/source.hh b/lib/include/source.hh index bc4a859c0a..9d443ed0db 100644 --- a/lib/include/source.hh +++ b/lib/include/source.hh @@ -14,6 +14,7 @@ public: void set_path(File_path*p_C); Sources(); void set_binary(bool); + ~Sources(); private: const File_path * path_C_; void add( Source_file* sourcefile_p ); diff --git a/lib/simple-file-storage.cc b/lib/simple-file-storage.cc new file mode 100644 index 0000000000..be022cee02 --- /dev/null +++ b/lib/simple-file-storage.cc @@ -0,0 +1,63 @@ +/* + simple-file-storage.cc -- implement Simple_file_storage + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include + +#include "file-storage.hh" +#include "varray.hh" +#include "string.hh" +#include "warn.hh" + +/** + Stupid but foolproof way of opening files. + + TODO + Should use obstack. Should check IO status + + This is of course a build it yourself version of mmap, so we should + have been using that... (see Mapped_file_storage) But we noticed + some problems with this (unexplained lexer crashes) + + */ + +Simple_file_storage::Simple_file_storage(String s) +{ + data_p_ =0; + FILE * f = fopen ( s.ch_C(), "r"); + if ( !f ) { + warning("can't open file\n"); + return ; + } + + int ret = fseek( f, 0, SEEK_END); + len_i_ = ftell(f); + rewind(f); + data_p_ = new char[len_i_+1]; + data_p_[len_i_] = 0; + ret = fread(data_p_, sizeof(char), len_i_, f); + assert (ret==len_i_); + fclose(f); +} + +char const* +Simple_file_storage::ch_C() const +{ + return data_p_; +} + +int +Simple_file_storage::length_i()const +{ + return len_i_; +} + + +Simple_file_storage::~Simple_file_storage() +{ + delete []data_p_; +} diff --git a/lib/source-file.cc b/lib/source-file.cc index 8f28f9b5f5..ffc7a341ed 100644 --- a/lib/source-file.cc +++ b/lib/source-file.cc @@ -1,50 +1,40 @@ -// -// source-file.cc -// - -#include // open, mmap -#include // open -#include // mmap -#include // INT_MAX -#include // open -#include // close, stat -#include // fdopen -#include // strerror -#include // errno +/* + source-file.cc -- implement + + source file of the GNU LilyPond music typesetter + + (c) 1997 Jan Nieuwenhuizen + & Han-Wen Nienhuys +*/ + + #include #include #include "string.hh" #include "proto.hh" #include "plist.hh" - - #include "warn.hh" #include "windhoos-suck-suck-suck-thank-you-cygnus.hh" - #include "source-file.hh" +#include "file-storage.hh" Source_file::Source_file( String filename_str ) { - data_caddr_ = 0; - fildes_i_ = 0; - size_off_ = 0; name_str_ = filename_str; istream_p_ = 0; - - open(); - if ( fildes_i_ > 0 ) - map(); + storage_p_ = new Simple_file_storage(filename_str); } istream* Source_file::istream_l() { - if ( !fildes_i_ ) + if ( !name_str_.length_i()) return &cin; + if ( !istream_p_ ) { - if ( size_off_ ) // can-t this be done without such a hack? - istream_p_ = new istrstream( ch_C(), size_off_ ); + if ( length_i() ) // can-t this be done without such a hack? + istream_p_ = new istrstream( ch_C(), length_i() ); else { istream_p_ = new istrstream( "", 0 ); istream_p_->set(ios::eofbit); @@ -53,35 +43,29 @@ Source_file::istream_l() return istream_p_; } -Source_file::~Source_file() +String +Source_file::file_line_no_str(char const *ch_C )const { - delete istream_p_; - istream_p_ = 0; - unmap(); - close(); + return name_str() + ": " + + String( line_i( ch_C ) ); } -char const* -Source_file::ch_C() +String +Source_file::name_str()const { - assert( this ); - return (char const*)data_caddr_; + return name_str_; } - -void -Source_file::close() +Source_file::~Source_file() { - if ( fildes_i_ ) { - ::close( fildes_i_ ); - fildes_i_ = 0; - } + delete istream_p_; + istream_p_ = 0; + delete storage_p_; } - String -Source_file::error_str( char const* pos_ch_C ) +Source_file::error_str( char const* pos_ch_C )const { char const* data_ch_C = ch_C(); - char const * eof_C_ = data_ch_C + size_off_; + char const * eof_C_ = data_ch_C + length_i(); if ( !in_b( pos_ch_C ) ) return "(position unknown)"; @@ -121,19 +105,14 @@ Source_file::error_str( char const* pos_ch_C ) } bool -Source_file::in_b( char const* pos_ch_C ) +Source_file::in_b( char const* pos_ch_C )const { - return ( pos_ch_C && ( pos_ch_C >= ch_C() ) && ( pos_ch_C <= ch_C() + size_off_ ) ); + return ( pos_ch_C && ( pos_ch_C >= ch_C() ) && ( pos_ch_C <= ch_C() + length_i() ) ); } -off_t -Source_file::length_off() -{ - return size_off_; -} int -Source_file::line_i( char const* pos_ch_C ) +Source_file::line_i( char const* pos_ch_C )const { if ( !in_b( pos_ch_C ) ) return 0; @@ -146,56 +125,14 @@ Source_file::line_i( char const* pos_ch_C ) return i; } -void -Source_file::map() -{ - if ( fildes_i_ == -1 ) - return; - - data_caddr_ = (caddr_t)mmap( (void*)0, size_off_, PROT_READ, MAP_SHARED, fildes_i_, 0 ); - - if ( (int)data_caddr_ == -1 ) - warning( String( "can't map: " ) + name_str_ + String( ": " ) + strerror( errno )); -} - -String -Source_file::name_str() -{ - return name_str_; -} - -void -Source_file::open() +int +Source_file::length_i()const { - if ( !name_str_.length_i() || ( name_str_ == "-" ) ) { - fildes_i_ = 0; - return; - } - - fildes_i_ = ::open( name_str_, O_RDONLY ); - - if ( fildes_i_ == -1 ) { - warning( String( "can't open: " ) + name_str_ + String( ": " ) + strerror( errno )); - return; - } - - struct stat file_stat; - fstat( fildes_i_, &file_stat ); - size_off_ = file_stat.st_size; + return storage_p_->length_i(); } -void -Source_file::unmap() +char const * +Source_file::ch_C()const { - if ( data_caddr_ ) { - munmap( data_caddr_, size_off_ ); - data_caddr_ = 0; - size_off_ = 0; - } -} -String -Source_file::file_line_no_str(char const *ch_C ) -{ - return name_str() + ": " - + String( line_i( ch_C ) ); + return storage_p_->ch_C(); } diff --git a/lib/source.cc b/lib/source.cc index 6be3ca42fc..ec490f17e7 100644 --- a/lib/source.cc +++ b/lib/source.cc @@ -72,3 +72,6 @@ Sources::sourcefile_l( char const* ch_C ) return *sourcefile_l_pcur; return 0; } + +Sources::~Sources() +{} diff --git a/lily/Makefile b/lily/Makefile index 1cee326a74..16f59f5d5c 100644 --- a/lily/Makefile +++ b/lily/Makefile @@ -37,7 +37,7 @@ EXTRA_DISTFILES = VERSION # list of custom libraries: # -MODULE_LIBDEPS= check-flower-deps check-lily-deps +MODULE_LIBDEPS= check-flower-deps check-lib-deps MODULE_LIBES= -llily -lflower # @@ -70,3 +70,8 @@ localinstall: installexe localuninstall: uninstallexe $(outdir)/lily-version.o: $(outdir)/version.hh + +# make config.hh. Ugh +$(outdir)/main.o: $(libout)/config.hh + +$(libout)/config.hh: check-lib-deps diff --git a/lily/Stable.make b/lily/Stable.make index 885745a247..c6d2ee88d9 100644 --- a/lily/Stable.make +++ b/lily/Stable.make @@ -1,10 +1,10 @@ # kept in dist bo stripping stable stuff, still to copy... # a bit of a hack to keep exec size under control. -stablecc=atom.cc command-request.cc musical-request.cc bar.cc boxes.cc \ +stablecc=atom.cc bar.cc boxes.cc \ keyword.cc leastsquares.cc \ lookup.cc meter.cc\ - parser.cc \ + parser.cc notename-table.cc lexer.cc\ qlp.cc qlpsolve.cc\ - template*.cc template6.cc version.cc tex-stream.cc tex.cc\ + template*.cc version.cc tex-stream.cc tex.cc\ identifier.cc note.cc diff --git a/lily/VERSION b/lily/VERSION index 013490db64..c04453cdaa 100644 --- a/lily/VERSION +++ b/lily/VERSION @@ -1,6 +1,6 @@ MAJOR_VERSION = 0 MINOR_VERSION = 1 -PATCH_LEVEL = 1 +PATCH_LEVEL = 7 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/lily/atom.cc b/lily/atom.cc index f90625a25f..0d8eb44f44 100644 --- a/lily/atom.cc +++ b/lily/atom.cc @@ -13,12 +13,12 @@ #include "varray.hh" #include "debug.hh" - - void Atom::print() const { +#ifndef NPRINT mtor << "texstring: " < a; - a.push(print_dimen(off_.y)); - a.push(print_dimen(off_.x)); + a.push(print_dimen(off_.y())); + a.push(print_dimen(off_.x())); a.push(sym_.tex); return substitute_args(s, a); } diff --git a/lily/audio-element.cc b/lily/audio-element.cc new file mode 100644 index 0000000000..6ab6c02d58 --- /dev/null +++ b/lily/audio-element.cc @@ -0,0 +1,13 @@ +/* + audio-element.cc -- implement Audio_element + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "audio-element.hh" + +IMPLEMENT_IS_TYPE_B(Audio_element); +Audio_element::~Audio_element() +{} diff --git a/lily/audio-item.cc b/lily/audio-item.cc index 689c34af38..a041a7d2f3 100644 --- a/lily/audio-item.cc +++ b/lily/audio-item.cc @@ -9,12 +9,17 @@ #include "audio-item.hh" #include "midi-item.hh" -#if 0 Audio_instrument::Audio_instrument( String instrument_str ) : Audio_item( 0 ) { + str_ = instrument_str; +} + +Midi_item* +Audio_instrument::midi_item_p() +{ + return new Midi_instrument( 0, str_ ); } -#endif Audio_item::Audio_item( Request* req_l ) { @@ -34,10 +39,9 @@ Audio_key::midi_item_p() } -Audio_note::Audio_note( Request* req_l, bool on_b ) +Audio_note::Audio_note( Request* req_l ) : Audio_item( req_l ) { - on_b_ = on_b; } Midi_item* @@ -82,3 +86,5 @@ Audio_text::midi_item_p() return new Midi_text( this ); } + +IMPLEMENT_IS_TYPE_B1(Audio_item, Audio_element); diff --git a/lily/audio-score.cc b/lily/audio-score.cc index 8094b3e369..27f82a0746 100644 --- a/lily/audio-score.cc +++ b/lily/audio-score.cc @@ -6,49 +6,98 @@ (c) 1997 Jan Nieuwenhuizen */ +#include #include "debug.hh" +#include "string.hh" +#include "string-convert.hh" +#include "main.hh" #include "midi-def.hh" +#include "midi-item.hh" +#include "midi-stream.hh" #include "audio-column.hh" +#include "audio-staff.hh" #include "audio-score.hh" +#include "score.hh" -Audio_score::Audio_score( Midi_def* l ) +Audio_score::Audio_score( Score* l ) { - midi_l_ = l; + score_l_ = l; } void -Audio_score::play( Audio_item* i, Audio_column* c ) +Audio_score::add( Audio_column* p ) { - assert( c ); - assert( i ); + p->audio_score_l_ = this; + audio_column_p_list_.bottom().add(p); +} - c->add( i ); -// typeset_element( i ); +void +Audio_score::output( Midi_stream& midi_stream_r ) +{ + int tracks_i = audio_staff_l_list_.size() + 1; + // ugh + int clocks_per_4_i = 384; + midi_stream_r << Midi_header( 1, tracks_i, clocks_per_4_i ); + output_header_track( midi_stream_r ); + int n = 1; + for ( PCursor i( audio_staff_l_list_ ); i.ok(); i++ ) + i->output( midi_stream_r, n++ ); } void -Audio_score::add( Audio_column* p ) +Audio_score::output_header_track( Midi_stream& midi_stream_r ) { - p->audio_score_l_ = this; - audio_column_p_list_.bottom().add(p); + Midi_track midi_track; + + time_t t = time( 0 ); + + // perhaps multiple text events? + String str = String( "Creator: " ) + get_version_str() + "\n"; + + Midi_text creator( Midi_text::TEXT, str ); + midi_track.add( Moment( 0 ), &creator ); + + str = "Automatically generated at "; + str += ctime( &t ); + str = str.left_str( str.length_i() - 1 ); + str += "\n"; + Midi_text generate( Midi_text::TEXT, str ); + midi_track.add( Moment( 0 ), &generate ); + + str = "from musical definition: "; + + str += score_l_->location_str(); + Midi_text from( Midi_text::TEXT, str ); + midi_track.add( Moment( 0 ), &from ); + + Midi_text track_name( Midi_text::TRACK_NAME, "Track " + + String_convert::i2dec_str( 0, 0, '0' ) ); + midi_track.add( Moment( 0 ), &track_name ); + + Midi_tempo tempo( score_l_->midi_p_->get_tempo_i( Moment( 1, 4 ) ) ); + midi_track.add( Moment(0), &tempo); + + midi_stream_r << midi_track; +} + +void +Audio_score::add_staff( Audio_staff* l ) +{ + audio_staff_l_list_.bottom().add( l ); } -#if 0 void -Audio_score::output(Tex_stream &ts) +Audio_score::add(Audio_element *p) { - ts << "\n "<< midi_l_->lookup_l()->texsetting << "%(Tex id)\n"; - ts<< super_elem_l_->TeX_string(); - ts << "\n\\EndLilyPondOutput"; + audio_elem_p_list_.bottom().add( p); } -#endif void Audio_score::print() const { #ifndef NPRINT mtor << "Audio_score { "; - midi_l_->print(); + score_l_->midi_p_->print(); mtor << "\ncolumns: "; for ( PCursor i( audio_column_p_list_ ); i.ok(); i++ ) i->print(); @@ -59,15 +108,5 @@ Audio_score::print() const void Audio_score::process() { -#if 0 - clean_cols(); - print(); - *mlog << "Preprocessing elements... " < +*/ +#include "axis-group-item.hh" +#include "p-col.hh" + +IMPLEMENT_IS_TYPE_B2(Axis_group_item, Axis_group_element, Item); + +void +Axis_group_item::OK() const +{ + Link_array elems = axis_admin_.elem_l_arr_; + for (int i=0; i < elems.size(); i++) { + Item * it_l = elems[i]->item(); + assert(it_l); + + // somebody probably broke it in pieces + assert (it_l->pcol_l_ == pcol_l_ ); + } +} + +void +Axis_group_item::do_breakable_col_processing() +{ + if (!pcol_l_->breakable_b()) + return; + OK(); + copy_breakable_items(); + + + Link_array elems = axis_admin_.elem_l_arr_; + for (int i=0; i < elems.size(); i++) { + Item* it_l = elems[i]->item(); + for ( int j=0; j < 2; j++) { + Item *new_l = it_l->find_prebroken_piece(broken_to_a_[j]->pcol_l_); + ((Axis_group_item*)broken_to_a_[j])->add_element( new_l ); + } + } + Item::do_breakable_col_processing(); +} + +void +Axis_group_item::do_print() const +{ + Axis_group_element::do_print(); +} diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc new file mode 100644 index 0000000000..94aab236b6 --- /dev/null +++ b/lily/axis-group-spanner.cc @@ -0,0 +1,115 @@ +/* + axis-group-spanner.cc -- implement Axis_group_spanner + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "axis-group-spanner.hh" +#include "item.hh" +#include "p-col.hh" + +/** Do stuff if we're not broken. In this case the last and first + columns usually are pre- and postbreak respectively, + so the items from these columns need adjusting. + */ +void +Axis_group_spanner::do_break_processing_if_unbroken() +{ + Link_array elems = axis_admin_.elem_l_arr_; + Line_of_score *my_line = line_l(); + for (int i=0; i < elems.size(); i++) { + if (!elems[i]->line_l()) { + Item * item_l = elems[i]->item(); + if (item_l + && item_l->breakable_b_ + && item_l->break_status_i() == 0) { + // last two checks are paranoia + Item * broken_item_l = + item_l->find_prebroken_piece( my_line ); + add_element( broken_item_l ); + } + remove_element( elems[i] ); + } + } + +} +void +Axis_group_spanner::do_break_processing() +{ + set_my_columns(); + bool breaking_self_b = ! Spanner::line_l(); + if (!breaking_self_b) { + do_break_processing_if_unbroken(); + Spanner::do_break_processing(); + return; + } + + break_into_pieces( true ); + Link_array loose_elems = axis_admin_.elem_l_arr_; + remove_all(); + + for (int i=0; i < loose_elems.size(); i++) { + Score_elem * elt = loose_elems[i]; + Line_of_score *elt_line = elt->line_l(); + + if ( ! elt_line ){ + /* this piece doesn't know where it belongs. + Find out if it was broken, and use the broken remains + */ + if (elt->spanner()) { + Spanner * sp = elt->spanner(); + + for (int j =0; j < broken_into_l_arr_.size(); j++) { + Axis_group_spanner * my_broken_l + = (Axis_group_spanner*)broken_into_l_arr_[j]; + + Spanner * broken_span_l + = sp->find_broken_piece( + ((Score_elem*)my_broken_l)->line_l()); + + if (broken_span_l) + my_broken_l->add_element(broken_span_l ); + + } + } else if (elt->item() + && elt->item()->breakable_b_ + && elt->item()->break_status_i() == 0) { + + // broken items + for (int j =0; j < 2; j++) { + Item * my_item = elt->item()->broken_to_a_[j]; + Line_of_score * item_line_l = my_item->line_l() ; + if ( ! item_line_l ) + continue; + + Axis_group_spanner * v + = (Axis_group_spanner*)find_broken_piece( item_line_l ); + if (v) + v->add_element( my_item ); + } + + } + } else { + /* this piece *does* know where it belongs. + Put it in appropriate piece of this spanner + */ + Axis_group_spanner * my_broken_l + = (Axis_group_spanner*)find_broken_piece( elt->line_l() ); + my_broken_l->add_element( elt ); + } + } + + Spanner::do_break_processing(); +} + +void +Axis_group_spanner::do_print() const +{ + Axis_group_element::do_print(); +} + + + +IMPLEMENT_IS_TYPE_B2(Axis_group_spanner, Spanner, Axis_group_element); diff --git a/lily/axis-group.cc b/lily/axis-group.cc new file mode 100644 index 0000000000..b6b5eec4fc --- /dev/null +++ b/lily/axis-group.cc @@ -0,0 +1,76 @@ +/* + axis-group.cc -- implement Axis_group_administration + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ +#include "interval.hh" +#include "axis-group.hh" +#include "score-elem.hh" +#include "debug.hh" + +/** don't copy anything: an element can only be in one + Axis_group_element at one time. */ +Axis_group_administration::Axis_group_administration( + Axis_group_administration const&) +{ +} + +bool +Axis_group_administration::contains_b(Score_elem const *e)const +{ + return elem_l_arr_.find_l(e); +} + +Interval +Axis_group_administration::extent(Axis axis)const +{ + Interval r; + for (int i=0; i < elem_l_arr_.size(); i++) + r.unite(elem_l_arr_[i]->extent(axis)); + return r; +} + +void +Axis_group_administration::add_element(Score_elem*e, + Axis_group_element*g, Axis a1, Axis a2) +{ + assert( ! e->axis_group_l_a_[a1] && !e->axis_group_l_a_[a2] ); + e->axis_group_l_a_[a1] = g; + e->axis_group_l_a_[a2] = g; + elem_l_arr_.push ( e); +} + + + +void +Axis_group_administration::remove_element(Score_elem*e, Axis a1, Axis a2) +{ + assert( contains_b( e)); + elem_l_arr_.unordered_substitute(e,0); + + e->axis_group_l_a_[a1] = 0; + e->axis_group_l_a_[a2] = 0; +} + +void +Axis_group_administration::remove_all(Axis a1, Axis a2) +{ + for (int i=0; i < elem_l_arr_.size(); i++) { + Score_elem*e=elem_l_arr_[i]; + e->axis_group_l_a_[a1] = 0; + e->axis_group_l_a_[a2] = 0; + } + elem_l_arr_.clear(); +} + + +void +Axis_group_administration::print() const +{ +#ifndef NPRINT + for (int i=0; i < elem_l_arr_.size(); i++) + mtor << elem_l_arr_[i]->name() << ' '; +#endif +} diff --git a/lily/axis.cc b/lily/axis.cc new file mode 100644 index 0000000000..eddfd0c9b5 --- /dev/null +++ b/lily/axis.cc @@ -0,0 +1,16 @@ +/* + axis.cc -- implement Axis + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "axes.hh" +#include "string.hh" + +String +axis_name_str(Axis a) +{ + return String (a + 'x'); +} diff --git a/lily/bar-column-grav.cc b/lily/bar-column-grav.cc new file mode 100644 index 0000000000..1dda5113ca --- /dev/null +++ b/lily/bar-column-grav.cc @@ -0,0 +1,69 @@ +/* + bar-column-grav.cc -- implement Bar_column_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#include "bar-column-grav.hh" +#include "bar-column.hh" +#include "request.hh" +#include "script.hh" +#include "bar.hh" + +Bar_column_engraver::Bar_column_engraver() +{ + bar_l_ =0; + barcol_p_ =0; +} + + +void +Bar_column_engraver::acknowledge_element(Score_elem_info info) +{ + if (info.elem_l_->is_type_b(Script::static_name()) + && info.req_l_->command() + && info.origin_grav_l_arr_.size() == 1) { + script_l_arr_.push( (Script*)info.elem_l_->item()); + } else { + if (info.origin_grav_l_arr_.size() == 1 + && info.elem_l_->is_type_b(Bar::static_name())) + bar_l_ = (Bar*)info.elem_l_->item(); + } + + if ( bar_l_ && !barcol_p_ ) { + barcol_p_ = new Bar_column; + barcol_p_->breakable_b_ =true; + barcol_p_->set_bar( bar_l_ ); + announce_element(Score_elem_info(barcol_p_, 0)); + } + + if (barcol_p_ ) { + for (int i=0; i < script_l_arr_.size(); i++) { + script_l_arr_[i]->breakable_b_ = true; + barcol_p_->add(script_l_arr_[i]); + } + script_l_arr_.clear(); + } +} + +void +Bar_column_engraver::do_pre_move_processing() +{ + if (barcol_p_) { + typeset_element( barcol_p_ ); + barcol_p_ =0; + } +} + +void +Bar_column_engraver::do_post_move_processing() +{ + script_l_arr_.clear(); + bar_l_ =0; +} + +IMPLEMENT_IS_TYPE_B1(Bar_column_engraver, Engraver); +ADD_THIS_ENGRAVER(Bar_column_engraver); diff --git a/lily/bar-column.cc b/lily/bar-column.cc new file mode 100644 index 0000000000..123b512ed4 --- /dev/null +++ b/lily/bar-column.cc @@ -0,0 +1,35 @@ +/* + bar-column.cc -- implement Bar_column + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "bar.hh" +#include "bar-column.hh" + +Bar_column::Bar_column() +{ + bar_l_ =0; + breakable_b_ = true; +} + +void +Bar_column::set_bar(Bar*b) +{ + Script_column::add_support( b ); + bar_l_ = b; +} + +void +Bar_column::do_substitute_dependency(Score_elem*o,Score_elem*n) +{ + Script_column::do_substitute_dependency(o,n); + if ( o == bar_l_ ) { + bar_l_ = n ? (Bar*)n->item() : 0; + } +} + +IMPLEMENT_IS_TYPE_B1(Bar_column, Script_column); + diff --git a/lily/bar-grav.cc b/lily/bar-grav.cc index 3362ce0024..3847e9a5ba 100644 --- a/lily/bar-grav.cc +++ b/lily/bar-grav.cc @@ -24,7 +24,7 @@ Bar_engraver::do_try_request(Request*r_l) if (!c_l|| !c_l->bar()) return false; Bar_req * b= c_l->bar(); - if (bar_req_l_ && bar_req_l_->compare(*b)) + if (bar_req_l_ && bar_req_l_->equal_b(b)) return false; bar_req_l_ = b; @@ -55,7 +55,7 @@ void Bar_engraver::do_pre_move_processing() { if (bar_p_) { - typeset_breakable_item(bar_p_); + typeset_element(bar_p_); bar_p_ =0; } } diff --git a/lily/bar-number-grav.cc b/lily/bar-number-grav.cc new file mode 100644 index 0000000000..4b0535f5a4 --- /dev/null +++ b/lily/bar-number-grav.cc @@ -0,0 +1,51 @@ +/* + bar-number-grav.cc -- implement Bar_number_grav + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#include "bar-number-grav.hh" +#include "script.hh" +#include "text-def.hh" +#include "command-request.hh" +#include "bar.hh" + +Bar_number_grav::Bar_number_grav() +{ + number_i_ =1; + script_p_ =0; +} + +static Command_script_req dummy; + +void +Bar_number_grav::acknowledge_element(Score_elem_info i) +{ + if (i.origin_grav_l_arr_.size() == 1 && + i.elem_l_->is_type_b( Bar::static_name()) && !script_p_) { + + script_p_ = new Script; + Text_def *td_p =new Text_def; + td_p->text_str_ = number_i_++; + script_p_->specs_l_ = td_p; + script_p_->breakable_b_ = true; + script_p_->dir_i_ = 1; + + announce_element(Score_elem_info( script_p_, &dummy)); + } +} + +void +Bar_number_grav::do_pre_move_processing() +{ + if ( script_p_ ) { + typeset_element(script_p_); + script_p_ =0; + } +} + +IMPLEMENT_IS_TYPE_B1(Bar_number_grav,Engraver); +ADD_THIS_ENGRAVER(Bar_number_grav); diff --git a/lily/bar.cc b/lily/bar.cc index b45d977b26..2342d227b2 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -15,6 +15,7 @@ Bar::Bar() { + breakable_b_ = true; type_str_ = "|"; spanned_i_ = 0; } @@ -40,13 +41,15 @@ Bar::brew_molecule_p()const } /** + Prescriptions for splitting bars. TODO: parametrise this (input-settable) */ -char const *bar_breaks[][3] ={ +static char const *bar_breaks[][3] ={ {":|", ":|:", "|:"}, {"|", "|", ""}, {"", "|:", "|:"}, {"||.", "||.", ""}, + {":|", ":|", ""}, {0,0,0} }; @@ -58,7 +61,11 @@ Bar::do_pre_processing() type_str_ = bar_breaks[i][break_status_i()+1]; } - // span_score_bar needs dims. -// transparent_b_ = empty_b_ = (type_str_ == ""); + /* + span_score_bar needs dims, so don't do + + transparent_b_ = empty_b_ = (type_str_ == ""); + + */ } diff --git a/lily/beam.cc b/lily/beam.cc index 9079d277ba..4dd852f188 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -312,7 +312,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const a.translate(Offset (-w, -w * sl)); for (int j = 0; j < lhalfs; j++) { Atom b(a); - b.translate_y( -dir_i_ * dy * (lwholebeams+j)); + b.translate( -dir_i_ * dy * (lwholebeams+j), Y_AXIS); leftbeams.add( b ); } } @@ -327,7 +327,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const int j = 0; for (; j < rwholebeams; j++) { Atom b(a); - b.translate_y( -dir_i_ * dy * j); + b.translate( -dir_i_ * dy * j, Y_AXIS); rightbeams.add( b ); } @@ -337,7 +337,7 @@ Beam::stem_beams(Stem *here, Stem *next, Stem *prev)const for (; j < rwholebeams + rhalfs; j++) { Atom b(a); - b.translate_y( -dir_i_ * dy * j); + b.translate( -dir_i_ * dy * j, Y_AXIS); rightbeams.add(b ); } @@ -366,7 +366,7 @@ Beam::brew_molecule_p() const sb.translate(Offset(x, (x * slope + left_pos)* inter_f)); mol_p->add(sb); } - mol_p->translate_x(x0 - left_col_l_->hpos_f_); + mol_p->translate(x0 - left_col_l_->hpos_f_, X_AXIS); return mol_p; } diff --git a/lily/boxes.cc b/lily/boxes.cc index 1798cb93c3..d06bfd2165 100644 --- a/lily/boxes.cc +++ b/lily/boxes.cc @@ -8,7 +8,7 @@ Box::Box() Box::Box(Interval ix, Interval iy) { - x = ix; - y = iy; + x() = ix; + y() = iy; } diff --git a/lily/break.cc b/lily/break.cc index 1ef5c4bc6f..8edb91a8b6 100644 --- a/lily/break.cc +++ b/lily/break.cc @@ -120,7 +120,7 @@ Break_algorithm::Break_algorithm() } void -Break_algorithm::set_pscore(PScore*s) +Break_algorithm::set_pscore(Paper_score*s) { pscore_l_ = s; linelength = s->paper_l_->linewidth_f(); diff --git a/lily/clef-grav.cc b/lily/clef-grav.cc index e7126456e2..a4426bcea2 100644 --- a/lily/clef-grav.cc +++ b/lily/clef-grav.cc @@ -106,7 +106,7 @@ Clef_engraver::do_pre_move_processing() { if (!clef_p_) return; - typeset_breakable_item(clef_p_); + typeset_element(clef_p_); clef_p_ = 0; } diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 15cc5687b2..67742488ca 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -27,6 +27,7 @@ Clef_item::do_pre_processing() Clef_item::Clef_item() { + breakable_b_ =true; default_b_ = false; change_b_ = true; read("violin"); @@ -59,7 +60,7 @@ Clef_item::brew_molecule_p()const t += "_change"; Symbol s = paper()->lookup_l()->clef(t); Molecule*output = new Molecule(Atom(s)); - output->translate_y( paper()->internote_f() * y_off); + output->translate( paper()->internote_f() * y_off, Y_AXIS); return output; } diff --git a/lily/collision-grav.cc b/lily/collision-grav.cc index 2a4903d105..8eaa7cd30f 100644 --- a/lily/collision-grav.cc +++ b/lily/collision-grav.cc @@ -16,9 +16,10 @@ Collision_engraver::acknowledge_element(Score_elem_info i) if (!(i.elem_l_->name() == Note_column::static_name())) return; - if (!col_p_) + if (!col_p_) { col_p_ = new Collision; - + announce_element(Score_elem_info(col_p_,0)); + } col_p_->add((Note_column*)i.elem_l_->item()); } diff --git a/lily/collision.cc b/lily/collision.cc index f9a15bc4fa..0af68c462e 100644 --- a/lily/collision.cc +++ b/lily/collision.cc @@ -20,6 +20,7 @@ void Collision::add(Note_column* ncol_l) { clash_l_arr_.push(ncol_l); + add_element( ncol_l ); add_dependency(ncol_l); } /** @@ -76,7 +77,7 @@ Collision::do_pre_processing() do { if (!clash_group_arr_a[idx(d, false)].size()){ clash_group_arr_a[idx(d, false)] = clash_group_arr_a[idx(d, true)]; - clash_group_arr_a[idx(d, true)].set_size(0); + clash_group_arr_a[idx(d, true)].clear(); } } while ((d *= -1) != 1); @@ -133,10 +134,14 @@ Collision::do_pre_processing() Real inter_f = paper()->internote_f(); Real wid_f = paper()->note_width(); for (int j=0; j < 4; j++) { - if (col_l_a[j]) - col_l_a[j]->translate(Offset(x_off[j] * wid_f, - y_off[j] * inter_f)); - + if (col_l_a[j]) { + /* collision.cc:138: request for method `translate' is ambiguous + + (shaddup) + */ + Offset o(x_off[j] * wid_f, y_off[j] * inter_f); + ((Score_elem*)col_l_a[j])->translate(o); + } } } diff --git a/lily/command-request.cc b/lily/command-request.cc index cf5ef632f8..9fe1c9118b 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -13,6 +13,7 @@ void Command_script_req::do_print() const {} +Command_script_req::Command_script_req(){} IMPLEMENT_IS_TYPE_B1(Command_script_req,Command_req); @@ -22,7 +23,17 @@ IMPLEMENT_IS_TYPE_B1(Cadenza_req, Timing_req); void Cadenza_req::do_print()const { +#ifndef NPRINT mtor << on_b_; +#endif +} + +bool +Cadenza_req::do_equal_b(Request*r)const +{ + Cadenza_req*cad = r->command()->timing()->cadenza(); + + return cad->on_b_ == on_b_; } Cadenza_req::Cadenza_req(bool b) @@ -32,10 +43,11 @@ Cadenza_req::Cadenza_req(bool b) /* *************** */ -int -Bar_req::compare(Bar_req const &c1)const +bool +Bar_req::do_equal_b(Request*r)const { - return type_str_ == c1.type_str_; + Bar_req * b = r->command()->bar(); + return type_str_ == b->type_str_; } @@ -56,7 +68,14 @@ Partial_measure_req::Partial_measure_req(Moment m) { duration_ =m; } -/* *************** */ + +bool +Partial_measure_req::do_equal_b(Request* r)const +{ + Partial_measure_req *p = r->command()->timing()->partial(); + + return p->duration_ == duration_; +} IMPLEMENT_IS_TYPE_B1(Timing_req,Command_req); @@ -83,6 +102,11 @@ IMPLEMENT_IS_TYPE_B1(Barcheck_req,Timing_req); void Barcheck_req::do_print() const{} +bool +Barcheck_req::do_equal_b(Request*)const +{ + return true; +} /* *************** */ IMPLEMENT_IS_TYPE_B1(Clef_change_req,Command_req); @@ -128,13 +152,18 @@ IMPLEMENT_IS_TYPE_B1(Meter_change_req,Timing_req); void Meter_change_req::do_print() const { +#ifndef NPRINT mtor << beats_i_ << "/" << one_beat_i_; +#endif } -int -Meter_change_req::compare(Meter_change_req const &m) +bool +Meter_change_req::do_equal_b(Request * r)const { - return m.beats_i_ == beats_i_ && one_beat_i_ == m.one_beat_i_; + Meter_change_req * m = r->command()->timing()->meterchange(); + + return m->beats_i_ == beats_i_ + && one_beat_i_ == m->one_beat_i_; } Meter_change_req::Meter_change_req() @@ -150,6 +179,28 @@ Meter_change_req::set(int b,int o) one_beat_i_=o; } + +Tempo_req::Tempo_req() +{ + metronome_i_ = 60; + dur_. type_i_ = 4; +} + +void +Tempo_req::do_print()const +{ + mtor << dur_.str() << " = " <command()->timing()->tempo(); + + return t->dur_.length()== dur_.length() && metronome_i_ == t->metronome_i_; +} + /* *************** */ @@ -162,6 +213,14 @@ Measure_grouping_req::do_print() const mtor << beat_i_arr_[i] <<"*" << elt_length_arr_[i]<<" "; } } + + +bool +Measure_grouping_req::do_equal_b(Request*)const +{ + return false; // todo +} + /* *************** */ void diff --git a/lily/crescendo.cc b/lily/crescendo.cc index df349421bb..8f604dbcba 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -24,7 +24,7 @@ Crescendo::Crescendo() Interval Crescendo::symbol_height()const { - return get_symbol().dim.y; + return get_symbol().dim[Y_AXIS]; } static Real absdyn_dim = 10 PT; // ugh diff --git a/lily/dynamic-grav.cc b/lily/dynamic-grav.cc index 8f99590581..72d76607df 100644 --- a/lily/dynamic-grav.cc +++ b/lily/dynamic-grav.cc @@ -28,7 +28,7 @@ Dynamic_engraver::Dynamic_engraver() void Dynamic_engraver::do_post_move_processing() { - dynamic_req_l_arr_.set_size(0); + dynamic_req_l_arr_.clear(); } bool diff --git a/lily/elem-group-item.cc b/lily/elem-group-item.cc index 138bd146a3..c22739a849 100644 --- a/lily/elem-group-item.cc +++ b/lily/elem-group-item.cc @@ -13,7 +13,7 @@ void Horizontal_vertical_group_item::do_print()const { - Horizontal_vertical_group::do_print(); + Horizontal_vertical_group_element::do_print(); } -IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_item,Horizontal_vertical_group,Item); +IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_item,Horizontal_vertical_group_element,Item); diff --git a/lily/elem-group.cc b/lily/elem-group.cc index badb6db851..5115c5c70b 100644 --- a/lily/elem-group.cc +++ b/lily/elem-group.cc @@ -1,5 +1,5 @@ /* - elem-group.cc -- implement Horizontal_vertical_group + elem-group.cc -- implement Horizontal_vertical_group_element source file of the GNU LilyPond music typesetter @@ -11,195 +11,107 @@ #include "item.hh" #include "debug.hh" -bool -Elbement_group::contains_b(Score_elem const*e)const +void +Axis_group_element::do_unlink() { - return elem_l_arr_.find_l(e); + remove_all(); } -Elbement_group::Elbement_group(Elbement_group const &s) - : Score_elem(s) -{ -} -Interval -Vertical_group::do_height()const -{ - Interval r; - for (int i=0; i < elem_l_arr_.size(); i++) - r.unite(elem_l_arr_[i]->height()); - return r; -} - -Interval -Horizontal_group::do_width()const +bool +Axis_group_element::contains_b(Score_elem const*e)const { - Interval r; - for (int i=0; i < elem_l_arr_.size(); i++) - if (elem_l_arr_[i]->item()) // makes no at preprocessing for spanners. - r.unite(elem_l_arr_[i]->width()); - return r; + return axis_admin_.contains_b(e); } - -IMPLEMENT_IS_TYPE_B1(Horizontal_group, Elbement_group); -IMPLEMENT_IS_TYPE_B1(Vertical_group, Elbement_group); - - -void -Elbement_group::add_element(Score_elem*i_l) +Link_array +Axis_group_element::get_extra_dependencies()const { - assert(i_l!= this); - assert(! contains_b(i_l)); - - elem_l_arr_.push(i_l); - add_dependency(i_l); + return axis_admin_.elem_l_arr_; } void -Horizontal_group::add_element(Score_elem*elt) +Axis_group_element::do_print()const { - assert ( !elt->x_group_l_ ); - elt->x_group_l_ = this; - Elbement_group::add_element(elt); + axis_admin_.print(); } -void -Vertical_group::add_element(Score_elem*e) -{ - assert( ! e->y_group_l_ ); - e->y_group_l_ = this; - - Elbement_group::add_element(e); -} +// **************** void -Horizontal_group::translate_x(Real x) +Vertical_group_element::add_element(Score_elem*e) { - for (int i=0; i < elem_l_arr_.size(); i++) - elem_l_arr_[i]->translate_x(x); + axis_admin_.add_element(e, this, Y_AXIS, Y_AXIS); } void -Vertical_group::translate_y(Real y) +Vertical_group_element::remove_element(Score_elem*e) { - for (int i=0; i < elem_l_arr_.size(); i++) - elem_l_arr_[i]->translate_y(y); + axis_admin_.remove_element(e, Y_AXIS, Y_AXIS); } -IMPLEMENT_IS_TYPE_B1(Elbement_group, Score_elem); - -void -Elbement_group::do_print() const +Interval +Vertical_group_element::do_height() const { -#ifndef NPRINT - for (int i=0; i < elem_l_arr_.size(); i++) - mtor << elem_l_arr_[i]->name() << ' '; -#endif + return axis_admin_.extent(Y_AXIS); } - void -Horizontal_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l) +Vertical_group_element::remove_all() { - int i; - - while ((i=elem_l_arr_.find_i(old))>=0) { - old->x_group_l_ =0; - - if (new_l){ - new_l->x_group_l_ = this; - elem_l_arr_[i] = new_l; - }else { - elem_l_arr_.unordered_del(i); - } - } + axis_admin_.remove_all(Y_AXIS,Y_AXIS); } +// **************** void -Vertical_group::do_substitute_dependency(Score_elem* old, Score_elem *new_l) -{ - int i; - - while ((i=elem_l_arr_.find_i(old))>=0) { - old->y_group_l_ =0; - - if (new_l){ - new_l->y_group_l_ =this; - elem_l_arr_[i] = new_l; - }else { - elem_l_arr_.unordered_del(i); - } - } -} - -Vertical_group::Vertical_group(Vertical_group - const &s) - : Elbement_group(s) +Horizontal_group_element::remove_all() { + axis_admin_.remove_all(X_AXIS,X_AXIS); } -Horizontal_group::Horizontal_group(Horizontal_group - const &s) - : Elbement_group(s) +void +Horizontal_group_element::add_element(Score_elem*e) { + axis_admin_.add_element(e,this, X_AXIS,X_AXIS); } -Elbement_group::Elbement_group() +void +Horizontal_group_element::remove_element(Score_elem*e) { - transparent_b_ = true; + axis_admin_.remove_element(e,X_AXIS,X_AXIS); } -IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group, Horizontal_group, Vertical_group); - -Horizontal_vertical_group::Horizontal_vertical_group() +Interval +Horizontal_group_element::do_width()const { + return axis_admin_.extent(X_AXIS); } -void -Horizontal_vertical_group::do_substitute_dependency(Score_elem*o,Score_elem*n) -{ - Vertical_group::do_substitute_dependency(o,n); - Horizontal_group::do_substitute_dependency(o,n); -} -void -Horizontal_vertical_group::add_element(Score_elem*e) -{ - Vertical_group::add_element(e); - Horizontal_group::add_element(e); -} +// **************** void -Horizontal_vertical_group::do_print()const +Horizontal_vertical_group_element::remove_all() { - Vertical_group::do_print(); + axis_admin_.remove_all(X_AXIS,Y_AXIS); } - void -Vertical_group::do_print()const +Horizontal_vertical_group_element::add_element(Score_elem *e) { - Elbement_group::do_print(); + axis_admin_.add_element(e, this, X_AXIS, Y_AXIS); } void -Horizontal_group::do_print() const +Horizontal_vertical_group_element::remove_element(Score_elem*e) { - Elbement_group::do_print(); + axis_admin_.remove_element(e, X_AXIS, Y_AXIS); } -void -Vertical_group::remove_element(Score_elem*s) -{ - remove_dependency( s ); -} - -void -Horizontal_group::remove_element(Score_elem*s) -{ - remove_dependency( s ); -} +IMPLEMENT_IS_TYPE_B1(Axis_group_element, Score_elem); +IMPLEMENT_IS_TYPE_B1(Horizontal_group_element, Axis_group_element); +IMPLEMENT_IS_TYPE_B1(Vertical_group_element, Axis_group_element); +IMPLEMENT_IS_TYPE_B2(Horizontal_vertical_group_element, Horizontal_group_element, Vertical_group_element); diff --git a/lily/engraver-group.cc b/lily/engraver-group.cc index 672c8f2e5f..69038b5024 100644 --- a/lily/engraver-group.cc +++ b/lily/engraver-group.cc @@ -17,6 +17,12 @@ Engraver* get_engraver_p(String); +void +Engraver_group_engraver::print()const +{ + Engraver::print(); +} + Engraver_group_engraver::~Engraver_group_engraver() { assert(removable_b()); @@ -160,7 +166,7 @@ void Engraver_group_engraver::terminate_engraver(Engraver*r_l) { mtor << "Removing " << r_l->name() << " at " << get_staff_info().when() << "\n"; - r_l->do_removal_processing(); + r_l->removal_processing(); Engraver * grav_p =remove_engraver_p(r_l); delete grav_p; @@ -176,7 +182,8 @@ Engraver_group_engraver::do_print()const #ifndef NPRINT if ( !check_debug) return ; - mtor << "ID: " << id_str_ << "\n"; + mtor << "ID: " << id_str_ ; + mtor << " iterators: " << iterator_count_<< "\n"; for (PCursor i(grav_list_.top()); i.ok(); i++) i->print(); #endif @@ -266,7 +273,7 @@ Engraver_group_engraver::do_announces() nongroup_l_arr_[i]->acknowledge_element(info); } } - announce_info_arr_.set_size(0); + announce_info_arr_.clear(); } @@ -274,7 +281,7 @@ void Engraver_group_engraver::do_removal_processing() { for (PCursor i(grav_list_.top()); i.ok(); i++) - i->do_removal_processing(); + i->removal_processing(); } Staff_info @@ -309,3 +316,16 @@ Engraver_group_engraver::is_bottom_engraver_b()const { return !itrans_l_->get_default_itrans_l(); } + +Engraver* +Engraver_group_engraver::get_simple_engraver(char const *type)const +{ + for (int i=0; i < nongroup_l_arr_.size(); i++) { + if (nongroup_l_arr_[i]->name() == type ) + return nongroup_l_arr_[i]; + } + if ( daddy_grav_l_ ) + return daddy_grav_l_->get_simple_engraver(type); + return 0; +} + diff --git a/lily/engraver.cc b/lily/engraver.cc index 4dea919eca..697a4844a2 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -26,6 +26,15 @@ Engraver::post_move_processing() status = MOVE_INITED; } +void +Engraver::removal_processing() +{ + if ( status < CREATION_INITED ) + do_creation_processing(); + + do_removal_processing(); +} + bool Engraver::try_request(Request * r) { @@ -97,12 +106,6 @@ Engraver::paper()const return daddy_grav_l_->paper(); } -void -Engraver::typeset_breakable_item(Item * nobreak_p) -{ - daddy_grav_l_->typeset_breakable_item(nobreak_p); -} - bool Engraver::contains_b(Engraver *grav_l)const { diff --git a/lily/general-script-def.cc b/lily/general-script-def.cc index 9bf570e5b8..e755af94c5 100644 --- a/lily/general-script-def.cc +++ b/lily/general-script-def.cc @@ -38,11 +38,11 @@ General_script_def::equal_b(General_script_def const&g)const if (name() != g.name()) return false; - return do_equal_b(g); + return do_equal_b(&g); } bool -General_script_def::do_equal_b(General_script_def const&)const +General_script_def::do_equal_b(General_script_def const*)const { return true; } diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index 03f6d3cd7c..6a0d2376a4 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -145,14 +145,18 @@ Gourlay_breaking::do_solve()const Array final_breaks; + Array lines; /* skip 0-th element, since it is a "dummy" elt*/ for (int i = optimal_paths.size()-1; i> 0; ) { final_breaks.push ( i ); assert ( i > optimal_paths[i].prev_break_i_); + + // there was no "feasible path" + if (!optimal_paths[i].line_config_.config.size() ) + return lines; i = optimal_paths[i].prev_break_i_; } - Array lines; for (int i= final_breaks.size(); i--; ) lines.push ( optimal_paths[final_breaks[i]].line_config_ ); diff --git a/lily/grouping.cc b/lily/grouping.cc index 0781bf9cb3..f35ae8e354 100644 --- a/lily/grouping.cc +++ b/lily/grouping.cc @@ -14,7 +14,7 @@ void Rhythmic_grouping::init() { interval_ = 0; - children.set_size(0); + children.clear(); } void diff --git a/lily/head-column.cc b/lily/head-column.cc index d08519a891..2d978bb60e 100644 --- a/lily/head-column.cc +++ b/lily/head-column.cc @@ -10,6 +10,7 @@ #include "head-column.hh" #include "note-head.hh" #include "stem.hh" +#include "script.hh" Head_column::Head_column() { @@ -36,9 +37,18 @@ void Head_column::set(Stem*stem_l) { stem_l_ = stem_l; - add_dependency(stem_l); + Score_elem::add_dependency(stem_l); + for (int i=0; script_l_arr_.size(); i++) + script_l_arr_[i]->set_stem( stem_l ); } +void +Head_column::add(Script *script_l) +{ + Script_column::add(script_l) ; + if (stem_l_ ) + script_l->set_stem( stem_l_ ); +} void Head_column::add(Note_head *n_l) { diff --git a/lily/head-grav.cc b/lily/head-grav.cc index 952f6d8670..2db5d4ac0b 100644 --- a/lily/head-grav.cc +++ b/lily/head-grav.cc @@ -40,8 +40,10 @@ Note_head_engraver::do_process_requests() n_p->set_rhythmic(note_req_l_->rhythmic()); if (note_req_l_->note()) { - n_p->position_i_ = note_req_l_->note()->height() + - *get_staff_info().c0_position_i_l_; + n_p->position_i_ = note_req_l_->note()->height(); + Staff_info inf = get_staff_info(); + if (inf.c0_position_i_l_) + n_p->position_i_ += *inf.c0_position_i_l_; } else if (note_req_l_->rest()) { n_p->rest_b_ = true; } diff --git a/lily/horizontal-align-item.cc b/lily/horizontal-align-item.cc index 46c9b70b85..8b4427fc0d 100644 --- a/lily/horizontal-align-item.cc +++ b/lily/horizontal-align-item.cc @@ -69,8 +69,8 @@ Horizontal_align_item::do_pre_processing() Horizontal_align_item_content( item_l_arr_[i], priority_i_arr_[i])); content.sort(Horizontal_align_item_content::compare); - item_l_arr_.set_size(0); - priority_i_arr_.set_size(0); + item_l_arr_.clear(); + priority_i_arr_.clear(); for (int i =0; i < content.size(); i++) { item_l_arr_.push( content[i].item_l_ ); priority_i_arr_.push( content[i].priority_i_); @@ -93,14 +93,14 @@ Horizontal_align_item::do_pre_processing() Real center_dx_f = 0; for ( int i=0 ; i < item_l_arr_.size(); i++) { Real dx = where_f -dims[i][-1]; - item_l_arr_[i]->translate_x( dx ); + item_l_arr_[i]->translate( dx , X_AXIS); if (item_l_arr_[i] == center_l_) center_dx_f = where_f; where_f += dims[i].length(); } if (center_dx_f && !align_i_ ) for ( int i=0 ; i < item_l_arr_.size(); i++) - item_l_arr_[i]->translate_x( - center_dx_f ); + item_l_arr_[i]->translate( - center_dx_f , X_AXIS); } diff --git a/lily/horizontal-group-item.cc b/lily/horizontal-group-item.cc index 15af0bd803..409f2feadf 100644 --- a/lily/horizontal-group-item.cc +++ b/lily/horizontal-group-item.cc @@ -9,33 +9,10 @@ #include "p-col.hh" #include "horizontal-group-item.hh" -IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group, Item); +IMPLEMENT_IS_TYPE_B2(Horizontal_group_item, Horizontal_group_element, Axis_group_item); void -Horizontal_group_item::OK() const -{ - for (int i=0; i < elem_l_arr_.size(); i++) { - Item * it_l = elem_l_arr_[i]->item(); - - assert(it_l&& it_l->pcol_l_ == pcol_l_ ); - } -} - -void -Horizontal_group_item::do_breakable_col_processing() -{ - if (!pcol_l_->breakable_b()) - return; - OK(); - copy_breakable_items(); - - Link_array elems = elem_l_arr_; - - for (int i=0; i < elems.size(); i++) { - Item* it_l = elems[i]->item(); - for ( int j=0; j < 2; j++) { - Item *new_l = it_l->find_prebroken_piece(broken_to_a_[j]->pcol_l_); - ((Horizontal_group_item*)broken_to_a_[j])->add_element( new_l ); - } - } +Horizontal_group_item::do_print() const +{ + Axis_group_item::do_print(); } diff --git a/lily/include/audio-element.hh b/lily/include/audio-element.hh new file mode 100644 index 0000000000..6deaf15713 --- /dev/null +++ b/lily/include/audio-element.hh @@ -0,0 +1,19 @@ +/* + audio-element.hh -- declare Audio_element + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef AUDIO_ELEMENT_HH +#define AUDIO_ELEMENT_HH + +#include "virtual-methods.hh" + +struct Audio_element { + virtual ~Audio_element(); + DECLARE_MY_RUNTIME_TYPEINFO; +}; +#endif // AUDIO_ELEMENT_HH diff --git a/lily/include/audio-item.hh b/lily/include/audio-item.hh index e6104dcb7f..1b0a4fccf9 100644 --- a/lily/include/audio-item.hh +++ b/lily/include/audio-item.hh @@ -9,29 +9,30 @@ #include "lily-proto.hh" #include "string.hh" +#include "audio-element.hh" /** Any piece of audio information. We need virtual constructors, let's try decentralised factory for specific audio implemenations. + + TODO: + + virtual Niff_item* niff_item_p() = 0; + + virtual CSound_item* score_item_p() = 0; */ -struct Audio_item { +struct Audio_item : public Audio_element { Audio_item( Request* req_l ); /// Create a midi-item from myself. virtual Midi_item* midi_item_p() = 0; -#if 0 - /// Not implemented. Anyone? - virtual Niff_item* niff_item_p() = 0; - - /// Not implemented. Anyone? - virtual Cscore_item* score_item_p() = 0; -#endif - Audio_column* audio_column_l_; Request* req_l_; + DECLARE_MY_RUNTIME_TYPEINFO; + private: Audio_item( Audio_item const& ); Audio_item& operator=( Audio_item const& ); @@ -43,16 +44,15 @@ struct Audio_key : public Audio_item { virtual Midi_item* midi_item_p(); }; -#if 0 struct Audio_instrument : public Audio_item { - Audio_instrument( Request* req_l ); + Audio_instrument( String instrument_str ); + virtual Midi_item* midi_item_p(); + String str_; }; -#endif struct Audio_note : public Audio_item { - Audio_note( Request* req_l, bool on_b ); + Audio_note( Request* req_l ); virtual Midi_item* midi_item_p(); - bool on_b_; }; struct Audio_text : Audio_item { diff --git a/lily/include/audio-score.hh b/lily/include/audio-score.hh index 845b598e47..407a7b412d 100644 --- a/lily/include/audio-score.hh +++ b/lily/include/audio-score.hh @@ -7,8 +7,7 @@ #ifndef AUDIO_SCORE_HH #define AUDIO_SCORE_HH -#include "proto.hh" -#include "parray.hh" +#include "lily-proto.hh" #include "plist.hh" /** all stuff which goes onto midi. notes, signs, symbols in a score @@ -18,18 +17,23 @@ class Audio_score { public: - Audio_score( Midi_def* ); + Audio_score( Score* l ); void add( Audio_column* ); + void add_staff( Audio_staff* l ); + void add(Audio_element*p); -// void output(Tex_stream &ts); + + void output( Midi_stream& midi_stream_r ); + void output_header_track( Midi_stream& midi_stream_r ); - void play( Audio_item* i, Audio_column* c ); void print() const; void process(); Pointer_list audio_column_p_list_; - Midi_def *midi_l_; + Link_list audio_staff_l_list_; + Pointer_list audio_elem_p_list_; + Score* score_l_; }; #endif // AUDIO_SCORE_HH diff --git a/lily/include/axes.hh b/lily/include/axes.hh new file mode 100644 index 0000000000..7dfe8fbf7a --- /dev/null +++ b/lily/include/axes.hh @@ -0,0 +1,24 @@ + +/* + axes.hh -- declare + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef AXES_HH +#define AXES_HH + +enum Axis { + X_AXIS =0, + Y_AXIS =1, + NO_AXES=2, +}; + +class String; + +String axis_name_str(Axis); + +#endif // AXES_HH diff --git a/lily/include/axis-group-item.hh b/lily/include/axis-group-item.hh new file mode 100644 index 0000000000..a461f52c25 --- /dev/null +++ b/lily/include/axis-group-item.hh @@ -0,0 +1,30 @@ +/* + axis-item.hh -- declare Axis_group_item + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef AXIS_ITEM_HH +#define AXIS_ITEM_HH + +#include "axis-group.hh" +#include "item.hh" + +/** + A grouping item. Its special support is in do_breakable_col_processing(). + */ + +class Axis_group_item : public virtual Axis_group_element, public Item { +protected: + virtual void do_breakable_col_processing(); + void OK()const; + virtual void do_print() const; +public: + DECLARE_MY_RUNTIME_TYPEINFO; + +}; + +#endif // AXIS_ITEM_HH diff --git a/lily/include/axis-group-spanner.hh b/lily/include/axis-group-spanner.hh new file mode 100644 index 0000000000..2b7d6e22bf --- /dev/null +++ b/lily/include/axis-group-spanner.hh @@ -0,0 +1,29 @@ +/* + axis-group-spanner.hh -- declare Axis_group_spanner + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef SPAN_AXIS_GROUP_HH +#define SPAN_AXIS_GROUP_HH + +#include "spanner.hh" +#include "axis-group.hh" + +/** An element which groups a line in a certain direction. The most + useful example of this is the Vertical_group_spanner */ +class Axis_group_spanner : public Spanner, public virtual Axis_group_element +{ + void do_break_processing_if_unbroken(); +protected: + virtual void do_break_processing(); + virtual void do_print()const; + +public: + DECLARE_MY_RUNTIME_TYPEINFO; +}; + +#endif // SPAN_AXIS_GROUP_HH diff --git a/lily/include/axis-group.hh b/lily/include/axis-group.hh new file mode 100644 index 0000000000..bdf758cb42 --- /dev/null +++ b/lily/include/axis-group.hh @@ -0,0 +1,53 @@ +/* +axis-group.hh -- declare Axis_group_administration, Axis_group_element + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef Axis_group_administration_HH +#define Axis_group_administration_HH + +#include "parray.hh" +#include "axes.hh" +#include "real.hh" +#include "lily-proto.hh" +#include "score-elem.hh" +/** + Do the dirty work for Axis_group_element. + */ +struct Axis_group_administration { + Link_array elem_l_arr_; + + Interval extent(Axis)const; + void print() const ; + Axis_group_administration(Axis_group_administration const&); + Axis_group_administration(){} + void remove_all(Axis a1,Axis a2); + + bool contains_b(Score_elem const *)const; + void add_element(Score_elem*, Axis_group_element*, Axis a1, Axis a2); + void remove_element(Score_elem*, Axis a1, Axis a2); +}; + +/** + Treat a group of elements a unity in either or both axis sense . + This is a wrapper around Axis_group_administration + */ +class Axis_group_element : public virtual Score_elem { +protected: + Axis_group_administration axis_admin_; + virtual void do_print()const; + virtual Link_array get_extra_dependencies()const; + virtual void do_unlink(); + +public: + virtual void remove_all()=0; + virtual void add_element(Score_elem*)=0; + virtual void remove_element(Score_elem*)=0; + virtual bool contains_b(Score_elem const *)const; + DECLARE_MY_RUNTIME_TYPEINFO; +}; +#endif // Axis_group_administration_HH diff --git a/lily/include/bar-column-grav.hh b/lily/include/bar-column-grav.hh new file mode 100644 index 0000000000..70b7bcf63a --- /dev/null +++ b/lily/include/bar-column-grav.hh @@ -0,0 +1,31 @@ +/* + bar-column-grav.hh -- declare Bar_column_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef BAR_COLUMN_GRAV_HH +#define BAR_COLUMN_GRAV_HH + +#include "engraver.hh" + +/// couple bars and appropriate scripts +class Bar_column_engraver :public Engraver { + Bar_column *barcol_p_; + Array< Script * > script_l_arr_; + + Bar *bar_l_; + +protected: + virtual void acknowledge_element(Score_elem_info); + virtual void do_pre_move_processing(); + virtual void do_post_move_processing(); +public: + Bar_column_engraver(); + DECLARE_MY_RUNTIME_TYPEINFO; +}; + +#endif // BAR_COLUMN_GRAV_HH diff --git a/lily/include/bar-column.hh b/lily/include/bar-column.hh new file mode 100644 index 0000000000..7c7fb426ad --- /dev/null +++ b/lily/include/bar-column.hh @@ -0,0 +1,30 @@ +/* + bar-column.hh -- declare Bar_column + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef BAR_COLUMN_HH +#define BAR_COLUMN_HH + +#include "script-column.hh" + +/** + The scripts over a and the bar itself. + */ +class Bar_column : public Script_column { + Bar * bar_l_; + +public: + Bar_column(); + void set_bar( Bar*); +protected: + SCORE_ELEM_CLONE(Bar_column); + void do_substitute_dependency(Score_elem*,Score_elem*); + DECLARE_MY_RUNTIME_TYPEINFO; +}; + +#endif // BAR_COLUMN_HH diff --git a/lily/include/bar-number-grav.hh b/lily/include/bar-number-grav.hh new file mode 100644 index 0000000000..287706b6ee --- /dev/null +++ b/lily/include/bar-number-grav.hh @@ -0,0 +1,29 @@ +/* + bar-number-grav.hh -- declare Bar_number_grav + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef BAR_NUMBER_GRAV_HH +#define BAR_NUMBER_GRAV_HH + +#include "engraver.hh" + +/** + catch bars, and put a number over them. + */ +class Bar_number_grav : public Engraver { + Script * script_p_; + int number_i_; +protected: + + void acknowledge_element(Score_elem_info); + void do_pre_move_processing(); +public: + Bar_number_grav(); + DECLARE_MY_RUNTIME_TYPEINFO; +}; +#endif // BAR_NUMBER_GRAV_HH diff --git a/lily/include/bar.hh b/lily/include/bar.hh index 9a7a8b92b6..c03527e6cc 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -8,6 +8,8 @@ #define BAR_HH #include "item.hh" /** + A vertical bar. + TODO: connections with pre and postbreak */ class Bar:public Item { diff --git a/lily/include/boxes.hh b/lily/include/boxes.hh index 22a2eec3a5..8161a84518 100644 --- a/lily/include/boxes.hh +++ b/lily/include/boxes.hh @@ -9,19 +9,28 @@ #include "real.hh" #include "interval.hh" #include "offset.hh" +#include "axes.hh" -/// a square subset of Real^2 struct Box { - Interval x, y; - + Interval interval_a_[NO_AXES]; + + Interval &x() {return interval_a_[X_AXIS]; } + Interval &y(){ return interval_a_[Y_AXIS]; } + Interval x()const{ return interval_a_[X_AXIS]; } + Interval y()const{return interval_a_[Y_AXIS]; } + Interval operator[](Axis a ) { + return interval_a_[a]; + } + void translate(Offset o) { - x.translate(o.x); - y.translate(o.y); + x().translate(o.x()); + y().translate(o.y()); } + /// smallest box enclosing #b# void unite(Box b) { - x.unite(b.x); - y.unite(b.y); + x().unite(b.x()); + y().unite(b.y()); } Box(); Box(Interval ix, Interval iy); diff --git a/lily/include/break.hh b/lily/include/break.hh index e016a8806a..0a9fafe68c 100644 --- a/lily/include/break.hh +++ b/lily/include/break.hh @@ -36,7 +36,7 @@ struct Col_stats class Break_algorithm { protected: - PScore *pscore_l_; + Paper_score *pscore_l_; Real linelength; /// search all pcols which are breakable. @@ -69,7 +69,7 @@ public: Line_spacer* (*get_line_spacer)(); Break_algorithm(); - void set_pscore(PScore*); + void set_pscore(Paper_score*); /// check if the spacing/breaking problem is well-stated void problem_OK()const; diff --git a/lily/include/collision.hh b/lily/include/collision.hh index 3891a5a0c1..162c5fe385 100644 --- a/lily/include/collision.hh +++ b/lily/include/collision.hh @@ -10,14 +10,17 @@ #ifndef COLLISION_HH #define COLLISION_HH #include "lily-proto.hh" -#include "item.hh" +#include "elem-group-item.hh" -/** TODO +/** + Resolve conflicts between various Note_columns (chords). + + TODO multistaff support (see Chlapik: equal noteheads should be on the same hpos.) */ -class Collision : public Item { +class Collision : public Horizontal_vertical_group_item { protected: virtual void do_substitute_dependency(Score_elem*,Score_elem*); virtual void do_pre_processing(); @@ -26,6 +29,5 @@ public: DECLARE_MY_RUNTIME_TYPEINFO; void add (Note_column*ncol_l); Collision(); - }; #endif // COLLISION_HH diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 11a1e44bdf..5d173ca9f9 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -1,5 +1,5 @@ /* - command-request.hh -- declare Non musical requests + command-request.hh -- declare non-musical requests source file of the GNU LilyPond music typesetter @@ -12,6 +12,7 @@ #include "request.hh" #include "varray.hh" +#include "duration.hh" /** Request which are assumed to be "happening" before the musical requests. */ @@ -34,6 +35,8 @@ public: class Command_script_req : public Command_req, public Script_req { public: + // huh? + Command_script_req(); REQUESTMETHODS(Command_script_req, commandscript); }; @@ -49,15 +52,29 @@ public: class Timing_req : public Command_req { public: REQUESTMETHODS(Timing_req, timing); + virtual Tempo_req * tempo(){return 0; } + Tempo_req(); }; +class Tempo_req : public Timing_req +{ +public: + Duration dur_; + int metronome_i_; + + Tempo_req(); + REQUESTMETHODS(Tempo_req, tempo); + bool do_equal_b(Request *)const; +}; + class Partial_measure_req : public Timing_req { public: Moment duration_; Partial_measure_req(Moment); REQUESTMETHODS(Partial_measure_req, partial); + bool do_equal_b(Request*)const; }; /** @@ -67,9 +84,9 @@ class Meter_change_req : public Timing_req { public: int beats_i_, one_beat_i_; - int compare(Meter_change_req const&); Meter_change_req(); void set(int,int); + bool do_equal_b(Request*)const; REQUESTMETHODS(Meter_change_req, meterchange); }; @@ -78,6 +95,7 @@ class Cadenza_req : public Timing_req { public: /// turn on? bool on_b_; + bool do_equal_b(Request*)const; Cadenza_req(bool); REQUESTMETHODS(Cadenza_req,cadenza); }; @@ -85,7 +103,7 @@ public: /// check if we're at start of a measure. class Barcheck_req : public Timing_req { public: - + bool do_equal_b(Request *)const; REQUESTMETHODS(Barcheck_req,barcheck); }; @@ -93,7 +111,7 @@ class Measure_grouping_req : public Timing_req { public: Array beat_i_arr_; Array elt_length_arr_; - + bool do_equal_b(Request *)const; REQUESTMETHODS(Measure_grouping_req, measuregrouping); }; @@ -103,7 +121,8 @@ class Bar_req : public Command_req { public: String type_str_; Bar_req(String); - int compare(const Bar_req&)const; + bool do_equal_b(Request*)const; + REQUESTMETHODS(Bar_req,bar); }; diff --git a/lily/include/elem-group-item.hh b/lily/include/elem-group-item.hh index bf532c035d..b1248cc990 100644 --- a/lily/include/elem-group-item.hh +++ b/lily/include/elem-group-item.hh @@ -10,15 +10,25 @@ #ifndef ELEM_GROUP_ITEM_HH #define ELEM_GROUP_ITEM_HH +#include "axis-group-item.hh" #include "elem-group.hh" -#include "item.hh" -class Horizontal_vertical_group_item : public Item, public Horizontal_vertical_group { + +/** + Treat a collection of items as a unity + */ +class Horizontal_vertical_group_item : public Axis_group_item, public Horizontal_vertical_group_element { +protected: + virtual void do_print() const; + virtual void remove_all() { Horizontal_vertical_group_element::remove_all(); } public: + virtual void add_element(Score_elem*e) { Horizontal_vertical_group_element::add_element(e); } + virtual void remove_element(Score_elem*e) { Horizontal_vertical_group_element::remove_element(e); } + DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEM_CLONE(Horizontal_vertical_group_item); -protected: - virtual void do_print() const; + + }; #endif // ELEM_GROUP_ITEM_HH diff --git a/lily/include/elem-group.hh b/lily/include/elem-group.hh index 9569dcd90c..baf3010c09 100644 --- a/lily/include/elem-group.hh +++ b/lily/include/elem-group.hh @@ -1,5 +1,5 @@ /* - elem-group.hh -- declare Horizontal_vertical_group + elem-group.hh -- declare Horizontal_vertical_group_element source file of the GNU LilyPond music typesetter @@ -11,49 +11,36 @@ #define ELEM_GROUP_HH #include "score-elem.hh" +#include "axis-group.hh" -class Elbement_group: public virtual Score_elem { + + +/** + Treat a group of elements a unity in horizontal sense . + A column is a typical Vertical_group. + */ +class Horizontal_group_element : public virtual Axis_group_element { protected: - Link_array elem_l_arr_; - - virtual void do_print() const ; -public: - Elbement_group(Elbement_group const&); - Elbement_group(); - bool contains_b(Score_elem const *)const; - void add_element(Score_elem*); - DECLARE_MY_RUNTIME_TYPEINFO; -}; + virtual void remove_all(); + virtual Interval do_width()const; -class Horizontal_group : public Elbement_group { public: DECLARE_MY_RUNTIME_TYPEINFO; - Horizontal_group(){} - void add_element(Score_elem*); - Horizontal_group(Horizontal_group const&); - void remove_element(Score_elem*); + virtual void add_element(Score_elem*); + virtual void remove_element(Score_elem*); -protected: - virtual Horizontal_group * horizontal_group() { return this; } - virtual void do_substitute_dependency(Score_elem*,Score_elem*); - virtual void do_print() const ; - virtual void translate_x(Real); - virtual Interval do_width()const; }; - -class Vertical_group : public Elbement_group { +/** + Like Horizontal_group_element, but in X direction + */ +class Vertical_group_element : public virtual Axis_group_element { protected: - virtual void translate_y(Real); - virtual void do_print() const ; virtual Interval do_height()const; - virtual void do_substitute_dependency(Score_elem*,Score_elem*); - virtual Vertical_group * vertical_group() { return this; } + virtual void remove_all(); + public: - void add_element(Score_elem*); - void remove_element(Score_elem*); - - Vertical_group(Vertical_group const &); - Vertical_group(){} + virtual void add_element(Score_elem*); + virtual void remove_element(Score_elem*); DECLARE_MY_RUNTIME_TYPEINFO; }; @@ -61,18 +48,16 @@ public: dimensions are the unions of the dimensions of what it contains. Translation means translating the contents. */ -class Horizontal_vertical_group : public Vertical_group, - public Horizontal_group +class Horizontal_vertical_group_element : public Vertical_group_element, + public Horizontal_group_element { protected: - virtual Horizontal_vertical_group* elem_group() { return this; } + virtual void remove_all(); public: - Horizontal_vertical_group(); - bool contains_b(Score_elem const *)const; - DECLARE_MY_RUNTIME_TYPEINFO; - virtual void do_substitute_dependency(Score_elem*,Score_elem*); - virtual void do_print() const; - void add_element(Score_elem*); + virtual void add_element(Score_elem*); + virtual void remove_element(Score_elem*); + + DECLARE_MY_RUNTIME_TYPEINFO; }; #endif // ELEM_GROUP_HH diff --git a/lily/include/engraver-group.hh b/lily/include/engraver-group.hh index 96e67feaa8..2e3e4941bd 100644 --- a/lily/include/engraver-group.hh +++ b/lily/include/engraver-group.hh @@ -24,7 +24,6 @@ */ class Engraver_group_engraver : public Engraver, public virtual Translator { protected: - Pointer_list grav_list_; Link_array group_l_arr_; Link_array nongroup_l_arr_; @@ -32,11 +31,10 @@ protected: Array announce_info_arr_; virtual void do_print()const; - virtual bool removable_b()const; - public: - virtual void print() const { Engraver::print(); } + Engraver*get_simple_engraver(char const*typeinfo)const; + virtual void print() const ; Input_translator * itrans_l_; void check_removal(); @@ -53,7 +51,8 @@ public: */ virtual void terminate_engraver(Engraver * grav_l); - DECLARE_MY_RUNTIME_TYPEINFO; + + DECLARE_MY_RUNTIME_TYPEINFO; /** Remove #grav_l# from the list, and return it. @@ -84,7 +83,6 @@ public: */ Translator * ancestor_l(int l=1); int depth_i() const; - }; #endif // ENGRAVERGROUP_HH diff --git a/lily/include/engraver.hh b/lily/include/engraver.hh index 52cd3bd7ea..60b8b95ca1 100644 --- a/lily/include/engraver.hh +++ b/lily/include/engraver.hh @@ -64,11 +64,6 @@ protected: virtual void do_creation_processing () {} virtual void do_removal_processing() {} - /** - typeset a "command" item. Default: pass on to daddy. - If the column is not breakable, #pre_p# and #post_p# are junked - */ - virtual void typeset_breakable_item(Item * nobreak_p); /** Invoke walker method to typeset element. Default: pass on to daddy. */ @@ -129,6 +124,7 @@ public: bool is_bottom_engraver() const; void post_move_processing(); + void removal_processing(); Engraver_group_engraver * daddy_grav_l_; diff --git a/lily/include/general-script-def.hh b/lily/include/general-script-def.hh index acaa554019..c384d4fa10 100644 --- a/lily/include/general-script-def.hh +++ b/lily/include/general-script-def.hh @@ -30,7 +30,7 @@ public: virtual ~General_script_def() {} protected: - virtual bool do_equal_b(General_script_def const &)const; + virtual bool do_equal_b(General_script_def const *)const; virtual void do_print()const; }; diff --git a/lily/include/head-column.hh b/lily/include/head-column.hh index 77065d84cb..f95733201b 100644 --- a/lily/include/head-column.hh +++ b/lily/include/head-column.hh @@ -12,6 +12,9 @@ #include "script-column.hh" +/** + Scripts and rests/noteheads + */ class Head_column : public Script_column { public: @@ -27,7 +30,7 @@ public: Stem* stem_l_; void add(Note_head*); - void add(Script*s) { Script_column::add(s) ; } + virtual void add(Script*s); virtual void set(Stem*); Head_column(); DECLARE_MY_RUNTIME_TYPEINFO; diff --git a/lily/include/head-grav.hh b/lily/include/head-grav.hh index 2a5b2be280..57711a27be 100644 --- a/lily/include/head-grav.hh +++ b/lily/include/head-grav.hh @@ -9,17 +9,22 @@ #define HEADGRAV_HH #include "engraver.hh" -struct Note_head_engraver : Engraver { +/** + make balls and rests + */ +class Note_head_engraver : public Engraver { Note_head* note_p_; Rhythmic_req * note_req_l_; - /* *************** */ +public: Note_head_engraver(); + DECLARE_MY_RUNTIME_TYPEINFO; +protected: virtual bool do_try_request(Request *req_l) ; virtual void do_process_requests(); virtual void do_pre_move_processing(); virtual void do_post_move_processing(); - DECLARE_MY_RUNTIME_TYPEINFO; + }; diff --git a/lily/include/horizontal-group-item.hh b/lily/include/horizontal-group-item.hh index 3495af9f97..f1fc8b3c9c 100644 --- a/lily/include/horizontal-group-item.hh +++ b/lily/include/horizontal-group-item.hh @@ -11,15 +11,19 @@ #define HORIZONTAL_GROUP_ITEM_HH #include "elem-group.hh" -#include "item.hh" +#include "axis-group-item.hh" -class Horizontal_group_item : public Item, public Horizontal_group { +class Horizontal_group_item : public Axis_group_item, public Horizontal_group_element { +protected: + virtual void remove_all() { Horizontal_group_element::remove_all(); } + virtual void do_print() const; +public: + virtual void add_element(Score_elem*e) { Horizontal_group_element::add_element(e); } + virtual void remove_element(Score_elem*e) { Horizontal_group_element::remove_element(e); } DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEM_CLONE(Horizontal_group_item); -protected: - virtual void do_breakable_col_processing(); - void OK()const; - virtual void do_print() const { Elbement_group::do_print(); } + + }; #endif // HORIZONTAL_GROUP_ITEM_HH diff --git a/lily/include/input-translator.hh b/lily/include/input-translator.hh index b2883a30cf..49f44bec01 100644 --- a/lily/include/input-translator.hh +++ b/lily/include/input-translator.hh @@ -24,7 +24,10 @@ struct Input_translator_list : public Pointer_list ~Input_translator_list(){} }; -struct Input_translator : Input { +/** Define a intereter for music. This is an runtime interface to the + typesystem */ +class Input_translator : public Input { +public: Input_translator_list contains_itrans_p_list_; Array consists_str_arr_; Array alias_str_arr_; diff --git a/lily/include/item.hh b/lily/include/item.hh index dcbae6374f..0768c5885e 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -14,7 +14,7 @@ #include "score-elem.hh" /** - a horizontally fixed size element of the score + A horizontally fixed size element of the score. Item is the datastructure for printables whose width is known before the spacing is calculated @@ -30,7 +30,10 @@ public: Item * broken_to_a_[2]; - // nobreak = 0, pre =1, post = 2 + /// should be put in a breakable col. + bool breakable_b_; + int break_status_i_; + /// nobreak = 0, pre = -1, post = 1 int break_status_i()const; Item * find_prebroken_piece(PCol*)const; Item * find_prebroken_piece(Line_of_score*)const; @@ -47,7 +50,6 @@ protected: virtual void do_print()const; void copy_breakable_items(); - }; diff --git a/lily/include/key-grav.hh b/lily/include/key-grav.hh index 7b54214892..51a978e592 100644 --- a/lily/include/key-grav.hh +++ b/lily/include/key-grav.hh @@ -13,7 +13,14 @@ #include "engraver.hh" #include "key.hh" -struct Key_engraver : Engraver { +/** + Make the key signature. + */ +class Key_engraver : public Engraver { + void create_key(); + void read_req(Key_change_req * r); + +public: Key key_; Key_change_req * keyreq_l_; Key_item * kit_p_; @@ -21,17 +28,15 @@ struct Key_engraver : Engraver { bool default_key_b_; bool change_key_b_; +protected: virtual bool do_try_request(Request *req_l); virtual void do_process_requests(); virtual void do_pre_move_processing(); virtual void do_post_move_processing(); virtual void acknowledge_element(Score_elem_info); +public: Key_engraver(); DECLARE_MY_RUNTIME_TYPEINFO; -private: - void create_key(); - - void read_req(Key_change_req * r); }; #endif // KEYGRAV_HH diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index a1ab3dc6d4..b980e3ff0f 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -19,7 +19,6 @@ struct Key_item : Item { bool default_b_; - /* *************** */ DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEM_CLONE(Key_item); @@ -27,6 +26,7 @@ struct Key_item : Item { void add(int pitch, int acc); void read(const Key_engraver&); void set_c_position(int); +protected: 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 5619bf021a..5e42f95f1e 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -10,18 +10,25 @@ #define LILY_PROTO_HH #include "proto.hh" -struct My_lily_lexer; + struct Absolute_dynamic_req; +struct Axis_group_element; +struct Axis_group; struct Translator; +struct Audio_element; struct Audio_column; struct Audio_item; struct Audio_key; struct Audio_meter; struct Audio_note; +struct Audio_note_off; struct Audio_score; +struct Audio_staff; struct Audio_tempo; struct Atom; struct Bar; +struct Bar_column_engraver; +struct Bar_column; struct Bar_engraver; struct Bar_req; struct Barcheck_req; @@ -50,6 +57,7 @@ struct Complex_music; struct Cresc_req; struct Crescendo ; struct Decresc_req; + struct Directional_spanner; struct Disallow_break_req; struct Durational_req; @@ -64,7 +72,7 @@ struct Group_change_req; struct Group_feature_req; struct Head_column; struct Horizontal_align_item; -struct Horizontal_group; +struct Horizontal_group_element; struct Horizontal_group_item; struct Horizontal_vertical_group; struct Idealspacing; @@ -92,6 +100,7 @@ struct Local_key_engraver; struct Lookup; struct Lyric_item; struct Lyric_req; +struct My_lily_lexer; struct Measure_grouping_req; struct Melodic_req; struct Meter; @@ -105,11 +114,14 @@ struct Midi_item; struct Midi_key; struct Midi_meter; struct Midi_note; +struct Midi_note_event; +struct Midi_note_off; struct Midi_output; struct Midi_score; struct Midi_stream; struct Midi_tempo; struct Midi_track; +struct Midi_walker; struct Mixed_qp; struct Molecule; struct Music_general_chord; @@ -130,7 +142,7 @@ struct Offset; struct Output; struct Performer; struct PCol; -struct PScore; +struct Paper_score; struct Paper_def; struct Partial_measure_req; struct Plet; @@ -184,6 +196,7 @@ struct Symtable; struct Symtables; struct Super_elem; struct Terminate_voice_req; +struct Tempo_req; struct Tex_stream; struct Text_def; struct Text_gob; @@ -197,7 +210,7 @@ struct Time_description; struct Timing_req; struct Vertical_brace; struct Vertical_spanner; -struct Vertical_group; +struct Vertical_group_element; struct Vertical_align_spanner; struct Vertical_align_engraver; struct Vertical_align_element; diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh index 2d4ed66e8f..7316df60e7 100644 --- a/lily/include/local-key-item.hh +++ b/lily/include/local-key-item.hh @@ -21,20 +21,26 @@ struct Local_acc { TODO: update item if Items are removed + + TODO + + figure out private/public + */ -struct Local_key_item : Item { +class Local_key_item : public Item { +public: DECLARE_MY_RUNTIME_TYPEINFO; Array accs; Link_array support_items_; int c0_position; - /* *************** */ + Local_key_item(int c0position); void add_support(Item*); void add(int oct, int pitch, int acc); void add(Melodic_req*); -public: +protected: virtual void do_pre_processing(); virtual void do_substitute_dependency(Score_elem*,Score_elem*); virtual Molecule* brew_molecule_p()const; diff --git a/lily/include/main.hh b/lily/include/main.hh index 7ec479ebd2..0c461a36d6 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -12,6 +12,7 @@ String find_file(String); String get_version_str(); extern Sources* source_l_g; extern bool only_midi; +extern int exit_status_i_; extern String default_out_fn; diff --git a/lily/include/midi-def.hh b/lily/include/midi-def.hh index 13073251ab..89a7543567 100644 --- a/lily/include/midi-def.hh +++ b/lily/include/midi-def.hh @@ -16,6 +16,7 @@ /** + definitions for midi output. Rather empty */ struct Midi_def { // ugh! @@ -25,7 +26,6 @@ struct Midi_def { /// output file name String outfile_str_; - Assoc *real_vars_p_; Input_translator* itrans_p_; /// duration of whole note @@ -37,11 +37,9 @@ struct Midi_def { Real duration_to_seconds_f(Moment); Global_translator* get_global_translator_p() const; - Real get_var( String s ) const; int get_tempo_i( Moment moment ); void print() const; void set( Input_translator* itrans_p ); - void set_var( String s, Real r ); void set_tempo( Moment moment, int count_per_minute_i ); }; diff --git a/lily/include/midi-item.hh b/lily/include/midi-item.hh index 369d4a4886..4906f27ba8 100644 --- a/lily/include/midi-item.hh +++ b/lily/include/midi-item.hh @@ -9,6 +9,8 @@ #include "string.hh" #include "lily-proto.hh" +#include "virtual-methods.hh" +#include "moment.hh" /** Any piece of midi information. @@ -16,6 +18,7 @@ Maybe use base classes for RIFF files? */ struct Midi_item { + DECLARE_MY_RUNTIME_TYPEINFO; Midi_item( Audio_item* audio_item_l ); static String i2varint_str( int i ); void output( Midi_stream* midi_stream_l ) const; @@ -29,72 +32,104 @@ private: Midi_item& operator =( Midi_item const& ); }; -struct Midi_key : public Midi_item { - Midi_key( Audio_item* audio_item_l ); - +/** + variable sized MIDI data + */ +struct Midi_chunk : Midi_item { + DECLARE_MY_RUNTIME_TYPEINFO; + Midi_chunk(); + + void add( String str ); + void set( String header_str, String data_str, String footer_str ); + virtual String str() const; + +private: + String data_str_; + String footer_str_; + String header_str_; +}; + +struct Midi_duration : public Midi_item { + DECLARE_MY_RUNTIME_TYPEINFO; + Midi_duration( Real seconds_f ); + virtual String str() const; + Real seconds_f_; +}; + +struct Midi_header : Midi_chunk { + DECLARE_MY_RUNTIME_TYPEINFO; + + Midi_header( int format_i, int tracks_i, int clocks_per_4_i ); + }; /** Change instrument event */ struct Midi_instrument : public Midi_item { + DECLARE_MY_RUNTIME_TYPEINFO; Midi_instrument( int channel_i, String instrument_str ); virtual String str() const; String instrument_str_; }; -struct Midi_note : public Midi_item { - /** - Generate a note-event on a channel. - - @param #melreq_l# is the pitch. - */ - Midi_note( Audio_item* audio_item_l ); +struct Midi_key : public Midi_item { + DECLARE_MY_RUNTIME_TYPEINFO; + Midi_key( Audio_item* audio_item_l ); + virtual String str() const; - - /* *************** */ - int const c0_pitch_i_c_ = 60; - bool on_b_; - Byte dynamic_byte_; }; -struct Midi_duration : public Midi_item { - Midi_duration( Real seconds_f ); +struct Midi_meter : Midi_item { + DECLARE_MY_RUNTIME_TYPEINFO; + Midi_meter( Audio_item* audio_item_l ); + virtual String str() const; - /* *************** */ - Real seconds_f_; + int clocks_per_1_i_; }; -struct Midi_chunk : Midi_item { - Midi_chunk(); +/** + Turn a note on (blond). + */ +struct Midi_note : public Midi_item { + DECLARE_MY_RUNTIME_TYPEINFO; + Midi_note( Audio_item* audio_item_l ); - void add( String str ); - void set( String header_str, String data_str, String footer_str ); + Moment duration() const; + int pitch_i() const; virtual String str() const; -private: - String data_str_; - String footer_str_; - String header_str_; + + int const c0_pitch_i_c_ = 60; + Byte dynamic_byte_; }; -struct Midi_header : Midi_chunk { - /* *************** */ - Midi_header( int format_i, int tracks_i, int clocks_per_4_i ); +/** + Turn a note off (dark). + */ +struct Midi_note_off : public Midi_item { + DECLARE_MY_RUNTIME_TYPEINFO; + Midi_note_off( Midi_note* midi_note_l ); + + int pitch_i() const; + virtual String str() const; + + Byte aftertouch_byte_; }; struct Midi_text : Midi_item { + DECLARE_MY_RUNTIME_TYPEINFO; + enum Type { TEXT = 1, COPYRIGHT, TRACK_NAME, INSTRUMENT_NAME, LYRIC, MARKER, CUE_POINT }; - - Midi_text( Audio_item* audio_item_l ); Midi_text( Midi_text::Type type, String text_str ); - + Midi_text( Audio_item* audio_item_l ); + virtual String str() const; Type type_; @@ -102,24 +137,19 @@ struct Midi_text : Midi_item { }; struct Midi_tempo : Midi_item { - Midi_tempo( Audio_item* audio_item_l ); + DECLARE_MY_RUNTIME_TYPEINFO; Midi_tempo( int per_minute_4_i ); - + Midi_tempo( Audio_item* audio_item_l ); + virtual String str() const; int per_minute_4_i_; }; -struct Midi_meter : Midi_item { - Midi_meter( Audio_item* audio_item_l ); - - virtual String str() const; - int clocks_per_1_i_; -}; - struct Midi_track : Midi_chunk { + DECLARE_MY_RUNTIME_TYPEINFO; int number_i_; - /* *************** */ + Midi_track(); void add( int delta_time_i, String event ); diff --git a/lily/include/midi-output.hh b/lily/include/midi-output.hh deleted file mode 100644 index 0338916a53..0000000000 --- a/lily/include/midi-output.hh +++ /dev/null @@ -1,30 +0,0 @@ -/* - midioutput.hh -- declare Midi_output - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - - -#ifndef MIDIOUTPUT_HH -#define MIDIOUTPUT_HH -#include "lily-proto.hh" - - -struct Midi_output { - #if 0 - Midi_output(Score* score_l, Midi_def* ); - - void do_staff(Staff*st_l, int count); - void header(); - void staffs(); - - Score* score_l_; - Midi_def* midi_l_; - Midi_stream* midi_stream_l_; -#endif -}; - -#endif // MIDIOUTPUT_HH - diff --git a/lily/include/midi-stream.hh b/lily/include/midi-stream.hh index c18cb9c4e9..9fded298d5 100644 --- a/lily/include/midi-stream.hh +++ b/lily/include/midi-stream.hh @@ -1,7 +1,8 @@ -// -// midistream.hh -- part of GNU LilyPond -// -// copyright 1997 Jan Nieuwenhuizen +/* + midi-stream.hh -- declare Midi_stream + + (c) 1997 Jan Nieuwenhuizen + */ #ifndef MIDI_STREAM_HH #define MIDI_STREAM_HH @@ -9,24 +10,19 @@ #include #include "string.hh" -/// Midi output +/// Midi outputfile struct Midi_stream { - ostream* os_p_; - String filename_str_; - int clocks_per_4_i_; - int tracks_i_; - - Midi_stream( String filename_str, int tracks_i, int clocks_per_4_i_ ); + Midi_stream( String filename_str ); ~Midi_stream(); Midi_stream& operator <<( String str ); Midi_stream& operator <<( Midi_item const& mitem_c_r ); Midi_stream& operator <<( int i ); - void header(); void open(); -//private: -// Midi_stream(Midi_stream const&); + ostream* os_p_; + String filename_str_; }; -#endif // MIDI_STREAM_HH // + +#endif // MIDI_STREAM_HH diff --git a/lily/include/midi-walker.hh b/lily/include/midi-walker.hh new file mode 100644 index 0000000000..a9ce619a09 --- /dev/null +++ b/lily/include/midi-walker.hh @@ -0,0 +1,48 @@ +/* + midi-walker.hh -- declare Midi_walker + + (c) 1996, 1997 Han-Wen Nienhuys + Jan Nieuwenhuizen + */ + +#ifndef MIDI_WALKER_HH +#define MIDI_WALKER_HH + +#include "proto.hh" +#include "plist.hh" +#include "pcursor.hh" +#include "pqueue.hh" +#include "lily-proto.hh" +#include "moment.hh" + +struct Midi_note_event : PQueue_ent +{ + bool ignore_b_; + Midi_note_event(); +}; + +int compare(Midi_note_event const& left, Midi_note_event const& right ); + +/** + walk audio and output midi + */ +class Midi_walker : public PCursor +{ +public: + Midi_walker( Audio_staff* audio_staff_l, Midi_track* midi_track_l ); + ~Midi_walker(); + + void process(); + +private: + void do_start_note( Midi_note* note_l ); + void do_stop_notes( Moment now_mom ); + void output_event( Moment now_mom, Midi_item* l ); + + Midi_track* track_l_; + PQueue stop_note_queue; + Moment last_mom_; +}; + + +#endif // MIDI_WALKER_HH diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh index 2eccfd3ee8..d1057bebf0 100644 --- a/lily/include/molecule.hh +++ b/lily/include/molecule.hh @@ -22,8 +22,7 @@ struct Molecule { void add_bottom(const Molecule &m); void add(Molecule const &m); void translate(Offset); - void translate_y(Real); - void translate_x(Real); + void translate(Real,Axis); void add(Atom const & a) ; /// how big is #this#? Box extent() const; diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 42ad968c42..c38340706e 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -16,24 +16,23 @@ #include "moment.hh" class Music_iterator { + Arrayreport_to_l_arr_; + void push_translator(Translator*); + void pop_translator(); protected: bool first_b_; virtual void do_print()const; -public: - Music_iterator *daddy_iter_l_; - DECLARE_MY_RUNTIME_TYPEINFO; - Arrayreport_to_l_arr_; - - Translator *report_to_l()const; - - static Music_iterator* static_get_iterator_p(Music*,Translator*); + virtual Translator * get_req_translator_l(); Music_iterator* get_iterator_p(Music*)const; void set_translator(Translator*); - void push_translator(Translator*); - void pop_translator(); - + Music_iterator *daddy_iter_l_; +public: + Translator *report_to_l()const; + DECLARE_MY_RUNTIME_TYPEINFO; + + static Music_iterator* static_get_iterator_p(Music*,Translator*); Music_iterator(); virtual void process_and_next(Moment until); @@ -42,16 +41,8 @@ public: virtual ~Music_iterator(); virtual void construct_children(); void print()const; - virtual Translator * get_req_translator_l(); }; -class Change_iterator : public Music_iterator { - Change_reg * change_l_; -public: - DECLARE_MY_RUNTIME_TYPEINFO; - virtual void process_and_next(Moment); - Change_iterator(Change_reg*); -}; class Chord_iterator : public Music_iterator { @@ -91,7 +82,10 @@ class Voice_iterator : private PCursor, public Music_iterator Moment here_mom_; const Voice * voice_C_; Music_iterator * iter_p_; - void next_element(); + void start_next_element(); + void leave_element(); + void set_voice_translator(); + public: Voice_iterator(Voice const*); DECLARE_MY_RUNTIME_TYPEINFO; diff --git a/lily/include/music.hh b/lily/include/music.hh index 41531a7902..63ce4b8799 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -17,18 +17,22 @@ #include "lily-proto.hh" #include "string.hh" -/** In Lily, everything that has a length and a pitch (which can be - transposed) is considered "music", +/** + Anything which has length or pitch. + + In Lily, everything that can be thought to have a length and a pitch + (which has a duration which can be transposed) is considered "music", Music is hierarchical: - @seealso Music_list + @see Music_list + */ class Music:public Input { public: Music_list * parent_music_l_; - /** what kind of iterator needed to walk this music? This doesn't + /** The kind of iterator needed to walk this music. This doesn't make sense for simple (ie non-list) music, but it does no harm here. Yes, it did harm Music_list: you can forget to copy it. diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 782541d689..6152be7782 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -51,9 +51,10 @@ public: /* *************** */ void set_duration(Duration); - static int compare(const Rhythmic_req &, const Rhythmic_req &); + bool do_equal_b(Request*)const; virtual Moment duration() const; Rhythmic_req(); + static int compare(Rhythmic_req const&,Rhythmic_req const&); REQUESTMETHODS(Rhythmic_req, rhythmic); }; @@ -88,7 +89,7 @@ public: Text_req(int d, Text_def*); ~Text_req(); Text_req(Text_req const&); - static int compare(const Text_req&,const Text_req&); + REQUESTMETHODS(Text_req,text); }; @@ -120,8 +121,8 @@ struct Melodic_req :virtual Musical_req /// return pitch from central c (in halfnotes) int pitch()const; Melodic_req(); - static int compare(Melodic_req const&, Melodic_req const&); - + bool do_equal_b(Request*)const; + static int compare( Melodic_req const&,Melodic_req const&); REQUESTMETHODS(Melodic_req,melodic); }; @@ -132,6 +133,7 @@ public: /// force/supress printing of accidental. bool forceacc_b_; Note_req(); + bool do_equal_b(Request*)const; Rhythmic_req* rhythmic() { return Rhythmic_req::rhythmic(); } REQUESTMETHODS(Note_req, note); }; @@ -166,7 +168,7 @@ public: enum { NOSPAN, START, STOP } spantype ; - static int compare(const Span_req &r1, const Span_req &r2); + bool do_equal_b(Request*)const; REQUESTMETHODS(Span_req,span); Span_req(); diff --git a/lily/include/my-lily-parser.hh b/lily/include/my-lily-parser.hh index 6c96382498..e606a0f4b3 100644 --- a/lily/include/my-lily-parser.hh +++ b/lily/include/my-lily-parser.hh @@ -38,6 +38,8 @@ class My_lily_parser { public: int default_octave_i_; Duration default_duration_; + Plet plet_; + String textstyle_str_; bool first_b_; bool last_duration_mode_b_ ; diff --git a/lily/include/note-column-grav.hh b/lily/include/note-column-grav.hh index 561944f00f..43ebda4432 100644 --- a/lily/include/note-column-grav.hh +++ b/lily/include/note-column-grav.hh @@ -23,7 +23,7 @@ class Note_column_engraver :public Engraver { bool h_shift_b_; int dir_i_; - /* *************** */ + bool acceptable_elem_b(Score_elem const*)const; protected: virtual void set_feature(Feature); diff --git a/lily/include/note-performer.hh b/lily/include/note-performer.hh index b925617e42..0fb8aecbd4 100644 --- a/lily/include/note-performer.hh +++ b/lily/include/note-performer.hh @@ -18,7 +18,6 @@ public: DECLARE_MY_RUNTIME_TYPEINFO; Note_performer(); - ~Note_performer(); protected: virtual void process_requests(); @@ -28,7 +27,6 @@ protected: private: Melodic_req * note_req_l_; - Moment off_mom_; }; #endif // NOTE_PERFORMER_HH diff --git a/lily/include/offset.hh b/lily/include/offset.hh index bd5b269532..00bc73e0e2 100644 --- a/lily/include/offset.hh +++ b/lily/include/offset.hh @@ -6,33 +6,49 @@ #ifndef OFFSET_HH #define OFFSET_HH + #include "real.hh" +#include "axes.hh" + /// 2d vector struct Offset { - Real x,y; - - Offset operator+(Offset o)const { - Offset r(*this); - r+=o; - return r; + Real coordinate_a_[NO_AXES]; + + Real &y() { return coordinate_a_[Y_AXIS]; } + Real &x() { return coordinate_a_[X_AXIS]; } + Real y()const { return coordinate_a_[Y_AXIS]; } + Real x()const { return coordinate_a_[X_AXIS]; } + + Real &operator[](Axis i) { + return coordinate_a_[i]; + } + Real operator[](Axis i) const{ + return coordinate_a_[i]; } Offset operator+=(Offset o) { - x+=o.x; - y+=o.y; + x()+=o.x(); + y()+=o.y(); return *this; } Offset(Real ix , Real iy) { - x=ix; - y=iy; + x()=ix; + y()=iy; } Offset() { - x=0.0; - y=0.0; + x()=0.0; + y()=0.0; } }; +inline Offset +operator+(Offset o1, Offset const& o2) +{ + o1 += o2; + return o1; +} + #endif // OFFSET_HH diff --git a/lily/include/p-col.hh b/lily/include/p-col.hh index 136d25293c..d66921dc87 100644 --- a/lily/include/p-col.hh +++ b/lily/include/p-col.hh @@ -23,7 +23,7 @@ class PCol { public: Link_list its; - Link_list stoppers, starters; + Link_list starters; /** prebreak is put before end of line. if broken here, then (*this) column is discarded, and prebreak @@ -49,7 +49,7 @@ public: bool error_mark_b_; bool used_b_ ; // manual override.. - PScore * pscore_l_; + Paper_score * pscore_l_; /* *************** */ /// which one (left =0) @@ -79,7 +79,7 @@ public: void set_rank(int); void OK() const; - void set_breakable(); + void set_breakable(); virtual void do_set_breakable(); void print()const; private: diff --git a/lily/include/p-score.hh b/lily/include/p-score.hh index 596e718c41..12ba8c77ad 100644 --- a/lily/include/p-score.hh +++ b/lily/include/p-score.hh @@ -1,5 +1,5 @@ /* - p-score.hh -- declare PScore + p-score.hh -- declare Paper_score source file of the GNU LilyPond music typesetter @@ -16,11 +16,11 @@ #include "plist.hh" /** all stuff which goes onto paper. notes, signs, symbols in a score - #PScore# contains the items, the columns. + #Paper_score# contains the items, the columns. */ -class PScore { +class Paper_score { public: Paper_def *paper_l_; @@ -41,7 +41,7 @@ public: /* *************** */ /* CONSTRUCTION */ - PScore(Paper_def*); + Paper_score(Paper_def*); /// add a line to the broken stuff. Positions given in #config# void set_breaking(Array const &); @@ -49,9 +49,9 @@ public: add the item in specified containers. If breakstatus is set properly, add it to the {pre,post}break of the pcol. */ - void typeset_item(Item *item_p, PCol *pcol_l,int breakstatus=0); + void typeset_item(Item *item_p, PCol *pcol_l); - /// add to bottom of pcols + /// add to bottom of pcols void add(PCol*); /** @@ -75,7 +75,7 @@ public: /* STANDARD ROUTINES */ void OK()const; void print() const; - ~PScore(); + ~Paper_score(); void typeset_element(Score_elem*); void typeset_broken_spanner(Spanner*); /// add a Spanner diff --git a/lily/include/paper-def.hh b/lily/include/paper-def.hh index d172c0bc38..44fc05e12a 100644 --- a/lily/include/paper-def.hh +++ b/lily/include/paper-def.hh @@ -18,7 +18,7 @@ /** - symbols, dimensions and constants + Symbols, dimensions and constants pertaining to visual output. This struct takes care of all kinds of symbols, dimensions and constants. Most of them are related to the point-size of the fonts, @@ -68,7 +68,7 @@ public: /// height of the staff Real standard_height()const; - /// width of a quaver ball + /// width of a crotchet ball Real note_width() const; void print() const; diff --git a/lily/include/performer-group-performer.hh b/lily/include/performer-group-performer.hh index fdca52a576..4c57fc7af8 100644 --- a/lily/include/performer-group-performer.hh +++ b/lily/include/performer-group-performer.hh @@ -23,22 +23,14 @@ public: DECLARE_MY_RUNTIME_TYPEINFO; Input_translator* itrans_l_; - Performer_group_performer(); - ~Performer_group_performer(); - virtual void add( Performer* perf_p ); - virtual void print()const { Performer::print() ; } - virtual Moment get_mom() const; virtual bool do_try_request( Request* req_l ); - virtual bool try_request(Request*r) { return Performer::try_request(r) ; } - - // - virtual void set_track( int& track_i_r ); - virtual int get_track_i() const; - // + virtual void print() const; + virtual bool try_request(Request* r); + protected: - + virtual ~Performer_group_performer(); virtual Translator* find_get_translator_l( String name, String id ); virtual Translator* get_default_interpreter(); diff --git a/lily/include/performer.hh b/lily/include/performer.hh index eda9b784f3..0126c7b231 100644 --- a/lily/include/performer.hh +++ b/lily/include/performer.hh @@ -27,16 +27,9 @@ public: Performer(); virtual ~Performer(); - void print() const; virtual void process_requests(); - virtual void set( Moment mom ); - // - virtual void set_track( int& track_i_r ); - virtual int get_track_i() const; - // - virtual bool try_request( Request* req_l ); virtual void do_removal_processing(); @@ -44,13 +37,10 @@ public: protected: virtual void do_creation_processing(); - virtual bool do_try_request(Request*); virtual int get_tempo_i() const; virtual void do_print() const; - virtual Moment get_mom() const; - virtual void play( Audio_item* p ); - virtual void play( Midi_item* l ); + virtual void play( Audio_element * elem_p ); }; #include "global-performers.hh" diff --git a/lily/include/request.hh b/lily/include/request.hh index 37bf51caa8..07e480137e 100644 --- a/lily/include/request.hh +++ b/lily/include/request.hh @@ -46,8 +46,10 @@ public: virtual Blank_req * blank() { return 0; } virtual Musical_req *musical() { return 0; } virtual Command_req * command() { return 0; } + bool equal_b(Request*) const; protected: - virtual void do_print()const ; + virtual bool do_equal_b(Request*) const; + virtual void do_print()const; }; #define REQUESTMETHODS(T,accessor) \ @@ -67,7 +69,8 @@ public: General_script_def *scriptdef_p_; /* *************** */ - static int compare(const Script_req &, const Script_req &); + bool do_equal_b(Request*)const; + Script_req(); REQUESTMETHODS(Script_req,script); ~Script_req(); diff --git a/lily/include/rest-column.hh b/lily/include/rest-column.hh index 7e2db4272c..6dfdaf16c9 100644 --- a/lily/include/rest-column.hh +++ b/lily/include/rest-column.hh @@ -13,10 +13,8 @@ #include "script-column.hh" #include "head-column.hh" -/** - struct to treat a set of rests as union (one voicegroup should - only produce one rest. - */ +/** struct to treat a set of rests as union (one voice should only + produce one rest. */ class Rest_column : public Head_column { public: DECLARE_MY_RUNTIME_TYPEINFO; diff --git a/lily/include/score-align-grav.hh b/lily/include/score-align-grav.hh index 4dcee6837e..718137ecfa 100644 --- a/lily/include/score-align-grav.hh +++ b/lily/include/score-align-grav.hh @@ -12,6 +12,9 @@ #include "engraver.hh" +/** + Group a number of items across staffs + */ class Score_align_engraver: public Engraver { Horizontal_group_item * align_p_; diff --git a/lily/include/score-column.hh b/lily/include/score-column.hh index 396fc0312b..e108bc8213 100644 --- a/lily/include/score-column.hh +++ b/lily/include/score-column.hh @@ -16,14 +16,14 @@ #include "p-col.hh" /** - - When typesetting hasn't started on PScore yet, the columns which - contain data have a rhythmical position. Score_column is the type - with a rhythmical time attached to it. The calculation of - idealspacing is done with data in these columns. (notably: the - #durations# field) - - */ + Column with durational info. + + The columns which contain data have a rhythmical + position. Score_column is the type with a rhythmical time attached + to it. The calculation of idealspacing is done with data in these + columns. (notably: the #durations# field) + + */ class Score_column : public PCol { friend class Score; diff --git a/lily/include/score-elem.hh b/lily/include/score-elem.hh index 39c0615262..82a6fbfe3d 100644 --- a/lily/include/score-elem.hh +++ b/lily/include/score-elem.hh @@ -15,6 +15,8 @@ #define SCORE_ELEM_CLONE(T) VIRTUAL_COPY_CONS(T, Score_elem) + + /** Both Spanner and Item are Score_elem's. Most Score_elem's depend on other Score_elem's, eg, Beam needs to know and set direction of Stem. So the Beam has to be calculated *before* Stem. This is @@ -29,11 +31,6 @@ class Score_elem : private Directed_graph_node { Molecule *output; // should scrap, and use temp var? - /** - This is needed, because #output# may still be - NULL. - */ - Offset offset_; /** for administration of what was done already @@ -56,12 +53,26 @@ class Score_elem : private Directed_graph_node { Status status_; + Score_elem* dependency(int) const; + Score_elem* dependent(int) const; + int dependent_size() const; + int dependency_size() const; public: - PScore *pscore_l_; - Vertical_group *y_group_l_; - Horizontal_group *x_group_l_; + /** + This is needed, because #output# may still be + NULL. + */ + Offset offset_; + + + + + Paper_score *pscore_l_; + Axis_group_element * axis_group_l_a_[2]; + Score_elem(Score_elem const&); virtual String TeX_string () const ; + String TeX_string_without_offset(Offset)const; virtual void print() const; Paper_def *paper() const; @@ -70,17 +81,24 @@ public: Score_elem(); DECLARE_MY_RUNTIME_TYPEINFO; + Interval extent(Axis)const; Interval width() const; Interval height() const; - virtual void translate_x(Real); - virtual void translate_y(Real); Status status() const; /** translate the symbol. The symbol does not have to be created yet. */ void translate(Offset); - Offset offset()const; + /** + translate in one direction + */ + + void translate(Real, Axis); + Real relative_coordinate(Axis_group_element*, Axis)const; + Offset absolute_offset()const; + Real absolute_coordinate(Axis)const; + Axis_group_element*common_group(Score_elem const* s, Axis a)const; void add_processing(); void OK() const; @@ -91,6 +109,9 @@ public: void post_processing(); void molecule_processing(); + /** + Remove all links (dependencies, dependents, Axis_group_elements. + */ void unlink(); void unlink_all(); void substitute_dependency(Score_elem*,Score_elem*); @@ -109,19 +130,12 @@ public: /* virtual accessors */ - virtual Vertical_group * vertical_group() { return 0; } - virtual Horizontal_group * horizontal_group() { return 0; } virtual Spanner* spanner() { return 0; } - virtual Horizontal_vertical_group* elem_group() { return 0; } virtual Item * item() { return 0; } virtual Line_of_score * line_l() const; SCORE_ELEM_CLONE(Score_elem); - Score_elem* dependency(int) const; - Score_elem* dependent(int) const; - int dependent_size() const; - int dependency_size() const; - + /// no dimension, translation is noop bool empty_b_; /// do not print anything black @@ -135,7 +149,7 @@ protected: virtual void do_print() const {} /// generate the molecule virtual Molecule* brew_molecule_p()const; - ///executed directly after the item is added to the PScore + ///executed directly after the item is added to the Paper_score virtual void do_add_processing(); /// do calculations before determining horizontal spacing virtual void do_pre_processing(); @@ -149,9 +163,8 @@ protected: virtual void do_break_processing(); virtual void handle_broken_dependencies(); virtual void handle_prebroken_dependencies(); - - - + virtual Link_array get_extra_dependencies()const; + virtual void do_unlink(); }; diff --git a/lily/include/score-grav.hh b/lily/include/score-grav.hh index 7a722edc2e..39941cda65 100644 --- a/lily/include/score-grav.hh +++ b/lily/include/score-grav.hh @@ -13,6 +13,9 @@ #include "engraver-group.hh" #include "global-translator.hh" +/** + Top level engraver. Puts elements into appropriate columns. + */ class Score_engraver : public Engraver_group_engraver, public Global_translator { @@ -28,7 +31,7 @@ class Score_engraver : Score_column* musical_column_l_; friend class Score; - void set_cols(Score_column*,Score_column*); + void set_columns(Score_column*,Score_column*); void typeset_all(); public: @@ -52,7 +55,6 @@ protected: virtual void do_creation_processing(); virtual void do_removal_processing(); virtual void announce_element(Score_elem_info); - virtual void typeset_breakable_item(Item * nobreak_p); virtual void do_announces(); virtual void typeset_element(Score_elem*elem_p); virtual Paper_def * paper() const; diff --git a/lily/include/score-performer.hh b/lily/include/score-performer.hh index b4030800b4..b0b584e72a 100644 --- a/lily/include/score-performer.hh +++ b/lily/include/score-performer.hh @@ -11,6 +11,9 @@ #include "performer-group-performer.hh" #include "global-translator.hh" +/** + Top level performer. Completely takes care of MIDI output + */ class Score_performer: public Performer_group_performer, public Global_translator { @@ -20,29 +23,22 @@ public: ~Score_performer(); protected: - virtual Translator* ancestor_l( int l ); + virtual Translator* ancestor_l(int l); virtual int depth_i() const; virtual void finish(); - virtual Moment get_mom() const; - virtual void prepare( Moment mom ); + virtual void prepare(Moment mom); virtual void process(); - virtual void set_score( Score* score_l ); + virtual void set_score(Score* score_l); virtual void start(); virtual int get_tempo_i() const; - virtual void play(Audio_item*); - virtual void play(Midi_item*); + virtual void play(Audio_element* p); private: void header(Midi_stream&); - Midi_def* midi_l_; - - Moment prev_mom_; Moment now_mom_; Audio_column* audio_column_l_; - - Link_array midi_item_l_arr_; }; #endif // SCORE_PERFORMER_HH diff --git a/lily/include/score.hh b/lily/include/score.hh index ecd4f8cc10..058fb173b0 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -26,7 +26,7 @@ public: Paper_def *paper_p_; Midi_def *midi_p_; Music * music_p_; - PScore *pscore_p_; + Paper_score *pscore_p_; Audio_score* audio_score_p_; int errorlevel_i_; @@ -44,7 +44,6 @@ public: /// output to file void output(String fn); - /// void set(Midi_def* midi_p); /// @@ -66,7 +65,6 @@ private: // utils: PCursor create_cols(Moment, PCursor &last); - /** make the pcol_l_ fields of each Score_column point to the correct PCol, remove any unnecessary Score_column's diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index aeb9d11277..b3d73aac95 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -25,7 +25,7 @@ public: Link_array support_l_arr_; DECLARE_MY_RUNTIME_TYPEINFO; - void add(Script *); + virtual void add(Script *); void add_support(Item*); }; diff --git a/lily/include/script-def.hh b/lily/include/script-def.hh index 890ce377bc..65898a0549 100644 --- a/lily/include/script-def.hh +++ b/lily/include/script-def.hh @@ -37,7 +37,7 @@ public: virtual Atom get_atom(Paper_def* p, int dir_i_)const; DECLARE_MY_RUNTIME_TYPEINFO; - virtual bool do_equal_b(General_script_def const &)const; + virtual bool do_equal_b(General_script_def const *)const; virtual void do_print() const; Script_def(); void set_from_input(String, bool, int, int ,bool,int ); diff --git a/lily/include/script-grav.hh b/lily/include/script-grav.hh index 2e622aa7ff..ce72d40def 100644 --- a/lily/include/script-grav.hh +++ b/lily/include/script-grav.hh @@ -15,15 +15,12 @@ class Script_engraver : public Engraver { Array