From 6ce61146edb1c36647b514778c29cdc9beedab6a Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 28 Jul 1997 00:34:29 +0200 Subject: [PATCH] release: 0.0.76 --- .dstreamrc | 28 +- .version | 4 +- ANNOUNCE | 83 +- AUTHORS.text | 12 +- BUGS | 2 + COPYING | 5 +- DEDICATION | 27 + Documentation/AUTHORS.pod | 7 +- Documentation/CodingStyle.pod | 26 +- Documentation/INSTALL.pod | 103 +- Documentation/MANIFESTO.pod | 27 +- Documentation/Makefile | 22 +- Documentation/faq.pod | 40 +- Documentation/gnu-music.pod | 42 +- Documentation/index.pod | 107 +- Documentation/language.pod | 61 +- Documentation/lilygut.pod | 115 +- Documentation/lilyliterature.pod | 20 +- Documentation/lilypond.pod | 68 +- Documentation/mi2mu.pod | 3 +- Documentation/mudela-book.pod | 55 + Documentation/mudela-course.doc | 157 +++ Documentation/mudela-man.doc | 565 ++++++++ Documentation/mudela.pod | 574 -------- Documentation/other-packages.pod | 12 +- INSTALL.text | 194 +-- NEWS | 46 +- README | 34 +- TODO | 27 +- bin/Makefile | 9 +- bin/{make_version => make-version} | 0 bin/{make_website => make-website} | 27 +- bin/mudela-book | 120 ++ configure | 28 +- configure.in | 22 +- flower/.version | 2 +- flower/NEWS | 3 + flower/configure | 2 +- flower/configure.in | 2 +- flower/include/acursor.hh | 58 + flower/test/Makefile | 4 +- init/engraver.ini | 113 +- init/paper16.ini | 3 +- init/performer.ini | 9 +- init/symbol.ini | 2 +- init/table16.ini | 13 +- input/book.ly | 49 - input/book.tex | 67 - input/cadenza.ly | 2 +- input/collisions.ly | 2 +- input/header.ly | 2 +- input/keys.ly | 2 +- input/kortjakje.ly | 9 +- input/multi.ly | 13 +- input/pedal.ly | 2 +- input/rhythm.ly | 37 +- input/scales.ly | 2 +- input/scripts.ly | 2 +- input/scsii-menuetto.ly | 6 +- input/slurs.ly | 2 +- input/standchen.ly | 12 +- input/toccata-fuga-E.ly | 18 +- input/twinkle.ly | 12 +- input/wohltemperirt.ly | 10 +- lily/.version | 4 +- lily/bar-grav.cc | 4 + lily/bar.cc | 5 +- lily/beam.cc | 8 +- lily/break.cc | 81 +- lily/calcideal.cc | 73 - lily/col-info.cc | 41 + lily/command-request.cc | 7 + lily/dynamic-grav.cc | 4 +- lily/engraver.cc | 1 - lily/global-translator.cc | 3 + lily/head-column.cc | 69 + lily/idealspacing.cc | 26 +- lily/identifier.cc | 8 +- lily/include/beam.hh | 2 +- lily/include/break.hh | 13 +- lily/include/col-info.hh | 36 + lily/include/command-request.hh | 6 + lily/include/engraver-group.hh | 2 + lily/include/global-translator.hh | 3 + lily/include/head-column.hh | 41 + lily/include/idealspacing.hh | 9 +- lily/include/identifier.hh | 5 +- lily/include/input-translator.hh | 1 + lily/include/lily-proto.hh | 5 +- lily/include/line-spacer.hh | 69 + lily/include/linespace.hh | 71 +- lily/include/lyric-engraver.hh | 5 +- lily/include/music-iterator.hh | 31 +- lily/include/musical-request.hh | 17 +- lily/include/note-column.hh | 21 +- lily/include/p-col.hh | 9 +- lily/include/p-score.hh | 15 +- lily/include/rest-column.hh | 12 +- lily/include/score-column.hh | 16 +- lily/include/score-elem.hh | 21 +- lily/include/score-grav.hh | 2 + lily/include/score-halign-grav.hh | 1 - lily/include/score.hh | 12 +- lily/include/silent-performer.hh | 26 - lily/include/span-bar-grav.hh | 7 +- lily/include/span-bar.hh | 13 +- lily/include/span-brace-engraver.hh | 31 - lily/include/span-brace-item.hh | 32 - lily/include/span-score-bar-grav.hh | 32 + lily/include/span-score-bar.hh | 38 + lily/include/spring-spacer.hh | 98 ++ lily/include/staff-gravs.hh | 15 +- lily/include/swallow-perf.hh | 21 + lily/include/translator.hh | 1 + lily/include/word-wrap.hh | 21 + lily/item.cc | 2 +- lily/line-spacer.cc | 22 + lily/linespace.cc | 388 ------ lily/local-key-grav.cc | 1 + lily/lookup.cc | 39 +- lily/{lyric-engraver.cc => lyric-grav.cc} | 28 +- lily/midi-output.cc | 0 lily/music-iterator.cc | 101 +- lily/musical-request.cc | 17 +- lily/note-column-grav.cc | 56 +- lily/note-column.cc | 43 +- lily/p-col.cc | 22 +- lily/p-score.cc | 73 +- lily/parser.y | 14 +- lily/rest-collision-grav.cc | 1 - lily/rest-collision.cc | 5 +- lily/rest-column.cc | 43 +- lily/score-align-grav.cc | 5 +- lily/score-column.cc | 38 +- lily/score-elem.cc | 81 +- lily/score-grav.cc | 42 +- lily/score.cc | 62 +- lily/scoreline.cc | 11 +- lily/script-column.cc | 3 + lily/silent-performer.cc | 62 - lily/span-bar-grav.cc | 11 +- lily/span-bar.cc | 27 +- lily/span-brace-engraver.cc | 57 - lily/span-brace-item.cc | 85 -- lily/span-score-bar-grav.cc | 30 + lily/span-score-bar.cc | 45 + lily/spanner.cc | 4 +- lily/spring-spacer.cc | 581 ++++++++ lily/staff-gravs.cc | 49 +- lily/staff-info.cc | 6 +- lily/stem-beam-grav.cc | 2 + lily/swallow-perf.cc | 13 + lily/translator.cc | 8 + lily/vertical-align-grav.cc | 4 +- lily/wordwrap.cc | 10 +- make/Makefile | 7 +- make/Rules.make | 11 + make/Targets.make | 2 +- make/Toplevel.make.in | 4 +- make/lilypond.lsm | 18 +- make/lilypond.lsm.in | 14 +- make/lilypond.spec | 23 +- make/lilypond.spec.in | 17 +- mf/Makefile | 62 - mf/README | 43 - mf/musexgen.mf | 194 --- mf/musix11.mf | 28 - mf/musix13.mf | 28 - mf/musix16.mf | 28 - mf/musix20.mf | 28 - mf/musix24.mf | 28 - mf/musix25.mf | 28 - mf/musix29.mf | 28 - mf/musixgen.mf | 1521 --------------------- mf/musixsps.mf | 295 ---- mf/musixspx.mf | 295 ---- mf/xdrawsl.mf | 39 - mf/xdrawzl.mf | 25 - mf/xgreg11.mf | 10 - mf/xgreg13.mf | 10 - mf/xgreg16.mf | 10 - mf/xgreg20.mf | 10 - mf/xgreg24.mf | 10 - mf/xgreg25.mf | 28 - mf/xgreg29.mf | 10 - mf/xgreggen.mf | 351 ----- mf/xhsld16.mf | 37 - mf/xhsld20.mf | 37 - mf/xhslu16.mf | 37 - mf/xhslu20.mf | 37 - mf/xsld11.mf | 20 - mf/xsld13.mf | 20 - mf/xsld16.mf | 20 - mf/xsld20.mf | 20 - mf/xsld24.mf | 20 - mf/xsld29.mf | 20 - mf/xslgen.mf | 37 - mf/xslhd.mf | 31 - mf/xslhd11.mf | 5 - mf/xslhd13.mf | 4 - mf/xslhd16.mf | 5 - mf/xslhd20.mf | 4 - mf/xslhd24.mf | 4 - mf/xslhd29.mf | 4 - mf/xslhu.mf | 30 - mf/xslhu11.mf | 4 - mf/xslhu13.mf | 4 - mf/xslhu16.mf | 5 - mf/xslhu20.mf | 4 - mf/xslhu24.mf | 4 - mf/xslhu29.mf | 4 - mf/xslhz20.mf | 24 - mf/xslu11.mf | 20 - mf/xslu13.mf | 20 - mf/xslu16.mf | 20 - mf/xslu20.mf | 20 - mf/xslu24.mf | 20 - mf/xslu29.mf | 20 - mf/xslz20.mf | 42 - mf/xtie20.mf | 24 - mi2mu/midi-event.cc | 2 +- tex/dimen.tex | 2 +- tex/lilyponddefs.tex | 15 +- 223 files changed, 3483 insertions(+), 6685 deletions(-) create mode 100644 DEDICATION create mode 100644 Documentation/mudela-book.pod create mode 100644 Documentation/mudela-course.doc create mode 100644 Documentation/mudela-man.doc delete mode 100644 Documentation/mudela.pod rename bin/{make_version => make-version} (100%) rename bin/{make_website => make-website} (88%) create mode 100755 bin/mudela-book create mode 100644 flower/include/acursor.hh delete mode 100644 input/book.ly delete mode 100644 input/book.tex delete mode 100644 lily/calcideal.cc create mode 100644 lily/col-info.cc create mode 100644 lily/head-column.cc create mode 100644 lily/include/col-info.hh create mode 100644 lily/include/head-column.hh create mode 100644 lily/include/line-spacer.hh delete mode 100644 lily/include/silent-performer.hh delete mode 100644 lily/include/span-brace-engraver.hh delete mode 100644 lily/include/span-brace-item.hh create mode 100644 lily/include/span-score-bar-grav.hh create mode 100644 lily/include/span-score-bar.hh create mode 100644 lily/include/spring-spacer.hh create mode 100644 lily/include/swallow-perf.hh create mode 100644 lily/include/word-wrap.hh create mode 100644 lily/line-spacer.cc delete mode 100644 lily/linespace.cc rename lily/{lyric-engraver.cc => lyric-grav.cc} (62%) delete mode 100644 lily/midi-output.cc delete mode 100644 lily/silent-performer.cc delete mode 100644 lily/span-brace-engraver.cc delete mode 100644 lily/span-brace-item.cc create mode 100644 lily/span-score-bar-grav.cc create mode 100644 lily/span-score-bar.cc create mode 100644 lily/spring-spacer.cc create mode 100644 lily/swallow-perf.cc delete mode 100644 mf/Makefile delete mode 100644 mf/README delete mode 100644 mf/musexgen.mf delete mode 100644 mf/musix11.mf delete mode 100644 mf/musix13.mf delete mode 100644 mf/musix16.mf delete mode 100644 mf/musix20.mf delete mode 100644 mf/musix24.mf delete mode 100644 mf/musix25.mf delete mode 100644 mf/musix29.mf delete mode 100644 mf/musixgen.mf delete mode 100644 mf/musixsps.mf delete mode 100644 mf/musixspx.mf delete mode 100644 mf/xdrawsl.mf delete mode 100644 mf/xdrawzl.mf delete mode 100644 mf/xgreg11.mf delete mode 100644 mf/xgreg13.mf delete mode 100644 mf/xgreg16.mf delete mode 100644 mf/xgreg20.mf delete mode 100644 mf/xgreg24.mf delete mode 100644 mf/xgreg25.mf delete mode 100644 mf/xgreg29.mf delete mode 100644 mf/xgreggen.mf delete mode 100644 mf/xhsld16.mf delete mode 100644 mf/xhsld20.mf delete mode 100644 mf/xhslu16.mf delete mode 100644 mf/xhslu20.mf delete mode 100644 mf/xsld11.mf delete mode 100644 mf/xsld13.mf delete mode 100644 mf/xsld16.mf delete mode 100644 mf/xsld20.mf delete mode 100644 mf/xsld24.mf delete mode 100644 mf/xsld29.mf delete mode 100644 mf/xslgen.mf delete mode 100644 mf/xslhd.mf delete mode 100644 mf/xslhd11.mf delete mode 100644 mf/xslhd13.mf delete mode 100644 mf/xslhd16.mf delete mode 100644 mf/xslhd20.mf delete mode 100644 mf/xslhd24.mf delete mode 100644 mf/xslhd29.mf delete mode 100644 mf/xslhu.mf delete mode 100644 mf/xslhu11.mf delete mode 100644 mf/xslhu13.mf delete mode 100644 mf/xslhu16.mf delete mode 100644 mf/xslhu20.mf delete mode 100644 mf/xslhu24.mf delete mode 100644 mf/xslhu29.mf delete mode 100644 mf/xslhz20.mf delete mode 100644 mf/xslu11.mf delete mode 100644 mf/xslu13.mf delete mode 100644 mf/xslu16.mf delete mode 100644 mf/xslu20.mf delete mode 100644 mf/xslu24.mf delete mode 100644 mf/xslu29.mf delete mode 100644 mf/xslz20.mf delete mode 100644 mf/xtie20.mf diff --git a/.dstreamrc b/.dstreamrc index cb3e8bbcbe..fbad82a93c 100644 --- a/.dstreamrc +++ b/.dstreamrc @@ -3,17 +3,18 @@ Dstream 1 File_path 1 My_lily_lexer 1 -PCol 1 -Score_column 1 -Script_column 1 -# E l b e ment? search/replace typo +PCol 0 +Score_column 0 +Script_column 0 +# E l b e ment? search/replace typo. +# Yeah. kind of. Looks cute though Elbement_group 1 Ineq_constrained_qp 1 Spacing_problem 1 Colinfo 1 Mixed_qp 1 PScore 1 -Idealspacing 1 +Idealspacing 0 # yydebug InitParser 1 @@ -60,20 +61,17 @@ Slur 1 Music 1 Paper_def 1 Lookup 1 -Input_translator 1 +Input_translator 0 Score_elem 1 Item 1 Note_head 1 Engraver 1 -Score_engraver 1 -Staff_engravers 1 +Rest_collision_engraver 1 +Score_engraver 0 Engraver_group_engraver 1 -Input_cursor 1 -Commands_at 1 -Input_command 1 Time_description 1 Melodic_req 1 -Midi_walker 1 +Midi_def 1 Note_performer 0 Performer 0 Stem_req 1 @@ -82,8 +80,10 @@ Script_req 1 Colinfo 1 Word_wrap 1 Text_req 1 -Script_def 1 -Text_def 1 +Script_def 0 +Text_def 0 Paperdef 1 Symtable 1 Symtables 1 +Beam 1 +Head_column 1 diff --git a/.version b/.version index 4733fbb512..8deba99f45 100644 --- a/.version +++ b/.version @@ -1,7 +1,7 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 0 -TOPLEVEL_PATCH_LEVEL = 75 +TOPLEVEL_PATCH_LEVEL = 76 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf -TOPLEVEL_MY_PATCH_LEVEL = .jcn6 +TOPLEVEL_MY_PATCH_LEVEL = diff --git a/ANNOUNCE b/ANNOUNCE index 987b26c7cb..6d851a385b 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,18 +1,18 @@ - We are proud to announce the birth of "GNU LilyPond 0.1", a.k.a. - Lily + Lily 0.1 - born .. 1997 + born August 1, 1997 daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys -Lily is a healthy, bouncing baby weighing 345 kilobytes +Lily is a healthy, bouncing baby weighing 335 kilobytes Visiting hours: 24hrs a day at - ftp://pcnov095.win.tue.nl, + ftp://pcnov095.win.tue.nl/pub/lilypond/lilypond-0.1.tar.gz + ftp://prep.gnu.ai.mit.edu/pub/gnu/lilypond-0.1.tar.gz you can see some babyfood, diapers and pictures at @@ -21,32 +21,6 @@ you can see some babyfood, diapers and pictures at You can send your congratulations to Janneke (jan@digicash.com) and Wendy (hanwen@stack.nl) - --- * --- - - 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, 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 too. - - - --- * --- [ And now the serious part ] @@ -75,22 +49,30 @@ detailed info and examples can be found on the webpage at: http://www.stack.nl/~hanwen/lilypond/index.html -(it is somewhat lousy, but I have more important things to do). +It isn't flashy, but then I wasn't born to be a webartist. [DETAILED DESCRIPTION] -WHAT IS GNU LilyPond +WHAT IS GNU LilyPond? + +GNU LilyPond which converts music definition files into visual or +audio output: it can typeset formatted sheet music to a TeX file and +and (mechanical) performances to MIDI files. + +WHY? -Technically it is a preprocessor which generates TeX -(or LaTeX) output which contains information to typeset a musical -score. Practically it is a typesetter, which only uses TeX as an -output medium. (this is handy because there exist music fonts for TeX) +We want to create tools which can produce production quality scores +and parts of public music. We haven't quite reached that goal: -As a bonus, you can also output a MIDI file of what you typed. +* The quality of the output isn't good enough yet due to +some (still) insophisticated algorithms -The input is a script file which is read. The script file is a "music -definition", ie, you type the melody as if it is read out loud +* A number of features haven't been implemented (although they can be +quite simple) + +We Want You! You can become a user, but we'd really appreciate to +have some Hackers to help advance our project more quickly. WHAT IS NEEDED? @@ -105,8 +87,12 @@ for compilation you need for running you need TeX + MusiXTeX fonts + +The MusiXTeX fonts are part of the MusiXTeX package version T.73, +available at http://www.gmd.de/Misc/Music/ -FEATURES +WHAT CAN LILYPOND DO? ASCII script input (mudela), with identifiers (for music reuse), customizable notenames @@ -115,17 +101,16 @@ MIDI output lets you check if you have entered the correct notes. MIDI to Mudela conversion through the mi2mu program. Multiple staffs in one score. Each staff can have a different meters. -Multiple voices within one staff; beams optionally shared between -voices. Multiple scores within one input file. Each score is output -to a different file. +Multiple voices within one staff (up to four handled graciously); +beams optionally shared between voices. Multiple scores within one +input file. Each score is output to a different file. Beams, slurs, chords, super/subscripts (accents and text), general n-plet (triplet, quadruplets, etc.), lyrics, transposition -dynamics (both absolute and hairpin style) clef changes, meter +dynamics (both absolute and hairpin style), clef changes, meter changes, cadenza-mode, key changes, repeat bars -[Kudos to the FSF, all Linux hackers, and --of course-- especially -GrandMaster Linus T, for The Kernel and The Announce :-] +Integration with LaTeX through scripts. + + - Han-Wen Nienhuys - Jan Nieuwenhuizen diff --git a/AUTHORS.text b/AUTHORS.text index 59947c7976..ffea060633 100644 --- a/AUTHORS.text +++ b/AUTHORS.text @@ -24,7 +24,8 @@ AAAAUUUUTTTTHHHHOOOORRRRSSSS make/*.make, */Makefile parts of Documentation/mudela.pod, lib/*source-file*, lib/duration.cc, lib/source, flower/*{list,cursor}*, - lily/rest-collision*, conflily, cygnus w32 stuff + lily/rest-collision*, conflily, cygnus w32 stuff, + lily/*perf* and corresponding header files. @@ -35,6 +36,9 @@ CCCCOOOONNNNTTTTRRRRIIIIBBBBUUUUTTTTOOOORRRRSS +o Werner Lemberg , misc bugfixes, some Beam and Stem code. + 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. + Some do not involve coding C++ @@ -57,10 +61,6 @@ CCCCOOOONNNNTTTTRRRRIIIIBBBBUUUUTTTTOOOORRRRSS - - - - -7/Jul/97 LilyPond 0.0.74 1 +26/Jul/97 LilyPond 0.0.76 1 diff --git a/BUGS b/BUGS index e69de29bb2..e4af66d3cb 100644 --- a/BUGS +++ b/BUGS @@ -0,0 +1,2 @@ + +[document reintroduced deficiencies.] diff --git a/COPYING b/COPYING index 54b93e6973..da81602209 100644 --- a/COPYING +++ b/COPYING @@ -1,10 +1,7 @@ This license applies to all files except: - the included input files which explicitly state a different -copyright - - - the MetaFont sources, found in the subdirectory mf/. See -mf/README. +copyright policy GNU GENERAL PUBLIC LICENSE diff --git a/DEDICATION b/DEDICATION new file mode 100644 index 0000000000..c96c364dfa --- /dev/null +++ b/DEDICATION @@ -0,0 +1,27 @@ + + --- * --- + + 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, 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/Documentation/AUTHORS.pod b/Documentation/AUTHORS.pod index d79edec206..dd150709fc 100644 --- a/Documentation/AUTHORS.pod +++ b/Documentation/AUTHORS.pod @@ -23,7 +23,7 @@ Jan Nieuwenhuizen , http://www.digicash.com/~jan lily/midi-*, mi2mu/*, parts flower/string*.cc, make/*.make, */Makefile parts of Documentation/mudela.pod, lib/*source-file*, lib/duration.cc, lib/source, flower/*{list,cursor}*, lily/rest-collision*, conflily, -cygnus w32 stuff +cygnus w32 stuff, lily/*perf* and corresponding header files. @@ -45,3 +45,8 @@ Beam and Stem code. =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/CodingStyle.pod b/Documentation/CodingStyle.pod index e4693e3641..8cf64c424d 100644 --- a/Documentation/CodingStyle.pod +++ b/Documentation/CodingStyle.pod @@ -12,7 +12,7 @@ checking status. =head2 Quote: A program should be light and agile, its subroutines -connected like a strings of pearls. The spirit and intent of +connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little nor too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming @@ -38,12 +38,12 @@ this is to rewrite the program. Definitions of classes that are only accessed via pointers (*) or references (&) shall not be included as include files. -Include files in C++ always have the file name extension ".hh". +filenames -Implementation files in C++ always have the file name -extension ".cc". - -Inline definition files always have the file name extension ".icc". + ".hh" Include files + ".cc" Implementation files + ".icc" Inline definition files + ".tcc" non inline Template defs in emacs: @@ -58,6 +58,8 @@ in emacs: auto-mode-alist)) +The class Class_name_abbreviation is coded in F + =head2 INDENTATION @@ -148,18 +150,6 @@ http://www.zib.de/Visual/software/doc++/index.html Unfortunately most of the code isn't really documented that good. -=head2 CLASSNAMES (2) - -A lot of classes in GNU LilyPond start with 'P', this is to distinguish -certain parts of GNU LilyPond: the P stands for Printer, and the P-classes -are supposed to be more lowlevel than the others. Example: - -Staff uses PStaff, PScore and PCol to do the typesetting of -symbols. Staff is the "brains" for PStaff - -NB: in PCursor (which is part of the library) P stands for PointerCursor - - =head2 MEMBERS (2) Standard methods: diff --git a/Documentation/INSTALL.pod b/Documentation/INSTALL.pod index e2697cffa9..9d86ae3641 100644 --- a/Documentation/INSTALL.pod +++ b/Documentation/INSTALL.pod @@ -6,15 +6,6 @@ INSTALL - installing GNU LilyPond This page documents installation and compilation of GNU LilyPond -=head1 IMPORTANT - -if you have downloaded a - - *.pre* - -version, then this is version is I meant for producing nice -output, but to keep your patchsets up to date. It might not even compile. - =head1 PREREQUISITES For compilation you need. @@ -48,8 +39,34 @@ Bison. (Version 1.25 or better) =back +=head1 RUNNING + +GNU LilyPond does use a lot of resources. For operation you need the following: + + +=over 5 + +=item * + +TeX + +=item * + +The MusixTeX fonts (I included those found in MusixTeX T.73). Beware, +the clef symbol seems to have changed its position in some versions, +(notably Egler's, a.k.a. OpusTeX). The MusixTeX fonts are included in +MusixTeX T.73, which can be had from any CTAN site, eg at + + ftp://ftp.shsu.edu/tex-archive/macros/musixtex/taupin + ftp://ftp.tex.ac.uk/tex-archive/macros/musixtex/taupin + ftp://ftp.dante.de/tex-archive/macros/musixtex/taupin + +You only need the contents of the F subdirectory of the package. + =head1 RECOMMENDED +Although not strictly necessary, these are recommended to have. + =over 5 =item * @@ -61,8 +78,16 @@ with the perl's Plain Old Documentation. (GNU) find + +=item * + +A fast computer (a full page of music typically takes 1 minute +on my 486/133, using the B<--enable-checking> compile. It's lot slower +than most MusiXTeX preprocessors) + =back + =head1 CONFIGURING and COMPILING to install GNU LilyPond, simply type: @@ -80,7 +105,6 @@ This will install the following files: /usr/local/bin/mi2mu /usr/local/share/lilypond/* /usr/lib/texmf/texmf/tex/lilypond/* - /usr/lib/texmf/texmf/fonts/source/lilypond/* The TeX include directory is detected dynamically, but it can be adjusted with B<--enable-tex-prefix> and B<--enable-tex-dir>. The @@ -98,7 +122,7 @@ B<--help>. If you are not root, you will probably have to make it with configure --prefix=/home/me_myself_and_I/ -In this case, you will have to set MFINPUTS, and TEINPUTS accordingly. +In this case, you will have to set MFINPUTS, and TEXINPUTS accordingly. If you want to install GNU LilyPond in F, and your TeX has no default hooks for local stuff (mine is broken too), you can do: @@ -140,7 +164,7 @@ Set then directory tex input is in (detected as a subdir of tex-prefix) =item --enable-mf-dir -Set then directory tex input is in (idem) +Set then directory mf input is in (idem) =back @@ -164,8 +188,6 @@ If you have done a successful C, then a simple should do the trick. -[todo. Obsolete; fonts are in distribution now.] - Install the musixtex fonts in a directory which TeX and MF knows (if you are root, look for a directory which contains the directories with AMS and CM source (*.mf) files. Create a subdir lilypond or musixtex @@ -174,7 +196,10 @@ applicable) Example: my fonts are in F, and I have a symlink pointing to that in -F +F. After I copied the +files, I ran "texhash" + +ftp://hprib.lps.u-psud.fr/pub/music_zips/musixtex.zip =head1 CAVEATS @@ -189,33 +214,9 @@ should turn off this flag for this file. =back -=head1 RUNNING - -GNU LilyPond does use a lot of resources. For operation you need the following: - +=head1 EXAMPLE -=over 5 - -=item * - -A fast computer (a full page of music typically takes 1 minute -on my 486/66, using the B<--enable-checking> compile. It's lot slower -than most MusiXTeX preprocessors) - -=item * - -TeX - -=item * - -The MusixTeX fonts (I included those found in MusixTeX T.73). Beware, -the clef symbol has changed position in the Egler version, -a.k.a. OpusTeX) - -=back - -At this time, GNU LilyPond output looks nice, but is not of production -quality. If you're not discouraged; this is what I type in my xterm: +This is what I type in my xterm: lilypond someinput.ly tex lelie.tex @@ -250,9 +251,10 @@ Please refer to the man page for more information. =head1 REDHAT LINUX RedHat Linux users should be able to get a RPM. A spec file is in -F. You should be able to create an rpm as a normal +F. You should be able to create an rpm as a normal user. Be sure you have a ~/.rpmrc, and edit the RPM-dir in -F +F. (If you create the RPM as a normal user the +permissions will not be set correctly, unfortunately) =head1 WINDOZE @@ -267,21 +269,6 @@ to make GNU LilyPond under, brr, aargh, well, simply type: bash configure make windows32 -=head1 PLATFORMS - -GNU LilyPond (pl 0.0.39) is known to compile on the following platforms: - -Unix: - - * gnu/linux 2.0.x, g++ 2.7.2[.1] - * aix 4.1, g++ 2.7.2 - * solaris 2.5, g++ 2.7.2 - -Other: - - * windows-nt 4.0, cygnus gnu-windows32 beta17.1 (~=g++ 2.7.2) - * gnu/linux 2.0.28 X to doze, gcc-go32 (~=g++ 2.7.2) [exec. untested] - =head1 AUTHORS Han-Wen Nienhuys diff --git a/Documentation/MANIFESTO.pod b/Documentation/MANIFESTO.pod index 4eab08fbd8..e14cc67f19 100644 --- a/Documentation/MANIFESTO.pod +++ b/Documentation/MANIFESTO.pod @@ -53,9 +53,12 @@ TeX is convenient for producing output. =item * -GNU LilyPond does not display notes directly, nor will it be rehacked to be -used interactively. GNU LilyPond writes output to a file. It will not be -extended to play music, or to recognize music. +GNU LilyPond does not display notes directly, nor will it be rehacked +to be used interactively. GNU LilyPond writes output to a file. It +will not be extended to play music, or to recognize music. + +[As an aside, I am contemplating to create a library for rendering +music, which is "X-capable", so that others can create interactive tools] =item * @@ -65,7 +68,8 @@ be portable to any platform which can run TeX and the GNU tools =item * GNU LilyPond is free. Commercial windows packages for setting music are -abundant. Free musicprinting software is scarce. +abundant. Free musicprinting software is scarce. For more thoughts on +this, please consult the F documentation. =item * @@ -98,7 +102,7 @@ or MIDI :-), =item * -be easily writable in ASCII with a simple texteditor, yfte(TM). +be easily writable in ASCII with a simple texteditor =back @@ -123,10 +127,9 @@ as well as the scores for all individual instruments, =item * -provide simple musical manipulations, such as -S<(i) extracting> a slice of music from a previously defined piece, -S<(ii) extracting> only the rhythm from a piece of music, -S<(iii) transposing>, etc., +provide simple musical manipulations, such as S<(i) extracting> a +slice of music from a previously defined piece, S<(ii) extracting> +only the rhythm from a piece of music, S<(iii) transposing>, etc., =item * @@ -144,11 +147,11 @@ Musical pieces could be =item * -Mahlerian orchestral scores, +Orchestral scores, (eg Mahler) =item * -piano pieces (Schubertian, Rachmaninovian), +piano pieces (eg. Schubert, Rachmaninov), =item * @@ -156,7 +159,7 @@ pop songs (lyrics and chords), =item * -gregorian chants, +Gregorian chants, =item * diff --git a/Documentation/Makefile b/Documentation/Makefile index e62a4c5441..79934bc758 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -19,22 +19,20 @@ include ./$(depth)/make/Files.make # # - +DOCFILES = $(wildcard *.doc) OUTPODFILES = $(addprefix $(outdir)/,$(PODFILES)) TEXTFILES = $(OUTPODFILES:.pod=.text) GROFFFILES = $(OUTPODFILES:.pod=.1) HTMLFILES = $(OUTPODFILES:.pod=.html) -# +DVIFILES = $(addprefix $(outdir)/, $(DOCFILES:.doc=.dvi)) -# list of distribution files: # -EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif +# list of distribution files: # - +EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif $(DOCFILES) default: do-doc - true -do-doc: $(TEXTFILES) +do-doc: $(TEXTFILES) $(DVIFILES) html: $(HTMLFILES) @@ -52,17 +50,17 @@ localclean: rm -f out/* rm -f $(TEXTFILES) $(HTMLFILES) $(GROFFFILES) -MAN1FILES = lilypond convert-mudela mi2mu +MAN1FILES = lilypond convert-mudela mi2mu mudela-book MAN1GROFF = $(addprefix $(outdir)/, $(addsuffix .1,$(MAN1FILES))) localinstall: $(outdir)/lilypond.1 $(outdir)/mudela.5 $(INSTALL) -d $(mandir)/man5 $(INSTALL) -d $(mandir)/man1 $(INSTALL) -m 755 $(MAN1GROFF) $(mandir)/man1 - $(INSTALL) -m 755 $(outdir)/mudela.5 $(mandir)/man5 + localuninstall: - rm -f $(mandir)/man1/lilypond.1 - rm -f $(mandir)/man1/convert-mudela.1 + (cd $(mandir)/man1/; rm -f $(MAN1GROFF)) + + -xpms: diff --git a/Documentation/faq.pod b/Documentation/faq.pod index 6be7d7d618..2eeced82b3 100644 --- a/Documentation/faq.pod +++ b/Documentation/faq.pod @@ -12,7 +12,8 @@ Q: I get all kinds of errors while compiling parser.cc A: LilyPond uses features of bison version 1.25. Please confirm that you are using a version 1.25 or better. Don't forget to do "make -clean" after installing it +clean" after installing it. Don't forget to remove the stale +bison.simple as well. If the problem persists, then please mail me. @@ -124,13 +125,6 @@ specify a()a()a -Q: Why shouldn't I put all commands (\clef, \meter) inside the music? - -A: You should do what you like, but at some time we will enable -quoting of music ("Stichnoten"). Besides if you are going to type an -orchestral score, then you'd probably want to enter most of the meter, -repeat commands only once. - Q: I want to insert some TeX commands A: You shouldn't: it's against LilyPond philosophy to have typesetting @@ -186,35 +180,7 @@ Q: Why do I need g++ >= 2.7? A: By using g++, GNU LilyPond is portable to all platforms which support g++ (there are quite a few). Not having to support other compilers -saves us a I of trouble. GNU LilyPond and FlowerLib use: - -=over 4 - -=item * - -builtin bool - -=item * - -64 bit integral type long long - -=item * - -typeof - -=item * - -operator ? - -=item * - -the new for-scope - -=item * - -class Rational (libg++) - -=back +saves us a I of trouble. =head2 Running diff --git a/Documentation/gnu-music.pod b/Documentation/gnu-music.pod index f487b5da8f..fbb2d7402f 100644 --- a/Documentation/gnu-music.pod +++ b/Documentation/gnu-music.pod @@ -4,7 +4,29 @@ GNU Music project - manifesto =head1 DESCRIPTION -Random ranting about the GNU Music project +Random ranting about the GNU Music project. + +=head2 Note + +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. + +Independently, I 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. =head1 GOAL @@ -94,7 +116,7 @@ Emacs and TeX =item easy to use. That is, for technical users (that can read a manual). The learning -curve should be as easy as possible but not at the expense of comfort +curve should be as flat as possible but not at the expense of comfort of use and power. =back @@ -106,19 +128,25 @@ of use and power. =item A set of music fonts Preferably in Metafont, suited to both screen display and use on -paper; This is because the copyright heritage of {Opus,Musix}tex is unclear. +paper; This is needed because + +1. the copyright heritage of +{Opus,Musix}tex is unclear. + +2. We don't have any legal papers which make these fonts free (to use +and alter) =item A typesetting engine A system with rules on how to set properties of items to be printed -(up/down directions, breaking, etc) LilyPond provides one, but it is -not yet suited to interactive typesetting +(up/down directions, breaking, dimensoins, etc) LilyPond provides one, +but it is not (yet) suited to interactive typesetting =item A display engine which can display clear notewriting in (say) an X-window -Gsharp is there, but far from finished. Ideally the system should +G-Sharp is there, but far from finished. Ideally the system should cooperate with the typesetting engine =item An ASCII language @@ -152,7 +180,7 @@ simplifies creating a collection of music (difficult) A system to generate accompaniments, figured bass, automatic accompaniment, etc. -=item an internet archive of free music +=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 diff --git a/Documentation/index.pod b/Documentation/index.pod index 30ba133a2b..54b509ee33 100644 --- a/Documentation/index.pod +++ b/Documentation/index.pod @@ -11,16 +11,25 @@ LaTeX) output from file input. As a bonus, you can also output a MIDI file of what you typed. +=head2 Examples + + examples of what LilyPond can do: MIDI, PS, .gif and input. -=head1 DOCUMENTATION +=head2 Documentation =over 4 +=item * + +FAQs + =item * =item * - -Design criteria +PS documents about LilyPond + =item * - -AUTHORS +manual page for mi2mu, the MIDI convertor. - =item * @@ -52,115 +61,135 @@ The manual page > =item * - -internal structures. +The mudela convertor: convert-mudela =item * - -Papers, books and online-resources on music typesetting +mudela in TeX: mudela-book =item * - -Other packages for printing music. +errors + +=back + +=head2 Background information + +=over 4 + =item * - -manual page for mi2mu, the MIDI convertor. +Design criteria =item * - -Mudela, the input format +The lilypond logo (Big, format: .gif) =item * - -The mudela convertor: convert-mudela +The lilypond logo (medium size, format: .gif) =item * - -FAQs +The GNU Music project +=back + + +=head2 The program + + +=over 5 + + =item * - -errors +The TODO list. =item * - -The lilypond logo (Big, format: .gif) +The Change log =item * - -The lilypond logo (medium size, format: .gif) +internal structures. - =item * - -The TODO list. +The coding standards of the lilypond project. =item * - -The Change log +The DOC++ documentation of the C++ sources. =item * - -The coding standards of the lilypond project. +AUTHORS +=back + +=head2 Links + +=over 5 + =item * - -The GNU Music project +Papers, books and online-resources on music typesetting =item * - -The DOC++ documentation of the C++ sources. +Other packages for printing music. - =item * -Get it at ftp://pcnov095.win.tue.nl/pub/lilypond ! +Get LilyPond at ftp://pcnov095.win.tue.nl/pub/lilypond ! =item * diff --git a/Documentation/language.pod b/Documentation/language.pod index 3139429302..8e46a662f0 100644 --- a/Documentation/language.pod +++ b/Documentation/language.pod @@ -19,60 +19,6 @@ do input for features we don't know how to produce on paper =head1 REQUIREMENTS -=head2 Parser output - -When I say LilyPond input, I mean the final output of the parsing -step, which should be roughly the same as it is now: hierarchically, -using pseudo syntax - - Score { - Midi_def - Paper_def - Staff [multiple] { - Voices - Stafftype - (instrument) - } - } - - -Voice should stay the same: - - Voice { - Voice_elements - } - -and - - Voice_elements { - requests - } - - -=head2 Staffs - -We definitely need the concept of staff in the parser output, because -it is fundamental to LilyPond. I think the input language should -allow the user to do something like: - - melody = { c d e f g } - - %At this time I can't think of more than these stafftypes - staff { gregorian music { melody } } - staff { pianostaff music { melody } } - staff { melodic music { melody } } - staff { rhythmic music { melody } } - staff { lyric music { melody } } % silly, i admit. - -The staff could also define what the instrument would be (both in -print and in MIDI) - -Moreover, if music {} in score equals staff, then how do we do multiple -voices on one staff? - -We might be able to do without the staff{} construct, but I doubt if -it will make things easier. - =head1 CONCRETE PROPOSALS @@ -166,7 +112,7 @@ is very sketchy. =head2 Requests I want to give the user some access to the internals. Technically, -walkers/registers will happily typeset voices which mix lyrics and +engravers/performers will happily typeset voices which mix lyrics and notes, which combine stem requests and lyricreqs. I want to have a \request { melodic name = 5, acc = -10 @@ -175,9 +121,7 @@ notes, which combine stem requests and lyricreqs. I want to have a type of syntax. This is the most flexible input format possible, since any valid LilyPond input can be made. This strongly implies tying mudela to LilyPond. That I don't mind, but it hampers -portability. Suppose some commercial systems want to read mudela -too. - +portability. Suppose some commercial systems want to read mudela too. =head2 Command placement: @@ -248,7 +192,6 @@ editions: Just ideas: || && ! filter syntax - ++ concatenation of voices + merging of voices =head2 Quoting diff --git a/Documentation/lilygut.pod b/Documentation/lilygut.pod index ef3249ec8a..f84120b47b 100644 --- a/Documentation/lilygut.pod +++ b/Documentation/lilygut.pod @@ -12,7 +12,7 @@ You should use doc++ to take a peek at the sources. This should become a Hacking-HOWTO. If you find any confusing stuff here, let me know. I am a hacker, and don't spend enough time doccing -what I write. +what I write. (Most stuff here which refers to the code is slightly outdated) If you finally have mastered some internal piece of lily, your explanation could be added here. @@ -41,16 +41,22 @@ Performers), which swallow requests, broadcast them and couple different elements. In this step data-structures for the next steps are created and filled -with data: PScore, PCol. +with data: Score_elements, PScore, PCol. + +=item Prebreaking + +Breakable stuff (eg. clefs and bars) are copied into pre and postbreaks. =item Preprocessing Some dependencies are resolved, such as the direction of stems, beams, -=item Calculation: +=item Break calculation: + +The lines and horizontal positions of the columns are determined + +=item Breaking -This step uses structures which have names starting with 'P'. -linebreaks and horizontal positions of PCols are determined. Through some magical interactions with Line_of_score and Super_elem (check out the source) the "lines" are produced. @@ -67,12 +73,11 @@ are determined. =item Output paper -Very simple, just walk all Line_of_* and follow the links over there =item Output midi -The columns of requests (from the Setting up step) are used to -determine what to output when. +The music is run through a translator (called Performer) which +creates midi-items from the requests. =back @@ -87,22 +92,16 @@ In music typesetting, the user might want to cram a lot more symbols on the paper than actually fits. To reflect this idea (the user asks more than we can do), the container for this data is called Request. -A request is done to the C which contains the -C. The staff decides whether to to honor the request, -ignore it, or merge it with other requests. Merging of requests is -preferably done with other requests done by members of the same -voicegroups (beams, brackets, stems) +The music (requests) are read/interpreted by a set of objects +(translators), the Performers/Engravers. The engraver which agrees to +handle a request decides whether to to honor the request, ignore it, +or merge it with other requests. Merging of requests is preferably +done with other requests done by members of the same voicegroups +(beams, brackets, stems). The result of a request will be an C or a C, which -will be put on a C. Note that the C and the original -C need not have anything in common. For example, the -``double'' piano Staff could interpret commands which juggle -melodies across the left and right hand, and may put the result in -two five-line PStaffs (maybe with extra PStaffs to carry the dynamic -signs and any lyric. - -The class C should be thought as a container for the -Cs, and an interpreter for Cs. +will be put on the score. + Different staffs can produce different outputs; a melodious voice which is put into a percussion-Staff, will be typeset as the rythm of that voice. @@ -122,13 +121,13 @@ some voice elts. =item C -Staff has to decide if the ball should be hanging left or right. This -influences the horizontal dimensions of a column, and this is why -request processing should be done before horizontal spacing. +LilyPond has to decide if the ball should be hanging left or +right. This influences the horizontal dimensions of a column, and this +is why request processing should be done before horizontal spacing. Other voices' frivolities may cause the need for accidentals, so this -is also for the C to decide. The C can decide on positioning -based on ottava commands and the appropriate clef. +is also for the to decide. The engraver can decide on positioning based on +ottava commands and the appropriate clef. =item C @@ -142,7 +141,7 @@ This type of request typically results in the creation of a C Start/stop a beam. -Staff has to combine this request with the stem_request, since the +Engraver has to combine this request with the stem_request, since the number of flags that a stem wants to carry will determine the number of beams. @@ -176,19 +175,19 @@ Voice_group), so they should share the beams, and the two [ ] pairs should be merged. The slurs OTOH are specific for each voice, so they should not be shared. -The judge in this "allocation" problem is Staff (actually, it's child -C). It uses the C to do most of the -work. For each request C queries so-called -Cs if they want to accept a request eg, the -C will accept Cs, and turn down -Cs. If C cannot find a engraver that wants -the request, it is junked (with a warning message). +The judge in this "allocation" problem a set of broker. It uses the +C to do most of the work. For each request +C queries so-called Cs if they want +to accept a request eg, the C will accept +Cs, and turn down Cs. If the Music_iterator +cannot find a engraver that wants the request, it is junked (with a +warning message). After all requests have been either assigned, or junked, the Engraver will process the requests (which usually means creating an C or C). If a C creates something, it tells -C. If all requests have been processed, then each -Engraver is notified of any created Staff_element. +If all requests have been processed, then each Engraver is notified +of any created Score_element, via a broadcasting system. =head2 example: @@ -202,41 +201,13 @@ produces: note_request will be taken by a C, stem_request will be taken by a C. C creates a C, C creates a C. Both announce -this to the Staff. Staff will tell C about the -C, which will add the C to the C it just -created. +this to the Staff_engraver. Staff_engraver will tell +C about the C, which will add the +C to the C it just created. To decide on merging, C has grouped several -engravers. There are a few groups: - -=over 4 - -=item * - -Staff wide, contains - - Local_key_engraver - Bar_engraver - Key_engraver - Meter_engraver - Clef_engraver +engravers. Please check init/engraver.ini. -=item * - -Voice group, contains - - Stem_beam_engraver - Script_engraver - Text_engraver - -=item * - -Voice, contains - - Slur_engraver - Notehead_engraver - -=back =head1 ITEMS and SPANNERS @@ -346,8 +317,12 @@ uses the concept of pre- and post-breaks. minimum distance to other columns, to prevent symbols from running into symbols of other columns.) + +=head1 SPACING 2 + + This of course does not solve the problem of generating the springs. This is an area that needs a lot of work, and the optimal solution to find is not of a mathematical nature. - +Gourlay's solution is used. diff --git a/Documentation/lilyliterature.pod b/Documentation/lilyliterature.pod index dd8c40f20d..a4abb247a5 100644 --- a/Documentation/lilyliterature.pod +++ b/Documentation/lilyliterature.pod @@ -7,8 +7,9 @@ Lily Literature -- reading on music engraving/typesetting/etc. A list of resources on music printing/writing and engraving. Please note that don't have access to most material. -[What I do know, I've commented inside brackets. They are just my -personal comments, not to be taken too seriously] +[Personal comments appear in brackets. What I (HWN) know, I've +commented myself. They are just my personal comments, not to be taken +too seriously] =head2 Music engraving: references @@ -81,8 +82,9 @@ John S. Gourlay. ``Spacing a Line of Music,'' Technical Report OSU-CISRC-10/87-TR35, Department of Computer and Information Science, The Ohio State University, 1987. -[Algorithm to generate spacing in polyphonic music, tailored for use -with MusiCopy HWN] +[Algorithm for generating spacing in one line of (polyphonic) music, +tailored for use with MusiCopy. LilyPond uses a variant of it (as of +pl 76) HWN] Allen Parish, Wael A. Hegazy, John S. Gourlay, Dean K. Roush and F. Javier Sola. ``MusiCopy: An automated Music Formatting System''. @@ -188,7 +190,7 @@ Muziek'' afstudeerscriptie Bestuurlijke informatica, no 45327, Erasmus universiteit Rotterdam, 1991. (``An automated system for printing music'' Master's Thesis Managerial Computer Science.) -[This thesis describes a simplistic (monophonic) typesetting system, +[This dutch thesis describes a simplistic (monophonic) typesetting system, and focuses on the breaking algorithm, which is taken from Hegazy & Gourlay HWN] @@ -261,12 +263,10 @@ Software Inc., 1995. ftp://blackbox.cartah.washington.edu/pub/ [Specs for NIFF, a comprehensive but binary (yuk) format for notation HWN] -Alexander Brinkman, ``PASCAL Programming for Music Research''. The -University of Chicago Press, 1990. - =head1 AUTHORS -References contributed by Han-Wen Nienhuys, Miguel Filgueiras, Mark -Basinski, Dorothea Blostein, Stephen Page, Jan Nieuwenhuizen. +References and comments contributed by Han-Wen Nienhuys (HWN), Miguel +Filgueiras, Mark Basinski (MB), Dorothea Blostein, Stephen Page (SP), +Jan Nieuwenhuizen. This should really be redone in BibTeX diff --git a/Documentation/lilypond.pod b/Documentation/lilypond.pod index 46b2fcc581..c0181bc645 100644 --- a/Documentation/lilypond.pod +++ b/Documentation/lilypond.pod @@ -8,17 +8,9 @@ lilypond - the GNU music typesetter =head1 DESCRIPTION -Technically GNU LilyPond is a preprocessor which generates TeX -(or LaTeX) output which contains information to typeset a musical -score. Practically it is a typesetter, which only uses TeX as an -output medium. (this is handy because there exist music fonts for TeX) - -As a bonus, you can also output a MIDI file of what you typed. - -It translates script files (mudela files or F<*.ly>'s) into TeX input. -Typesetting music is a complex task, whereas the message that printed -music conveys is usually a simple one. GNU LilyPond is a try at providing -a simple interface for setting music. +GNU LilyPond which converts music definition files into visual or +audio output: it can produce formatted sheet music in TeX and +and mechanical perfomances to MIDI files. =head1 OPTIONS @@ -88,10 +80,6 @@ Multiple staffs in one score. Each staff can have a different meters. =item * -multiple stafftypes (melodic, rhythmic) [broken from pl28 on] - -=item * - beams, slurs, ties, chords, super/subscripts (accents and text), triplets, general n-plet (triplet, quadruplets, etc.), lyrics, transposition dynamics (both absolute and hairpin style) @@ -131,23 +119,12 @@ information, and small contributions. Han-Wen Nienhuys , http://www.stack.nl/~hanwen -Main author - =item * Jan Nieuwenhuizen , http://www.digicash.com/~jan. -Context errors, Lyrics, mi2mu, MIDI stuff, make structure, bits of -FlowerLib, general comments, Mudela design. - =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++ - -=head1 EXAMPLES - =head1 PROBLEMS @@ -163,16 +140,25 @@ if the bug has been fixed in a newer release. =item * -if the bug has been found earlier, consult F +if the bug has been found earlier, consult F and F + +=back -=item * +If you have found a bug, then you should send a bugreport. -where the bug comes from: if GNU LilyPond bombs out, then please -recompile using with debugging info turned on, and send a copy of the -input which causes the error and a gdb stacktrace of the crash. It -also helps if you can print the values of the objects. So if your -trace is + - send a copy of the input which causes the error + - send a description of the platform you use + - send a description of the LilyPond version you use (with + compile/config options please) + - send a description of the bug itself. + - 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 + + received SIGSEGV (gdb) backtrace 12 #0 Interval::operator+= (this=0x11fffec60..) at ../flower/interval.hh:50 @@ -184,13 +170,6 @@ trace is Than it would help if you send a dump of the Interval and the Item (use: C or use LilyPond C methods). -=back - -Bug reports should be directed to: -bug-gnu-music@vuse.vanderbilt.edu. In any case, they should contain a -description of the problem, a small input file which reproduces it (if -applicable), the lilypond version and a description of the platform. - =head1 FILES @@ -247,8 +226,8 @@ GNU LilyPond is updated very frequently, the latest version is always available at: ftp://pcnov095.win.tue.nl/pub/lilypond. -For programs which part of the GNU music project, the following mailing list -have been setup: +For programs which are part of the GNU music project, the following +mailing list have been setup: =over 4 @@ -298,7 +277,7 @@ 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 -to be repaired. It was decided to rewrite MPP. We debated a lot about +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 with a parser-first, bottom-up rewrite called mpp95 (which totally failed, obviously). @@ -312,3 +291,6 @@ Patchlevel 0.0.7 (or 8) to the mutex list after asking some technical 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). + +The first large scale release (0.1) was planned after approximately 80 +patchlevels on August 1, 1997. diff --git a/Documentation/mi2mu.pod b/Documentation/mi2mu.pod index 1a996ec1bd..a4aa186f3b 100644 --- a/Documentation/mi2mu.pod +++ b/Documentation/mi2mu.pod @@ -9,8 +9,7 @@ mi2mu - convert MIDI to mudela(5) =head1 DESCRIPTION Mi2mu translates a MIDI input file to Mudela (GNU LilyPond source -format). -Mi2mu is part of the GNU LilyPond music typesetting package. +format). Mi2mu is part of the GNU LilyPond music typesetting package. =head1 OPTIONS diff --git a/Documentation/mudela-book.pod b/Documentation/mudela-book.pod new file mode 100644 index 0000000000..042948dc4b --- /dev/null +++ b/Documentation/mudela-book.pod @@ -0,0 +1,55 @@ +=head1 NAME + +mudela-book - integrate LaTeX and mudela + +=head1 SYNOPSIS + + convert-mudela [options] [files] + +=head1 DESCRIPTION + +mudela-book runs LilyPond on fragments of mudela in your source file, +and produces a LaTeXable document, with formatted music. + + \begin{mudela} + CONTENTS + \end{mudela} + +runs LilyPond on CONTENTS, and puts the result back, surrounded by +\preexample and \postexample commands. The \begin takes the +following options: + +=over 4 + +=item fragment + +mudela-book adds some redtape. You +can substitute voice-contents for CONTENTS in this case. + +=item verbatim + +CONTENTS is copied into the TeX source enclosed in a verbatim block. + +=back + +=head1 OPTIONS + +=over 4 + +=item B<--outname> + +The name of TeX file to output + +=item B<--outdir> + +The directory to output lilypond output and input to + +=back + +=head1 BUGS + +Doesn't handle incorrect input sanely. + +=head1 AUTHOR + +Han-Wen Nienhuys diff --git a/Documentation/mudela-course.doc b/Documentation/mudela-course.doc new file mode 100644 index 0000000000..23fc00cb4e --- /dev/null +++ b/Documentation/mudela-course.doc @@ -0,0 +1,157 @@ +% -*-LaTeX-*- +\documentclass{article} +\usepackage{a4wide} +\title{Mudela and LilyPond crash course} +\author{Han-Wen Nienhuys} + +\begin{document} +\maketitle +\def\interexample{\par Produces the following:\par} +\def\preexample{\par\medskip} +\def\postexample{\par\medskip} + + +\section{Overview} +Mudela is a language for specifying music. LilyPond is a +program which converts such a specification into formatted sheet +music, or MIDI output. + +Please note that some examples not only demonstrate features but also +some lurking bugs. If can't understand what is happening, it might +just be my (lack of) programming skills. + + +\begin[fragment,verbatim]{mudela} + { c4 e4 g4 } +\end{mudela} + + +Basics: the \verb+%+ introduces a comment. All music is inside a +\verb+\score+ block which represents one movement, ie one contiguous +block of music. Voices are grouped by \verb+{+ and \verb+}+ and +chords by \verb+<+ and \verb+>+. + +\begin[verbatim]{mudela} +\score { + \melodic { % { means voice + c'4 g'4 % 4 means quaver, 1 beat in 4/4 meter + c''4 ''c4 % c' is 1 octave up, 'c 1 down. + % <> means a chord + } +} +\end{mudela} + +The \verb+\octave+ command controls the default pitch (octave). If you +do not specify duration, the last one entered is used. The +\verb+\paper+ block contains parameters for spacing and dimensions. + +\begin[verbatim]{mudela} +\score { + % twinkle twinkle little star + \melodic { + \octave c'; + c4 c g g a a g2 + f4 f e e d [d8. e16] c2 + + } + \paper { linewidth = 5.\cm; } +} +\end{mudela} + +A more complex example; The multi command controls at what level the +different components of a chord are interpreted. The LilyPond chord +is much more general than a traditional chord. Multiple voices on a +staff are entered as a chord of voices. A score is a chord of staffs, +etc. + +\begin[verbatim]{mudela} + +\score{ + \melodic + { \octave c'; c4 c4 + < \multi 1; { c2 c2 } { c'2 c'2 } > + < \multi 2; { \stem -1; c2 c2 } { \stem 1; c'2 c'2 } > + < \multi 3; + { \clef "bass"; c2 c2 } + { \meter 2/4;\bar "||"; + \key fis cis gis; c'2 c'2 } > + c2 c1 + c1 c1 + < \multi 1; < \multi 3; + { \meter 2/4; \clef "violin"; c2 c2 } + { \meter 2/4; \clef "bass"; c2 c2 } + > + < \multi 3; + { \meter 2/4; \clef "violin"; c2 c2 } + { \meter 2/4; \clef "bass"; c2 c2 } + > + > + } +} + +\end{mudela} + + +LilyPond is designed to handle complicated stuff +automatically. Expertise should be in the program, not in the user. + +The following example shows how multiple voice on the same staff are +handled graciously (well, somewhat). If the noteheads of different +voices collide, they are moved horizontally. The same goes for the rests. + +\begin[verbatim]{mudela} +two_voice = \melodic + < \multi 2; + { \octave c'; \stem -1; + c4 d e f g2~ g4 a [c8 d e f] c2| } + { \stem 1; + g4 f e g ~ g2 g2 c4 g4 g2 } + + > + +two_voice_steminvert = \melodic + < \multi 2; + { \octave c'; \stem 1; +% the f and g on 4th beat are exceptionally ugh. + c4 d e f g2 g4 a | } + { \stem -1; + g4 f e g g2 g2 } + + > + +three_voice = \melodic + < \multi 2; + { \stem 1; + g4 f e f g a g2 } + { \hshift 1; \stem 1; + e2 e2 e2 e2 } + { \stem -1; + c4 d e d c d es } + > + + +restsII = \melodic { + \octave c'; + < \multi2; + { \stem 1; g'8 f' e' d' c' b a g f e d c } + { \stem -1; r r r r r r r r r r r r } + > + r8 r4 + < \multi2; r8 r8 > + < \multi2; r8 r8 r8 > + < \multi2; r8 r8 r8 r8 > + < \multi2; r r > + < \multi2; r r r > + \stem 1; + [c''8 r8 c''8 c''8] + [c8 r8 c8 c8] +} + +\score{ + \melodic { \$two_voice \$two_voice_steminvert + \$three_voice \restsII } +} + +\end{mudela} + +\end{document} diff --git a/Documentation/mudela-man.doc b/Documentation/mudela-man.doc new file mode 100644 index 0000000000..f9405a5eee --- /dev/null +++ b/Documentation/mudela-man.doc @@ -0,0 +1,565 @@ +% -*-latex-*- +\documentclass{article} +\usepackage{a4wide} +\title{GNU LilyPond input format 0.1} +\author{Han-Wen Nienhuys} + +\begin{document} +\maketitle +\def\interexample{\par Produces the following:\par} +\def\preexample{\par\medskip} +\def\postexample{\par\medskip} +\def\file#1{{\texttt{#1}}} + +\section{Introduction} + +This document describes the the GNU LilyPond input format, which is an +effective language for defining music. We call this language +(rather arrogantly) The Musical Definition Language (Mudela 0.1). + +[If anybody comes up with a better name, we'd gladly take +this. Gourlay already uses Musical Description Language, GSharp Score +Definition 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 point of view. + + +The Musical Definition Language (Mudela) version 2, has a logical +structure, making use of typing and naming (using identifiers), that +allows for flexible input, and definition reuse. See MANIFESTO for +reasons and design considerations. + +The below included for explanatory purposes only (i.e., for a complete +and up-to-date definition, see \file{lily/parser.y} and +\file{lily/lexer.l}): + +As a related note, you should take a look at the examples and the init +files, as this document does not cover every aspect of mudela yet, and +may be out of date. + + +\subsection{Files} + +The de-facto extension of Mudela is \file{.ly}. Files may be included by +entering \verb+include+ at the start of a line: + +\begin{verbatim} +\include "a_file.ly" +\end{verbatim} + + +\subsection{Comments} + +Line comments are introduced by a \verb+%+. Block comments are delimited +by \verb+%{+ and \verb+%}+. They do not nest. + +\subsection{Versions} + +Occasionally, small changes in syntax across different versions of +Mudela might give syntax errors. To warn you about possible +incompatibilities, you can specify the Mudela version for which the +inputfile was written, +\begin{verbatim} +\version "0.0.50"; +\end{verbatim} + +A perl-script which tries to convert to newer versions +(\file{convert-mudela}) is included in the LilyPond distribution. + +\subsection{Words} + +Keywords are preceded by a backslash: \verb+\+. They contain +alphabetic characters only. + +Identifiers in their normal form consist start with a backslash, a +alpha character, followed by alpha-numerics. Identifiers can contain +any characters (except whitespace, \verb+$+ and \verb+%+), if you use this +construct: + +\begin{verbatim} +\$i'm_a_weird!!!identifier +\end{verbatim} + +(which is the identifier with the name +\verb+i'm_a_weird!!!identifier+). \verb+$+ Takes any sequence of +characters which are not whitespace, \verb+$+ and \verb+%+. +\verb+$i'm_a_weird!!!string+ + +\subsection{Nesting characters} + +Mudela uses the brace (\verb+{+ and \verb+}+) for most hierarchical +structures. For chords the \verb+<+ and the \verb+>+ are used as +nesting braces. + +\subsection{Constants} + +Please note that -.5 is not a Real. + +\begin{verbatim} +"I am a string" +-1.2e3 % a real +12 % an int +\end{verbatim} + + +\subsection{Identifiers} + +When assigning identifiers you use + +\begin{verbatim} +string = ... +\oldidentifier = .. +\end{verbatim} + +When using identifiers they have to be escaped: + +\begin{verbatim} +oboe = \melodic { ... } +\score{ \melodic { \oboe }} +\end{verbatim} +\subsection{Hierarchical structures} + +The general structure consists of declarations: +\begin{verbatim} +IDENTIFIER = \TYPE{ + +} +\end{verbatim} +and instantiations: + +\begin{verbatim} +\TYPE{ } +\end{verbatim} + +(Currently, \verb+\score+ is the only type that can be instantiated +at top level. Currently declarations can only be done at top level) + +Most instantiations that use an IDENTIFIER are specified as follows: + +\begin{verbatim} +\TYPE{ IDENTIFIER [...] } +\end{verbatim} + +Some exceptions on this rule have been made to prevent inputting +Mudela becoming tedious + + +\subsection{Modes:} + +To simplify different aspects of music definition (entering the notes +and manipulating them) Mudela has a number of different input "modes": + +\begin{description} + + +\item[Normal mode] + +At the start of parsing, Mudela assumes normal mode. +In Normal mode, a word is looked up in the following order: +\begin{verbatim} +word string +\word keyword, identifier +\end{verbatim} +In normalmode, a word is assumed to start with an alphabetic +character, followed by alpha-numeric characters. + +\item[Note mode] + Note mode (and thus Simple mudela) is introduced by + the keyword \verb+\melodic+. In Note mode, a word is looked up in + the following order: + +\begin{verbatim} +word notename, string +\word keyword, identifier +\end{verbatim} +In Note mode a word is considered to have alphabetic characters only. + +\item[Lyric mode] +Lyrics mode (and thus Simple mudela) is introduced by the keyword \verb+\lyrics+. + +In Lyrics mode, a word is looked up in the following order: + +\begin{verbatim} +word string +\word keyword, identifier +\end{verbatim} + +In Lyric mode every sequence of non-digit and non-white characters +starting with an alphabetic character or the \_ is considered a word. + +\begin{verbatim} +a&@&@&TSI|{[ % a word +1THtrhortho % not a "word" +Leise Fl\"u\ss{}teren meine Sapfe % 4 words +_ _ _ _ % 4 words: 4 spaces +\end{verbatim} +\end{description} + +These modes are of a lexical nature. Normal and Note mode largely +resemble each other, save the possibility of entering Reals, +meaning of \verb+_+ and the resolution of words + +\subsection{Notes} + +You enter a note by giving the name and the reciprocal of the duration: + +\begin[fragment,verbatim]{mudela} +a'4 % dutch names +\end{mudela} + +is a A-1 pitched quaver. 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} +'a % 110 + a % 220 + A % 110, uppercase octavates down + a' % 440 +a'' % 880 +'as4.*2/3 +\end{mudela} + +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. + +Notenames are just a special kind of identifiers, and can be declared +for any language appropriate (see \file{dutch.ini}). The default language +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'' + +\begin{verbatim} +% double sharp +cisis disis eisis fisis gisis aisis bisis +% sharps +cis dis eis fis gis ais bis +% naturals +c d e f g a b +% flats +ces des es fes ges as bes +% double flats +ceses deses eses feses geses ases beses +\end{verbatim} + +Rests are named r or s +\begin{verbatim} +r % print a rest +s % a "space" rest, nothing is printed. +\end{verbatim} + +These notenames along with duration are enough material to construct +simple melodies: + +\begin[verbatim,fragment]{mudela} +\octave c'; +c4 c4 g4 g4 a4 a4 g2 +f4 f4 e4 e4 d4 d4 c2 +\end{mudela} + +Music is able to express more. generally speaking, the other +'features' are either connected between notes (slurs, beams: spanning +requests) or attached to notes (eg. accents). The former are +implemented as START and STOP stop features and then attached to the note. + +\begin{verbatim} +[] START/STOP a beam +() START/STOP a slur +\end{verbatim} + +example: +\begin[verbatim,fragment]{mudela} + \octave c'; + [c8 () d8 () e8 + e8(] [)g8 % NO nesting! + [2/3 c8 c8 c8]1/1 % a triplet +\end{mudela} + +Please note that these two characters do \emph{not} necessarrily nest, +they should attached to the note \verb+[ ]+ will generate a parse +error for this reason. + +\subsection{Slurs and Ties} + +Ties connect the noteheads of adjecent notes. They are entered as follows: + +\begin[fragment]{mudela} +a4 ~ a4 +\end{mudela} + +Slurs connect whole chords, and try to avoid crossing stems. They are +entered as follows: +\begin{verbatim} + +\begin[fragment]{mudela} +a4( )a4 +\end{mudela} + +\subsection{Scripts} + +Symbols which can be put at either side (above or below) of a staff +are entered as follows: +\begin[fragment]{mudela} +a-^ % marcato, direction: default + a^- % portato, direction: above note + a_. % staccato, direction: below note + a^\fermata % predefined identifier + c_"marcato" % add a text + c^"marcato" +c-"marcato" +\end{mudela} + +If you want to define your own scripts refer to \file{script.ini} for +details. + + +Dynamics can be put after the notename: +\begin{verbatim} +a4 \dynamic { 0 } % 0 = fff, 7 = ppp +\end{verbatim} + +Mudela defines the following dynamic identifiers: + +\begin{verbatim} +ppp pp p mp mf df ff fff % df iso f, f is a notename. +\end{verbatim} +and the following abbreviations: +\begin{verbatim} +\< %start crescendo +\> % start decrescendo +\! % end crescendo/decrescendo +\end{verbatim} + +\subsection{Defaults} + +If omit the duration of a note, a default value is substituted. For +this default value mudela uses the last duration explicitly entered. + +Thus the following inputs are equivalent +\begin{verbatim} +c4 c4 c16 c16 c16 s16 c4 c16 +c4 c c16 c c c c4 c16 +\end{verbatim} + +If you are typing music which does not lie in the "small" and "large" +octave, you can prevent having to type \verb+'+ all the time by using the +\verb+\octave+ command: These two lines have the same pitch. +\begin{verbatim} +c'' d'' e'' c d e c d e + +\octave c''; c d e ''c ''d ''e \octave c; c d e +\end{verbatim} + +By default the setting of \verb+\octave+ is 0. + +\subsection{Lyrics} + +Lyrics in Mudela resemble Simple mudela a lot, with notes substituted +by text. + +All syllables are entered separately, separated by whitespace +\begin{verbatim} +Twin-4 kle4 twin-4 kle4 ... +\end{verbatim} + +Two syllables or words that compose a single +duration entry are bound together using an underscore +\begin{verbatim} +He_could4 not4 +\end{verbatim} + +\subsection{ Music direction} + +Mudela reads left to right, but you can still stack voices and +Voice\_elements which are produced in two directions: horizontal +(voice like) and vertical (chord like) + +A note is a prime example of a Music-element is the note: +\begin{verbatim} +c4 +\end{verbatim} + +If you enclose a sequence of Music-elements in braces ( { } ), then you form +another kind of Music-element (Voice) with those pieces +\begin{verbatim} + { c c g g a a g2 } % twinkle twinkle + { { c c g g} { a a g2 } } + + horOne = \melodic { c c g g } + horTwo = \melodic { a a g2 } + twinkle = \melodic { \horOne \horTwo } +\end{verbatim} + +You can stack Music-elements by enclosing a sequence Music-elements of +notes with < and >. Example: +\begin{verbatim} + % a-major chord +\end{verbatim} +You can also put vertical music inside horizontal music: +\begin{verbatim} +{ c } % 4 increasing chords +\end{verbatim} +And vice versa +\begin{verbatim} +< \multi 2; + {c c g g a a g2} + {r2 r2 c c g g a a g2} > % a canon +\end{verbatim} + +The duration of a chord equals the union of the durations of each of +its elements. The \verb+\multi 2+ is a construct which is explained +below. + +You can also create a Music-element by transposing a Music-element: +\begin{verbatim} +\transpose + d % from c to the d that's one octave down + { e4 f4 } % the horizontal music + +\end{verbatim} + +\subsection{Voicegroups} + +If more than one "voice" is in a staff, then you have the option of +putting the different voices into so called voicegroups: members of +the same voicegroup share certain characteristics, among others: + + - dynamics + - text + - beams and stems + - scripts + +For the actual list, see the init file \file{register.ini} + +Putting different musical lines in to the same voicegroup effectively +makes LilyPond try to form chords of all those lines. Putting +different musical lines in to different voicegroups effectively makes +LilyPond try to set those lines as independently as possible. + +You can set the voicegroup of a voice with the command \verb+\group+, e.g., +\begin{verbatim} + oboeI = \melodic { + \group "oboes"; + [e8 f8 + \group "+solo"; + [g16 a16 g16 fis16] + \group "-"; + g8 f8 + } + oboeII = \melodic { \group "oboes"; + c8 d8] + e4 + e8 d8 + } + /// ... + + \staff { + melodicregs \melodic{ oboeI } + \melodic { oboeII} +} +\end{verbatim} +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 +created, called "oboes+solo". The \verb+\group "-"+ command makes the +voice enter "oboes" again. + +Please do note that [] are voicegroup wide; the previous input is +valid: the beam, started in oboeI, voicegroup "oboes" is also ended in +voicegroup "oboes", albeit not in oboeI but oboeII + +This concept may seem contorted, but it allows you to set the separate +oboe parts without changing the \verb+oboeI+ and \verb+oboeII+ (assuming that +you edit the [] in the example.) + +The construct +\begin{verbatim} +< { .... } {......} > +\end{verbatim} +makes a chord (all horizontal parts are in the same voicegroup). The construct +\begin{verbatim} +< \multi 2; { ....} { .... } > +\end{verbatim} +creates horizontal parts which behave independently. You will have to +set voicegroup features by hand (\verb+\stem+ and \verb+\hshift+. See examples) + +The construct +\begin{verbatim} +< \multi 3; { ....} { .... } > +\end{verbatim} +creates a chord with each part in a different staff + + +\subsection{Durations} + +A duration always starts with the duration type (1,2,4 etc), and then +any optional multipliers/dots + +\subsection{Meters/groupings} + +A meter has this form: +\begin{verbatim} +\meter 3/4 ; +\end{verbatim} + +Rhythmic grouping is a concept closely associated with this. For +example, in a 5/8 meter, the counts are grouped 2+3. In mudela this is +entered as +\begin{verbatim} +\grouping 8*2 8*3 ; +\end{verbatim} +You can start the piece with a partial measure, the command takes the +same syntax as grouping: +\begin{verbatim} +\partial 16*3 4; +\end{verbatim} + +Make the piece start with a partial measure [transl?] lasting 1 3/4 +quaver. + +These commands are also "voice elements", and constitute simple mudela +(consisting of stuff with duration 0). + +\section{STRUCTURE} + +In concrete, a piece of Mudela has the following structure: +\begin{verbatim} +% declare pieces of music: + melody = \music{ } + accompany = \music{ } + + % instantiate (=create tex, midi output) the score: + \score{ + \melodic < + \multi 3; + \melody + \accompany + > + \midi{ } + \paper{ } +} +\end{verbatim} + +\subsection{Examples} + +Examples are included with the GNU LilyPond distribution. For the sake of +maintenance no long examples are included in this document. + + +\section{HISTORY} + +This language has a number of roots. First and foremost, GNU LilyPond's +predecessor mpp was the inspiration of simple Mudela. Secondly, the +hierarchical structure looks a lot like Rayce's (Rayce is a raytracer +that I've written as a hobby project. ), which in turn owes a lot to +POVRay. + +Now, we know, musictypesetting and raytracing do not necessarily +require the same input format, and we know that a lot more ways exist +to convert music to ASCII, but we did give this language some +thoughts. As always suggestions are appreciated. + +\end{document} + diff --git a/Documentation/mudela.pod b/Documentation/mudela.pod deleted file mode 100644 index 633c9b588d..0000000000 --- a/Documentation/mudela.pod +++ /dev/null @@ -1,574 +0,0 @@ -=head1 NAME - -Mudela - GNU LilyPond input format 0.1 - -=head1 DESCRIPTION - -This document describes the the GNU LilyPond input format, which is an -effective language for defining music. We call this language -(rather arrogantly) The Musical Definition Language (S). - -[If anybody comes up with a better name, we'd gladly take this Gourlay -already uses Musical Description Language, GSharp Score Definition -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 point of view. - - -=head1 Overview - -The Musical Definition Language (Mudela) S, has a logical -structure, making use of typing and naming (using identifiers), that -allows for flexible input, and definition reuse. See MANIFESTO for -reasons and design considerations. - -The below included for explanatory purposes only (i.e., for a complete -and up-to-date definition, see F and F): - -As a related note, you should take a look at the examples and the init -files, as this document does not cover every aspect of mudela yet, and -may be out of date. - -=head2 Files - -The de-facto extension of Mudela is F<.ly>. Files may be included by -entering C at the start of a line: - - \include "a_file.ly" - -=head2 Comments - -Line comments are introduced by a C<%>. Block comments are delimited -by C<%{> and C<%}>. They do not nest. - -=head2 Versions - -Occasionally, small changes in syntax across different versions of -Mudela might give syntax errors. To warn you about possible -incompatibilities, you can specify the Mudela version for which the -inputfile was written, - - \version "0.0.50"; - -A perl-script which tries to convert to newer versions -(F) is included in the LilyPond distribution. - -=head2 Words - -Keywords are preceded by a backslash: '\'. They contain alphabetic -characters only. - -Identifiers in their normal form consist start with a alpha character, -followed by alpha-numerics. Identifiers can contain any characters -(except whitespace, C<$> and C<%>), if you use this construct: - - $i'm_a_weird###identifier - -(which is the identifier with the name -C ). C<$> Takes any sequence of -characters which are not whitespace, C<$> and C<%>. - - \$i'm_a_weird###escaped_word - -=head2 Nesting characters - -Mudela uses the brace (C<{> and C<}>) for hierarchical structures. To -aid the eye in reading, for chords the < and the > are used as -nesting braces. - -=head2 Constants - -Please note that -.5 is no Real. - - "I am a string" - -1.2e3 % a real - 12 % an int - - - -=head2 Identifiers - -=head2 Hierarchical structures - -The general structure consists of declarations: - - IDENTIFIER = \TYPE{ - - } - -and instantiations: - - \TYPE{ } - -(Currently, C<\score> is the only type that can be instantiated -at top level. Currently declarations can only be done at top level) - -Most instantiations that use an IDENTIFIER are specified as follows: - - \TYPE{ IDENTIFIER [...] } - -Some exceptions on this rule have been made to prevent inputting -Mudela becoming tedious - - -=head2 Simple mudela - -The actual musical part of Mudela that defines a melody, is known as -I. - -Simple mudela is the most common type of music. It consists of a list -of notes or lyrics, chords, and commands. - -=head2 Modes: - -To simplify different aspects of music definition (entering the notes -and manipulating them) Mudela has a number of different input "modes": - -=over 4 - -=item Normal mode - -At the start of parsing, Mudela assumes normal mode. -In Normal mode, a word is looked up in the following order: - - word identifier, string - \word keyword, identifier, string - -In normalmode, a word is assumed to start with an alphabetic -character, followed by alpha-numeric characters. - -=item Note mode - -Note mode (and thus Simple mudela) is introduced by the keyword C<\melodic>. -In Note mode, a word is looked up in the following order: - - word notename, string - \word keyword, identifier, string - -In Note mode a word is considered to have alphabetic characters only. - -=item Lyric mode - -Lyrics mode (and thus Simple mudela) is introduced by the keyword C<\lyrics>. - -In Lyrics mode, a word is looked up in the following order: - - word string - \word keyword, identifier, string - -In Lyric mode every sequence of non-digit and non-white characters -starting with an alphabetic character or the '_'is considered a word. - - a&@&@&TSI|{[ % a word - 1THtrhortho % not a "word" - Leise Fl\"u\ss{}teren meine Sapfe % 4 words - _ _ _ _ % 4 words: 4 spaces - -=back - -These modes are of a lexical nature. Normal and Note mode largely -resemble each other, save the possibility of entering Reals, -meaning of C<_> and the resolution of words - -=head2 Notes - -Simple mudela basically is a sequence of the notes you want to -enter. - - a'4 % dutch names - -is a A-1 pitched quaver. The ' signifies an octave change. A-1 is 440 -Hz concert-pitch. C is also known as the central c. More examples: - - 'a % 110 - a % 220 - a' % 440 - a'' % 880 - -another example: - - 'as4.*2/3 - -This is an A flat, (just below 110 Hz concert-pitch). The C<*2/3> -signifies that this note is part of a triplet (3 in stead of 2). The -duration is one and a half quaver (C<4.>) times 2/3. - - -Notenames are just a special kind of identifiers, and can be declared -for any language appropriate (see F). The default language -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" - - % double sharp - cisis disis eisis fisis gisis aisis bisis - % sharps - cis dis eis fis gis ais bis - % naturals - c d e f g a b - % flats - ces des es fes ges as bes - % double flats - ceses deses eses feses geses ases beses - -The standard notenames also have uppercase versions, which octavate -down: - - a % 220 concert-pitch - A % 110 - 'A % 55 - A' % 220 - Cisis - -Rests are named r or s - - r % print a rest - s % a "space" rest, nothing is printed. - -These notenames along with duration are enough material to construct -simple melodies: - - c4 c4 g4 g4 a4 a4 g2 - f4 f4 e4 e4 d4 d4 c2 - -Music is able to express more. generally speaking, the other -'features' are either connected between notes (slurs, beams: spanning -requests) or attached to notes (eg. accents). The former are -implemented as START and STOP stop features and then attached to the note. - - [] START/STOP a beam - () START/STOP a slur - - -example: - - [c8 () d8 () e8 ] - -Please note that these two characters do I necessarrily nest, -they should attached to the note C<[ {c4 c4} ]> will generate a parse -error for this reason. - - [c8 e8(] [)g8 - % NO nesting! - [2/3 c8 c8 c8]1/1 % a triplet - - -=head2 Slurs and Ties - -Ties connect the noteheads of adjecent notes. They are entered as follows: - - a4 ~ a4 - -Slurs connect whole chords, and try to avoid crossing stems. They are -entered as follows: - - a4( )a4 - -=head2 Scripts - -Symbols which can be put at either side (above or below) of a staff -are entered as follows: - - a-^ % marcato, direction: default - a^- % portato, direction: above note - a_. % staccato, direction: below note - a^\script { "symbolindex" . . . } % see script.ini for details. - a^\fermata % predefined identifier - -Dynamics can be put after the notename: - - a4 \dynamic { 0 } % 0 = fff, 7 = ppp - -Mudela defines the following dynamic identifiers: - - ppp pp p mp mf df ff fff % df iso f, f is a notename. - -and the following abbreviations: - - \< %start crescendo - \> % start decrescendo - \! % end crescendo/decrescendo - -=head2 Text - -To accompany a note with a text (eg, "marcato"), you should say: - - c_"marcato" - c^"marcato" - c-"marcato" - -the c- construct chooses the default up/down direction. - - - - -=head2 Defaults - -If omit the duration of a, a default value is substituted. For this -default value, there are two modes: - -=over 4 - -=item 1 - -Use the last duration explicitly entered - -=item 2 - -Use the explicitly set "default duration" - -=back - -Thus the following inputs are equivalent - - c4 c4 c16 c16 c16 s16 c4 c16 - - \duration { "last" } - c4 c c16 c c c c4 c16 - - \duration { 4 } - c c c16 c16 c16 c16 c c16 - - \duration { 16 } - c4 c4 c c c c c4 - -If you are typing music which does not lie in the "small" and "large" -octave, you can prevent having to type C<'> all the time by using the -C<\octave> command: These two lines have the same pitch. - - c'' d'' e'' - \octave{c''} c d e - -By default the setting of C<\octave> is 0. - -=head2 Lyrics - -Lyrics in Mudela resemble Simple mudela a lot, with notes substituted -by text. - -All syllables are entered separately, separated by whitespace - - Twin-4 kle4 twin-4 kle4 ... - -Two syllables or words that compose a single -duration entry are bound together using an underscore - - He_could4 not4 - -=head2 Music direction - -Mudela reads left to right, but you can still stack voices and -Voice_elements which are produced in two directions: horizontal -(voice like) and vertical (chord like) - -A sequence of notes (horizontal) is called simple horizontal, eg - - c4 c4 g4 g4 - - -You can also glue two pieces of simple horizontal music together with the -concatenation operator: - - horOne = \melodic { c c g g } - horTwo = \melodic { a a g2 } - twinkle = \melodic { \horOne ++ \horTwo } - -If you enclose simple horizontal music in braces ( { } ), then you get -horizontal music: - - { c c g g a a g2 } % twinkle twinkle - -You can start vertical music (a "chord") by enclosing a sequence of -notes with < and >. Example: - - % a-major chord - -You can also put vertical music inside horizontal music: - - { c } % 4 increasing chords - -And vice versa - - < \multivoice - {c c g g a a g2} - {r2 r2 c c g g a a g2} > % a canon - -The duration of a chord equals the union of the durations of each of -its elements. The C<\multivoice> is a construct which is explained -below. - - -=head2 Transposition - -You can transpose horizontal music in the following way: - - - \melodic { - \meter 2/4; - ++ - \transpose { - d % from c to the d that's one octave down - { e4 f4 } % the horizontal music - } ++ g4 - } - -The result is, as you can see, again simple horizontal music. - - -=head2 Voicegroups - -If more than one "voice" is in a staff, then you have the option of -putting the different voices into so called voicegroups: members of -the same voicegroup share certain characteristics, among others: - - - dynamics - - text - - beams and stems - - scripts - -For the actual list, see the init file F - -Putting different musical lines in to the same voicegroup effectively -makes LilyPond try to form chords of all those lines. Putting -different musical lines in to different voicegroups effectively makes -LilyPond try to set those lines as independently as possible. - -You can set the voicegroup of a voice with the command C<\group>, e.g., - - oboeI = \melodic { - \group "oboes"; - [e8 f8 - \group "+solo"; - [g16 a16 g16 fis16] - \group "-"; - g8 f8 - } - oboeII = \melodic { \group "oboes"; - c8 d8] - e4 - e8 d8 - } - /// ... - - \staff { - melodicregs \melodic{ oboeI } - \melodic { oboeII} - } - -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 -created, called "oboes+solo". The C<\group "-"> command makes the -voice enter "oboes" again. - -Please do note that [] are voicegroup wide; the previous input is -valid: the beam, started in oboeI, voicegroup "oboes" is also ended in -voicegroup "oboes", albeit not in oboeI but oboeII - -This concept may seem contorted, but it allows you to set the separate -oboe parts without changing the C and C (assuming that -you edit the [] in the example.) - -The construct - - < { .... } {......} > - -makes a chord (all horizontal parts are in the same voicegroup). The construct - - < \multivoice { ....} { .... } > - -creates horizontal parts which behave independently. You will have to -set voicegroup features by hand (\stem and \hshift. See examples) - - - - -=head2 Rhythms - -Rhythms in Mudela are entered identical to Simple mudela. -The melodic part of the information is ignored. - -=head2 Durations - -A duration always starts with the duration type (1,2,4 etc), and then -any optional multipliers/dots - -=head2 Meters/groupings - -A meter has this form: - - \meter 3/4 ; - -Rhythmic grouping is a concept closely associated with this. For -example, in a 5/8 meter, the counts are grouped 2+3. In mudela this is -entered as - - \grouping 8*2 8*3 ; - -You can start the piece with a partial measure, the command takes the -same syntax as grouping: - - \partial 16*3 4; - -Make the piece start with a partial measure [transl?] lasting 1 3/4 -quaver. - -These commands are also "voice elements", and constitute simple mudela -(consisting of stuff with duration 0). - -=head1 STRUCTURE - -In concrete, a piece of Mudela has the following structure: - - % declare pieces of music: - melody = \music{ } - accompany = \music{ } - - % instantiate (=create tex, midi output) the score: - \score{ - \staff{ melodicregs melody } - \staff{ melodicregs accompany } - \midi{ } - \paper{ } - } - -=head2 Examples - -Examples are included with the GNU LilyPond distribution. For the sake of -maintenance no long examples are included in this document. - -=head2 Staff - -The staff is a simple container (containing Voices). The so-called -"registers" determine the characteristics of the Staff. At this time, -LilyPond supports the following personalities: - -=over 4 - -=item melodicregs - -This makes the staff into a single five line melodic staff. - -=item lyricregs - -This makes the staff into a staff which will only set Lyric_requests. - -=back - - -=head1 HISTORY - - -This language has a number of roots. First and foremost, GNU LilyPond's -predecessor mpp was the inspiration of simple Mudela. Secondly, the -hierarchical structure looks a lot like Rayce's (Rayce is a raytracer -that I've written as a hobby project. ), which in turn owes a lot to -POVRay. - -Now, we know, musictypesetting and raytracing do not necessarily -require the same input format, and we know that a lot more ways exist -to convert music to ASCII, but we did give this language some -thoughts. As always suggestions are appreciated. - diff --git a/Documentation/other-packages.pod b/Documentation/other-packages.pod index eb32c65b68..7d6f3c0b4b 100644 --- a/Documentation/other-packages.pod +++ b/Documentation/other-packages.pod @@ -11,7 +11,8 @@ packages. Feel free to add info (and mail it to me). =item G Sharp, http://dept-info.labri.u-bordeaux.fr/~strandh/Gsharp -An alpha version notation editor for X. Source available on request. +An alpha version notation editor for X in Scheme. Source available on +request. =item Rosegarden, http://www.math.bath.ac.uk/~masjpf/rose.html @@ -21,7 +22,7 @@ A Notation editor/Sequencer for X (win95 port underway). Outputs musictex. http://www-ccrma.stanford.edu/CCRMA/Software/cmn/cmn.html A versatile lisp package. Part of the Common Music system. Input is in -Lisp. It needs Adobe fonts +Lisp. It needs some Adobe fonts =item Vivace, http://www.calband.berkeley.edu/~gmeeker/vivace @@ -65,7 +66,6 @@ available on request. (?) A TeX macro package for typesetting single-staff music by Angelika Schofer & Andrea Steinbach. With some fonts - =head2 Free (zero cents) =item Calliope, http://www.cl.cam.ac.uk/users/wfc/ @@ -89,8 +89,12 @@ Described in Computer vol 29(6). Shareware =item LIME, http://datura.cerl.uiuc.edu/ +Notation editor for W95 and Mac + =item Sibelius, http://www.acorn.co.uk/developers/sibelius +Notation/engraving on Acorn machines. + =item Finale =item Score @@ -116,7 +120,7 @@ A shareware windows package =item MusiCopy, ? -Ohio State university. +A project at Ohio State university, which was discontinued in 1987. =item Berlioz, http://www.bsi.fr/~montel/ diff --git a/INSTALL.text b/INSTALL.text index 1a6758d625..d4ff1b1791 100644 --- a/INSTALL.text +++ b/INSTALL.text @@ -11,15 +11,6 @@ DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN This page documents installation and compilation of GNU LilyPond -IIIIMMMMPPPPOOOORRRRTTTTAAAANNNNTTTT - if you have downloaded a - - *.pre* - - version, then this is version is _n_o_t meant for producing - nice output, but to keep your patchsets up to date. It - might not even compile. - PPPPRRRREEEERRRREEEEQQQQUUUUIIIISSSSIIIITTTTEEEESSSS For compilation you need. @@ -40,35 +31,59 @@ PPPPRRRREEEERRRREEEEQQQQUUUUIIIISSSSIIIITTTTEE +o Bison. (Version 1.25 or better) -RRRREEEECCCCOOOOMMMMMMMMEEEENNNNDDDDEEEEDDDD - +o Perl. Most scripts are written in Perl. The - documentation was created with the perl's Plain Old - Documentation. +RRRRUUUUNNNNNNNNIIIINNNNGGGG + GNU LilyPond does use a lot of resources. For operation + you need the following: - +o (GNU) find + +o TeX -CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG aaaannnndddd CCCCOOOOMMMMPPPPIIIILLLLIIIINNNNGGGG - to install GNU LilyPond, simply type: + +o The MusixTeX fonts (I included those found in + MusixTeX T.73). Beware, the clef symbol seems to have + changed its position in some versions, (notably + Egler's, a.k.a. OpusTeX). The MusixTeX fonts are + included in MusixTeX T.73, which can be had from any + CTAN site, eg at - configure - make install + ftp://ftp.shsu.edu/tex-archive/macros/musixtex/taupin + ftp://ftp.tex.ac.uk/tex-archive/macros/musixtex/taupin + ftp://ftp.dante.de/tex-archive/macros/musixtex/taupin - This will install the following files: + You only need the contents of the _m_f_/ subdirectory of + the package. + +RRRREEEECCCCOOOOMMMMMMMMEEEENNNNDDDDEEEEDDDD + Although not strictly necessary, these are recommended to + have. + +o Perl. Most scripts are written in Perl. The + documentation was created with the perl's Plain + Old Documentation. +28/Jul/97 LilyPond 0.0.76 1 -7/Jul/97 LilyPond 0.0.74 1 +INSTALL(1) LilyPond documentation INSTALL(1) + +o (GNU) find -INSTALL(1) LilyPond documentation INSTALL(1) + +o A fast computer (a full page of music typically + takes 1 minute on my 486/133, using the + --------eeeennnnaaaabbbblllleeee----cccchhhheeeecccckkkkiiiinnnngggg compile. It's lot slower than + most MusiXTeX preprocessors) +CCCCOOOONNNNFFFFIIIIGGGGUUUURRRRIIIINNNNGGGG aaaannnndddd CCCCOOOOMMMMPPPPIIIILLLLIIIINNNNGGGG + to install GNU LilyPond, simply type: + + configure + make install + + This will install the following files: /usr/local/man/man1/mi2mu.1 /usr/local/man/man5/mudela.5 @@ -78,7 +93,6 @@ INSTALL(1) LilyPond documentation INSTALL(1) /usr/local/bin/mi2mu /usr/local/share/lilypond/* /usr/lib/texmf/texmf/tex/lilypond/* - /usr/lib/texmf/texmf/fonts/source/lilypond/* The TeX include directory is detected dynamically, but it can be adjusted with --------eeeennnnaaaabbbblllleeee----tttteeeexxxx----pppprrrreeeeffffiiiixxxx and --------eeeennnnaaaabbbblllleeee----tttteeeexxxx---- @@ -98,7 +112,7 @@ INSTALL(1) LilyPond documentation INSTALL(1) configure --prefix=/home/me_myself_and_I/ - In this case, you will have to set MFINPUTS, and TEINPUTS + In this case, you will have to set MFINPUTS, and TEXINPUTS accordingly. If you want to install GNU LilyPond in _/_u_s_r_/_l_o_c_a_l, and @@ -110,57 +124,59 @@ INSTALL(1) LilyPond documentation INSTALL(1) Since GNU LilyPond currently is beta, you are advised to also use - --enable-debugging - --enable-checking - other options include: - --enable-shared - Make a shared library (gnu/linux, solaris (?) only ) - --enable-printing - Enable debugging print routines (lilypond ----dddd option) +28/Jul/97 LilyPond 0.0.76 2 - --enable-optimise - Set maximum optimisation -7/Jul/97 LilyPond 0.0.74 2 +INSTALL(1) LilyPond documentation INSTALL(1) + --enable-debugging + --enable-checking + other options include: + --enable-shared + Make a shared library (gnu/linux, solaris (?) + only ) -INSTALL(1) LilyPond documentation INSTALL(1) + --enable-printing + Enable debugging print routines (lilypond ----dddd + option) + --enable-optimise + Set maximum optimisation --enable-profiling - Compile with support for profiling + Compile with support for profiling --enable-tex-prefix - Set the directory where texmf lives + Set the directory where texmf lives --enable-tex-dir - Set then directory tex input is in (detected as a - subdir of tex-prefix) + Set then directory tex input is in (detected as a + subdir of tex-prefix) --enable-mf-dir - Set then directory tex input is in (idem) + Set then directory mf input is in (idem) - All options are documented in the _c_o_n_f_i_g_u_r_e help The - option --------eeeennnnaaaabbbblllleeee----ooooppppttttiiiimmmmiiiisssseeee is recommended for Real Life - usage. + All options are documented in the _c_o_n_f_i_g_u_r_e help + The option --------eeeennnnaaaabbbblllleeee----ooooppppttttiiiimmmmiiiisssseeee is recommended for + Real Life usage. - If you do + If you do - make all + make all - everything will be compiled, but nothing will be - installed. The resulting binaries can be found in the - subdirectories _o_u_t_/ (which contain all files generated - during compilation). + everything will be compiled, but nothing will be + installed. The resulting binaries can be found + in the subdirectories _o_u_t_/ (which contain all + files generated during compilation). IIIINNNNSSSSTTTTAAAALLLLLLLLIIIINNNNGGGG If you have done a successful make, then a simple @@ -169,31 +185,15 @@ IIIINNNNSSSSTTTTAAAALLLLLLLLIIIINNNNGGGG should do the trick. - [todo. Obsolete; fonts are in distribution now.] - Install the musixtex fonts in a directory which TeX and MF knows (if you are root, look for a directory which contains the directories with AMS and CM source (*.mf) files. Create a subdir lilypond or musixtex and copy the fonts into that). Do not forget to rehash TeX (if - applicable) - - Example: my fonts are in - _/_u_s_r_/_l_o_c_a_l_/_l_i_b_/_t_e_x_f_o_n_t_s_/_m_u_s_i_x_t_e_x_/, and I have a symlink - pointing to that in - _/_u_s_r_/_l_i_b_/_t_e_x_m_f_/_t_e_x_m_f_/_f_o_n_t_s_/_s_o_u_r_c_e_/_p_u_b_l_i_c_/ - -CCCCAAAAVVVVEEEEAAAATTTTSSSS - +o The -O2 option to gcc triggers a gcc bug on DEC Alpha - in dstream.cc. You should turn off this flag for this - file. -RRRRUUUUNNNNNNNNIIIINNNNGGGG - GNU LilyPond does use a lot of resources. For operation - -7/Jul/97 LilyPond 0.0.74 3 +28/Jul/97 LilyPond 0.0.76 3 @@ -202,22 +202,23 @@ RRRRUUUUNNNNNNNNIIIINNNNGGGG INSTALL(1) LilyPond documentation INSTALL(1) - you need the following: + applicable) - +o A fast computer (a full page of music typically takes - 1 minute on my 486/66, using the --------eeeennnnaaaabbbblllleeee----cccchhhheeeecccckkkkiiiinnnngggg - compile. It's lot slower than most MusiXTeX - preprocessors) + Example: my fonts are in + _/_u_s_r_/_l_o_c_a_l_/_l_i_b_/_t_e_x_f_o_n_t_s_/_m_u_s_i_x_t_e_x_/, and I have a symlink + pointing to that in + _/_u_s_r_/_l_i_b_/_t_e_x_m_f_/_t_e_x_m_f_/_f_o_n_t_s_/_s_o_u_r_c_e_/_p_u_b_l_i_c_/. After I copied + the files, I ran "texhash" - +o TeX + ftp://hprib.lps.u-psud.fr/pub/music_zips/musixtex.zip - +o The MusixTeX fonts (I included those found in - MusixTeX T.73). Beware, the clef symbol has changed - position in the Egler version, a.k.a. OpusTeX) +CCCCAAAAVVVVEEEEAAAATTTTSSSS + +o The -O2 option to gcc triggers a gcc bug on DEC + Alpha in dstream.cc. You should turn off this + flag for this file. - At this time, GNU LilyPond output looks nice, but is not - of production quality. If you're not discouraged; this is - what I type in my xterm: +EEEEXXXXAAAAMMMMPPPPLLLLEEEE + This is what I type in my xterm: lilypond someinput.ly tex lelie.tex @@ -251,15 +252,14 @@ INSTALL(1) LilyPond documentation INSTALL(1) RRRREEEEDDDDHHHHAAAATTTT LLLLIIIINNNNUUUUXXXX RedHat Linux users should be able to get a RPM. A spec - file is in _m_a_k_e_/_l_i_l_y_p_o_n_d_._s_p_e_c. You should be able to + file is in _m_a_k_e_/_o_u_t_/_l_i_l_y_p_o_n_d_._s_p_e_c. You should be able to create an rpm as a normal user. Be sure you have a - ~/.rpmrc, and edit the RPM-dir in _V_a_r_i_a_b_l_e_s_._m_a_k_e + ~/.rpmrc, and edit the RPM-dir in _V_a_r_i_a_b_l_e_s_._m_a_k_e. (If you + create the RPM as a normal user the permissions will not - - -7/Jul/97 LilyPond 0.0.74 4 +28/Jul/97 LilyPond 0.0.76 4 @@ -268,6 +268,8 @@ RRRREEEEDDDDHHHHAAAATTTT LLLLIIIINNNNUUUUXXXX INSTALL(1) LilyPond documentation INSTALL(1) + be set correctly, unfortunately) + WWWWIIIINNNNDDDDOOOOZZZZEEEE Windows NT: @@ -280,28 +282,26 @@ WWWWIIIINNNNDDDDOOOOZZZZEEEE make windows32 -PPPPLLLLAAAATTTTFFFFOOOORRRRMMMMSSSS - GNU LilyPond (pl 0.0.39) is known to compile on the - following platforms: +AAAAUUUUTTTTHHHHOOOORRRRSSSS + Han-Wen Nienhuys + + Jan Nieuwenhuizen + + Have fun! + + + + + + - Unix: - * gnu/linux 2.0.x, g++ 2.7.2[.1] - * aix 4.1, g++ 2.7.2 - * solaris 2.5, g++ 2.7.2 - Other: - * windows-nt 4.0, cygnus gnu-windows32 beta17.1 (~=g++ 2.7.2) - * gnu/linux 2.0.28 X to doze, gcc-go32 (~=g++ 2.7.2) [exec. untested] -AAAAUUUUTTTTHHHHOOOORRRRSSSS - Han-Wen Nienhuys - Jan Nieuwenhuizen - Have fun! @@ -325,6 +325,6 @@ AAAAUUUUTTTTHHHHOOOORRRRSSSS -7/Jul/97 LilyPond 0.0.74 5 +28/Jul/97 LilyPond 0.0.76 5 diff --git a/NEWS b/NEWS index e68557764c..2cf9b4d45e 100644 --- a/NEWS +++ b/NEWS @@ -1,31 +1,44 @@ +pl 76 + - mudela version bumped to 0.1 + - mudela-book + - doco updates, now some stuff in LaTeX + - junked book.{ly,tex} example + - progress indicator + - rhythm.ly updated + - removed mf sources from distribution due to (c) stuff + - allowal of breaks handled cleanly + - junked Subtle_reqs, junked Request_iterator. Request + iteration now by Voice_element_iterator + - Piano_bar, Piano_bar_engraver, Span_score_bar_engraver, + Span_score_bar + - Swallow_performer + - removed Staff_engravers, grouping into Line_group_engraver + - Head_column as base for Rest_column,Note_column + - Score_column derived from PCol + - regurgled Line spacing: interface and implementation + separate. Idealspacing moved into Spring_spacer + - Gourlay style linespacing + pl 75.jcn6 - {lyric,meter,key}-performer - - span-brace-* - -pl 75.jcn5 + - span-brace-* (Removed again. Such is life) - doze compile - -pl 75.jcn4 - midi output, notes only - -pl 75.jcn3 - working midi output -- hacked + - doze compile, mingw32 configure (still triggers gcc int. comp err) -pl 75.jcn2 - - doze compile, mingw32 configure (still triggers gcc ico) +pl 74pre.jcn2 + - mi2mu fixes after scott snyder [sss] + - mi2mu update for mudela 0.0.61 + - conflily fixes -pl 75.jcn1 - - all of the above +******* +july 21 pl 75 - inbook.ly & book.tex example. - natural width: linewidth = -1.0\cm -pl 74pre.jcn2 - - mi2mu fixes after scott snyder [sss] - - mi2mu update for mudela 0.0.61 - - conflily fixes - pl 74pre.jcn1 - oversimplified midi output thru performer hierarchy - bf: Spanner::doprint @@ -649,6 +662,7 @@ Bugfix ******* pl 41 - release + pl 40.3 - all of the above - hw's configure.in diff --git a/README b/README index 34e2bac6d2..20c2ad72aa 100644 --- a/README +++ b/README @@ -1,4 +1,11 @@ -IMPORTANT: +This is the toplevel README to LilyPond + + +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 @@ -7,7 +14,19 @@ if you have downloaded a version, then this is version is *not* meant for producing nice output (but to keep your patchsets up to date). It might not even compile. -==================== +2. REQUIREMENTS + +For the compilation and running of LilyPond you need some additional +packages. The most unusual one of this are the mf sources to +MusixTeX. Please refer to the installation instructions on how to +obtain and install them. + +3. INSTALLATINON + +For your convenience, a formatted copy of the INSTALL instructions are +in the toplevel directory, as INSTALL.text + +4. DOCUMENTATION Please refer to the directory Documentation/ for the real doco. @@ -16,14 +35,9 @@ and then do this: make doc -You can also simply read the .pod sources. It is ASCII text. For your -convenience, a copy of the formatted INSTALL instructions are in -the toplevel directory, as INSTALL.text - - -====================== +You can also simply read the .pod sources. They are ASCII text. -NOTE: +5. COMMENTS LilyPond is a long way from finished and polished. I do appreciate criticism, comments, bugreports, patches, etc. Please send e-mail to @@ -40,6 +54,6 @@ to us: hanwen@stack.nl, jan@digicash.com. - + Have fun! diff --git a/TODO b/TODO index cfb9f4229a..5ac024269a 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,7 @@ +0.1: + + * versioning stuff (cvt mudela, mudela, etc.) + Features you cannot find in the doco as working, should be mentioned here. This is an assorted collection of stuff that will be done, might be @@ -6,33 +10,24 @@ 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 - * script for unified musicological source: + * dots into separate item. - blah blah latex - \begin{mudela} c4 d4 e4 f4 - \end{mudela} + * lyrics in chords still fuck up. - * lyrics with chords broken - - * Redo MIDI output to use Translators - - remember more horizontal info than melodics: + * add to MIDI output: - tempo change - repeat - slurs - dynamics etc. - * pushgroup/popgroup - - * strict separation between visual and auditive processing. + * rewire acknowledge_element() logic with a process_acknowledged() - * fix depcy/dept stuff in eg. Beam. + * pushgroup/popgroup * whole head on ledger line * piano staff - * decent spacing - * implement better breaking algorithm * update 20 pt table @@ -41,7 +36,7 @@ grep for TODO and ugh/ugr * enter script priority - * a Hands on tutorial + * a hands on tutorial PROJECTS @@ -258,6 +253,8 @@ SMALLISH PROJECTS * Decent TeX titledefs (\tempo, \metron, etc. ) + * lily \tempo + * C meter iso 4/4, idem for alla breve, etc. * textspanner: center position diff --git a/bin/Makefile b/bin/Makefile index cf07dbbc41..8a6b6654fe 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -8,16 +8,17 @@ include $(depth)/make/Include.make SCRIPTS = clearlily cpgento genheader make_patch \ lily.efence\ - make_version make_website release convert-mudela show-latest \ - conflily + make-version make-website release convert-mudela show-latest \ + mudela-book conflily EXTRA_DISTFILES = $(SCRIPTS) # -EXECUTABLES=convert-mudela +EXECUTABLES=convert-mudela mudela-book localinstall: all $(INSTALL) -d $(bindir) $(INSTALL) -m 755 convert-mudela $(bindir) + $(INSTALL) -m 755 mudela-book $(bindir) localuninstall: - rm -f $(bindir)/convert-mudela + rm -f $(bindir)/convert-mudela $(bindir)/mudela-book diff --git a/bin/make_version b/bin/make-version similarity index 100% rename from bin/make_version rename to bin/make-version diff --git a/bin/make_website b/bin/make-website similarity index 88% rename from bin/make_website rename to bin/make-website index 89fafd7c24..3a38929684 100755 --- a/bin/make_website +++ b/bin/make-website @@ -6,6 +6,7 @@ use Getopt::Long; my $lily_version; my $footstr; my $mw_id = ""; +my $id_str = "make-website 0.2"; sub get_version { @@ -38,7 +39,7 @@ sub set_html_footer $footstr = "\n
Please take me
back to the index\n
-This page was generated by make_website from lilypond-$lily_version by +This page was generated by " . $id_str . " from lilypond-$lily_version by


$username <$MAILADRESS>

" . `date` . " @@ -72,7 +73,7 @@ sub my_system local $base="lilypond/"; local @examples=("multi", "wohltemperirt" ,"standchen", "toccata-fuga-E", - "scsii-menuetto", "collisions", "cadenza", "scales", "book"); + "scsii-menuetto", "collisions", "cadenza", "scales"); # rhythm, scales, @@ -108,7 +109,7 @@ sub gen_examples foreach $a (@examples) { $texfile="lelie"; $tex = "tex $texfile"; - if ($a eq "standchen" || $a eq "scsii-menuetto" || $a eq "book" ) { + if ($a eq "standchen" || $a eq "scsii-menuetto" ) { $tex = "latex $a"; $texfile = "$a"; } @@ -136,6 +137,22 @@ sub gen_examples } } +my @texstuff = ("mudela-man", "mudela-course"); + +sub gen_manuals +{ + print "generating TeX doco list\n"; + open HTMLLIST, ">tex_manuals.html"; + print HTMLLIST "LilyPond manuals in TeX\n" . + "

    \n"; + foreach $a (@texstuff) { + my_system( "make -C $depth/Documentation out/$a.dvi"); + my_system( "dvips $a", "gzip -9f $a.ps"); + print HTMLLIST "
  • $a.ps.gz"; + } + print HTMLLIST "
"; + close HTMLLIST; +} sub gen_list { @@ -252,9 +269,10 @@ sub do_tar "-tar vhcf website.tar $files;", "gzip -f9 website.tar;"; } + sub identify { - print STDERR "make_website 0.1\n"; + print STDERR "This is " . $id_str . "\n"; } sub main @@ -287,6 +305,7 @@ sub main gen_examples; gen_list; } + gen_manuals; set_images; edit_html; diff --git a/bin/mudela-book b/bin/mudela-book new file mode 100755 index 0000000000..c56b1050a7 --- /dev/null +++ b/bin/mudela-book @@ -0,0 +1,120 @@ +#!/usr/bin/perl -w +my $mudcount = 0; +my $mudela_b = 0; +my $outdir = ""; +my $outname = ""; +use Getopt::Long; + +sub gen_mufile +{ + return "$outdir/$outname$mudcount.ly"; +} + +sub gen_texfile +{ + return "$outdir/$outname$mudcount.tex"; +} + +sub close_mudela +{ + $mudela_b = 0; + if ($fragment_b) { + print MUDELA "}\n \\paper { linewidth = -1.0\\cm; } }\n"; + $fragment_b =0; + } + if ( $verbatim_b) { + print BOOK "\\end{verbatim}\n\\interexample"; + $verbatim_b =0; + } + close MUDELA; + my $status =0; + if ( -f gen_mufile ) { + $status = system "diff -q $outdir/book-mudela.ly " . gen_mufile; + } else { + $status = 1; + } + if ( $status ) { + rename "$outdir/book-mudela.ly", gen_mufile; + unlink gen_texfile; + } + + if ( ! -f gen_texfile) { + system "lilypond ". gen_mufile; + rename "lelie.tex", gen_texfile; + } + print BOOK "\\preexample\\input " . gen_texfile . "\n\\postexample\n"; + +} + +sub open_mudela +{ + $mudcount++; + $mudela_b = 1 ; + open MUDELA, ">$outdir/book-mudela.ly"; + if ($verbatim_b) { + print BOOK "\\begin{verbatim}\n"; + } + if ($fragment_b) { + print MUDELA "\\score { \\melodic {"; + } + +} + +sub begin_b +{ + my ($s) = @_; + return (/^\\begin{$s}/) ; +} + +sub end_b +{ + my ($s) = @_; + return (/^\\end{$s}/) ; +} +sub parse_mudela_opts +{ + my ($s) = @_; + $s =~ s/[\[\]]//g; + + $verbatim_b =1 if ($s =~ /verbatim/ ); + $fragment_b = 1 if ($s =~ /fragment/ ); +} + +sub main +{ + GetOptions( 'outdir=s', 'outname=s'); + $outdir = $opt_outdir; + $outname = $opt_outname if (defined ($opt_outname) && $opt_outname); + open INFILE, $ARGV[0]; + + open BOOK, ">$outdir/$outname"; + while () { + if ($mudela_b) { + if (end_b "mudela") { + close_mudela; + next; + } + print MUDELA; + if ( $verbatim_b ) { + my $s = $_; + $s =~ s/\t/ /g; #shit + print BOOK $s; + } + + } else { + if (/^\\begin(\[.*\])?{mudela}/ ) { + my $opts =""; + $opts = $1 if ( defined ($1)); + + parse_mudela_opts($opts); + open_mudela; + next; + } + print BOOK; + } + } + close INFILE; + close BOOK; +} + +main; diff --git a/configure b/configure index e409e1430d..25709197dc 100755 --- a/configure +++ b/configure @@ -589,9 +589,9 @@ if test "${enable_profiling+set}" = set; then fi -# Check whether --enable-mingw32 or --disable-mingw32 was given. -if test "${enable_mingw32+set}" = set; then - enableval="$enable_mingw32" +# Check whether --enable-mingw-prefix or --disable-mingw-prefix was given. +if test "${enable_mingw_prefix+set}" = set; then + enableval="$enable_mingw_prefix" MINGWPREFIX=$enableval else MINGWPREFIX=no @@ -1698,38 +1698,28 @@ cat << EOF > lib/out/config.hh EOF -CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh +CXX="$ac_cv_prog_CXX" bin/make-version >> lib/out/config.hh touch make/out/Site.make # ugr -(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh +(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh ) # rgu sed 's/TOPLEVEL_//g' < .version > lily/.version -(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh +(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh ) -$MAKE -f make/Toplevel.make.in Makefile +echo '# WARNING : Automatically generated from make/Toplevel.make.in' | cat - make/Toplevel.make.in > Makefile cat << END -Finished configuring. For making everything, do: +For making everything, do: - make all - -If you only want help on the make targets, do a - - make help - -assuming that \`make' is GNU make, of course. + make # GNU make If you want to make site-wide extensions to the makefiles, please use make/out/Site.make - -If you can't find a toplevel makefile, please execute - - make -f make/Toplevel.make.in Makefile # GNU make, of course END diff --git a/configure.in b/configure.in index 327a133d82..b6a8246365 100644 --- a/configure.in +++ b/configure.in @@ -260,39 +260,29 @@ cat << EOF > lib/out/config.hh EOF -CXX="$ac_cv_prog_CXX" bin/make_version >> lib/out/config.hh +CXX="$ac_cv_prog_CXX" bin/make-version >> lib/out/config.hh touch make/out/Site.make # ugr -(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh +(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh dnl echo 0 > out/.build ) # rgu sed 's/TOPLEVEL_//g' < .version > lily/.version -(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh +(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh ) -$MAKE -f make/Toplevel.make.in Makefile +echo '# WARNING : Automatically generated from make/Toplevel.make.in' | cat - make/Toplevel.make.in > Makefile cat << END -Finished configuring. For making everything, do: +For making everything, do: - make all - -If you only want help on the make targets, do a - - make help - -assuming that \`make' is GNU make, of course. + make # GNU make If you want to make site-wide extensions to the makefiles, please use make/out/Site.make - -If you can't find a toplevel makefile, please execute - - make -f make/Toplevel.make.in Makefile # GNU make, of course END diff --git a/flower/.version b/flower/.version index 4575a2e82a..a6d093ed41 100644 --- a/flower/.version +++ b/flower/.version @@ -1,6 +1,6 @@ MAJOR_VERSION = 1 MINOR_VERSION = 1 -PATCH_LEVEL = 21 +PATCH_LEVEL = 22 # use to send patches, always empty for released version: MY_PATCH_LEVEL = # include separator: "-1" or ".a" # diff --git a/flower/NEWS b/flower/NEWS index 40740f0bb1..e7aaaa390e 100644 --- a/flower/NEWS +++ b/flower/NEWS @@ -1,5 +1,8 @@ version 1.1: +pl 22: + - ACursor and PACursor to give array a List like interface. + pl 21: pl 20.mb - bf: Warning about NPRINT only if debugging requested. diff --git a/flower/configure b/flower/configure index 2a28860b95..5ede2662f7 100755 --- a/flower/configure +++ b/flower/configure @@ -898,7 +898,7 @@ done -CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh +CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh trap '' 1 2 15 cat > confcache <<\EOF diff --git a/flower/configure.in b/flower/configure.in index e58f93f485..cac84bdbb7 100644 --- a/flower/configure.in +++ b/flower/configure.in @@ -35,7 +35,7 @@ AC_FUNC_VPRINTF AC_CHECK_FUNCS(memmem snprintf ) AC_CONFIG_HEADER(out/config.hh:config.hh.in) -CXX="$ac_cv_prog_CXX" ../bin/make_version > out/version.hh +CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh AC_OUTPUT(out/Flower-flags.make:Flower-flags.make.in) diff --git a/flower/include/acursor.hh b/flower/include/acursor.hh new file mode 100644 index 0000000000..3664b8245f --- /dev/null +++ b/flower/include/acursor.hh @@ -0,0 +1,58 @@ +/* + acursor.hh -- declare ACursor, PACursor + + source file of the Flower Library + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef ACURSOR_HH +#define ACURSOR_HH + +template +class ACursor +{ +protected: + int idx_; + Array &arr_; +public: + ACursor(ACursor const& s) + :arr_(s.arr_) + { + idx_ = s.idx_; + } + ACursor(Array const &arr) + arr_((Array&)arr) + { + idx_ =0; + } + T thing() const { + return arr_[idx_]; + } + T& thing() { return arr_[idx_]; } + T& operator++(int) { + T&t = thing(); + idx_ ++; + return t; + } + bool ok() { return idx_ >=0 && idx_ < arr_.size(); } +}; + + +template +class PACursor : public ACursor +{ +public: + PACursor(Link_array l) + : ACursor(l) + { + } + T* ptr() { return arr_[idx_]; } + T *operator->() { + return ptr(); + } + +}; + +#endif // ACURSOR_HH diff --git a/flower/test/Makefile b/flower/test/Makefile index 0cc3bb960c..ec93a1e545 100644 --- a/flower/test/Makefile +++ b/flower/test/Makefile @@ -63,6 +63,8 @@ include ./$(depth)/make/Rules.make # auto dependencies: # --include $(DEPFILES) +ifdef DEPFILES +include $(DEPFILES) +endif # diff --git a/init/engraver.ini b/init/engraver.ini index f78fa772b4..4d73ecf419 100644 --- a/init/engraver.ini +++ b/init/engraver.ini @@ -2,7 +2,68 @@ % setup for Request->Element conversion. Guru-only % -\requesttranslator { +staff_engraver = \requesttranslator { + Engraver "Engraver_group_engraver" + \alias "Staff"; + \consists "Line_group_engraver"; + \consists "Bar_engraver"; + \consists "Clef_engraver"; + \consists "Key_engraver"; + \consists "Meter_engraver"; + \consists "Local_key_engraver"; + \consists "Staff_sym_engraver"; + \consists "Collision_engraver"; + \consists "Rest_collision_engraver"; + \contains \requesttranslator { + Engraver "Voice_group_engravers" + \alias "Voice_group"; + \consists "Dynamic_engraver"; + \consists "Stem_beam_engraver"; + \consists "Script_engraver"; + \consists "Note_column_engraver"; + \consists "Slur_engraver"; + \contains \requesttranslator { + Engraver "Engraver_group_engraver" + \alias "Voice"; + \consists "Note_head_engraver" ; + \consists "Tie_engraver"; + } + } + } + +piano_staff_engraver = \requesttranslator { + Engraver "Engraver_group_engraver" + \alias "Piano"; + \alias "Hoenoemjedat"; + \consists "Span_bar_engraver"; + \consists "Vertical_align_engraver"; + \consists "Line_group_engraver"; + \consists "Piano_bar_engraver"; + \contains\requesttranslator { \staff_engraver } +} + +staff_group_engraver = \requesttranslator { + Engraver "Engraver_group_engraver" + \alias "Staff_group"; + \consists "Span_bar_engraver"; + \consists "Vertical_align_engraver"; + \consists "Line_group_engraver"; + \contains\requesttranslator { \staff_engraver } +} +lyric_engraver = \requesttranslator { + Engraver "Engraver_group_engraver" + \alias "Lyric"; + + \contains\requesttranslator{ + Engraver "Engraver_group_engraver" + \consists "Lyric_engraver"; + \consists "Line_group_engraver"; + \consists "Swallow_engraver"; + } + \consists "Vertical_align_engraver"; +} + +orchestral_score_translator = \requesttranslator { Engraver Score_engraver \alias "Score"; @@ -11,52 +72,14 @@ \consists "Key_align_engraver"; \consists "Meter_align_engraver"; \consists "Score_horizontal_align_engraver"; - \consists "Vertical_align_engraver"; - \consists "Span_bar_engraver"; - \consists "Span_brace_engraver"; - - \contains\requesttranslator { - Engraver "Staff_engravers" - \alias "Staff"; - \consists "Bar_engraver"; - \consists "Clef_engraver"; - \consists "Key_engraver"; - \consists "Meter_engraver"; - \consists "Local_key_engraver"; - \consists "Staff_sym_engraver"; - \consists "Collision_engraver"; - \consists "Rest_collision_engraver"; - \contains \requesttranslator { - Engraver "Voice_group_engravers" - \alias "Voice_group"; - \consists "Dynamic_engraver"; - \consists "Stem_beam_engraver"; - \consists "Script_engraver"; - \consists "Note_column_engraver"; - \consists "Slur_engraver"; - \contains \requesttranslator { - Engraver "Engraver_group_engraver" - \alias "Voice"; - \consists "Note_head_engraver" ; - \consists "Tie_engraver"; - } - } - } + \consists "Span_score_bar_engraver"; - \contains\requesttranslator { - Engraver "Staff_engravers" - \alias "Lyric"; - \contains\requesttranslator{ - Engraver "Voice_group_engravers" - \alias "Voice_group"; - \contains\requesttranslator{ - Engraver "Engraver_group_engraver" - \consists "Lyric_engraver"; - \consists "Swallow_engraver"; - } - } - } + \contains \requesttranslator { \staff_group_engraver } + \contains \requesttranslator { \lyric_engraver } + \contains \requesttranslator { \piano_staff_engraver } + + } diff --git a/init/paper16.ini b/init/paper16.ini index 369d7f435b..c99b858d2c 100644 --- a/init/paper16.ini +++ b/init/paper16.ini @@ -1,5 +1,6 @@ \include "table16.ini" +\include "engraver.ini" default_paper = \paper { linewidth = 15.0 \cm; @@ -14,5 +15,5 @@ default_paper = \paper { interbeam = 2.667\pt; geometric = 1.414; \symboltables { \table_sixteen } - \include "engraver.ini" + \requesttranslator { \orchestral_score_translator } } diff --git a/init/performer.ini b/init/performer.ini index 174da6fb0b..fa184d11e7 100644 --- a/init/performer.ini +++ b/init/performer.ini @@ -2,8 +2,6 @@ % setup for Request->Element conversion. Guru-only % -% nice to have, but let's first get some output - \requesttranslator { Performer "Score_performer" \alias "Score"; @@ -21,11 +19,12 @@ \contains\requesttranslator{ Performer "Performer_group_performer" \consists "Lyric_performer"; - \consists "Key_performer"; \consists "Note_performer"; - \consists "Meter_performer"; - \consists "Silent_performer"; + } } + \consists "Key_performer"; + \consists "Meter_performer"; + \consists "Swallow_performer"; } } diff --git a/init/symbol.ini b/init/symbol.ini index 77f7fdd5f6..d3f1d1bc29 100644 --- a/init/symbol.ini +++ b/init/symbol.ini @@ -1,4 +1,4 @@ -\version "0.0.61"; +\version "0.1.0"; \include "dynamic.ini" \include "dutch.ini" diff --git a/init/table16.ini b/init/table16.ini index d18731c845..c64b5fc399 100644 --- a/init/table16.ini +++ b/init/table16.ini @@ -97,11 +97,12 @@ table_sixteen= "bars" = \table { "empty" "\emptybar" - "|" "\maatstreep{%}" 0.0\pt 0.64\pt .0\pt 16.0\pt - "||" "\doublebar{%}" 0.0\pt 4.0\pt .0\pt 16.0\pt - "|." "\finishbar{%}" -4.0\pt 0.0\pt .0\pt 16.0\pt - ":|" "\repeatbar" -4.0\pt 0.0\pt .0\pt 16.0\pt - "|:" "\startrepeat" 0.0\pt 4.0\pt 0.0\pt 16.0\pt + "" "" 0.0\pt 0.0\pt 0.0\pt 16.0\pt + "|" "\maatstreep{%}" 0.0\pt 0.64\pt 0.0\pt 16.0\pt + "||" "\doublebar{%}" 0.0\pt 4.0\pt 0.0\pt 16.0\pt + "|." "\finishbar{%}" -4.0\pt 0.0\pt 0.0\pt 16.0\pt + ":|" "\repeatbar" -8.0\pt 0.0\pt 0.0\pt 16.0\pt + "|:" "\startrepeat" 0.0\pt 8.0\pt 0.0\pt 16.0\pt ":|:" "\repeatbarstartrepeat" 0.0\pt 16.0\pt 0.0\pt 16.0\pt } @@ -129,7 +130,7 @@ table_sixteen= % dims ignored for this table "param" = \table { - "brace" "\brace{%}" 0.0\pt 0.0\pt -3.0\pt 3.0\pt + "brace" "\pianobrace{%}" 0.0\pt 0.0\pt 0.0\pt 0.0\pt "meter" "\generalmeter{%}{%}" 0.0\pt 10.0\pt -5.0\pt 5.0\pt "linestaf" "\linestafsym{%}{%}" "stem" "\stem{%}{%}" diff --git a/input/book.ly b/input/book.ly deleted file mode 100644 index 534fe34f59..0000000000 --- a/input/book.ly +++ /dev/null @@ -1,49 +0,0 @@ -%{ -MudelaHeader - - filename: book.ly - title: - description: demonstrate inclusion of Lily output into (La)TeX -documents - composers: - entered-by: - copyright: - - Tested Features: natural width -EndMudelaHeader -%} -\version "0.0.61"; - - - -\score {\melodic { \clef "bass"; - [c8 g e' d'] [e' g e' g] - [c a f' e'] [f' a f' a] - } - - \paper { - \output "bach1.out"; - linewidth =-1.0\cm; - } -} - -\score {\melodic { \clef "bass"; - [c8() g e'() d'] [e'( g e') g] - [c() a f' ()e'] [f'( a f') a] - } - \paper { - \output "bach2.out"; - linewidth= -1.0\cm; - } -} - -\score {\melodic { \clef "bass"; - [c8 g( e' d'] [)e' g( e' )g] - [c a( f' e'] [)f' a( f' )a] - } - \paper { - \output "bach3.out"; - linewidth = -1.0\cm; - unitspace = 2.0\cm; - } -} diff --git a/input/book.tex b/input/book.tex deleted file mode 100644 index 9a1e16453d..0000000000 --- a/input/book.tex +++ /dev/null @@ -1,67 +0,0 @@ -% should be scriptified, probably -\documentclass{article} -\input lilyponddefs -\title{Bach's Cello suites} - -\author{A.U.Thor} -\begin{document} -\maketitle - -\section{Banjo} - -It is normal to have some text around various figures. Such as this -text which is merely to add some weight to the page. In het midden van -mei/Als de nachtegaals zingen/En de avondglans huwt/aan de morgense schijn. -Als de schuchtere geur/ van de bloeiende seringen/zich mengt met de -geur/van de late jasmijn. Op een tochtje langs de rijn. - -\def\EndLilyPondOutput{} -\begin{figure}[h] - \begin{center} - \leavevmode - \input bach1.out - \caption{original} - \end{center} -\end{figure} - -Voglio centocinquante gramme di gorgonzola, tre di questi pannini e due bionde -ragazze con ciocolatta e panna, per favore. Presto! Non posso parlare -o scrivere la lingua italiana, ma provo. - -\section{Hammond-organ and electric guitar} - -It is normal to have some text around various figures. Such as this -text which is merely to add some weight to the page. In het midden van -mei/Als de nachtegaals zingen/En de avondglans huwt/aan de morgense schijn. -Als de schuchtere geur/ van de bloeiende seringen/zich mengt met de -geur/van de late jasmijn. Op een tochtje langs de rijn. - -\begin{figure}[h] - \begin{center} - \leavevmode -\input bach2.out - - \caption{interpretation 1} - \end{center} -\end{figure} - -It is normal to have some text around various figures. Such as this -text which is merely to add some weight to the page. In het midden van -mei/Als de nachtegaals zingen/En de avondglans huwt/aan de morgense schijn. -Als de schuchtere geur/ van de bloeiende seringen/zich mengt met de -geur/van de late jasmijn. Op een tochtje langs de rijn. - -\begin{figure}[h] - \begin{center} - \leavevmode -\input bach3.out - - \caption{interpretation 2} - \end{center} -\end{figure} - -Voglio centocinquante gramme di gorgonzola, tre di questi pannini e due bionde -ragazze con ciocolatta e panna, per favore. Presto! Non posso parlare -o scrivere la lingua italiana, ma provo. - -\end{document} diff --git a/input/cadenza.ly b/input/cadenza.ly index eda6e6bfd7..a2110f3462 100644 --- a/input/cadenza.ly +++ b/input/cadenza.ly @@ -10,7 +10,7 @@ EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; cad = \melodic { diff --git a/input/collisions.ly b/input/collisions.ly index fa1c3f71c0..9bde8122fb 100644 --- a/input/collisions.ly +++ b/input/collisions.ly @@ -10,7 +10,7 @@ Tested Features:test the Collision resolution EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; diff --git a/input/header.ly b/input/header.ly index f7ab263e0a..3baaadf9e1 100644 --- a/input/header.ly +++ b/input/header.ly @@ -10,4 +10,4 @@ Tested Features: EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; diff --git a/input/keys.ly b/input/keys.ly index 4a30ea61f9..45237a2d7e 100644 --- a/input/keys.ly +++ b/input/keys.ly @@ -10,7 +10,7 @@ Tested Features: local key, key, forced accidentals EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; blah = \melodic{ diff --git a/input/kortjakje.ly b/input/kortjakje.ly index 617dac78e9..ab408c9f2f 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -10,7 +10,7 @@ Tested Features: example file with comments EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; % the % is a comment. @@ -58,10 +58,9 @@ begeleiding = \melodic{ } \score{ - \melodic < \multi 3; - - \melodie - \begeleiding + \melodic < \id "Piano" ""; \multi 3; + \melodie + \begeleiding > } diff --git a/input/multi.ly b/input/multi.ly index 02b1dcfaf6..7113cfb4a0 100644 --- a/input/multi.ly +++ b/input/multi.ly @@ -12,7 +12,7 @@ EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; \score{ \melodic @@ -21,6 +21,15 @@ EndMudelaHeader < \multi 2; { \stem -1; c2 c2 } { \stem 1; c'2 c'2 } > < \multi 3; { \clef "bass"; c2 c2 } { \meter 2/4;\bar "||"; \key fis cis gis; c'2 c'2 } > c2 c1 - + c1 c1 + < \multi 1; < \multi 3; + { \meter 2/4; \clef "violin"; c2 c2 } + { \meter 2/4; \clef "bass"; c2 c2 } + > + < \multi 3; + { \meter 2/4; \clef "violin"; c2 c2 } + { \meter 2/4; \clef "bass"; c2 c2 } + > + > } } diff --git a/input/pedal.ly b/input/pedal.ly index f9a5b9eaf9..da3290ec44 100644 --- a/input/pedal.ly +++ b/input/pedal.ly @@ -24,7 +24,7 @@ % \lbheel \lbheel \lfheel \lftoe % \rbheel \rbtoe \rfheel \rftoe -\version "0.0.61"; +\version "0.1.0"; \score{ \melodic { diff --git a/input/rhythm.ly b/input/rhythm.ly index 530fc74a98..a321ca34a7 100644 --- a/input/rhythm.ly +++ b/input/rhythm.ly @@ -11,18 +11,12 @@ unsynced bars EndMudelaHeader %} -\version "0.0.58"; -% -% Ive' got rhythm! -% -% add any impressive examples here, please -\version "0.0.58"; -ritme = \staff { - melodicregs - \melodic{ %\octave ; +\version "0.1.0"; + +ritme = \melodic{ %\octave ; \partial 8; \octave c'; \meter 4/4; @@ -48,29 +42,28 @@ ritme = \staff { } -} -another = \staff { - melodicregs + +another = \melodic{ \meter 4/4; c1. c1. c4 c4 c4 c4 \meter 4/4; c1 c1 c1 } -} -yanother = \staff { - melodicregs + +yanother = \melodic{ \meter 4/4; c1 c1 c1 c4 c4 c4 c4 c1 c1 c1 } -} + \score{ - ritme - another - yanother + < \multi 3; + \ritme + \another + \yanother + > - \midi { } \paper{ - \unitspace 2\cm - \geometric 1.3 + unitspace =2.0\cm; + geometric =1.6; } } diff --git a/input/scales.ly b/input/scales.ly index c594d77876..0e30979237 100644 --- a/input/scales.ly +++ b/input/scales.ly @@ -15,7 +15,7 @@ EndMudelaHeader % scales with accents. % -\version "0.0.61"; +\version "0.1.0"; blah = \melodic { \meter 6/8; \octave 'c ; diff --git a/input/scripts.ly b/input/scripts.ly index 3882327d27..51d8a9093f 100644 --- a/input/scripts.ly +++ b/input/scripts.ly @@ -10,7 +10,7 @@ Tested Features: scripts, text. EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; blah = \melodic { diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 96e400baf4..a8a7b2c236 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -13,7 +13,7 @@ EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; %% Stuff from MPP version % \lefttitle{Menuetto} @@ -102,7 +102,9 @@ IImenuetto = \melodic{ \score{ % huh? how to set id_str - \melodic{ \id "Melodic" "Cello"; \IImenuetto } + \melodic{ + \id "Staff" "Cello"; \IImenuetto + } \paper{ unitspace= 9.0\mm ;% to get lily to use only three lines geometric= 1.40; diff --git a/input/slurs.ly b/input/slurs.ly index 29ad8cf5c0..107809130c 100644 --- a/input/slurs.ly +++ b/input/slurs.ly @@ -11,7 +11,7 @@ EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; \score{ \melodic{\octave c'; diff --git a/input/standchen.ly b/input/standchen.ly index d1c5ec81d9..4f36f53182 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -13,7 +13,7 @@ EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; commands = \melodic{ \skip 2.*4; @@ -465,12 +465,14 @@ tekstII = \lyric{ } \score{ - < \multi 3; + < { \id "Lyric" "1"; \tekstI } % ugh { \id "Lyric" "2"; \tekstII } - - \melodic < \melodie \commands > - \melodic < \begeleiding \commands > + < \id "Piano" ""; + \multi 2; + \melodic < \melodie \commands > + \melodic < \begeleiding \commands > + > > \paper{ linewidth= 195.\mm; diff --git a/input/toccata-fuga-E.ly b/input/toccata-fuga-E.ly index b912fb5f0b..6e5746e725 100644 --- a/input/toccata-fuga-E.ly +++ b/input/toccata-fuga-E.ly @@ -20,7 +20,7 @@ EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; toccata_commands = \melodic{ \meter 4/4; @@ -131,16 +131,22 @@ fuga2_pedal = \melodic{ dis4-\rtoe e4-\rheel 'e4-\ltoe | } -break = \melodic{ \meter 4/4; r1 } +break = \melodic{ + %\meter 4/4; + r1 +} % these should be two separate scores... \score{ - \melodic < \multi 3; + \melodic < \multi 1; - {\$toccata_right \break \$fuga2_right } - {\$toccata_left \break \$fuga2_left } + < \id Piano ""; \multi 3; + {\$toccata_right \break \$fuga2_right } + { \$toccata_left \break \$fuga2_left } + > - {\$toccata_pedal \break \$fuga2_pedal } + { \$toccata_pedal \break \$fuga2_pedal } + > \paper{} diff --git a/input/twinkle.ly b/input/twinkle.ly index 80b6ac10ae..aae1ded22a 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -14,7 +14,7 @@ Tested Features: lyrics EndMudelaHeader %} -\version "0.0.61"; +\version "0.1.0"; melody = \melodic{ \clef violin; @@ -115,13 +115,19 @@ textiii = \lyric{ \score{ < \multi 3; - \melodic <\global \melody > + \melodic < + \id "Piano" "";\multi 3; + < \global + \melody > + < \global + \accompany > + > % ugh \lyric < \id "Lyric" "1"; \global \tekst \hegedraagjetekst > % \lyric < \id "Lyric" "2"; \global \texte > % \lyric < \id "Lyric" "3"; \global \texti \textii \textiii > - \melodic < \global \accompany > + > \paper{ unitspace= 2.5\cm; diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index 89970f8776..08101712ad 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -9,7 +9,7 @@ %} -\version "0.0.61"; +\version "0.1.0"; % should add \need{dutch.ini} for % correct parsing of note names @@ -160,7 +160,8 @@ bassdux = \score { - \melodic < \multi 1; + \melodic < \id "Piano" ""; + \multi 1; < \multi 2; \global \dux @@ -172,7 +173,10 @@ bassdux = > > - \paper{} + \paper{ +% unitspace = 40.0\pt; geometric = 1.6; + geometric= 1.4; unitspace= 34.\pt; + } \midi { \tempo 4:84; } diff --git a/lily/.version b/lily/.version index c535523065..4f4f02184e 100644 --- a/lily/.version +++ b/lily/.version @@ -1,7 +1,7 @@ MAJOR_VERSION = 0 MINOR_VERSION = 0 -PATCH_LEVEL = 75 +PATCH_LEVEL = 76 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf -MY_PATCH_LEVEL = .jcn5 +MY_PATCH_LEVEL = diff --git a/lily/bar-grav.cc b/lily/bar-grav.cc index 61cf611474..8bcfd80ce7 100644 --- a/lily/bar-grav.cc +++ b/lily/bar-grav.cc @@ -10,6 +10,7 @@ #include "bar.hh" #include "command-request.hh" #include "time-description.hh" +#include "engraver-group.hh" Bar_engraver::Bar_engraver() { @@ -43,6 +44,9 @@ Bar_engraver::do_process_requests() if (bar_p_){ announce_element(Score_elem_info(bar_p_, bar_req_l_) ); + } else { + Disallow_break_req r; + daddy_grav_l_->try_request(&r); } } diff --git a/lily/bar.cc b/lily/bar.cc index 6d50fa0fc9..b4364e6cd5 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -57,7 +57,8 @@ Bar::do_pre_processing() if (bar_breaks[i][1] == type_str_) type_str_ = bar_breaks[i][break_status_i()+1]; } - - transparent_b_ = empty_b_ = (type_str_ == ""); + + // span_score_bar needs dims. +// transparent_b_ = empty_b_ = (type_str_ == ""); } diff --git a/lily/beam.cc b/lily/beam.cc index 872cfae025..d09eb627f1 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -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); + mol_p->translate_x(x0 - left_col_l_->hpos_f_); return mol_p; } @@ -381,11 +381,9 @@ Beam::do_print()const Spanner::do_print(); #endif } -/* - duh. The stem is not a dependency but a dependent - */ + void -Beam::do_substitute_dependency(Score_elem*o,Score_elem*n) +Beam::do_substitute_dependent(Score_elem*o,Score_elem*n) { if (o->is_type_b( Stem::static_name() )) { stems.substitute( (Stem*)o->item(), n?(Stem*) n->item():0); diff --git a/lily/break.cc b/lily/break.cc index 826346f4b3..fbda8d4279 100644 --- a/lily/break.cc +++ b/lily/break.cc @@ -9,7 +9,7 @@ #include "break.hh" #include "paper-def.hh" -#include "linespace.hh" +#include "line-spacer.hh" #include "debug.hh" #include "scoreline.hh" #include "p-score.hh" @@ -20,7 +20,7 @@ Line_of_cols Break_algorithm::find_breaks() const { Line_of_cols retval; - for (iter_top(pscore_.cols,c); c.ok(); c++) { + for (iter_top(pscore_l_->col_p_list_,c); c.ok(); c++) { if (c->breakable_b()) retval.push(c); } @@ -30,59 +30,59 @@ Break_algorithm::find_breaks() const return retval; } - -void -Break_algorithm::generate_spacing_problem(Line_of_cols curline, Spacing_problem & sp)const + +Line_spacer* +Break_algorithm::generate_spacing_problem(Line_of_cols curline)const { - sp.add_column(curline[0], true, 0.0); + Line_spacer * sp= (*get_line_spacer)(); + sp->paper_l_ = pscore_l_->paper_l_; + sp->add_column(curline[0], true, 0.0); for (int i=1; i< curline.size()-1; i++) - sp.add_column(curline[i]); + sp->add_column(curline[i]); if ( linelength > 0) - sp.add_column(curline.top(), true, linelength); + sp->add_column(curline.top(), true, linelength); else - sp.add_column(curline.top()); + sp->add_column(curline.top()); + return sp; } Col_hpositions Break_algorithm::stupid_solution(Line_of_cols curline)const { - Spacing_problem sp; - generate_spacing_problem(curline, sp); - Col_hpositions colhpos; - colhpos.cols = curline; - colhpos.energy = INFTY; - colhpos.ugh_b_ = true; - colhpos.config = sp.try_initial_solution(); - return colhpos; + Line_spacer *sp =generate_spacing_problem(curline); + Col_hpositions colhpos; + colhpos.cols = curline; + colhpos.energy = INFTY; + colhpos.ugh_b_ = true; + colhpos.config = sp->default_solution(); + delete sp; + return colhpos; } /// construct an appropriate Spacing_problem and solve it. Col_hpositions Break_algorithm::solve_line(Line_of_cols curline) const { - Spacing_problem sp; - generate_spacing_problem(curline, sp); - - // misschien moeven uit Spacing_problem? - for (iter_top(pscore_.suz,i); i.ok(); i++) { - sp.add_ideal(i); - } - sp.prepare(); + Line_spacer *sp = generate_spacing_problem(curline); + sp->prepare(); - Array the_sol=sp.solve(); - Col_hpositions col_hpos; - col_hpos.cols = curline; - col_hpos.energy = the_sol.pop(); - col_hpos.config = the_sol; - col_hpos.error_col_l_arr_ = sp.error_pcol_l_arr(); - col_hpos.OK(); - return col_hpos; + Array the_sol=sp->solve(); + Col_hpositions col_hpos; + col_hpos.cols = curline; + col_hpos.energy = the_sol.pop(); + col_hpos.config = the_sol; + col_hpos.error_col_l_arr_ = sp->error_pcol_l_arr(); + col_hpos.OK(); + delete sp; + + return col_hpos; } Break_algorithm::Break_algorithm(PScore&s) - :pscore_(s) { + pscore_l_ = &s; + get_line_spacer =0; linelength = s.paper_l_->linewidth_f(); } @@ -101,11 +101,17 @@ Break_algorithm::feasible(Line_of_cols curline) const void Break_algorithm::problem_OK() const { - if (!pscore_.cols.size()) + if (!pscore_l_->col_p_list_.size()) error("Score does not have any columns"); + OK(); +} + +void +Break_algorithm::OK()const +{ #ifndef NDEBUG - iter_top(pscore_.cols,start); - PCursor end (pscore_.cols.bottom()); + iter_top(pscore_l_->col_p_list_,start); + PCursor end (pscore_l_->col_p_list_.bottom()); assert(start->breakable_b()); assert(end->breakable_b()); @@ -115,7 +121,6 @@ Break_algorithm::problem_OK() const Array Break_algorithm::solve()const { - return do_solve(); } diff --git a/lily/calcideal.cc b/lily/calcideal.cc deleted file mode 100644 index 11c1aa2d2c..0000000000 --- a/lily/calcideal.cc +++ /dev/null @@ -1,73 +0,0 @@ -/* - calcideal.cc -- implement Score::calc_idealspacing() - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - -#include "idealspacing.hh" -#include "score.hh" -#include "p-score.hh" -#include "paper-def.hh" -#include "score-column.hh" -#include "dimen.hh" - - -/** - generate springs between columns. - - TODO: This needs A LOT of rethinking. Spacing should take optical - effects into account, should be local (measure wide), should check - smallest divisions. - - plus, calc_idealspacing() should be called per line. - */ -void -Score::calc_idealspacing() -{ - iter_top(cols_,i); - - for (; i.ok(); i++) { - if (!i->used_b()) - continue; - - PCursor j(i+1); - - if (i->musical_b()) { - assert(j.ok()); - for (int n=0; n < i->durations.size(); n++) { - Moment d = i->durations[n]; - Real dist = paper_p_->duration_to_dist(d); - Real strength = i->durations[0]/i->durations[n]; - assert(strength <= 1.0); - - while (j.ok()) { - if (j->used_b() && j->when() >= d + i->when() ) - break; - j++; - } - Moment delta_desired = j->when() - (d+i->when()); - dist += paper_p_->duration_to_dist(delta_desired); - if (!j->musical_b()) - dist += 1 PT; // ugh - pscore_p_->connect(i->pcol_l_, j->pcol_l_, dist, strength); - } - } else if (j.ok()) { - while (!j->used_b()) - j++; - - /* attach i to the next column in use. This exists, since - the last col is breakable, and therefore in use - */ - - Moment d = j->when() - i->when(); - Real dist = (d) ? paper_p_->duration_to_dist(d) : 2 PT; // todo - - pscore_p_->connect(i->pcol_l_, j->pcol_l_, dist, (d) ? 1.0:1.0); - } - // !j.ok() might hold if we're at the last col. - } -} - - diff --git a/lily/col-info.cc b/lily/col-info.cc new file mode 100644 index 0000000000..e54d421b3a --- /dev/null +++ b/lily/col-info.cc @@ -0,0 +1,41 @@ +/* + col-info.cc -- implement Colinfo + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "p-col.hh" +#include "col-info.hh" +#include "debug.hh" + +void +Colinfo::print() const +{ +#ifndef NPRINT + mtor << "column { "; + if (fixed()) + mtor << "fixed at " << fixed_position()<<", "; + assert(pcol_l_); + mtor << "[" << minleft() << ", " << minright() << "]"; + mtor <<"}\n"; +#endif +} + +Colinfo::Colinfo(PCol *col_l, Real const *fixed_C) +{ + if (fixed_C) + fixpos_p_.set_l(fixed_C); + ugh_b_ = false; + pcol_l_ = col_l; + width = pcol_l_->width(); +} + + +Colinfo::Colinfo() +{ + ugh_b_ = false; + pcol_l_ =0; +} + diff --git a/lily/command-request.cc b/lily/command-request.cc index 1d4b35dadf..a9539e28f7 100644 --- a/lily/command-request.cc +++ b/lily/command-request.cc @@ -69,6 +69,13 @@ IMPLEMENT_IS_TYPE_B1(Command_req,Request); void Command_req::do_print()const{} + +IMPLEMENT_IS_TYPE_B1(Disallow_break_req,Command_req); +IMPLEMENT_STATIC_NAME(Disallow_break_req); +void +Disallow_break_req::do_print()const +{ +} /* *************** */ IMPLEMENT_STATIC_NAME(Barcheck_req); IMPLEMENT_IS_TYPE_B1(Barcheck_req,Timing_req); diff --git a/lily/dynamic-grav.cc b/lily/dynamic-grav.cc index fea92a8b6a..09673c240d 100644 --- a/lily/dynamic-grav.cc +++ b/lily/dynamic-grav.cc @@ -82,7 +82,7 @@ Dynamic_engraver::do_process_requests() if ( new_cresc_p ) { cresc_p_ = new_cresc_p; - cresc_p_->left_col_l_ = get_staff_info().musical_l()->pcol_l_; + cresc_p_->left_col_l_ = get_staff_info().musical_l(); if (dynamic_p_) { cresc_p_->left_dyn_b_ = true; } @@ -102,7 +102,7 @@ Dynamic_engraver::do_pre_move_processing() if (dynamic_p_) to_end_cresc_p_->right_dyn_b_=true; - to_end_cresc_p_->right_col_l_ = get_staff_info().musical_l()->pcol_l_; + to_end_cresc_p_->right_col_l_ = get_staff_info().musical_l(); to_end_cresc_p_->set_staffsym(s_l); typeset_element(to_end_cresc_p_); to_end_cresc_p_ = 0; diff --git a/lily/engraver.cc b/lily/engraver.cc index d524de63d5..54518e6daf 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -15,7 +15,6 @@ void Engraver::post_move_processing() { - if (status < CREATION_INITED) { do_creation_processing(); status = CREATION_INITED; diff --git a/lily/global-translator.cc b/lily/global-translator.cc index 62cbb284e4..d53bc4eb6d 100644 --- a/lily/global-translator.cc +++ b/lily/global-translator.cc @@ -67,3 +67,6 @@ void Global_translator::prepare(Moment) { } + +IMPLEMENT_STATIC_NAME(Global_translator); +IMPLEMENT_IS_TYPE_B1(Global_translator, Translator); diff --git a/lily/head-column.cc b/lily/head-column.cc new file mode 100644 index 0000000000..4a50701e63 --- /dev/null +++ b/lily/head-column.cc @@ -0,0 +1,69 @@ +/* + head-column.cc -- implement Head_column + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "debug.hh" +#include "head-column.hh" +#include "note-head.hh" +#include "stem.hh" + +Head_column::Head_column() +{ + stem_l_ = 0; + dir_i_ =0; +} + +void +Head_column::do_substitute_dependency(Score_elem*o, + Score_elem*n) +{ + Script_column::do_substitute_dependency(o,n); + if (o->name() == Note_head::static_name()) { + head_l_arr_.substitute( (Note_head*)o->item(), + (n)? (Note_head*)n->item() : 0); + } + if (stem_l_ == o) { + stem_l_ = n ? (Stem*)n->item():0; + } +} + + +void +Head_column::set(Stem*stem_l) +{ + stem_l_ = stem_l; + add_dependency(stem_l); +} + +void +Head_column::add(Note_head *n_l) +{ + add_support(n_l); + head_l_arr_.push(n_l); +} + + +IMPLEMENT_STATIC_NAME(Head_column); +IMPLEMENT_IS_TYPE_B1(Head_column,Script_column); + +void +Head_column::do_print() const +{ +#ifndef NPRINT + mtor << "heads: " << head_l_arr_.size(); +#endif +} + +void +Head_column::do_pre_processing() +{ + if (!dir_i_){ + if (stem_l_) + dir_i_ = stem_l_->dir_i_; + } + Script_column::do_pre_processing(); +} diff --git a/lily/idealspacing.cc b/lily/idealspacing.cc index f1ff3691d5..9713f255db 100644 --- a/lily/idealspacing.cc +++ b/lily/idealspacing.cc @@ -1,3 +1,11 @@ +/* + idealspacing.cc -- implement Idealspacing + + source file of the GNU LilyPond music typesetter + + (c) 1996,1997 Han-Wen Nienhuys +*/ + #include "idealspacing.hh" #include "p-col.hh" #include "p-score.hh" @@ -8,23 +16,21 @@ Idealspacing::print() const { #ifndef NPRINT mtor << "idealspacing {" ; - mtor << "distance "<rank_i() << " right " << right->rank_i() << "}\n"; + mtor << "distance "<= 0 && left && right); -#endif + assert(hooke_f_ >= 0); } diff --git a/lily/identifier.cc b/lily/identifier.cc index b3b6179487..4eda207ca7 100644 --- a/lily/identifier.cc +++ b/lily/identifier.cc @@ -63,11 +63,11 @@ class Class DEFAULT_PRINT(Script_id, General_script_def, script); DEFAULT_PRINT(Lookup_id, Lookup, lookup); +DEFAULT_PRINT(Input_translator_id, Input_trans, input_translator); DEFAULT_PRINT(Symtables_id, Symtables, symtables); DEFAULT_PRINT(Music_id,Music , music); DEFAULT_PRINT(Request_id, Request, request); DEFAULT_PRINT(Score_id, Score, score); -DEFAULT_PRINT(Input_trans_id, Input_translator, itrans); DEFAULT_PRINT(Midi_def_id,Midi_def, mididef); DEFAULT_PRINT(Paper_def_id,Paper_def, paperdef); @@ -112,7 +112,7 @@ Idclass::~Idclass() { delete accessor(false); }\ Idclass::Idclass(String s, Class*st, int code):Identifier(s,code) { data = st; }\ - +implement_id_class(Input_translator_id, Input_translator, input_translator); implement_id_class(Int_id, int, intid); implement_id_class(Real_id, Real, real); implement_id_class(Script_id, General_script_def, script); @@ -121,7 +121,6 @@ implement_id_class(Symtables_id, Symtables, symtables); implement_id_class(Music_id, Music, music); implement_id_class(Score_id, Score, score); implement_id_class(Request_id, Request, request); -implement_id_class(Input_trans_id, Input_translator, itrans); implement_id_class(Midi_def_id, Midi_def, mididef); implement_id_class(Paper_def_id, Paper_def, paperdef); @@ -129,7 +128,7 @@ Identifier::Identifier(Identifier const&) { assert(false); } - +default_accessor(Input_translator_id,Input_translator, input_translator); default_accessor(Int_id, int, intid); default_accessor(Real_id, Real, real); virtual_accessor(Script_id, General_script_def, script); @@ -138,6 +137,5 @@ default_accessor(Symtables_id, Symtables, symtables); virtual_accessor(Music_id, Music, music); default_accessor(Score_id, Score, score); virtual_accessor(Request_id, Request, request); -default_accessor(Input_trans_id, Input_translator, itrans); default_accessor(Midi_def_id, Midi_def, mididef); default_accessor(Paper_def_id, Paper_def, paperdef); diff --git a/lily/include/beam.hh b/lily/include/beam.hh index 55fbc8a673..bd0c2550a9 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -37,7 +37,7 @@ protected: virtual void set_default_dir(); virtual void do_pre_processing(); virtual void do_post_processing(); - virtual void do_substitute_dependency(Score_elem*, Score_elem*); + virtual void do_substitute_dependent(Score_elem*, Score_elem*); virtual void do_print() const; diff --git a/lily/include/break.hh b/lily/include/break.hh index 703f9bb816..bb37f4aeab 100644 --- a/lily/include/break.hh +++ b/lily/include/break.hh @@ -21,9 +21,9 @@ */ class Break_algorithm { - void generate_spacing_problem(Line_of_cols,Spacing_problem&)const; + Line_spacer* generate_spacing_problem(Line_of_cols)const; protected: - PScore &pscore_; + PScore *pscore_l_; Real linelength; /// search all pcols which are breakable. @@ -41,18 +41,15 @@ protected: Col_hpositions stupid_solution(Line_of_cols) const; virtual Array do_solve()const=0; public: + Line_spacer* (*get_line_spacer)(); + Break_algorithm(PScore&); /// check if the spacing/breaking problem is well-stated void problem_OK()const; - + void OK()const; Array solve()const; }; -/// wordwrap type algorithm: move to next line if current is optimal. -struct Word_wrap : Break_algorithm { - virtual Array do_solve()const; - Word_wrap(PScore&); -}; #endif // BREAK_HH diff --git a/lily/include/col-info.hh b/lily/include/col-info.hh new file mode 100644 index 0000000000..985df3b69d --- /dev/null +++ b/lily/include/col-info.hh @@ -0,0 +1,36 @@ +/* + col-info.hh -- declare + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef COL_INFO_HH +#define COL_INFO_HH + +#include "lily-proto.hh" +#include "pointer.hh" +#include "interval.hh" + +/// helper struct for #Spacing_problem# +struct Colinfo { + PCol *pcol_l_; + P fixpos_p_; + Interval width; + int rank_i_; + /// did some tricks to make this column come out. + bool ugh_b_; + /* *************** */ + Colinfo(); + Colinfo(PCol *,Real const *); + + void print() const; + bool fixed() const { return fixpos_p_.get_C();} + Real fixed_position()const { return *fixpos_p_; } + Real minright() const { return width.right; } + Real minleft() const { return -width.left; } +}; + +#endif // COL_INFO_HH diff --git a/lily/include/command-request.hh b/lily/include/command-request.hh index 285d0cbb85..11a1e44bdf 100644 --- a/lily/include/command-request.hh +++ b/lily/include/command-request.hh @@ -26,6 +26,7 @@ public: virtual Meter_change_req * meterchange() { return 0; } virtual Bar_req *bar() { return 0; } virtual Cadenza_req *cadenza() { return 0; } + virtual Disallow_break_req *disallowbreak() { return 0; } virtual Timing_req*timing() { return 0; } virtual Command_script_req*commandscript() { return 0;} }; @@ -37,6 +38,11 @@ public: }; +class Disallow_break_req : public Command_req { +public: + REQUESTMETHODS(Disallow_break_req, disallowbreak); +}; + /** Baseclass for meter/partial req. It has to be handled by Staff_{walker,column} baseclass. */ diff --git a/lily/include/engraver-group.hh b/lily/include/engraver-group.hh index 4e468e9efd..7e2b9b21b5 100644 --- a/lily/include/engraver-group.hh +++ b/lily/include/engraver-group.hh @@ -36,6 +36,8 @@ protected: virtual bool removable_b()const; public: + virtual void print() const { Engraver::print(); } + Input_translator * itrans_l_; void check_removal(); Engraver_group_engraver(); diff --git a/lily/include/global-translator.hh b/lily/include/global-translator.hh index 0c14172095..3faa9e4eea 100644 --- a/lily/include/global-translator.hh +++ b/lily/include/global-translator.hh @@ -18,6 +18,7 @@ class Global_translator : public virtual Translator { Moment last_mom_; public: Score *score_l_; + Global_translator(); int moments_left_i()const; void modify_next(Moment&); @@ -29,7 +30,9 @@ public: virtual void finish() {} virtual void start() {} + NAME_MEMBERS(); protected: + virtual Global_translator *global_l() { return this; } virtual int depth_i() const; virtual Translator *ancestor_l(int); diff --git a/lily/include/head-column.hh b/lily/include/head-column.hh new file mode 100644 index 0000000000..ea5e9a7531 --- /dev/null +++ b/lily/include/head-column.hh @@ -0,0 +1,41 @@ +/* + head-column.hh -- declare Head_column + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef HEAD_COLUMN_HH +#define HEAD_COLUMN_HH + +#include "script-column.hh" + +class Head_column : public Script_column +{ +public: + Link_array head_l_arr_; + /** The relative position of the "voice" containing this + chord. Normally this would be the same as the stem direction, + but rests do not have stems. + + Hmm. outdated.. Rests *do* have stems. + */ + + int dir_i_; + Stem* stem_l_; + + void add(Note_head*); + void add(Script*s) { Script_column::add(s) ; } + virtual void set(Stem*); + Head_column(); + NAME_MEMBERS(); +protected: + + + virtual void do_pre_processing(); + virtual void do_print()const; + virtual void do_substitute_dependency(Score_elem*,Score_elem*); +}; +#endif // HEAD_COLUMN_HH diff --git a/lily/include/idealspacing.hh b/lily/include/idealspacing.hh index 72124521c0..83fb5ba89d 100644 --- a/lily/include/idealspacing.hh +++ b/lily/include/idealspacing.hh @@ -12,17 +12,18 @@ struct Idealspacing { /// the ideal distance - Real space; + Real space_f_; /// Hooke's constant: how strong are the "springs" attached to columns - Real hooke; + Real hooke_f_; /// the two columns - PCol const *left, *right; + int left_i_; + int right_i_; void print()const; void OK() const ; - Idealspacing(PCol const *left,PCol const *right); + Idealspacing(); }; diff --git a/lily/include/identifier.hh b/lily/include/identifier.hh index ddcc32ccb4..c2c5eebe7a 100644 --- a/lily/include/identifier.hh +++ b/lily/include/identifier.hh @@ -30,8 +30,8 @@ struct Identifier : public Input { void print()const; NAME_MEMBERS(); void error(String); + IDACCESSOR(Input_translator, input_translator) IDACCESSOR(Music, music) - IDACCESSOR(Input_translator, itrans) IDACCESSOR(General_script_def, script) IDACCESSOR(Symtables, symtables) IDACCESSOR(Midi_def, mididef) @@ -58,7 +58,7 @@ struct Idclass : Identifier {\ }\ - +declare_id_class(Input_translator_id, Input_translator, input_translator); declare_id_class(Real_id, Real, real); declare_id_class(Script_id, General_script_def, script); declare_id_class(Lookup_id, Lookup, lookup); @@ -67,7 +67,6 @@ declare_id_class(Music_id, Music, music); declare_id_class(Int_id, int, intid); declare_id_class(Score_id, Score, score); declare_id_class(Request_id, Request, request); -declare_id_class(Input_trans_id, Input_translator, itrans); declare_id_class(Paper_def_id,Paper_def, paperdef); declare_id_class(Midi_def_id,Midi_def, mididef); #endif // IDENTIFIER_ diff --git a/lily/include/input-translator.hh b/lily/include/input-translator.hh index 2ee65f0d8f..b2883a30cf 100644 --- a/lily/include/input-translator.hh +++ b/lily/include/input-translator.hh @@ -21,6 +21,7 @@ struct Input_translator_list : public Pointer_list { Input_translator_list(Input_translator_list const &); Input_translator_list(){} + ~Input_translator_list(){} }; struct Input_translator : Input { diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index ab3549f1f5..01c5731854 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -44,6 +44,7 @@ struct Cresc_req; struct Crescendo ; struct Decresc_req; struct Directional_spanner; +struct Disallow_break_req; struct Durational_req; struct Dynamic; struct Dynamic_req; @@ -54,6 +55,7 @@ struct General_script_def; struct Global_translator; struct Group_change_req; struct Group_feature_req; +struct Head_column; struct Horizontal_align_item; struct Horizontal_group; struct Horizontal_group_item; @@ -75,6 +77,7 @@ struct Keyword_table; struct Lily_stream; struct Line_of_score; struct Line_of_staff; +struct Line_spacer; struct Linestaff; struct Local_key; struct Local_key_item; @@ -154,10 +157,10 @@ struct Slur; struct Slur_engraver; struct Slur_req; struct Spacing_req ; -struct Spacing_problem; struct Span_dynamic_req; struct Span_req; struct Spanner; +struct Spring_spacer; struct Staff_performer; struct Staff_side; struct Staff_symbol; diff --git a/lily/include/line-spacer.hh b/lily/include/line-spacer.hh new file mode 100644 index 0000000000..c8bf02b48c --- /dev/null +++ b/lily/include/line-spacer.hh @@ -0,0 +1,69 @@ +/* + line-spacer.hh -- declare Line_spacer + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef LINE_SPACER_HH +#define LINE_SPACER_HH +#include "lily-proto.hh" +#include "varray.hh" +#include "vector.hh" +#include "interval.hh" + +/** + abstract interface to Line spacing. + + TODO + add estimate of "force" or energy. + */ + +class Line_spacer +{ + +public: + Paper_def * paper_l_; + Paper_def *paper_l()const; + Line_spacer(); + + virtual Array error_pcol_l_arr() const=0; + + /** solve the spacing problem + + @return the column positions, and the energy (last element) + + */ + virtual Array solve() const=0; + + /** add a col to the problem. columns have to be added left to + right. The column contains info on it's minimum width. */ + virtual void add_column(PCol *, bool fixed=false, Real fixpos=0.0)=0; + + /** + can the posed problem be solved? + + @pre + + prepare() was called + + */ + virtual bool check_constraints(Vector v) const=0; + + /** + generate a solution which can't fail + */ + virtual Vector default_solution() const=0; + + virtual void OK() const{} + virtual void print() const{} + + /** + Call after construction before solving + */ + virtual void prepare(){} +}; + +#endif diff --git a/lily/include/linespace.hh b/lily/include/linespace.hh index 97e4caf70c..587ecf912c 100644 --- a/lily/include/linespace.hh +++ b/lily/include/linespace.hh @@ -6,6 +6,7 @@ (c) 1996,1997 Han-Wen Nienhuys */ +#error #ifndef LINESPACE_HH #define LINESPACE_HH @@ -16,25 +17,6 @@ #include "interval.hh" #include "pointer.hh" -/// helper struct for #Spacing_problem# -struct Colinfo { - PCol *pcol_l_; - P fixpos_p_; - Interval width; - int rank_i_; - /// did some tricks to make this column come out. - bool ugh_b_; - /* *************** */ - Colinfo(); - Colinfo(PCol *,Real const *); - - void print() const; - bool fixed() const { return fixpos_p_.get_C();} - Real fixed_position()const { return *fixpos_p_; } - Real minright() const { return width.right; } - Real minleft() const { return -width.left; } -}; - /** the problem, given by the columns (which include constraints) and intercolumn spacing. The problem is: @@ -59,7 +41,7 @@ struct Colinfo { */ class Spacing_problem { - Array ideals; + PointerList ideal_p_list_; Array cols; Array loose_col_arr_; @@ -86,18 +68,7 @@ class Spacing_problem { void handle_loose_cols(); void position_loose_cols(Vector &) const; -public: - Array error_pcol_l_arr() const; - - /** solve the spacing problem - - @return the column positions, and the energy (last element) - - */ - Array solve() const; - - - /** + /** add a idealspacing to the problem. One pair of columns can have no, one or more idealspacings, @@ -105,23 +76,27 @@ public: not in this problem, the spacing is ignored. */ void add_ideal(Idealspacing const *i); - - - /** add a col to the problem. columns have to be added left to right. The column contains - info on it's minimum width. - */ - void add_column(PCol *, bool fixed=false, Real fixpos=0.0); - + void print_ideal(Idealspacing const *)const; + Vector try_initial_solution() const; + void calcideal(); + Score_column* scol_l(int); + void connect(int i,int j, Real,Real); +public: + static Line_spacer *constructor() { + return new Line_spacer; + } + Array error_pcol_l_arr() const; - bool check_constraints(Vector v) const; + virtual Array solve() const; + virtual void add_column(PCol *, bool fixed=false, Real fixpos=0.0); + - Vector try_initial_solution() const; - void OK() const; - void print() const; - void print_ideal(Idealspacing const *)const; - void prepare(); + virtual Vector default_solution() contains { + return try_initial_solution() ; + } + virtual bool check_constraints(Vector v) const; + virtual void OK() const; + virtual void print() const; + virtual void prepare(); }; - - -#endif diff --git a/lily/include/lyric-engraver.hh b/lily/include/lyric-engraver.hh index 9c50d5c068..9c1aefadac 100644 --- a/lily/include/lyric-engraver.hh +++ b/lily/include/lyric-engraver.hh @@ -15,7 +15,10 @@ #include "lily-proto.hh" class Lyric_engraver : public Engraver { - Array lreq_arr_; + Lyric_req* lreq_l_; + Text_item *lyric_item_p_; +protected: + virtual void do_pre_move_processing(); virtual bool do_try_request(Request*); virtual void do_process_requests(); virtual void do_post_move_processing(); diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 25f3c7fbc3..143587be88 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -45,21 +45,6 @@ public: virtual Translator * get_req_translator_l(); }; -// duh. -class Request_iterator : public Music_iterator { - Request *req_l_; - bool last_b_; -public: - Request_iterator(Request const *); - NAME_MEMBERS(); -protected: - virtual bool ok() const; - virtual Moment next_moment() const; - - virtual void do_print()const; - virtual void process_and_next(Moment); -}; - class Change_iterator : public Music_iterator { Change_reg * change_l_; public: @@ -73,6 +58,7 @@ class Chord_iterator : public Music_iterator const Chord *chord_C_; Pointer_list children_p_list_; public: + ~Chord_iterator(); Chord_iterator(Chord const*); NAME_MEMBERS(); protected: @@ -83,13 +69,20 @@ protected: virtual bool ok()const; }; -class Voice_element_iterator : public Chord_iterator { - -protected: - virtual void construct_children(); +class Voice_element_iterator : public Music_iterator { + const Voice_element * elt_l_; + Moment elt_duration_; + bool last_b_; public: Voice_element_iterator(Voice_element*); NAME_MEMBERS(); + +protected: + virtual void process_and_next(Moment); + virtual Moment next_moment()const; + virtual void construct_children(); + virtual bool ok()const; + virtual void do_print()const; }; diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index 122f1c20a8..08cce94c9a 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -36,7 +36,6 @@ public: virtual Dynamic_req* dynamic() { return 0; } virtual Absolute_dynamic_req * absdynamic() { return 0; } virtual Tie_req * tie() { return 0; } - virtual Subtle_req * subtle() { return 0; } virtual Span_dynamic_req * span_dynamic() { return 0; } REQUESTMETHODS(Musical_req, musical); }; @@ -207,21 +206,7 @@ public: }; -/** A helper in the hierarchy. Each dynamic is bound to one note ( a - crescendo spanning multiple notes is thought to be made of two - "dynamics": a start and a stop). Dynamic changes can occur in a - smaller time than the length of its note, therefore fore each - Dynamic request carries a time, measured from the start of its - note. - */ -class Subtle_req : public virtual Musical_req { -public: - /// the time relative to Voice_element start. - Moment subtime_; - REQUESTMETHODS(Subtle_req, subtle); -}; - -class Dynamic_req : public Subtle_req { +class Dynamic_req : public virtual Musical_req { public: /// for absolute dynamics enum Loudness { diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index 805b969bbc..3065642be6 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -9,36 +9,25 @@ #ifndef NOTE_COLUMN_HH #define NOTE_COLUMN_HH + #include "item.hh" -#include "script-column.hh" +#include "head-column.hh" /** a struct for treating a group of noteheads (noteheads, stem (chord) and scripts ) as a single entity. */ -class Note_column : public Script_column { +class Note_column : public Head_column { protected: virtual void do_pre_processing(); - virtual void do_substitute_dependency(Score_elem*,Score_elem*); -public: - /// link to the stem. For setting default direction - Stem * stem_l_; +public: bool h_shift_b_; - Link_array head_l_arr_; Interval_t head_positions_interval()const; - - /** The relative position of the "voice" containing this - chord. Normally this would be the same as the stem direction, - but rests do not have stems. */ - int dir_i_; - NAME_MEMBERS(); Note_column(); - void add(Note_head *); - void add(Stem *); + virtual void set(Stem *); void sort(); - void add(Script* s) { Script_column::add(s);} }; #endif // NOTE_COLUMN_HH diff --git a/lily/include/p-col.hh b/lily/include/p-col.hh index 87f1584164..2b2266fb7a 100644 --- a/lily/include/p-col.hh +++ b/lily/include/p-col.hh @@ -44,7 +44,7 @@ public: /** if lines are broken then this column x-coord #hpos# if not known, then hpos == -1.(ugh?) */ - Real hpos; // should use ptr? + Real hpos_f_; // should use ptr? bool error_mark_b_; bool used_b_ ; // manual override.. @@ -66,8 +66,8 @@ public: bool breakable_b()const; Interval width() const; - ~PCol(); - PCol(PCol * parent); + virtual ~PCol(); + PCol(); /** which col comes first?. @@ -79,7 +79,8 @@ 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 32231f6371..596e718c41 100644 --- a/lily/include/p-score.hh +++ b/lily/include/p-score.hh @@ -25,13 +25,13 @@ public: Paper_def *paper_l_; /// the columns, ordered left to right - Pointer_list cols; + Pointer_list col_p_list_; /// the idealspacings, no particular order - Pointer_list suz; + Pointer_list suz_p_list_; /// crescs etc; no particular order - Pointer_list spanners; + Pointer_list span_p_list_; /// other elements Pointer_list elem_p_list_; @@ -71,14 +71,6 @@ public: /* UTILITY ROUTINES */ - /// get the spacing between c1 and c2, create one if necessary. - Idealspacing* get_spacing(PCol *c1, PCol *c2); - - /// connect c1 and c2 - void do_connect(PCol *c1, PCol *c2, Real distance_f, Real strength_f); - - /// connect c1 and c2 and any children of c1 and c2 - void connect(PCol* c1, PCol *c2, Real distance_f,Real strength_f= 1.0); /* STANDARD ROUTINES */ void OK()const; @@ -94,6 +86,7 @@ private: /// before calc_breaking void preprocess(); + void calc_idealspacing(); /// calculate where the lines are to be broken, and use results void calc_breaking(); diff --git a/lily/include/rest-column.hh b/lily/include/rest-column.hh index 05327cbc6c..86aa7f96e0 100644 --- a/lily/include/rest-column.hh +++ b/lily/include/rest-column.hh @@ -11,24 +11,16 @@ #define REST_COLUMN_HH #include "script-column.hh" +#include "head-column.hh" /** struct to treat a set of rests as union (one voicegroup should only produce one rest. */ -class Rest_column : public Script_column { - Link_array head_l_arr_; +class Rest_column : public Head_column { public: - int dir_i_; - Stem* stem_l_; - void add(Note_head *); - void add(Stem *); NAME_MEMBERS(); - Rest_column(); void translate_heads(int dy); -protected: - virtual void do_print() const; - virtual void do_substitute_dependency(Score_elem*, Score_elem*); }; #endif // REST_COLUMN_HH diff --git a/lily/include/score-column.hh b/lily/include/score-column.hh index b8daacd176..396fc0312b 100644 --- a/lily/include/score-column.hh +++ b/lily/include/score-column.hh @@ -13,7 +13,7 @@ #include "lily-proto.hh" #include "varray.hh" #include "moment.hh" - +#include "p-col.hh" /** @@ -25,17 +25,13 @@ */ -class Score_column { +class Score_column : public PCol { friend class Score; friend class Score_engraver; bool musical_b_; Moment when_; - void set_breakable(); public: - /// indirection to column - PCol * pcol_l_; - /// length of notes/rests in this column Array durations; @@ -43,21 +39,15 @@ public: Moment when() { return when_; } Score_column(Moment when); - static int compare(Score_column & c1, Score_column &c2); void add_duration(Moment ); void preprocess(); - bool breakable_b(); bool musical_b() { return musical_b_; } - bool used_b(); void print() const; + virtual void do_set_breakable(); }; -#include "compare.hh" - -instantiate_compare(Score_column&, Score_column::compare); - #endif // SCORE_COLUMN_HH diff --git a/lily/include/score-elem.hh b/lily/include/score-elem.hh index 4189057f54..4bf3efd006 100644 --- a/lily/include/score-elem.hh +++ b/lily/include/score-elem.hh @@ -54,7 +54,7 @@ class Score_elem : private Directed_graph_node { DELETED, // to catch malloc mistakes. }; - Status status; + Status status_; public: PScore *pscore_l_; @@ -74,6 +74,7 @@ public: 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. @@ -92,6 +93,7 @@ public: void unlink(); void unlink_all(); + void substitute_dependency(Score_elem*,Score_elem*); void remove_dependency(Score_elem*); /** add a dependency. It may be the 0 pointer, in which case, it is ignored. @@ -104,6 +106,15 @@ public: 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 + bool transparent_b_; protected: virtual Interval do_height()const; @@ -128,16 +139,8 @@ protected: virtual void handle_broken_dependencies(); virtual void handle_prebroken_dependencies(); - 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 - bool transparent_b_; }; diff --git a/lily/include/score-grav.hh b/lily/include/score-grav.hh index 92b659a377..c559d25548 100644 --- a/lily/include/score-grav.hh +++ b/lily/include/score-grav.hh @@ -17,6 +17,8 @@ class Score_engraver : public Engraver_group_engraver, public Global_translator { Line_of_score * scoreline_l_; + bool disallow_break_b_; + int breaks_i_; Array nobreak_item_p_arr_; diff --git a/lily/include/score-halign-grav.hh b/lily/include/score-halign-grav.hh index cba48928b8..6cab304fe3 100644 --- a/lily/include/score-halign-grav.hh +++ b/lily/include/score-halign-grav.hh @@ -11,7 +11,6 @@ #define SCORE_HALIGN_GRAV_HH #include "engraver.hh" class Score_horizontal_align_engraver : public Engraver { - Break_align_item * halign_p_; public: NAME_MEMBERS(); diff --git a/lily/include/score.hh b/lily/include/score.hh index 15486e2aaa..dea8806243 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -26,9 +26,6 @@ public: Paper_def *paper_p_; Midi_def *midi_p_; Music * music_p_; - - - Pointer_list cols_; PScore *pscore_p_; int errorlevel_i_; @@ -51,16 +48,13 @@ public: /// void set(Paper_def* midi_p); - // standard - void OK() const; void print() const; - /// find a column. - PCursor find_col(Moment,bool); - Score(Score const&); - private: + + + void run_translator(Global_translator*); void midi_output(); void paper_output(); diff --git a/lily/include/silent-performer.hh b/lily/include/silent-performer.hh deleted file mode 100644 index b8d5d1a614..0000000000 --- a/lily/include/silent-performer.hh +++ /dev/null @@ -1,26 +0,0 @@ -/* - silent-performer.hh -- declare Silent_performer - - (c) 1996, 1997 Han-Wen Nienhuys - Jan Nieuwenhuizen - */ - -#ifndef SILENT_PERFORMER_HH -#define SILENT_PERFORMER_HH - -#include "performer.hh" - -/** -*/ - -class Silent_performer : public Performer { -public: - NAME_MEMBERS(); - - Silent_performer(); - ~Silent_performer(); - - virtual bool try_request( Request *req_l ) ; -}; - -#endif // SILENT_PERFORMER_HH diff --git a/lily/include/span-bar-grav.hh b/lily/include/span-bar-grav.hh index e93c3af1b7..62bc40a226 100644 --- a/lily/include/span-bar-grav.hh +++ b/lily/include/span-bar-grav.hh @@ -19,10 +19,13 @@ class Span_bar_engraver : public Engraver Vertical_align_element * valign_l_; public: NAME_MEMBERS(); + + Span_bar_engraver(); +protected: + virtual void acknowledge_element(Score_elem_info); virtual void do_pre_move_processing(); - Span_bar_engraver(); - + virtual Span_bar* get_span_bar_p()const; }; #endif // SPAN_BAR_GRAV_HH diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index 177ada65c4..a66477ebe8 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -21,8 +21,15 @@ public: SCORE_ELEM_CLONE(Span_bar); void add(Bar* ); void set( Vertical_align_element *); - void do_pre_processing(); - void do_substitute_dependency(Score_elem*,Score_elem*); - Molecule * brew_molecule_p()const; + +protected: + virtual Interval do_width()const; + virtual void do_pre_processing(); + virtual void translate_y(Real y); + + virtual void do_substitute_dependency(Score_elem*,Score_elem*); + virtual Molecule * brew_molecule_p()const; + virtual Symbol get_bar_sym(Real dy) const; }; + #endif // SPAN_BAR_HH diff --git a/lily/include/span-brace-engraver.hh b/lily/include/span-brace-engraver.hh deleted file mode 100644 index a91556923c..0000000000 --- a/lily/include/span-brace-engraver.hh +++ /dev/null @@ -1,31 +0,0 @@ -/* - span-brace-engraver.hh -- declare Span_brace_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - - -#ifndef SPAN_BRACE_GRAV_HH -#define SPAN_BRACE_GRAV_HH - -#include "engraver.hh" - -class Span_brace_engraver : public Engraver -{ -public: - NAME_MEMBERS(); - Span_brace_engraver(); - ~Span_brace_engraver(); - - virtual void acknowledge_element( Score_elem_info i ); - virtual void do_pre_move_processing(); - -private: - Span_brace_item* span_brace_p_; - Array bar_l_arr_; - Vertical_align_element* valign_l_; -}; - -#endif // SPAN_BRACE_GRAV_HH diff --git a/lily/include/span-brace-item.hh b/lily/include/span-brace-item.hh deleted file mode 100644 index 88c8c2a40c..0000000000 --- a/lily/include/span-brace-item.hh +++ /dev/null @@ -1,32 +0,0 @@ -/* - span-brace-item.hh -- declare Span_brace_item - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys - Jan Nieuwenhuizen -*/ - - -#ifndef SPAN_BRACE_ITEM_HH -#define SPAN_BRACE_ITEM_HH - -#include "bar.hh" - -class Span_brace_item : public Item -{ -public: - NAME_MEMBERS(); - SCORE_ELEM_CLONE(Span_brace_item); - - void add( Bar* bar_l ); - void set( Vertical_align_element* vae_l ); - void do_pre_processing(); - void do_substitute_dependency( Score_elem*, Score_elem* ); - Molecule* brew_molecule_p() const; - -private: - Link_array spanning_l_arr_; -}; - -#endif // SPAN_BRACE_ITEM_HH diff --git a/lily/include/span-score-bar-grav.hh b/lily/include/span-score-bar-grav.hh new file mode 100644 index 0000000000..6e4f0d28b6 --- /dev/null +++ b/lily/include/span-score-bar-grav.hh @@ -0,0 +1,32 @@ +/* + span-score-bar-grav.hh -- declare Span_score_bar_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef SPAN_SCORE_BAR_GRAV_HH +#define SPAN_SCORE_BAR_GRAV_HH + +#include "span-bar-grav.hh" + +class Span_score_bar_engraver : public Span_bar_engraver +{ +public: + NAME_MEMBERS(); + virtual Span_bar* get_span_bar_p()const; +}; + +/** + Please don't shoot the piano player + */ +class Piano_bar_engraver : public Span_score_bar_engraver +{ +public: + NAME_MEMBERS(); + virtual Span_bar * get_span_bar_p() const; +}; + +#endif // SPAN_SCORE_BAR_GRAV_HH diff --git a/lily/include/span-score-bar.hh b/lily/include/span-score-bar.hh new file mode 100644 index 0000000000..c8991d624b --- /dev/null +++ b/lily/include/span-score-bar.hh @@ -0,0 +1,38 @@ +/* + span-score-bar.hh -- declare Span_score_bar + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef SPAN_SCORE_BAR_HH +#define SPAN_SCORE_BAR_HH + +#include "span-bar.hh" + +class Span_score_bar : public Span_bar +{ +public: + NAME_MEMBERS(); + SCORE_ELEM_CLONE(Span_score_bar); + Span_score_bar(); +protected: + + + virtual void do_pre_processing(); +}; + + +class Piano_brace : public Span_score_bar +{ +public: + NAME_MEMBERS(); + SCORE_ELEM_CLONE(Piano_brace); +protected: + virtual Interval do_width()const; + virtual Symbol get_bar_sym(Real) const; +}; + +#endif // SPAN_SCORE_BAR_HH diff --git a/lily/include/spring-spacer.hh b/lily/include/spring-spacer.hh new file mode 100644 index 0000000000..2b540085f2 --- /dev/null +++ b/lily/include/spring-spacer.hh @@ -0,0 +1,98 @@ +/* + spring-spacer.hh -- declare Spring_spacer + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef SPRING_SPACER_HH +#define SPRING_SPACER_HH + +#include "line-spacer.hh" +#include "plist.hh" +#include "col-info.hh" + +/** the problem, given by the columns (which include constraints) and + intercolumn spacing. The problem is: + + Generate a spacing which + \begin{itemize} + \item + Satisfies spacing constraints (notes can't be printed through each other) + \item + Looks good, ie tries to conform to an ideal spacing as much as possible. + \end{itemize} + This is converted by regarding idealspacing as "springs" attached + to columns. The equilibrium of one spring is the ideal + distance. The columns have a size, this imposes "hard" constraints + on the distances. This transforms the problem into a quadratic + programming problem with linear constraints. + + The quality is given by the total potential energy in the + springs. The lower the energy, the better the configuration. + + TODO: make item widths work per pstaff. + +*/ + +class Spring_spacer : public Line_spacer { + friend class Durations_iter; + + Pointer_list ideal_p_list_; + Array cols; + Array loose_col_arr_; + + /// mark column #i# as being loose. + void loosen_column(int i); + /// the index of #c# in #cols# + int col_id(PCol const *c) const; + + /// generate an (nonoptimal) solution + Vector find_initial_solution() const; + + /// check if problem is too tight + bool check_feasible() const; + + /// does #this# contain the column #w#? + bool contains(PCol const *w); + + /// make the energy function + void make_matrices(Matrix &quad, Vector &lin,Real&) const; + + /// generate the LP constraints + void make_constraints(Mixed_qp& lp) const; + + + void handle_loose_cols(); + void position_loose_cols(Vector &) const; + /** + add a idealspacing to the problem. + + One pair of columns can have no, one or more idealspacings, + since they can be "summed" if the columns to which #i# refers are + not in this problem, the spacing is ignored. + */ + void add_ideal(Idealspacing const *i); + Vector try_initial_solution() const; + void calc_idealspacing(); + + Score_column* scol_l(int); + void connect(int i,int j, Real,Real); +public: + static Line_spacer *constructor(); + Array error_pcol_l_arr() const; + + virtual Array solve() const; + virtual void add_column(PCol *, bool fixed=false, Real fixpos=0.0); + + + virtual Vector default_solution() const; + virtual bool check_constraints(Vector v) const; + virtual void OK() const; + virtual void print() const; + virtual void prepare(); +}; + +#endif // SPRING_SPACER_HH diff --git a/lily/include/staff-gravs.hh b/lily/include/staff-gravs.hh index 4dffdaee12..a51ffe4795 100644 --- a/lily/include/staff-gravs.hh +++ b/lily/include/staff-gravs.hh @@ -1,5 +1,5 @@ /* - staff-gravs.hh -- declare Staff_engravers + staff-gravs.hh -- declare Line_group_engraver source file of the GNU LilyPond music typesetter @@ -14,24 +14,19 @@ /** Engravers which manage a Staff (one 5-line linestaff) - - */ -class Staff_engravers : public Engraver_group_engraver { + */ +class Line_group_engraver : public Engraver{ Line_of_staff *staffline_p_; Link_array staff_elem_l_arr_; - void group_staff_elems(); protected: - virtual void do_pre_move_processing(); virtual void do_creation_processing(); virtual void do_removal_processing(); - virtual void typeset_element(Score_elem*); - virtual void typeset_breakable_item( Item * it_p); + virtual void acknowledge_element(Score_elem_info); public: - NAME_MEMBERS(); - Staff_engravers(); + Line_group_engraver(); }; #endif // STAFF_GRAVS_HH diff --git a/lily/include/swallow-perf.hh b/lily/include/swallow-perf.hh new file mode 100644 index 0000000000..7c6ec8d4ae --- /dev/null +++ b/lily/include/swallow-perf.hh @@ -0,0 +1,21 @@ +/* + swallow-perf.hh -- declare Swallow_performer + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef SWALLOW_PERF_HH +#define SWALLOW_PERF_HH + +#include "performer.hh" + +class Swallow_performer : public Performer { +public: + NAME_MEMBERS(); + virtual bool try_request (Request* ) { return true; } +}; + +#endif // SWALLOW_PERF_HH diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 65219628f0..b1e333a59a 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -23,6 +23,7 @@ public: virtual Global_translator *global_l() { return 0; } /// Score_register = 0, Staff_registers = 1, etc) + virtual void print()const; virtual int depth_i()const=0; virtual bool is_bottom_engraver_b() const { return false; } virtual bool try_request(Request*); diff --git a/lily/include/word-wrap.hh b/lily/include/word-wrap.hh new file mode 100644 index 0000000000..b7b7d42cfa --- /dev/null +++ b/lily/include/word-wrap.hh @@ -0,0 +1,21 @@ +/* + word-wrap.hh -- declare Word_wrap + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef WORD_WRAP_HH +#define WORD_WRAP_HH + +#include "break.hh" + +/// wordwrap type algorithm: move to next line if current is optimal. +struct Word_wrap : Break_algorithm { + virtual Array do_solve()const; + Word_wrap(PScore&); +}; + +#endif // WORD_WRAP_HH diff --git a/lily/item.cc b/lily/item.cc index f1de7827e8..ab0290db9f 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -33,7 +33,7 @@ Item::do_print() const Real Item::hpos_f()const { - return pcol_l_->hpos + offset().x; + return pcol_l_->hpos_f_ + offset().x; } diff --git a/lily/line-spacer.cc b/lily/line-spacer.cc new file mode 100644 index 0000000000..bc5ef29f34 --- /dev/null +++ b/lily/line-spacer.cc @@ -0,0 +1,22 @@ +/* + line-spacer.cc -- implement + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#include "line-spacer.hh" + +Line_spacer::Line_spacer() +{ + paper_l_ =0; +} +Paper_def* +Line_spacer::paper_l()const +{ + + + return paper_l_ ; +} diff --git a/lily/linespace.cc b/lily/linespace.cc deleted file mode 100644 index c2fec09918..0000000000 --- a/lily/linespace.cc +++ /dev/null @@ -1,388 +0,0 @@ -#include -#include "linespace.hh" -#include "p-col.hh" -#include "debug.hh" -#include "qlp.hh" -#include "unionfind.hh" -#include "idealspacing.hh" -#include "pointer.tcc" - -const Real COLFUDGE=1e-3; -template class P; // ugh. - -bool -Spacing_problem::contains(PCol const *w) -{ - for (int i=0; i< cols.size(); i++) - if (cols[i].pcol_l_ == w) - return true; - return false; -} - -int -Spacing_problem::col_id(PCol const *w)const -{ - for (int i=0; i< cols.size(); i++) - if (cols[i].pcol_l_ == w) - return i; - assert(false); - return -1; -} - -void -Spacing_problem::OK() const -{ -#ifndef NDEBUG - for (int i = 1; i < cols.size(); i++) - assert(cols[i].rank_i_ > cols[i-1].rank_i_); - for (int i = 1; i < loose_col_arr_.size(); i++) - assert(loose_col_arr_[i].rank_i_ > loose_col_arr_[i-1].rank_i_); -#endif -} - -/** - Make sure no unconnected columns happen. - */ -void -Spacing_problem::handle_loose_cols() -{ - Union_find connected(cols.size()); - Array fixed; - for (int i=0; i < ideals.size(); i++) { - assert(ideals[i]->hooke > 0); - int l = col_id(ideals[i]->left); - int r = col_id(ideals[i]->right); - connected.connect(l,r); - } - for (int i = 0; i < cols.size(); i++) - if (cols[i].fixed()) - fixed.push(i); - for (int i=1; i < fixed.size(); i++) - connected.connect(fixed[i-1], fixed[i]); - - for (int i = cols.size(); i--; ) { - if (! connected.equiv(fixed[0], i)) { - warning("unconnected column: " + String(i)); - loosen_column(i); - } - } - OK(); -} - - -/** Guess a stupid position for loose columns. Put loose columns at - regular distances from enclosing calced columns */ -void -Spacing_problem::position_loose_cols(Vector &sol_vec)const -{ - if (!loose_col_arr_.size()) - return ; - assert(sol_vec.dim()); - Array fix_b_arr; - fix_b_arr.set_size(cols.size() + loose_col_arr_.size()); - Real utter_right_f=-INFTY; - Real utter_left_f =INFTY; - for (int i=0; i < loose_col_arr_.size(); i++) { - fix_b_arr[loose_col_arr_[i].rank_i_] = false; - } - for (int i=0; i < cols.size(); i++) { - int r= cols[i].rank_i_; - fix_b_arr[r] = true; - utter_right_f = utter_right_f >? sol_vec(i); - utter_left_f = utter_left_f 0) ?sol_vec(j-1) : utter_left_f; - Real right_pos_f = - (j < sol_vec.dim()) ? sol_vec(j) : utter_right_f; - int left_rank = (j>0) ? cols[j-1].rank_i_ : 0; - int right_rank = (j left_rank && r < right_rank); - - v(i) = (r - left_rank)*left_pos_f/ d_r + - (right_rank - r) *right_pos_f /d_r; - } - } - sol_vec = v; -} - -bool -Spacing_problem::check_constraints(Vector v) const -{ - int dim=v.dim(); - assert(dim == cols.size()); - - for (int i=0; i < dim; i++) { - - if (cols[i].fixed()&& - abs(cols[i].fixed_position() - v(i)) > COLFUDGE) - return false; - - if (!i) - continue; - - Real mindist=cols[i-1].minright() - +cols[i].minleft(); - - // ugh... compares - Real dif =v(i) - v(i-1)- mindist; - bool b = (dif > - COLFUDGE); - - - if (!b) - return false; - - } - return true; -} - -void -Spacing_problem::prepare() -{ - handle_loose_cols(); -} - -bool -Spacing_problem::check_feasible() const -{ - Vector sol(try_initial_solution()); - return check_constraints(sol); -} - -/// generate a solution which obeys the min distances and fixed positions -Vector -Spacing_problem::try_initial_solution() const -{ - int dim=cols.size(); - Vector initsol(dim); - for (int i=0; i < dim; i++) { - if (cols[i].fixed()) { - initsol(i)=cols[i].fixed_position(); - - if (i > 0) { - Real r =initsol(i-1) + cols[i-1].minright(); - if (initsol(i) < r ) { - warning("overriding fixed position"); - initsol(i) =r; - } - } - - } else { - Real mindist=cols[i-1].minright() - +cols[i].minleft(); - if (mindist < 0.0) - warning("Excentric column"); - initsol(i)=initsol(i-1)+mindist; - } - } - - return initsol; -} - - - -Vector -Spacing_problem::find_initial_solution() const -{ - Vector v(try_initial_solution()); - assert(check_constraints(v)); - return v; -} - -// generate the matrices -void -Spacing_problem::make_matrices(Matrix &quad, Vector &lin, Real &c) const -{ - quad.fill(0); - lin.fill(0); - c = 0; - for (int j=0; j < ideals.size(); j++){ - Idealspacing const*i=ideals[j]; - int l = col_id(i->left); - int r = col_id(i->right); - - quad(r,r) += i->hooke; - quad(r,l) -= i->hooke; - quad(l,r) -= i->hooke; - quad(l,l) += i->hooke; - - lin(r) -= i->space*i->hooke; - lin(l) += i->space*i->hooke; - - c += sqr(i->space); - } -} - -// put the constraints into the LP problem -void -Spacing_problem::make_constraints(Mixed_qp& lp) const -{ - int dim=cols.size(); - for (int j=0; j < dim; j++) { - Colinfo c=cols[j]; - if (c.fixed()) { - lp.add_fixed_var(j,c.fixed_position()); - } - if (j > 0){ - Vector c1(dim); - - c1(j)=1.0 ; - c1(j-1)=-1.0 ; - lp.add_inequality_cons(c1, cols[j-1].minright() + - cols[j].minleft()); - } - } -} - -Array -Spacing_problem::solve() const -{ - assert(check_feasible()); - print(); - - Mixed_qp lp(cols.size()); - make_matrices(lp.quad,lp.lin, lp.const_term); - make_constraints(lp); - Vector start=find_initial_solution(); - Vector sol(lp.solve(start)); - if (!check_constraints(sol)) { - WARN << "solution doesn't satisfy constraints.\n" ; - } - Real energy_f =lp.eval(sol); - position_loose_cols(sol); - - Array posns(sol); - - posns.push(energy_f); - return posns; -} - -/** - add one column to the problem. -*/ -void -Spacing_problem::add_column(PCol *col, bool fixed, Real fixpos) -{ - Colinfo c(col,(fixed)? &fixpos : 0); - if (cols.size()) - c.rank_i_ = cols.top().rank_i_+1; - else - c.rank_i_ = 0; - cols.push(c); -} - -Array -Spacing_problem::error_pcol_l_arr()const -{ - Array retval; - for (int i=0; i< cols.size(); i++) - if (cols[i].ugh_b_) - retval.push(cols[i].pcol_l_); - for (int i=0; i < loose_col_arr_.size(); i++) { - retval.push(loose_col_arr_[i].pcol_l_); - } - return retval; -} - -void -Spacing_problem::loosen_column(int i) -{ - Colinfo c=cols.get(i); - for (int i=0; i < ideals.size(); ) { - Idealspacing const *i_l =ideals[i]; - if (i_l->left == c.pcol_l_ || i_l->right == c.pcol_l_) - ideals.del(i); - else - i++; - } - c.ugh_b_ = true; - - int i=0; - for (; i < loose_col_arr_.size(); i++) { - if (loose_col_arr_[i].rank_i_ > c.rank_i_) - break; - } - loose_col_arr_.insert(c,i); -} - -void -Spacing_problem::add_ideal(Idealspacing const *i) -{ - PCol const *l =i->left; - PCol const *r= i->right; - - if (!contains(l) || !contains(r)) { - return; - } - ideals.push(i); -} - -void -Spacing_problem::print_ideal(Idealspacing const *id)const -{ -#ifndef NPRINT - int l = col_id(id->left); - int r = col_id(id->right); - - mtor << "between " << l <<","<print(); -#endif -} - -void -Spacing_problem::print() const -{ -#ifndef NPRINT - for (int i=0; i < cols.size(); i++) { - mtor << "col " << i<<' '; - cols[i].print(); - } - for (int i=0; i < ideals.size(); i++) { - print_ideal(ideals[i]); - } -#endif - -} - -/* **************** */ - -void -Colinfo::print() const -{ -#ifndef NPRINT - mtor << "column { "; - if (fixed()) - mtor << "fixed at " << fixed_position()<<", "; - assert(pcol_l_); - mtor << "[" << minleft() << ", " << minright() << "]"; - mtor <<"}\n"; -#endif -} - -Colinfo::Colinfo(PCol *col_l, Real const *fixed_C) -{ - if (fixed_C) - fixpos_p_.set_l(fixed_C); - ugh_b_ = false; - pcol_l_ = col_l; - width = pcol_l_->width(); -} - - -Colinfo::Colinfo() -{ - ugh_b_ = false; - pcol_l_ =0; -} diff --git a/lily/local-key-grav.cc b/lily/local-key-grav.cc index 682e79b917..4c10dc50b6 100644 --- a/lily/local-key-grav.cc +++ b/lily/local-key-grav.cc @@ -53,6 +53,7 @@ Local_key_engraver::do_pre_move_processing() for(int i=0; i < support_l_arr_.size(); i++) key_item_p->add_support(support_l_arr_[i]); + announce_element(Score_elem_info(key_item_p, 0)); // ugh ugh ugh typeset_element(key_item_p); } diff --git a/lily/lookup.cc b/lily/lookup.cc index 790ab2d34a..9a0c8c7093 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -239,25 +239,38 @@ Lookup::stem(Real y1,Real y2) const return s; } +/* + should be handled via TeX code and Lookup::bar() + */ Symbol -Lookup::vbrace( Real &y ) const +Lookup::vbrace(Real &y) const { - if ( y < 2 * 20 PT ) { - warning( "staff brace too small (" + print_dimen( y ) + ")" ); - y = 2 * 20 PT; + if (y < 2* 20 PT) { + warning ( "piano brace too small (" + print_dimen(y)+ ")"); + y = 2*20 PT; } - if ( y > 2 * 67 PT ) { - warning( "staff brace too big (" + print_dimen( y ) + ")" ); - y = 2 * 67 PT; + if (y > 67 * 2 PT) { + warning ( "piano brace too big (" + print_dimen(y)+ ")"); + y = 67 *2 PT; } - int idx = int( rint( y/2.0 - 20 ) ); + int idx = int(rint((y/2.0 - 20 ) + 148)); Symbol s = (*symtables_)("param")->lookup("brace"); - - Array a; - a.push(idx); - s.tex = substitute_args(s.tex,a); - s.dim.y = Interval(0,y); + { + Array a; + a.push(idx); + s.tex = substitute_args(s.tex,a); + s.dim.y = Interval(0,y); + } + { + Array a; + a.push(print_dimen( y/2 )); + a.push(print_dimen(0)); + a.push(s.tex); + s.tex = substitute_args("\\placebox{%}{%}{%}", a); + } + + return s; } diff --git a/lily/lyric-engraver.cc b/lily/lyric-grav.cc similarity index 62% rename from lily/lyric-engraver.cc rename to lily/lyric-grav.cc index 28d1086e02..08c81723a0 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-grav.cc @@ -14,6 +14,8 @@ Lyric_engraver::Lyric_engraver() { + lreq_l_ =0; + lyric_item_p_ =0; } bool @@ -22,7 +24,7 @@ Lyric_engraver::do_try_request(Request*r) Musical_req * m =r->musical(); if (!m || ! m->lreq_l()) return false; - lreq_arr_.push(m->lreq_l()); + lreq_l_ = m->lreq_l(); return true; } @@ -30,24 +32,28 @@ Lyric_engraver::do_try_request(Request*r) void Lyric_engraver::do_process_requests() { - Text_item * last_item_l =0; - for (int i=0; i < lreq_arr_.size(); i++) { - Text_item *lp = new Text_item(lreq_arr_[i]->tdef_p_ ); - lp->dir_i_ = -1; - lp->fat_b_ = true; - if (last_item_l) - lp->add_support(last_item_l); - last_item_l = lp; - typeset_element(lp); + if ( lreq_l_ ) { + lyric_item_p_ = new Text_item(lreq_l_->tdef_p_ ); + lyric_item_p_->dir_i_ = -1; + lyric_item_p_->fat_b_ = true; + announce_element( Score_elem_info( lyric_item_p_, lreq_l_)); } } void Lyric_engraver::do_post_move_processing() { - lreq_arr_.set_size(0); + lreq_l_ =0; } +void +Lyric_engraver::do_pre_move_processing() +{ + if ( lyric_item_p_ ){ + typeset_element( lyric_item_p_); + lyric_item_p_ =0; + } +} IMPLEMENT_STATIC_NAME(Lyric_engraver); IMPLEMENT_IS_TYPE_B1(Lyric_engraver,Engraver); diff --git a/lily/midi-output.cc b/lily/midi-output.cc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 33e6b2cdb6..b88271e158 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -15,6 +15,7 @@ IMPLEMENT_STATIC_NAME(Music_iterator); IMPLEMENT_IS_TYPE_B(Music_iterator); +Chord_iterator::~Chord_iterator(){} void Music_iterator::do_print()const { @@ -122,8 +123,6 @@ Music_iterator::static_get_iterator_p(Music *m, p = new Chord_iterator( (Chord*) m); else if (m->is_type_b( Voice::static_name())) p = new Voice_iterator( (Voice*) m); - else if (m->is_type_b( Request::static_name() )) - p = new Request_iterator( (Request*) m ); if ( m->is_type_b( Music_list::static_name())) { Music_list* ml = (Music_list*) m; @@ -304,52 +303,6 @@ Voice_iterator::ok()const /* ***************** */ -void -Request_iterator::do_print()const -{ - mtor << req_l_->name() ; -} - -Request_iterator::Request_iterator(Request const*c) -{ - req_l_ = (Request*)c; - last_b_ = false; -} - -void -Request_iterator::process_and_next(Moment m) -{ - if ( first_b_ ) { - bool gotcha = daddy_iter_l_->report_to_l()->try_request(req_l_); - if (!gotcha) - req_l_->warning("Junking request: " + String(req_l_->name())); - first_b_ = false; - } - - if ( m >= req_l_->duration() ) - last_b_ = true; -} - -Moment -Request_iterator::next_moment()const -{ - - Moment m(0); - if (!first_b_) - m = req_l_->duration(); - return m; -} - -bool -Request_iterator::ok()const -{ - return (req_l_->duration() && !last_b_) || first_b_; // ugh -} - -IMPLEMENT_STATIC_NAME(Request_iterator); -IMPLEMENT_IS_TYPE_B1(Request_iterator, Music_iterator); - -/* ****************** */ Change_iterator::Change_iterator(Change_reg * ch) { @@ -384,17 +337,61 @@ Change_iterator::process_and_next(Moment mom) /* ******************** */ IMPLEMENT_STATIC_NAME(Voice_element_iterator); -IMPLEMENT_IS_TYPE_B1(Voice_element_iterator,Chord_iterator); +IMPLEMENT_IS_TYPE_B1(Voice_element_iterator,Music_iterator); void Voice_element_iterator::construct_children() { get_req_translator_l(); - Chord_iterator::construct_children(); } Voice_element_iterator::Voice_element_iterator(Voice_element*el_l) - : Chord_iterator(el_l) { - + elt_l_ = el_l; + elt_duration_ = el_l->time_int().length(); + last_b_ = false; +} + + +bool +Voice_element_iterator::ok()const +{ + return (elt_duration_ && !last_b_) || first_b_; +} + + + +Moment +Voice_element_iterator::next_moment()const +{ + Moment m(0); + if (!first_b_) + m = elt_duration_; + return m; +} + +void +Voice_element_iterator::do_print() const +{ +#ifndef NPRINT + mtor << "duration: " << elt_duration_; +#endif +} +void +Voice_element_iterator::process_and_next(Moment mom) +{ + if ( first_b_ ) { + for (PCursor i(elt_l_->music_p_list_); i.ok(); i++) { + assert(i->is_type_b(Request::static_name())); + Request * req_l = (Request*)i.ptr(); + bool gotcha = report_to_l()->try_request(req_l); + if (!gotcha) + req_l->warning("Junking request: " + String(req_l->name())); + + } + first_b_ = false; + } + + if ( mom >= elt_duration_ ) + last_b_ = true; } diff --git a/lily/musical-request.cc b/lily/musical-request.cc index fe81ac84b4..396870dd36 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -363,24 +363,13 @@ Request::voice_l() } /* *************** */ -IMPLEMENT_STATIC_NAME(Subtle_req); -IMPLEMENT_IS_TYPE_B1(Subtle_req,Musical_req); - -void -Subtle_req::do_print() const -{ -#ifndef NPRINT - mtor << " subtime " << subtime_; -#endif -} - IMPLEMENT_STATIC_NAME(Dynamic_req); IMPLEMENT_IS_TYPE_B1(Dynamic_req,Musical_req); void Dynamic_req::do_print() const { - Subtle_req::do_print(); + Musical_req::do_print(); } IMPLEMENT_STATIC_NAME(Absolute_dynamic_req); @@ -389,8 +378,10 @@ IMPLEMENT_IS_TYPE_B1(Absolute_dynamic_req,Musical_req); void Absolute_dynamic_req::do_print() const { +#ifndef NPRINT Dynamic_req::do_print(); - mtor << " loudness " <add(h_l); else note_col_l()->add(h_l); - } - else if (nC == Stem::static_name()){ + + } else if (nC == Stem::static_name()){ stem_l_ = (Stem*)i.elem_l_->item(); } + + if ( ncol_p_ || restcol_p_ ) { + if ( stem_l_ ) { + if (restcol_p_&& !restcol_p_->stem_l_) + restcol_p_->set (stem_l_ ); + if (ncol_p_ && !ncol_p_->stem_l_) + ncol_p_->set(stem_l_); + } + + + for (int i=0; i < script_l_arr_.size(); i++) { + if (restcol_p_) + restcol_p_->add(script_l_arr_[i]); + if ( ncol_p_ ) + ncol_p_->add(script_l_arr_[i]); + } + + script_l_arr_.set_size(0); + } + } void Note_column_engraver::do_pre_move_processing() { - Script_column *col_l = ( ncol_p_ ) ? ncol_p_ : restcol_p_; - if (!col_l) - return; - - for (int i=0; i < script_l_arr_.size(); i++) - col_l->add(script_l_arr_[i]); - - if (stem_l_) { - if (ncol_p_) - ncol_p_->add(stem_l_); - if (restcol_p_) - restcol_p_->add(stem_l_); - } - if (restcol_p_) { - if (! restcol_p_ -> dir_i_) - restcol_p_->dir_i_ = dir_i_; - typeset_element(restcol_p_); - restcol_p_ =0; - } if (ncol_p_) { - if (! ncol_p_->dir_i_ ) - ncol_p_->dir_i_ = dir_i_; if (! ncol_p_->h_shift_b_) ncol_p_->h_shift_b_ = h_shift_b_; + if (! ncol_p_->dir_i_ ) + ncol_p_->dir_i_ = dir_i_; + typeset_element(ncol_p_); ncol_p_ =0; } + if (restcol_p_) { + if (! restcol_p_->dir_i_ ) + restcol_p_->dir_i_ = dir_i_; + + typeset_element(restcol_p_); + restcol_p_ =0; + } } void @@ -120,6 +129,7 @@ Note_column_engraver::Note_column_engraver() restcol_p_ =0; do_post_move_processing(); } + IMPLEMENT_STATIC_NAME(Note_column_engraver); IMPLEMENT_IS_TYPE_B1(Note_column_engraver,Engraver); ADD_THIS_ENGRAVER(Note_column_engraver); diff --git a/lily/note-column.cc b/lily/note-column.cc index fab25c79ce..8d7d7f7e2b 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -7,34 +7,23 @@ */ #include "note-column.hh" -#include "debug.hh" #include "script.hh" #include "note-head.hh" #include "stem.hh" IMPLEMENT_STATIC_NAME(Note_column); -IMPLEMENT_IS_TYPE_B1(Note_column,Script_column); +IMPLEMENT_IS_TYPE_B1(Note_column,Head_column); void -Note_column::add(Stem*stem_l) +Note_column::set(Stem*s) { - stem_l_ = stem_l; - add_support(stem_l); -} - -void -Note_column::add(Note_head* n_l) -{ - assert(!n_l->rest_b_); - head_l_arr_.push(n_l); - add_support(n_l); + stem_l_ = s; + add_support(s); } Note_column::Note_column() { - stem_l_ = 0; h_shift_b_ =false; - dir_i_ =0; } void @@ -46,7 +35,7 @@ Note_column::sort() Interval_t Note_column::head_positions_interval()const { - ( (Note_column*)this)->sort(); + ((Note_column*)this)->sort(); return Interval_t ( head_l_arr_[0]->position_i_, head_l_arr_.top()->position_i_); @@ -56,26 +45,10 @@ Note_column::head_positions_interval()const void Note_column::do_pre_processing() { - if (!dir_i_){ - if (stem_l_) - dir_i_ = stem_l_->dir_i_; - else - dir_i_ = (head_positions_interval().center() >= 5) ? -1 : 1; + if (!dir_i_&& !stem_l_){ + dir_i_ = (head_positions_interval().center() >= 5) ? -1 : 1; } - Script_column::do_pre_processing(); + Head_column::do_pre_processing(); } - -void -Note_column::do_substitute_dependency(Score_elem*o,Score_elem*n) -{ - Script_column::do_substitute_dependency(o,n); - if (o->name() == Note_head::static_name()) { - head_l_arr_.substitute( (Note_head*)o->item(), - (n)? (Note_head*)n->item() : 0); - } - if (stem_l_ == o) { - stem_l_ = n ? (Stem*)n->item():0; - } -} diff --git a/lily/p-col.cc b/lily/p-col.cc index 7036bebee3..b433f1b41e 100644 --- a/lily/p-col.cc +++ b/lily/p-col.cc @@ -98,11 +98,19 @@ PCol::set_breakable() if (breakable_b()) return; - prebreak_p_ = new PCol(this); - postbreak_p_ = new PCol(this); + do_set_breakable(); prebreak_p_->pscore_l_ = pscore_l_; postbreak_p_->pscore_l_ = pscore_l_; + + prebreak_p_->daddy_l_ = postbreak_p_->daddy_l_ = this; +} +void +PCol::do_set_breakable() +{ + prebreak_p_ = new PCol; + postbreak_p_ = new PCol; } + bool PCol::breakpoint_b() const @@ -116,15 +124,15 @@ PCol::breakable_b() const return prebreak_p_||postbreak_p_; } -PCol::PCol(PCol *parent) +PCol::PCol() { used_b_ = false; error_mark_b_ = false; - daddy_l_ = parent; + daddy_l_ = 0; prebreak_p_=0; postbreak_p_=0; line_l_=0; - hpos = -1.0; + hpos_f_ = -1.0; pscore_l_ = 0; rank_i_ = -1; } @@ -132,7 +140,7 @@ PCol::PCol(PCol *parent) PCol::~PCol() { delete prebreak_p_; - delete postbreak_p_; + delete postbreak_p_; } void @@ -145,5 +153,5 @@ PCol::add( Item *i) bool PCol::used_b()const { - return breakable_b() || its.size()|| used_b_; + return daddy_l_ || breakable_b() || its.size()|| used_b_; } diff --git a/lily/p-score.cc b/lily/p-score.cc index 2c84188729..0e093c9693 100644 --- a/lily/p-score.cc +++ b/lily/p-score.cc @@ -7,7 +7,6 @@ */ #include "super-elem.hh" -#include "idealspacing.hh" #include "debug.hh" #include "lookup.hh" #include "spanner.hh" @@ -15,7 +14,7 @@ #include "scoreline.hh" #include "p-score.hh" #include "tex-stream.hh" -#include "break.hh" +#include "word-wrap.hh" #include "p-col.hh" PScore::PScore(Paper_def*p) @@ -72,10 +71,10 @@ PScore::typeset_broken_spanner(Spanner*span_p) void PScore::typeset_unbroken_spanner(Spanner*span_p) { - spanners.bottom().add(span_p); + span_p_list_.bottom().add(span_p); span_p->pscore_l_=this; - if ( span_p->left_col_l_) + if (span_p->left_col_l_) span_p->left_col_l_->used_b_ = true; if ( span_p->right_col_l_) span_p->right_col_l_->used_b_ = true; @@ -84,23 +83,12 @@ PScore::typeset_unbroken_spanner(Spanner*span_p) span_p->add_processing(); } -Idealspacing* -PScore::get_spacing(PCol*l, PCol*r) -{ - assert(l!=r); - - Idealspacing*i_p =new Idealspacing(l,r); - suz.bottom().add(i_p); - - return i_p; -} - void PScore::clean_cols() { int rank_i = 0; - for (iter_top(cols,c); c.ok(); ) + for (iter_top(col_p_list_,c); c.ok(); ) if (!c->used_b()) { delete c.remove_p(); } else { @@ -109,27 +97,6 @@ PScore::clean_cols() } } -void -PScore::do_connect(PCol *c1, PCol *c2, Real d, Real h) -{ - if (!c1 || !c2 ) - return; - Idealspacing*s_l=get_spacing(c1,c2); - - - s_l->hooke = h; - s_l->space =d; -} - -void -PScore::connect(PCol* c1, PCol *c2, Real d, Real h) -{ - do_connect(c1,c2,d,h); - do_connect(c1->postbreak_p_, c2,d,h); - do_connect(c1, c2->prebreak_p_,d,h); - do_connect(c1->postbreak_p_, c2->prebreak_p_,d,h); -} - void PScore::add(PCol *p) { @@ -138,7 +105,7 @@ PScore::add(PCol *p) p->prebreak_p_->pscore_l_ = this; p->postbreak_p_->pscore_l_ = this; } - cols.bottom().add(p); + col_p_list_.bottom().add(p); } void @@ -154,10 +121,8 @@ void PScore::OK()const { #ifndef NDEBUG - for (iter_top(cols,cc); cc.ok(); cc++) + for (iter_top(col_p_list_,cc); cc.ok(); cc++) cc->OK(); - for (iter_top(suz,i); i.ok(); i++) - i->OK(); #endif } @@ -171,15 +136,12 @@ PScore::print() const for (iter_top(elem_p_list_,cc); cc.ok(); cc++) cc->print(); mtor << "\n unbroken spanners: "; - for (iter(spanners.top(), i); i.ok(); i++) + for (iter(span_p_list_.top(), i); i.ok(); i++) i->print(); mtor << "\ncolumns: "; - for (iter_top(cols,cc); cc.ok(); cc++) + for (iter_top(col_p_list_,cc); cc.ok(); cc++) cc->print(); - mtor << "\nideals: "; - for (iter_top(suz,i); i.ok(); i++) - i->print(); mtor << "}\n"; #endif } @@ -205,7 +167,7 @@ PScore::find_col(PCol const *c)const if (what->daddy_l_ ) what = what->daddy_l_; - return cols.find((PCol*)what); + return col_p_list_.find((PCol*)what); } @@ -216,7 +178,7 @@ PScore::set_breaking(Array const &breaking) super_elem_l_->break_processing(); - for (iter(spanners.top(),i); i.ok(); ) { + for (iter(span_p_list_.top(),i); i.ok(); ) { Spanner *span_p = i.remove_p(); if (span_p->broken_b()) { span_p->unlink(); @@ -234,7 +196,7 @@ PScore::set_breaking(Array const &breaking) i++; } - for (iter_top(cols, i); i.ok(); i++) + for (iter_top(col_p_list_, i); i.ok(); i++) i->clean_breakable_items(); } @@ -242,6 +204,7 @@ void PScore::calc_breaking() { Word_wrap w(*this); + set_breaking(w.solve()); } @@ -264,8 +227,8 @@ PScore::breakable_col_range(PCol*l,PCol*r)const { Link_array ret; - PCursor start(l ? find_col(l)+1 : cols.top() ); - PCursor stop(r ? find_col(r) : cols.bottom()); + PCursor start(l ? find_col(l)+1 : col_p_list_.top() ); + PCursor stop(r ? find_col(r) : col_p_list_.bottom()); /* ugh! windows-suck-suck-suck. @@ -283,8 +246,8 @@ PScore::col_range(PCol*l,PCol*r)const { Link_array ret; - PCursor start(l ? find_col(l)+1 : cols.top() ); - PCursor stop(r ? find_col(r) : cols.bottom()); + PCursor start(l ? find_col(l)+1 : col_p_list_.top() ); + PCursor stop(r ? find_col(r) : col_p_list_.bottom()); ret.push(l); /* @@ -301,8 +264,8 @@ PScore::broken_col_range(PCol*l,PCol*r)const { Link_array ret; - PCursor start(l ? find_col(l)+1 : cols.top() ); - PCursor stop(r ? find_col(r) : cols.bottom()); + PCursor start(l ? find_col(l)+1 : col_p_list_.top() ); + PCursor stop(r ? find_col(r) : col_p_list_.bottom()); /* ugh! windows-suck-suck-suck. diff --git a/lily/parser.y b/lily/parser.y index 2607a2ed08..4f074fb2dc 100644 --- a/lily/parser.y +++ b/lily/parser.y @@ -12,7 +12,7 @@ #include // mmm -#define MUDELA_VERSION "0.0.61" +#define MUDELA_VERSION "0.1.0" #include "script-def.hh" #include "symtable.hh" @@ -170,6 +170,7 @@ yylex(YYSTYPE *s, void * v_l) %token SCRIPT_IDENTIFIER %token STAFF_IDENTIFIER %token REAL_IDENTIFIER +%token INPUT_TRANS_IDENTIFIER %token INT_IDENTIFIER %token SCORE_IDENTIFIER %token MIDI_IDENTIFIER @@ -283,6 +284,7 @@ declarable_identifier: old_identifier: IDENTIFIER + | INPUT_TRANS_IDENTIFIER | MELODIC_REQUEST_IDENTIFIER | POST_REQUEST_IDENTIFIER | SCRIPT_IDENTIFIER @@ -332,6 +334,10 @@ declaration: $$ = new Request_id(*$1, $3, MELODIC_REQUEST_IDENTIFIER); delete $1; } + | declarable_identifier '=' input_translator_spec { + $$ = new Input_translator_id ( *$1, $3, INPUT_TRANS_IDENTIFIER); + delete $1; + } ; @@ -342,7 +348,11 @@ input_translator_spec: ; input_translator_spec_body: - STRING STRING { + INPUT_TRANS_IDENTIFIER { + $$ = $1->input_translator(true); + $$-> set_spot( THIS->here_input() ); + } + | STRING STRING { $$ = new Input_translator; $$->base_str_ = *$1; $$->type_str_ =*$2; diff --git a/lily/rest-collision-grav.cc b/lily/rest-collision-grav.cc index d5e42658e7..296f856a8a 100644 --- a/lily/rest-collision-grav.cc +++ b/lily/rest-collision-grav.cc @@ -55,7 +55,6 @@ void Rest_collision_engraver::do_print() const { #ifndef NPRINT - mtor << "collisions: " << collision_l_arr_.size(); if ( rest_collision_p_ ) rest_collision_p_->print(); #endif diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 6408a96450..4529bbc4d6 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -98,9 +98,10 @@ Rest_collision::do_pre_processing() // meisjes met meisjes if (!ncol_l_arr_.size()) { int dy = rest_l_arr_.size() > 2 ? 6 : 4; - rest_l_arr_[0]->translate_heads(dy); + + rest_l_arr_[0]->translate_heads(rest_l_arr_[0]->dir_i_ *dy); // top is last element... - rest_l_arr_.top()->translate_heads(-dy); + rest_l_arr_.top()->translate_heads(rest_l_arr_.top()->dir_i_* dy); } // meisjes met jongetjes else { diff --git a/lily/rest-column.cc b/lily/rest-column.cc index a58e73846f..9f811d39de 100644 --- a/lily/rest-column.cc +++ b/lily/rest-column.cc @@ -13,48 +13,7 @@ #include "stem.hh" IMPLEMENT_STATIC_NAME(Rest_column); -IMPLEMENT_IS_TYPE_B1(Rest_column,Item); - -Rest_column::Rest_column() -{ - dir_i_ = 0; - stem_l_ = 0; -} - -void -Rest_column::add(Note_head *n_l) -{ - add_support(n_l); - head_l_arr_.push(n_l); -} - -void -Rest_column::add(Stem*stem_l) -{ - stem_l_ = stem_l; - add_dependency(stem_l); -// add_support(stem_l); -} - -void -Rest_column::do_print() const -{ -#ifndef NPRINT - mtor << "heads: " << head_l_arr_.size(); -#endif -} - -void -Rest_column::do_substitute_dependency(Score_elem*o,Score_elem*n) -{ - Script_column::do_substitute_dependency(o,n); - if (o == stem_l_) - stem_l_ = n? (Stem*)n->item() :0; - - if (o->is_type_b( Note_head::static_name()) ) - head_l_arr_.substitute( (Note_head*)o->item(), - (n)? (Note_head*)n->item() : 0); -} +IMPLEMENT_IS_TYPE_B1(Rest_column,Head_column); /** diff --git a/lily/score-align-grav.cc b/lily/score-align-grav.cc index b56e6777c2..7f315bcc39 100644 --- a/lily/score-align-grav.cc +++ b/lily/score-align-grav.cc @@ -31,14 +31,15 @@ void Score_align_engraver::acknowledge_element(Score_elem_info inf) { if (inf.elem_l_->is_type_b(type_ch_C_ )) { - - if (! align_p_ ) { + + if (!align_p_ ) { align_p_ = new Horizontal_group_item; announce_element(Score_elem_info(align_p_,0)); } align_p_->add_element(inf.elem_l_); } + } IMPLEMENT_STATIC_NAME(Score_align_engraver) diff --git a/lily/score-column.cc b/lily/score-column.cc index d01d78e5c1..2fd3def678 100644 --- a/lily/score-column.cc +++ b/lily/score-column.cc @@ -10,30 +10,12 @@ #include "p-col.hh" #include "score-column.hh" -int -Score_column::compare(Score_column & c1, Score_column &c2) -{ - return sign(c1.when_ - c2.when_); -} - -void -Score_column::set_breakable() -{ - pcol_l_->set_breakable(); -} - Score_column::Score_column(Moment w) { when_ = w; - pcol_l_ = new PCol(0); musical_b_ = false; } -bool -Score_column::used_b() { - return pcol_l_->used_b(); -} - void Score_column::print() const { @@ -43,15 +25,15 @@ Score_column::print() const for (int i=0; i < durations.size(); i++) mtor << durations[i] << " "; mtor << "]\n"; - pcol_l_->print(); + PCol::print(); mtor << "}\n"; #endif } int -Moment_compare(Moment &a , Moment& b) +Moment_compare(Moment const &m1, Moment const &m2) { - return sign(a-b); + return sign(m1-m2); } void @@ -59,6 +41,7 @@ Score_column::preprocess() { durations.sort(Moment_compare); } + void Score_column::add_duration(Moment d) { @@ -70,8 +53,15 @@ Score_column::add_duration(Moment d) durations.push(d); } -bool -Score_column::breakable_b() +void +Score_column::do_set_breakable() { - return pcol_l_->breakable_b(); + Score_column *c1 = new Score_column(when_); + Score_column *c2 = new Score_column(when_); + prebreak_p_ =c1; + postbreak_p_ = c2; + c1->durations = durations; + c2->durations = durations; + c1->musical_b_ + = c2->musical_b_ = musical_b_; } diff --git a/lily/score-elem.cc b/lily/score-elem.cc index 9a554a46ef..7f026d1e88 100644 --- a/lily/score-elem.cc +++ b/lily/score-elem.cc @@ -47,7 +47,7 @@ Score_elem::dependent_size() const String Score_elem::TeX_string() const { - assert( status > POSTCALCED); + assert( status_ > POSTCALCED); if (transparent_b_ ) return ""; String s( "\\placebox{%}{%}{%}"); @@ -79,7 +79,7 @@ Score_elem::Score_elem(Score_elem const&s) copy_edges_out(s); x_group_element_i_ = 0; y_group_element_i_ = 0; - status = s.status; + status_ = s.status_; assert(!s.output); output = 0; pscore_l_ = s.pscore_l_; @@ -89,9 +89,9 @@ Score_elem::Score_elem(Score_elem const&s) Score_elem::~Score_elem() { // some paranoia to prevent weird segv's - assert(status < DELETED); + assert(status_ < DELETED); delete output; - status = DELETED; + status_ = DELETED; output = 0; assert(!x_group_element_i_ && !y_group_element_i_); } @@ -197,7 +197,7 @@ Score_elem::Score_elem() pscore_l_=0; offset_ = Offset(0,0); output = 0; - status = ORPHAN; + status_ = ORPHAN; } @@ -211,61 +211,61 @@ Score_elem::paper() const void Score_elem::add_processing() { - if (status >= VIRGIN) + if (status_ >= VIRGIN) return; - status = VIRGIN; + status_ = VIRGIN; do_add_processing(); } void Score_elem::pre_processing() { - if (status >= PRECALCED ) + if (status_ >= PRECALCED ) return; - assert(status != PRECALCING); // cyclic dependency - status = PRECALCING; + assert(status_ != PRECALCING); // cyclic dependency + status_ = PRECALCING; for (int i=0; i < dependency_size(); i++) dependency(i)->pre_processing(); do_pre_processing(); - status = PRECALCED; + status_ = PRECALCED; } void Score_elem::breakable_col_processing() { - if (status >= PREBROKEN ) + if (status_ >= PREBROKEN ) return; - assert(status != PREBREAKING); // cyclic dependency - status = PREBREAKING; + assert(status_ != PREBREAKING); // cyclic dependency + status_ = PREBREAKING; for (int i=0; i < dependency_size(); i++) dependency(i)->breakable_col_processing(); do_breakable_col_processing(); - status = PREBROKEN; + status_ = PREBROKEN; } void Score_elem::break_processing() { - if (status >= BROKEN ) + if (status_ >= BROKEN ) return; - assert(status != BREAKING); // cyclic dependency - status = BREAKING; + assert(status_ != BREAKING); // cyclic dependency + status_ = BREAKING; for (int i=0; i < dependency_size(); i++) dependency(i)->break_processing(); do_break_processing(); - status = BROKEN; + status_ = BROKEN; } void @@ -278,24 +278,30 @@ Score_elem::do_break_processing() void Score_elem::post_processing() { - if (status >= POSTCALCED) + if (status_ >= POSTCALCED) return; - assert(status != POSTCALCING);// cyclic dependency - status=POSTCALCING; + assert(status_ != POSTCALCING);// cyclic dependency + status_=POSTCALCING; for (int i=0; i < dependency_size(); i++) dependency(i)->post_processing(); do_post_processing(); - status=POSTCALCED; + status_=POSTCALCED; +} + +Score_elem::Status +Score_elem::status()const +{ + return status_; } void Score_elem::molecule_processing() { - if (status >= OUTPUT) + if (status_ >= OUTPUT) return; - status = OUTPUT; // do it only once. + status_ = OUTPUT; // do it only once. for (int i=0; i < dependency_size(); i++) dependency(i)->molecule_processing(); @@ -333,7 +339,8 @@ Score_elem::do_substitute_dependency(Score_elem*,Score_elem*) } void Score_elem::do_substitute_dependent(Score_elem*,Score_elem*) -{} +{ +} IMPLEMENT_STATIC_NAME(Score_elem); @@ -365,8 +372,7 @@ void Score_elem::remove_dependency(Score_elem*e) { remove_edge_out(e); - e->do_substitute_dependent(this, 0); - do_substitute_dependency(e, 0); + substitute_dependency(e, 0); } void @@ -374,7 +380,12 @@ Score_elem::add_dependency(Score_elem*e) { Directed_graph_node::add(e); } - +void +Score_elem::substitute_dependency(Score_elem* old, Score_elem* new_l) +{ + do_substitute_dependency(old,new_l); + old->do_substitute_dependent(this, 0); +} void Score_elem::handle_broken_dependencies() @@ -390,13 +401,13 @@ Score_elem::handle_broken_dependencies() if (elt->spanner()) { Spanner * sp = elt->spanner(); Spanner * broken = sp->find_broken_piece(line); - do_substitute_dependency(sp, broken); + substitute_dependency(sp, broken); add_dependency(broken); } else if (elt->item() && elt->item()->pcol_l_->breakpoint_b() && elt->item()->break_status_i() == 0) { Item * my_item = elt->item()->find_prebroken_piece(line); - do_substitute_dependency( elt, my_item); + substitute_dependency( elt, my_item); if (my_item) add_dependency( my_item); } @@ -412,8 +423,8 @@ Score_elem::handle_broken_dependencies() /* Reset this. If we are a (broken) copy of a spanner, then break_processing() was not called on us (and we are not breaking). */ - if (status < BROKEN) - status = BROKEN; + if (status_ < BROKEN) + status_ = BROKEN; } /* @@ -460,8 +471,8 @@ Score_elem::handle_prebroken_dependencies() /* see comment at handle_broken_dependencies() */ - if (status < PREBROKEN) - status = PREBROKEN; + if (status_ < PREBROKEN) + status_ = PREBROKEN; } diff --git a/lily/score-grav.cc b/lily/score-grav.cc index f837dba557..bcec7e71fb 100644 --- a/lily/score-grav.cc +++ b/lily/score-grav.cc @@ -17,6 +17,7 @@ #include "score.hh" #include "musical-request.hh" #include "score-column.hh" +#include "command-request.hh" void @@ -28,28 +29,29 @@ Score_engraver::set_score(Score *s) Score_engraver::Score_engraver() { + disallow_break_b_ = false; scoreline_l_ =0; command_column_l_ =0; musical_column_l_ =0; + breaks_i_ =0; } void Score_engraver::prepare(Moment w) { - Score_column* c1 = new Score_column(w); - Score_column* c2 = new Score_column(w); + command_column_l_ = new Score_column(w); + musical_column_l_ = new Score_column(w); - c1->musical_b_ = false; - c2->musical_b_ = true; + command_column_l_->musical_b_ = false; + musical_column_l_->musical_b_ = true; - score_l_->cols_.bottom().add(c1); - score_l_->cols_.bottom().add(c2); - set_cols(c1,c2); - - + score_l_->pscore_p_->add(command_column_l_); + score_l_->pscore_p_->add(musical_column_l_); + disallow_break_b_ = false; post_move_processing(); } + void Score_engraver::finish() { @@ -65,13 +67,6 @@ Score_engraver::do_creation_processing() Engraver_group_engraver::do_creation_processing(); } -void -Score_engraver::set_cols(Score_column*c1,Score_column*c2) -{ - command_column_l_ = c1; - musical_column_l_ = c2; -} - void Score_engraver::do_removal_processing() { @@ -93,12 +88,9 @@ Score_engraver::process() void Score_engraver::announce_element(Score_elem_info info) { + announce_info_arr_.push(info); info.origin_grav_l_arr_.push(this); - if (info.elem_l_->name() == Bar::static_name()) { - get_staff_info().command_pcol_l()->set_breakable(); - } - announce_info_arr_.push(info); } void Score_engraver::do_announces() @@ -118,7 +110,7 @@ Score_engraver::do_announces() */ if (announce_info_arr_[i].req_l_) { Musical_req *m = announce_info_arr_[i].req_l_->musical(); - if (m&&m->rhythmic()) { + if (m && m->rhythmic()) { musical_column_l_->add_duration( m->duration()); } } @@ -172,6 +164,12 @@ Score_engraver::typeset_all() void Score_engraver::do_pre_move_processing() { + if ( !disallow_break_b_ ){ + get_staff_info().command_pcol_l()->set_breakable(); + breaks_i_ ++; + if ( ! (breaks_i_%8)) + *mlog << "[" << breaks_i_ << "]" << flush; + } // this generates all items. Engraver_group_engraver::do_pre_move_processing(); @@ -204,6 +202,8 @@ Score_engraver::do_try_request(Request*r) for ( int i =0; !gotcha && i < nongroup_l_arr_.size() ; i++) gotcha = nongroup_l_arr_[i]->try_request(r); + if ( r->command() && r->command()->disallowbreak()) + disallow_break_b_ = true; return gotcha; } diff --git a/lily/score.cc b/lily/score.cc index 15b9b3fcc6..3164315981 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -65,6 +65,8 @@ Score::run_translator(Global_translator * trans_l) } trans_l->modify_next( w ); trans_l->prepare(w); + trans_l->print(); + iter->process_and_next( w ); trans_l->process(); } @@ -85,7 +87,7 @@ Score::midi() if ( !midi_p_ ) return; - *mlog << "\nCreating elements ..." << flush; + *mlog << "\nCreating MIDI elements ..." << flush; Global_translator* score_trans= midi_p_->get_global_translator_p(); run_translator( score_trans ); @@ -118,14 +120,10 @@ Score::paper() warning("Errors found, /*not processing score*/"); // return; } - do_cols(); - clean_cols(); // can't move clean_cols() farther up. print(); - calc_idealspacing(); // debugging - OK(); *mlog << endl; pscore_p_->process(); @@ -133,45 +131,6 @@ Score::paper() paper_output(); } -/** - Remove empty cols, preprocess other columns. - */ -void -Score::clean_cols() -{ - for (iter_top(cols_,c); c.ok(); ) { - if (!c->pcol_l_->used_b()) { - delete c.remove_p(); - } else { - c->preprocess(); - c++; - } - } -} - -PCursor -Score::find_col(Moment w, bool mus) -{ - iter_top( cols_,i); - - for (; i.ok(); i++) { - if (i->when() == w && i->musical_b_ == mus) - return i; - if (i->when() > w) - break; - } - assert(false); - return i; -} - -void -Score::do_cols() -{ - iter_top(cols_,i); - for (; i.ok(); i++) { - pscore_p_->add(i->pcol_l_); - } -} void Score::set(Paper_def *pap_p) @@ -187,16 +146,6 @@ Score::set(Midi_def* midi_p) midi_p_ = midi_p; } -void -Score::OK() const -{ -#ifndef NDEBUG - cols_.OK(); - for (iter_top(cols_,cc); cc.ok() && (cc+1).ok(); cc++) { - assert(cc->when() <= (cc+1)->when()); - } -#endif -} void @@ -205,11 +154,6 @@ Score::print() const #ifndef NPRINT mtor << "score {\n"; music_p_->print(); - for (iter_top(cols_,i); i.ok(); i++) { - i->print(); - } - if (pscore_p_) - pscore_p_->print(); if (midi_p_) midi_p_->print(); diff --git a/lily/scoreline.cc b/lily/scoreline.cc index a9961f0592..85be620ccf 100644 --- a/lily/scoreline.cc +++ b/lily/scoreline.cc @@ -28,12 +28,12 @@ Line_of_score::TeX_string() const s+= "\\scorelineerrormark"; - Real lastpos = cols[0]->hpos; + Real lastpos = cols[0]->hpos_f_; for (int i=0; i < cols.size(); i++){ PCol* col_l= cols[i]; // all items in the current line & staff. String chunk_str; - Real delta = col_l->hpos - lastpos; + Real delta = col_l->hpos_f_ - lastpos; if (col_l->error_mark_b_) { @@ -53,7 +53,7 @@ Line_of_score::TeX_string() const if (delta) s +=String( "\\kern ") + print_dimen(delta); s += chunk_str; - lastpos = col_l->hpos; + lastpos = col_l->hpos_f_; } } s += "}"; @@ -75,7 +75,8 @@ IMPLEMENT_IS_TYPE_B1(Line_of_score,Spanner); void Line_of_score::add(Score_elem*e) { - add_dependency(e); + if( !e->dependent_size()) // avoid excess dependencies. + add_dependency(e); } bool @@ -114,7 +115,7 @@ Line_of_score::set_breaking(Array const &breaking) } for (int i=0; i < curline.size(); i++){ - curline[i]->hpos = config[i]; + curline[i]->hpos_f_ = config[i]; curline[i]->line_l_ = (Line_of_score*)line_l; } } diff --git a/lily/script-column.cc b/lily/script-column.cc index adf27dc7a6..b49fbd48f5 100644 --- a/lily/script-column.cc +++ b/lily/script-column.cc @@ -27,8 +27,11 @@ Script_column::add(Script*s_l) void Script_column::do_print()const { +#ifndef NPRINT mtor << "scripts: " << script_l_arr_.size() << '\n'; +#endif } + static int idx(bool inside, int dir) { diff --git a/lily/silent-performer.cc b/lily/silent-performer.cc deleted file mode 100644 index b62f8c7020..0000000000 --- a/lily/silent-performer.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* - silent-performer.cc -- implement Silent_performer - - (c) 1996, 1997 Jan Nieuwenhuizen - */ - -#include "silent-performer.hh" -#include "translator.hh" -#include "input-translator.hh" -#include "command-request.hh" -#include "musical-request.hh" -#include "debug.hh" - -IMPLEMENT_IS_TYPE_B1(Silent_performer,Performer); -IMPLEMENT_STATIC_NAME(Silent_performer); -ADD_THIS_PERFORMER(Silent_performer); - -Silent_performer::Silent_performer() -{ -} - -Silent_performer::~Silent_performer() -{ -} - -bool -Silent_performer::try_request( Request* req_l ) -{ - return true; -#if 0 - Command_req* com_l = req_l->command(); - Musical_req* mus_l = req_l->musical(); - - if ( com_l ) { - if ( com_l->bar() ) - return true; - - if ( com_l->barcheck() ) - return true; - } - - if ( mus_l ) { - if ( mus_l->beam() ) - return true; - - if( mus_l->rest() ) - return true; - - if( mus_l->slur() ) - return true; - - if ( mus_l->stem() ) - return true; - - if ( mus_l->tie() ) - return true; - } - - return false; -#endif -} - diff --git a/lily/span-bar-grav.cc b/lily/span-bar-grav.cc index 8a8482ff8b..c38fe43073 100644 --- a/lily/span-bar-grav.cc +++ b/lily/span-bar-grav.cc @@ -16,14 +16,21 @@ Span_bar_engraver::Span_bar_engraver() valign_l_ =0; } +Span_bar* +Span_bar_engraver::get_span_bar_p()const +{ + return new Span_bar; +} + void Span_bar_engraver::acknowledge_element(Score_elem_info i) { - if ( i.elem_l_->is_type_b( Bar::static_name() ) ) { + if ( i.origin_grav_l_arr_.size() > 1 && + i.elem_l_->is_type_b( Bar::static_name() ) ) { bar_l_arr_.push( (Bar*)i.elem_l_->item() ); if (bar_l_arr_.size() >= 2 && !spanbar_p_) { - spanbar_p_ = new Span_bar; + spanbar_p_ = get_span_bar_p(); announce_element( Score_elem_info(spanbar_p_,0) ); } } else if (i.elem_l_->is_type_b( Vertical_align_spanner::static_name() ) diff --git a/lily/span-bar.cc b/lily/span-bar.cc index eed9237f65..61f6b1b4e6 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -6,7 +6,7 @@ (c) 1997 Han-Wen Nienhuys */ - +#include "dimen.hh" #include "span-bar.hh" #include "lookup.hh" #include "symbol.hh" @@ -41,7 +41,16 @@ Span_bar::do_substitute_dependency(Score_elem*o, Score_elem*n) } spanning_l_arr_.substitute( bold , b); +} +/* + A no-op if not yet output: the span_bar slavish follows what it spans + */ +void +Span_bar::translate_y(Real y) +{ + if (status() == OUTPUT) + Score_elem::translate_y(y); } void @@ -51,6 +60,11 @@ Span_bar::set(Vertical_align_element *a) } +Interval +Span_bar::do_width() const +{ + return paper()->lookup_l()->bar(type_str_, 40 PT).dim.x; // ugh +} void Span_bar::do_pre_processing() { @@ -58,7 +72,8 @@ Span_bar::do_pre_processing() transparent_b_ = true; empty_b_ =true; } else { - type_str_ = spanning_l_arr_[0]->type_str_; + if (type_str_ == "") + type_str_ = spanning_l_arr_[0]->type_str_; if (type_str_ =="") { transparent_b_=true; empty_b_ = true; @@ -66,13 +81,19 @@ Span_bar::do_pre_processing() } } +Symbol +Span_bar::get_bar_sym(Real dy) const +{ + return paper()->lookup_l()->bar(type_str_, dy); +} + Molecule* Span_bar::brew_molecule_p()const { Interval y; for (int i=0; i < spanning_l_arr_.size(); i++) y.unite( spanning_l_arr_[i]->height() ); - Symbol s = paper()->lookup_l()->bar(type_str_, y.length()); + Symbol s = get_bar_sym(y.length()); Molecule*output = new Molecule(Atom(s)); output->translate_y ( y[-1] ); diff --git a/lily/span-brace-engraver.cc b/lily/span-brace-engraver.cc deleted file mode 100644 index d1f73147dd..0000000000 --- a/lily/span-brace-engraver.cc +++ /dev/null @@ -1,57 +0,0 @@ -/* - span-brace-engraver.cc -- implement Span_brace_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys - Jan Nieuwenhuizen -*/ - -#include "span-brace-item.hh" -#include "span-brace-engraver.hh" -#include "vertical-align-spanner.hh" - -IMPLEMENT_STATIC_NAME(Span_brace_engraver); -IMPLEMENT_IS_TYPE_B1(Span_brace_engraver,Engraver); -ADD_THIS_ENGRAVER(Span_brace_engraver); - -Span_brace_engraver::Span_brace_engraver() -{ - span_brace_p_ = 0; - valign_l_ = 0; -} - -Span_brace_engraver::~Span_brace_engraver() -{ -} - -void -Span_brace_engraver::acknowledge_element( Score_elem_info i ) -{ - if ( i.elem_l_->is_type_b( Bar::static_name() ) ) { - bar_l_arr_.push( (Bar*)i.elem_l_->item() ); - - if ( bar_l_arr_.size() >= 2 && !span_brace_p_ ) { - span_brace_p_ = new Span_brace_item; - announce_element( Score_elem_info( span_brace_p_, 0 ) ); - } - } - else if ( i.elem_l_->is_type_b( Vertical_align_spanner::static_name() ) - && i.origin_grav_l_arr_.size() <= 2 ) - valign_l_ = (Vertical_align_spanner*)i.elem_l_->spanner(); -} - -void -Span_brace_engraver::do_pre_move_processing() -{ - if ( span_brace_p_ ) { - for ( int i=0; i < bar_l_arr_.size() ; i++ ) - span_brace_p_->add( bar_l_arr_[ i ] ); - span_brace_p_->set( valign_l_ ); - typeset_breakable_item( span_brace_p_ ); - span_brace_p_ = 0; - } - - bar_l_arr_.clear(); -} - diff --git a/lily/span-brace-item.cc b/lily/span-brace-item.cc deleted file mode 100644 index 877914e764..0000000000 --- a/lily/span-brace-item.cc +++ /dev/null @@ -1,85 +0,0 @@ -/* - span-brace-item.cc -- implement Span_brace_item - - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys - Jan Nieuwenhuizen -*/ - -#include "span-brace-item.hh" -#include "lookup.hh" -#include "symbol.hh" -#include "paper-def.hh" -#include "molecule.hh" -#include "vertical-align-elem.hh" - -IMPLEMENT_STATIC_NAME(Span_brace_item); -IMPLEMENT_IS_TYPE_B1( Span_brace_item, Item ); - -void -Span_brace_item::add( Bar* b ) -{ - b->spanned_i_++; - spanning_l_arr_.push( b ); - add_dependency( b ); -} - -void -Span_brace_item::do_substitute_dependency( Score_elem* o, Score_elem* n ) -{ - Bar* bold = 0; - if ( o->is_type_b( Bar::static_name() ) ) - bold = (Bar*)o->item(); - else - return; - - bold->spanned_i_--; - Bar* b = 0; - if ( n && n->is_type_b( Bar::static_name() ) ) { - b = (Bar*)n->item(); - b->spanned_i_++; - } - - spanning_l_arr_.substitute( bold, b ); -} - -void -Span_brace_item::set( Vertical_align_element* a ) -{ - add_dependency( a ); -} - - -void -Span_brace_item::do_pre_processing() -{ - if ( spanning_l_arr_.size () < 1 ) { - transparent_b_ = true; - empty_b_ = true; - } - else { // 0: nobreak, 1: pre, 2: post - empty_b_ = ( break_status_i() != 2 ); - transparent_b_ = ( break_status_i() != 1 ); - } -} - -Molecule* -Span_brace_item::brew_molecule_p() const -{ - Interval y; - for ( int i = 0; i < spanning_l_arr_.size(); i++ ) - y.unite( spanning_l_arr_[ i ]->height() ); - // ugh, one extra staff @ 16pt -// Real length_f = y.length() + spanning_l_arr_[ 0 ]->height().length(); -// Real length_f = y.length() + 16; - Real length_f = y.length() - 6; - Symbol s = paper()->lookup_l()->vbrace( length_f ); - Molecule* mol_p = new Molecule( Atom ( s ) ); -// mol_p->translate_y( - ( length_f + 16 ) / 2 ); - // urgh, what's wrong here? - mol_p->translate_y( - length_f / 2 - 6 ); - - return mol_p; -} - diff --git a/lily/span-score-bar-grav.cc b/lily/span-score-bar-grav.cc new file mode 100644 index 0000000000..9bfe9ef1ce --- /dev/null +++ b/lily/span-score-bar-grav.cc @@ -0,0 +1,30 @@ +/* + span-score-bar-grav.cc -- implement Span_score_bar_engraver and Piano_bar_engraver + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ +#include "span-score-bar.hh" +#include "span-score-bar-grav.hh" + + +Span_bar* +Span_score_bar_engraver::get_span_bar_p() const +{ + return new Span_score_bar; +} + +IMPLEMENT_STATIC_NAME(Span_score_bar_engraver); +IMPLEMENT_IS_TYPE_B1(Span_score_bar_engraver, Span_bar_engraver); +IMPLEMENT_STATIC_NAME(Piano_bar_engraver); +IMPLEMENT_IS_TYPE_B1(Piano_bar_engraver, Span_score_bar_engraver); + +Span_bar* +Piano_bar_engraver::get_span_bar_p() const +{ + return new Piano_brace; +} + +ADD_THIS_ENGRAVER(Piano_bar_engraver); +ADD_THIS_ENGRAVER(Span_score_bar_engraver); diff --git a/lily/span-score-bar.cc b/lily/span-score-bar.cc new file mode 100644 index 0000000000..9ee958ae46 --- /dev/null +++ b/lily/span-score-bar.cc @@ -0,0 +1,45 @@ +/* + span-score-bar.cc -- implement Span_score_bar + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "span-score-bar.hh" +#include "symbol.hh" +#include "paper-def.hh" +#include "lookup.hh" + +Span_score_bar::Span_score_bar() +{ + type_str_ = "|"; +} + +void +Span_score_bar::do_pre_processing() +{ + Span_bar::do_pre_processing(); + + if ( break_status_i() != 1) { + empty_b_ = transparent_b_ = true; + } +} + + +Symbol +Piano_brace::get_bar_sym(Real dy)const +{ + return paper()->lookup_l()->vbrace(dy); +} +Interval +Piano_brace::do_width()const +{ + return Interval(0,0); +} + +IMPLEMENT_STATIC_NAME(Span_score_bar); +IMPLEMENT_IS_TYPE_B1(Span_score_bar, Span_bar); +IMPLEMENT_IS_TYPE_B1(Piano_brace, Span_score_bar); +IMPLEMENT_STATIC_NAME(Piano_brace); + diff --git a/lily/spanner.cc b/lily/spanner.cc index 5cc28a1bd9..eb6d16f6fd 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -100,8 +100,8 @@ Spanner::Spanner() Interval Spanner::do_width()const { - Real r = right_col_l_->hpos; - Real l = left_col_l_->hpos; + Real r = right_col_l_->hpos_f_; + Real l = left_col_l_->hpos_f_; assert(*left_col_l_ < *right_col_l_); assert(r>=l); diff --git a/lily/spring-spacer.cc b/lily/spring-spacer.cc new file mode 100644 index 0000000000..0804161edd --- /dev/null +++ b/lily/spring-spacer.cc @@ -0,0 +1,581 @@ +/* + spring-spacer.cc -- implement Spring_spacer + + source file of the GNU LilyPond music typesetter + + (c) 1996,1997 Han-Wen Nienhuys +*/ + + +#include +#include "spring-spacer.hh" +#include "p-col.hh" +#include "debug.hh" +#include "qlp.hh" +#include "unionfind.hh" +#include "idealspacing.hh" +#include "pointer.tcc" +#include "score-column.hh" +#include "paper-def.hh" +#include "dimen.hh" +#include "minterval.hh" + +Vector +Spring_spacer::default_solution()const +{ + return try_initial_solution() ; +} + +Score_column* +Spring_spacer::scol_l(int i) +{ + return (Score_column*)cols[i].pcol_l_; +} + +const Real COLFUDGE=1e-3; +template class P; // ugh. + +bool +Spring_spacer::contains(PCol const *w) +{ + for (int i=0; i< cols.size(); i++) + if (cols[i].pcol_l_ == w) + return true; + return false; +} + + +void +Spring_spacer::OK() const +{ +#ifndef NDEBUG + for (int i = 1; i < cols.size(); i++) + assert(cols[i].rank_i_ > cols[i-1].rank_i_); + for (int i = 1; i < loose_col_arr_.size(); i++) + assert(loose_col_arr_[i].rank_i_ > loose_col_arr_[i-1].rank_i_); +#endif +} + +/** + Make sure no unconnected columns happen. + */ +void +Spring_spacer::handle_loose_cols() +{ + Union_find connected(cols.size()); + Array fixed; + for (PCursor i(ideal_p_list_.top()); i.ok(); i++){ + connected.connect(i->left_i_,i->right_i_); + } + for (int i = 0; i < cols.size(); i++) + if (cols[i].fixed()) + fixed.push(i); + for (int i=1; i < fixed.size(); i++) + connected.connect(fixed[i-1], fixed[i]); + + for (int i = cols.size(); i--; ) { + if (! connected.equiv(fixed[0], i)) { + warning("unconnected column: " + String(i)); + loosen_column(i); + } + } + OK(); +} + + +/** + Guess a stupid position for loose columns. Put loose columns at + regular distances from enclosing calced columns + */ +void +Spring_spacer::position_loose_cols(Vector &sol_vec)const +{ + if (!loose_col_arr_.size()) + return ; + assert(sol_vec.dim()); + Array fix_b_arr; + fix_b_arr.set_size(cols.size() + loose_col_arr_.size()); + Real utter_right_f=-INFTY; + Real utter_left_f =INFTY; + for (int i=0; i < loose_col_arr_.size(); i++) { + fix_b_arr[loose_col_arr_[i].rank_i_] = false; + } + for (int i=0; i < cols.size(); i++) { + int r= cols[i].rank_i_; + fix_b_arr[r] = true; + utter_right_f = utter_right_f >? sol_vec(i); + utter_left_f = utter_left_f 0) ?sol_vec(j-1) : utter_left_f; + Real right_pos_f = + (j < sol_vec.dim()) ? sol_vec(j) : utter_right_f; + int left_rank = (j>0) ? cols[j-1].rank_i_ : 0; + int right_rank = (j left_rank && r < right_rank); + + v(i) = (r - left_rank)*left_pos_f/ d_r + + (right_rank - r) *right_pos_f /d_r; + } + } + sol_vec = v; +} + +bool +Spring_spacer::check_constraints(Vector v) const +{ + int dim=v.dim(); + assert(dim == cols.size()); + + for (int i=0; i < dim; i++) { + + if (cols[i].fixed()&& + abs(cols[i].fixed_position() - v(i)) > COLFUDGE) + return false; + + if (!i) + continue; + + Real mindist=cols[i-1].minright() + +cols[i].minleft(); + + // ugh... compares + Real dif =v(i) - v(i-1)- mindist; + bool b = (dif > - COLFUDGE); + + + if (!b) + return false; + + } + return true; +} + +bool +Spring_spacer::check_feasible() const +{ + Vector sol(try_initial_solution()); + return check_constraints(sol); +} + +/// generate a solution which obeys the min distances and fixed positions +Vector +Spring_spacer::try_initial_solution() const +{ + int dim=cols.size(); + Vector initsol(dim); + for (int i=0; i < dim; i++) { + if (cols[i].fixed()) { + initsol(i)=cols[i].fixed_position(); + + if (i > 0) { + Real r =initsol(i-1) + cols[i-1].minright(); + if (initsol(i) < r ) { + warning("overriding fixed position"); + initsol(i) =r; + } + } + + } else { + Real mindist=cols[i-1].minright() + +cols[i].minleft(); + if (mindist < 0.0) + warning("Excentric column"); + initsol(i)=initsol(i-1)+mindist; + } + } + + return initsol; +} + + + +Vector +Spring_spacer::find_initial_solution() const +{ + Vector v(try_initial_solution()); + assert(check_constraints(v)); + return v; +} + +// generate the matrices +void +Spring_spacer::make_matrices(Matrix &quad, Vector &lin, Real &c) const +{ + quad.fill(0); + lin.fill(0); + c = 0; + + for (PCursor i(ideal_p_list_.top()); i.ok(); i++) { + int l = i->left_i_; + int r = i->right_i_; + + quad(r,r) += i->hooke_f_; + quad(r,l) -= i->hooke_f_; + quad(l,r) -= i->hooke_f_; + quad(l,l) += i->hooke_f_; + + lin(r) -= i->space_f_*i->hooke_f_; + lin(l) += i->space_f_*i->hooke_f_; + + c += sqr(i->space_f_); + } +} + +// put the constraints into the LP problem +void +Spring_spacer::make_constraints(Mixed_qp& lp) const +{ + int dim=cols.size(); + for (int j=0; j < dim; j++) { + Colinfo c=cols[j]; + if (c.fixed()) { + lp.add_fixed_var(j,c.fixed_position()); + } + if (j > 0){ + Vector c1(dim); + + c1(j)=1.0 ; + c1(j-1)=-1.0 ; + lp.add_inequality_cons(c1, cols[j-1].minright() + + cols[j].minleft()); + } + } +} + +Array +Spring_spacer::solve() const +{ + assert(check_feasible()); + + Mixed_qp lp(cols.size()); + make_matrices(lp.quad,lp.lin, lp.const_term); + make_constraints(lp); + Vector start=find_initial_solution(); + Vector sol(lp.solve(start)); + if (!check_constraints(sol)) { + WARN << "solution doesn't satisfy constraints.\n" ; + } + Real energy_f =lp.eval(sol); + position_loose_cols(sol); + + Array posns(sol); + + posns.push(energy_f); + return posns; +} + +/** + add one column to the problem. +*/ +void +Spring_spacer::add_column(PCol *col, bool fixed, Real fixpos) +{ + Colinfo c(col,(fixed)? &fixpos : 0); + if (cols.size()) + c.rank_i_ = cols.top().rank_i_+1; + else + c.rank_i_ = 0; + cols.push(c); +} + +Array +Spring_spacer::error_pcol_l_arr()const +{ + Array retval; + for (int i=0; i< cols.size(); i++) + if (cols[i].ugh_b_) + retval.push(cols[i].pcol_l_); + for (int i=0; i < loose_col_arr_.size(); i++) { + retval.push(loose_col_arr_[i].pcol_l_); + } + return retval; +} + +void +Spring_spacer::loosen_column(int i) +{ + Colinfo c=cols.get(i); + for (PCursor j(ideal_p_list_.top()); j.ok(); j++){ + if (j->left_i_ == i|| j->right_i_ == i) + j.del(); + else + j++; + } + c.ugh_b_ = true; + + int j=0; + for (; j < loose_col_arr_.size(); j++) { + if (loose_col_arr_[j].rank_i_ > c.rank_i_) + break; + } + loose_col_arr_.insert(c,j); +} + + +void +Spring_spacer::print() const +{ +#ifndef NPRINT + for (int i=0; i < cols.size(); i++) { + mtor << "col " << i<<' '; + cols[i].print(); + } + for (PCursor i(ideal_p_list_.top()); i.ok(); i++){ + i->print(); + } +#endif + +} + + +void +Spring_spacer::connect(int i, int j, Real d, Real h) +{ + Idealspacing * s = new Idealspacing; + s->left_i_ = i; + s->right_i_ = j; + s->space_f_ = d; + s->hooke_f_ = h; + + ideal_p_list_.bottom().add(s); +} + +/** + walk through all durations in all Score_columns + */ +struct Durations_iter +{ + Spring_spacer * sp_l_; + int col_i_; + int d_i_; + + Durations_iter(Spring_spacer*); + + Moment duration()const; + Moment when()const; + + bool ok()const; + void next(); +}; + +Durations_iter::Durations_iter(Spring_spacer * s) +{ + col_i_ =0; + d_i_ =0; // ugh + + sp_l_ = s; + if (! sp_l_->scol_l(col_i_)->durations.size() ) + next(); +} + +Moment +Durations_iter::duration() const +{ + return sp_l_->scol_l(col_i_)->durations[d_i_]; +} + +bool +Durations_iter::ok()const{ + return col_i_ < sp_l_->cols.size(); +} + +Moment +Durations_iter::when()const{ + return sp_l_->scol_l(col_i_)->when(); +} + +void +Durations_iter::next() +{ + d_i_ ++; + while ( col_i_ < sp_l_->cols.size() + && d_i_ >= sp_l_->scol_l(col_i_)->durations.size()){ + col_i_ ++; + d_i_ =0; + } +} + + +/** + generate springs between columns. + + UNDER DESTRUCTION + + TODO: This needs rethinking. Spacing should take optical + effects into account, and should be local (measure wide) + + The algorithm is taken from : + + John S. Gourlay. ``Spacing a Line of Music,'' Technical Report + OSU-CISRC-10/87-TR35, Department of Computer and Information + Science, The Ohio State University, 1987. + + */ +void +Spring_spacer::calc_idealspacing() +{ + + for (int i=0; i < cols.size(); i++) + scol_l(i)->preprocess(); + + /* get the shortest running note at a time. */ + Array shortest_arr_; + { + Durations_iter d_iter(this); + for (int i=0; i < cols.size(); i++) { + Moment now = scol_l(i)->when(); + while ( d_iter.ok() && now >= d_iter.when() ) { + if ( now < d_iter.when() + d_iter.duration()) + break; + d_iter.next(); + } + if ( d_iter.ok() && now >= d_iter.when()) { + Durations_iter d2 = d_iter; + Moment shortest = INFTY; + while (d2.ok() && d2.when() <= now) { + shortest = shortest ideal_arr_; + Array hooke_arr_; + for (int i=0; i < cols.size(); i++){ + ideal_arr_.push( -1.0); + hooke_arr_.push(1.0); + } + + for (int i=0; i < cols.size(); i++) { + if ( !scol_l(i)->musical_b()) { + ideal_arr_[i] = cols[i].minright() + 2 PT; + hooke_arr_[i] = 2.0; + if (i+1 < cols.size()) { + Moment delta_t = scol_l(i+1)->when() - scol_l(i)->when() ; + Real dist = delta_t ? paper_l()->duration_to_dist(delta_t) : 0; + if (delta_t && dist > ideal_arr_[i]) + ideal_arr_[i] = dist; + } + } + } + for (int i=0; i < cols.size(); i++) { + if (scol_l(i)->musical_b()) { + Moment shortest_len = shortest_arr_[i]; + if ( ! shortest_len ) { + warning( "Can't find a ruling note at " + +String( scol_l(i)->when())); + shortest_len = 1; + } + Moment delta_t = scol_l(i+1)->when() - scol_l(i)->when(); + Real dist = paper_l()->duration_to_dist(shortest_len); + dist *= delta_t / shortest_len; + if (!scol_l(i+1)->musical_b() ) { + + if (ideal_arr_[i+1] + cols[i+1].minleft() < dist) { + ideal_arr_[i+1] = dist/2 + cols[i+1].minleft(); + hooke_arr_[i+1] =1.0; + } + ideal_arr_[i] = dist/2; + } else + ideal_arr_[i] = dist; + } + } + + for (int i=0; i < ideal_arr_.size()-1; i++) { + assert (ideal_arr_[i] >=0 && hooke_arr_[i] >=0); + connect(i, i+1, ideal_arr_[i], hooke_arr_[i]); + } + +} + + + +void +Spring_spacer::prepare() +{ + calc_idealspacing(); + handle_loose_cols(); + print(); +} + +Line_spacer* +Spring_spacer::constructor() +{ + return new Spring_spacer; +} + +#if 0 +void obsolete() +{ + for (int i=0; i < cols.size(); i++) { + if (!scol_l(i)->used_b()) + continue; + + + int j = i+1; + + if (scol_l(i)->musical_b()) { + assert ( j < cols.size()); + + for (int n=0; n < scol_l(i)->durations.size(); n++) { + Moment d = scol_l(i)->durations[n]; + Real dist = paper_l()->duration_to_dist(d); + Real strength = scol_l(i)->durations[0]/scol_l(i)->durations[n]; + assert(strength <= 1.0); + + while (j < cols.size()) { + if (scol_l(j)->used_b() + && scol_l(j)->when() >= d + scol_l(i)->when() ) + break; + j++; + } + if ( j < cols.size() ){ + Moment delta_desired = scol_l(j)->when() - (d+scol_l(i)->when()); + dist += paper_l()->duration_to_dist(delta_desired); + if (scol_l(j)->musical_b()) { + dist += cols[j].minleft() + 2 PT; + } + connect(i, j, dist, strength); + } + } + } else if (j < cols.size()) { + while (!scol_l(j)->used_b()) + j++; + + /* attach i to the next column in use. This exists, since + the last col is breakable, and therefore in use + */ + + Moment d = scol_l(j)->when() - scol_l(i)->when(); + Real minimal_f = cols[i].minright() +cols[j].minleft() + 2 PT; + Real durdist_f = (d) ? paper_l()->duration_to_dist(d) : 0; // todo + + connect(i, j, minimal_f add_element(elem.elem_l_); } -void -Staff_engravers::typeset_breakable_item( Item * nobreak_p) -{ - staff_elem_l_arr_.push(nobreak_p); - Engraver_group_engraver::typeset_breakable_item(nobreak_p); -} - -void -Staff_engravers::do_pre_move_processing() -{ - Engraver_group_engraver::do_pre_move_processing(); - group_staff_elems(); -} - -void -Staff_engravers::group_staff_elems() -{ - for (int i=0; i add_element(staff_elem_l_arr_[i]); - staff_elem_l_arr_.set_size(0); -} void -Staff_engravers::do_removal_processing() +Line_group_engraver::do_removal_processing() { - /* this is a "destructor type function", first do children, then self. */ - Engraver_group_engraver::do_removal_processing(); - group_staff_elems(); - staffline_p_->right_col_l_ = get_staff_info().command_pcol_l(); - Engraver::typeset_element(staffline_p_); + typeset_element(staffline_p_); staffline_p_ = 0; } void -Staff_engravers::do_creation_processing() +Line_group_engraver::do_creation_processing() { staffline_p_ = new Line_of_staff; staffline_p_->left_col_l_ = get_staff_info().command_pcol_l(); // don't broadcast to self. - Engraver::announce_element(Score_elem_info(staffline_p_,0)); - Engraver_group_engraver::do_creation_processing(); + announce_element(Score_elem_info(staffline_p_,0)); } -IMPLEMENT_STATIC_NAME(Staff_engravers); -IMPLEMENT_IS_TYPE_B1(Staff_engravers,Engraver_group_engraver); -ADD_THIS_ENGRAVER(Staff_engravers); +IMPLEMENT_STATIC_NAME(Line_group_engraver); +IMPLEMENT_IS_TYPE_B1(Line_group_engraver,Engraver); +ADD_THIS_ENGRAVER(Line_group_engraver); diff --git a/lily/staff-info.cc b/lily/staff-info.cc index 250d3273d6..6159758077 100644 --- a/lily/staff-info.cc +++ b/lily/staff-info.cc @@ -36,15 +36,17 @@ Staff_info::command_l() { return command_l_; } + PCol* Staff_info::command_pcol_l() { - return command_l()->pcol_l_; + return command_l(); } + PCol* Staff_info::musical_pcol_l() { - return musical_l()->pcol_l_; + return musical_l(); } Moment diff --git a/lily/stem-beam-grav.cc b/lily/stem-beam-grav.cc index b476406a3c..a5cb842cbb 100644 --- a/lily/stem-beam-grav.cc +++ b/lily/stem-beam-grav.cc @@ -84,8 +84,10 @@ Stem_beam_engraver::do_process_requests() defp->text_str_ = beam_req_l_->nplet; defp->style_str_="italic"; t->spec_p_ = defp; + announce_element(Score_elem_info(t,0)); typeset_element(t); } + announce_element ( Score_elem_info(beam_p_, 0)); } } diff --git a/lily/swallow-perf.cc b/lily/swallow-perf.cc new file mode 100644 index 0000000000..7bdb355adc --- /dev/null +++ b/lily/swallow-perf.cc @@ -0,0 +1,13 @@ +/* + swallow-perf.cc -- implement Swallow_performer + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "swallow-perf.hh" + +IMPLEMENT_STATIC_NAME(Swallow_performer); +IMPLEMENT_IS_TYPE_B1(Swallow_performer, Performer); +ADD_THIS_PERFORMER(Swallow_performer); diff --git a/lily/translator.cc b/lily/translator.cc index 66ac05c5d8..06e30c21e9 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -7,6 +7,7 @@ */ #include "translator.hh" + Translator::Translator() { iterator_count_ = 0; @@ -20,3 +21,10 @@ Translator::try_request(Request*) { return false; } + + +void +Translator::print()const +{ + +} diff --git a/lily/vertical-align-grav.cc b/lily/vertical-align-grav.cc index 86665f3d50..6eb56a4dff 100644 --- a/lily/vertical-align-grav.cc +++ b/lily/vertical-align-grav.cc @@ -36,8 +36,8 @@ Vertical_align_engraver::acknowledge_element(Score_elem_info i) { if ( i.origin_grav_l_arr_.size() == 2 && i.elem_l_->is_type_b(Vertical_group::static_name()) && - !i.elem_l_->y_group_element_i_ && - !valign_p_->contains_b( i.elem_l_) ) { + !i.elem_l_->y_group_element_i_ ) { + assert( !valign_p_->contains_b( i.elem_l_) ); valign_p_->add ( i.elem_l_ ); } diff --git a/lily/wordwrap.cc b/lily/wordwrap.cc index 5aefed16f3..8653c071e9 100644 --- a/lily/wordwrap.cc +++ b/lily/wordwrap.cc @@ -6,21 +6,24 @@ (c) 1997 Han-Wen Nienhuys */ -#include "break.hh" +#include "word-wrap.hh" #include "p-score.hh" #include "debug.hh" #include "p-col.hh" +#include "spring-spacer.hh" + + /** el stupido. This should be done more accurately: It would be nice to have a Dynamic Programming type of algorithm similar to TeX's - */ + */ Array Word_wrap::do_solve()const { problem_OK(); - iter_top(pscore_.cols,curcol); + iter_top(pscore_l_->col_p_list_,curcol); Array breaking; Line_of_cols breakpoints(find_breaks()); assert(breakpoints.size()>=2); @@ -87,4 +90,5 @@ Word_wrap::do_solve()const Word_wrap::Word_wrap(PScore&ps) : Break_algorithm(ps) { + get_line_spacer = Spring_spacer::constructor; } diff --git a/make/Makefile b/make/Makefile index 95dd3acafe..804cad1e9b 100644 --- a/make/Makefile +++ b/make/Makefile @@ -40,13 +40,16 @@ include ./$(depth)/make/Rules.make spec: $(outdir)/lilypond.spec -rpmdocs=$(addprefix Documentation/out/, $(notdir $(shell ls $(depth)/Documentation/$(outdir)/*.text))) +rpmdocs=$(addprefix Documentation/out/, $(notdir $(shell ls $(depth)/Documentation/$(outdir)/*.text)))\ + BUGS TODO NEWS DEDICATION ANNOUNCE README +rpmmudocs=$(addprefix Documentation/out/, $(notdir $(shell ls $(depth)/Documentation/*.doc))) +rpmdvis=$(rpmmudocs:.doc=.dvi) rpmexamples= $(addprefix input/, $(notdir $(shell ls $(depth)/input/*.{ly,tex}))) sed-version= sed 's!@TOPLEVEL_VERSION@!${TOPLEVEL_VERSION}!g' sed-date=sed 's!@DATE@!${date}!g' -sed-examples = sed 's!@EXAMPLE_LYS@!${rpmexamples}!g' +sed-examples = sed 's!@EXAMPLE_LYS@!${rpmexamples} ${rpmdvis}!g' sed-docs=sed 's!@TEXT_DOCS@!${rpmdocs}!g' $(outdir)/lilypond.spec: lilypond.spec.in $(depth)/.version diff --git a/make/Rules.make b/make/Rules.make index d9e51b11c0..23fee6acc0 100644 --- a/make/Rules.make +++ b/make/Rules.make @@ -78,3 +78,14 @@ $(depth)/%.text: check-doc-deps $(outdir)/%.xpm: %.gif giftopnm $< | ppmtoxpm > $@ + +$(outdir)/%.ps: $(outdir)/%.dvi + dvips -o $@ $< + +$(outdir)/%.dvi: $(outdir)/%.mudtex + latex '\batchmode \input $<' + +$(outdir)/%.mudtex: %.doc + $(depth)/bin/mudela-book --outdir=$(outdir)/ --outname=$(notdir $@) $< + + diff --git a/make/Targets.make b/make/Targets.make index 1795fd7a41..a564a1f91c 100644 --- a/make/Targets.make +++ b/make/Targets.make @@ -180,7 +180,7 @@ endif # $(outdir)/version.hh: .version - ./$(lily_bindir)/make_version > $@ + ./$(lily_bindir)/make-version > $@ # should this be in Rules? diff --git a/make/Toplevel.make.in b/make/Toplevel.make.in index b4949cdb0f..d16767ea68 100644 --- a/make/Toplevel.make.in +++ b/make/Toplevel.make.in @@ -26,14 +26,14 @@ include ./$(depth)/make/Variables.make # descent order into subdirectories: # -SUBDIRS = mf flower lib lily mi2mu \ +SUBDIRS = flower lib lily mi2mu \ Documentation bin init input tex make # # list of distribution files: # SCRIPTS = configure configure.in install-sh -README_FILES = ANNOUNCE COPYING NEWS README TODO INSTALL.text AUTHORS.text +README_FILES = BUGS DEDICATION ANNOUNCE COPYING NEWS README TODO INSTALL.text AUTHORS.text EXTRA_DISTFILES= .dstreamrc .version $(README_FILES) $(SCRIPTS) $(SYMLINKS) # do not dist ./Makefile (is copied from make/Toplevel.make) diff --git a/make/lilypond.lsm b/make/lilypond.lsm index 3105802e7e..1b55b27d71 100644 --- a/make/lilypond.lsm +++ b/make/lilypond.lsm @@ -1,11 +1,11 @@ -[This lsm-entry is not in the LSM yet.] - Begin3 Title: LilyPond -Version: 0.0.75 -Entered-date: 07/22/97 -Description: LilyPond is a program which converts a music-script (mudela) into -TeX output, or MIDI to produce multi-staff scores. Features include multiple +Version: 0.0.76 +Entered-date: 07/28/97 +Description: +GNU LilyPond which converts music definition files into visual or +audio output: it can typeset formatted sheet music to a TeX file and +and (mechanical) performances to MIDI files. Features include multiple meters, clefs, keys, lyrics, versatile input-language, cadenzas beams, slurs, triplets. Keywords: music typesetting midi notation @@ -13,9 +13,9 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys) jan@digicash.com (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: pcnov095.win.tue.nl /pub/lilypond/ - 300k lilypond-0.0.75.tar.gz -Alternate-site: + 340k lilypond-0.0.76.tar.gz +Alternate-site: prep.ai.gnu.mit.edu /pub/gnu Original-site: -Platform: unix/win32, GNU C++ +Platform: Unix/win32, GNU C++ Copying-policy: GPL End diff --git a/make/lilypond.lsm.in b/make/lilypond.lsm.in index 47222cc126..b9a6613f05 100644 --- a/make/lilypond.lsm.in +++ b/make/lilypond.lsm.in @@ -1,11 +1,11 @@ -[This lsm-entry is not in the LSM yet.] - Begin3 Title: LilyPond Version: @TOPLEVEL_VERSION@ Entered-date: @DATE@ -Description: LilyPond is a program which converts a music-script (mudela) into -TeX output, or MIDI to produce multi-staff scores. Features include multiple +Description: +GNU LilyPond which converts music definition files into visual or +audio output: it can typeset formatted sheet music to a TeX file and +and (mechanical) performances to MIDI files. Features include multiple meters, clefs, keys, lyrics, versatile input-language, cadenzas beams, slurs, triplets. Keywords: music typesetting midi notation @@ -13,9 +13,9 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys) jan@digicash.com (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: pcnov095.win.tue.nl /pub/lilypond/ - 300k lilypond-@TOPLEVEL_VERSION@.tar.gz -Alternate-site: + 340k lilypond-@TOPLEVEL_VERSION@.tar.gz +Alternate-site: prep.ai.gnu.mit.edu /pub/gnu Original-site: -Platform: unix/win32, GNU C++ +Platform: Unix/win32, GNU C++ Copying-policy: GPL End diff --git a/make/lilypond.spec b/make/lilypond.spec index 91029f1173..6e271cb108 100644 --- a/make/lilypond.spec +++ b/make/lilypond.spec @@ -1,21 +1,21 @@ Name: lilypond -Version: 0.0.75 +Version: 0.0.76 Release: 1 Copyright: GPL Group: Applications/Publishing -Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.75.tar.gz +Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-0.0.76.tar.gz Summary: A preprocessor to make TeX typeset music. URL: http://www.stack.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys -Icon: lelie_icon.xpm +Icon: lelie_icon.gif Buildroot: /tmp/lilypond_build %description -GNU LilyPond is a program which converts a music-script -(mudela) into TeX output, or MIDI to produce multi-staff -scores. Features include multiple meters, clefs, keys, lyrics, -versatile input-language, cadenzas beams, slurs, triplets, multiple -voices. +GNU LilyPond which converts music definition files into visual or +audio output: it can typeset formatted sheet music to a TeX file and +and (mechanical) performances to MIDI files. Features include multiple +meters, clefs, keys, lyrics, versatile input-language, cadenzas +beams, slurs, triplets. %prep %setup @@ -27,18 +27,17 @@ rm -rf $RPM_BUILD_ROOT strip lily/out/lilypond mi2mu/out/mi2mu make prefix="$RPM_BUILD_ROOT/usr" install %files -%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/error.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/language.text Documentation/out/lilygut.text Documentation/out/lilyliterature.text Documentation/out/lilypond.text Documentation/out/mi2mu.text Documentation/out/mudela.text Documentation/out/other-packages.text input/beams.ly input/book.ly input/book.tex input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/error.ly input/header.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/slurs.ly input/standchen.ly input/standchen.tex input/toccata-fuga-E.ly input/twinkle.ly input/wohltemperirt.ly Documentation/lelie_logo.gif +%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/error.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/language.text Documentation/out/lilygut.text Documentation/out/lilyliterature.text Documentation/out/lilypond.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/error.ly input/header.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/slurs.ly input/standchen.ly input/standchen.tex input/toccata-fuga-E.ly input/twinkle.ly input/wohltemperirt.ly Documentation/out/mudela-course.dvi Documentation/out/mudela-man.dvi Documentation/lelie_logo.gif /usr/bin/convert-mudela +/usr/bin/mudela-book /usr/bin/lilypond /usr/lib/libflower.so /usr/bin/mi2mu /usr/man/man1/mi2mu.1 /usr/man/man1/lilypond.1 -/usr/man/man5/mudela.5 +/usr/man/man1/mudela-book.1 /usr/man/man1/convert-mudela.1 /usr/lib/texmf/texmf/tex/lilypond/ -/usr/lib/texmf/texmf/fonts/source/lilypond/ /usr/share/lilypond/ %post -echo please run texhash to update TeX directory listings 1>&2 diff --git a/make/lilypond.spec.in b/make/lilypond.spec.in index 76b484ae60..5cab6df5a7 100644 --- a/make/lilypond.spec.in +++ b/make/lilypond.spec.in @@ -7,15 +7,15 @@ Source0: pcnov095.win.tue.nl:/pub/lilypond/lilypond-@TOPLEVEL_VERSION@.tar.gz Summary: A preprocessor to make TeX typeset music. URL: http://www.stack.nl/~hanwen/lilypond Packager: Han-Wen Nienhuys -Icon: lelie_icon.xpm +Icon: lelie_icon.gif Buildroot: /tmp/lilypond_build %description -GNU LilyPond is a program which converts a music-script -(mudela) into TeX output, or MIDI to produce multi-staff -scores. Features include multiple meters, clefs, keys, lyrics, -versatile input-language, cadenzas beams, slurs, triplets, multiple -voices. +GNU LilyPond which converts music definition files into visual or +audio output: it can typeset formatted sheet music to a TeX file and +and (mechanical) performances to MIDI files. Features include multiple +meters, clefs, keys, lyrics, versatile input-language, cadenzas +beams, slurs, triplets. %prep %setup @@ -29,16 +29,15 @@ make prefix="$RPM_BUILD_ROOT/usr" install %files %doc @TEXT_DOCS@ @EXAMPLE_LYS@ Documentation/lelie_logo.gif /usr/bin/convert-mudela +/usr/bin/mudela-book /usr/bin/lilypond /usr/lib/libflower.so /usr/bin/mi2mu /usr/man/man1/mi2mu.1 /usr/man/man1/lilypond.1 -/usr/man/man5/mudela.5 +/usr/man/man1/mudela-book.1 /usr/man/man1/convert-mudela.1 /usr/lib/texmf/texmf/tex/lilypond/ -/usr/lib/texmf/texmf/fonts/source/lilypond/ /usr/share/lilypond/ %post -echo please run texhash to update TeX directory listings 1>&2 diff --git a/mf/Makefile b/mf/Makefile deleted file mode 100644 index 48682ab497..0000000000 --- a/mf/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# -# project LilyPond -- the musical typesetter -# title makefile for yet to add in MF files -# file ../Makefile -# -# Copyright (c) 1997 by -# Jan Nieuwenhuizen -# Han-Wen Nienhuys -# - -# subdir level: -# -depth = .. -# - -# generic variables: -# -include ./$(depth)/make/Variables.make - -include ./$(depth)/.version - -# descent order into subdirectories: -# -SUBDIRS = -# - -# -include ./$(depth)/make/Files.make -MFFILES:=$(wildcard *.mf) - -EXTRA_DISTFILES = $(MFFILES) README - - -# list of custom libraries: -# -CUSTOMLIBES = \ - -LOADLIBES += -# - -# main target of this module: -# -MAINTARGET = - -default: $(MAINTARGET) -# - -# generic targets and rules: -# -include ./$(depth)/make/Targets.make -include ./$(depth)/make/Rules.make -# - -lily-mfdir = $(MFDIR)/lilypond - -localinstall: - $(INSTALL) -d $(lily-mfdir) - $(INSTALL) -m 644 $(MFFILES) $(lily-mfdir) - -localuninstall: - for i in $(MFFILES); do rm -f $(lily-mfdir)/$$i; done - -rmdir $(lily-mfdir) diff --git a/mf/README b/mf/README deleted file mode 100644 index 98ec47cec3..0000000000 --- a/mf/README +++ /dev/null @@ -1,43 +0,0 @@ -This is from the package MusixTeX, version T.73 (Taupin version.) - -The documentation states: - - \begin{center} - - Although one of the authors contested that point once the - common work had begun, \musixtex{} may be freely copied, - duplicated and used. However, since it is intended to be a - \ital{freeware} you are not allowed to sell it, and the fee - you may ask for distributing it must be limited to - maintenance, support and duplication costs. You may take parts - of it to include in other packages, but no packages called - \musixtex{} may be distributed under this name if different - from the original distribution (except obvious bug corrections - or text font adaptations for specific implementations). - - \musixtex{} may be included in further commercial packages, - provided that no fee is charged for \musixtex{} itself. - - \end{center} - - -A part (the fonts) are included in this package, which is not called -\musixtex, so this not a copyright infringement. - - -MusixTeX is copyright 19?? by: - - Daniel Taupin, - - Laboratoire de Physique des Solides (associ\'e au CNRS), - b\^atiment 510, Centre Universitaire, F-91405 ORSAY Cedex - - - Ross Mitchell - - CSIRO Division of Atmospheric Research, Private Bag No.1, - Mordialloc, Victoria 3195, Australia - - Andreas Egler - - (Ruhr--Uni--Bochum) Ursulastr. 32 D-44793 Bochum diff --git a/mf/musexgen.mf b/mf/musexgen.mf deleted file mode 100644 index 1b73e01bd8..0000000000 --- a/mf/musexgen.mf +++ /dev/null @@ -1,194 +0,0 @@ -% this is musexgen.mf - -% Here are two types of pianobrackets available, they are absolute compatible, -% so choose this one you prefer (search for '%!!!') - -path p; -picture save_pic; - -pen thin_pen, med_pen; -thin_pen:= pencircle scaled max(1,.2pt+blacker); -med_pen:= pencircle scaled med; - -%%%%%%% -message (""); -%%%%%%% - -firstbrace:=20; % smallest brace is 2*20 pt (\simeq 14mm) -lastbrace:=67; % largest brace is 2*67 pt (\simeq 47mm) - -%%% from Stanislav Kneifl - -def drawpianobracket (expr height) = - u# := 1nhh#/5pt# * 1pt#; - v# := (height/40) * 1pt#; - define_pixels (u, v); -% beginchar (height-firstbrace, 1.25nhh#, 0, 0); - beginchar (height-firstbrace, 0, 0, 0); - z1 = origin; - z2 = (4.7u, 7v); - z3 = (3.6u, 16.5v); - z4 = (1.9u, 25v); - z5 = (2.28u, 32v); - z6 = (w, 40v); - penpos1 (max(1,0.1u), 125); - penpos2 (1.2u, 180); - penpos3 (3.2u, 195); - penpos4 (2.5u, 180); - penpos5 (1.14u, 180); - penpos6 (max(2,0.3u), 150); - penstroke z1e{dir 35}..z2e..z3e..z4e..z5e..{dir 60}z6e; - currenttransform := identity reflectedabout ((0,0),(1,0)); - penstroke z1e{dir 35}..z2e..z3e..z4e..z5e..{dir 60}z6e; - currenttransform := identity; -% inserted - currentpicture:=currentpicture shifted (round(-1.75nhh), 0); -% - endchar; -enddef; - -def bigbrace(expr v) = - beginchar (v-firstbrace, 0, 0, 0); - " brace vsize "&decimal round(2v*pt#)&"pt"; - vwidth:=v*pt; - hwidth:=max(.1vwidth,3.25pt); - hwidth:=min(hwidth,6.5pt); - actwidth:=.035vwidth; - x1=.25nhw; y1=vwidth; - x2l=-.8hwidth; y2=2/3vwidth; - x3r=.2hwidth; y3=1/3vwidth; - x4=-hwidth; y4=0; - penpos1(max(1,.25pt),-35); - penpos2(1.5med+actwidth,40); - penpos3(1.75med+actwidth,45); - penpos4(max(1,.2pt),-90); - penstroke z1e..z2e..z3e..{left+sw}z4e; - currentpen:= pencircle; draw z1..z2..z3..{left+sw}z4; - addto currentpicture also currentpicture reflectedabout (origin, right); - penlabels(1,2,3,4); - currentpicture:= currentpicture shifted (round(-.75nhh), 0); - endchar; -enddef; - -%!!! comment the line 'bigbrace' and uncomment the line 'drawpianobracket' -% or leave it like it is !!! - -for v=firstbrace upto lastbrace : - bigbrace (v); -% drawpianobracket (v); -endfor; - -%%%%%%% -message (""); -%%%%%%% -% glissando{slide} (slope [degree]) - -def glissando (expr theta)= - x1=-1; y1=0; z2=z1+(.5nhw,0); z3=z1+(nhw+1,0); - p:= z1{1.25up+right}..{1.25down+right}z2{1.25down+right}..{1.25up+right}z3; - pickup penrazor scaled (.075nhw+thick) rotated (theta+65); - draw p rotated theta; - labels (1,2,3); -enddef; - -for slope=1 upto 8: - - beginchar(56+slope-1, (cosd(10slope))*nhw#,(sind(10slope))*nhw#, 0); - " glissando element slope "&decimal (10slope)&" degree"; - glissando (10slope); - save_pic:= currentpicture; - endchar; - - beginchar(64+slope-1, (cosd(10slope))*nhw#, (sind(10slope))*nhw#, 0); - " glissando element slope "&decimal (-10slope)&" degree"; - currentpicture:= save_pic reflectedabout (origin, right); - endchar; - -endfor; - -%%%%%%% -message (""); -%%%%%%% -def tabulatur (expr nd)= - hwidth:=1/5w; - x1=x2=y2=y3=0; x3=w; y1=-nd; - fill unitsquare xscaled (w+2thinwidth) yscaled (med+.2pt) - shifted(-thinwidth,0); - pickup thin_pen; - for v=1 upto 5 : - draw (z2--z3) shifted (0,v*-hwidth); - endfor; - - for v=0 upto 5 : - draw (z1--z2) shifted (v*hwidth,0); - endfor; - labels (1,2,3); -enddef; - -%beginchar(72, 15/4nhw#, 0, 0);" grid"; -% tabulatur (54/10nhh); -%endchar; - -%beginchar(73, 15/8nhw#, 0, 0); " dot"; -% fill fullcircle scaled .675nhh shifted (w,-.45nhh); -%endchar; - -%beginchar(74, 15/4nhw#, 0, 0); " bar"; -% fill unitsquare xscaled w yscaled .3nhh shifted (0,-.6nhh); -%endchar; - -shift:=.15nhh; -def Circle (expr nh)= - x1l=.1w; x2=x4=.5w; x3l=.9w; - y1=y3=.5nh+shift; y2=.1nh+shift; y4=.9nh+shift; - penpos1(med, 0); - penpos2(thinwidth,90); - penpos3(med,180); - penpos4(thinwidth, 270); - penstroke z1e..z2e..z3e..z4e..cycle; - pickup pencircle; draw z1..z2..z3..z4..cycle; -enddef; - -%beginchar(75, 3/4nhw#, 0, 0); " circle"; -% Circle (.9nhh); -%endchar; - -def Cross (expr nh)= - x1=x3=.2w; x2=x4=.8w; - y1=y4=.2nh+shift; y2=y3=nh-.2nh+shift; - pickup med_pen; - draw z1--z2; draw z3--z4; -% labels (1,2,3,4); -enddef; - -%beginchar(76, 3/4nhw#, 0, 0); " cross"; -% Cross (.9nhh); -%endchar; - -%beginchar(77, 3/4nhw#, 0, 0); " blank"; -%endchar; - -beginchar(72, 3nhw#, 0, 0);" small grid"; - tabulatur (108/25nhh); -endchar; - -beginchar(73, 3/2nhw#, 0, 0); " small dot"; - fill fullcircle scaled .54nhh shifted (w,-.36nhh); -endchar; - -beginchar(74, 3nhw#, 0, 0); " small bar"; - fill unitsquare xscaled w yscaled .24nhh shifted (0,-.48nhh); -endchar; - -beginchar(75, 3/5nhw#, 0, 0); " small circle"; - Circle (.72nhh); -endchar; - -beginchar(76, 3/5nhw#, 0, 0); " small cross"; - Cross (.72nhh); -endchar; - -% the next seems to be senseless, but it isn't - -beginchar(77, 3/5nhw#, 0, 0); " small blank"; -endchar; diff --git a/mf/musix11.mf b/mf/musix11.mf deleted file mode 100644 index fd70f02eca..0000000000 --- a/mf/musix11.mf +++ /dev/null @@ -1,28 +0,0 @@ - -font_identifier:="musix11"; - -mode_setup; - -font_size 10.24pt#; - -nhh#:=2.56pt#; -nhw#:=3.072pt#; -gregwidth#:=0.5*sqrt(2)*nhw#; - -thin#:=1/50designsize; -med#:=1/33designsize; -thick#:=1/16designsize; - -thinwidth := 0.064pt; -beamht#:=0.48nhh#; - -define_pixels(nhh,nhw,beamht,gregwidth); -define_blacker_pixels(thin,med,thick); - -pair ne,se,sw,nw; %northeast,southeast,southwest,northwest -ne = up+right; se = down+right; sw = down+left; nw = up+left; - -font_x_height nhh#; -font_quad nhw#; - -input musixgen diff --git a/mf/musix13.mf b/mf/musix13.mf deleted file mode 100644 index 918db5f01b..0000000000 --- a/mf/musix13.mf +++ /dev/null @@ -1,28 +0,0 @@ - -font_identifier:="musix13"; - -mode_setup; - -font_size 12.8pt#; - -nhh#:=3.2pt#; -nhw#:=3.84pt#; -gregwidth#:=0.5*sqrt(2)*nhw#; - -thin#:=1/50designsize; -med#:=1/33designsize; -thick#:=1/16designsize; - -thinwidth := 0.08pt; -beamht#:=0.48nhh#; - -define_pixels(nhh,nhw,beamht,gregwidth); -define_blacker_pixels(thin,med,thick); - -pair ne,se,sw,nw; %northeast,southeast,southwest,northwest -ne = up+right; se = down+right; sw = down+left; nw = up+left; - -font_x_height nhh#; -font_quad nhw#; - -input musixgen diff --git a/mf/musix16.mf b/mf/musix16.mf deleted file mode 100644 index 32dbddd36d..0000000000 --- a/mf/musix16.mf +++ /dev/null @@ -1,28 +0,0 @@ - -font_identifier:="musix16"; - -mode_setup; - -font_size 16pt#; - -nhh#:=4pt#; -nhw#:=4.8pt#; -gregwidth#:=0.5*sqrt(2)*nhw#; - -thin#:=1/50designsize; -med#:=1/33designsize; -thick#:=1/16designsize; - -thinwidth := 0.1pt; -beamht#:=0.48nhh#; - -define_pixels(nhh,nhw,beamht,gregwidth); -define_blacker_pixels(thin,med,thick); - -pair ne,se,sw,nw; %northeast,southeast,southwest,northwest -ne = up+right; se = down+right; sw = down+left; nw = up+left; - -font_x_height nhh#; -font_quad nhw#; - -input musixgen diff --git a/mf/musix20.mf b/mf/musix20.mf deleted file mode 100644 index 0bdebdf3f1..0000000000 --- a/mf/musix20.mf +++ /dev/null @@ -1,28 +0,0 @@ - -font_identifier:="musix20"; - -mode_setup; - -font_size 20pt#; - -nhh#:=5pt#; -nhw#:=1.2*nhh#; -gregwidth#:=0.5*sqrt(2)*nhw#; - -thin#:=1/50designsize; -med#:=1/33designsize; -thick#:=1/16designsize; - -thinwidth := 0.125pt; -beamht#:=0.48nhh#; - -define_pixels(nhh,nhw,beamht,gregwidth); -define_blacker_pixels(thin,med,thick); - -pair ne,se,sw,nw; %northeast,southeast,southwest,northwest -ne = up+right; se = down+right; sw = down+left; nw = up+left; - -font_x_height nhh#; -font_quad nhw#; - -input musixgen diff --git a/mf/musix24.mf b/mf/musix24.mf deleted file mode 100644 index 0b2dc46b71..0000000000 --- a/mf/musix24.mf +++ /dev/null @@ -1,28 +0,0 @@ - -font_identifier:="musix24"; - -mode_setup; - -font_size 24pt#; - -nhh#:=6pt#; -nhw#:=1.2nhh#; -gregwidth#:=0.5*sqrt(2)*nhw#; - -thin#:=1/50designsize; -med#:=1/33designsize; -thick#:=1/16designsize; - -thinwidth := 0.15pt; -beamht#:=0.48nhh#; - -define_pixels(nhh,nhw,beamht,gregwidth); -define_blacker_pixels(thin,med,thick); - -pair ne,se,sw,nw; %northeast,southeast,southwest,northwest -ne = up+right; se = down+right; sw = down+left; nw = up+left; - -font_x_height nhh#; -font_quad nhw#; - -input musixgen diff --git a/mf/musix25.mf b/mf/musix25.mf deleted file mode 100644 index 529c7ec7ad..0000000000 --- a/mf/musix25.mf +++ /dev/null @@ -1,28 +0,0 @@ - -font_identifier:="musix25"; - -mode_setup; - -font_size 25pt#; - -nhh#:=6.25pt#; -nhw#:=7.5pt#; -gregwidth#:=0.5*sqrt(2)*nhw#; - -thin#:=1/50designsize; -med#:=1/33designsize; -thick#:=1/16designsize; - -thinwidth := 0.15pt; -beamht#:=0.48nhh#; - -define_pixels(nhh,nhw,beamht,gregwidth); -define_blacker_pixels(thin,med,thick); - -pair ne,se,sw,nw; %northeast,southeast,southwest,northwest -ne = up+right; se = down+right; sw = down+left; nw = up+left; - -font_x_height nhh#; -font_quad nhw#; - -input musixgen diff --git a/mf/musix29.mf b/mf/musix29.mf deleted file mode 100644 index 622aeae27f..0000000000 --- a/mf/musix29.mf +++ /dev/null @@ -1,28 +0,0 @@ - -font_identifier:="musix29"; - -mode_setup; - -font_size 29pt#; - -nhh#:=7.2pt#; -nhw#:=1.2*nhh#; -gregwidth#:=0.5*sqrt(2)*nhw#; - -thin#:=1/50designsize; -med#:=1/33designsize; -thick#:=1/16designsize; - -thinwidth := 0.15pt; -beamht#:=0.48nhh#; - -define_pixels(nhh,nhw,beamht,gregwidth); -define_blacker_pixels(thin,med,thick); - -pair ne,se,sw,nw; %northeast,southeast,southwest,northwest -ne = up+right; se = down+right; sw = down+left; nw = up+left; - -font_x_height nhh#; -font_quad nhw#; - -input musixgen diff --git a/mf/musixgen.mf b/mf/musixgen.mf deleted file mode 100644 index 622f8d763f..0000000000 --- a/mf/musixgen.mf +++ /dev/null @@ -1,1521 +0,0 @@ -% next changes: - redesigning accidentals -% - new accents -% - new gregorian symbols -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% this is musixgen.mf (c) -% -% Version T.70 [March 97] -% - double shap corrected by Julian Gilbey (strange paths) -% -% Version T.59 [September 96] -% - added one more gregorian symbol (126) -% -% Version T.40 [September 95] -% - corrected gregorianFclef (123) -% -% Version 0.37 [March 95] -% - introduced reverseAllabreve (122) -% -% Version 0.25 [December 94] -% - some new chars -% - added the beamfonts at pos x+128 to save memory -% - changed coda to be centered -% - changed the flags -% - changed the position of some chars to save time -% -% ... - trouble shooting, minor changes -% -% Version 0.99b[April 94] -% - added the new signs from Daniel Taupin -% -% Version 0.99 [February 94] -% -'bravely' changed the tfm informations to save memory -% - redesigned chars 14, 15, 35, 36, 53, 71, 72, 80, 81, 86, 93 -% - removed * 'never used' chars 37-39, 55-57, 69-70, -% 77-79, 91-99, 101-119 -% * (de)crescendi 16-23 -> now in musixlin -% - introduced some new chars 0-11, 16-23, 37-39, 57, 77-79, -% 99-117 -% - changed the position of some chars to save memory -%%%%%%%%%% -% this was musicgen.mf -% -% Version 4.89 [September 93] Andreas Egler -% - blacker influence now -% - redesigned chars 71, 72, 53, 123 -% -% Version 4.88 [January 93] Ross Mitchell -% - redesigned chars 63, 64, 65, 66 -% -% Version 4.87 [] Daniel Taupin -% -% Version 2.00 [] Daniel Taupin -% -% Version 1.00 [August 86] Angelika Schofer/Andrea Steinbach -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% free positions: 125-127, 188-191, 252-255 -% heights : 0, 0.5, 1, 1.5, 2.25, 3.25, 4, 4.75, 5.25 -% depths : 0, 0.5, 1, 1.5, 2.25 - -%{{{ This always indicates a lowres fix to avoid seperated points -%}}} and/or 'invisible' lines. It doesn't affect higher resolutions !! - -pair pone, ptwo; -transform t; -path p; - -hlthick=.2pt; -lthick=.4pt; - -pen line_pen, med_pen, coda_pen, thin_pen; -med_pen:= pencircle scaled med; -line_pen:= pencircle scaled lthick; -coda_pen:= pencircle xscaled 1.25thick yscaled max(1,.75med); -thin_pen:= pencircle scaled max(1,.25pt); - -apog_fact=.75; -apog_nhw#=apog_fact*nhw#; - -picture save_pic, elem_pic; - -%%%%%%%%%%%%%%% -% basic def's % -%%%%%%%%%%%%%%% - -def savepic = save_pic:= currentpicture enddef; -def save_elempic = elem_pic:= currentpicture enddef; -def callpic = currentpicture:= save_pic enddef; - -def mirror (expr pone, ptwo) = - currentpicture:=currentpicture reflectedabout(round(pone),round(ptwo)) -enddef; - -def add_mirror (expr pone, ptwo) = - addto currentpicture also currentpicture - reflectedabout (round(pone), round(ptwo)) -enddef; - -def call_mirror (expr pone, ptwo) = callpic; mirror (pone, ptwo) enddef; - -def add_shift (expr pone, ptwo) = - addto currentpicture also currentpicture shifted (pone, ptwo) -enddef; - -def call_add_shift (expr pone, ptwo) = - callpic; add_shift (pone, ptwo) -enddef; - -def add_elempic (expr pone, ptwo) = - addto currentpicture also elem_pic shifted (pone, ptwo) -enddef; - -def call_add_save_elempic (expr pone, ptwo) = - callpic; add_elempic(pone, ptwo); savepic -enddef; - -def shift_pic (expr pone, ptwo) = - currentpicture:=currentpicture shifted (round(pone),round(ptwo)) -enddef; - -def fill_circle (expr diameter, zshift) = - fill fullcircle scaled diameter shifted zshift -enddef; - -def fill_square (expr xwidth, ywidth, zshift) = - fill unitsquare xscaled xwidth yscaled ywidth shifted zshift -enddef; - -% - -def staff= - for i=0 upto 4: - pickup pencircle yscaled lthick; - draw (-5nhw,i*nhh)--(5nhw,i*nhh); - endfor -enddef; - -def Staff= - for i=0 upto 4: - pickup pencircle yscaled lthick; - draw (-5nhw,(i*nhh-.5nhh))--(5nhw,(i*nhh-.5nhh)); - endfor -enddef; - -def upstem= - fill_square (lthick, 5nhh, (0,-5nhh)) -enddef; - -def downstem= - fill_square (lthick, 5nhh, (nhw-hlthick,0)) -enddef; - -% eobasicdefs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -%%%%%%% -message (""); -%%%%%%% - -beginchar(0, 0, 0, 0); "duration dot"; % correct 3=>0 DT - fill_circle (1/3nhh+blacker, (1.5nhw, 0)); - save_elempic; - savepic; -endchar; - -beginchar(1, 0, 0, 0); "double duration dot"; - call_add_shift (.5nhw, 0); - savepic; -endchar; - -beginchar(2, 0, 0, 0); "triple duration dot"; - callpic; - add_elempic (nhw, 0); -endchar; - -beginchar(3, 0, nhh#, nhh#); "left parenthesis"; % correct 0=>3 DT - x11=x13=-.1nhw; y12=0; x12=-.3nhw; y11=-y13=-.75nhh; - pickup med_pen; - draw z11..z12..z13; - savepic; -endchar; - -beginchar(4, 0, nhh#, nhh#); "right parenthesis"; - call_mirror ((.5nhw,0),(.5nhw,1)); -endchar; - -beginchar(5, 0, nhh#, nhh#); "cautionary parentheses"; - callpic; - add_mirror ((.3nhw, 0),(.3nhw, 1)); -endchar; - -beginchar(6, 0, nhh#, nhh#); "cautionary wide parentheses";% -> bb - callpic; - add_mirror ((.55nhw, 0),(.55nhw, 1)); -endchar; - -%%%%%%% -message(""); -%%%%%%% - -beginchar(120, 0, 1.5nhh#, 0); "harmonics"; - pickup thin_pen; - draw fullcircle scaled .5nhw shifted (.5nhw, nhh); -endchar; - -%beginchar(XX, 0, 1.5nhh#, 0); "???"; -% x1=0; x2=.5nhw; x3=nhw-x1; x3=x4+.25nhw; x6=x1+med; -% y1=y6=y4=y3=nhh; y2=y1+nhh; -% z5-z6=whatever*(z2-z1); -% z5-z4=whatever*(z2-z3); -% fill z1--z2--z3--z4--z5--z6--cycle; -% fill_circle (thick, ((x5,y1+.5thick))); -% savepic; -%endchar; - -beginchar(20, 0, 2.25nhh#, 0); "upper sforzato"; - x1=1/12nhw; x2=.5nhw; x3=nhw-x1; x3=x4+.25nhw; x6=x1+med; - y1=y6=y4=y3=nhh; y2=y1+nhh; - z5-z6=whatever*(z2-z1); - z5-z4=whatever*(z2-z3); - fill z1--z2--z3--z4--z5--z6--cycle; - savepic; -endchar; - -beginchar(21, 0, 0, 2.25nhh#); "lower sforzato"; - call_mirror (origin, right); -endchar; - -beginchar(22, 0, nhh#, 0); "downbow"; - fill_square (thin, nhh, (-thin, .4nhh)); - fill_square (.5nhw+thin+1, .8beamht+thin, (-thin, nhh)); - add_mirror ((.5nhw,0),(.5nhw,1)); -endchar; - -beginchar(23, 0, 1.5nhh#, 0); "upbow"; - pickup med_pen; - draw (.15nhw, 1.7nhh)--(.5nhw, .2nhh); - add_mirror ((.5nhw,0),(.5nhw,1)); -endchar; - -beginchar(24, 0, nhh#, 0); "upper staccato"; - fill_circle (.275nhw+blacker, (.5nhw, nhh)); - savepic; -endchar; - -beginchar(25, 0, 0, nhh#); "lower staccato"; - call_mirror (origin, right); -endchar; - -beginchar(18, 0, nhh#, 0); "upper tenuto/staccato"; - fill_square (nhw, 1.25med, (0, 1.2nhh-.625med)); - fill_circle (.275nhw+blacker, (.5nhw, .9nhh)); - savepic; -endchar; - -beginchar(19, 0, 0, nhh#); "lower tenuto/staccato"; - call_mirror (origin, right); -endchar; - -beginchar(26, 0, nhh#, 0); "upper portato (tenuto)"; - fill_square (nhw, 1.25med, (0, nhh-.625med)); - savepic; -endchar; - -beginchar(27, 0, 0, nhh#); "lower portato (tenuto)"; - call_mirror (origin, right); -endchar; - -beginchar(28, 0, 1.5nhh#, 0); "upper staccatissimo"; - rayon:= thin+.125nhh; - x1=x3=x2+rayon=x4-rayon=.5nhw; - y2=y4=y1-rayon=y3+.5nhh=1.15nhh; - fill z3--z4{up}..z1..{down}z2--cycle; - savepic; -endchar; - -beginchar(29, 0, 0, 1.5nhh#); "lower staccatissimo"; - call_mirror (origin, right); -endchar; - -beginchar(30, 0, 2.25nhh#, 0); "upper marcato"; - pickup med_pen; - draw (-.2nhw, 1.9nhh)--(1.2nhw, 1.5nhh)--(-.2nhw, 1.1nhh); - savepic; -endchar; - -beginchar(31, 0, 0, 2.25nhh#); "lower marcato"; - call_mirror (origin, right); -endchar; - -%%%%%%% -message (""); -%%%%%%% - -NHW=nhw+hlthick; - -beginchar(7, 0, .5nhh#, .5nhh#); "quarter note"; -% makeshift, expedience -if pixels_per_inch=600: - if NHW>50: corNHW=1.04*NHW; else: corNHW=1.04*NHW+1; fi - fill fullcircle xscaled corNHW yscaled 1.85h - rotated 20 shifted (.5NHW-.5, 0); -else: - corNHW=1.065*NHW; - fill fullcircle xscaled corNHW yscaled 1.85h - rotated 20 shifted (.5NHW, 0); -fi -endchar; - -beginchar(8, 0, .5nhh#, .5nhh#); "half note"; - penpos1(max(1,2hlthick), 0); - penpos3(max(1,2hlthick), 180); - penpos2(thick,-90); - penpos4(thick, 90); - -x1l = .53NHW; - x3l = .5NHW; - x2 = x4 = y1 = y3 = 0; - y2l =-y4l = h; - penstroke (z1e{up}..z2e{right}..z3e{down}..z4e{left}..cycle) - rotated 20 shifted (.5NHW, 0); -endchar; - -beginchar(9, 0, .5nhh#, .5nhh#); "whole note"; - x1= y1 = y3 = y5 = y7 = 0; - x3= 2x2 = 2x4 = 2x6 = 2x8 = 5/4nhw; - y2=-y4 = h; - x5= x3-x7 = x1+.375nhw-blacker; - y6=-y8 = y2-.1thin; - fill z1{curl3}..z2..{curl3}z3{curl3}..z4..{curl3}cycle; - unfill (z5..z6..z7..z8..cycle) rotatedaround ((x2,0), 45) shifted (.5,.5); -%{{{ - currentpen:= pencircle; - draw rt z1{curl3}..bot z2..{curl3}lft z3{curl3}..top z4..{curl3}cycle; -%}}} - labels(range 1 thru 8); - savepic; -endchar; - -beginchar(56, 0, .5nhh#, .5nhh#); "whole note with | --> |O|"; - callpic; - fill_square (.6thick, nhh, (-.55thick,-.5nhh)); - fill_square (.6thick, nhh, (5/4nhw-.05thick,-.5nhh)); -endchar; - -beginchar(32, 0, .5nhh#, .5nhh#); "brevis";% 2 whole notes - fill_square (5/4nhw, .25nhh, (0,.25nhh)); - add_mirror (origin, right); - x1=x2=0; x3=x4=5/4nhw; y1=-y2=y3=-y4=.7nhh; - pickup line_pen; - draw z1--z2; draw z3--z4; - savepic; -endchar; - -beginchar(39, 0, .5nhh#, .5nhh#); "longa";% 4 whole notes - callpic; - pickup line_pen; - draw (5/4nhw,-.7nhh)--(5/4nhw,-1.7nhh); -endchar; - -beginchar(36, 0, .5nhh#, .5nhh#); "maxima";% 8 whole notes - fill_square (5/2nhw, .3nhh, (0,.2nhh)); - add_mirror (origin, right); - pickup line_pen; - draw (0,.7nhh)--(0,-.7nhh); draw (5/2nhw,.7nhh)--(5/2nhw,-1.7nhh); -endchar; - -beginchar(37, 0, .5nhh#, .5nhh#); "filled diamond";% -> triangle - fill unitsquare scaled (.5*sqrt(2)*NHW) rotated -45; -endchar; - -def square (expr mw)= - fill_square (sqrt(2)*.5mw, max(1,thin), origin) rotated -45; - fill_square (sqrt(2)*.5mw, .15nhw, (0,-.15nhw)) rotated 45; - save_elempic; - mirror (origin,up); - mirror (origin,left); - shift_pic (mw+.5,0); - add_elempic(0,0); -% mirror (origin,right);% I've seen this too, somewhere ... -enddef; - -beginchar(38, 0, .5nhh#, .5nhh#); "unfilled diamond";% -> rimshot - square (NHW); -endchar; - -beginchar(99, 0, .5nhh#, .5nhh#); "oldstyle quarter notehead up"; - x1=x4=0; x2=x3=NHW; y1=y2=-y3=-y4=h-hlthick; - fill z1{dir-10}..z2--z3{dir-170}..z4--cycle; - savepic; -endchar; - -beginchar(100, 0, .5nhh#, .5nhh#); "oldstyle quarter notehead down"; - call_mirror(origin, right); -endchar; - -beginchar(101, 0, .5nhh#, .5nhh#); "oldstyle half notehead up"; - pthick:=.2nhh; - x1=0; x2=NHW; y1=y2=h-.5pthick+hlthick; - pickup penrazor scaled pthick rotated 90; - draw z1{dir-10}..z2; - add_shift (0, -nhh+pthick); - fill_square (lthick, nhh-hlthick, (0, -h+hlthick)); - fill_square (lthick, nhh-hlthick, (nhw-hlthick, -h+hlthick)); - savepic; -endchar; - -beginchar(102, 0, .5nhh#, .5nhh#); "oldstyle half notehead down"; - call_mirror(origin, right); -endchar; - -beginchar(111, 0, .5nhh#, .5nhh#); "cross"; % -> closed hihat - x1=0; x2=nhw; y1=-.5nhw; y2=-y1; - pickup med_pen; - draw top rt z1--bot lft z2; - add_mirror((.5nhw,0),(.5nhw,1)); - savepic; -endchar; - -beginchar(112, 0, .5nhh#, .5nhh#); "halfcircled cross";% -> halfclosed hihat - callpic; - pickup thin_pen; - draw halfcircle scaled nhw shifted (.5nhw,0); -endchar; - -beginchar(113, 0, .5nhh#, .5nhh#); "circled cross";% -> open hihat - callpic; - pickup thin_pen; - draw fullcircle scaled nhw shifted (.5nhw,0); -endchar; - -def doublesharp (expr mw, xshift)= - x1=y2=x3=0; y1=x2=y4=.5mw; y3=.5mw-x4=.1mw; - z4'=.925[z3,z4]; z3'=.925[z4,z3]; % *** - penpos2(max(1,thin),45); -%%% a 'nicer' look for 'high'res-printers gives -if pixels_per_inch > 500: - fill z1..{dir-125}z3'{dir35}..{se}z2l--z2r--(z1+(eps,0))--cycle; - fill z1..{dir35}z4'{dir-125}..{se}z2r--z2l--(z1-(eps,0))--cycle; % *** -else : -%%% but this causes 'strange path' on lower resolutions - fill z1..{dir-110}z3'{dir30}..{se}z2l--z2r--(z1+(eps,0))--cycle; - fill z1..{dir20}z4'{dir-120}..{se}z2r--z2l--(z1-(eps,0))--cycle; % *** -fi -%{{{ - currentpen:= pencircle; draw z1--(x2+1,y2-1);% draw (x3'+1,y3'+1)--z5'; -%}}} -% add_mirror ((0,.5mw),(.5mw,0)); % *** - add_mirror ((.5mw,-.5mw),(.5mw,.5mw)); - add_mirror (origin, right); - shift_pic (xshift, 0); -enddef; - -beginchar(114, 0, .5nhh#, .5nhh#); "doublesharp notehead";% -> ride cymbal - doublesharp (.95nhw,0.025nhw); - savepic; -endchar; - -beginchar(115,0, .5nhh#, .5nhh#);"circled doublesharp notehead";%->crash cymbal - callpic; - pickup thin_pen; - draw fullcircle scaled nhw shifted (.5nhw,0); -endchar; - -beginchar(116, 0, .5nhh#, .5nhh#); "triangle";% -> rattle - x1=y1=y2=0; x2=2x3=nhw; y3=.8h; - pickup med_pen; - draw z1--z2--z3--z1; -endchar; - -beginchar(117, 0, .5nhh#, .5nhh#); "bongo cross"; - pickup med_pen; - draw (0,0)--(nhw,0); - draw (0.5nhw,-0.5nhw) -- (0.5nhw,0.5nhw); -endchar; - -beginchar(118, 0, .5nhh#, .5nhh#); "rhombus";% -> shaker - x1=x4=y2=y4=0; y1=-y3=-h; x2=x3=NHW; - fill z1--z2--z3--z4--cycle; -endchar; - -beginchar(95, 0, .5nhh#, .5nhh#); "gregorian square"; - x1=x4=0; x2=x3=gregwidth; y1=y2=-y3=-y4=.5gregwidth-lthick; - fill z1{dir 15}..z2--z3{dir 165}..z4--cycle; - shift_pic(0,-hlthick); - savepic; -endchar; - -beginchar(96, 0, .5nhh#, .5nhh#); "gregorian square left"; - callpic; - fill_square (med, 1.5nhh,(0, -1.5nhh)); -endchar; - -beginchar(97, 0, .5nhh#, .5nhh#); "gregorian square right"; - callpic; - fill_square (med, 1.5nhh,(gregwidth-med, -1.5nhh)); - savepic; -endchar; - -beginchar(124, 0, .5nhh#, .5nhh#); "porrectus"; - x1=x4=0; x2=x3=2.5*gregwidth; y1=-y4=.5gregwidth-lthick; y2=y1-nhh; y3=y4-nhh; - fill z1..{right}z2--z3{left}..z4--cycle; shift_pic(0,hlthick); - fill_square (med, 1.5nhh,(0, -1.5nhh)); -endchar; - -beginchar(125, 0, .5nhh#, .5nhh#); "quilisma"; - qdecalage:=.12*gregwidth; - x1=x4=-0.2*gregwidth; x2=x3=1.2*gregwidth; - y1+qdecalage=y2-qdecalage=.5gregwidth-lthick;y1=-y3; y2=-y4; - fill z1--z2--z3--z4--cycle; - pickup med_pen; - - draw z4--(z1+0.4*(z1-z4)); - draw (0.667z4+0.333z3)--((0.667z1+0.333z2)+0.4*(z1-z4)); - draw (0.333z4+0.667z3)--((0.333z1+0.667z2)+0.4*(z1-z4)); - draw z3--(z2+0.4*(z1-z4)); - shift_pic(0,-hlthick); -endchar; - -beginchar(126, 0, .5nhh#, .5nhh#); "mirrored gregorian square"; - x1=x4=0; x2=x3=gregwidth; y1=y2=-y3=-y4=-.5gregwidth+lthick; - fill z1{dir -15}..z2--z3{dir -165}..z4--cycle; - shift_pic(0,+hlthick); -endchar; - - - -%%%%%%% -message (""); -%%%%%%% - -flagw:=.8nhw; -flagthick:=nhh; -flagthin:=5thinwidth; - -def flagshape -(expr contflag, width, height, flgthick, flgthin, shifty, flagsense) = - penpos1(flgthick+blacker, 90); % .1 - penpos2(3.25flgthin+blacker, 70);% - x1 = 0; % .2 - y1 = height+shifty-.5flgthick; % - x2 = 3/8width; % .3 - y2 = y1-.45flgthick; % - x3 = width-flgthin/2; % .4(.4) - y3 = y1-1.5flgthick; - - if contflag=1: x4 = x3-.4width; y4 = shifty; - else: x4 = x3; y4 = 2.5flagthick-2flgthick; fi - if flagsense>0: penpos3(1.15flgthin, 35); - else: penpos3(.8flgthin, 0); fi - - penstroke z1e..z2e..z3e{down}..z4; -%{{{ - currentpen:= pencircle; draw lft z1..z2..z3{down}..z4; -%}}} - penlabels(1,2,3,4) -enddef; - -def mirror_flag(expr sense)= if sense<0: mirror((0,h/2),(1,h/2));fi enddef; - -def cflag (expr sense) = - flagshape(1, flagw, 3nhh, flagthick, flagthin, 0, sense); - mirror_flag(sense); - savepic; -enddef; - -def ccflag (expr sense) = - flagshape(5, flagw, 2.25nhh, 2/3flagthick, flagthin, flagthick, sense); - save_elempic; - clearxy; - flagshape(1, flagw, 2.5nhh, 2/3flagthick, flagthin, 0, sense); - savepic; - mirror_flag(sense); -enddef; - -def addflag (expr sense, shifty) = - call_add_save_elempic (0, shifty*.75flagthick); - mirror_flag(sense); -enddef; - -def cccflag (expr sense) = addflag(sense, 1) enddef; -def ccccflag (expr sense) = addflag(sense, 2) enddef; -def cccccflag (expr sense) = addflag(sense, 3) enddef; - -beginchar(40, 0, 3.25nhh#, 0); "8th flag up"; - cflag(1); - shift_pic (0, .5nhh+.5); -endchar; - -beginchar(12, 0, 3.25nhh#, 0); "acciacaturra stem up"; - callpic; - pickup med_pen; - x1=-.25nhw; y1=.2h; x2=1.1nhw; y2=y1+.6(x2-x1); - draw z1--z2; - shift_pic (0, .5nhh+.5); -endchar; - -beginchar(41, 0, 3.25nhh#, 0); "16th flag up"; - ccflag(1); - shift_pic (0, .25nhh); -endchar; - -beginchar(42, 0, 4nhh#, 0); "32th flag up"; - cccflag(1); - shift_pic (0, .25nhh); -endchar; - -beginchar(43, 0, 4.75nhh#, 0); "64th flag up"; - ccccflag(1); - shift_pic (0, .25nhh); -endchar; - -beginchar(44, 0, 5.5nhh#, 0); "128th flag up"; - cccccflag(1); - shift_pic (0, .25nhh); -endchar; - -%%% -% flags up should be wider -%%% -flagw:=nhw; - -beginchar(45, 0, 3.25nhh#, 0); "8th flag down"; - cflag(-1); - shift_pic (0,-.5nhh-.5); -endchar; - -beginchar(13, 0, 3.25nhh#, 0); "acciacaturra stem down"; - callpic; - pickup med_pen; - x1=-.25nhw; y1=1.6nhh; x2=1.2nhw; y2=y1+.6(x2-x1); - draw z1--z2; - shift_pic (0,-.5nhh-.5); -endchar; - -beginchar(46, 0, 3.25nhh#, 0); "16th flag down"; - ccflag(-1); - shift_pic (0,-.25nhh); -endchar; - -beginchar(47, 0, 4nhh#, 0); "32th flag down"; - cccflag(-1); - shift_pic (0,-.25nhh); -endchar; - -beginchar(48, 0, 4.75nhh#, 0); "64th flag down"; - ccccflag(-1); - shift_pic (0,-.25nhh); -endchar; - -beginchar(49, 0, 5.5nhh#, 0); "128th flag down"; - cccccflag(-1); - shift_pic (0,-.25nhh); -endchar; - -%%%%%%% -message(""); -%%%%%%% - -def flat (expr reduction, shiftx, flatsense) = - fthick:= reduction*thick; - penpos4(4/3fthick,0); % 1 - penpos3(1/2fthick,-90); % - penpos6(4/7fthick,90); % 6 - x1 = x2 = x3 = x5 = fthick; % / \ - y1 = 6fthick; y2 = .5y4; % 2 4 - y3l=-2fthick; y5 = y3r; % / - x4 = 3.6fthick; y4 = .1fthick; % 3,5 - y6r= 2fthick; x6 = .5(x2+x4); - t:= identity shifted (round(shiftx),0); - p:= (z1--z5) transformed t; - pickup penrazor scaled max(1,(2sind40*thin)) rotated 40; - draw p; - penstroke (z2..{right}z6e..z4e{sw+down}..{sw}z3e) transformed t; - if flatsense<0: mirror (z5 transformed t, z1 transformed t); fi - penlabels (1,2,3,4,5,6) -enddef; - -beginchar(50, nhw#, 1.5nhh#, .5nhh#); "flat"; - flat (1, 0, 1); - savepic; -endchar; - -beginchar(51, 1.7nhw#, 1.5nhh#, .5nhh#); "doubleflat"; - call_add_shift (.7nhw, 0); -endchar; - -def sharp (expr reduction, zshift) = - sthick:= .5reduction*thick; - nx:= reduction*1.5nhh; - ny:= reduction*.8nhw; - y1 =-y7= nx-1.5sthick; y2 =-y8 = .5sthick-nx; - x1 = x2 = y3 = -y6 = ny-x7 = ny-x8 = 2sthick; - y4 =-y5 = y3 + 3sthick; - x3 = x5 = 0; x4 = x6 = ny; - pickup penrazor scaled max(1,thin) rotated angle(z4-z3); - draw z1--z2; draw z8--z7; - pickup penrazor scaled 3sthick rotated 90; - draw z3--z4; draw z5--z6; - shift_pic (zshift, 0); - labels (range 1 thru 8) -enddef; - -beginchar(52, nhw#, 1.5nhh#, 1.5nhh#); "sharp"; - sharp (1, 0); -endchar; - -beginchar(53, nhw#, .5nhh#, .5nhh#); "doublesharp"; - doublesharp (w, -.1nhw); -endchar; - -def natural (expr reduction, zshift) = - ny:= .8nhw*reduction; - nthick:= 3/4reduction*thick; - x1 = x2 = x3 = nthick+.5thin; - x5 = x6 = x4 = ny-x1; - y1 = -y6 = 1.5nhh*reduction; - y2 = -y5 = 1.6nthick; - y4 = -y3 = y2+4/3nthick; - pickup penrazor scaled max(1,thin) rotated angle(z4-z2); - draw lft z1--bot lft(x3,y3-nthick); - draw top rt(x4,y4+nthick)--rt z6; - pickup penrazor scaled 2nthick rotated 90; - draw (x2-.5,y2)--(x4+.5,y4); - draw (x3-.5,y3)--(x5+.5,y5); - shift_pic (zshift, 0); - labels(1,2,3,4,5,6) -enddef; - -beginchar(54, nhw#, 1.5nhh#, 1.5nhh#); "natural"; - natural (1, 0); -endchar; - -beginchar(90, apog_nhw#, nhh#, .5nhh#); "small flat"; - flat (apog_fact, -.05nhw, 1); - savepic; -endchar; - -beginchar(91, 1.65apog_nhw#, nhh#, .5nhh#); "small doubleflat"; - call_add_shift (.7apog_fact*nhw,0); -endchar; - -beginchar(92, apog_nhw#, nhh#, nhh#); "small sharp"; - sharp (apog_fact, 0); -endchar; - -beginchar(93, apog_nhw#, .5nhh#, .5nhh#); "small doublesharp"; - doublesharp (w, -.075nhw); -endchar; - -beginchar(94, apog_nhw#, nhh#, nhh#); "small natural"; - natural (apog_fact, 0); -endchar; - -%%%%%%% -message (""); -%%%%%%% - -beginchar(59, .5nhw#, 0, 0); "ddp";% doubledouble (4) pause - fill_square (.5nhw, 2nhh, (0, nhh)); -endchar; - -beginchar(58, .5nhw#, 0, 0); "dp";% double (2) pause - fill_square (.5nhw, nhh, (0, 2nhh)); - savepic; -endchar; - -beginchar(60, 5/4nhw#, .5nhh#, 0); "half rest"; - fill_square (5/4nhw, .5nhh, (0, 0)); - savepic; -endchar; - -beginchar(10, 0, .5nhh#, 0); "half rest outside a staff"; - callpic; - fill_square (2nhw, lthick, (-.375nhw, -hlthick)); - savepic; -endchar; - -beginchar(11, 0, 0, .5nhh#); "full rest outside a staff"; - call_mirror(origin,right); -endchar; - -beginchar(61, 5/4nhw#, 0, .5nhh#); "full rest"; - fill_square (5/4nhw, .5nhh, (0, -.5nhh)); -endchar; - -beginchar(62, 0, 4nhh#, 0); "quarter rest"; - rthin:= 1/8 nhh; % .1 - rthick:= 2 thick+rthin; % .2 - alpha:= -50; % .3 - penpos1(rthin, 90+alpha); % .4 - penpos5(rthin, alpha); % .5,10 - penpos2(rthick, alpha); % .6 - penpos4(rthick, alpha); % - penpos3(3/4rthick, alpha); % .7 - penpos6(4/3thick, alpha); - penpos7(rthin, 45); - y1l = 4nhh - 1/2nhh; - x1l = 1/2nhh; - z2r = z1 +(nhh* right) rotated alpha; - z3 = 1/2[z2,z4]; - z4 = (nhw,4nhh) scaled .55; - z5 = z4l+(nhh* right) rotated alpha; - x6l = x4l; y6r = 1.45nhh; - x7 = .9nhw; y7= nhh-1/8nhh; - z10 = z5r shifted (sqrt(2)*rthin/4,sqrt(2)*rthin/4); - - pickup penrazor scaled rthin rotated 45; - draw z1--z2r; draw z4l--z10; - penstroke z2e..z3e..z4e; - penstroke z5e..z6e..z7e; - penlabels(1,2,3,4,5,6,7,10); - shift_pic (-.2nhw, 0); -endchar; - -%%% -% Draw the crook needed for quaver rests and shorter. -% The crook extends left from the point z.i on the stem. -%%% -def crook(text i)= - forsuffixes $=i: - x3:=x.$-6.5fact; y3:=top y.$- 3fact; - x4:=x.$-6fact; y4:= y.$+.5fact; - draw z.${dir 240}..{dir 160}z3; - filldraw z3{dir 160}..z4{dir-20}..{dir 160}z3..cycle; - endfor -enddef; - -beginchar(63, 0, 3.25nhh#, 0); "8th rest"; - z1=(nhh,nhh); - z2-z1=whatever*dir 70; % Angle the stem at 70 degrees. -%%% -% Define the scaling factor `fact' implicitly. -% This value will be used for the shorter rests as well. -%%% - z2-z1=(5fact,1.7nhh); - pickup med_pen; - draw z1..z2; - crook(2); - shift_pic (-.35nhw, 0); - penlabels (1,2,3,4); -endchar; - -beginchar(64, 0, 3.25nhh#, 0); "16th rest"; - z1=(nhh,0); - z2-z1=whatever*dir 75; % Angle the stem at 75 degrees. - y2-y1=2.7nhh; - z5-z2=whatever*(z1-z2); y5=y2-nhh; - pickup med_pen; - draw z1..z2; - crook(2,5); - shift_pic (-.35nhw, 0); - penlabels (1,2,3,4,5); -endchar; - -beginchar(65, 0, 4nhh#, 0); "32th rest"; - z1=(nhh,0); - z2-z1=whatever*dir 80; % Angle the stem at 80 degrees. - y2-y1=3.7nhh; - z5-z2=whatever*(z1-z2); y5=y2-nhh; - z6-z2=whatever*(z1-z2); y6=y5-nhh; - pickup med_pen; - draw z1..z2; - crook(2,5,6); - shift_pic (-.35nhw, 0); - penlabels (1,2,3,4,5,6); -endchar; - -beginchar(66, 0, 4.75nhh#, 0); "64th rest"; - z1=(nhh,0); - z2-z1=whatever*dir 82; % Angle the stem at 82 degrees. - y2-y1=4.7nhh; - z5-z2=whatever*(z1-z2); y5=y2-nhh; - z6-z2=whatever*(z1-z2); y6=y5-nhh; - z7-z2=whatever*(z1-z2); y7=y6-nhh; - pickup med_pen; - draw z1..z2; - crook(2,5,6,7); - shift_pic (-.35nhw, 0); - penlabels (1,2,3,4,5,6,7); -endchar; - -%%%%%%% -message (""); -%%%%%%% - -def violin(expr reduction) = - gx:=reduction*-nhw; - gy:=reduction*nhh; - gthick:=1.5reduction*thick; - gthin:=.75reduction*med; - - x1=31/24gx+w; x4=23/24gx+w; x2=x10=3/4gx+w; x3r=w; x8l=15/16gx+w; - x5=x11r=15/8gx+w; x6=gx+w; x7=5/8gx+w; x9=5/4gx+w; - y1=5/8gy; y2r=y5r=2gy; y3=gy; y4r=0; y6=27/8gy; - y7l=5gy; y8l=11/2gy; y9=17/4gy; y10=y11=-7/8gy; - penpos1(gthin,160); - penpos2(gthick,90); - penpos3(gthick,0); - penpos4(5/4gthin,-90); - penpos5(3/2gthick,110); - penpos6(17/16gthick,130); - penpos7(gthin,-140); - penpos8(5/4gthick,-80); - penpos9(3/8gthick,0); - penpos10(gthin,0); - penpos11(1/2gthick,180); - penstroke z1e{nw}..z2e..z3e..z4e..z5e{up+ne}..z6e..{up+nw}z7e - ..z8e{sw}..{down}z9e{down}..{down}z10e..z11e; -%{{{ - currentpen:= pencircle; - draw z1{nw}..z2..z3..z4..z5{up+ne}..z6..{up+nw}z7 - ..z8{sw}..{down}z9{down}..{down}z10..z11; -%}}} - fill_circle ((3(x2-x4)), (x11+11/40gy, y11)); - penlabels(range 1 thru 11) -enddef; - -%beginchar(71, 8/3nhw#, 5.5nhh#, 1.5nhh#); "G-clef"; -beginchar(71, 8/3nhw#, 4.5nhh#, 2.5nhh#); "G-clef"; - violin(1); -% shift_pic (-.2nhw, 0); % T.59 - shift_pic (-.2nhw, -nhh); % T.60 -endchar; - -%beginchar(72, 7/3nhw#, 3nhh#, 2nhh#); "small G-clef"; -beginchar(72, 7/3nhw#, 3nhh#, 3nhh#); "small G-clef"; - violin(.8); -% shift_pic (-.3nhw, 0); %T.59 - shift_pic (-.3nhw, -nhh); %T.60 -endchar; - -def bass (expr reduction) = - fx:=reduction*nhw; - fy:=reduction*nhh; - fthick:=reduction*thick; - - x2=.8fx; y2=3nhh; - x1=x2r+.26fx; y1=y2; - x3=x2+.71fx; y3r=y2+1fy; - x4=x3+.71fx; y4=y2-.2fy; - x6=x2-6reduction*thinwidth; y6=y2-2.2fy; - x7=x4+.50fx; y7=y2+.38fy; - - penpos2(.6fthick,180); - penpos3(.6fthick, 90); - penpos4(2fthick,0); - penpos6(.4fthick,-10); - - fill_circle (.35fx, z7); - add_mirror ((0,y2), (1,y2)); - fill_circle ((2(x2r-x1)), z1); - - penstroke z2e{up}..{right}z3e{right}..{down}z4e{down}..{left+.1down}z6e; -%{{{ - currentpen:= pencircle; - draw z2{up}..{right}z3{right}..{down}z4{down}..{left+.1down}z6; -%}}} - penlabels(1,2,3,4,6) -enddef; - -beginchar(73, 8/3nhw#, 4nhh#, 0); "F-clef"; - bass(1); -% shift_pic (-.35nhw, 0); % T.59 - shift_pic (-.35nhw, -3nhh); % T.60 -endchar; - -beginchar(74, 7/3nhw#, 4nhh#, 0); "small F-clef"; - bass(.8); -% shift_pic (-4/15nhw, 0); % T.59 - shift_pic (-4/15nhw, -3nhh); % T.59 -endchar; - -def alt(expr reduction, yshift) = - nh:=h*reduction; - athick:=1/10nh; - ahigh:=1/2nh; - radius:=5/4thick*reduction; - - x4=13/16nh+3thinwidth; x5=9/16nh; - x6=1/2nh; x9=x10=2/3nh; x11=17/32nh; - y4=yshift+31/50ahigh; y5=yshift+1/2ahigh; - y6=yshift; y9=yshift+1/9ahigh; - y10=yshift+ahigh; y11=yshift+11/14ahigh; - penpos4(athick,180); - penpos5(1/8athick,0); - penpos6(athick,0); - penpos9(1/3athick,90); - penpos10(1/3athick,-90); - penpos11(1/2athick,0); - - penstroke z5e..{sw+down}z6e; - penstroke z5e{se+3down}..{right}z9e{right}..{up}z4e{up} - ..{left}z10e{left}..{sw+3down}z11e; - fill_circle (2radius, (z11l+(radius, -.05nhh))); - fill_square (athick, ahigh, (5/16nh-1/2athick,yshift)); - fill_square (.25athick, ahigh, (x6l-.25athick,yshift)); - add_mirror ((0,yshift),(1,yshift)); - penlabels(4,5,6,9,10,11) -enddef; - -beginchar(75, 8/3nhw#, 4nhh#, 0); "Alto clef"; - alt(1, 2nhh); -% shift_pic (-.45nhw, 0); % T.59 - shift_pic (-.45nhw, -2nhh); % T.60 -endchar; - -beginchar(76, 7/3nhw#, 4nhh#, 0); "small Alto clef"; - alt(.8 ,2nhh); -% shift_pic (-.3nhw, 0); % T.59 - shift_pic (-.3nhw, -2nhh); % T.60 -endchar; - -beginchar(77, 8/3nhw#, 4nhh#, 0); "drum clef"; - fill_square (.3nhw, .5h, (.85nhw,1nhh)); - add_mirror ((w/2,0),(w/2,1)); -% shift_pic (.2nhw, 0); % T.59 - shift_pic (.2nhw, -2nhh); % T.60 -endchar; - -beginchar(103, 8/3nhw#, 4nhh#, nhh#); "oldstyle G-clef"; - def penslopeI= (.35nhh/cosd45)+blacker,45 enddef; - def penslopeII= (.35nhh/cosd32.5)+blacker,32.5 enddef; - def penslopeIII= (.4nhh/cosd32.5)+blacker,32.5 enddef; - def penslopeIV= (max(1,lthick/cosd32.5)),122.5 enddef; - - x1l=1.5nhw; x2l=x3l=x4r=x1l+2/5nhw; - x1l-x5l=x3r-x1l; x6l=x15r=x5l; x7r=x1=x14r; x8=x2; - y1l=y2l=1.45nhh; y3l=y4r; - y4l=0; y5=y3r; y6l=y15r; y7l=y8r=3nhh; y14r=y7r; - z15r-z14r=whatever*dir(180+32.5); - penpos1(penslopeI); - penpos2(penslopeI); % /7\ 6(15) - penpos3(penslopeII); % 6 8 7(14) - penpos4(penslopeIII); % | - penpos5(penslopeII); % | 1-2 - penpos6(penslopeII); % | | - penpos7(penslopeII); % 5 3 - penpos8(.35nhh,90); % \4/ - penpos14(penslopeIV); - penpos15(penslopeIV); - penstroke z1e--z2e--z3e; - fill unitsquare xscaled (x3r-x4l) yscaled lthick - shifted z4l rotatedaround (z4l,32.5); - penstroke z4e--z5e{dir85}..z6e; - penstroke z7e--z8e; penstroke z14e--z15e; - - x9=x5l=x16-.25nhw; x10l=x1l; x11=x10-.1nhw; x12=x8; - x17l=x2r+.05nhw; x13r=x2l-.1nhw; - y9r=-nhh; y16l=y9l-.01nhh; y10=0; - y11=3.5nhh; y12r=y8r; y17r=y8r+.2nhh; y13r=4nhh; - % 13 - penpos12(2lthick,90); % / \ - penpos17(3hlthick,180); % 11 17 - penpos13(.35nhh+blacker,-90); % | 12 - penpos11(max(lthick,1),0); % | - penpos10(max(lthick,1),0); % 10 - penpos16(.475nhh+blacker,-90); % / - penpos9(.5nhh+blacker,-90); % 9-16 - - penstroke z12e..z17e{dir80}..z13e..{down}z11e..{down}z10e{down}.. - {left}z16e..z9e; - shift_pic (-.25nhw,0); - penlabels (range 1 thru 12); - shift_pic (0, -nhh); % T.60 -endchar; - -beginchar(98, 8/3nhw#, 3.25nhh#, 0); "gregorian C clef"; - x1=x4=0; x2=x3=gregwidth; y1=y2=-y3=-y4=.5gregwidth-lthick; - fill z1{dir 15}..z2--z3{dir 165}..z4--cycle; - save_elempic; - pickup med_pen; draw bot rt z1..{down}(-.01nhw,-.5nhh); - shift_pic(nhw,2.5nhh); - add_mirror ((0,2nhh),(1,2nhh)); - savepic; - shift_pic (0,-2nhh); -endchar; - -beginchar(122, 8/3nhw#, 4.25nhh#, 0); "gregorian F clef"; - callpic; - add_elempic (.1nhw,2nhh); - fill_square (med, 1.5nhh, (.75nhw,.8nhh)); - shift_pic (1/3nhw,-2nhh); -endchar; - -%%%%%%% -message (""); -%%%%%%% - -beginchar(14, 0, nhh#, 0); "song system limit up"; - x1=y1=0; x2=1.5nhw; y2=nhh; - penpos1(thick, 90); penpos2(thin, 90); - penstroke z1e{right}..{dir80}z2e; -%{{{ - currentpen:=pencircle; draw z1{right}..{dir80}z2; -%}}} - savepic; -endchar; - -beginchar(15, 0, 0, nhh#); "song system limit down"; - call_mirror (origin, right); -endchar; - -beginchar(16, 0, 0, 0); "used for volta"; - fill_square (lthick, 2.5nhh, (0,-.5nhh)); -endchar; - -beginchar(17, 0, 0, 0); "used for volta"; - fill_square (lthick, 2.5nhh, (0,-2.5nhh)); -endchar; - -% 'polyrhythmik' {\meterfrac{3+2+3}8}, e.g. Bart\'ok -beginchar(57, 2nhh#, 1.5nhh#, 0); "big plus sign"; - pickup pencircle scaled .3nhh; - draw lft(.5nhh,.9nhh)..rt(1.5nhh,.9nhh); - draw bot(nhh,.4nhh)..top(nhh,1.4nhh); -endchar; - -beginchar(79, 0, 4nhh#, 0); "caesura";% other breathmark - pickup penrazor scaled thick; - draw (.3nhw+thick, 3.4nhh)--(.7nhw+thick, 4.6nhh); -endchar; - -beginchar(80, 0, 2.25nhh#, 0); "fermata up"; - x1 = -.5nhw; x2=.5(x1+x3); x3 = 1.5nhw; - y1 = y3 = nhh; y2 = 2.3nhh; - penpos1(thinwidth,165); - penpos2(.9beamht+thin,90); - penpos3(thinwidth,15); - penstroke z1e{dir75}..z2e..{dir-75}z3e; - fill_circle (beamht, (x2, y1+.5beamht)); -%{{{ - currentpen:= pencircle; draw z1{dir 75}..z2..{dir-75}z3; - add_mirror ((x2, 0),(x2, 1)); -%}}} - savepic; - penlabels(1,2,3); -endchar; - -beginchar(81, 0, 0, 2.25nhh#); "fermata down"; - call_mirror (origin, right); -endchar; - -beginchar(82, 5/3nhw#, 4nhh#, 0); "allabreve"; - fit:= .025nhw; - 2x2 = 2x4 = x1 + 1/2nhh = w; - x3r = 0; 2y1 = 3y2 = y4r = 3nhh; - y3r = 2nhh; x5 = w -1/2nhh; y5 = 3nhh -1/2nhh; - z6r = z5r + (-1/40nhh, 1/20nhh); - penpos1(max(1,med), 0); - penpos2(max(1,med), -90); - penpos3(1/4nhh+thick,180); - penpos4(max(1,med), 90); - penpos5(max(1,med), 0); - penpos6(1/4nhh+med,45); - penstroke z1e..z2e..z3e..z4e..z5e; - fill rt z1r..lft z1l..cycle; - fill_circle (.35nhw+blacker, (z6 + (-2fit, fit))); - shift_pic (.5nhh,0); - savepic; - - pickup med_pen; - draw (4/5nhw+.5nhh, y2r-3/8nhh)--(4/5nhw+.5nhh, y4r+3/8nhh); - penlabels(1,2,3,4,5,6); - save_elempic; - shift_pic (0,-2nhh); -endchar; - -beginchar(83, 5/3nhw#, 3.25nhh#, 0); "C"; - callpic; - shift_pic (0,-2nhh); -endchar; - -beginchar(84, 10/3nhw#, 3.25nhh#, 0); "reverseC"; - callpic; - add_mirror ((11/6nhw,0),(11/6nhw,1)); - shift_pic (0,-2nhh); -endchar; - -beginchar(123, 5/3nhw#, 3.25nhh#, 0); "reverseallabreve"; - add_elempic (0,0); - mirror ((13/12nhw,0),(13/12nhw,1)); - shift_pic (0,-2nhh); -endchar; - -beginchar(121, 0, 0, 0); "double thumb bracket"; - mh:=0.625nhh; - fill_square (lthick, mh, origin); - fill_square (.55nhw, lthick, origin); - add_mirror ((0,mh),(1,mh)); - shift_pic (-.75nhw, -mh); -endchar; - -%%%%%%% -message (""); -%%%%%%% - -beginchar(55, 0, 4nhh#, 0); "repeat colons"; - fill_circle (1/3nhw+blacker, (0, 3/2nhh)); - add_mirror ((0, 2nhh),(1, 2nhh)); - shift_pic(0,-2nhh); -endchar; - -beginchar(78, 0, 4nhh#, 0); "due volte"; - fill_circle ((1/3nhw+blacker),(-.75nhh,2.5nhh)); - addto currentpicture also currentpicture rotatedaround ((0,2nhh), 180); - pickup penrazor scaled (1/3nhw+blacker); - draw (-nhh, nhh)--(nhh, 3nhh); -endchar; - -beginchar(85, 0, 3.25nhh#, 0); "coda"; - mh:=3nhh; - x2 = 2nhw-x4 = 1/6mh; y2 = y4 = 1/2mh; - x3 = x5 = nhw; y3 = mh-y5 = 5/6mh; - pickup thin_pen; - draw (0,mh/2)--(2nhw,mh/2); draw (nhw,0)--(nhw,mh); - savepic; - pickup coda_pen; - draw z2..z3..z4..z5..cycle; - shift_pic (-nhw, 0); - labels (1,2,3,4); -endchar; - -beginchar(105, 0, 3.25nhh#, 0); "coda II"; - mh:=3nhh; - callpic; - x2 = x5 = 1/6mh; y2 = y3 = 5/6mh; - x3 = x4 = 2nhw-x2; y4 = y5 = 1/6mh; - pickup coda_pen; - draw z2--z3--z4--z5--cycle; - shift_pic (-nhw, 0); - labels (1,2,3,4); -endchar; - -beginchar(86, 0, 3.25nhh#, 0); "segno"; - x1= .5nhw; y1 = 1.75nhh; x4=-.5x1; y4=.4nhh; - x5=.7x1; y5=y6=3.05nhh; x6=x5-x1; - z1'= (x1+1,y1); - penpos1'(.5nhh+blacker, 80); - penpos5(max(1,thin), -110); - penpos6(max(1,1.2thin), -70); - fill_circle (.5nhh, (x5-.2nhh,y5l-.13nhh)); - fill_circle (thick+.1nhh, (x4, y4+.9nhh)); - penstroke z1'e{dir170}..{ne}z6e..z5e; - pickup penrazor scaled max(1,thin); - draw z4--z1; - penlabels (1,5,6); - addto currentpicture also currentpicture rotatedaround (z1, 180); -endchar; - -beginchar(110, 0, 5.5nhh#, 2nhh#); "segno II"; - mw:=2.5nhh; - gamma:=36.9; - dist:=1nhh+.75beamht; - gthick:=beamht+blacker; - - x1'=x3'=x7=x16=2x1=2x10=2x13=.5mw; x9=x14=x2; x3r=mw-.2nhh; - x11=x5; x15=x3; mw-x8=x12=1/3nhh; - y1'=dist; y3'=y1'-.5dist; y4'+dist=y9-2dist=y2; y10-2dist=y13+dist=y1; - y11=y5+2dist; y14=y2-dist; y8=y6-.1dist+2dist; y12=y3+.1dist-dist; - y15=y3-dist; y16r=-d; y7l=3.25nhh+2dist; - z1-z1'=z1'-z2=whatever*dir-gamma; - z3-z3'=whatever*dir-gamma; z2-z4=whatever*dir(-90-gamma); - z2-z4'=whatever*dir-90; z4-z4'=whatever*dir-gamma; - z5=z3 rotatedaround (z1',180); z6=z4 rotatedaround (z1',180); - - penpos1(gthick, gamma); penpos2(gthick, gamma); - penpos3(max(1,thin),-90+gamma); penpos4(.9gthick,-180+gamma); - penpos5(max(1,thin),-90+gamma); penpos6(.9gthick,-180+gamma); - penpos7(.3gthick,-90-gamma); penpos8(.5gthick,-180+gamma); - penpos9(gthick, gamma); penpos10(gthick, gamma); - penpos11(.5gthick,-90+gamma); penpos12(.5gthick,-180+gamma); - penpos13(gthick, gamma); penpos14(gthick, gamma); - penpos15(.5gthick,-90+gamma); penpos16(.3gthick+1,-90-gamma); - - penstroke z6e{dir(180-gamma)}..z5e..z1e---z2e..z3e..{dir(180-gamma)}z4e; - add_shift (0,2dist); - add_shift (0,-dist); - unfill (0,-nhh)--(mw,-nhh)--(mw,-d)--(0,-d)--cycle; - unfill (0,5nhh)--(mw,5nhh)--(mw,6nhh)--(0,6nhh)--cycle; cullit; - - penstroke z9e---z10e..z11e..z7e..z8e; - penstroke z13e---z14e..z15e..z16e..z12e; - - dotthick:=.65nhh+blacker; fit:=.15nhh; - fill_circle(dotthick,(x8-fit,y8-.5dotthick+fit+.02nhh)); - fill_circle(dotthick,(x12+fit,y12+.5dotthick-fit-.02nhh)); - - pickup thin_pen; - draw (3/8mw,1/3nhh)--(3/8mw,4nhh+1/3nhh); - draw (5/8mw,-1/3nhh)--(5/8mw,4nhh-1/3nhh); - penlabels (range 1 thru 16); - shift_pic(-mw,0); -endchar; - -%%%%%%% -message (""); -%%%%%%% - -beginchar (67, 0, nhh#, 0); "turn"; - x1=2nhw-x6=.4nhw; y1r=h; y6=h-y1; - x2r=0; y2=.5h; x5=2nhw-x2; y5=h-y2; - x3=.44nhw; y3r=0; x4=2nhw-x3; y4=h-y3; - penpos1(med, 90); - penpos2(med, 180); - penpos3(thick,-40); - penpos4(thick,-40); - penpos5(med, 180); - penpos6(med, 90); - penstroke z1e..{down}z2e{down}..{right}z3e{right} - ..{right}z4e{right}..{down}z5e{down}..z6e; - fill_circle ((1/4nhh+thick), (x1,y1r-thick)); - fill_circle ((1/4nhh+thick), (x6,y6l+thick)); - shift_pic (-.5nhw, 0); - penlabels(1,2,3,4,5,6); - savepic; -endchar; - -beginchar (68, 0, nhh#, 0); "backturn"; - call_mirror ((.5nhw,0), (.5nhw,1)); -endchar; - -def setpar = - off:= .3nhw; x2=x1+off; x3=x2+off; x4=x3+off; - y1= y3=.75nhh-y2=.75nhh-y4=.15nhh; -enddef; - -beginchar(87, 0, nhh#, 0); "shake"; - x1=-.15nhw; setpar; - pickup pensquare xscaled (thick+.15nhh) yscaled med rotated 52; - draw z1--z2--z3--z4; - save_elempic; - add_elempic (2off,0); - savepic; -endchar; - -beginchar(88, 0, nhh#, 0); "(long or double) shake"; - callpic; - add_elempic (2*2off,0); - shift_pic (-.3nhw, 0); - save_elempic; -endchar; - -beginchar(89, 0, nhh#, 0); "mordent"; - callpic; - fill_square (med, 1.5nhh, (.5nhw,-.375nhh)); -endchar; - -beginchar(119, 0, nhh#, 0); "(long or double) mordent"; - currentpicture:= elem_pic; savepic; - fill_square (med, 1.5nhh, (.5nhw,-.375nhh)); -endchar; - -beginchar(106, 0, 1.5nhh#, 0); "Pince with line"; - callpic; - pickup med_pen; - draw (-.55nhw, 0)--(-.55nhw, h); -endchar; - -beginchar(107, 0, 1.5nhh#, 0); "Pince with hook nw"; - callpic; - x1=-.45nhw; setpar; - pickup med_pen; - z5=1.75[z3,z2]-(x3-x1,0); z6=z1 rotatedaround (z5,90); - draw (z1..z5{z2-z3}..{z3-z2}z6) shifted -(.5thick, .15nhh); -endchar; - -beginchar(108, 0, nhh#, 0); "Pince with hook sw"; - callpic; - x1=-.45nhw; setpar; - pickup med_pen; - z5=1.5[z2,z1]-.75(.5thick,.15nhh); z6=z2 rotatedaround (z5,-90); - draw (z1..z5{z1-z2}..{z2-z1}z6); -endchar; - -beginchar(109, 0, 1.5nhh#, 0); "Pince with hook ne"; - callpic; - x1=1.35nhw; setpar; - pickup med_pen; - z5=1.5[z1,z2]; z6=z1 rotatedaround (z5,-90); - draw (z1..z5{z2-z1}..{z1-z2}z6); -endchar; - -beginchar(69, nhw#, .5nhh#, 0); "trille-element"; - x1=-1; y1=y2=y3=.5h; x3=2x2=nhw; - pickup penrazor scaled 1.5thick rotated 50; - draw z1{ne}..{se}z2{se}..{ne}z3; -endchar; - -beginchar(70, 0, nhh#, 0); "arpeggio-element"; - x1=x2=x3=.2nhw-1; y1=0; y3=2y2=nhh+1; - pickup penrazor scaled (thick+.16nhh) rotated 45; - draw z1{ne}..{nw}z2{nw}..{ne}z3; - shift_pic (-nhw, 0); -endchar; - -%%%%%%% -message (""); -%%%%%%% - -def pedalstar (text rot)= - x4=-x1=min(.05nhh,0.35pt); y1=y4=0; x3=-x2=.14nhh; - y3=y2=2y5=2y6=.4nhh; x6=-x5=1.1x4; - p:=(z1..z5..z2..z3..z6..z4--cycle) shifted (0, .2nhh); - forsuffixes $=rot: fill p rotated $; endfor - pickup med_pen; - draw quartercircle scaled .4nhh; - add_mirror (origin, up); - add_mirror (origin, right); - labels (1,2,3,4); - shift_pic (.5nhw, .8nhh); -enddef; - -beginchar(33, 0, 1.5nhh#, 0); "pedal (release) star I"; - pedalstar (0,60); -endchar; - -beginchar(104, 0, 1.5nhh#, 0); "pedal star II"; - pedalstar (0,45,90); -endchar; - -beginchar(34, 0, 1.5nhh#, 0); "pedal I"; - mw:= 1.25nhw; mh:=1.7nhh; - - x1=.425mw; y1=4/18mh; - x2=.2mw; y2=4/18mh; - x3=x1; y3r=0; - x4=.65mw; y4=.35mh; - x5=.475mw; y5=.83mh; - penpos1(.75thin,0); penpos4(.275nhh+thin,60); - penpos2(.15nhh+thin,135); penpos5(.025nhh+med,0); - penpos3(.025nhh+med,-90); - - penstroke z1e{up}..z2e..z3e..z4e..{up+.5right}z5e; - - fill lft z1l{up+ne}..{down+se}rt z1r{down+sw}..{up+nw}cycle; - fill rt z5l{up+ne}..{down+se}lft z5r{down+sw}..{up+nw}cycle; -%{{{ - currentpen:= pencircle; draw z1{up}..z2..z3..z4..{up+.5right}z5; -%}}} - - x6=mw-x12; y6=.75mh; - x7=mw-x11; y7=.65mh; - x8=.25mw; y8=y10; - x9=x8+(x10-x8)/2; y9r=mh; - x10=.8mw; y10=.9mh; - x11=.88mw; y11=y7; - x12=.7mw; y12=.7mh; - penpos6(thin,-80); penpos10(1.2med,90); - penpos7(.25nhh+thin,-110); penpos11(.25nhh+thin,-70); - penpos8(med,90); penpos12(thin,-100); - penpos9(.9med,90); - - penstroke z6e..z7e..z8e..z9e..z10e..z11e..z12e; -%{{{ - currentpen:=pencircle; draw z6..z7..z8..z9..z10..z11..z12; -%}}} - penlabels (range 1 thru 12); - savepic; - shift_pic (-.125nhw, 0); -endchar; - -beginchar(35, 0, 1.5nhh#, 0); "pedal II"; - callpic; %%% ->P - mw:=3nhw; mh:=1.7nhh; - fill_circle (.15mh, (.945mw-.15mh/2, .15mh/2));%%% ->. - - x1=.5mw; y1=.9mh; - x2=.77mw; y2=.58mh; - x3=.815mw; y3=.2mh; - x4= x2; y4r=0; - x5=.63mw; y5=.22mh; - x6= x2; y6=y2; - penpos1(.75med,90); penpos4(.025nhh+med,-90); - penpos2(.1125nhh+med,30); penpos5(.1125nhh+thin,-135); - penpos3(.05nhh+med,0); penpos6(med,100); - - penstroke (z1e{right}..z2e..z3e..z4e..z5e{dir 110}..z6e);%%% ->d - fill lft z1l{ne}..{nw}rt z1r{sw}..{se}cycle; - - x7=x5; y7=y5; - x8=.55mw; y8r=0; - x9=x1; y9=.56mh; - x10=x11+.1mw; y10=y11+.1mh; - x11=.375mw; y11r=0; - x12=.28mw; y12=.25mh; - penpos7(thin,-75); penpos10(1.2thin,-45); - penpos8(.05nhh+med,-90); penpos11(.225nhh,-100); - penpos9(.0625nhh+thin,80); penpos12(thin,-125); - - penstroke z7e..z8e..z9e & z9e{dir-30}..{dir-150}z10e..z11e;%%% ->e - penstroke z12e..z11e; - penlabels (range 1 thru 12); - shift_pic (-(.125nhw+.25nhw), 0); -endchar; - -%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -%%%%%%% -message (""); -%%%%%%% - -pen beam_pen; -beam_pen:= penrazor scaled beamht rotated 90; - -for LOOP=0 upto 9: - longueur:= 2; - for loop=0 upto 5: - beginchar(LOOP*6+loop+128, longueur, 0, 0); - pickup beam_pen; - draw origin--(lft w, w*(.05*(LOOP+1))); - savepic; - endchar; - - beginchar(LOOP*6+loop+64+128, longueur, 0, 0); - call_mirror (origin,right); - endchar; - - longueur:= 2*longueur; - endfor -endfor; -end diff --git a/mf/musixsps.mf b/mf/musixsps.mf deleted file mode 100644 index 26e350f0ee..0000000000 --- a/mf/musixsps.mf +++ /dev/null @@ -1,295 +0,0 @@ -font_identifier := "music_special_symbols"; - -% Here are two types of pianobrackets available, they are absolute compatible, -% so choose this one you prefer (search for '%!!!') - -% free pos: 196-255 - -mode_setup; - -font_size 20pt#; - -nhh#:=5pt#; -nhw#:=6pt#; - -qqs#=.4pt#; %width of lines -qqw#=10pt#; %length of horizontal stroke. - -med#:=1/33designsize; -thick#:=1/16designsize; - -thinwidth:=0.125pt; - -define_pixels(qqw,nhh,nhw); -define_blacker_pixels(med,thick); - -qqs:=ceiling(qqs#*hppp); % the way rule widths are calculated - -pair sw; -sw = down+left; - -path p; -picture save_pic; - -pen line_pen; -line_pen:= pencircle scaled qqs; - -%%%%%%% -message (""); -%%%%%%% - -def glissando (expr theta)= - x1=-1; y1=0; z2=z1+(.5nhw,0); z3=z1+(nhw+1,0); - p:= z1{1.25up+right}..{1.25down+right}z2{1.25down+right}..{1.25up+right}z3; - pickup penrazor scaled (.075nhw+thick) rotated (theta+65); - draw p rotated theta; - labels (1,2,3); -enddef; - -for slope=1 upto 8: - - beginchar(slope-1, (cosd(10slope))*nhw#,(sind(10slope))*nhw#, 0); - " glissando element slope "&decimal (10slope)&" degree"; - glissando (10slope); - save_pic:= currentpicture; - endchar; - - beginchar(8+slope-1, (cosd(10slope))*nhw#, (sind(10slope))*nhw#, 0); - " glissando element slope "&decimal (-10slope)&" degree"; - currentpicture:= save_pic reflectedabout (origin, right); - endchar; - -endfor; - -%%%%%%% -message (""); -%%%%%%% - -def tabulatur (expr nd)= - hwidth:=1/5w; - x1=x2=y2=y3=0; x3=w; y1=-nd; - fill unitsquare xscaled (w+2thinwidth) yscaled (med+.2pt) - shifted(-thinwidth,0); - pickup pencircle scaled max(1,.2pt+blacker); - for v=1 upto 5 : - draw (z2--z3) shifted (0,v*-hwidth); - endfor; - - for v=0 upto 5 : - draw (z1--z2) shifted (v*hwidth,0); - endfor; - labels (1,2,3); -enddef; - -shift:=.15nhh; -def Circle (expr nh)= - x1l=.1w; x2=x4=.5w; x3l=.9w; - y1=y3=.5nh+shift; y2=.1nh+shift; y4=.9nh+shift; - penpos1(med, 0); - penpos2(thinwidth,90); - penpos3(med,180); - penpos4(thinwidth, 270); - penstroke z1e..z2e..z3e..z4e..cycle; - pickup pencircle; draw z1..z2..z3..z4..cycle; -enddef; - -def Cross (expr nh)= - x1=x3=.2w; x2=x4=.8w; - y1=y4=.2nh+shift; y2=y3=nh-.2nh+shift; - pickup pencircle scaled med; - draw z1--z2; draw z3--z4; - labels (1,2,3,4); -enddef; - -beginchar(16, 3nhw#, 0, 0);" small grid"; - tabulatur (108/25nhh); -endchar; - -beginchar(17, 3/2nhw#, 0, 0); " small dot"; - fill fullcircle scaled .54nhh shifted (w,-.36nhh); -endchar; - -beginchar(18, 3nhw#, 0, 0); " small bar"; - fill unitsquare xscaled w yscaled .24nhh shifted (0,-.48nhh); -endchar; - -beginchar(19, 3/5nhw#, 0, 0); " small circle"; - Circle (.72nhh); -endchar; - -beginchar(20, 3/5nhw#, 0, 0); " small cross"; - Cross (.72nhh); -endchar; - -% the next seems to be senseless, but it isn't - -beginchar(28, 3/5nhw#, 0, 0); " small blank"; -endchar; - -%%%%%%% -message (""); -%%%%%%% - -hooklength:=4.5pt; - -beginchar(21, 0, 0, 0);" bracket hook up"; - pickup line_pen; - draw origin--(0, hooklength); -endchar; - -beginchar(22, 0, 0, 0);" bracket hook down"; - pickup line_pen; - draw origin--(0, -hooklength); -endchar; - -beginchar(23, nhw#, 0, 0);" upper octaveline"; - pickup line_pen; - draw (.33w, 1.1nhw)--(.66w, 1.1nhw); -endchar; - -beginchar(24, 0, 0, 0);" final hook for upper octaveline"; - pickup line_pen; - draw (1.1nhw,0)--(1.1nhw, 1.1nhw); - draw (.33nhw, 1.1nhw)--(1.1nhw, 1.1nhw); -endchar; - -beginchar(25, nhw#, 0, 0);" lower octaveline"; - pickup line_pen; - draw (.33w, 0)--(.66w, 0); -endchar; - -beginchar(26, 0, 0, 0);" final hook for lower octaveline"; - pickup line_pen; - draw (1.1nhw,0)--(1.1nhw, 1.1nhw); - draw (.33nhw,0)--(1.1nhw, 0); -endchar; - -beginchar(27, .75nhw#, 0, 0);" used for \bracket"; - pickup line_pen; - draw origin--(.5nhw, 0); -endchar; - -beginchar(29, qqw#, 0, 0);" line ydim 0pt"; - pickup line_pen; - draw origin--(w,0); -endchar; - -% lines length xdim 10pt, ydim (-).25 to (-)5pt - -for j=1 upto 20: - beginchar(29+j, qqw#, 0, 0); " line ydim "&decimal .25j&"pt"; - pickup line_pen; - draw origin--(w, .25pt*j); - save_pic:= currentpicture; - endchar; - - beginchar(49+j, qqw#, 0, 0); " line ydim -"&decimal .25j&"pt"; - currentpicture:= save_pic reflectedabout (origin, right); - endchar; -endfor; - -%%%%%%% -message (""); -%%%%%%% - -for n:=1 upto 14: - beginchar(70+n-1, 0, 0, 0); - " fullcircle diameter "&decimal ((n+2)*2)&" pt"; - diameter:=(n+2)*2pt; - pickup line_pen; - draw fullcircle scaled diameter; - endchar; -endfor; - -%%%%%%% -message ("<(de-)crescendi>"); -%%%%%%% - -widthstep:=nhw; -crescendowidth:=.5nhh; % \Internote - -for n:=1 upto 32: - beginchar(84+n-1, 0, 3pt#, 3pt#); - " crescendo length "&decimal n&" noteheadwidths"; - pickup line_pen; - draw (n*widthstep, crescendowidth+.0075n*crescendowidth)--(0,0); - addto currentpicture also currentpicture reflectedabout (origin,right); - save_pic:= currentpicture; - endchar; - - beginchar(116+n-1, 0, 3pt#, 3pt#); - " decrescendo length "&decimal n&" noteheadwidths"; - currentpicture:= save_pic reflectedabout(origin, up) shifted (n*widthstep,0); - endchar; -endfor; - -%%%%%%% -message (""); -%%%%%%% - -% lastbrace is adjustable (originally 99) - -firstbrace:=20; % smallest brace is 2*20 pt (\simeq 14mm) -lastbrace:=67; % largest brace is 2*67 pt (\simeq 47mm) - -%%% from Stanislav Kneifl - -def drawpianobracket (expr height) = - u# := 1nhh#/5pt# * 1pt#; - v# := (height/40) * 1pt#; - define_pixels (u, v); -% beginchar (height-firstbrace, 1.25nhh#, 0, 0); - beginchar (height-firstbrace+148, 0, 0, 0); - z1 = origin; - z2 = (4.7u, 7v); - z3 = (3.6u, 16.5v); - z4 = (1.9u, 25v); - z5 = (2.28u, 32v); - z6 = (w, 40v); - penpos1 (max(1,0.1u), 125); - penpos2 (1.2u, 180); - penpos3 (3.2u, 195); - penpos4 (2.5u, 180); - penpos5 (1.14u, 180); - penpos6 (max(2,0.3u), 150); - penstroke z1e{dir 35}..z2e..z3e..z4e..z5e..{dir 60}z6e; - currenttransform := identity reflectedabout ((0,0),(1,0)); - penstroke z1e{dir 35}..z2e..z3e..z4e..z5e..{dir 60}z6e; - currenttransform := identity; -% inserted - currentpicture:=currentpicture shifted (round(-1.75nhh), 0); -% - endchar; -enddef; - -def bigbrace(expr v) = - beginchar (v-firstbrace+148, 0, 0, 0); - " brace vsize "&decimal round(2v*pt#)&"pt"; - vwidth:=v*pt; - hwidth:=max(.1vwidth,3.25pt); - hwidth:=min(hwidth,6.5pt); - actwidth:=.035vwidth; - x1=.25nhw; y1=vwidth; - x2l=-.8hwidth; y2=2/3vwidth; - x3r=.2hwidth; y3=1/3vwidth; - x4=-hwidth; y4=0; - penpos1(max(1,.25pt),-35); - penpos2(1.5med+actwidth,40); - penpos3(1.75med+actwidth,45); - penpos4(max(1,.2pt),-90); - penstroke z1e..z2e..z3e..{left+sw}z4e; - currentpen:= pencircle; draw z1..z2..z3..{left+sw}z4; - addto currentpicture also currentpicture reflectedabout (origin, right); - penlabels(1,2,3,4); - currentpicture:= currentpicture shifted (round(-.75nhh), 0); - endchar; -enddef; - -%!!! comment the line 'bigbrace' and uncomment the line 'drawpianobracket' - -for v=firstbrace upto lastbrace : - bigbrace (v); -% drawpianobracket (v); -endfor; - -end diff --git a/mf/musixspx.mf b/mf/musixspx.mf deleted file mode 100644 index 3b3f432d9f..0000000000 --- a/mf/musixspx.mf +++ /dev/null @@ -1,295 +0,0 @@ -font_identifier := "music_special_symbols"; - -% Here are two types of pianobrackets available, they are absolute compatible, -% so choose this one you prefer (search for '%!!!') - -% free pos: 196-255 - -mode_setup; - -font_size 20pt#; - -nhh#:=5pt#; -nhw#:=6pt#; - -qqs#=.4pt#; %width of lines -qqw#=10pt#; %length of horizontal stroke. - -med#:=1/33designsize; -thick#:=1/16designsize; - -thinwidth:=0.125pt; - -define_pixels(qqw,nhh,nhw); -define_blacker_pixels(med,thick); - -qqs:=ceiling(qqs#*hppp); % the way rule widths are calculated - -pair sw; -sw = down+left; - -path p; -picture save_pic; - -pen line_pen; -line_pen:= pencircle scaled qqs; - -%%%%%%% -message (""); -%%%%%%% - -def glissando (expr theta)= - x1=-1; y1=0; z2=z1+(.5nhw,0); z3=z1+(nhw+1,0); - p:= z1{1.25up+right}..{1.25down+right}z2{1.25down+right}..{1.25up+right}z3; - pickup penrazor scaled (.075nhw+thick) rotated (theta+65); - draw p rotated theta; - labels (1,2,3); -enddef; - -for slope=1 upto 8: - - beginchar(slope-1, (cosd(10slope))*nhw#,(sind(10slope))*nhw#, 0); - " glissando element slope "&decimal (10slope)&" degree"; - glissando (10slope); - save_pic:= currentpicture; - endchar; - - beginchar(8+slope-1, (cosd(10slope))*nhw#, (sind(10slope))*nhw#, 0); - " glissando element slope "&decimal (-10slope)&" degree"; - currentpicture:= save_pic reflectedabout (origin, right); - endchar; - -endfor; - -%%%%%%% -message (""); -%%%%%%% - -def tabulatur (expr nd)= - hwidth:=1/5w; - x1=x2=y2=y3=0; x3=w; y1=-nd; - fill unitsquare xscaled (w+2thinwidth) yscaled (med+.2pt) - shifted(-thinwidth,0); - pickup pencircle scaled max(1,.2pt+blacker); - for v=1 upto 5 : - draw (z2--z3) shifted (0,v*-hwidth); - endfor; - - for v=0 upto 5 : - draw (z1--z2) shifted (v*hwidth,0); - endfor; - labels (1,2,3); -enddef; - -shift:=.15nhh; -def Circle (expr nh)= - x1l=.1w; x2=x4=.5w; x3l=.9w; - y1=y3=.5nh+shift; y2=.1nh+shift; y4=.9nh+shift; - penpos1(med, 0); - penpos2(thinwidth,90); - penpos3(med,180); - penpos4(thinwidth, 270); - penstroke z1e..z2e..z3e..z4e..cycle; - pickup pencircle; draw z1..z2..z3..z4..cycle; -enddef; - -def Cross (expr nh)= - x1=x3=.2w; x2=x4=.8w; - y1=y4=.2nh+shift; y2=y3=nh-.2nh+shift; - pickup pencircle scaled med; - draw z1--z2; draw z3--z4; - labels (1,2,3,4); -enddef; - -beginchar(16, 3nhw#, 0, 0);" small grid"; - tabulatur (108/25nhh); -endchar; - -beginchar(17, 3/2nhw#, 0, 0); " small dot"; - fill fullcircle scaled .54nhh shifted (w,-.36nhh); -endchar; - -beginchar(18, 3nhw#, 0, 0); " small bar"; - fill unitsquare xscaled w yscaled .24nhh shifted (0,-.48nhh); -endchar; - -beginchar(19, 3/5nhw#, 0, 0); " small circle"; - Circle (.72nhh); -endchar; - -beginchar(20, 3/5nhw#, 0, 0); " small cross"; - Cross (.72nhh); -endchar; - -% the next seems to be senseless, but it isn't - -beginchar(28, 3/5nhw#, 0, 0); " small blank"; -endchar; - -%%%%%%% -message (""); -%%%%%%% - -hooklength:=4.5pt; - -beginchar(21, 0, 0, 0);" bracket hook up"; - pickup line_pen; - draw origin--(0, hooklength); -endchar; - -beginchar(22, 0, 0, 0);" bracket hook down"; - pickup line_pen; - draw origin--(0, -hooklength); -endchar; - -beginchar(23, nhw#, 0, 0);" upper octaveline"; - pickup line_pen; - draw (.33w, 1.1nhw)--(.66w, 1.1nhw); -endchar; - -beginchar(24, 0, 0, 0);" final hook for upper octaveline"; - pickup line_pen; - draw (1.1nhw,0)--(1.1nhw, 1.1nhw); - draw (.33nhw, 1.1nhw)--(1.1nhw, 1.1nhw); -endchar; - -beginchar(25, nhw#, 0, 0);" lower octaveline"; - pickup line_pen; - draw (.33w, 0)--(.66w, 0); -endchar; - -beginchar(26, 0, 0, 0);" final hook for lower octaveline"; - pickup line_pen; - draw (1.1nhw,0)--(1.1nhw, 1.1nhw); - draw (.33nhw,0)--(1.1nhw, 0); -endchar; - -beginchar(27, .75nhw#, 0, 0);" used for \bracket"; - pickup line_pen; - draw origin--(.5nhw, 0); -endchar; - -beginchar(29, qqw#, 0, 0);" line ydim 0pt"; - pickup line_pen; - draw origin--(w,0); -endchar; - -% lines length xdim 10pt, ydim (-).25 to (-)5pt - -for j=1 upto 20: - beginchar(29+j, qqw#, 0, 0); " line ydim "&decimal .25j&"pt"; - pickup line_pen; - draw origin--(w, .25pt*j); - save_pic:= currentpicture; - endchar; - - beginchar(49+j, qqw#, 0, 0); " line ydim -"&decimal .25j&"pt"; - currentpicture:= save_pic reflectedabout (origin, right); - endchar; -endfor; - -%%%%%%% -message (""); -%%%%%%% - -for n:=1 upto 14: - beginchar(70+n-1, 0, 0, 0); - " fullcircle diameter "&decimal ((n+2)*2)&" pt"; - diameter:=(n+2)*2pt; - pickup line_pen; - draw fullcircle scaled diameter; - endchar; -endfor; - -%%%%%%% -message ("<(de-)crescendi>"); -%%%%%%% - -widthstep:=nhw; -crescendowidth:=.5nhh; % \Internote - -for n:=1 upto 32: - beginchar(84+n-1, 0, 3pt#, 3pt#); - " crescendo length "&decimal n&" noteheadwidths"; - pickup line_pen; - draw (n*widthstep, crescendowidth+.0075n*crescendowidth)--(0,0); - addto currentpicture also currentpicture reflectedabout (origin,right); - save_pic:= currentpicture; - endchar; - - beginchar(116+n-1, 0, 3pt#, 3pt#); - " decrescendo length "&decimal n&" noteheadwidths"; - currentpicture:= save_pic reflectedabout(origin, up) shifted (n*widthstep,0); - endchar; -endfor; - -%%%%%%% -message (""); -%%%%%%% - -% lastbrace is adjustable (originally 99) - -firstbrace:=20; % smallest brace is 2*20 pt (\simeq 14mm) -lastbrace:=67+48; % largest brace is 2*67 pt (\simeq 47mm) - -%%% from Stanislav Kneifl - -def drawpianobracket (expr height) = - u# := 1nhh#/5pt# * 1pt#; - v# := (height/40) * 1pt#; - define_pixels (u, v); -% beginchar (height-firstbrace, 1.25nhh#, 0, 0); - beginchar (height-firstbrace+148, 0, 0, 0); - z1 = origin; - z2 = (4.7u, 7v); - z3 = (3.6u, 16.5v); - z4 = (1.9u, 25v); - z5 = (2.28u, 32v); - z6 = (w, 40v); - penpos1 (max(1,0.1u), 125); - penpos2 (1.2u, 180); - penpos3 (3.2u, 195); - penpos4 (2.5u, 180); - penpos5 (1.14u, 180); - penpos6 (max(2,0.3u), 150); - penstroke z1e{dir 35}..z2e..z3e..z4e..z5e..{dir 60}z6e; - currenttransform := identity reflectedabout ((0,0),(1,0)); - penstroke z1e{dir 35}..z2e..z3e..z4e..z5e..{dir 60}z6e; - currenttransform := identity; -% inserted - currentpicture:=currentpicture shifted (round(-1.75nhh), 0); -% - endchar; -enddef; - -def bigbrace(expr v) = - beginchar (v-firstbrace+148, 0, 0, 0); - " brace vsize "&decimal round(2v*pt#)&"pt"; - vwidth:=v*pt; - hwidth:=max(.1vwidth,3.25pt); - hwidth:=min(hwidth,6.5pt); - actwidth:=.035vwidth; - x1=.25nhw; y1=vwidth; - x2l=-.8hwidth; y2=2/3vwidth; - x3r=.2hwidth; y3=1/3vwidth; - x4=-hwidth; y4=0; - penpos1(max(1,.25pt),-35); - penpos2(1.5med+actwidth,40); - penpos3(1.75med+actwidth,45); - penpos4(max(1,.2pt),-90); - penstroke z1e..z2e..z3e..{left+sw}z4e; - currentpen:= pencircle; draw z1..z2..z3..{left+sw}z4; - addto currentpicture also currentpicture reflectedabout (origin, right); - penlabels(1,2,3,4); - currentpicture:= currentpicture shifted (round(-.75nhh), 0); - endchar; -enddef; - -%!!! comment the line 'bigbrace' and uncomment the line 'drawpianobracket' - -for v=firstbrace upto lastbrace : - bigbrace (v); -% drawpianobracket (v); -endfor; - -end diff --git a/mf/xdrawsl.mf b/mf/xdrawsl.mf deleted file mode 100644 index fe8c5ec0b8..0000000000 --- a/mf/xdrawsl.mf +++ /dev/null @@ -1,39 +0,0 @@ -%(c) - -min_bow:= .5nhh; -max_bow:= 1.5nhh; -slope:=17.5/100; - -code=-1; - -for iht=1 upto 8: - for iwd=0 upto 15: - beginchar(incr code, 0, 0, 0); - mw#:=(minwidth+iwd*delwidth)*pt#; - define_pixels(mw); - x1 = y1= 0; x3= mw; y3= 2y2'= iht*delheight; x2'= .5x3; - mheight:=y3; - z2-z2'= whatever*dir(angle(z3-z1)+90); - my_bow:=min(max_bow, slope*mw); - my_bow:=max(my_bow, min_bow); - z1'=(z1-(0,my_bow)) rotated angle(z3-z1); - (z1'-z2)=whatever*(z1-z2'); - penpos1(.15thick,(angle(z3-z1)+90)); - penpos2(thick,(angle(z3-z1)+90)); - penpos3(.15thick,(angle(z3-z1)+90)); - penstroke (flex(z1e,z2e,z3e)); -%{{{ - currentpen:= pencircle; - draw (flex(z1,z2,z3));% draw z1--z3; draw z2'--z2--z1'--z1; -%}}} - currentpicture:=currentpicture t; - p:=currentpicture; - endchar; - - beginchar(code+128, 0, 0, 0); - currentpicture:=p T; - endchar; - - endfor -endfor -end diff --git a/mf/xdrawzl.mf b/mf/xdrawzl.mf deleted file mode 100644 index 50ef6cfd6f..0000000000 --- a/mf/xdrawzl.mf +++ /dev/null @@ -1,25 +0,0 @@ -%(c) - -min_bow:= .4nhh; -max_bow:= 1.75nhh; -slope:= 10/100; - -code=-1; - -for i=1 upto numslurs: - beginchar(incr code, 0, 0, 0); - mw:=(minwidth+code*delwidth)*pt; - x3= -x1= .5mw; x2= y1= y3 = 0; - y2= max(min_bow, slope*mw); - y2:= min(y2, max_bow); - penpos1(.15thick,90); penpos2(thick,90); penpos3(.15thick,90); - penstroke (flex(z1e,z2e,z3e)); - currentpen:= pencircle; draw (flex(z1,z2,z3)); - p:=currentpicture; - endchar; - - beginchar(code+54, 0, 0, 0); - currentpicture:=p reflectedabout (origin, right); - endchar; -endfor -end diff --git a/mf/xgreg11.mf b/mf/xgreg11.mf deleted file mode 100644 index e5f3dc4b4c..0000000000 --- a/mf/xgreg11.mf +++ /dev/null @@ -1,10 +0,0 @@ - -font_identifier:="xgreg11"; - -mode_setup; - -font_size 10.24pt#; - -nhh#:=2.56pt#; - -input xgreggen diff --git a/mf/xgreg13.mf b/mf/xgreg13.mf deleted file mode 100644 index 49a78be6e7..0000000000 --- a/mf/xgreg13.mf +++ /dev/null @@ -1,10 +0,0 @@ - -font_identifier:="xgreg13"; - -mode_setup; - -font_size 12.8pt#; - -nhh#:=3.2pt#; - -input xgreggen diff --git a/mf/xgreg16.mf b/mf/xgreg16.mf deleted file mode 100644 index bc5d554686..0000000000 --- a/mf/xgreg16.mf +++ /dev/null @@ -1,10 +0,0 @@ - -font_identifier:="xgreg16"; - -mode_setup; - -font_size 16pt#; - -nhh#:=4pt#; - -input xgreggen diff --git a/mf/xgreg20.mf b/mf/xgreg20.mf deleted file mode 100644 index f0ba509ead..0000000000 --- a/mf/xgreg20.mf +++ /dev/null @@ -1,10 +0,0 @@ - -font_identifier:="xgreg20"; - -mode_setup; - -font_size 20pt#; -nhh#:=5pt#; - - -input xgreggen diff --git a/mf/xgreg24.mf b/mf/xgreg24.mf deleted file mode 100644 index 9f4dbfbd9b..0000000000 --- a/mf/xgreg24.mf +++ /dev/null @@ -1,10 +0,0 @@ - -font_identifier:="xgreg24"; - -mode_setup; - -font_size 24pt#; - -nhh#:=6pt#; - -input xgreggen diff --git a/mf/xgreg25.mf b/mf/xgreg25.mf deleted file mode 100644 index 529c7ec7ad..0000000000 --- a/mf/xgreg25.mf +++ /dev/null @@ -1,28 +0,0 @@ - -font_identifier:="musix25"; - -mode_setup; - -font_size 25pt#; - -nhh#:=6.25pt#; -nhw#:=7.5pt#; -gregwidth#:=0.5*sqrt(2)*nhw#; - -thin#:=1/50designsize; -med#:=1/33designsize; -thick#:=1/16designsize; - -thinwidth := 0.15pt; -beamht#:=0.48nhh#; - -define_pixels(nhh,nhw,beamht,gregwidth); -define_blacker_pixels(thin,med,thick); - -pair ne,se,sw,nw; %northeast,southeast,southwest,northwest -ne = up+right; se = down+right; sw = down+left; nw = up+left; - -font_x_height nhh#; -font_quad nhw#; - -input musixgen diff --git a/mf/xgreg29.mf b/mf/xgreg29.mf deleted file mode 100644 index 3a2293e7d4..0000000000 --- a/mf/xgreg29.mf +++ /dev/null @@ -1,10 +0,0 @@ - -font_identifier:="xgreg29"; - -mode_setup; - -font_size 29pt#; - -nhh#:=7.2pt#; - -input xgreggen diff --git a/mf/xgreggen.mf b/mf/xgreggen.mf deleted file mode 100644 index 43f14ec162..0000000000 --- a/mf/xgreggen.mf +++ /dev/null @@ -1,351 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% this is xgreggen.mf (c) -% -% Version T.67 [January 97] -% - -nhw#:=1.2*nhh#; - -thin#:=1/50designsize; -med#:=1/33designsize; -thick#:=1/16designsize; - -thinwidth := 0.125pt; -beamht#:=0.48nhh#; -%gregwidth#:=0.5*sqrt(2)*nhh#; -gregwidth#:=0.6*nhh#; -smallgreg:=0.5; - -define_pixels(nhh,nhw,beamht,gregwidth); -define_blacker_pixels(thin,med,thick); - -pair ne,se,sw,nw; %northeast,southeast,southwest,northwest -ne = up+right; se = down+right; sw = down+left; nw = up+left; - -font_x_height nhh#; -font_quad nhw#; - -pair pone, ptwo; -transform t; -path p; - -hlthick=.2pt; -lthick=.4pt; - -greglangle:=18; gregrlangle:=180+greglangle; -greguangle:=26; gregruangle:=180+greguangle; -orisuangle:=40; orisruangle:=180+orisuangle; - -diamwidth:=.96 gregwidth; greg_min_diam:=gregwidth-diamwidth; -diamheight:=1.33 gregwidth; -deminutae:=0.66; gregwidth_dem:=gregwidth*deminutae; -aucta_fact:=0.33gregwidth; -shave:=.3gregwidth; - -pen line_pen, med_pen, coda_pen, thin_pen; -med_pen:= pencircle scaled med; -line_pen:= pencircle scaled lthick; -coda_pen:= pencircle xscaled 1.25thick yscaled max(1,.75med); -thin_pen:= pencircle scaled max(1,.25pt); - -picture save_pic, elem_pic; - -%%%%%%%%%%%%%%% -% basic def's % -%%%%%%%%%%%%%%% - -def savepic = save_pic:= currentpicture enddef; -def save_elempic = elem_pic:= currentpicture enddef; -def callpic = currentpicture:= save_pic enddef; - -def mirror (expr pone, ptwo) = - currentpicture:=currentpicture reflectedabout(round(pone),round(ptwo)) -enddef; - -def add_mirror (expr pone, ptwo) = - addto currentpicture also currentpicture - reflectedabout (round(pone), round(ptwo)) -enddef; - -def call_mirror (expr pone, ptwo) = callpic; mirror (pone, ptwo) enddef; - -def add_shift (expr pone, ptwo) = - addto currentpicture also currentpicture shifted (pone, ptwo) -enddef; - -def call_add_shift (expr pone, ptwo) = - callpic; add_shift (pone, ptwo) -enddef; - -def add_elempic (expr pone, ptwo) = - addto currentpicture also elem_pic shifted (pone, ptwo) -enddef; - -def call_add_save_elempic (expr pone, ptwo) = - callpic; add_elempic(pone, ptwo); savepic -enddef; - -def shift_pic (expr pone, ptwo) = - currentpicture:=currentpicture shifted (round(pone),round(ptwo)) -enddef; - -def fill_circle (expr diameter, zshift) = - fill fullcircle scaled diameter shifted zshift -enddef; - -def fill_square (expr xwidth, ywidth, zshift) = - fill unitsquare xscaled xwidth yscaled ywidth shifted zshift -enddef; - -% - -% eobasicdefs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -%%%%%%% -message (""); -%%%%%%% - -NHW=nhw+hlthick; - -beginchar(0, gregwidth#, .5nhh#, .5nhh#); "dummy square"; -endchar; - -beginchar(18, smallgreg*gregwidth#, .5nhh#, .5nhh#); "small dummy square"; -endchar; - - -beginchar(1, 0, .5nhh#, .5nhh#); "filled diamond"; - x1:=0.5greg_min_diam+hlthick; x3=gregwidth-x1; x2=x4=0.5gregwidth; - y1=y3=0; y2=-y4=0.5diamheight; - pickup pencircle scaled lthick; - fill z1--z2--z3--z4--cycle; - draw z1--z2--z3--z4--cycle; - penlabels (1,2,3,4); -endchar; - -beginchar(2, 0, .5nhh#, .5nhh#); "filled diamond aucta"; - x1:=0.5greg_min_diam+hlthick; x3=gregwidth-x1; x2=x4=0.5gregwidth; - y1=y3=0; y2=-y4=0.5diamheight; - x5=x1+hlthick; y5=1.5y4; - pickup pencircle scaled lthick; - fill z1--z2--z3{sw+down}..{left+0.3up}z5--z5{right}..z4--cycle; - draw z1--z2--z3{sw+down}..{left+0.3up}z5--z5{right}..z4--cycle; - penlabels (1,2,3,4,5); -endchar; - -beginchar(3, 0, .5nhh#, .5nhh#); "apostropha"; - x1:=0.5greg_min_diam+hlthick; x3=gregwidth-x1; x2=x4+0.1gregwidth=0.5gregwidth; - y1=y3=0; y2=0.5gregwidth+0.5greg_min_diam-hlthick; - y4=-y2-0.2gregwidth; - pickup pencircle scaled lthick; - fill z1--z2--z3{left+1.5down}..{left+0.6down}z4--z4{right+2up}..{left+0.1up}cycle; - draw z1--z2--z3{left+1.5down}..{left+0.6down}z4--z4{right+2up}..{left+0.1up}cycle; - penlabels (1,2,3,4); -endchar; - -beginchar(4, 0, .5nhh#, .5nhh#); "filled diamond deminutae"; - x1:=0.5greg_min_diam*deminutae+hlthick; - x3=gregwidth_dem-x1; x2=x4=0.5gregwidth_dem; - y1=y3=0; y2=-y4=0.5diamheight*deminutae; - pickup pencircle scaled lthick; - fill z1--z2--z3--z4--cycle; - draw z1--z2--z3--z4--cycle; - penlabels (1,2,3,4); -endchar; - -beginchar(5, 0, .5nhh#, .5nhh#); "gregorian punctum"; - x1=x4=hlthick; x2=x3=gregwidth+hlthick; y1=y2=-y3=-y4=.5gregwidth-hlthick; - pickup pencircle scaled lthick; - fill z1{dir greguangle}..z2--z3..{dir gregrlangle}z4--cycle; - draw z1{dir greguangle}..z2--z3..{dir gregrlangle}z4--cycle; - shift_pic(0,-hlthick); - savepic; - penlabels (1,2,3,4); -endchar; - -beginchar(13, 0, .5nhh#, .5nhh#); "mirrored gregorian punctum"; - callpic; - mirror(origin, right); -endchar; - -beginchar(6, 0, .5nhh#, .5nhh#); "gregorian virga left"; - callpic; - fill_square (lthick, 1.5nhh,(0, -1.5nhh)); -endchar; - -beginchar(7, 0, .5nhh#, .5nhh#); "gregorian virga right"; - callpic; - fill_square (lthick, 1.5nhh,(gregwidth, -1.5nhh)); -endchar; - -beginchar(8, 0, .5nhh#, .5nhh#); "gregorian punctum aucta down"; - x1=x4=hlthick; x2=x3=gregwidth+hlthick; - y1=y2+aucta_fact=-y3-aucta_fact=-y4=.5gregwidth-hlthick; - pickup pencircle scaled lthick; - fill z1{dir greguangle}..z2--z3..{dir gregrlangle}z4--cycle; - draw z1{dir greguangle}..z2--z3..{dir gregrlangle}z4--cycle; - shift_pic(0,-hlthick); - savepic; - penlabels (1,2,3,4); -endchar; - -beginchar(9, 0, .5nhh#, .5nhh#); "gregorian punctum aucta up"; -callpic; -mirror(origin,right); -endchar; - -beginchar(10, 0, .5nhh#, .5nhh#); "oriscus"; - x1=x4=hlthick; x2=x3=gregwidth+hlthick; y1=y2=-y3=-y4=.5gregwidth-hlthick; - pickup pencircle scaled lthick; - fill z1{dir orisuangle}..{dir orisuangle}z2--z3{dir orisruangle}..{dir orisruangle}z4--cycle; - draw z1{dir orisuangle}..{dir orisuangle}z2--z3{dir orisruangle}..{dir orisruangle}z4--cycle; - penlabels (1,2,3,4); -endchar; - -beginchar(11, 0, .5nhh#, .5nhh#); "apostropha aucta"; - x1:=0.5greg_min_diam+hlthick; x3=gregwidth-x1; x2=x4=0.5gregwidth; - y1=y3=0; y2=0.5gregwidth+0.5greg_min_diam-hlthick; - y4=-y2-0.2gregwidth; y5=y4; x5=x1; - pickup pencircle scaled lthick; - fill z1--z2--z3{left+1.5down}..{left+0.6down}z4..z5--z5{right}..{left+0.1up}cycle; - draw z1--z2--z3{left+1.5down}..{left+0.6down}z4..z5--z5{right}..{left+0.1up}cycle; - penlabels (1,2,3,4,5); -endchar; - -beginchar(12, 0, .5nhh#, .5nhh#); "small gregorian punctum"; - x1=x4=hlthick; x2=x3=smallgreg*gregwidth+hlthick; - y1=y2=-y3=-y4=.5smallgreg*gregwidth-hlthick; - pickup pencircle scaled lthick; - fill z1{dir greguangle}..z2--z3..{dir gregrlangle}z4--cycle; - draw z1{dir greguangle}..z2--z3..{dir gregrlangle}z4--cycle; - shift_pic(0,-hlthick); - savepic; -endchar; - -beginchar(14, 0, .5nhh#, .5nhh#); "mirrored small gregorian punctum"; - callpic; - mirror(origin, right); -endchar; - -beginchar(15, gregwidth#, .5nhh#, .5nhh#); "podatus bottom"; - fill_square(gregwidth+lthick, gregwidth, (0, -0.5gregwidth)); -endchar; - -beginchar(16, gregwidth#, .5nhh#, .5nhh#); "small podatus bottom"; - fill_square(gregwidth+lthick, gregwidth-shave, (0, -0.5gregwidth)); -endchar; - -beginchar(17, 0, .5nhh#, .5nhh#); "gregorian punctum shaved bottom"; - x1=x4=hlthick; x2=x3=gregwidth+hlthick; y1=y2=-y3+shave=-y4+shave=.5gregwidth-hlthick; - pickup pencircle scaled lthick; - fill z1{dir greguangle}..z2--z3..{dir gregrlangle}z4--cycle; - draw z1{dir greguangle}..z2--z3..{dir gregrlangle}z4--cycle; - shift_pic(0,-hlthick); - savepic; - penlabels (1,2,3,4); -endchar; - -def square (expr mw)= - fill_square (sqrt(2)*.5mw, max(1,thin), origin) rotated -45; - fill_square (sqrt(2)*.5mw, .15nhw, (0,-.15nhw)) rotated 45; - save_elempic; - mirror (origin,up); - mirror (origin,left); - shift_pic (mw+.5,0); - add_elempic(0,0); -% mirror (origin,right);% I've seen this too, somewhere ... -enddef; - -beginchar(118, 0, .5nhh#, .5nhh#); "deep porrectus"; - x1=x4=0; x2=x3=3*gregwidth+lthick; - y1=-y4=.5gregwidth-lthick; y2=y1-2nhh; y3=y4-2nhh; - z5=z1+(0,0.3gregwidth); - fill z5..{right+0.4down}z2--z3{left+0.4up}..z4--cycle; shift_pic(0,hlthick); - fill_square (med, 1.5nhh,(0, -2nhh)); - penlabels (1,2,3,4,5); -endchar; - -beginchar(119, 0, .5nhh#, .5nhh#); "low porrectus"; - x1=x4=0; x2=x3=3*gregwidth+lthick; - y1=-y4=.5gregwidth-lthick; y2=y1-1.5nhh; y3=y4-1.5nhh; - z5=z1+(0,0.2gregwidth); - fill z1..{right+0.4down}z2--z3{left+0.4up}..z4--cycle; shift_pic(0,hlthick); - fill_square (med, 1.5nhh,(0, -2nhh)); - penlabels (1,2,3,4,5); -endchar; - -beginchar(120, 0, .5nhh#, .5nhh#); "porrectus"; - x1=x4=0; x2=x3=3*gregwidth+lthick; - y1=-y4=.5gregwidth-lthick; y2=y1-nhh; y3=y4-nhh; - z5=z1+(0,0.1gregwidth); - fill z5..{right}z2--z3{left}..z4--cycle; shift_pic(0,hlthick); - fill_square (med, 1.5nhh,(0, -1.5nhh)); - penlabels (1,2,3,4,5); -endchar; - -beginchar(121, 0, .5nhh#, .5nhh#); "soft porrectus"; - x1=x4=0; x2=x3=3*gregwidth+lthick; - y1=-y4=.5gregwidth-lthick; y2=y1-0.5nhh; y3=y4-0.5nhh; - z5=z1+(0,0.1gregwidth); - fill z5..{right}z2--z3{left}..z4--cycle; shift_pic(0,hlthick); - fill_square (med, 1.5nhh,(0, -1.5nhh)); - penlabels (1,2,3,4,5); -endchar; - -def quilisma(expr ymidtop, ymidbot) = - ydiff:=0.15gregwidth; - qdecalage:=.2*gregwidth; - ydepth:=0.25gregwidth; - x1=x14=-qdecalage+hlthick; - x7=x8=gregwidth+hlthick; - y1+ydiff-0.5ydepth=ymidtop=y7-ydiff-0.5ydepth; - y14+ydiff-0.5ydepth=ymidbot=y8-ydiff-0.5ydepth; - 3x3=2x1+x7; 3x5=x1+2x7; - 3y3=2y1+y7; 3y5=y1+2y7; - 2x2=x1+x3; 2x4=x3+x5; 2x6=x5+x7; - 2y2=y1+y3-2ydepth; 2y4=y3+y5-2ydepth; 2y6=y5+y7-2ydepth; - 3x12=2x14+x8; 3x10=x14+2x8; - 3y12=2y14+y8; 3y10=y14+2y8; - 2x13=x14+x12; 2x11=x12+x10; 2x9=x10+x8; - 2y13=y14+y12-2ydepth; 2y11=y12+y10-2ydepth; 2y9=y10+y8-2ydepth; - - pickup line_pen; - - - draw z1{down+0.1right}..z2..z3..z4..z5..z6..{up+0.1right}z7--z8{down}..z9..z10..z11..z12..z13..{up+0.1left}z14--cycle; - fill z1{down+0.1right}..z2..z3..z4..z5..z6..{up+0.1right}z7--z8{down}..z9..z10..z11..z12..z13..{up+0.1left}z14--cycle; - shift_pic(0,-hlthick); -enddef; - -beginchar(125, 0, .5nhh#, .5nhh#); "quilisma"; - quilisma(0.5gregwidth-hlthick, -0.5gregwidth+hlthick); -endchar; - -beginchar(126, 0, .5nhh#, .5nhh#); "bottom quilisma"; - quilisma(0.5gregwidth-hlthick-0.8shave, -0.5gregwidth+hlthick); -endchar; - -%%%%%%% -message (""); -%%%%%%% -keygregwidth:=0.5*sqrt(2)*nhw; - -beginchar(98, 8/3nhw#, 3.25nhh#, 0); "gregorian C clef"; - x1=x4=0; x2=x3=keygregwidth; y1=y2=-y3=-y4=.5keygregwidth-lthick; - fill z1{dir 15}..z2--z3{dir 165}..z4--cycle; - save_elempic; - pickup med_pen; draw bot rt z1..{down}(-.01nhw,-.5nhh); - shift_pic(nhw,2.5nhh); - add_mirror ((0,2nhh),(1,2nhh)); - savepic; - shift_pic (0,-2nhh); -endchar; - -beginchar(122, 8/3nhw#, 4.25nhh#, 0); "gregorian F clef"; - callpic; - add_elempic (.1nhw+0.5med,2nhh); - fill_square (med, 1.5nhh, (.75nhw,.8nhh)); - shift_pic (1/3nhw,-2nhh); -endchar; - -end diff --git a/mf/xhsld16.mf b/mf/xhsld16.mf deleted file mode 100644 index 5c719988e7..0000000000 --- a/mf/xhsld16.mf +++ /dev/null @@ -1,37 +0,0 @@ -font_identifier:="xhsld16"; -mode_setup; -font_size 16pt#; -thick#:=1pt#; -stepwidth#:=1/8designsize;% -> \internote -define_pixels(stepwidth); -define_blacker_pixels(thick); -picture save_pic; -numheights:=16; -numlengths:=8;%(20-90pt) - -code=-1; -for j=1 upto numlengths: - slength#:=(j+1)*10pt#; - define_pixels(slength); - - for i=1 upto numheights: - beginchar(incr code, slength#, 0, 0); - x1=y1=0;x3=slength;y3=2y1'= i*stepwidth; - x1'=.5x3;z3'-z1'=whatever*dir(angle(z3-z1)+90); - if x3> y3:y3'=0;else:x3'=slength;fi - z2=.5[z3',z1']; - penpos1(thick,90); - penpos2(2/3thick,(angle(z3-z1)+90)); - penpos3(.15thick,(angle(z3-z1)+90)); - penstroke z1e..z2e..z3e; - pickup pencircle; draw z1..z2..z3;% draw z1--z3; draw z1'--z3'; - save_pic:=currentpicture; - endchar; - - beginchar(128+code, slength#, 0, 0); - currentpicture:=save_pic reflectedabout((.5slength,0),(.5slength, 1)); - endchar; - endfor - -endfor -end diff --git a/mf/xhsld20.mf b/mf/xhsld20.mf deleted file mode 100644 index e91a7902a0..0000000000 --- a/mf/xhsld20.mf +++ /dev/null @@ -1,37 +0,0 @@ -font_identifier:="xhsld20"; -mode_setup; -font_size 20pt#; -thick#:=1pt#; -stepwidth#:=1/8designsize;% -> \internote -define_pixels(stepwidth); -define_blacker_pixels(thick); -picture save_pic; -numheights:=16; -numlengths:=8;%(20-90pt) - -code=-1; -for j=1 upto numlengths: - slength#:=(j+1)*10pt#; - define_pixels(slength); - - for i=1 upto numheights: - beginchar(incr code, slength#, 0, 0); - x1=y1=0;x3=slength;y3=2y1'= i*stepwidth; - x1'=.5x3;z3'-z1'=whatever*dir(angle(z3-z1)+90); - if x3> y3:y3'=0;else:x3'=slength;fi - z2=.5[z3',z1']; - penpos1(thick,90); - penpos2(2/3thick,(angle(z3-z1)+90)); - penpos3(.15thick,(angle(z3-z1)+90)); - penstroke z1e..z2e..z3e; - pickup pencircle; draw z1..z2..z3;% draw z1--z3; draw z1'--z3'; - save_pic:=currentpicture; - endchar; - - beginchar(128+code, slength#, 0, 0); - currentpicture:=save_pic reflectedabout((.5slength,0),(.5slength, 1)); - endchar; - endfor - -endfor -end diff --git a/mf/xhslu16.mf b/mf/xhslu16.mf deleted file mode 100644 index b2e3e7d6b0..0000000000 --- a/mf/xhslu16.mf +++ /dev/null @@ -1,37 +0,0 @@ -font_identifier:="xhslu16"; -mode_setup; -font_size 16pt#; -thick#:=1pt#; -stepwidth#:=1/8designsize;% -> \internote -define_pixels(stepwidth); -define_blacker_pixels(thick); -picture save_pic; -numheights:=16; -numlengths:=8;%(20-90pt) - -code=-1; -for j=1 upto numlengths: - slength#:=(j+1)*10pt#; - define_pixels(slength); - - for i=1 upto numheights: - beginchar(incr code, slength#, 0, 0); - x1=y1=0;x3=slength;y3=2y1'=-i*stepwidth; - x1'=.5x3;z3'-z1'=whatever*dir(angle(z3-z1)+90); - if x3>-y3:y3'=0;else:x3'=slength;fi - z2=.5[z3',z1']; - penpos1(thick,90); - penpos2(2/3thick,(angle(z3-z1)+90)); - penpos3(.15thick,(angle(z3-z1)+90)); - penstroke z1e..z2e..z3e; - pickup pencircle; draw z1..z2..z3;% draw z1--z3; draw z1'--z3'; - save_pic:=currentpicture; - endchar; - - beginchar(128+code, slength#, 0, 0); - currentpicture:=save_pic reflectedabout((.5slength,0),(.5slength, 1)); - endchar; - endfor - -endfor -end diff --git a/mf/xhslu20.mf b/mf/xhslu20.mf deleted file mode 100644 index d41801dd5c..0000000000 --- a/mf/xhslu20.mf +++ /dev/null @@ -1,37 +0,0 @@ -font_identifier:="xhslu20"; -mode_setup; -font_size 20pt#; -thick#:=1pt#; -stepwidth#:=1/8designsize;% -> \internote -define_pixels(stepwidth); -define_blacker_pixels(thick); -picture save_pic; -numheights:=16; -numlengths:=8;%(20-90pt) - -code=-1; -for j=1 upto numlengths: - slength#:=(j+1)*10pt#; - define_pixels(slength); - - for i=1 upto numheights: - beginchar(incr code, slength#, 0, 0); - x1=y1=0;x3=slength;y3=2y1'=-i*stepwidth; - x1'=.5x3;z3'-z1'=whatever*dir(angle(z3-z1)+90); - if x3>-y3:y3'=0;else:x3'=slength;fi - z2=.5[z3',z1']; - penpos1(thick,90); - penpos2(2/3thick,(angle(z3-z1)+90)); - penpos3(.15thick,(angle(z3-z1)+90)); - penstroke z1e..z2e..z3e; - pickup pencircle; draw z1..z2..z3;% draw z1--z3; draw z1'--z3'; - save_pic:=currentpicture; - endchar; - - beginchar(128+code, slength#, 0, 0); - currentpicture:=save_pic reflectedabout((.5slength,0),(.5slength, 1)); - endchar; - endfor - -endfor -end diff --git a/mf/xsld11.mf b/mf/xsld11.mf deleted file mode 100644 index 4b9142ae10..0000000000 --- a/mf/xsld11.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xsld11"; -mode_setup; -font_size 10.24pt#; -thick#:=1pt#; -internote#:=1.28pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= reflectedabout (origin,right) shifted (-.5mw,0) enddef; -def T= rotated 180 shifted (0,-mheight) enddef; - -input xslgen; diff --git a/mf/xsld13.mf b/mf/xsld13.mf deleted file mode 100644 index c612d42a63..0000000000 --- a/mf/xsld13.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xsld13"; -mode_setup; -font_size 12.8pt#; -thick#:=1pt#; -internote#:=1.6pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= reflectedabout (origin,right) shifted (-.5mw,0) enddef; -def T= rotated 180 shifted (0,-mheight) enddef; - -input xslgen; diff --git a/mf/xsld16.mf b/mf/xsld16.mf deleted file mode 100644 index 38720a75ac..0000000000 --- a/mf/xsld16.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xsld16"; -mode_setup; -font_size 16pt#; -thick#:=1pt#; -internote#:=2pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= reflectedabout (origin,right) shifted (-.5mw,0) enddef; -def T= rotated 180 shifted (0,-mheight) enddef; - -input xslgen; diff --git a/mf/xsld20.mf b/mf/xsld20.mf deleted file mode 100644 index c36089fcf9..0000000000 --- a/mf/xsld20.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xsld20"; -mode_setup; -font_size 20pt#; -thick#:=1pt#; -internote#:=2.5pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= reflectedabout (origin,right) shifted (-.5mw,0) enddef; -def T= rotated 180 shifted (0,-mheight) enddef; - -input xslgen; diff --git a/mf/xsld24.mf b/mf/xsld24.mf deleted file mode 100644 index 5a03c91cac..0000000000 --- a/mf/xsld24.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xsld24"; -mode_setup; -font_size 24pt#; -thick#:=1pt#; -internote#:=3pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= reflectedabout (origin,right) shifted (-.5mw,0) enddef; -def T= rotated 180 shifted (0,-mheight) enddef; - -input xslgen; diff --git a/mf/xsld29.mf b/mf/xsld29.mf deleted file mode 100644 index 766cb83ffc..0000000000 --- a/mf/xsld29.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xsld29"; -mode_setup; -font_size 28.8pt#; -thick#:=1pt#; -internote#:=3.6pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= reflectedabout (origin,right) shifted (-.5mw,0) enddef; -def T= rotated 180 shifted (0,-mheight) enddef; - -input xslgen; diff --git a/mf/xslgen.mf b/mf/xslgen.mf deleted file mode 100644 index 8df8742b77..0000000000 --- a/mf/xslgen.mf +++ /dev/null @@ -1,37 +0,0 @@ -min_bow:= internote; -max_bow:=3internote; -slope:=17.5/100; - -code=-1; - -for iht=1 upto 8: - for iwd=0 upto 15: - beginchar(incr code, 0, 0, 0); - mw#:=(minwidth+iwd*delwidth)*pt#; - define_pixels(mw); - x1 = y1= 0; x3= mw; y3= 2y2'= iht*internote; x2'= .5x3; - mheight:=y3; - z2-z2'= whatever*dir(angle(z3-z1)+90); - my_bow:=min(max_bow, slope*mw); - my_bow:=max(my_bow, min_bow); - z1'=(z1-(0,my_bow)) rotated angle(z3-z1); - (z1'-z2)=whatever*(z1-z2'); - penpos1(.15thick,(angle(z3-z1)+90)); - penpos2(thick,(angle(z3-z1)+90)); - penpos3(.15thick,(angle(z3-z1)+90)); - penstroke (flex(z1e,z2e,z3e)); -%{{{ - currentpen:= pencircle; - draw (flex(z1,z2,z3));% draw z1--z3; draw z2'--z2--z1'--z1; -%}}} - currentpicture:=currentpicture t; - p:=currentpicture; - endchar; - - beginchar(code+128, 0, 0, 0); - currentpicture:=p T; - endchar; - - endfor -endfor -end diff --git a/mf/xslhd.mf b/mf/xslhd.mf deleted file mode 100644 index 5ae5fdcdd0..0000000000 --- a/mf/xslhd.mf +++ /dev/null @@ -1,31 +0,0 @@ -thick#:=1pt#; -stepwidth#:=designsize/8; -define_pixels(stepwidth); -define_blacker_pixels(thick); -picture save_pic; -numheights:=16; -numlengths:=8;%(12-96pt) - -code=-1; -for j=1 upto numlengths: - slength#:=j*12pt#; - define_pixels(slength); - - for i=1 upto numheights: - beginchar(incr code, slength#, 0, 0); - x1=y1=0;x2=slength;y2= i*stepwidth; - penpos1(thick,90); - penpos2(max(1,.15thick),min(2angle(z2-z1)+90,180)); - fill z1r{dir(1)}..{dir(min(2angle(z2-z1),90)-1)}z2r-- - z2l{dir(min(2angle(z2-z1)-180,-90))}..z1l{left}--cycle; - save_pic:=currentpicture; - endchar; - - beginchar(128+code, slength#, 0, 0); - currentpicture:=save_pic reflectedabout((.5slength,0),(.5slength, 1)); - endchar; - endfor - -endfor -end - diff --git a/mf/xslhd11.mf b/mf/xslhd11.mf deleted file mode 100644 index 215a47fbee..0000000000 --- a/mf/xslhd11.mf +++ /dev/null @@ -1,5 +0,0 @@ -font_identifier:="xslhd11"; -mode_setup; -font_size 10.24pt#; -input xslhd; - diff --git a/mf/xslhd13.mf b/mf/xslhd13.mf deleted file mode 100644 index 930c0aef58..0000000000 --- a/mf/xslhd13.mf +++ /dev/null @@ -1,4 +0,0 @@ -font_identifier:="xslhd13"; -mode_setup; -font_size 12.8pt#; -input xslhd; diff --git a/mf/xslhd16.mf b/mf/xslhd16.mf deleted file mode 100644 index aacbd5ac1a..0000000000 --- a/mf/xslhd16.mf +++ /dev/null @@ -1,5 +0,0 @@ -font_identifier:="xslhd16"; -mode_setup; -font_size 16pt#; -input xslhd; - diff --git a/mf/xslhd20.mf b/mf/xslhd20.mf deleted file mode 100644 index d0bb66a5d2..0000000000 --- a/mf/xslhd20.mf +++ /dev/null @@ -1,4 +0,0 @@ -font_identifier:="xslhd20"; -mode_setup; -font_size 20pt#; -input xslhd; diff --git a/mf/xslhd24.mf b/mf/xslhd24.mf deleted file mode 100644 index 650eba1aa9..0000000000 --- a/mf/xslhd24.mf +++ /dev/null @@ -1,4 +0,0 @@ -font_identifier:="xslhd24"; -mode_setup; -font_size 24pt#; -input xslhd; diff --git a/mf/xslhd29.mf b/mf/xslhd29.mf deleted file mode 100644 index db52074175..0000000000 --- a/mf/xslhd29.mf +++ /dev/null @@ -1,4 +0,0 @@ -font_identifier:="xslhd24"; -mode_setup; -font_size 28.8pt#; -input xslhd; diff --git a/mf/xslhu.mf b/mf/xslhu.mf deleted file mode 100644 index c52ceacc8f..0000000000 --- a/mf/xslhu.mf +++ /dev/null @@ -1,30 +0,0 @@ -thick#:=1pt#; -stepwidth#:=designsize/8; -define_pixels(stepwidth); -define_blacker_pixels(thick); -picture save_pic; -numheights:=16; -numlengths:=8;%(12-96pt) - -code=-1; -for j=1 upto numlengths: - slength#:=j*12pt#; - define_pixels(slength); - - for i=1 upto numheights: - beginchar(incr code, slength#, 0, 0); - x1=y1=0;x2=slength;y2=-i*stepwidth; - penpos1(thick,90); - penpos2(max(1,.15thick),min(2angle(z2-z1)+90,180)); - fill z1r{dir(1)}..{dir(min(2angle(z2-z1),90)-1)}z2r-- - z2l{dir(min(2angle(z2-z1)-180,-90))}..z1l{left}--cycle; - save_pic:=currentpicture; - endchar; - - beginchar(128+code, slength#, 0, 0); - currentpicture:=save_pic reflectedabout((.5slength,0),(.5slength, 1)); - endchar; - endfor - -endfor -end diff --git a/mf/xslhu11.mf b/mf/xslhu11.mf deleted file mode 100644 index f1b0c69998..0000000000 --- a/mf/xslhu11.mf +++ /dev/null @@ -1,4 +0,0 @@ -font_identifier:="xslhu11"; -mode_setup; -font_size 10.24pt#; -input xslhu.mf diff --git a/mf/xslhu13.mf b/mf/xslhu13.mf deleted file mode 100644 index 162c503770..0000000000 --- a/mf/xslhu13.mf +++ /dev/null @@ -1,4 +0,0 @@ -font_identifier:="xslhu13"; -mode_setup; -font_size 12.8pt#; -input xslhu.mf diff --git a/mf/xslhu16.mf b/mf/xslhu16.mf deleted file mode 100644 index 6cfc184d8e..0000000000 --- a/mf/xslhu16.mf +++ /dev/null @@ -1,5 +0,0 @@ -font_identifier:="xslhu16"; -mode_setup; -font_size 16pt#; -input xslhu.mf - diff --git a/mf/xslhu20.mf b/mf/xslhu20.mf deleted file mode 100644 index 94c6f00d1b..0000000000 --- a/mf/xslhu20.mf +++ /dev/null @@ -1,4 +0,0 @@ -font_identifier:="xslhu20"; -mode_setup; -font_size 20pt#; -input xslhu.mf diff --git a/mf/xslhu24.mf b/mf/xslhu24.mf deleted file mode 100644 index 399813c110..0000000000 --- a/mf/xslhu24.mf +++ /dev/null @@ -1,4 +0,0 @@ -font_identifier:="xslhu24"; -mode_setup; -font_size 24pt#; -input xslhu.mf diff --git a/mf/xslhu29.mf b/mf/xslhu29.mf deleted file mode 100644 index f5155abdc7..0000000000 --- a/mf/xslhu29.mf +++ /dev/null @@ -1,4 +0,0 @@ -font_identifier:="xslhu29"; -mode_setup; -font_size 28.8pt#; -input xslhu.mf diff --git a/mf/xslhz20.mf b/mf/xslhz20.mf deleted file mode 100644 index 23f015dc97..0000000000 --- a/mf/xslhz20.mf +++ /dev/null @@ -1,24 +0,0 @@ -font_identifier:="xslhz20"; -mode_setup; -font_size 20pt#; -thick#:=1pt#; -stepwidth#:=4pt#; -define_pixels(stepwidth); -define_blacker_pixels(thick); -picture pic; - -slope=1/100; - -for i=1 upto 100: - beginchar((i-1),0,0,0); - x3=-x1=.5i*stepwidth; x2=y1=y3=0; y2=slope*i*stepwidth; - penpos1(thick,90); penpos2(thick,90); penpos3(thick,90); - penstroke z1e..z2e..z3e; - pic:= currentpicture; - endchar; - - beginchar((128+i-1),0,0,0); - currentpicture:= pic reflectedabout(origin,right); - endchar; -endfor -end diff --git a/mf/xslu11.mf b/mf/xslu11.mf deleted file mode 100644 index 0a11e6012f..0000000000 --- a/mf/xslu11.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xslu11"; -mode_setup; -font_size 10.24pt#; -thick#:=1pt#; -internote#:=1.28pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= rotated 180 shifted (.5mw, mheight) enddef; -def T= rotated 180 shifted (0,mheight) enddef; - -input xslgen; diff --git a/mf/xslu13.mf b/mf/xslu13.mf deleted file mode 100644 index b9f9fb1720..0000000000 --- a/mf/xslu13.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xslu13"; -mode_setup; -font_size 12.8pt#; -thick#:=1pt#; -internote#:=1.6pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= rotated 180 shifted (.5mw, mheight) enddef; -def T= rotated 180 shifted (0,mheight) enddef; - -input xslgen; diff --git a/mf/xslu16.mf b/mf/xslu16.mf deleted file mode 100644 index 37d07d99ff..0000000000 --- a/mf/xslu16.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xslu16"; -mode_setup; -font_size 16pt#; -thick#:=1pt#; -internote#:=2pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= rotated 180 shifted (.5mw, mheight) enddef; -def T= rotated 180 shifted (0,mheight) enddef; - -input xslgen; diff --git a/mf/xslu20.mf b/mf/xslu20.mf deleted file mode 100644 index 0a741c0f54..0000000000 --- a/mf/xslu20.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xslu20"; -mode_setup; -font_size 20pt#; -thick#:=1pt#; -internote#:=2.5pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= rotated 180 shifted (.5mw, mheight) enddef; -def T= rotated 180 shifted (0,mheight) enddef; - -input xslgen; diff --git a/mf/xslu24.mf b/mf/xslu24.mf deleted file mode 100644 index f7ce9d6561..0000000000 --- a/mf/xslu24.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xslu24"; -mode_setup; -font_size 24pt#; -thick#:=1pt#; -internote#:=3pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= rotated 180 shifted (.5mw, mheight) enddef; -def T= rotated 180 shifted (0,mheight) enddef; - -input xslgen; diff --git a/mf/xslu29.mf b/mf/xslu29.mf deleted file mode 100644 index 68383431b3..0000000000 --- a/mf/xslu29.mf +++ /dev/null @@ -1,20 +0,0 @@ -font_identifier:="xslu29"; -mode_setup; -font_size 28.8pt#; -thick#:=1pt#; -internote#:=3.6pt#; -define_pixels(internote); -define_blacker_pixels(thick); - -minwidth:=8pt#; -delwidth:=4pt#; - -maxwidth:=minwidth+15delwidth; -fontdimen 5: maxwidth; - -picture p; - -def t= rotated 180 shifted (.5mw, mheight) enddef; -def T= rotated 180 shifted (0,mheight) enddef; - -input xslgen; diff --git a/mf/xslz20.mf b/mf/xslz20.mf deleted file mode 100644 index f335e12bcf..0000000000 --- a/mf/xslz20.mf +++ /dev/null @@ -1,42 +0,0 @@ -font_identifier:="xslz20"; -mode_setup; -font_size 20pt#; -thick#:=1pt#; -nhh#:=5pt#; -define_pixels(nhh); -define_blacker_pixels(thick); -minwidth:=8pt#; -delwidth:=4pt#; - -numslurs:=54; -maxwidth:=minwidth+(numslurs-1)*delwidth; - -fontdimen 5: maxwidth; - -picture p; - -min_bow:= .4nhh; -max_bow:= 1.75nhh; -slope:= 10/100; - -code=-1; - -for i=1 upto numslurs: - - beginchar(incr code, 0, 0, 0); - mw:=(minwidth+code*delwidth)*pt; - x3= -x1= .5mw; x2= y1= y3 = 0; - y2= max(min_bow, slope*mw); - y2:= min(y2, max_bow); - penpos1(.15thick,90); penpos2(thick,90); penpos3(.15thick,90); - penstroke (flex(z1e,z2e,z3e)); - currentpen:= pencircle; draw (flex(z1,z2,z3)); - p:=currentpicture; - endchar; - - beginchar(code+54, 0, 0, 0); - currentpicture:=p reflectedabout (origin, right); - endchar; - -endfor -end diff --git a/mf/xtie20.mf b/mf/xtie20.mf deleted file mode 100644 index 99f2454842..0000000000 --- a/mf/xtie20.mf +++ /dev/null @@ -1,24 +0,0 @@ -font_identifier:="xtie20"; -mode_setup; -font_size 20pt#; -thick#:=1pt#; -stepwidth#:=4pt#; -define_pixels(stepwidth); -define_blacker_pixels(thick); -picture pic; - -slope=.009; - -for i=1 upto 100: - beginchar((i-1),0,0,0); - x3=-x1=.5i*stepwidth; x2=y1=y3=0; y2=slope*i*stepwidth; - penpos1(thick,90); penpos2(thick,90); penpos3(thick,90); - penstroke z1e..z2e..z3e; - pic:= currentpicture; - endchar; - - beginchar((128+i-1),0,0,0); - currentpicture:= pic reflectedabout(origin,right); - endchar; -endfor -end diff --git a/mi2mu/midi-event.cc b/mi2mu/midi-event.cc index 4f16fe3c36..0439514987 100644 --- a/mi2mu/midi-event.cc +++ b/mi2mu/midi-event.cc @@ -39,7 +39,7 @@ Midi_key::mudela_str( bool command_mode_bo ) str += String( (char)( ( key_i_ + 2 ) % 7 + 'A' ) ); else // heu, -2: should be - 1 1/2: A -> fis str += String( (char)( ( key_i_ + 2 - 2 ) % 7 + 'a' ) ); - str = String( "% " ) + '"' str + '"' + "; % not supported yet\n"; + str = String( "% " ) + '"' + str + '"' + "; % not supported yet\n"; return str; } diff --git a/tex/dimen.tex b/tex/dimen.tex index 4bfc721865..fb9d6d9d59 100644 --- a/tex/dimen.tex +++ b/tex/dimen.tex @@ -2,7 +2,7 @@ % A tex file to help determine dims. % -\font\musicfont=musix16 +\font\musicfont=musixsps \font\slurfont=xslu16 \font\specfont=musixspx % \def\thefont{\musicfont} diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index d003f860b7..58a4e11029 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -127,28 +127,31 @@ \def\emptybar{} -\def\thinbar#1{\vrule height #1 width 1.6\staffrulethickness} % TODO parametric. -\def\thickbar#1{\vrule height #1 width 2\smallspace} -\def\maatstreep#1{\thinbar{#1}} \def\defaultthinbar{\thinbar{\balkheight}} \def\defaultthickbar{\thickbar{\balkheight}} %? what-s wrong with rightalign? -\def\finishbar#1{\rightalign{\thinbar{#1}\kern\smallspace\thickbar{#1}}} - \def\repeatstopbar{\hss\rightalign{\repeatcolon\hskip2\smallspace\defaultthinbar\hskip\smallspace\defaultthickbar}} \def\repeatstartbar{\hbox{\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}} \def\repeatstopstart{\hbox{\repeatcolon\kern2\smallspace\defaultthinbar\kern\smallspace\defaultthickbar\kern\smallspace\defaultthickbar\kern\smallspace\defaultthinbar\kern2\smallspace\repeatcolon}} -\def\doublebar#1{\hbox{\thinbar{#1}\hskip\smallspace\thinbar{#1}}} %compatibility \def\repeatbar{\repeatstopbar} \def\startrepeat{\repeatstartbar} \def\repeatbarstartrepeat{\repeatstopstart} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % parametric symbols %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\doublebar#1{\hbox{\thinbar{#1}\hskip\smallspace\thinbar{#1}}} +\def\thinbar#1{\vrule height #1 width 1.6\staffrulethickness} % TODO parametric. +\def\thickbar#1{\vrule height #1 width 2\smallspace} +\def\maatstreep#1{\thinbar{#1}} +\def\finishbar#1{\rightalign{\thinbar{#1}\kern\smallspace\thickbar{#1}}} + +\def\pianobrace#1{{\musicdraw\char#1}} \def\slurcharh#1{{\slurhfont\char#1}} \def\slurcharu#1{{\slurufont\char#1}} \def\slurchard#1{{\slurdfont\char#1}} -- 2.39.5